/* ==========================================================================
   FlowGrid design system — palette sampled from the FlowGrid logo
   forest #003F1F · green #0B7A3B · lime #7AC943 · gold #FCC000
   ========================================================================== */
:root {
  --fg-forest: #003f1f;
  --fg-forest-2: #00552a;
  --fg-green: #0b7a3b;
  --fg-green-bright: #17a34a;
  --fg-lime: #7ac943;
  --fg-gold: #fcc000;
  --fg-gold-2: #ffd23f;
  --fg-gold-deep: #c99700;

  --bg: #f3f6f1;
  --surface: #ffffff;
  --surface-2: #f7faf5;
  --surface-3: #eaf1e6;
  --border: #dce6d8;
  --border-strong: #c3d3bd;
  --text: #0c1f14;
  --text-2: #33493b;
  --muted: #66796c;
  --primary: #0b6b34;
  --primary-hover: #00552a;
  --primary-soft: rgba(11, 122, 59, .1);
  --accent: #fcc000;
  --accent-ink: #2b2100;
  --accent-soft: rgba(252, 192, 0, .16);
  --danger: #d0342c;
  --danger-soft: rgba(208, 52, 44, .1);
  --info: #0e7c86;

  --lvl-free: #1fa855;
  --lvl-moderate: #f2b705;
  --lvl-heavy: #ef7d22;
  --lvl-severe: #d3302a;
  --lvl-closed: #7a1d1d;

  --map-bg: #edf3e9;
  --map-grid: rgba(0, 63, 31, .07);
  --map-water: #cfe6ea;
  --map-park: #d7ecc9;
  --road-casing: #ffffff;
  --road-base: #b9c9b3;
  --node-fill: #ffffff;
  --node-stroke: #003f1f;
  --node-text: #003f1f;
  --label: #33493b;
  --label-halo: #edf3e9;
  --vehicle: #003f1f;
  --route-main: #003f1f;
  --route-flow: #fcc000;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 40, 20, .06);
  --shadow: 0 1px 2px rgba(0, 40, 20, .05), 0 8px 24px rgba(0, 40, 20, .06);
  --shadow-lg: 0 24px 60px rgba(0, 40, 20, .14);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Montserrat", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-w: 264px;

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
  --bs-emphasis-color: var(--text);
  --bs-link-color: var(--primary);
  --bs-link-hover-color: var(--primary-hover);
  --bs-link-color-rgb: 11, 107, 52;
  --bs-link-hover-color-rgb: 0, 85, 42;
  --bs-body-font-family: var(--font-sans);
  --bs-focus-ring-color: rgba(23, 163, 74, .3);
}

[data-bs-theme="dark"] {
  --bg: #06110b;
  --surface: #0c1b13;
  --surface-2: #10231a;
  --surface-3: #153022;
  --border: #1d382a;
  --border-strong: #2a4d3a;
  --text: #e6f1e9;
  --text-2: #bcd0c3;
  --muted: #8aa293;
  --primary: #22b35e;
  --primary-hover: #3fcb77;
  --primary-soft: rgba(34, 179, 94, .14);
  --accent-soft: rgba(252, 192, 0, .14);
  --danger: #f0605a;
  --danger-soft: rgba(240, 96, 90, .14);
  --info: #45c2cc;

  --map-bg: #0a1810;
  --map-grid: rgba(122, 201, 67, .07);
  --map-water: #0f2a33;
  --map-park: #10301b;
  --road-casing: #06110b;
  --road-base: #2c4636;
  --node-fill: #0c1b13;
  --node-stroke: #7ac943;
  --node-text: #e6f1e9;
  --label: #bcd0c3;
  --label-halo: #0a1810;
  --vehicle: #fcc000;
  --route-main: #ffffff;
  --route-flow: #003f1f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
  --bs-emphasis-color: var(--text);
  --bs-link-color-rgb: 34, 179, 94;
  --bs-link-hover-color-rgb: 63, 203, 119;
}

/* ------------------------------------------------------------------ base */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .9375rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .display-font { font-family: var(--font-display); letter-spacing: -.02em; color: var(--text); }
h5, h6 { color: var(--text); }
a { text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
.text-muted, .text-secondary { color: var(--muted) !important; }
.mono, code, pre { font-family: var(--font-mono); }
code { color: var(--primary); font-size: .85em; }
.tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid rgba(23, 163, 74, .45); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ brand */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; background: #fff;
  display: grid; place-items: center; box-shadow: 0 0 0 1px var(--border), var(--shadow-sm); flex: none;
}
.brand-mark img { width: 30px; height: 30px; }
.brand-word { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 1.35rem; letter-spacing: -.03em; line-height: 1; }
.brand-word .flow { color: var(--fg-forest); }
.brand-word .grid { color: var(--fg-gold); }
[data-bs-theme="dark"] .brand-word .flow { color: #fff; }
.brand-sub { display: block; font-size: .58rem; letter-spacing: .2em; font-weight: 700; color: var(--muted); text-transform: uppercase; font-style: normal; margin-top: 3px; font-family: var(--font-sans); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--primary);
}
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--accent); }

/* ------------------------------------------------------------------ buttons */
.btn { font-weight: 600; border-radius: 10px; padding: .55rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.35rem; font-size: 1rem; border-radius: 12px; }
.btn-fg { background: var(--fg-forest); color: #fff; border: 1px solid var(--fg-forest); box-shadow: 0 6px 16px rgba(0, 63, 31, .18); }
.btn-fg:hover, .btn-fg:focus-visible { background: var(--fg-forest-2); color: #fff; border-color: var(--fg-forest-2); }
[data-bs-theme="dark"] .btn-fg { background: var(--fg-green-bright); border-color: var(--fg-green-bright); color: #03140a; box-shadow: none; }
[data-bs-theme="dark"] .btn-fg:hover { background: #2fc263; border-color: #2fc263; color: #03140a; }
.btn-accent { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); box-shadow: 0 6px 16px rgba(252, 192, 0, .25); }
.btn-accent:hover, .btn-accent:focus-visible { background: var(--fg-gold-2); color: var(--accent-ink); border-color: var(--fg-gold-2); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.btn-ghost.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); border: 1px solid transparent; }
.btn-danger-soft:hover { background: var(--danger); color: #fff; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn .spinner-border { width: 1rem; height: 1rem; border-width: 2px; }

/* segmented control */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: .8rem; padding: .38rem .7rem; border-radius: 8px; transition: background .15s, color .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.segmented.w-100 { display: flex; }
.segmented.w-100 button { flex: 1 1 auto; white-space: nowrap; padding-left: .5rem; padding-right: .5rem; }

/* ------------------------------------------------------------------ forms */
.form-label { font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; }
.form-control, .form-select { background-color: var(--surface); border-color: var(--border-strong); color: var(--text); border-radius: 10px; font-size: .9rem; }
.form-control:focus, .form-select:focus { background-color: var(--surface); color: var(--text); border-color: var(--fg-green-bright); box-shadow: 0 0 0 .2rem rgba(23, 163, 74, .18); }
.form-range::-webkit-slider-thumb { background: var(--fg-green-bright); }
.form-range::-moz-range-thumb { background: var(--fg-green-bright); }
.form-range::-webkit-slider-runnable-track { background: var(--surface-3); }
.form-range::-moz-range-track { background: var(--surface-3); }
.form-check-input:checked { background-color: var(--fg-green-bright); border-color: var(--fg-green-bright); }
.input-group-text { background: var(--surface-3); border-color: var(--border-strong); color: var(--muted); font-size: .8rem; border-radius: 10px; }

/* ------------------------------------------------------------------ cards / panels */
.card-fg {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; position: relative;
}
.card-fg.pad-0 { padding: 0; }
.card-fg.flat { box-shadow: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-title { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; font-family: var(--font-sans); letter-spacing: -.01em; }
.card-title .bi { color: var(--primary); }
.card-sub { font-size: .8rem; color: var(--muted); margin: .15rem 0 0; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700;
  padding: .25rem .6rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.chip-live { background: var(--primary-soft); color: var(--primary); }
.chip-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-green-bright); box-shadow: 0 0 0 0 rgba(23, 163, 74, .6); animation: pulse 1.8s infinite; }
.chip-warn { background: var(--accent-soft); color: #8a6500; }
[data-bs-theme="dark"] .chip-warn { color: var(--fg-gold); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: rgba(14, 124, 134, .12); color: var(--info); }
.chip-gold { background: var(--accent); color: var(--accent-ink); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(23, 163, 74, .55); } 70% { box-shadow: 0 0 0 8px rgba(23, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(23, 163, 74, 0); } }

.los { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 800; font-size: .8rem; color: #fff; }
.los-A, .los-B { background: var(--lvl-free); }
.los-C { background: #8fbf2a; }
.los-D { background: var(--lvl-moderate); color: #2b2100; }
.los-E { background: var(--lvl-heavy); }
.los-F { background: var(--lvl-severe); }

/* KPI tiles */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); height: 100%; position: relative; overflow: hidden; }
.kpi-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: .4rem; }
.kpi-label .bi { color: var(--primary); font-size: .9rem; }
.kpi-value { font-family: var(--font-display); font-weight: 800; font-size: 1.85rem; letter-spacing: -.03em; margin: .35rem 0 .15rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-value small { font-size: .9rem; font-weight: 600; color: var(--muted); margin-left: .15rem; letter-spacing: 0; }
.kpi-foot { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.delta-up { color: var(--danger); font-weight: 700; }
.delta-down { color: var(--lvl-free); font-weight: 700; }
.delta-good.delta-up { color: var(--lvl-free); }
.delta-good.delta-down { color: var(--danger); }
.kpi::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); opacity: 0; transition: opacity .3s; }
.kpi.flash::after { opacity: 1; }

/* tables */
.table-fg { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); margin: 0; font-size: .85rem; }
.table-fg thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; border-bottom-width: 1px; white-space: nowrap; background: transparent; }
.table-fg td { vertical-align: middle; }
.table-fg tbody tr:hover { background: var(--surface-2); }
.table-fg .best td { background: var(--accent-soft); }

/* progress bars */
.bar { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--fg-green-bright); transition: width .6s cubic-bezier(.2, .8, .2, 1), background-color .4s; }

/* ------------------------------------------------------------------ app shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; }
  .sidebar .offcanvas-body { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
}
.sidebar .offcanvas-body { padding: 1.15rem 1rem; }
.sidebar-brand { padding: .25rem .4rem 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.nav-group { font-size: .66rem; font-weight: 800; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; padding: .9rem .75rem .45rem; }
.side-link {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: .88rem; position: relative; transition: background .15s, color .15s;
}
.side-link .bi { font-size: 1.05rem; width: 1.2rem; text-align: center; color: var(--muted); transition: color .15s; }
.side-link:hover { background: var(--surface-3); color: var(--text); }
.side-link.active { background: var(--primary-soft); color: var(--primary); }
.side-link.active .bi { color: var(--primary); }
.side-link.active::before { content: ""; position: absolute; left: -1rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.side-link .badge-new { margin-left: auto; font-size: .6rem; font-weight: 800; background: var(--accent); color: var(--accent-ink); padding: .15rem .4rem; border-radius: 6px; letter-spacing: .05em; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; }
.engine-card { background: linear-gradient(135deg, var(--fg-forest), #0b5a2c); color: #e6f4ea; border-radius: var(--radius); padding: 1rem; font-size: .78rem; position: relative; overflow: hidden; }
.engine-card::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; border: 18px solid rgba(252, 192, 0, .2); }
.engine-card strong { color: #fff; font-size: .85rem; display: flex; align-items: center; gap: .45rem; }
.engine-card .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-gold); box-shadow: 0 0 0 4px rgba(252, 192, 0, .2); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; height: 64px; display: flex; align-items: center; gap: .75rem;
  padding: 0 1.5rem; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .crumbs { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.topbar .crumbs strong { color: var(--text); font-weight: 700; }
.app-content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem 1.5rem; font-size: .75rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.75rem; font-weight: 800; margin: .35rem 0 .25rem; }
.page-head p { color: var(--muted); margin: 0; max-width: 680px; }
@media (max-width: 575.98px) {
  .app-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .page-head h1 { font-size: 1.4rem; }
  .card-fg { padding: 1rem; }
}

/* ------------------------------------------------------------------ map */
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--map-bg); border: 1px solid var(--border); }
.map-wrap svg { display: block; width: 100%; height: auto; user-select: none; }
.fgmap .bg { fill: var(--map-bg); }
.fgmap .grid-line { stroke: var(--map-grid); stroke-width: 1; }
.fgmap .water { fill: var(--map-water); }
.fgmap .park { fill: var(--map-park); }
.fgmap .decor-label { fill: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .2em; opacity: .6; font-family: var(--font-sans); text-transform: uppercase; }
.fgmap .road-casing { stroke: var(--road-casing); stroke-linecap: round; }
.fgmap .road-line { stroke: var(--road-base); stroke-linecap: round; transition: stroke .6s ease, opacity .3s; }
.fgmap .road-center { stroke: rgba(255, 255, 255, .85); stroke-dasharray: 10 12; stroke-width: 1.6; pointer-events: none; }
[data-bs-theme="dark"] .fgmap .road-center { stroke: rgba(255, 255, 255, .25); }
.fgmap .road-hit { stroke: transparent; stroke-width: 22; cursor: default; }
.fgmap.clickable-roads .road-hit { cursor: pointer; }
.fgmap .road[data-level="free"] .road-line { stroke: var(--lvl-free); }
.fgmap .road[data-level="moderate"] .road-line { stroke: var(--lvl-moderate); }
.fgmap .road[data-level="heavy"] .road-line { stroke: var(--lvl-heavy); }
.fgmap .road[data-level="severe"] .road-line { stroke: var(--lvl-severe); }
.fgmap .road[data-level="closed"] .road-line { stroke: var(--lvl-closed); stroke-dasharray: 4 10; }
.fgmap .road.user-closed .road-line { stroke: var(--danger) !important; stroke-dasharray: 3 9; }
.fgmap .road.dim .road-line { opacity: .22; }
.fgmap .road.mst .road-line { stroke: var(--fg-gold) !important; }
.fgmap .road:hover .road-line { filter: brightness(1.08); }
.fgmap .overlay path { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.fgmap .route-glow { stroke: var(--fg-gold); stroke-width: 24; opacity: .35; }
.fgmap .route-main { stroke: var(--route-main); stroke-width: 9; }
.fgmap .route-flow { stroke: var(--route-flow); stroke-width: 3.5; stroke-dasharray: 3 13; animation: flow 1s linear infinite; }
.fgmap .route-alt { stroke-width: 7; opacity: .9; }
.fgmap .route-ghost { stroke: var(--muted); stroke-width: 6; stroke-dasharray: 2 10; opacity: .7; }
.fgmap .route-emergency { stroke: var(--danger); stroke-width: 9; }
.fgmap .route-emergency-flow { stroke: #fff; stroke-width: 3; stroke-dasharray: 12 14; animation: flow .5s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -32; } }
.fgmap .node { cursor: default; }
.fgmap.clickable-nodes .node { cursor: pointer; }
.fgmap .node-ring { fill: none; stroke: var(--lvl-free); stroke-width: 4; opacity: 0; transition: stroke .5s, opacity .3s; }
.fgmap.show-load .node-ring { opacity: .9; }
.fgmap .node-dot { fill: var(--node-fill); stroke: var(--node-stroke); stroke-width: 3; transition: fill .25s, stroke .25s, r .2s; }
.fgmap .node-code { fill: var(--node-text); font-size: 10px; font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; font-family: var(--font-sans); letter-spacing: .02em; }
.fgmap .node-label { fill: var(--label); font-size: 16px; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--label-halo); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; font-family: var(--font-sans); }
.fgmap.hide-labels .node-label { display: none; }
.fgmap .node:hover .node-dot { stroke: var(--fg-gold); }
.fgmap .node.hospital .node-dot { fill: #d3302a; stroke: #fff; }
.fgmap .node.hospital .node-code { fill: #fff; }
.fgmap .node.visited .node-dot { fill: var(--accent); stroke: var(--fg-forest); }
.fgmap .node.visited .node-code { fill: var(--fg-forest); }
.fgmap .node.on-path .node-dot { fill: var(--fg-forest); stroke: var(--fg-gold); }
.fgmap .node.on-path .node-code { fill: #fff; }
[data-bs-theme="dark"] .fgmap .node.on-path .node-dot { fill: var(--fg-gold); stroke: #fff; }
[data-bs-theme="dark"] .fgmap .node.on-path .node-code { fill: #03140a; }
.fgmap .node.selected .node-dot { stroke: var(--fg-gold); stroke-width: 5; }
.fgmap .node.center .node-dot { fill: var(--fg-gold); stroke: var(--fg-forest); stroke-width: 4; }
.fgmap .node.center .node-code { fill: var(--fg-forest); }
.fgmap .ripple { fill: none; stroke: var(--fg-gold); stroke-width: 3; animation: ripple .9s ease-out forwards; pointer-events: none; transform-box: fill-box; transform-origin: center; }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(2.8); opacity: 0; } }
.fgmap .vehicle { fill: var(--vehicle); stroke: var(--map-bg); stroke-width: 1.5; pointer-events: none; }
.fgmap .vehicle.ev { fill: var(--danger); }
.fgmap .incident circle.pulse { fill: var(--danger); opacity: .25; animation: incident 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.fgmap .incident circle.core { fill: var(--danger); stroke: #fff; stroke-width: 2.5; }
.fgmap .incident.warning circle.core, .fgmap .incident.warning circle.pulse { fill: #e08a00; }
.fgmap .incident text { fill: #fff; font-weight: 900; font-size: 13px; text-anchor: middle; dominant-baseline: central; font-family: var(--font-sans); }
@keyframes incident { from { transform: scale(.6); opacity: .5; } to { transform: scale(1.8); opacity: 0; } }
.fgmap .pin path { stroke: #fff; stroke-width: 2; }
.fgmap .pin text { fill: #fff; font-weight: 900; font-size: 13px; text-anchor: middle; font-family: var(--font-sans); }
.fgmap .pin.a path { fill: var(--fg-forest); }
[data-bs-theme="dark"] .fgmap .pin.a path { fill: var(--fg-green-bright); }
.fgmap .pin.b path { fill: var(--fg-gold-deep); }
.fgmap .node.preempted .node-dot { stroke: var(--lvl-free); stroke-width: 5; fill: var(--node-fill); }
.fgmap .node.preempted .node-code { fill: var(--node-text); }
.fgmap .node.hospital.preempted .node-dot { fill: #d3302a; }
.fgmap .node.hospital.preempted .node-code { fill: #fff; }

.map-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .74rem; color: var(--muted); font-weight: 600; }
.map-legend i { display: inline-block; width: 18px; height: 5px; border-radius: 3px; vertical-align: middle; margin-right: .35rem; }
.map-overlay-tl, .map-overlay-tr, .map-overlay-bl { position: absolute; z-index: 2; }
.map-overlay-tl { top: 12px; left: 12px; }
.map-overlay-tr { top: 12px; right: 12px; }
.map-overlay-bl { bottom: 12px; left: 12px; }
.glass { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.map-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 170px; max-width: 260px; padding: .6rem .75rem; font-size: .78rem;
  transform: translate(-50%, calc(-100% - 14px)); opacity: 0; transition: opacity .12s; color: var(--text);
}
.map-tip.show { opacity: 1; }
.map-tip b { font-size: .84rem; display: block; margin-bottom: .2rem; }
.map-tip .row-kv { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); }
.map-tip .row-kv span:last-child { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------ dashboard */
.clock-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.clock-big { font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.clock-meta { font-size: .75rem; color: var(--muted); font-weight: 600; }
.demand-meter { width: 140px; }
.alert-feed { display: flex; flex-direction: column; gap: .6rem; max-height: 360px; overflow-y: auto; padding-right: .25rem; }
.alert-item { display: flex; gap: .7rem; padding: .7rem .75rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); animation: slideIn .35s ease; }
.alert-item .ai-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 1rem; }
.alert-item.critical .ai-icon { background: var(--danger-soft); color: var(--danger); }
.alert-item.warning .ai-icon { background: var(--accent-soft); color: #a77800; }
[data-bs-theme="dark"] .alert-item.warning .ai-icon { color: var(--fg-gold); }
.alert-item.info .ai-icon { background: var(--primary-soft); color: var(--primary); }
.alert-item .ai-title { font-weight: 700; font-size: .82rem; display: flex; justify-content: space-between; gap: .5rem; }
.alert-item .ai-title time { font-weight: 600; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.alert-item .ai-msg { font-size: .78rem; color: var(--text-2); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.empty-state { text-align: center; padding: 1.5rem 1rem; color: var(--muted); font-size: .85rem; }
.empty-state .bi { font-size: 1.6rem; display: block; margin-bottom: .4rem; color: var(--primary); }
.signal-row { display: grid; grid-template-columns: 1fr 64px 70px; gap: .75rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--border); font-size: .82rem; }
.signal-row:last-child { border-bottom: 0; }
.signal-row .name { font-weight: 600; }
.signal-row .name small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; }
.phase-pill { font-size: .68rem; font-weight: 800; padding: .2rem .45rem; border-radius: 6px; background: var(--primary-soft); color: var(--primary); text-align: center; font-variant-numeric: tabular-nums; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.chart-box.short { height: 190px; }

/* ------------------------------------------------------------------ route planner */
.step-list { list-style: none; padding: 0; margin: 0; position: relative; }
.step-list li { position: relative; padding: 0 0 .9rem 1.9rem; font-size: .84rem; }
.step-list li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--border-strong); }
.step-list li:last-child::before { display: none; }
.step-list .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.step-list li:first-child .dot { background: var(--primary); }
.step-list li:last-child .dot { background: var(--accent); border-color: var(--fg-gold-deep); }
.step-list .leg { font-size: .74rem; color: var(--muted); }
.lvl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.lvl-free { background: var(--lvl-free); } .lvl-moderate { background: var(--lvl-moderate); } .lvl-heavy { background: var(--lvl-heavy); } .lvl-severe { background: var(--lvl-severe); } .lvl-closed { background: var(--lvl-closed); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .65rem .8rem; }
.stat span { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; display: block; }
.stat strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat strong small { font-size: .75rem; color: var(--muted); font-weight: 600; margin-left: .15rem; }
.alt-card { border: 2px solid var(--border); border-radius: 12px; padding: .7rem .85rem; cursor: pointer; transition: border-color .15s, background .15s; background: var(--surface); width: 100%; text-align: left; color: var(--text); }
.alt-card:hover, .alt-card.active { border-color: var(--alt-color, var(--primary)); background: var(--surface-2); }
.alt-swatch { display: inline-block; width: 22px; height: 6px; border-radius: 3px; background: var(--alt-color); margin-right: .4rem; vertical-align: middle; }
.closure-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .2rem .3rem .2rem .55rem; border-radius: 999px; background: var(--danger-soft); color: var(--danger); margin: 0 .3rem .3rem 0; }
.closure-chip button { border: 0; background: transparent; color: inherit; padding: 0 .15rem; line-height: 1; }
.hint { font-size: .76rem; color: var(--muted); display: flex; gap: .45rem; align-items: flex-start; }
.hint .bi { color: var(--fg-gold-deep); margin-top: .1rem; }
.compare-bar { display: flex; align-items: center; gap: .5rem; }
.compare-bar .bar { flex: 1; }
.big-saving { font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; color: var(--danger); line-height: 1; letter-spacing: -.04em; }

/* ------------------------------------------------------------------ signals */
.approach-row { display: grid; grid-template-columns: 74px 1fr 92px; gap: .75rem; align-items: center; margin-bottom: .7rem; }
.approach-row label { font-weight: 700; font-size: .84rem; display: flex; align-items: center; gap: .45rem; }
.approach-dot { width: 10px; height: 10px; border-radius: 3px; }
.junction-wrap { position: relative; background: var(--map-bg); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.junction svg { display: block; width: 100%; height: auto; }
.junction .asphalt { fill: #3a4a40; }
[data-bs-theme="dark"] .junction .asphalt { fill: #1c2b22; }
.junction .verge { fill: var(--map-park); }
.junction .lane-mark { stroke: rgba(255, 255, 255, .7); stroke-width: 2; stroke-dasharray: 10 10; }
.junction .stop-line { stroke: #fff; stroke-width: 4; }
.junction .zebra { fill: rgba(255, 255, 255, .55); }
.junction .car { rx: 3; }
.junction .head { fill: #1b1f1d; stroke: #000; stroke-width: 1; }
.junction .lamp { fill: #3b3f3c; transition: fill .15s; }
.junction .lamp.on-red { fill: #ff4a3d; filter: drop-shadow(0 0 4px #ff4a3d); }
.junction .lamp.on-yellow { fill: #ffc400; filter: drop-shadow(0 0 4px #ffc400); }
.junction .lamp.on-green { fill: #2ee66f; filter: drop-shadow(0 0 4px #2ee66f); }
.junction .qlabel { fill: #fff; font-size: 12px; font-weight: 800; font-family: var(--font-sans); }
.dial svg { width: 100%; max-width: 230px; display: block; margin: 0 auto; }
.dial .needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.dial text { font-family: var(--font-sans); }
.alloc-bars { display: flex; height: 46px; border-radius: 10px; overflow: hidden; gap: 3px; }
.alloc-bars > div { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .78rem; transition: flex-grow .5s ease; min-width: 0; white-space: nowrap; overflow: hidden; }
.big-number { font-family: var(--font-display); font-size: 2.4rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-number small { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }

/* ------------------------------------------------------------------ simulation lab */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.preset { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 12px; padding: .6rem .75rem; text-align: left; color: var(--text); transition: border-color .15s, background .15s; }
.preset:hover, .preset.active { border-color: var(--primary); background: var(--primary-soft); }
.preset strong { display: block; font-size: .82rem; }
.preset span { font-size: .72rem; color: var(--muted); }
.strategy-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: var(--surface); height: 100%; position: relative; box-shadow: var(--shadow); border-top: 4px solid var(--s-color, var(--primary)); }
.strategy-card.winner { box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); }
.strategy-card .trophy { position: absolute; top: .8rem; right: .8rem; }
.strategy-card h6 { font-weight: 700; font-size: .86rem; margin-bottom: .6rem; padding-right: 4.5rem; }
.strategy-card .metric-main { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.strategy-card .metric-main small { font-size: .78rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.strategy-card dl { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; font-size: .78rem; margin: .5rem 0 0; }
.strategy-card dt { color: var(--muted); font-weight: 500; }
.strategy-card dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.winner-banner { background: linear-gradient(110deg, var(--fg-forest) 0%, #0b5a2c 60%, #2f7d1f 100%); color: #fff; border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; position: relative; overflow: hidden; }
.winner-banner::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 30px solid rgba(252, 192, 0, .18); }
.winner-banner .wb-num { font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; color: var(--fg-gold); letter-spacing: -.04em; line-height: 1; }
.winner-banner p { margin: 0; color: #d4ead9; font-size: .85rem; }
.winner-banner h3 { color: #fff; font-size: 1.15rem; margin: 0 0 .2rem; }
.timeline { display: flex; flex-direction: column; gap: .55rem; }
.tl-row { display: grid; grid-template-columns: 150px 1fr; gap: .75rem; align-items: center; font-size: .78rem; font-weight: 600; }
.tl-track { position: relative; height: 22px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.tl-seg { position: absolute; top: 0; bottom: 0; }
.tl-axis { display: grid; grid-template-columns: 150px 1fr; gap: .75rem; font-size: .68rem; color: var(--muted); }
.tl-axis .ticks { display: flex; justify-content: space-between; }
.tl-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .74rem; color: var(--muted); font-weight: 600; }
.tl-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: .35rem; }
@media (max-width: 575.98px) { .tl-row, .tl-axis { grid-template-columns: 92px 1fr; } }

/* ------------------------------------------------------------------ analytics */
.heatmap { display: grid; gap: 2px; font-size: .62rem; font-variant-numeric: tabular-nums; }
.heatmap .hm-cell { height: 26px; border-radius: 3px; display: grid; place-items: center; font-weight: 700; color: rgba(0, 0, 0, .65); cursor: default; transition: transform .1s; }
.heatmap .hm-cell:hover { transform: scale(1.25); z-index: 2; box-shadow: var(--shadow); outline: 2px solid var(--text); }
.heatmap .hm-head { display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: .58rem; }
.heatmap .hm-head.row { display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }
.hm-scale { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #e9f7d9, #7ac943, #0b7a3b, #003f1f); }
.rank-row { display: grid; grid-template-columns: 22px 1fr 100px 62px; gap: .6rem; align-items: center; font-size: .8rem; padding: .35rem 0; }
.rank-row .rk { font-weight: 800; color: var(--muted); }
.complexity-badge { font-family: var(--font-mono); font-size: .76rem; background: var(--surface-3); padding: .15rem .45rem; border-radius: 6px; color: var(--text); white-space: nowrap; }
.check-ok { color: var(--lvl-free); font-weight: 700; }

/* ------------------------------------------------------------------ API docs */
.endpoint { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.endpoint + .endpoint { margin-top: .75rem; }
.endpoint-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; flex-wrap: wrap; }
.method { font-family: var(--font-mono); font-size: .72rem; font-weight: 800; padding: .25rem .5rem; border-radius: 6px; min-width: 52px; text-align: center; }
.method.get { background: var(--primary-soft); color: var(--primary); }
.method.post { background: var(--accent-soft); color: #8a6500; }
[data-bs-theme="dark"] .method.post { color: var(--fg-gold); }
.endpoint-path { font-family: var(--font-mono); font-weight: 700; font-size: .88rem; }
.endpoint-desc { color: var(--muted); font-size: .82rem; flex: 1 1 260px; }
.endpoint-body { border-top: 1px solid var(--border); padding: 1rem; background: var(--surface-2); display: none; }
.endpoint.open .endpoint-body { display: block; }
.code-block { background: #0a1a11; color: #d5ecd9; border-radius: 10px; padding: .85rem 1rem; font-size: .78rem; max-height: 340px; overflow: auto; margin: 0; white-space: pre; }
.code-block .k { color: #fcc000; } .code-block .s { color: #9be08c; } .code-block .n { color: #7fd3ff; }

/* ------------------------------------------------------------------ landing */
.site-nav { position: sticky; top: 0; z-index: 1030; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-nav.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.site-nav .nav-link { color: var(--text-2); font-weight: 600; font-size: .9rem; padding: .5rem .85rem !important; border-radius: 8px; }
.site-nav .nav-link:hover { color: var(--text); background: var(--surface-3); }
.hero { position: relative; overflow: hidden; padding: 4.5rem 0 5rem; background: var(--bg); isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--map-grid) 1px, transparent 1px), linear-gradient(90deg, var(--map-grid) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 30%, transparent 75%); z-index: -1;
}
.hero::after { content: ""; position: absolute; width: 640px; height: 640px; right: -160px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(252, 192, 0, .2), transparent 65%); pointer-events: none; z-index: -1; }
.hero-logo { width: 100%; max-width: 560px; height: auto; mix-blend-mode: multiply; margin-left: -10px; }
[data-bs-theme="dark"] .hero-logo { mix-blend-mode: normal; background: #fff; border-radius: 22px; padding: 14px 22px; margin-left: 0; box-shadow: var(--shadow-lg); }
.hero-lead { font-size: 1.12rem; color: var(--text-2); max-width: 560px; line-height: 1.65; }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .78rem; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-sm); }
.hero-badge span { background: var(--fg-forest); color: var(--fg-gold); border-radius: 999px; padding: .12rem .5rem; font-weight: 800; font-size: .7rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem; }
.trust-row div { font-size: .78rem; color: var(--muted); font-weight: 600; }
.trust-row strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.preview-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg); padding: .75rem; position: relative; }
.preview-top { display: flex; align-items: center; justify-content: space-between; padding: .35rem .5rem .75rem; gap: .5rem; }
.preview-top .dots { display: flex; gap: 6px; }
.preview-top .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); display: block; }
.float-kpi { position: absolute; z-index: 3; padding: .7rem .9rem; min-width: 150px; animation: floaty 6s ease-in-out infinite; }
.float-kpi .v { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.float-kpi .l { font-size: .68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.float-kpi.one { left: -28px; bottom: 54px; }
.float-kpi.two { right: -22px; top: 70px; animation-delay: -3s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
@media (max-width: 991.98px) { .float-kpi.one { left: 10px; } .float-kpi.two { right: 10px; } }
.section { padding: 5rem 0; }
.section-head { max-width: 680px; margin: 0 auto 3rem; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; margin: .75rem 0; }
.section-head p { color: var(--muted); font-size: 1.02rem; }
.module-card { display: block; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s; position: relative; overflow: hidden; }
.module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); color: var(--text); }
.module-card .icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: var(--primary-soft); color: var(--primary); margin-bottom: 1rem; }
.module-card.gold .icon { background: var(--accent-soft); color: #a77800; }
[data-bs-theme="dark"] .module-card.gold .icon { color: var(--fg-gold); }
.module-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: .45rem; font-family: var(--font-sans); letter-spacing: -.01em; }
.module-card p { color: var(--muted); font-size: .88rem; margin-bottom: 1rem; }
.module-card .tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.module-card .go { position: absolute; right: 1.25rem; top: 1.5rem; color: var(--muted); transition: transform .2s, color .2s; }
.module-card:hover .go { transform: translateX(4px); color: var(--primary); }
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: step; }
@media (max-width: 991.98px) { .pipeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .pipeline { grid-template-columns: 1fr; } }
.pipe-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; position: relative; }
.pipe-step::before { counter-increment: step; content: "0" counter(step); font-family: var(--font-display); font-weight: 900; font-size: 2.2rem; color: var(--accent); line-height: 1; display: block; margin-bottom: .75rem; letter-spacing: -.04em; }
.pipe-step h4 { font-size: 1.05rem; font-weight: 700; font-family: var(--font-sans); }
.pipe-step p { font-size: .85rem; color: var(--muted); margin: 0; }
.stats-band { background: linear-gradient(115deg, var(--fg-forest) 0%, #064d27 55%, #0b6b34 100%); color: #fff; border-radius: 28px; padding: 3rem 2rem; position: relative; overflow: hidden; }
.stats-band::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 36px 36px; }
.stats-band > * { position: relative; }
.stats-band .num { font-family: var(--font-display); font-weight: 900; font-size: clamp(2rem, 4vw, 3rem); color: var(--fg-gold); letter-spacing: -.04em; line-height: 1; }
.stats-band .lbl { color: #cfe6d6; font-size: .86rem; margin-top: .4rem; }
.algo-table td, .algo-table th { padding: .85rem .75rem; }
.cta-band { text-align: center; padding: 4rem 1.5rem; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; left: 50%; top: -120px; width: 520px; height: 240px; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(252, 192, 0, .25), transparent 70%); }
.cta-band > * { position: relative; }
.site-footer { border-top: 1px solid var(--border); padding: 3rem 0 2rem; margin-top: 4rem; font-size: .85rem; color: var(--muted); }
.site-footer h6 { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--text); margin-bottom: .9rem; }
.site-footer a { color: var(--muted); display: block; padding: .2rem 0; }
.site-footer a:hover { color: var(--primary); }
.footer-logo { height: 54px; width: auto; mix-blend-mode: multiply; }
[data-bs-theme="dark"] .footer-logo { mix-blend-mode: normal; background: #fff; border-radius: 10px; padding: 4px 8px; }

/* ------------------------------------------------------------------ toasts / misc */
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: 360px; }
.fg-toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .75rem 1rem; font-size: .84rem; display: flex; gap: .6rem; align-items: flex-start; animation: slideIn .25s ease; }
.fg-toast.error { border-left-color: var(--danger); }
.fg-toast.error .bi { color: var(--danger); }
.fg-toast .bi { color: var(--primary); font-size: 1.05rem; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; min-height: 1rem; }
@keyframes shimmer { to { background-position: -200% 0; } }
.notice { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px; padding: .75rem 1rem; font-size: .78rem; color: var(--muted); display: flex; gap: .6rem; }
.notice .bi { color: var(--fg-gold-deep); font-size: 1rem; }
.kbd { font-family: var(--font-mono); font-size: .72rem; padding: .1rem .35rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.fade-in { animation: slideIn .35s ease; }
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-family: var(--font-display); font-weight: 900; font-size: 7rem; line-height: 1; letter-spacing: -.05em; background: linear-gradient(120deg, var(--fg-forest), var(--fg-green-bright) 50%, var(--fg-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.offcanvas-backdrop { z-index: 1040; }
.sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--surface); }
@media print {
  .sidebar, .topbar, .app-footer, .no-print { display: none !important; }
  .card-fg, .kpi { box-shadow: none; break-inside: avoid; }
}
