:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --bg-2: #eceee9;
  --surface-1: #fcfcfb;
  --surface-2: #ffffff;
  --line: rgba(20, 24, 30, .10);
  --line-strong: rgba(20, 24, 30, .22);
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #7b7a74;
  --accent: #c46a00;
  --accent-2: #2a6fd6;
  --glow: rgba(249, 159, 35, .18);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --seq-lo: #86b6ef;
  --seq-hi: #184f95;
  --ret-lo: #3f8f62;
  --ret-hi: #b23b38;
  --good: #1a7f37; --warn: #b26b00; --crit: #c62828;
  --grid: rgba(20, 24, 30, .08);
  --map-bg: #e9ece6;
  --colo: #7b4fd6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07090c; --bg-2: #0b0e13; --surface-1: #11151b; --surface-2: #161b23;
    --line: rgba(160, 220, 255, .08); --line-strong: rgba(160, 220, 255, .18);
    --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #8a8d93;
    --accent: #f99f23; --accent-2: #8ecbff; --glow: rgba(249, 159, 35, .2);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --seq-lo: #184f95; --seq-hi: #9ec5f4; --ret-lo: #6fbf8e; --ret-hi: #d0544f;
    --good: #3fb950; --warn: #e3a008; --crit: #f85149;
    --grid: rgba(255, 255, 255, .06); --map-bg: #05070a; --colo: #a983ff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07090c; --bg-2: #0b0e13; --surface-1: #11151b; --surface-2: #161b23;
  --line: rgba(160, 220, 255, .08); --line-strong: rgba(160, 220, 255, .18);
  --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #8a8d93;
  --accent: #f99f23; --accent-2: #8ecbff; --glow: rgba(249, 159, 35, .2);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --seq-lo: #184f95; --seq-hi: #9ec5f4; --ret-lo: #6fbf8e; --ret-hi: #d0544f;
  --good: #3fb950; --warn: #e3a008; --crit: #f85149;
  --grid: rgba(255, 255, 255, .06); --map-bg: #05070a; --colo: #a983ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text-primary);
  font: 15px/1.55 "Space Grotesk", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
code, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .86em; }
a { color: var(--accent); }
h1, h2 { letter-spacing: -.02em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(34px, 5.4vw, 72px); font-weight: 700; }
h2 { font-size: clamp(26px, 3.4vw, 44px); font-weight: 600; }
.accent { color: var(--accent); text-shadow: 0 0 32px var(--glow); }
.eyebrow { font: 500 12px/1 "JetBrains Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.sub, .lede { color: var(--text-secondary); max-width: 720px; }
.lede { font-size: 17px; margin: 18px 0 24px; }

/* top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 12px 24px; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; gap: 18px; }
.topbar nav a { color: var(--text-secondary); text-decoration: none; font-size: 13px; }
.topbar nav a:hover { color: var(--text-primary); }
.topbar-cta { text-decoration: none; border-radius: 10px; padding: 7px 14px; font-size: 13px; white-space: nowrap; box-shadow: none; }
.topbar-cta:hover { filter: brightness(1.08); }

button { font: inherit; cursor: pointer; border-radius: 10px; }
.primary { background: var(--accent); color: #1a0f00; border: 0; padding: 11px 18px; font-weight: 600; box-shadow: 0 0 24px var(--glow); }
.ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--line-strong); padding: 10px 16px; }
.ghost.small { padding: 6px 12px; font-size: 13px; }
.ghost:hover { border-color: var(--accent); }

/* topbar cluster chip: appears once the intro slider has scrolled away */
.rack-chip { margin-left: auto; white-space: nowrap; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 3px; font-size: 13px; color: var(--text-secondary); opacity: 0; pointer-events: none; transition: opacity .3s; }
.rack-chip b { color: var(--accent); font-size: 14px; }
.rack-chip button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text-primary); line-height: 1; }
body.past-intro .rack-chip { opacity: 1; pointer-events: auto; }

/* pinned cluster → map stage */
html { scroll-snap-type: y proximity; }
.scrolly { position: relative; height: 320vh; background: var(--map-bg); }
/* Settled-map scroll position (p = 0.76 of the section); also a soft snap point so the map is easy to land on. */
.map-anchor { position: absolute; left: 0; top: calc((100% - 100vh) * 0.76); height: 1px; scroll-snap-align: start; }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#rackCanvas { background: radial-gradient(110% 90% at 62% 0%, var(--surface-2), var(--map-bg)); }
#mapCanvas { opacity: 0; pointer-events: none; }

.intro { position: absolute; left: 0; top: 0; padding: 96px 48px 40px; width: min(540px, 100%); pointer-events: none; }
.intro > * { pointer-events: auto; }
.intro h1 { font-size: clamp(40px, 5vw, 66px); text-shadow: 0 2px 30px var(--map-bg); }
.market { position: relative; display: inline-block; margin: 0 0 14px; }
.market-btn { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 4px; }
.market-btn span { font-size: 10px; margin-left: 4px; }
.market-btn:hover, .market-btn[aria-expanded="true"] { color: var(--text-primary); }
.market-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; min-width: 360px; max-width: calc(100vw - 32px); margin: 0; padding: 6px; list-style: none; border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 96%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line-strong); box-shadow: 0 16px 50px rgba(0,0,0,.4); }
.market-menu[hidden] { display: none; }
.market-menu li[role="menuitem"] { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--text-primary); white-space: nowrap; }
.market-menu li[role="menuitem"]:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.market-menu li small { color: var(--text-muted); font: 11px "JetBrains Mono"; }
.market-menu li em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--text-muted); }
.market-menu li.on { color: var(--accent); }
.market-menu li.on::after { content: "✓"; margin-left: auto; }
.market-menu li.soon { color: var(--text-secondary); }
.market-note { padding: 8px 10px 4px; font-size: 12px; color: var(--accent); border-top: 1px solid var(--line); margin-top: 4px; }
.prompt { font-size: 20px; line-height: 1.35; margin: 14px 0 18px; color: var(--text-primary); }
.sys-seg { margin-bottom: 10px; background: color-mix(in srgb, var(--surface-1) 80%, transparent); backdrop-filter: blur(8px); }
.sys-seg button { padding: 8px 12px; }
.sys-seg button b { font-weight: 600; }
.sys-seg button .long { color: var(--text-muted); font-size: 12px; }
.sys-seg button.on .long { color: var(--text-secondary); }
.rack-control { display: flex; align-items: center; gap: 12px; width: fit-content; background: color-mix(in srgb, var(--surface-1) 80%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 12px; padding: 10px 14px; backdrop-filter: blur(8px); box-shadow: 0 0 30px var(--glow); }
.rack-control label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .1em; }
.rack-control output { font: 700 24px "Space Grotesk"; color: var(--accent); min-width: 18px; }
input[type=range] { accent-color: var(--accent); width: 170px; }
.rack-note { font-size: 12.5px; color: var(--text-muted); margin: 10px 0 14px; }
.readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.readout { background: color-mix(in srgb, var(--surface-1) 78%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.readout .v { font: 600 20px/1.15 "Space Grotesk"; }
.readout .v small { font-size: 12px; color: var(--text-secondary); margin-left: 3px; font-weight: 500; }
.readout .l { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.3; }
.readout.txt .v { font-size: 14px; line-height: 1.25; }
.readout.warn { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.readout.warn .v { color: var(--warn); }
.readout.alert { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, var(--surface-1)); box-shadow: 0 0 28px color-mix(in srgb, var(--warn) 35%, transparent); }
.readout.alert .v { color: var(--warn); font-size: 15px; }
.readout.alert .l { color: var(--text-primary); }
.readout.bounce { animation: bounce .9s cubic-bezier(.28,.84,.42,1); }
@keyframes bounce { 0% { transform: scale(1); } 20% { transform: translateY(-10px) scale(1.06); } 40% { transform: translateY(0) scale(.98); } 60% { transform: translateY(-5px) scale(1.03); } 80% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .readout.bounce { animation: none; } }
.readout.hl { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 30px var(--glow); }
.stage-caption { position: absolute; right: 24px; bottom: 20px; font-size: 12px; color: var(--text-muted); }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 9px 16px; border-radius: 99px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface-1) 75%, transparent); backdrop-filter: blur(8px); color: var(--text-primary); text-decoration: none; font-size: 13px; }
.scroll-cue span { color: var(--accent); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* map phase */
.map-ui { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.map-ui.live > * { pointer-events: auto; }
.find-head, .site-panel {
  position: absolute; background: color-mix(in srgb, var(--surface-1) 82%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); border-radius: 16px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.find-head { left: 24px; top: 80px; width: 420px; }
.find-head .eyebrow { margin-bottom: 8px; }
.find-head h2 { font-size: clamp(24px, 2.6vw, 34px); }
.find-sub { color: var(--text-secondary); font-size: 14px; margin: 10px 0 14px; }
.find-sub b { color: var(--text-primary); }
.find-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.options button { font-size: 12px; padding: 5px 9px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-secondary); }
.options button b { color: var(--text-primary); font-weight: 600; margin-left: 2px; }
.options button:hover { border-color: var(--accent); }
.options button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text-primary); }
.find-hint { color: var(--text-muted); font-size: 12px; margin: 10px 0 0; }
.zoom { position: absolute; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 36px; height: 36px; padding: 0; font-size: 18px; background: color-mix(in srgb, var(--surface-1) 80%, transparent); }

.site-panel { right: 24px; top: 80px; width: 330px; max-height: calc(100% - 160px); overflow: auto; }
.site-panel .badge.mode, .tariff-pop .badge.mode { border-color: var(--accent); color: var(--accent); }
.site-panel dt.tariff-row { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; cursor: pointer; padding: 5px 8px; margin: 0 -8px; border-radius: 8px; border: 1px solid transparent; }
.site-panel dt.tariff-row b { font-family: "JetBrains Mono"; color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.site-panel dt.tariff-row:hover { border-color: var(--line-strong); }
.site-panel dt.tariff-row.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.site-panel dt.tariff-row + dd { display: none; }
.alt-mode { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.alt-mode summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.alt-mode summary:hover { color: var(--text-primary); }
.alt-mode dl { opacity: .9; }
#snapBtn.on { border-color: var(--accent); color: var(--accent); }
i.dia { display: inline-block; width: 9px; height: 9px; background: var(--colo); transform: rotate(45deg); margin-right: 7px; vertical-align: 0; box-shadow: 0 0 8px color-mix(in srgb, var(--colo) 60%, transparent); }
.colo-btn.on { border-color: var(--colo); color: var(--text-primary); background: color-mix(in srgb, var(--colo) 18%, transparent); }
.options .colo-chip b { font-weight: 600; font-size: 11px; margin-left: 4px; }
.options .colo-chip b.fit-yes { color: var(--good); } .options .colo-chip b.fit-maybe { color: var(--warn); } .options .colo-chip b.fit-no { color: var(--crit); }
.options .colo-chip.on { border-color: var(--colo); background: color-mix(in srgb, var(--colo) 16%, transparent); }
.map-legend i.dia { margin-right: 2px; }
/* Map hint: a pulsing marker pinned to a clickable spot on the map (positioned from JS), with the instruction beside it. */
.map-hint { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; display: flex; align-items: center; gap: 12px; margin: -11px 0 0 -11px; }
.map-hint[hidden] { display: none; }
.map-hint.flip { flex-direction: row-reverse; }
.map-hint.nomark .pulse { display: none; }
.map-hint.below { flex-direction: column; gap: 8px; }
.map-hint.below .txt { white-space: normal; max-width: 220px; text-align: center; }
.map-hint .pulse { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 24px var(--accent); }
.map-hint .pulse::before, .map-hint .pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); animation: ping 1.8s ease-out infinite; }
.map-hint .pulse::after { animation-delay: .9s; }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.map-hint .txt { padding: 7px 12px; border-radius: 10px; font-size: 13px; white-space: nowrap; color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-1) 92%, transparent); border: 1px solid var(--accent); box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.map-hint .txt b { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .map-hint .pulse::before, .map-hint .pulse::after { animation: none; } }
/* Sortable colo headers */
.colo-table th { padding: 0; }
.colo-table th .sort { width: 100%; text-align: left; background: none; border: 0; border-radius: 0; color: var(--text-muted); font: inherit; font-weight: 500; padding: 6px 8px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.colo-table th .sort:hover { color: var(--text-primary); }
.colo-table th .sort i { font-style: normal; font-size: 10px; opacity: .55; }
.colo-table th[aria-sort="ascending"] .sort, .colo-table th[aria-sort="descending"] .sort { color: var(--accent); }
.colo-table th[aria-sort="ascending"] .sort i, .colo-table th[aria-sort="descending"] .sort i { opacity: 1; }
/* Tariff breakdown: fans out beside the panel. */
.tariff-pop { position: absolute; top: 80px; right: calc(24px + 330px + 12px); width: 320px; max-height: calc(100% - 160px); overflow: auto; font-size: 13px;
  background: color-mix(in srgb, var(--surface-1) 90%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--accent); border-radius: 16px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: fan .2s ease-out; }
@keyframes fan { from { opacity: 0; transform: translateX(-8px); } }
.tariff-pop .badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--text-secondary); margin-right: 4px; }
.tariff-pop h4 { margin: 8px 0 0; font-size: 16px; }
.tariff-pop .sched { font: 12px "JetBrains Mono"; color: var(--text-muted); }
.tariff-pop .big { font: 600 26px "Space Grotesk"; margin: 8px 0 4px; }
.tariff-pop .big small { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.tariff-pop .tsplit { grid-template-columns: 1fr; gap: 2px; }
.tariff-pop .tsplit dt { margin-top: 8px; }
.tariff-pop .tsplit dd span { display: block; color: var(--text-muted); font-size: 11.5px; }
.tariff-pop .tsplit .tot { font-weight: 700; color: var(--text-primary); font-family: "Space Grotesk"; font-size: 15px; border-top: 1px solid var(--line); padding-top: 6px; }
.tariff-pop dd.tot { color: var(--accent); font-family: "JetBrains Mono"; }
.tariff-pop p { color: var(--text-secondary); margin: 10px 0 0; }
.tariff-pop p.muted { color: var(--text-muted); font-size: 12px; }
.tariff-pop .src { font-size: 12px; }
.tariff-pop .close { position: absolute; right: 10px; top: 10px; padding: 2px 8px; }
/* Wide screens: dock the details next to the find card so everything reads from the left. */
@media (min-width: 1280px) { .site-panel { right: auto; left: 456px; width: 340px; } .tariff-pop { right: auto; left: calc(456px + 340px + 12px); } }
.colo-near .colo-link { display: block; width: 100%; text-align: left; margin-top: 4px; padding: 5px 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-secondary); font-size: 12.5px; }
.colo-near .colo-link:hover { border-color: var(--line-strong); color: var(--text-primary); }
.colo-near .colo-link .mono { color: var(--text-muted); margin-left: 4px; }
.colo-table tr.flash td { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--colo) 28%, transparent); } 100% { background: transparent; } }
.notes-head { margin: 28px 0 12px; font-size: 18px; }
.rung-facts { margin: 10px 0 0; font-size: 12.5px; display: grid; gap: 2px; }
.rung-facts dt { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.rung-facts dd { margin: 0; color: var(--text-primary); }
.rung-facts dd b { color: var(--warn); font-weight: 600; }
.site-panel h3 { margin: 0 0 2px; font-size: 20px; }
.site-panel .node { font-size: 12.5px; color: var(--text-muted); }
.site-panel dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 10px 0 0; font-size: 13px; }
.site-panel dt { color: var(--text-secondary); }
.site-panel dt.grp { margin-top: 8px; font: 500 11px "JetBrains Mono"; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.site-panel dd { margin: 0; font-family: "JetBrains Mono"; text-align: right; }
.site-panel dt.alt { color: var(--text-muted); }
.site-panel dt.node { font: 11px "JetBrains Mono"; color: var(--text-muted); margin-top: -4px; word-break: break-all; }
.site-panel dt.key, .site-panel dd.key { font-weight: 700; color: var(--text-primary); font-size: 15px; padding-top: 6px; border-top: 1px solid var(--line); }
.site-panel dd.key { color: var(--accent); }
.site-panel dd.key small, .tariff-pop dd.tot small, .tcard .big small { font-weight: 400; font-size: 11px; color: var(--text-muted); }
.rung .here small { display: block; font-weight: 500; opacity: .85; font-size: 12px; }
.find-sub a, .tariff-pop .sched a, .tcard .sched a { color: var(--accent); }
.site-panel .util { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-secondary); }
.site-panel .badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--text-secondary); margin-right: 4px; }

.map-legend { position: absolute; left: 24px; bottom: 24px; font-size: 12px; color: var(--text-secondary); display: grid; gap: 6px; }
.map-legend > div { display: flex; align-items: center; gap: 8px; }
.map-legend .ramp { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--seq-lo), var(--seq-hi)); }
.map-legend .ramp.ret { background: linear-gradient(90deg, var(--ret-lo), var(--ret-hi)); }
.map-label { position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; font-size: 12px; padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 88%, transparent); border: 1px solid var(--line-strong); color: var(--text-secondary); margin-top: -6px; }
.map-label b { color: var(--text-primary); font-family: "JetBrains Mono"; font-weight: 500; }
.map-label.hover { border-color: var(--accent); }
.ic-strip { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 14px; text-decoration: none; color: var(--text-secondary); font-size: 12.5px; white-space: nowrap;
  background: color-mix(in srgb, var(--surface-1) 85%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--line-strong); }
.ic-strip:hover { border-color: var(--accent); }
.ic-strip .ic-k { font: 500 11px "JetBrains Mono"; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.ic-strip .ic-steps { display: flex; gap: 3px; }
.ic-strip .ic-steps i { width: 22px; height: 6px; border-radius: 3px; background: var(--line-strong); }
.ic-strip .ic-steps i.past { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.ic-strip .ic-steps i.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.ic-strip b { color: var(--text-primary); }
.ic-strip em { font-style: normal; color: var(--warn); font-weight: 600; }
.ic-strip.warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.ic-strip.warn .ic-steps i.on { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.tooltip {
  position: fixed; z-index: 40; pointer-events: none; background: var(--surface-2); color: var(--text-primary);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.3);
  max-width: 260px;
}
.tooltip b { display: block; font-size: 13px; }
.tooltip .mono { color: var(--text-secondary); }

/* bands */
.band { padding: 110px 48px 90px; background: var(--bg); position: relative; }
.band.alt { background: var(--bg-2); }
.band.slim { padding-top: 40px; padding-bottom: 40px; }
.section-head { margin-bottom: 36px; }
.section-head .sub { margin-top: 12px; }

/* filters + charts */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--text-secondary); padding: 7px 13px; border-radius: 0; font-size: 13px; }
.seg button.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text-primary); }
.charts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.charts .card:first-child { grid-row: span 2; }
.charts.one { grid-template-columns: 1fr; }
.charts.one .card:first-child { grid-row: auto; }
.card { margin: 0; background: var(--surface-1); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; min-width: 0; }
figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-bottom: 8px; }
figcaption span { color: var(--text-muted); font-size: 12px; }
.chart { position: relative; width: 100%; min-height: 240px; }
.chart.tall { min-height: 380px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--text-secondary); font: 11px "JetBrains Mono", monospace; }
.chart .lbl { fill: var(--text-primary); font: 500 12px "Space Grotesk"; }
.chart .gridline { stroke: var(--grid); }
.chart .axis { stroke: var(--line-strong); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text-muted); font-weight: 500; }
td { font-family: "JetBrains Mono"; }
.notice { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--warn); border-radius: 12px; color: var(--text-secondary); }

/* tariffs */
.chart-hint { margin: -4px 0 8px; font-size: 12px; color: var(--text-muted); }
.trow .trow-bg { fill: transparent; }
.trow:hover .trow-bg { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
.trow.sel .trow-bg { fill: color-mix(in srgb, var(--accent) 13%, transparent); stroke: var(--accent); }
.tariff-detail .tcard { position: relative; margin-top: 14px; max-width: 760px; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.tariff-detail .close { position: absolute; right: 12px; top: 12px; padding: 2px 8px; }
.tariff-detail .conf { float: none; margin-right: 44px; position: absolute; right: 12px; top: 48px; }
.tsplit { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 0; font-size: 13px; }
.tsplit dt { color: var(--text-muted); }
.tsplit dd { margin: 0; font-family: "JetBrains Mono"; }
.tcard .src { font-size: 12px; }
.tariff-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 16px; }
.tcard { background: var(--surface-1); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 13px; }
.tcard h4 { margin: 0; font-size: 15px; }
.tcard .sched { font: 12px "JetBrains Mono"; color: var(--accent); }
.tcard .big { font: 600 28px "Space Grotesk"; margin: 8px 0 2px; }
.tcard .big small { font-size: 13px; color: var(--text-secondary); }
.tcard p { color: var(--text-secondary); margin: 8px 0 0; }
.tcard .conf { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--text-muted); float: right; }

/* ladder */
.ladder { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.rung { position: relative; padding: 22px 20px 24px; background: var(--surface-1); border-right: 1px solid var(--line); min-height: 300px; }
.rung:last-child { border-right: 0; }
.rung .step { font: 500 11px "JetBrains Mono"; color: var(--text-muted); letter-spacing: .1em; }
.rung h4 { margin: 6px 0 4px; font-size: 18px; }
.rung .range { font: 600 22px "Space Grotesk"; color: var(--text-primary); }
.rung .range small { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.rung .when { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }
.rung .when b { color: var(--warn); }
.rung ul { padding-left: 16px; margin: 12px 0 0; color: var(--text-secondary); font-size: 13px; }
.rung .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--seq-lo), var(--seq-hi)); opacity: .5; }
.rung.active { background: color-mix(in srgb, var(--accent) 9%, var(--surface-1)); }
.rung.active .bar { background: var(--accent); opacity: 1; box-shadow: 0 0 20px var(--accent); }
.rung .here { display: inline-flex; gap: 7px; align-items: flex-start; margin-top: 10px; font-size: 12px; padding: 6px 12px; border-radius: 12px; background: var(--accent); color: #1a0f00; font-weight: 600; line-height: 1.35; }
.rung .here b { display: block; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.rung .here i { font-style: normal; }
.callouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.callout { background: var(--surface-1); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; color: var(--text-secondary); }
.callout b { color: var(--text-primary); display: block; margin-bottom: 4px; font-size: 14px; }

/* colo */
.colo-legend { font-size: 12px; color: var(--text-muted); }
.colo-legend i { display: inline-block; width: 9px; height: 9px; background: var(--colo); transform: rotate(45deg); margin-right: 8px; box-shadow: 0 0 10px var(--colo); }
.colo-table td, .colo-table th { text-align: left; white-space: normal; vertical-align: top; font-family: "Space Grotesk"; font-size: 13px; padding: 10px 8px; }
.colo-table td.mono, .colo-table .mono { font-family: "JetBrains Mono"; font-size: 12px; }
.colo-table td small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.colo-table td b { color: var(--text-primary); }
.colo-table .cap { min-width: 200px; } .colo-table .dens { min-width: 180px; }
.colo-table tr.near td { background: color-mix(in srgb, var(--colo) 9%, transparent); }
.colo-table .src a { display: block; font-size: 12px; }
.colo-table button { font-size: 12px; padding: 4px 9px; white-space: nowrap; }
.cap-badge { display: inline-block; font: 500 10.5px "JetBrains Mono"; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--text-muted); margin-bottom: 4px; }
.cap-badge.reported { border-color: color-mix(in srgb, var(--good) 60%, transparent); color: var(--good); }
.cap-badge.leased { border-color: color-mix(in srgb, var(--warn) 60%, transparent); color: var(--warn); }
.colo-table td { vertical-align: top; font-family: inherit; }
.colo-table td.mono, .colo-table .mono { font-family: "JetBrains Mono"; }
.colo-table td.wrap { white-space: normal; min-width: 200px; max-width: 280px; text-align: left; }
.colo-table th { text-align: left; }
.colo-table td { text-align: left; }
.colo-table .muted { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.colo-table tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.liq { font-weight: 600; }
.liq.yes { color: var(--good); }
.liq.announced { color: var(--warn); }
.liq.unknown { color: var(--text-muted); }
.fit { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); }
.fit.yes { color: var(--good); border-color: color-mix(in srgb, var(--good) 55%, transparent); }
.fit.maybe { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.fit.no { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 55%, transparent); }
.colo-near div { margin-top: 4px; }
.colo-near .cap-badge { margin: 0 0 0 4px; }
.site-panel dt.colo { color: var(--text-secondary); }
.site-panel dt.colo::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--colo); transform: rotate(45deg); margin-right: 7px; }

.method-details summary { cursor: pointer; font-weight: 600; font-size: 17px; color: var(--text-secondary); }
.method-details summary:hover { color: var(--text-primary); }
.method-details[open] summary { margin-bottom: 20px; }
.method { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; color: var(--text-secondary); font-size: 14px; }
.method h4 { color: var(--text-primary); margin: 0 0 6px; }
.method ul { margin: 0; padding-left: 18px; }
footer { padding: 30px 48px 40px; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--line); }

/* Mid widths: the legend and the centred strip don't fit side by side, so stack the legend above the strip. */
@media (min-width: 1001px) and (max-width: 1300px) { .ic-strip { left: 24px; transform: none; } .map-legend { bottom: 78px; } }
@media (max-width: 1000px) {
  .charts, .method { grid-template-columns: 1fr; }
  .charts .card:first-child { grid-row: auto; }
  .ladder { grid-template-columns: 1fr 1fr; }
  .callouts { grid-template-columns: 1fr; }
  .site-panel { left: 16px; right: 16px; width: auto; top: auto; bottom: 16px; max-height: 36%; padding: 14px; }
  .find-head { left: 16px; right: 16px; width: auto; top: 68px; padding: 14px; }
  .tariff-pop { left: 16px; right: 16px; width: auto; top: auto; bottom: calc(36% + 28px); max-height: 32%; }
  .zoom, .map-legend, .stage-caption { display: none; }
  .ic-strip { bottom: 16px; }
  .map-hint .txt { white-space: normal; max-width: 180px; }
}
@media (max-width: 640px) {
  .topbar nav { display: none; }
  .topbar { gap: 10px; padding: 10px 16px; }
  .site-panel { display: none; }
  .tariff-pop { display: none; } /* the find card carries the summary; details are in the sections below */
  .rack-chip { margin-left: auto; }
  .intro { padding: 72px 16px 16px; }
  .prompt { font-size: 17px; margin: 10px 0 14px; }
  .rack-note { display: none; }
  .rack-control { margin-bottom: 12px; }
  input[type=range] { width: 120px; }
  .readout { padding: 8px 10px; }
  .readout.opt { display: none; }
  .readout .v { font-size: 17px; }
  .find-sub { font-size: 13px; margin: 6px 0 10px; }
  .find-hint { display: none; }
  .sys-seg button { padding: 7px 9px; font-size: 13px; }
  .sys-seg button .long { display: none; }
  .options { margin-top: 8px; max-height: 64px; overflow: hidden; }
  .ic-strip { left: 16px; right: 16px; transform: none; justify-content: space-between; gap: 8px; }
  .ic-strip .ic-k { display: none; }
  .ic-strip .ic-v { overflow: hidden; text-overflow: ellipsis; }
  .band { padding: 80px 16px 60px; }
  .ladder { grid-template-columns: 1fr; }
  .rung { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  footer { padding: 24px 16px; }
}
