/* MDC Strategic Dashboard — shared styles */
:root {
  --mdc-blue: #074FEA;
  --mdc-blue-deep: #0540c0;
  --mdc-cyan: #22d3ee;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --slate-950: #0a0e1a;
  --slate-900: #0f1729;
  --slate-800: #1e2a45;
  --slate-700: #2d3a55;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --paper: #ffffff;

  /* Dark theme (default) surface tokens */
  --app-bg:        #0a0e1a;
  --chrome-bg:     rgba(10,14,26,.80);
  --surface:       rgba(15,23,41,.92);
  --surface-2:     rgba(10,14,26,.96);
  --surface-subtle:rgba(148,163,184,.06);
  --surface-chip:  rgba(148,163,184,.12);
  --border-soft:   rgba(148,163,184,.22);
  --border-hair:   rgba(148,163,184,.15);
  --ink:           #ffffff;
  --ink-strong:    #ffffff;
  --ink-muted:     #cbd5e1;
  --ink-dim:       #94a3b8;
  --ink-dimmer:    #64748b;
  --leaflet-bg:    #0a0e1a;

  --bg: #f4f6fa;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e9f0;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md: 0 2px 4px rgba(15,23,42,.06), 0 6px 24px rgba(15,23,42,.06);
  --shadow-lg: 0 4px 12px rgba(15,23,42,.08), 0 24px 48px rgba(15,23,42,.10);
}

/* ─── LIGHT THEME ─────────────────────────────────────────────────
   Flips surface tokens; high-specificity overrides below translate
   the inline-styled dark backgrounds (rgba(15,23,41,…) / rgba(10,14,26,…))
   to warm paper equivalents. */
:root[data-theme="light"] {
  --app-bg:        #eef1f6;
  --chrome-bg:     rgba(255,255,255,.92);
  --surface:       rgba(255,255,255,.96);
  --surface-2:     rgba(255,255,255,.98);
  --surface-subtle:rgba(15,23,42,.03);
  --surface-chip:  rgba(15,23,42,.06);
  --border-soft:   rgba(15,23,42,.12);
  --border-hair:   rgba(15,23,42,.08);
  --ink:           #0f172a;
  --ink-strong:    #020617;
  --ink-muted:     #334155;
  --ink-dim:       #64748b;
  --ink-dimmer:    #94a3b8;
  --leaflet-bg:    #e8ecf2;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace; }

/* ===== Map: pins, callouts, cable label ===== */
.mdc-pin-wrap { background: transparent !important; border: none !important; }
.mdc-callout-wrap { background: transparent !important; border: none !important; pointer-events: none; }

.mdc-pin {
  position: relative;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .2s;
}
.mdc-pin:hover { transform: scale(1.15); z-index: 999; }
.mdc-pin-pulse {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  opacity: .35;
  animation: mdc-pulse 2.4s ease-out infinite;
}
@keyframes mdc-pulse {
  0% { transform: scale(.7); opacity: .55; }
  100% { transform: scale(1.6); opacity: 0; }
}
.mdc-pin-core {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2.5px solid;
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.15) inset;
  z-index: 2;
}
.mdc-pin-num {
  font-size: 11px; font-weight: 700; letter-spacing: -.3px;
  font-family: 'Poppins', sans-serif;
}
.mdc-pin-live {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px white, 0 0 8px var(--green);
  z-index: 3;
}
.mdc-pin-selected .mdc-pin-core {
  box-shadow: 0 0 0 4px rgba(7,79,234,.35), 0 6px 18px rgba(0,0,0,.5);
  transform: scale(1.2);
}

/* Callouts (always visible, anchored to pin) */
.mdc-callout {
  display: flex;
  background: rgba(15,23,41,.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  font-family: 'Poppins', sans-serif;
  color: white;
  width: 230px;
  overflow: hidden;
}
.mdc-callout-right { flex-direction: row-reverse; }
.mdc-cl-line { width: 3px; flex-shrink: 0; }
.mdc-cl-body { padding: 8px 10px; flex: 1; min-width: 0; }
.mdc-cl-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.mdc-cl-pri {
  font-size: 9px; font-weight: 700;
  background: rgba(7,79,234,.25);
  color: #93c5fd;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .3px;
}
.mdc-cl-name {
  font-size: 12px; font-weight: 600;
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mdc-cl-type {
  font-size: 9px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .3px;
}
.mdc-cl-meta {
  font-size: 10.5px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.mdc-cl-mw { color: #fbbf24; font-weight: 600; }
.mdc-cl-sep { color: #475569; }
.mdc-cl-anchor { color: #e2e8f0; font-weight: 500; }
.mdc-cl-tgt { color: #94a3b8; }

.mdc-callout-mini {
  background: rgba(15,23,41,.92);
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid rgba(148,163,184,.2);
  white-space: nowrap;
  display: inline-block;
}
.mdc-callout-mini strong {
  color: #93c5fd; margin-right: 4px;
}

.mdc-cable-label {
  background: linear-gradient(135deg, #074FEA, #1e40af);
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 10px; font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(7,79,234,.45);
  white-space: nowrap;
  text-align: center;
}
.mdc-cable-clickable {
  cursor: pointer;
  transition: all .15s;
  border: 1px solid rgba(96,165,250,.3);
}
.mdc-cable-clickable:hover {
  background: linear-gradient(135deg, #1d6dff, #074FEA);
  box-shadow: 0 6px 24px rgba(7,79,234,.7);
  transform: scale(1.06);
}

/* Persistent city-name labels for Px pins — always visible under each marker */
.mdc-pin-citylabel {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .2px;
  white-space: nowrap;
  text-align: center;
  text-shadow:
    0 0 6px rgba(10,14,26,1),
    0 0 3px rgba(10,14,26,1),
    0 1px 2px rgba(10,14,26,1);
  pointer-events: none;
}
:root[data-theme="light"] .mdc-pin-citylabel {
  color: #0f172a !important;
  text-shadow:
    0 0 6px rgba(255,255,255,.95),
    0 0 3px rgba(255,255,255,.95),
    0 1px 2px rgba(255,255,255,.95) !important;
}

/* Persistent city-name labels for Manta landings */
.mdc-manta-citylabel {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #bfdbfe;
  letter-spacing: .2px;
  white-space: nowrap;
  text-shadow:
    0 0 4px rgba(10,14,26,.95),
    0 0 2px rgba(10,14,26,.95),
    0 1px 2px rgba(10,14,26,.95);
  pointer-events: none;
}
.mdc-manta-citylabel--muted {
  color: #93c5fd;
  opacity: .7;
  font-style: italic;
}

/* Context city labels (sparse, only the ones that matter for MDC's footprint) */
.mdc-ctx-city {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: .3px;
  white-space: nowrap;
  text-shadow:
    0 0 4px rgba(10,14,26,.9),
    0 0 2px rgba(10,14,26,.9);
  pointer-events: none;
  user-select: none;
}

/* Future-site pins (projected expansion markets) */
.mdc-future-wrap { background: transparent; border: none; }
.mdc-future-pin {
  position: relative;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.mdc-future-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: #a78bfa;
  opacity: .25;
  animation: mdc-future-pulse 2.4s ease-in-out infinite;
}
@keyframes mdc-future-pulse {
  0%, 100% { transform: scale(.9); opacity: .25; }
  50%      { transform: scale(1.4); opacity: 0; }
}
.mdc-future-core {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(124,58,237,.25);
  border: 1.5px dashed #a78bfa;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 12px rgba(167,139,250,.4);
  transition: all .15s;
}
.mdc-future-pin:hover .mdc-future-core {
  background: rgba(124,58,237,.5);
  transform: scale(1.15);
}
.mdc-future-label {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  color: #c4b5fd;
  background: rgba(15,23,41,.75);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: .2px;
  pointer-events: none;
  border: 1px solid rgba(167,139,250,.25);
}
.mdc-future-tip .leaflet-tooltip-top:before { border-top-color: rgba(15,23,41,.95); }
.mdc-future-tip {
  background: rgba(15,23,41,.95) !important;
  border: 1px solid rgba(167,139,250,.35) !important;
  color: white !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.5) !important;
}

/* Native-resizable variant of pinned card */
.mdc-pinned-rs {
  resize: both;
  min-width: 300px;
  min-height: 360px;
  max-width: 800px;
  max-height: 92vh;
}
.mdc-pinned-rs::-webkit-resizer {
  background: linear-gradient(135deg, transparent 50%, rgba(148,163,184,.5) 50%);
}

/* Draggable + resizable floating panel */
.mdc-fp {
  position: absolute;
  z-index: 500;
  background: rgba(15,23,41,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  color: white;
  font-family: 'Poppins';
  display: flex;
  flex-direction: column;
  resize: both;
  overflow: hidden;
  min-width: 240px;
  min-height: 180px;
  max-width: 600px;
  max-height: 90vh;
}
.mdc-fp-handle {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  cursor: grab;
  background: rgba(148,163,184,.06);
  border-bottom: 1px solid rgba(148,163,184,.12);
  flex-shrink: 0;
  user-select: none;
}
.mdc-fp-handle:active { cursor: grabbing; }
.mdc-fp-grip {
  display: flex; gap: 2px;
}
.mdc-fp-grip span {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(148,163,184,.5);
}
.mdc-fp-title {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #94a3b8;
  font-weight: 600;
}
.mdc-fp-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}
.mdc-fp-body::-webkit-scrollbar { width: 6px; }
.mdc-fp-body::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 3px; }
/* native resize handle styling (chrome) */
.mdc-fp::-webkit-resizer {
  background: linear-gradient(135deg, transparent 50%, rgba(148,163,184,.5) 50%);
}

/* Leaflet overrides */
.leaflet-container { background: var(--leaflet-bg); font-family: 'Poppins', sans-serif; }
.leaflet-control-attribution { display: none; }

/* Hover preview */
.mdc-hover {
  background: rgba(15,23,41,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 10px;
  padding: 10px 12px;
  color: white;
  font-family: 'Poppins', sans-serif;
  width: 240px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  animation: mdc-fade-in .12s ease-out;
}
@keyframes mdc-fade-in {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Pinned card */
.mdc-pinned {
  background: rgba(10,14,26,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 14px;
  overflow: hidden;
  color: white;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 20px 60px rgba(0,0,0,.65);
  animation: mdc-slide-in .18s ease-out;
}
@keyframes mdc-slide-in {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.mdc-pinned-photo {
  position: relative;
  display: block;
  height: 130px;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  cursor: pointer;
}
.mdc-pinned-photo:hover .mdc-pinned-photo-label {
  background: rgba(7,79,234,1);
  transform: translateY(-2px);
}
.mdc-pinned-photo-label {
  position: absolute;
  left: 12px; bottom: 12px;
  background: rgba(7,79,234,.9);
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  transition: all .15s;
  letter-spacing: .2px;
}
.mdc-pinned-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(15,23,41,.7);
  color: #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
  border: 1px solid rgba(148,163,184,.25);
  transition: all .15s;
}
.mdc-pinned-close:hover { background: rgba(239,68,68,.7); color: white; }
.mdc-pinned-body { padding: 14px 16px 16px; }
.mdc-pinned-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.mdc-pinned-type {
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: .4px;
}
.mdc-pinned-name { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.mdc-pinned-code { font-size: 10.5px; color: #94a3b8; margin-top: 2px; }
.mdc-pinned-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(148,163,184,.15);
}
.mdc-pinned-stats > div {
  display: flex; flex-direction: column; gap: 1px;
}
.mdc-pinned-stats span {
  font-size: 9px; text-transform: uppercase; letter-spacing: .5px;
  color: #64748b; font-weight: 600;
}
.mdc-pinned-stats b {
  font-size: 12px; font-weight: 600; color: white;
}
.mdc-pinned-anchor {
  margin-top: 12px; padding: 10px 12px;
  background: rgba(7,79,234,.12);
  border: 1px solid rgba(7,79,234,.25);
  border-radius: 8px;
}
.mdc-pinned-note {
  margin-top: 10px;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  padding: 8px 10px;
  background: rgba(148,163,184,.08);
  border-left: 2px solid #22d3ee;
  border-radius: 4px;
}

.mdc-map-host { position: relative; width: 100%; height: 100%; }

/* ===== Reusable cards ===== */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.card-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.card-title-ico {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: var(--mdc-blue);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}

.lens-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: .5px; text-transform: uppercase;
}
.lens-investor { background: #f0e9ff; color: #6b21a8; }
.lens-operator { background: #dbeafe; color: #1e40af; }

/* big number */
.bignum {
  font-size: 32px; font-weight: 700; line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
}
.bignum-sub {
  font-size: 11px; color: var(--muted); margin-top: 4px;
}

.delta-up { color: var(--green); }
.delta-down { color: var(--red); }
.delta-flat { color: var(--muted); }

/* RAG dot */
.rag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.rag-green { background: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.rag-amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.rag-red   { background: var(--red);   box-shadow: 0 0 0 3px rgba(239,68,68,.18); }

/* Dashboard frame */
.dash-frame {
  width: 100%; height: 100%;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.dash-header {
  flex-shrink: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px;
}
.dash-logo {
  width: 40px; height: 40px;
  background: var(--mdc-blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 16px;
  box-shadow: 0 4px 12px rgba(7,79,234,.25);
}
.dash-title {
  font-size: 17px; font-weight: 700; letter-spacing: -.3px; line-height: 1.1;
}
.dash-sub {
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
}

/* Tooltip-like badge */
.kpi-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--slate-100);
  font-size: 11px; font-weight: 500; color: var(--slate-700);
}
.kpi-pill strong { color: var(--text); font-weight: 700; }

/* Subtle scrollbar */
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* utility */
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.text-muted { color: var(--muted); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }

/* Schedule timeline mini bar */
.tl-bar {
  display: flex; height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--slate-100);
}
.tl-bar-seg {
  height: 100%; transition: opacity .2s;
}

/* Site row */
.site-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.site-row:last-child { border-bottom: none; }
.site-row .pri {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white;
}

/* Lens header bar */
.lens-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 12px;
}
.lens-bar-investor {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}
.lens-bar-operator {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}


/* ═══════════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   The dashboard was authored dark-first with many inline rgba() values.
   We swap them via attribute selectors scoped under [data-theme="light"].
   ═══════════════════════════════════════════════════════════════════ */

:root[data-theme="light"] body { background: var(--app-bg); color: var(--ink); }
:root[data-theme="light"] html,
:root[data-theme="light"] body,
:root[data-theme="light"] #root { background: var(--app-bg); }

/* Callouts, hovers, pinned cards, floating panels, deep-dive drawer */
:root[data-theme="light"] .mdc-callout,
:root[data-theme="light"] .mdc-callout-mini,
:root[data-theme="light"] .mdc-hover,
:root[data-theme="light"] .mdc-fp {
  background: var(--surface) !important;
  border-color: var(--border-soft) !important;
  color: var(--ink) !important;
  box-shadow: 0 10px 30px rgba(15,23,42,.10), 0 2px 8px rgba(15,23,42,.06) !important;
}
:root[data-theme="light"] .mdc-pinned {
  background: var(--surface-2) !important;
  border-color: var(--border-soft) !important;
  color: var(--ink) !important;
  box-shadow: 0 24px 64px rgba(15,23,42,.18), 0 4px 12px rgba(15,23,42,.08) !important;
}

/* Floating panel chrome */
:root[data-theme="light"] .mdc-fp-handle {
  background: var(--surface-subtle) !important;
  border-bottom-color: var(--border-hair) !important;
}
:root[data-theme="light"] .mdc-fp-grip span { background: rgba(15,23,42,.35) !important; }
:root[data-theme="light"] .mdc-fp-title { color: var(--ink-muted) !important; }

/* Callout body copy becomes dark-on-light */
:root[data-theme="light"] .mdc-callout,
:root[data-theme="light"] .mdc-callout *,
:root[data-theme="light"] .mdc-callout-mini,
:root[data-theme="light"] .mdc-callout-mini *,
:root[data-theme="light"] .mdc-hover,
:root[data-theme="light"] .mdc-hover *,
:root[data-theme="light"] .mdc-pinned,
:root[data-theme="light"] .mdc-pinned *,
:root[data-theme="light"] .mdc-fp,
:root[data-theme="light"] .mdc-fp * {
  /* only swap pure-white text */
  color: unset;
}

/* Inline-styled dark backgrounds → paper 
   React serializes inline styles with spaces & 0.x decimals, so we match both formats. */
:root[data-theme="light"] [style*="rgba(10,14,26"],
:root[data-theme="light"] [style*="rgba(10, 14, 26"] {
  background-color: var(--chrome-bg) !important;
  background: var(--chrome-bg) !important;
  backdrop-filter: blur(12px);
}
:root[data-theme="light"] [style*="rgba(15,23,41"],
:root[data-theme="light"] [style*="rgba(15, 23, 41"] {
  background-color: var(--surface) !important;
  background: var(--surface) !important;
}

/* Inline-styled slate borders & separators (rgba(148,163,184, .08–.22)) */
:root[data-theme="light"] [style*="rgba(148,163,184"],
:root[data-theme="light"] [style*="rgba(148, 163, 184"] {
  border-color: var(--border-soft) !important;
}

/* Chips / pill backgrounds — when slate is used as BACKGROUND not border.
   We target via attribute contains on background: token. */
:root[data-theme="light"] [style*="background: rgba(148, 163, 184"],
:root[data-theme="light"] [style*="background:rgba(148,163,184"],
:root[data-theme="light"] [style*="background-color: rgba(148, 163, 184"],
:root[data-theme="light"] [style*="background-color:rgba(148,163,184"] {
  background-color: var(--surface-chip) !important;
  background: var(--surface-chip) !important;
}

/* Horizontal rules drawn as 1px divs */
:root[data-theme="light"] div[style*="height: 1px"][style*="rgba(148, 163, 184"],
:root[data-theme="light"] div[style*="height:1px"][style*="rgba(148,163,184"] {
  background-color: rgba(15,23,42,.10) !important;
  background: rgba(15,23,42,.10) !important;
}

/* Top-chrome headings & labels — swap white / light-slate text.
   React serializes hex colors to rgb() — we match both forms. */
:root[data-theme="light"] [style*="color: white"],
:root[data-theme="light"] [style*="color:white"],
:root[data-theme="light"] [style*="color: #fff"],
:root[data-theme="light"] [style*="color:#fff"],
:root[data-theme="light"] [style*="color: rgb(255, 255, 255)"] {
  color: var(--ink-strong) !important;
}
:root[data-theme="light"] [style*="color: #cbd5e1"],
:root[data-theme="light"] [style*="color:#cbd5e1"],
:root[data-theme="light"] [style*="color: rgb(203, 213, 225)"],
:root[data-theme="light"] [style*="color: #e2e8f0"],
:root[data-theme="light"] [style*="color:#e2e8f0"],
:root[data-theme="light"] [style*="color: rgb(226, 232, 240)"] {
  color: var(--ink-muted) !important;
}
:root[data-theme="light"] [style*="color: #94a3b8"],
:root[data-theme="light"] [style*="color:#94a3b8"],
:root[data-theme="light"] [style*="color: rgb(148, 163, 184)"] {
  color: var(--ink-dim) !important;
}
:root[data-theme="light"] [style*="color: #64748b"],
:root[data-theme="light"] [style*="color:#64748b"],
:root[data-theme="light"] [style*="color: rgb(100, 116, 139)"] {
  color: var(--ink-dimmer) !important;
}

/* Map pin text bubbles are authored white — keep white (they sit over blue pins) */
:root[data-theme="light"] .mdc-pin,
:root[data-theme="light"] .mdc-pin *,
:root[data-theme="light"] .leaflet-marker-icon * {
  /* handled separately — leave untouched */
}

/* Cable label */
:root[data-theme="light"] .mdc-cable-label {
  background: rgba(255,255,255,.85) !important;
  color: #4c1d95 !important;
  border-color: rgba(124,58,237,.25) !important;
}

/* Future-site tooltip */
:root[data-theme="light"] .mdc-future-tip {
  background: rgba(255,255,255,.96) !important;
  border-color: rgba(124,58,237,.35) !important;
  color: #1e1b4b !important;
}
:root[data-theme="light"] .mdc-future-tip .leaflet-tooltip-top:before {
  border-top-color: rgba(255,255,255,.96) !important;
}

/* Floating-panel control buttons */
:root[data-theme="light"] .mdc-fp-btn {
  background: rgba(15,23,42,.04) !important;
  color: var(--ink-muted) !important;
  border: 1px solid rgba(15,23,42,.08) !important;
}
:root[data-theme="light"] .mdc-fp-btn:hover {
  background: rgba(15,23,42,.08) !important;
}

/* Scrollbars in light mode */
:root[data-theme="light"] .mdc-pinned::-webkit-scrollbar-thumb,
:root[data-theme="light"] .mdc-fp-body::-webkit-scrollbar-thumb,
:root[data-theme="light"] .mdc-deepdive-drawer ::-webkit-scrollbar-thumb {
  background: rgba(15,23,42,.18) !important;
}

/* Narrative one-liner pills (investor/operator summary rows) */
.mdc-narrative-line {
  color: #e2e8f0;
}
:root[data-theme="light"] .mdc-narrative-line {
  color: #334155 !important;
}

/* Light-mode city label halos: flip dark shadow → white shadow so labels
   stay legible on light tiles. */
:root[data-theme="light"] .mdc-manta-citylabel {
  color: #1e40af !important;
  text-shadow:
    0 0 4px rgba(255,255,255,.95),
    0 0 2px rgba(255,255,255,.95),
    0 1px 2px rgba(255,255,255,.95) !important;
}
:root[data-theme="light"] .mdc-manta-citylabel--muted {
  color: #3b82f6 !important;
}
:root[data-theme="light"] .mdc-ctx-city {
  color: #475569 !important;
  text-shadow:
    0 0 4px rgba(255,255,255,.95),
    0 0 2px rgba(255,255,255,.95) !important;
}

/* Theme toggle button (lives in top chrome) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: 'Poppins', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { background: rgba(148,163,184,.18); color: #fff; }
.theme-toggle svg { width: 13px; height: 13px; }
:root[data-theme="light"] .theme-toggle {
  background: rgba(15,23,42,.05);
  border-color: rgba(15,23,42,.12);
  color: #334155;
}
:root[data-theme="light"] .theme-toggle:hover {
  background: rgba(15,23,42,.08);
  color: #0f172a;
}
