/* ECOTRACK — operations console aesthetic */

:root {
  --bg: #07090C;
  --bg-2: #0B0F14;
  --panel: #10151D;
  --panel-2: #151B25;
  --border: #1D2530;
  --border-2: #262F3D;
  --text: #E6EAF0;
  --text-dim: #8B95A3;
  --text-faint: #5B6676;
  --teal: #2DD4BF;
  --teal-dim: #0E7C6F;
  --blue: #5B9CFF;
  --amber: #F5B13A;
  --red: #FF5D5D;
  --green: #4ADE80;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:focus-visible { outline: 1px solid var(--teal); outline-offset: 1px; }
input, textarea { font-family: inherit; color: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1D2530; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2A3545; }

/* App shell */
.app {
  display: grid;
  grid-template-rows: 44px 1fr;
  grid-template-columns: 64px 1fr;
  grid-template-areas: "topnav topnav" "sidebar main";
  height: 100vh;
}
.app.sidebar-expanded { grid-template-columns: 220px 1fr; }

/* Top nav */
.topnav {
  grid-area: topnav;
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.12em;
}
.logo-mark {
  width: 22px; height: 22px; border-radius: 3px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dim));
  display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 900; font-size: 11px; letter-spacing: 0;
  position: relative; overflow: hidden;
}
.logo-mark::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.25));
}
.logo-name { color: var(--text); }
.logo-suffix { color: var(--teal); margin-left: -4px; }

.topnav-divider { width: 1px; height: 22px; background: var(--border); }
.topnav-cluster { display: flex; align-items: center; gap: 10px; }
.topnav-spacer { flex: 1; }

.ticker {
  display: flex; gap: 22px; font-family: var(--mono); font-size: 11px;
  color: var(--text-dim); overflow: hidden; white-space: nowrap;
}
.ticker-item { display: flex; align-items: center; gap: 6px; }
.ticker-label { color: var(--text-faint); }
.ticker-value { color: var(--text); }
.ticker-value.up { color: var(--green); }
.ticker-value.down { color: var(--red); }

.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.status-dot.live { background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,0.6); animation: pulse 1.6s infinite; }
.status-dot.warn { background: var(--amber); }
.status-dot.crit { background: var(--red); animation: pulse 0.9s infinite; }
.status-dot.teal { background: var(--teal); box-shadow: 0 0 8px rgba(45,212,191,0.5); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.role-switcher {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border: 1px solid var(--border);
  background: var(--panel); border-radius: 4px;
  font-family: var(--mono); font-size: 11px;
  cursor: pointer; position: relative;
  z-index: 10000;
}
.role-switcher:hover { border-color: var(--border-2); }
.role-label { color: var(--text-dim); }
.role-value { color: var(--text); }
.role-dropdown {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--panel); border: 1px solid var(--border);
  min-width: 200px; z-index: 10001; border-radius: 4px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.role-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: pointer; font-family: var(--mono); font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.role-option:last-child { border-bottom: none; }
.role-option:hover { background: var(--panel-2); }
.role-option.active { background: rgba(45,212,191,0.06); color: var(--teal); }

.icon-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--panel); border-radius: 4px;
  color: var(--text-dim); position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.icon-btn.active { color: var(--teal); border-color: rgba(45,212,191,0.4); background: rgba(45,212,191,0.08); }
.badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 600;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
}

.ecopilot-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px; border: 1px solid rgba(45,212,191,0.3);
  background: rgba(45,212,191,0.06); color: var(--teal);
  border-radius: 4px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.05em;
}
.ecopilot-btn:hover { background: rgba(45,212,191,0.12); border-color: rgba(45,212,191,0.5); }
.ecopilot-btn .status-dot { background: var(--teal); box-shadow: 0 0 6px var(--teal); }

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 8px 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; color: var(--text-dim);
  cursor: pointer; border-left: 2px solid transparent;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.nav-item.active {
  color: var(--teal); border-left-color: var(--teal);
  background: rgba(45,212,191,0.05);
}
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .nav-label { opacity: 1; transition: opacity 0.2s; }
.app:not(.sidebar-expanded) .nav-label { display: none; }

.sidebar-footer {
  margin-top: auto; padding: 12px 14px;
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 10px;
  color: var(--text-faint);
}

/* Main content area */
.main {
  grid-area: main;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

/* Page header (shared) */
.page {
  height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.page-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.page-title {
  display: flex; flex-direction: column; gap: 2px;
}
.page-title h1 {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 10px;
}
.page-title .sub {
  font-family: var(--mono); font-size: 10px; color: var(--text-faint);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.page-body { flex: 1; overflow: auto; padding: 16px 20px; }
.page-body.no-pad { padding: 0; }

/* Panels / cards */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
}
.panel-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-faint);
}
.panel-head .panel-tag { color: var(--teal); }
.panel-body { padding: 14px; }

/* KPI card */
.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--teal);
}
.kpi.warn::before { background: var(--amber); }
.kpi.crit::before { background: var(--red); }
.kpi-label {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.kpi-value {
  font-family: var(--mono); font-size: 24px; font-weight: 600;
  letter-spacing: -0.01em; color: var(--text);
  display: flex; align-items: baseline; gap: 4px;
}
.kpi-unit { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.kpi-sub {
  margin-top: 6px; font-family: var(--mono); font-size: 10px;
  display: flex; align-items: center; gap: 6px; color: var(--text-dim);
}
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-spark { margin-top: 8px; height: 28px; }

/* Grid helpers */
.grid { display: grid; gap: 12px; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.row { display: flex; gap: 12px; }

/* Status / severity pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 2px;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid transparent;
}
.pill.teal { color: var(--teal); border-color: rgba(45,212,191,0.3); background: rgba(45,212,191,0.08); }
.pill.green { color: var(--green); border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.08); }
.pill.amber { color: var(--amber); border-color: rgba(245,177,58,0.3); background: rgba(245,177,58,0.08); }
.pill.red { color: var(--red); border-color: rgba(255,93,93,0.3); background: rgba(255,93,93,0.08); }
.pill.blue { color: var(--blue); border-color: rgba(91,156,255,0.3); background: rgba(91,156,255,0.08); }
.pill.dim { color: var(--text-dim); border-color: var(--border); background: var(--panel-2); }

/* Tables */
table.data {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 11px;
}
table.data th {
  text-align: left; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 10px; color: var(--text-faint);
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  background: var(--panel-2); position: sticky; top: 0; z-index: 1;
}
table.data td {
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
table.data tr:hover td { background: rgba(255,255,255,0.02); color: var(--text); }
table.data td.num { text-align: right; }

/* Alerts feed */
.alert-row {
  display: grid;
  grid-template-columns: 40px 70px 80px 1fr auto;
  gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px;
  align-items: center;
  cursor: pointer;
  transition: background 0.1s;
}
.alert-row:hover { background: rgba(255,255,255,0.02); }
.alert-row .ts { color: var(--text-faint); font-size: 10px; }
.alert-row .entity { color: var(--teal); }
.alert-row .desc { color: var(--text); }
.alert-row .sev-cell { display: flex; justify-content: center; }

/* Pipeline */
.pipeline {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px; height: 100%;
}
.pipeline-col {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 4px; display: flex; flex-direction: column; min-height: 0;
}
.pipeline-head {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-dim);
  display: flex; align-items: center; justify-content: space-between;
}
.pipeline-head .count { color: var(--teal); }
.pipeline-body {
  flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.order-card {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 3px; padding: 10px; cursor: pointer;
  transition: border-color 0.15s;
}
.order-card:hover { border-color: var(--teal); }
.order-card .oid { font-family: var(--mono); font-size: 11px; color: var(--teal); font-weight: 600; }
.order-card .orow { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.order-card .obottom {
  margin-top: 8px; display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 10px; color: var(--text-faint);
}

/* Buttons */
.btn {
  padding: 6px 12px; border: 1px solid var(--border); background: var(--panel);
  border-radius: 3px; color: var(--text-dim); font-size: 11px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--border-2); color: var(--text); }
.btn.primary { border-color: var(--teal); color: var(--teal); background: rgba(45,212,191,0.08); }
.btn.primary:hover { background: rgba(45,212,191,0.15); }
.btn.danger { border-color: rgba(255,93,93,0.4); color: var(--red); }

/* Segmented control */
.seg {
  display: inline-flex; border: 1px solid var(--border);
  border-radius: 3px; overflow: hidden; background: var(--panel);
}
.seg button {
  padding: 5px 10px; font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--teal); color: #000; font-weight: 600; }
.seg button:not(.active):hover { color: var(--text); background: var(--panel-2); }

/* Map */
.map-wrap { position: relative; height: 100%; width: 100%; }
#leaflet-map { height: 100%; width: 100%; background: #0A1016; }
.leaflet-tile { filter: saturate(0.7); }
.leaflet-container {
  background: #0A1016 !important;
  font-family: var(--mono) !important;
  font-size: 11px !important;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: 4px !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7) !important;
}
.leaflet-popup-content { font-family: var(--mono); font-size: 11px; }
.leaflet-control-zoom a {
  background: var(--panel) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.leaflet-control-attribution {
  background: rgba(7,9,12,0.8) !important; color: var(--text-faint) !important;
  font-family: var(--mono) !important; font-size: 9px !important;
}
.leaflet-control-attribution a { color: var(--text-dim) !important; }

/* Map markers (divIcons) */
.marker-vehicle {
  width: 26px; height: 26px; background: var(--panel);
  border: 1.5px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--teal);
  box-shadow: 0 0 12px rgba(45,212,191,0.45);
  transition: transform 0.2s;
}
.marker-vehicle.warn { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 12px rgba(245,177,58,0.45); }
.marker-vehicle.crit { border-color: var(--red); color: var(--red); box-shadow: 0 0 12px rgba(255,93,93,0.45); animation: pulse 1.2s infinite; }
.marker-vehicle:hover { transform: scale(1.15); z-index: 1000; }
.marker-label {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(16,21,29,0.95); border: 1px solid var(--border);
  padding: 1px 5px; font-size: 9px; color: var(--text); white-space: nowrap;
  border-radius: 2px; font-family: var(--mono);
}
.marker-warehouse {
  width: 32px; height: 32px; background: var(--panel-2);
  border: 1.5px solid var(--blue);
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; color: var(--blue);
  box-shadow: 0 0 12px rgba(91,156,255,0.3);
}
.marker-warehouse.origin { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 12px rgba(45,212,191,0.3); }

/* Map overlays */
.map-overlay {
  position: absolute; z-index: 500; pointer-events: auto;
}
.map-overlay.left { top: 12px; left: 12px; width: 220px; }
.map-overlay.right { top: 12px; right: 12px; width: 320px; bottom: 12px; display: flex; flex-direction: column; }
.map-overlay.bottom { bottom: 12px; left: 50%; transform: translateX(-50%); }
.map-overlay.bottom.with-right { left: calc(50% - 160px); }
.map-overlay.top-right-kpis { top: 12px; right: 12px; display: flex; gap: 8px; }

.layer-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  cursor: pointer;
}
.layer-toggle:hover { color: var(--text); }
.layer-toggle:last-child { border-bottom: none; }
.switch {
  width: 26px; height: 14px; background: var(--border-2);
  border-radius: 8px; position: relative; transition: background 0.2s;
}
.switch::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 10px; height: 10px; background: var(--text); border-radius: 50%;
  transition: left 0.2s;
}
.switch.on { background: var(--teal); }
.switch.on::after { left: 14px; background: #000; }

/* Scenario bar */
.scenario-bar {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 4px; padding: 8px 12px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* ECOPILOT panel */
.ecopilot-panel {
  position: fixed; top: 44px; right: 0; bottom: 0; width: 420px;
  background: var(--panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 1000;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
.ecopilot-panel.open { transform: translateX(0); }
.ecopilot-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
}
.ecopilot-avatar {
  width: 28px; height: 28px; border-radius: 4px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 700; font-family: var(--mono);
  position: relative;
}
.ecopilot-avatar::after {
  content: ''; position: absolute; inset: -3px; border-radius: 6px;
  border: 1px solid var(--teal); opacity: 0.4;
  animation: pulse 2s infinite;
}
.ecopilot-meta { flex: 1; }
.ecopilot-meta .name { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; }
.ecopilot-meta .sub { font-size: 10px; color: var(--text-faint); font-family: var(--mono); }
.ecopilot-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; }
.msg .bubble {
  padding: 9px 12px; border-radius: 4px;
  font-size: 12px; line-height: 1.5;
}
.msg.user .bubble { background: var(--teal); color: #000; font-weight: 500; }
.msg.bot .bubble { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.msg .meta { font-family: var(--mono); font-size: 9px; color: var(--text-faint); margin-top: 4px; letter-spacing: 0.05em; }
.msg.user .meta { text-align: right; }
.typing { display: flex; gap: 3px; padding: 4px 0; }
.typing span { width: 5px; height: 5px; background: var(--teal); border-radius: 50%; animation: typing 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ecopilot-suggests {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 6px; background: var(--panel-2);
}
.suggest-chip {
  padding: 5px 9px; border: 1px solid var(--border); background: var(--panel);
  border-radius: 3px; font-family: var(--mono); font-size: 10px; color: var(--text-dim);
  cursor: pointer;
}
.suggest-chip:hover { border-color: var(--teal); color: var(--teal); }
.suggest-chip.demo-chip {
  background: linear-gradient(135deg, rgba(45,212,191,0.22), rgba(45,212,191,0.08));
  border-color: rgba(45,212,191,0.6);
  color: var(--teal); font-weight: 700; letter-spacing: 0.04em;
  box-shadow: 0 0 0 1px rgba(45,212,191,0.15) inset;
  order: -1;
}
.suggest-chip.demo-chip:hover { background: linear-gradient(135deg, rgba(45,212,191,0.3), rgba(45,212,191,0.12)); }

.case-transcript {
  margin-top: 10px; padding: 10px;
  border: 1px dashed rgba(45,212,191,0.35);
  background: rgba(10,16,22,0.55); border-radius: 4px;
  display: flex; flex-direction: column; gap: 8px;
}
.case-transcript-head {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--teal); text-transform: uppercase;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.case-msg { font-size: 11px; line-height: 1.45; }
.case-msg .who {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  color: var(--text-faint); text-transform: uppercase;
  margin-bottom: 3px;
}
.case-msg .who .av {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--teal); color: #000;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; letter-spacing: 0;
}
.case-msg .who .ts { margin-left: auto; opacity: 0.7; }
.case-msg.pilot .who { color: var(--teal); }
.case-msg.driver .who { color: #5B9CFF; }
.case-msg .txt {
  padding: 6px 10px; border-radius: 4px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text);
}
.case-msg.pilot .txt { border-color: rgba(45,212,191,0.3); }
.case-msg.driver .txt { border-color: rgba(91,156,255,0.3); }

.ecopilot-input {
  padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px;
  background: var(--panel);
}
.ecopilot-input input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  padding: 8px 10px; border-radius: 3px; color: var(--text); font-size: 12px;
}
.ecopilot-input input:focus { border-color: var(--teal); outline: none; }
.ecopilot-input .btn { padding: 7px 12px; }

/* Radar response inline */
.radar-inline { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 12px; margin-top: 8px; }
.radar-legend {
  display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px;
}
.radar-legend-item { display: flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text-dim); }
.radar-legend-item .dot { width: 10px; height: 10px; border-radius: 2px; }
.radar-legend-item.off { opacity: 0.35; text-decoration: line-through; }

/* Mini data table in chat */
.mini-table {
  margin-top: 8px; font-family: var(--mono); font-size: 10px;
  border: 1px solid var(--border); border-radius: 3px; overflow: hidden;
}
.mini-table-row {
  display: flex; padding: 6px 10px; border-bottom: 1px solid var(--border);
  justify-content: space-between;
}
.mini-table-row:last-child { border-bottom: none; }
.mini-table-row .k { color: var(--text-faint); }
.mini-table-row .v { color: var(--text); }

/* Action buttons in chat */
.chat-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* Bar list (carrier compare) */
.bar-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; }
.bar-row .lbl { width: 110px; color: var(--text-dim); }
.bar-row .bar { flex: 1; height: 10px; background: var(--panel); border: 1px solid var(--border); position: relative; border-radius: 2px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal-dim), var(--teal)); }
.bar-row .val { width: 60px; text-align: right; color: var(--text); }

/* Detail drawer */
.detail-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 340px;
  background: var(--panel); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.25s;
  z-index: 600; overflow-y: auto;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
.detail-drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel-2);
}
.drawer-head .ttl { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; }
.drawer-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

.kv-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 0; border-bottom: 1px dashed var(--border);
  font-family: var(--mono); font-size: 11px;
}
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--text-faint); }
.kv-row .v { color: var(--text); }

/* Progress bar */
.progress {
  height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal-dim), var(--teal)); transition: width 0.3s; }
.progress-fill.warn { background: var(--amber); }
.progress-fill.crit { background: var(--red); }

/* Toast */
.toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--panel); border: 1px solid var(--teal);
  padding: 10px 14px; border-radius: 4px;
  font-family: var(--mono); font-size: 11px; color: var(--text);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  animation: slideIn 0.25s cubic-bezier(0.4,0,0.2,1);
  min-width: 240px;
  display: flex; align-items: center; gap: 10px;
}
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Heatmap */
.heatmap-grid {
  display: grid; grid-template-columns: 100px repeat(8, 1fr);
  gap: 2px; font-family: var(--mono); font-size: 10px;
}
.heatmap-grid .hcell {
  aspect-ratio: 2/1; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); border-radius: 2px;
}
.heatmap-grid .hlabel {
  display: flex; align-items: center; padding: 0 8px; color: var(--text-faint);
}
.heatmap-grid .hhead {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 9px;
}

/* Tweaks panel */
.tweaks-panel {
  position: fixed; bottom: 20px; right: 20px;
  width: 260px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 6px;
  z-index: 2000; box-shadow: 0 10px 40px rgba(0,0,0,0.7);
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-head {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--teal); text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.tweak-group { display: flex; flex-direction: column; gap: 6px; }
.tweak-group label {
  font-family: var(--mono); font-size: 10px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* Charts */
.chart-wrap { height: 160px; position: relative; }

/* Compliance score */
.score-row {
  display: grid; grid-template-columns: 180px 1fr 60px 80px;
  gap: 10px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px;
}
.score-row:last-child { border-bottom: none; }
.badge-tag {
  display: inline-block; padding: 2px 6px; border-radius: 2px;
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em;
}
.badge-tag.platinum { background: rgba(91,156,255,0.15); color: var(--blue); border: 1px solid rgba(91,156,255,0.3); }
.badge-tag.gold { background: rgba(245,177,58,0.15); color: var(--amber); border: 1px solid rgba(245,177,58,0.3); }
.badge-tag.silver { background: rgba(139,149,163,0.15); color: var(--text-dim); border: 1px solid var(--border); }
.badge-tag.bronze { background: rgba(180,100,50,0.15); color: #CF8050; border: 1px solid rgba(180,100,50,0.3); }

/* Driver mobile view */
.driver-mobile-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(45,212,191,0.05), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(91,156,255,0.04), transparent 40%),
    var(--bg);
  padding: 20px;
}
.driver-phone {
  width: 400px; max-width: 100%; height: 100%; max-height: 820px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 32px; overflow: hidden; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
}
.driver-phone::before {
  content: ''; position: absolute; top: 16px; left: 50%;
  transform: translateX(-50%); width: 100px; height: 22px;
  background: #000; border-radius: 12px; z-index: 10;
}
.driver-statusbar {
  height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  padding-top: 10px;
}
.driver-content { flex: 1; overflow-y: auto; padding: 16px; }
.driver-hero {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.driver-checklist { display: flex; flex-direction: column; gap: 8px; }
.driver-check {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
}
.driver-check.done { border-color: var(--green); background: rgba(74,222,128,0.05); }
.check-box {
  width: 22px; height: 22px; border: 1.5px solid var(--border-2);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.driver-check.done .check-box { background: var(--green); border-color: var(--green); color: #000; }
.driver-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px;
}
.driver-btn {
  padding: 14px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 12px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.driver-btn.primary { background: var(--teal); color: #000; border-color: var(--teal); }
.driver-btn.danger { border-color: rgba(255,93,93,0.4); color: var(--red); }

/* Utility */
.hidden { display: none !important; }
.spacer { flex: 1; }
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.sep { height: 1px; background: var(--border); margin: 8px 0; }

/* Density tweak */
.density-calm .kpi { padding: 16px 18px; }
.density-calm .page-body { padding: 24px; }

/* ─────────────────────────────────────────────
   CITY DETAIL — inner drill-down
   ───────────────────────────────────────────── */

.city-detail-root {
  position: absolute; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  z-index: 700;
  opacity: 1;
}
@keyframes cityIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.city-crumb {
  height: 40px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.btn.ghost {
  padding: 5px 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 3px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.05em;
}
.btn.ghost:hover { border-color: var(--teal); color: var(--teal); }
.crumb-sep { color: var(--text-faint); font-size: 10px; }
.crumb-trail { font-size: 10px; color: var(--text-faint); letter-spacing: 0.08em; }
.crumb-current { font-size: 10px; color: var(--teal); letter-spacing: 0.08em; font-weight: 600; }

.city-stage {
  flex: 1; position: relative; overflow: hidden;
}
.city-map {
  position: absolute; inset: 0;
  background: #0A1016;
}
.city-map .leaflet-tile { filter: saturate(0.55) brightness(0.95); }
.city-map .leaflet-container { background: #0A1016 !important; }
.city-map .leaflet-control-zoom a {
  background: var(--panel) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

.city-overlay { position: absolute; z-index: 520; pointer-events: auto; }
.city-overlay.left { top: 12px; left: 12px; width: 280px; }
.city-overlay.right { top: 12px; right: 12px; width: 280px; display: flex; flex-direction: column; }
.city-overlay.top-center { top: 12px; left: 50%; transform: translateX(-50%); width: 420px; }
.city-overlay.top-right { top: 12px; right: 308px; width: 180px; }
.city-overlay.restriction-callout { top: 220px; left: 50%; transform: translateX(-50%); width: 230px; }
.city-overlay.bottom-right-legend { bottom: 48px; right: 308px; width: 220px; }
.city-overlay.bottom-legend { bottom: 8px; left: 12px; right: 308px; }
/* Facility popover — sits above the "Tráfico en tiempo real" legend in the bottom-right */
.city-overlay.popover { bottom: 168px; right: 308px; width: 320px; }
.city-popover-card .twin-img-wrap {
  position: relative;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.city-popover-card .twin-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.city-popover-card .twin-img-wrap .twin-tag {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0,0,0,0.65); color: var(--teal);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  padding: 2px 6px; border-radius: 2px;
  display: inline-flex; align-items: center; gap: 4px;
}
.city-popover-card .twin-img-wrap .twin-tag .live-d {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 6px var(--teal);
}
.city-popover-card .twin-img-wrap .twin-cta {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.7); color: var(--text);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em;
  padding: 3px 7px; border-radius: 2px; cursor: pointer;
  border: 1px solid var(--border);
}
.city-popover-card .twin-img-wrap .twin-cta:hover { color: var(--teal); border-color: var(--teal); }

/* Facility image dialog — centered full-image preview */
.facility-image-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.facility-image-dialog img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.facility-image-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  border: 1px solid var(--border);
  z-index: 2;
}

/* Neighborhood labels on map */
.city-neighborhood {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.15em;
  color: rgba(139,149,163,0.55); text-align: center; white-space: nowrap;
  text-shadow: 0 0 4px rgba(7,9,12,0.9);
  pointer-events: none;
}

/* Local map markers */
.city-wh {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--panel-2); border: 1.5px solid var(--blue);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 10px rgba(91,156,255,0.35);
}
.city-wh.hub { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 12px rgba(45,212,191,0.5); background: rgba(45,212,191,0.1); }
.city-wh.crit { border-color: var(--red); color: var(--red); box-shadow: 0 0 12px rgba(255,93,93,0.5); animation: pulse 1.5s infinite; }

.city-vh {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 4px;
  background: rgba(45,212,191,0.95); color: #04121B;
  border-radius: 14px;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}
.city-vh.warn { background: rgba(245,177,58,0.95); }
.city-vh.crit { background: rgba(255,93,93,0.95); color: #fff; animation: pulse 1.2s infinite; }
.city-vh.arrived { opacity: 0.55; filter: grayscale(0.4); }
.city-vh.arrived::after { content: '✓'; margin-left: 4px; font-size: 10px; }
.city-vh-label { letter-spacing: 0.05em; }

.city-restriction-pin {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(255,93,93,0.7);
  animation: pulse 1.2s infinite;
}

.city-route-line { filter: drop-shadow(0 0 4px currentColor); }

/* Left info card */
.city-info-card { padding: 0; }
.city-info-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  background: var(--panel-2);
}
.city-info-title { font-size: 14px; font-weight: 600; color: var(--text); }
.city-info-sub { font-size: 10px; color: var(--text-faint); letter-spacing: 0.06em; margin-top: 3px; text-transform: uppercase; }
.city-photo { padding: 12px 14px 0; }
.city-photo-inner {
  position: relative; aspect-ratio: 16/9;
  border-radius: 4px; overflow: hidden; border: 1px solid var(--border);
}
.city-photo-inner svg { width: 100%; height: 100%; display: block; }
.city-photo-tag {
  position: absolute; bottom: 6px; left: 6px;
  font-size: 9px; color: var(--text-faint); letter-spacing: 0.12em;
  background: rgba(7,9,12,0.7); padding: 2px 5px; border-radius: 2px;
}
.city-info-status {
  padding: 8px 14px; display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--green);
  border-bottom: 1px solid var(--border);
}
.city-info-metrics { padding: 12px 14px; }
.cm-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
  font-family: var(--mono); font-size: 11px;
}
.cm-k { color: var(--text-faint); font-size: 10px; letter-spacing: 0.06em; }
.cm-v { color: var(--text); }
.city-warn-card {
  margin: 0 14px 12px;
  padding: 10px; border: 1px solid rgba(245,177,58,0.3);
  background: rgba(245,177,58,0.06); border-radius: 4px;
  display: flex; gap: 8px; align-items: flex-start;
  color: var(--amber);
}
.city-warn-card .cw-title { font-size: 11px; color: var(--text); line-height: 1.35; }
.city-warn-card .cw-sub { font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.city-info-card > button.btn.primary { margin: 0 14px 14px; }

/* Top-center search */
.city-search {
  display: flex; gap: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
.city-search-select {
  background: var(--panel-2); color: var(--text);
  border: none; border-right: 1px solid var(--border);
  padding: 8px 10px; font-size: 11px;
  outline: none; appearance: none;
  min-width: 110px;
  font-family: var(--mono); letter-spacing: 0.05em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 12 12'><path d='M2 4 L6 8 L10 4' stroke='%238B95A3' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 26px;
}
.city-search-input {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; color: var(--text-faint);
}
.city-search-input input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 12px; padding: 8px 0;
}
.city-search-input input::placeholder { color: var(--text-faint); }

/* Top-right layers panel */
.city-layers { padding: 8px; }
.city-layer-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  font-family: var(--mono); font-size: 11px; color: var(--text);
  cursor: pointer;
}
.city-layer-row:hover { background: var(--panel-2); border-radius: 3px; }
.cbox {
  width: 14px; height: 14px; border: 1.5px solid var(--border-2);
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  color: #000; flex-shrink: 0;
}
.cbox.on { background: var(--teal); border-color: var(--teal); }

/* Restriction callout */
.restriction-callout .panel { padding: 0; box-shadow: 0 10px 32px rgba(0,0,0,0.6); }
.rc-head {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
  color: var(--red); background: rgba(255,93,93,0.06);
}
.rc-title { font-size: 11px; font-weight: 600; color: var(--text); }
.rc-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.rc-line { display: flex; align-items: center; gap: 6px; color: var(--text); }
.rc-line.mono { font-family: var(--mono); font-size: 10px; }
.rc-detour {
  margin-top: 6px; padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 10px; color: var(--text-faint); letter-spacing: 0.05em;
}

/* City lists (right side) */
.city-list { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.city-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.city-list-row:last-child { border-bottom: none; }
.city-list-row:hover { background: var(--panel-2); }
.list-ico {
  width: 26px; height: 26px; border-radius: 4px;
  background: var(--panel-2); border: 1px solid var(--blue);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.list-ico.wh.alert { border-color: var(--red); color: var(--red); }
.list-ico.vh { border-radius: 50%; border-width: 1.5px; }
.list-body { flex: 1; min-width: 0; }
.list-name { font-size: 11px; color: var(--text); font-weight: 500; }
.list-sub {
  font-size: 10px; color: var(--text-faint); margin-top: 2px;
  display: flex; align-items: center; gap: 5px;
}
.list-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.list-dot.crit { background: var(--red); }
.list-meta { font-size: 10px; color: var(--text-dim); white-space: nowrap; }

.city-list-cta {
  width: calc(100% - 20px); margin: 8px 10px 10px;
  padding: 8px 12px; border: 1px solid rgba(45,212,191,0.3);
  background: rgba(45,212,191,0.06); color: var(--teal);
  border-radius: 3px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.city-list-cta:hover { background: rgba(45,212,191,0.12); }
.mini-x {
  width: 18px; height: 18px; color: var(--text-faint);
  display: flex; align-items: center; justify-content: center;
}
.mini-x:hover { color: var(--text); }

/* Traffic legend (bottom-right) */
.bottom-right-legend .panel { padding: 0; }
.traffic-gradient {
  display: flex; height: 10px; margin: 10px 12px 4px;
  border-radius: 2px; overflow: hidden;
}
.traffic-gradient span:nth-child(1) { flex: 1; background: #4ADE80; }
.traffic-gradient span:nth-child(2) { flex: 1; background: #F5B13A; }
.traffic-gradient span:nth-child(3) { flex: 1; background: #FF8C3E; }
.traffic-gradient span:nth-child(4) { flex: 1; background: #FF5D5D; }
.traffic-labels {
  display: flex; justify-content: space-between;
  padding: 0 12px 10px;
  font-size: 9px; color: var(--text-faint); letter-spacing: 0.05em;
}

/* Bottom legend bar */
.city-legend-bar {
  background: rgba(16,21,29,0.92); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px; color: var(--text-dim);
}
.clb-title { color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.clb-item { display: flex; align-items: center; gap: 6px; }
.clb-dot { width: 8px; height: 8px; border-radius: 50%; }
.clb-dot.crit { background: var(--red); border: 1.5px dashed #fff; }
.clb-line { width: 22px; height: 0; border-top: 2px solid; }
.clb-line.solid { border-top-style: solid; height: 2px; border: none; }
.clb-line.dashed { border-top-style: dashed; }
.clb-sep { width: 1px; height: 14px; background: var(--border); }

/* Popover card */
.city-popover-card { padding: 0; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.density-calm .grid { gap: 16px; }
.density-busy .kpi { padding: 8px 10px; }
.density-busy .kpi-value { font-size: 20px; }
.density-busy .page-body { padding: 12px 14px; }
.density-busy .grid { gap: 8px; }

/* Scanlines on panels (subtle) */
.scanlines {
  position: relative;
}
.scanlines::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent 0, transparent 3px, rgba(255,255,255,0.006) 3px, rgba(255,255,255,0.006) 4px);
}

/* Sparkline (canvas placeholder) */
svg.spark { width: 100%; height: 100%; }

/* Bottom scenario legend */
.legend-chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; color: var(--text-dim); }
.legend-chip .dot { width: 10px; height: 10px; border-radius: 2px; }
