/* ============================================================
   OJL OPS — Modern SOC Dashboard Theme
   Cleaned and optimized version
============================================================ */

/* ------------------------------
   GLOBAL RESET & BASE
--------------------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", Arial, sans-serif;
}

:root {
  --panel-left-width: 360px;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #0a0f15;
  color: #e2e8f0;
}

#app-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* -------------------------------------------------------------
   TOP COMMAND BAR
-------------------------------------------------------------- */

.top-bar {
  height: 56px;
  background: #0c1118;
  border-bottom: 1px solid #1a2431;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: #1e2a3a;
  border-radius: 6px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 64 64' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 14l20-8 20 8v16c0 14-10 24-20 28-10-4-20-14-20-28V14z' stroke='white' stroke-width='7.6'/%3E%3Crect x='20' y='24' width='12' height='12' rx='2' stroke='white' stroke-width='3.8'/%3E%3Cpath d='M40 24v10c0 4-3 6-7 6' stroke='white' stroke-width='3.8' stroke-linecap='round'/%3E%3Cpath d='M30 44h10' stroke='white' stroke-width='3.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 28px;
}

.brand-text .brand-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-text .brand-subtitle {
  font-size: 0.75rem;
  color: #9ca3af;
}

.top-status {
  display: flex;
  align-items: center;
  gap: 22px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  background: #111a25;
  border-radius: 12px;
  border: 1px solid #1f2a36;
  font-size: 0.8rem;
}

.status-light {
  width: 8px;
  height: 8px;
  background: #18c964;
  border-radius: 50%;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.smart-search-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #1f2b3a;
  background: #111824;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.smart-search-btn:hover {
  background: #182234;
  border-color: #334155;
}

.icon-btn {
  padding: 6px 10px;
  border-radius: 4px;
  background: #111824;
  border: 1px solid #1f2b3a;
  cursor: pointer;
  color: #eee;
}

.icon-btn:hover {
  background: #182234;
}

/* -------------------------------------------------------------
   MAIN SURFACE LAYOUT
-------------------------------------------------------------- */

.surface {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* OSINT mode: report-first layout */
body.osint-mode .surface {
  gap: 0;
}

body.osint-mode .panel-left {
  width: 66%;
  min-width: 340px;
  border-right: 1px solid #1a2431;
}

body.osint-mode .map-surface {
  flex: 0 0 34%;
  max-width: 34%;
  min-width: 300px;
  background: #0b111a;
  border-left: 1px solid #1a2431;
}

@media (max-width: 1200px) {
  body.osint-mode .panel-left {
    width: 100%;
  }
  body.osint-mode .map-surface {
    display: none;
  }
  body.osint-mode #alert-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

body.osint-mode .panel-header {
  padding: 10px 12px;
}

body.osint-mode .panel-meta {
  font-size: 0.7rem;
}

body.osint-mode #alert-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  padding: 10px;
}

body.osint-mode .alert-item {
  margin: 0;
  padding: 10px;
}

body.osint-mode .alert-title {
  font-size: 0.88rem;
}

body.osint-mode .alert-summary {
  font-size: 0.74rem;
  max-height: 64px;
  overflow: hidden;
}

body.osint-mode .alert-meta {
  gap: 4px;
  flex-wrap: wrap;
}

body.osint-mode #map {
  height: 100%;
}

body.osint-mode .map-legend {
  right: 16px;
  bottom: 16px;
}

body.osint-mode .map-popout {
  left: auto;
  right: 16px;
  bottom: 16px;
}

body.osint-mode .map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.9rem;
  background: rgba(7, 10, 16, 0.55);
  pointer-events: none;
  text-align: center;
  padding: 20px;
}

body.osint-mode .map-empty.hidden {
  display: none;
}

/* Left Alerts Panel */
.panel-left {
  width: var(--panel-left-width);
  background: #0f151f;
  border-right: 1px solid #1a2431;
  display: flex;
  flex-direction: column;
  position: relative;
  container-type: inline-size;
}

.panel-header {
  padding: 12px;
  border-bottom: 1px solid #1a2431;
  flex: 0 0 auto;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a3443 #0f141b;
}

.panel-title {
  font-size: 1.02rem;
  font-weight: 600;
}

.count-pill {
  display: inline-block;
  padding: 2px 7px;
  font-size: 0.75rem;
  background: #1a2433;
  border-radius: 12px;
  margin-left: 6px;
}

.panel-meta {
  font-size: 0.72rem;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  color: #9aa6b6;
}

.inline-filters {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  grid-column: 1 / -1;
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  background: #0b1118;
  color: #e2e8f0;
  border: 1px solid #1f2b3a;
  border-radius: 4px;
}

.mission-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 6px;
  grid-column: 1 / -1;
}

.timeline-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 1fr));
  gap: 6px;
  grid-column: 2 / -1;
}

.priority-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 1fr));
  gap: 6px;
  grid-column: 2 / -1;
}

.inline-filters label {
  grid-column: 1;
}

.inline-filters select,
.inline-filters .toggle-switch,
.inline-filters .timeline-buttons,
.inline-filters .priority-buttons {
  grid-column: 2 / -1;
}

.inline-filters .toggle-switch {
  justify-content: flex-start;
}

.mission-btn,
.timeline-btn,
.priority-btn {
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.01em;
}

.toggle-switch {
  justify-content: flex-start;
}

.toggle-text {
  min-width: 28px;
  text-align: left;
}

.mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-btn:hover {
  background: rgba(255,255,255,0.08);
}

.empty-state {
  padding: 14px;
  color: rgba(226,226,226,0.75);
  text-align: center;
}

.inline-filters label {
  font-size: 0.75rem;
  color: #9fa7b4;
}

.inline-filters select {
  width: 100%;
  padding: 4px 6px;
  background: #111316;
  color: #e2e2e2;
  border: 1px solid #2a323d;
  border-radius: 4px;
}

/* Alert list area */
.panel-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: #2a3443 #0f141b;
}

.panel-section-resizer {
  height: 6px;
  cursor: row-resize;
  background: linear-gradient(180deg, rgba(31,43,58,0.0), rgba(31,43,58,0.6), rgba(31,43,58,0.0));
}

.panel-section-resizer:hover {
  background: linear-gradient(180deg, rgba(59,130,246,0.0), rgba(59,130,246,0.5), rgba(59,130,246,0.0));
}

.panel-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
}

.panel-body-scroll::-webkit-scrollbar {
  width: 10px;
}

.panel-body-scroll::-webkit-scrollbar-track {
  background: #0f141b;
  border-left: 1px solid #1a2431;
}

.panel-body-scroll::-webkit-scrollbar-thumb {
  background: #2a3443;
  border-radius: 10px;
  border: 2px solid #0f141b;
}

.panel-body-scroll::-webkit-scrollbar-thumb:hover {
  background: #334054;
}

.panel-header::-webkit-scrollbar {
  width: 10px;
}

.panel-header::-webkit-scrollbar-track {
  background: #0f141b;
  border-left: 1px solid #1a2431;
}

.panel-header::-webkit-scrollbar-thumb {
  background: #2a3443;
  border-radius: 10px;
  border: 2px solid #0f141b;
}

.panel-header::-webkit-scrollbar-thumb:hover {
  background: #334054;
}

/* Alert Cards */
.alert-item {
  background: #111316;
  border: 1px solid #2a323d;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 100%;
}

.alert-item:hover {
  background: #1a1d22;
  border-color: #3a4452;
}

.alert-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #ffffff;
}

.alert-summary {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #d2d2d2;
  margin-bottom: 8px;
}

.alert-submeta {
  margin-top: 4px;
  margin-bottom: 6px;
  font-size: 0.72rem;
  color: #8aa0bd;
}

.alert-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.7rem;
}

.tag {
  padding: 2px 6px;
  border-radius: 4px;
  background: #1f2428;
  color: #9ca3af;
}

.tag-type {
  text-transform: capitalize;
}

.tag.sev-high {
  background: #b91c1c;
  color: #fff;
}

.tag.sev-medium {
  background: #d97706;
  color: #fff;
}

.tag.sev-low {
  background: #0284c7;
  color: #fff;
}

.tag.muted {
  background: transparent;
  border: 1px solid #2a323d;
}

.type-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 10px;
  margin-bottom: 6px;
}

.type-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #cbd5f5;
  min-width: 0;
}

@container (max-width: 300px) {
  .type-toggles {
    grid-template-columns: 1fr;
  }
}

.type-toggle input {
  accent-color: #3b82f6;
}

body.theme-light .type-toggle {
  color: #475569;
}

/* -------------------------------------------------------------
   THEME: LIGHT
-------------------------------------------------------------- */

body.theme-light {
  background: #f5f7fb;
  color: #0f172a;
}

body.theme-light .top-bar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .panel-left {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

body.theme-light .panel-header {
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .panel-header {
  scrollbar-color: #cbd5f5 #f1f5f9;
}

body.theme-light .panel-header::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-left-color: #e2e8f0;
}

body.theme-light .panel-header::-webkit-scrollbar-thumb {
  background: #cbd5f5;
  border: 2px solid #f1f5f9;
}

body.theme-light .panel-header::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

body.theme-light .panel-meta {
  color: #64748b;
}

body.theme-light .count-pill {
  background: #e2e8f0;
  color: #0f172a;
}

body.theme-light .search-wrap input {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

body.theme-light .inline-filters label {
  color: #64748b;
}

body.theme-light .inline-filters select {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

body.theme-light .mini-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

body.theme-light .mini-btn:hover {
  background: #e2e8f0;
}

body.theme-light .empty-state {
  color: #64748b;
}

body.theme-light .alert-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

body.theme-light .alert-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.theme-light .alert-title {
  color: #0f172a;
}

body.theme-light .alert-summary {
  color: #475569;
}

body.theme-light .panel-body-scroll {
  scrollbar-color: #cbd5e1 #f8fafc;
}

body.theme-light .panel-body-scroll::-webkit-scrollbar-track {
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
}

body.theme-light .panel-body-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border: 2px solid #f8fafc;
}

body.theme-light .panel-body-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

body.theme-light .icon-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

body.theme-light .icon-btn:hover {
  background: #e2e8f0;
}

body.theme-light .smart-search-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

body.theme-light .smart-search-btn:hover {
  background: #e2e8f0;
}

body.theme-light .tag {
  background: #e2e8f0;
  color: #475569;
}

body.theme-light .tag.muted {
  border: 1px solid #cbd5e1;
}

body.theme-light .map-popout {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}

body.theme-light .popout-title {
  color: #0f172a;
}

body.theme-light .map-legend {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
}


body.theme-light .legend-title {
  color: #64748b;
}

body.theme-light .legend-item span {
  color: #0f172a;
}

body.theme-light .legend-icon {
  border: 1px solid rgba(15, 23, 42, 0.2);
  color: #0f172a;
}

/* -------------------------------------------------------------
   MAP SURFACE
-------------------------------------------------------------- */

.map-surface {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

/* -------------------------------------------------------------
   MAP POPOUT CARD
-------------------------------------------------------------- */

.map-popout {
  position: fixed;
  bottom: 18px;
  left: calc(var(--panel-left-width) + 18px);
  background: #0c1118;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #1f2b3a;
  width: 320px;
  z-index: 9999;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  transform: translateZ(0);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.map-popout.hidden {
  display: none;
}

.focus-shell {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(6px);
}

.focus-shell.hidden {
  display: none;
}

.focus-card {
  width: min(480px, 92vw);
  background: #0c1118;
  border: 1px solid #1f2b3a;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  color: #e2e8f0;
}

.focus-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.focus-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 16px;
}

.focus-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.focus-input {
  flex: 1;
  min-width: 0;
  background: #0b1320;
  border: 1px solid #1f2b3a;
  border-radius: 10px;
  padding: 10px 12px;
  color: #e2e8f0;
  font-size: 0.9rem;
  min-height: 52px;
  resize: none;
  overflow: hidden;
  pointer-events: auto;
}

.focus-input:-webkit-autofill,
.focus-input:-webkit-autofill:hover,
.focus-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e2e8f0;
  box-shadow: 0 0 0px 1000px #0b1320 inset;
  transition: background-color 9999s ease-in-out 0s;
}

.focus-input::-webkit-scrollbar {
  width: 6px;
}

.focus-input::-webkit-scrollbar-track {
  background: transparent;
}

.focus-input::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.focus-input {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.focus-input::-webkit-scrollbar {
  display: none;
}

.focus-btn {
  flex: 0 0 auto;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.focus-btn:hover {
  background: #1d4ed8;
}

.focus-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.focus-btn.ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5f5;
  padding: 8px 14px;
  border-radius: 10px;
}

.focus-btn.ghost:hover {
  background: rgba(148, 163, 184, 0.12);
}

body.theme-light .focus-shell {
  background: rgba(226, 232, 240, 0.85);
}

body.theme-light .focus-card {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}

body.theme-light .focus-input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}


body.theme-light .focus-subtitle {
  color: #64748b;
}

.popout-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #1f2b3a;
  cursor: default;
}

.popout-badge {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 4px;
  flex: 0 0 auto;
  background: #94a3b8;
}

.popout-badge.type-conflict { background: #ef4444; }
.popout-badge.type-geopolitics { background: #3b82f6; }
.popout-badge.type-humanitarian { background: #22c55e; }
.popout-badge.type-security { background: #a855f7; }
.popout-badge.type-public_health { background: #14b8a6; }
.popout-badge.type-earthquake { background: #f59e0b; }
.popout-badge.type-weather { background: #facc15; }
.popout-badge.type-finance { background: #f97316; }
.popout-badge.type-tech { background: #38bdf8; }
.popout-badge.type-discord { background: #5865f2; }

.popout-header-text {
  flex: 1;
  min-width: 0;
}

.popout-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #f4f7fb;
}

.popout-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.7rem;
}

.popout-close {
  background: transparent;
  border: 0;
  color: #9ca3af;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popout-close:hover {
  color: #fff;
}

.popout-body {
  padding: 14px;
  overflow: auto;
}

.popout-submeta {
  font-size: 0.78rem;
  color: #8fa2c6;
  margin: 0 0 8px;
}

.popout-summary {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #d2d2d2;
  margin-bottom: 64px;
}

.popout-media {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.popout-media img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.popout-files {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.popout-file {
  color: #7dd3fc;
  font-size: 0.82rem;
  text-decoration: none;
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.4);
}

.popout-file:hover {
  border-color: rgba(125, 211, 252, 0.55);
  color: #e0f2fe;
}

.popout-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.popout-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.popout-log {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5f1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.popout-log:hover {
  border-color: rgba(56, 189, 248, 0.6);
  color: #e2e8f0;
}

.popout-link:hover {
  text-decoration: underline;
}

.popout-media {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.popout-media img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.popout-files {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.popout-file {
  color: #7dd3fc;
  font-size: 0.82rem;
  text-decoration: none;
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.4);
}

.popout-file:hover {
  border-color: rgba(125, 211, 252, 0.55);
  color: #e0f2fe;
}

.discord-log-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.discord-log-modal.hidden {
  display: none;
}

.discord-log-card {
  width: min(620px, 92vw);
  max-height: 70vh;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

.discord-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(11, 17, 27, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.discord-log-close {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
}

.discord-log-body {
  padding: 14px 16px;
  overflow: auto;
  max-height: 60vh;
}

.discord-log-item {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 10px 0;
}

.discord-log-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.discord-log-author {
  color: #e2e8f0;
  font-weight: 600;
}

.discord-log-text {
  margin-top: 6px;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.discord-log-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 10px 0;
}

.popout-coords {
  font-size: 0.75rem;
  color: #8c94a3;
  white-space: nowrap;
}

/* -------------------------------------------------------------
   NEW ALERT BANNER
-------------------------------------------------------------- */

.new-alert {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #d9534f;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: bold;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.new-alert.hidden {
  display: none;
}

/* -------------------------------------------------------------
   MAPBOX POPUP STYLING
-------------------------------------------------------------- */

.mapboxgl-popup-content {
  background: rgba(15, 23, 42, 0.94);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  padding: 12px;
}

.mapboxgl-popup-close-button {
  color: #e5e7eb;
  font-size: 18px;
  padding: 4px 8px;
}

.mapboxgl-popup-tip {
  border-top-color: rgba(15, 23, 42, 0.94) !important;
  border-bottom-color: rgba(15, 23, 42, 0.94) !important;
}

.cluster-popup {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cluster-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  color: #f1f5f9;
}

.cluster-item {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.25);
  margin-bottom: 8px;
}

.cluster-item:last-child {
  margin-bottom: 0;
}

.cluster-item-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 4px;
}

.cluster-item-meta {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.cluster-item-link {
  font-size: 11.5px;
  color: #60a5fa;
  text-decoration: none;
}

.cluster-item-link:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------
   RIGHT INTEL PANEL (if needed)
-------------------------------------------------------------- */

.panel-right {
  width: 320px;
  background: #1d2127;
  border-left: 1px solid #22272e;
  display: flex;
  flex-direction: column;
}

#intel-body {
  padding: 14px;
  overflow-y: auto;
  color: #aaa;
}

/* -------------------------------------------------------------
   MAP LEGEND
-------------------------------------------------------------- */

.map-legend {
  position: absolute;
  bottom: 24px;
  right: 16px;
  left: auto !important;
  top: auto !important;
  background: rgba(12, 17, 24, 0.92);
  border: 1px solid #1f2b3a;
  border-radius: 10px;
  padding: 12px;
  z-index: 20;
  max-width: 220px;
}

.legend-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa6b6;
  margin-bottom: 8px;
}

.legend-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.legend-icon svg * {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legend-item span {
  font-size: 0.78rem;
  color: #e2e8f0;
}


.mission-buttons, .timeline-buttons, .priority-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mission-btn, .timeline-btn, .priority-btn {
  border: 1px solid #1f2b3a;
  background: rgba(13, 20, 30, 0.7);
  color: #cbd5f5;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  cursor: pointer;
}

.mission-btn.active, .timeline-btn.active, .priority-btn.active {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #fff;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 18px;
  background: #1f2b3a;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #9aa6b6;
  transition: transform 0.2s ease, background 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: #1d4ed8;
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(18px);
  background: #fff;
}

.toggle-text {
  font-size: 0.75rem;
  color: #9aa6b6;
}

.toggle-switch input:checked ~ .toggle-text {
  color: #e2e8f0;
}

body.theme-light .mission-btn,
body.theme-light .timeline-btn,
body.theme-light .priority-btn {
  background: #f8fafc;
  border-color: #cbd5f5;
  color: #334155;
}

body.theme-light .mission-btn.active,
body.theme-light .timeline-btn.active,
body.theme-light .priority-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

body.theme-light .toggle-slider {
  background: #e2e8f0;
}

body.theme-light .toggle-text {
  color: #475569;
}

/* -------------------------------------------------------------
   RESPONSIVE (MOBILE)
-------------------------------------------------------------- */


@media (max-width: 1100px) {
  .surface {
    flex-direction: column;
  }

  .map-surface {
    order: 1;
    height: 68vh;
    min-height: 320px;
  }

  .panel-left {
    order: 2;
    width: 100%;
    max-height: 32vh;
    border-right: 0;
    border-top: 1px solid #1a2431;
  }

  .panel-body-scroll {
    max-height: 24vh;
  }

  .map-legend {
    bottom: 16px;
    right: 12px;
    max-width: 180px;
  }

  .map-popout {
    left: 10px;
    bottom: 64px;
  }
}

@media (max-width: 900px) {
  .top-bar {
    height: 44px;
    padding: 4px 8px;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
  }

  .brand {
    flex: 0 0 auto;
    gap: 8px;
  }

  .brand-logo {
    width: 26px;
    height: 26px;
    background-size: 18px 18px;
  }

  .brand-text {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .brand-text .brand-title {
    font-size: 0.92rem;
    line-height: 1;
  }

  .brand-text .brand-subtitle {
    display: none;
  }

  .top-status {
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 8px;
  }

  .top-actions {
    flex: 0 0 auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .status-pill,
  .last-sync {
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .top-actions,
  .top-status,
  .brand {
    white-space: nowrap;
  }

  .smart-search-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  .icon-btn {
    padding: 3px 7px;
  }

  .top-bar::-webkit-scrollbar {
    display: none;
  }

  .top-bar {
    scrollbar-width: none;
  }

  .surface {
    flex-direction: column;
  }

  .map-surface {
    order: 1;
    height: 72vh;
    min-height: 360px;
  }

  .panel-left {
    order: 2;
    width: 100%;
    max-height: 28vh;
    border-right: 0;
    border-top: 1px solid #1a2431;
  }

  .panel-header {
    padding: 12px;
  }

  .panel-body-scroll {
    max-height: 22vh;
  }

  .map-legend {
    bottom: 16px;
    right: 12px;
    padding: 8px;
    max-width: 180px;
  }

  .legend-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .legend-item {
    gap: 8px;
  }

  #ai-panel {
    display: none !important;
  }

  .map-popout {
    width: min(92vw, 420px);
    left: 10px;
    bottom: 64px;
  }

  .inline-filters label:nth-of-type(1),
  .inline-filters label:nth-of-type(2),
  .inline-filters label:nth-of-type(4),
  .inline-filters label:nth-of-type(6) {
    display: none;
  }

  #source-filter,
  #priority-buttons,
  #type-visibility,
  .search-wrap {
    display: none !important;
  }
}

@media (max-height: 600px) and (min-width: 900px) {
  .top-bar {
    height: 44px;
    padding: 0 12px;
    flex-wrap: nowrap;
  }

  .brand-text .brand-subtitle {
    display: none;
  }

  .top-status,
  .top-actions {
    gap: 10px;
  }

  .smart-search-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
  }

  .status-pill,
  .last-sync {
    font-size: 0.75rem;
  }
}

@media (max-width: 640px) {
  .map-surface {
    height: 70vh;
    min-height: 320px;
  }

  .panel-left {
    max-height: 30vh;
  }

  .inline-filters {
    gap: 8px;
  }

  .inline-filters label {
    font-size: 0.7rem;
  }

  .icon-btn {
    padding: 6px 8px;
  }

  .smart-search-btn {
    padding: 6px 10px;
  }
}


.mapboxgl-ctrl-top-right {
  top: 12px;
  right: 12px;
  margin: 0;
}


.mapboxgl-ctrl-bottom-right {
  bottom: 12px;
  right: 12px;
  margin: 0;
}


.mapboxgl-ctrl-group {
  display: flex;
  flex-direction: row;
  gap: 6px;
  background: rgba(12, 17, 24, 0.92);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.mapboxgl-ctrl-group {
  outline: none !important;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35) !important;
}

.mapboxgl-ctrl-group:focus,
.mapboxgl-ctrl-group:focus-visible,
.mapboxgl-ctrl-group:active {
  outline: none !important;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35) !important;
}

.mapboxgl-ctrl-group button {
  outline: none !important;
}

.mapboxgl-ctrl-group button:focus-visible {
  outline: none !important;
}


.mapboxgl-ctrl-group button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: #0f1723;
  box-shadow: none;
}


.mapboxgl-ctrl-group button:hover {
  background: #1b283b;
}

.mapboxgl-ctrl-icon {
  filter: invert(94%) sepia(8%) saturate(152%) hue-rotate(176deg) brightness(95%) contrast(90%);
}

body.theme-light .mapboxgl-ctrl-group {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(15, 23, 42, 0.15);
}

body.theme-light .mapboxgl-ctrl-group button {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.18);
}

body.theme-light .mapboxgl-ctrl-icon {
  filter: none;
}

.mapboxgl-ctrl-group button + button {
  margin-left: 4px;
}

.mapboxgl-ctrl-group button {
  border-top: 0 !important;
}

.mapboxgl-ctrl-group button:not(:first-child) {
  border-top: 0 !important;
}

.mapboxgl-ctrl-group button:focus {
  outline: none;
  box-shadow: none;
}


.mapboxgl-ctrl-group button::after,
.mapboxgl-ctrl-group button::before {
  border: 0 !important;
  box-shadow: none !important;
}
