:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2328;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #1f6feb;
  --green: #3fb950;
  --yellow: #e3b341;
  --red: #f85149;
  --blue: #58a6ff;
  /* issue #145: fixed categorical colours for the time-series charts' generation mix -- assigned by
     fuel identity, never cycled, so the same fuel always reads the same colour across every chart
     and every hour. --fuel-other is the fallback for a fuel type outside this fixed set. */
  --fuel-nuclear: #8b5cf6;
  --fuel-coal: #6e7681;
  --fuel-gas: #3fb950;
  --fuel-hydro: #22a6b3;
  --fuel-wind: #58a6ff;
  --fuel-solar: #e3b341;
  --fuel-other: #e34948;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex; flex-direction: column;
}
#app-tabs {
  background: #161b22; flex: 0 0 auto; display: flex; align-items: flex-end; gap: 2px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 0;
}
#app-tabs .app-tab {
  background: none; border: 0; border-radius: 6px 6px 0 0; color: #c9d1d9; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 7px 14px; font-size: 13px; font-weight: 600; line-height: 1.2;
}
#app-tabs .app-tab[hidden] { display: none; }
#app-tabs .app-tab:hover:not(:disabled) { background: #30363d; color: #fff; }
#app-tabs .app-tab.active { background: #24292f; color: #fff; }
#app-tabs .app-tab:disabled { opacity: .55; cursor: default; }
/* IOU is its own app: the grid chapters' menu is not part of it. */
body.app-sites #nav { display: none; }
#banner {
  background: #24292f; color: #fff; padding: 8px 14px; font-size: 13px;
  border-bottom: 3px solid var(--yellow); flex: 0 0 auto;
}
#layout { flex: 1 1 auto; display: flex; min-height: 0; }
#map-wrap { flex: 2 1 0; min-width: 0; position: relative; }
#map { position: absolute; inset: 0; background: #0d1117; }
/* Issue #184: the animated wind streamline canvas, a plain sibling element right after #map (DOM
   order alone puts it on top -- no z-index needed to beat #map, and none given here so it still
   stays under #map-tools/.map-empty/.map-toast/.map-spinner's own explicit z-index above).
   pointer-events: none, same reason as .map-empty etc below: it must never swallow a map click. */
#wind-streamlines-canvas { position: absolute; inset: 0; pointer-events: none; }
/* issue #47: satellite toggle and the hand-rolled parcel draw tool, floating over the map so
   they work the same in every view rather than living in one panel section */
#map-tools {
  position: absolute; top: 10px; right: 10px; z-index: 4; display: flex; flex-direction: column; gap: 4px;
  background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 6px; padding: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); max-width: 250px;  /* widened (coordinator follow-up) so a labelled
    row's value -- "2,369 - 3,790 MW" -- has room without wrapping mid-number; was 220px */
}
#map-tools .row { margin: 0; gap: 4px; }
#btn-satellite[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
#btn-draw-parcel.drawing { background: var(--yellow); border-color: var(--yellow); }
#parcel-status { line-height: 1.35; }
#parcel-status button { margin-top: 3px; }
/* labelled parcel-band rows (coordinator follow-up): reuse the same label-plus-bold-value pattern
   the capacity/portfolio cards use (.pf-kv-row, cardHtml() in app.js), instead of a run-on paragraph */
#parcel-status .pf-kv-row b { font-variant-numeric: tabular-nums; }
#parcel-status .pf-kv-row span:first-child { white-space: nowrap; }  /* "Grid here" stays one line; the value wraps first if anything has to */
#parcel-status .warn { margin-top: 2px; }
#panel {
  flex: 1 1 0; min-width: 380px; max-width: 560px; overflow-y: auto;
  background: var(--panel); border-left: 1px solid var(--line);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
h1 { font-size: 17px; margin: 4px 0 8px; }
h2 { font-size: 14px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.num {
  display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 50%; background: #d0d7de; color: #24292f; font-size: 12px; font-weight: 600;
}
.step.done .num { background: var(--green); color: #fff; }
.step.active .num { background: var(--accent); color: #fff; }
.step { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 8px 0; }
.step.agent { border-color: #c9d6f2; background: #f8faff; }
/* author display rules beat the UA sheet's [hidden], so say it here or hidden flex rows stay visible */
[hidden] { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; margin: 6px 0; position: relative; flex-wrap: wrap; }
button {
  font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 5px; border: 1px solid #c8ced6;
  background: #fff; color: var(--text); cursor: pointer;
}
button:hover:not(:disabled) { background: #f0f3f6; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover:not(:disabled) { background: #1a5fd0; }
button.tiny { font-size: 12px; padding: 2px 8px; }
button.preset { font-size: 12px; }
input[type=text], input[type=number], textarea {
  font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid #c8ced6; border-radius: 5px; width: 100%;
}
input[type=number] { width: 80px; }
textarea { width: 100%; resize: vertical; }
label.mw { display: inline-flex; align-items: center; gap: 4px; font-weight: normal; font-size: 13px; margin-left: auto; }
.ms { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 52px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.result { font-size: 13px; }
.result table { border-collapse: collapse; width: 100%; margin: 4px 0; font-size: 12px; }
.result th, .result td { text-align: left; padding: 2px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.result th { color: var(--muted); font-weight: 500; }
.result .num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.kpi { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 6px; }
.kpi div { background: #f3f5f8; border-radius: 5px; padding: 4px 10px; }
.kpi b { font-size: 16px; display: block; }
.kpi .bad b { color: var(--red); }
.kpi .ok b { color: var(--green); }
.tag { display: inline-block; padding: 0 6px; border-radius: 10px; font-size: 11px; background: #eaeef2; }
.tag.new { background: #ffe8e6; color: #a40e26; }
.tag.clean { background: #dcffe4; color: #116329; }
.tag.dirty { background: #ffe8e6; color: #a40e26; }
.tag.diverged { background: #efe3ff; color: #5a2ca0; }
.tag.islanded { background: #fff1e0; color: #8a4b00; }
.tag.thermal { background: #ffdcdc; color: #9f1239; }
.tag.voltage { background: #dbeafe; color: #1447e6; }
/* issue #149 (PR #166 review, H3): the same purple family CAP_COLOR uses above the AC audit
   threshold -- a DC screen figure that has not been AC-checked at this size, not a clean pass. */
.tag.unverified { background: #ede4fb; color: #5a32a3; }
.unverified { color: #5a32a3; }
.asm {
  display: inline-block; font-size: 10px; line-height: 12px; padding: 0 3px; margin-left: 2px;
  border-radius: 3px; background: #fff3cd; color: #7a5b00; border: 1px solid #f0d78a; cursor: help;
  vertical-align: super;
}
.asm.sourced { background: #e6f1ff; color: #0b4a9c; border-color: #bcd6ff; }
.asm.estimated { background: #eef7e6; color: #2f6b12; border-color: #c8e6b3; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; align-items: center; }
.legend .sw { display: inline-block; width: 18px; height: 4px; margin-right: 4px; vertical-align: middle; border-radius: 2px; }
.legend .sw.dashed { border-top: 2px dashed #fff; background: #555; height: 0; }
.legend .sw.dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #333; }
/* issue #144: the temperature overlay's adaptive-scale legend swatch -- a continuous gradient bar,
   since the field itself is a continuous ramp rather than the discrete bands every other legend
   in this app uses; the real min/max for the hour go in #ops-temp-range-text next to it. */
.temp-gradient-bar { display: inline-block; width: 110px; height: 10px; border-radius: 2px; vertical-align: middle; border: 1px solid rgba(255,255,255,0.25); }
/* issue #140: binding/relaxed N-1 rows painted red on the map -- relaxed distinguished from
   binding by a thicker, dashed swatch rather than a second colour (both really are "red"). */
.legend .sw.thick { height: 7px; }
.legend .sw.dashed-red { border-top: 3px dashed var(--red); background: transparent; height: 0; }
.legend .sw.ring { width: 10px; height: 10px; border-radius: 50%; background: #f2c14e; border: 2px solid #fff; }
/* the left nav: one entry per mode, the panel shows one view at a time */
#nav { flex: 0 0 140px; background: #24292f; display: flex; flex-direction: column; padding: 8px 0; gap: 2px; }
.nav-item {
  background: none; border: 0; border-left: 3px solid transparent; border-radius: 0; color: #c9d1d9;
  display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 11px 12px; font-size: 13px; line-height: 1.2; text-align: left;
}
.nav-item:hover:not(:disabled) { background: #30363d; color: #fff; }
.nav-item.active { background: #30363d; color: #fff; border-left-color: var(--yellow); }
.nav-icon { font-size: 20px; line-height: 1; width: 22px; text-align: center; flex: 0 0 auto; }
.nav-label { flex: 1 1 auto; }
.nav-spacer { flex: 1 1 auto; }
.soon { font-size: 9px; font-weight: 600; letter-spacing: .02em; background: var(--yellow); color: #24292f; border-radius: 8px; padding: 1px 5px; }
h1 .soon { font-size: 10px; vertical-align: middle; margin-left: 4px; }
/* issue #203: an "unreleased" badge on a nav entry (reuses .soon) or the agent panel's own
   heading, never hidden by flex truncation the way a long nav-label plus a badge might be. */
.nav-item .chapter-badge { flex: 0 0 auto; }
h2 .chapter-badge { font-size: 9px; }
#chapter-unavailable button.primary { margin-top: 8px; }
.hint { margin: -4px 0 8px; }
.view > .step p { margin: 6px 0; }
/* capacity bands: one bar, five segments, counts beneath, instead of a sentence of numbers */
.capbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 6px 0 4px; background: #eef0f3; }
.capbar i { display: block; height: 100%; }
.capbar-labels { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.capbar-labels b { color: var(--text); font-variant-numeric: tabular-nums; }
#cap-screen label { font-size: 12px; margin-right: 6px; }
#site-results table td.num-cell, #site-results table th.num-cell { text-align: right; }
#site-results tr.studied td { background: #f3fbf5; }
/* scenarios card (issue #45): nine columns in a 560 px panel; the row editor's number inputs must not each claim a full column */
#scenario-results { overflow-x: auto; }
#scenario-results th, #scenario-results td { padding: 2px 4px; }
#scenario-editor input[type="number"] { width: 4.5em; }
#scenario-editor input.sc-label { width: 8em; }
.pinning #map, .drawing-parcel #map, .picking-outage #map { cursor: crosshair; }
.legend .sw.dashed.diverged { border-top-color: #d2a8ff; }
.legend .sw.dim-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff; background: #e6edf3; opacity: 0.55; }
.dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line);
  border-radius: 5px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto;
}
.dropdown div { padding: 5px 10px; cursor: pointer; font-size: 13px; }
.dropdown div:hover, .dropdown div.active { background: #f0f3f6; }
/* issue #139: an outage list row's own hour/label inputs, edited in place rather than remove-and-readd */
#ops-outage-list input[type="number"] { width: 55px; }
#ops-outage-list input[type="text"] { width: 110px; }
.error { color: var(--red); font-size: 13px; }
#agent-log { padding-left: 18px; margin: 6px 0; font-size: 13px; }
#agent-log li { margin: 2px 0; }
#agent-log .running { color: var(--accent); }
#agent-log .fail { color: var(--red); }
#agent-summary { font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; margin-top: 6px; }
#agent-summary:empty { display: none; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.compare:empty { display: none; }
.compare .card { border: 1px solid var(--line); border-radius: 5px; padding: 8px; background: #fff; font-size: 12px; }
.compare .card h3 { margin: 0 0 4px; font-size: 13px; }
footer { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.maplibregl-popup-content { font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: #1f2328; }
@media (max-width: 900px) {
  /* the nav turns into a strip across the top; flex-basis would otherwise become its height */
  #nav { flex: 0 0 auto; flex-direction: row; justify-content: space-around; padding: 0; }
  .nav-item { border-left: 0; border-bottom: 3px solid transparent; padding: 6px 8px; }
  /* issue #214 (checked at 390 px): with every chapter listed the strip is wider than a phone; it
     scrolls on its own instead of widening the whole page. Once it overflows, space-around would
     push the first item out of reach, so it packs to the start. */
  @media (max-width: 600px) { #nav { overflow-x: auto; justify-content: flex-start; } .nav-item { flex: 0 0 auto; } }
  .nav-item.active { border-left-color: transparent; border-bottom-color: var(--yellow); }
  .nav-spacer { display: none; }
  #layout { flex-direction: column; }
  #map-wrap { flex: 0 0 50vh; }
  #panel { max-width: none; min-width: 0; }
}

.hint { cursor: help; text-decoration: underline dotted #98a2b3; text-underline-offset: 3px; }
.calc { font-size: 12px; margin: 4px 0; }
.calc-item { padding: 4px 0; border-bottom: 1px solid var(--line); }
.legend select { font: inherit; font-size: 12px; padding: 1px 4px; }

/* issue #15: the study-cases side-by-side (peak vs off-peak) and future-year tables. Inside
   #res-7 (class="result"), so .result table already sets border-collapse/width/margin/font-size
   (line 64 above); this only adds the full-grid borders and header background those two extra
   tables need to read as a comparison, on top of what .result already gives every table. */
.tbl th, .tbl td { border: 1px solid var(--line); padding: 3px 6px; }
.tbl th { background: #f3f5f8; font-weight: 600; }

/* issue #69: "by change" colour mode, disabled until step 2 (power flow) has run */
.legend select option:disabled { color: #98a2b3; }
#color-change-hint { font-style: italic; }

/* Assumption ("A") badge popover: replaces the native title= tooltip (issue #67) with a
   positioned, structured popover. One element is reused for every badge; app.js positions it. */
.asm:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.asm-popover {
  position: fixed; z-index: 20; max-width: 34em; max-height: 60vh; overflow-y: auto;
  background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 10px 12px; font-size: 12px; line-height: 1.45;
}
.asm-pop-head { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.asm-pop-value { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.asm-pop-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; }
.asm-pop-meta dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding-top: 1px; }
.asm-pop-meta dd { margin: 0; word-wrap: break-word; }
.asm-pop-note { color: var(--muted); }
.asm-pop-conf {
  display: inline-block; padding: 0 6px; border-radius: 10px; font-size: 11px;
  background: #fff3cd; color: #7a5b00; border: 1px solid #f0d78a; /* assumed: same default as .asm */
}
.asm-pop-conf.sourced { background: #e6f1ff; color: #0b4a9c; border-color: #bcd6ff; }
.asm-pop-conf.estimated { background: #eef7e6; color: #2f6b12; border-color: #c8e6b3; }

/* issue #88, merged into one control by #142: one tick per forecast hour, coloured by that
   hour's own status (never blank, even when nothing solved -- see app.js opsTickClass) so a
   reader can spot an islanded or infeasible stretch without scrubbing to it. Also the base look
   for the trading spread strip (a separate, non-interactive read of the same hours). */
.ops-strip { display: flex; height: 16px; border-radius: 3px; overflow: hidden; margin: 4px 0 6px; background: #eef0f3; }
.ops-strip i { display: block; flex: 1 1 0; min-width: 1px; cursor: pointer; }
.ops-strip i.current { box-shadow: inset 0 0 0 2px var(--accent); }
.ops-tick-solved { background: #3fb950; }
.ops-tick-not_evaluated { background: #c8ced6; }
.ops-tick-infeasible, .ops-tick-failed { background: #f85149; }
.ops-tick-islanded { background: #a855f7; }
.ops-tick-fade { opacity: .4; }
.ops-tick-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
/* review round 1: the strip's own ticks describe the last *precomputed* run, which an outage
   edit can outrun (the on-screen hour itself is still live and correct -- see opsFetchHour) */
.ops-strip.stale { opacity: .45; }
/* issue #143: the hour context panel's compact generation-mix bar -- one segment per fuel,
   width proportional to that fuel's own share of this hour's total generation. */
.ops-mix-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: #eef0f3; gap: 2px; }
.ops-mix-seg { display: block; min-width: 2px; }
.ops-mix-legend { margin-top: 4px; }
#ops-outage-list table td.num-cell, #ops-outage-list table th.num-cell { text-align: right; }
.warn { color: #9a6700; }

/* issue #142: the Hour card is one control, not a slider plus a separate status strip. Same
   .ops-strip look as before, plus focus/keyboard affordance (it's a real widget: click, drag, or
   arrow keys) and a distinct pair of tick colours for "already finished"/"not yet run" while a
   background dispatch run is going -- the progress bar it replaces is gone, this track fills in
   its place (see app.js opsRenderTimeline). */
.ops-timeline { cursor: pointer; touch-action: none; outline-offset: 2px; }
.ops-timeline:focus-visible { outline: 2px solid var(--accent); }
.ops-timeline.running { cursor: default; }
.ops-tick-progress { background: var(--accent); }
.ops-tick-pending { background: #eef0f3; }
.ops-hour-label { margin: 2px 0 6px; font-weight: 600; color: var(--text); }
.legend-info-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  padding: 0; margin-left: 4px; border-radius: 50%; font-size: 12px; line-height: 1; vertical-align: middle;
}
.ops-legend-pop { margin: 2px 0 8px; padding: 6px 8px; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; }

/* Ops UX follow-up: the map's own empty state (no forecast, no run yet, running with nothing
   finished, error, or a stale run) -- explains the plain grey map instead of leaving it silent,
   and carries the same loading legend "Study a point" uses so a reader knows what colour to
   expect once an hour solves. Hidden the instant any hour's own colours are painted.
   Regression fix (#139 follow-up): this div is `inset: 0`, covering the whole map, with no
   interactive content of its own (just text and a static legend) -- but with no `pointer-events`
   rule it still absorbed every real click meant for the map underneath, silently, for as long as
   it was showing (i.e. any fresh session before a forecast/dispatch run exists, the common case).
   "Add outages by clicking the map" looked completely broken in that state: the click handler,
   layer ids and add-mode flag were all fine, `map.on('click', 'branches', ...)` simply never
   fired because the DOM click never reached the map's own canvas. Confirmed live with a real CDP
   Input.dispatchMouseEvent (not a synthetic canvas.dispatchEvent, which bypasses real hit-testing
   and so never exercised this): document.elementFromPoint at the click's own coordinates returned
   this div, not the canvas, until `pointer-events: none` was added here. */
.map-empty {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; text-align: center; padding: 24px; background: rgba(13,17,23,.6);
  pointer-events: none;
}
.map-empty-text { color: #fff; font-size: 14px; max-width: 380px; line-height: 1.4; }
.map-empty .legend { color: #d0d7de; justify-content: center; margin-bottom: 0; }
/* A dispatch run in progress can still show already-finished hours (fetched on demand): a small
   corner badge, not the full empty-state overlay, marks that preview as live and partial. Plain
   text, no interactive content -- pointer-events: none for the same reason as .map-empty above,
   though its footprint (a small corner badge, not inset: 0) makes it a much smaller target. */
.map-live-badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 4; max-width: 320px; pointer-events: none;
  background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; font-size: 12px; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
/* Review round 1 (#139): a click-to-add outage's own confirmation, over the map itself (not just
   the side panel's status line, easy to miss while looking at the map) -- one accent-bordered
   toast, an Undo right in it, centered above the map tools so it never sits under the cursor that
   just clicked. */
.map-toast {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 7;
  max-width: 420px; display: flex; align-items: center; gap: 10px;
  background: rgba(13,17,23,.94); color: #fff; border: 1px solid var(--accent); border-radius: 6px;
  padding: 8px 12px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.map-toast button { flex: none; }
/* the outage list's own newest row, briefly, so a click that scrolled the list is obvious even
   after the toast above has faded */
#ops-outage-list tr.just-added { animation: ops-outage-flash 1.6s ease-out; }
@keyframes ops-outage-flash {
  from { background: rgba(255, 211, 61, .45); }
  to { background: transparent; }
}

/* issue #142: a big spinner over the map while the hour on the timeline is being solved or
   loaded -- the map itself stays visible underneath, just dimmed, rather than the opaque
   .map-empty treatment (that one means "no data exists at all", this one means "on its way").
   pointer-events: none for the same reason as .map-empty above (regression fix, #139
   follow-up): also inset: 0 with no interactive content, so it would otherwise silently block
   every click meant for the map while an hour is being solved. */
.map-spinner {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; text-align: center; padding: 24px; background: rgba(13,17,23,.35);
  pointer-events: none;
}
.map-spinner-ring {
  width: 56px; height: 56px; border-radius: 50%; border: 5px solid rgba(255,255,255,.3);
  border-top-color: #fff; animation: ops-spin .8s linear infinite;
}
.map-spinner-label { color: #fff; font-size: 14px; font-weight: 600; max-width: 320px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
@keyframes ops-spin { to { transform: rotate(360deg); } }

/* Ops UX follow-up: a collapsed "what this shows" explainer and the outage editor's element
   preview span, styled like the rest of the panel's small/muted text rather than default
   <details>/<summary> chrome. */
#ops-explainer { margin: 4px 0 10px; }
#ops-explainer summary { cursor: pointer; }
#ops-explainer p { margin: 4px 0; }
/* issue #148: curtailment behind a constraint, collapsed to its own summary line by default */
#ops-curtailment-details summary { cursor: pointer; }
#ops-curtailment-body .curt-line { margin: 3px 0; }
/* issue #140: the N-1 watch list is collapsed to its summary line by default (native
   <details>/<summary>, same chrome as #ops-explainer above), a small (i) explains binding vs
   relaxed without needing the list expanded, and rows are a fixed-width table with two wide
   name/outage columns rather than the old 7-column table, which squeezed long element and
   outage names into a couple of narrow columns and wrapped them across four or more lines. */
#ops-watch-details summary { cursor: pointer; }
#ops-watch-details summary .tag { margin-left: 2px; }
.info-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 50%; font: italic 700 10px/1 Georgia, serif; background: #eaeef2; color: var(--muted);
  border: 1px solid var(--line); cursor: help; padding: 0; vertical-align: middle;
}
.info-badge:hover { background: #dde3ea; }
/* #344: the word "slack" is its own popover trigger: plain text with a dotted underline, not the round (i) */
.info-badge.flows-slack-word, .info-badge.flows-slack-word[aria-expanded="true"] {
  display: inline; width: auto; height: auto; border: 0; border-bottom: 1px dotted currentColor; border-radius: 0; background: none;
  font: inherit; color: inherit; padding: 0; vertical-align: baseline;
}
.info-badge.flows-slack-word:hover, .info-badge.flows-slack-word[aria-expanded="true"] { background: rgba(88, 166, 255, .16); }
/* the slack plant on the map: a small ring and a tag after a Power flow result; a bigger pulsing ring when its word is hovered */
.slack-pin { width: 0; height: 0; pointer-events: none; z-index: 3; }
.slack-pin[hidden] { display: none; }
.slack-pin .slack-ring { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid #ffd54a; background: rgba(255, 213, 74, .18); transition: all .15s; }
.slack-pin .slack-tag { position: absolute; left: 12px; top: -8px; white-space: nowrap; font: 700 10px/1 system-ui, sans-serif; letter-spacing: .02em;
  color: #fff; background: rgba(13, 17, 23, .92); padding: 2px 5px; border-radius: 3px; border-left: 3px solid #ffd54a; }
.slack-pin.hot .slack-ring { left: -16px; top: -16px; width: 32px; height: 32px; border-width: 3px; background: rgba(255, 213, 74, .28); box-shadow: 0 0 0 4px rgba(255, 213, 74, .25); }
.slack-pin.hot .slack-tag { left: 20px; top: -9px; font-size: 12px; padding: 3px 7px; }
.slack-pin.left .slack-tag { left: auto; right: 20px; border-left: 0; border-right: 3px solid #ffd54a; }
.fw-slack { font-weight: 400; font-size: 12px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .slack-pin .slack-ring { transition: none; } }
/* issue #151: this badge is now reused across every view (a generalization of the one-off #140
   built for the N-1 watch list), so a visible keyboard focus ring matters everywhere, not just
   there -- same treatment as .asm:focus-visible above, not the outline:none the single-instance
   badge used to set (it relied on the hover background alone, fine for a mouse, invisible to a
   keyboard or switch user tabbing through many of these now). */
.info-badge:focus-visible { background: #dde3ea; outline: 2px solid var(--accent); outline-offset: 1px; }
.info-badge[aria-expanded="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.info-popover {
  position: fixed; z-index: 20; max-width: min(30em, calc(100vw - 24px)); background: #fff; color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 10px 12px; font-size: 12px; line-height: 1.5;
}
.info-popover p { margin: 0 0 6px; }
.info-popover p:last-child { margin-bottom: 0; }
.ops-watch-table { table-layout: fixed; width: 100%; }
.ops-watch-table .ow-name { width: 27%; font-weight: 600; overflow-wrap: break-word; }
.ops-watch-table .ow-outage { width: 29%; overflow-wrap: break-word; }
.ops-watch-table .ow-flow { width: 25%; overflow-wrap: break-word; }
.ops-watch-table .ow-price { width: 19%; overflow-wrap: break-word; }
.ops-watch-row:hover { background: #eef4ff; }
.ops-watch-row .dir-arrow { font-weight: 700; white-space: nowrap; }

/* issue #46: portfolio cards, KPI bar, gallery and shortlist over the same find_sites result
   the table already renders. The segmented control mirrors the nav strip's own look (active
   item picked out by colour) rather than inventing a second control style. */
.seg { gap: 4px; }
.sview-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pf-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 8px 0;
}
.pf-gallery { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pf-card {
  border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden;
  display: flex; flex-direction: column; font-size: 12px;
}
.pf-card-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 0; }
.pf-map {
  width: 100%; height: 110px; background: #eef0f3; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pf-card.gallery .pf-map { height: 190px; }
.pf-map svg { width: 100%; height: 100%; }
.pf-card-body { padding: 6px 8px; flex: 1 1 auto; }
.pf-card.gallery .pf-card-body { font-size: 11px; }
.pf-kv-row { display: flex; justify-content: space-between; gap: 6px; padding: 1px 0; }
.pf-kv-row span { color: var(--muted); }
.pf-card-actions { padding: 6px 8px; border-top: 1px solid var(--line); font-size: 12px; }
.pf-pin { padding: 0 6px; font-size: 14px; line-height: 1; border-color: transparent; background: none; }
.pf-pin.pinned { color: var(--yellow); }
#site-shortlist:not(:empty) {
  border: 1px solid var(--yellow); border-radius: 6px; padding: 8px; margin: 8px 0; background: #fffdf5;
}
#site-shortlist h2 { margin-top: 0; }
.pf-shortlist-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* issue #146: Trading's binding-constraints section -- one collapsible <details>, grouped N-0/N-1,
   one compact row per constraint instead of a wide table (element, if <outage>, flow / limit,
   $/MWh). Styled like #ops-explainer's own <details> rather than default browser chrome. */
#trading-binding-details summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#trading-binding-details summary .small { font-weight: normal; }
.tr-group { margin: 8px 0; }
.tr-group h3 { font-size: 11px; margin: 6px 0 2px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tr-row { display: flex; align-items: baseline; gap: 5px; padding: 2px 0; font-size: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tr-row .tr-price { margin-left: auto; font-variant-numeric: tabular-nums; }
.tr-row.relaxed .tr-price { color: var(--red); font-weight: 600; }
.tr-sep { color: var(--muted); }
/* issue #145: the ops time-series panel -- a stack of small, hand-rolled inline SVG charts across
   the run's whole horizon, sharing one x axis (real time, issue #170). Thin marks, hairline
   gridlines, muted axis text, a 2px selected-hour marker line kept in sync with the timeline both
   ways. */
#ops-timeseries summary { cursor: pointer; }
.ts-chart { border: 1px solid var(--line); border-radius: 6px; margin: 6px 0; padding: 6px 8px 4px; background: var(--panel); }
.ts-chart-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.ts-svg { width: 100%; height: auto; display: block; cursor: crosshair; }
.ts-svg .ts-grid { stroke: var(--line); stroke-width: 1; }
.ts-svg .ts-axis { stroke: var(--line); stroke-width: 1; }
.ts-svg .ts-tick-label { fill: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.ts-svg .ts-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* issue #170: an isolated sampled hour (no neighbour within an hour to draw a line to) still gets
   a visible dot -- a lone "M" with no "L" would otherwise paint nothing at all. */
.ts-svg .ts-dot { stroke: var(--panel); stroke-width: 1; }
.ts-svg .ts-marker { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 2; pointer-events: none; }
.ts-svg .ts-area { stroke: none; }
.ts-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin: 2px 0 4px; }
.ts-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; vertical-align: middle; }
.ts-legend .sw.line { width: 12px; height: 2px; border-radius: 1px; }

/* issue #214: the Flows chapter. Two button groups (load level, outage); the active button uses the
   same accent fill as the sites view switcher (.sview-btn.active). */
.flows-picker { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.flows-group-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.flows-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.flows-btns-outage { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.flows-btn { font-size: 12px; text-align: left; line-height: 1.25; }
.flows-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.flows-btn.active:hover:not(:disabled) { background: #1a5fd0; }
.flows-btn-name { display: block; font-weight: 600; }
.flows-btn-sub { display: block; font-size: 11px; opacity: .75; }
.flows-detail { border-left: 3px solid var(--accent); padding: 4px 8px; margin: 8px 0; }

/* issue #204 follow-up: content for one site only (the public static build sets data-site) */
html[data-site="static"] .site-collab-only, html:not([data-site="static"]) .site-static-only { display: none; }
/* issue #389: the address box keeps its width; the match or error sits on its own line under it */
#site-address { flex: 1 1 14rem; min-width: 12rem; }
#site-address-status { flex: 1 0 100%; }
#site-address-status:empty { display: none; }
.about-chapters { padding-left: 18px; margin: 8px 0; }
.about-chapters li { margin: 4px 0; }
#nav .nav-item:disabled { opacity: .5; cursor: default; }
.nav-item .soon, #btn-draw-parcel .soon { margin-left: 4px; }

/* Flows chapter (owner walkthrough 2026-09-30): one view control, a readable caption with
   clickable facts, a legend whose entries light up their lines on the map, phone layout */
/* issue #228: the private site's edit mode (server only; hidden on the static site) */
.flows-edit { border: 1px dashed var(--line); border-radius: 6px; padding: 6px 8px; margin: 0 0 8px; }
.flows-edit-toggle.active { background: #eef4ff; color: var(--accent); border-color: var(--accent); }
#flows-edit-body { margin-top: 6px; }
#flows-edit-factor { width: 4.5em; }
.flows-edit-list { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; }
.flows-edit-list li { margin: 2px 0; }
.flows-edit-rm { padding: 0 6px; margin-left: 4px; line-height: 1.4; font-size: 12px; }
.flows-edit-list-head { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.flows-edit-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#flows-edit-bus input { width: 6em; }
.flows-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 2px 0 8px; }
.flows-seg-btn { border: 0; border-radius: 0; font-size: 12px; padding: 5px 10px; background: #fff; }
.flows-seg-btn + .flows-seg-btn { border-left: 1px solid var(--line); }
.flows-seg-btn.active, .flows-seg-btn.active:hover:not(:disabled) { background: #eef4ff; color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }
/* design review: only the chosen outage is filled blue; the load level reads as a secondary choice */
#flows-levels .flows-btn.active, #flows-levels .flows-btn.active:hover:not(:disabled) { background: #eef4ff; color: var(--accent); border-color: var(--accent); }
.flows-caption { font-size: 13px; line-height: 1.5; background: #f6f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 0 0 8px; }
.flows-head { margin: 0 0 6px; font-size: 14px; }
.flows-facts { list-style: none; padding: 0; margin: 0 0 4px; }
.flows-facts li { margin: 3px 0; }
.flows-fact-k { display: inline-block; min-width: 88px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.flows-el, .flows-link { font: inherit; padding: 0; border: 0; background: none; color: var(--accent); cursor: pointer; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }
.flows-el { font-weight: 600; }
.flows-el:hover:not(:disabled), .flows-link:hover:not(:disabled) { background: none; text-decoration: underline solid; }
.flows-nums { white-space: nowrap; }
.flows-hint { font-size: 11px; color: var(--muted); margin: 0 0 4px; }
.flows-over { list-style: none; padding: 0 0 0 12px; margin: 2px 0; }
.flows-over li { margin: 1px 0; }
.flows-kv { font-weight: 400; color: var(--muted); font-size: 12px; }
.flows-bad { color: #cf222e; }
.flows-more { margin-top: 6px; font-size: 12px; color: var(--muted); }
.flows-more summary { cursor: pointer; }
.flows-more p { margin: 4px 0; }
.flows-legend { font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.flows-legend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin: 2px 0 2px -6px; }
.flows-legend-title { font-weight: 600; color: var(--text); }
.flows-legend-note { margin: 2px 0; }
.flows-key { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); padding: 2px 6px; border: 1px solid transparent; border-radius: 4px; background: none; }
.flows-key { cursor: pointer; }
.flows-key:hover:not(:disabled), .flows-key.active { background: rgba(31, 111, 235, .1); border-color: #c8dafc; color: var(--text); }
.flows-key .sw { display: inline-block; width: 18px; height: 4px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
.flows-key .sw.flows-dash { height: 8px; width: 24px; border-radius: 2px; box-shadow: none;
  background: repeating-linear-gradient(90deg, #e6edf3 0 5px, transparent 5px 9px) center / 100% 2px no-repeat, #22272e; }
.flows-pill { font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: #b62324; border-radius: 3px; padding: 0 3px; }
.flows-glyph { width: 16px; height: 16px; color: #22272e; }
.flows-detail > div { margin: 1px 0; }
.flows-kv-row { margin-top: 6px; }
.flows-kv-row .flows-legend-title { margin: 0 4px 0 6px; }
.flows-kv-chip { font-size: 12px; padding: 2px 8px; border-radius: 12px; color: var(--muted); background: #fff; text-decoration: line-through; }
.flows-kv-chip.on { color: var(--text); background: #eef4ff; border-color: #c8dafc; text-decoration: none; }
.flows-kv-chip.lod { opacity: .55; border-style: dashed; }
.flows-kv-lod { font-size: 10px; color: var(--muted); margin-left: 2px; }
@media (max-width: 480px) {
  /* phone: the map first and taller, the outage picker as one row that scrolls sideways */
  body:has(#view-flows:not([hidden])) #map-wrap { flex-basis: 46vh; }
  body:has(#view-flows:not([hidden])) #btn-draw-parcel { display: none; }
  .flows-btns-outage { display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .flows-btns-outage .flows-btn { flex: 0 0 auto; max-width: 64vw; scroll-snap-align: start; }
  .flows-btn-name { white-space: nowrap; }
  .flows-seg { display: flex; }
  .flows-seg-btn { flex: 1 1 0; }
}
.flows-dirty { color: #9a6700; font-weight: 600; }
.flows-solve:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.flows-solve:hover:not(:disabled) { background: #1a5fd0; }
.flows-edit-form { background: #f6f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin: 6px 0; font-size: 13px; }
.flows-edit-form label { margin-right: 6px; }
.flows-delta-k { white-space: nowrap; }
.map-failed { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); max-width: 420px; padding: 14px 16px; background: #161b22; color: #e6edf3; border: 1px solid #30363d; border-radius: 8px; font-size: 14px; line-height: 1.5; }

/* issue #249: the public site's waitlist card and Substack link (owner-approved mock, 2026-10-02) */
a.nav-item { text-decoration: none; }
.nav-item.nav-cta { background: var(--yellow); color: #24292f; font-weight: 600; margin: 0 8px 4px; border-radius: 5px; border-left: 0; }
.nav-item.nav-cta:hover:not(:disabled) { background: #f0c75e; color: #24292f; }
/* owner, 2026-10-02: room between the chapter and the offer, so the card doesn't crowd it */
.waitlist { border: 2px solid var(--yellow); border-radius: 8px; overflow: hidden; background: #fff; margin: 40px 0 8px; }
.waitlist-band { background: #24292f; color: #fff; padding: 12px 14px; border-bottom: 3px solid var(--yellow); }
.waitlist-kicker { color: var(--yellow); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.waitlist-band h2 { color: #fff; font-size: 18px; margin: 2px 0 0; }
.waitlist-body { padding: 12px 14px; }
.waitlist-body p { margin: 0 0 10px; }
.waitlist-video { display: block; width: 100%; aspect-ratio: 1440 / 900; margin: 0 0 10px; border-radius: 5px; border: 1px solid var(--line); background: #0d1117; }
.waitlist-form { display: flex; gap: 6px; flex-wrap: wrap; }
.waitlist-form input[type=email] { flex: 1 1 150px; min-width: 0; font: inherit; padding: 7px 9px; border: 1px solid #c8ced6; border-radius: 5px; }
.waitlist-form button.primary { padding: 7px 14px; font-weight: 600; }
.waitlist-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#waitlist-msg { margin: 8px 0 0; }
#waitlist-msg:empty { display: none; }
#waitlist-msg.ok { color: #1a7f37; font-weight: 600; }
#waitlist-msg.err { color: #cf222e; }
/* the nav button's landing spot must be obvious: three yellow pulses, and the card stays
   outlined while the email field has the cursor */
.waitlist:focus-within { box-shadow: 0 0 0 2px var(--yellow); }
.waitlist.flash { animation: waitlist-flash .7s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) { .waitlist.flash { animation: none; } }  /* the focus outline still marks it */
@keyframes waitlist-flash { 0%, 100% { box-shadow: 0 0 0 2px var(--yellow); } 50% { box-shadow: 0 0 0 7px var(--yellow); } }
/* the bar: sticks to the panel's bottom edge; invisible (not removed, so the layout never jumps)
   while the card itself is on screen */
.waitlist-bar { position: sticky; bottom: -24px; z-index: 3; display: flex; align-items: center; gap: 10px; width: calc(100% + 32px);
  margin: 16px -16px -24px; padding: 10px 16px; border: 0; border-top: 3px solid var(--yellow); border-radius: 0;
  background: #24292f; color: #fff; font-size: 14px; text-align: left; }
.waitlist-bar b { flex: 1; }
.waitlist-bar-go { background: var(--yellow); color: #24292f; font-weight: 600; font-size: 13px; padding: 5px 12px; border-radius: 5px; }
.waitlist-bar:hover:not(:disabled) { background: #30363d; }
.waitlist-bar.away { visibility: hidden; }
/* scrolling to a focused control or a row keeps it clear of the bar */
html[data-site="static"] #panel { scroll-padding-bottom: 56px; }
.step.substack { margin-bottom: 0; }
.step.substack p { margin: 0 0 6px; }
.substack-btn { display: inline-block; background: #ff6719; color: #fff; border-radius: 5px; padding: 4px 10px; font-size: 13px; text-decoration: none; }
.substack-btn:hover { background: #e85a10; }
@media (max-width: 900px) { .nav-item.nav-cta { margin: 4px; } }

/* issue #263: the Operator dispatch view */
#flows-modes { margin-bottom: 10px; }
#flows-dispatch .flows-caption p { margin: 0 0 6px; }
.fd-h { font-size: 13px; margin: 12px 0 4px; }
.fd-list { list-style: none; padding: 0; margin: 0 0 6px; }
.fd-list li { margin: 0 0 6px; line-height: 1.35; }
.fd-focus { font-weight: 700; }
.fd-table { border-collapse: collapse; width: 100%; font-size: 12px; margin: 0 0 6px; }
.fd-table td { padding: 2px 6px 2px 0; vertical-align: top; }
.fd-table td.num { white-space: nowrap; text-align: right; }

/* issue #267: the live dispatch's bus search; the dropdown anchors to this wrapper */
.fd-pick { position: relative; margin: 4px 0; }
.fd-pick input { width: 100%; box-sizing: border-box; }
/* issue #268: one end of an FTR path, the button that arms a map click above its search box */
.fd-ftr-end { margin: 6px 0; }
#fd-ftr-result p { margin: 6px 0; }
.fd-table td.num-cell { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }

.fd-story { border-left: 3px solid #ffd33d; }
/* #286: Back and Next on the first row of the box, so they stay put whatever the text below */
.fd-story-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; min-height: 30px; }
.fd-story-head { margin: 0 0 4px; }
.fd-story .fd-story-text { margin: 0 0 4px; }
.fd-story .fd-story-real { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line, #30363d); font-size: 12px; opacity: .85; }
.fd-story .fd-story-real a { color: inherit; text-decoration: underline; }
.fd-story .fd-story-real summary { cursor: pointer; }
.fd-story .fd-story-real p { margin: 4px 0 0; }
.fd-story-nav { display: flex; gap: 8px; }
.fd-story-nav .flows-btn { min-width: 64px; text-align: center; }

/* #286: the two modes, a big two-option switch with a line under each name */
.flows-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.flows-mode { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; line-height: 1.25; }
.flows-mode b { font-size: 14px; }
.flows-mode span { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.flows-mode:hover:not(.active) { border-color: #b6c2d1; }
.flows-mode.active, .flows-mode.active:hover { border-color: var(--accent); background: #eef4ff; box-shadow: inset 0 -3px 0 var(--accent); }
.flows-mode.active b { color: var(--accent); }
@media (max-width: 480px) { .flows-mode { padding: 7px 8px; } .flows-mode b { font-size: 13px; } .flows-mode span { font-size: 11px; } }

/* #286: the lists start closed, the heading with its count opens them; "More" for the long part of a summary */
.fd-sub { font-size: 12px; font-weight: 600; margin: 10px 0 2px; }
.fd-fold { border-top: 1px solid var(--line); margin: 8px 0 0; padding-top: 4px; }
.fd-fold > summary, .fd-more > summary { cursor: pointer; padding: 3px 0; font-size: 13px; }
.fd-more > summary { color: var(--accent); font-size: 12px; list-style: none; }
.fd-more > summary::-webkit-details-marker { display: none; }
.fd-more > summary .fd-more-off, .fd-more[open] > summary .fd-more-on { display: none; }
.fd-more[open] > summary .fd-more-off { display: inline; }
.fd-more > summary::after { content: ' \25BE'; }
.fd-more[open] > summary::after { content: ' \25B4'; }
.fd-story-nav .flows-btn[disabled] { opacity: 0.4; cursor: default; }

/* issues #287, #292: the one legend, a chip on the map at the bottom left, closed until asked; open, it lists only
   the keys of the screen and holds the voltage-level filter */
.map-legend { position: absolute; left: 10px; bottom: 34px; z-index: 3;  /* #306: lowest spot that still clears the map credit */ display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  max-width: min(760px, calc(100% - 20px)); box-sizing: border-box; color: #e6edf3; font-size: 10.5px; line-height: 1.25; }
.map-legend .ml-toggle { font: inherit; font-size: 12px; font-weight: 600; color: #e6edf3; background: rgba(13, 17, 23, .94); border: 1px solid #30363d;
  border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.map-legend.open .ml-toggle { border-color: #8b949e; }
.map-legend .ml-panel { background: rgba(13, 17, 23, .94); border: 1px solid #30363d; border-radius: 6px; padding: 4px 8px 5px; max-height: min(55vh, 420px); overflow: auto; max-width: 100%; box-sizing: border-box;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1px 14px; }
.map-legend .ml-panel[hidden] { display: none; }
.map-legend .ml-sec { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.map-legend .ml-title { font-weight: 600; }
.map-legend .ml-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }
.map-legend .ml-note { color: #9da7b3; }
.map-legend .ml-key { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: #c9d1d9; font: inherit; background: none; border: 0; padding: 2px 4px; border-radius: 4px; cursor: default; }
.map-legend .ml-key[data-hl] { cursor: pointer; }
.map-legend .ml-key[data-hl]:hover, .map-legend .ml-key.active { background: rgba(255, 255, 255, .12); color: #fff; }
.map-legend .sw { display: inline-block; width: 14px; height: 6px; border-radius: 2px; }
.map-legend .sw.dash { background-image: repeating-linear-gradient(90deg, rgba(13,17,23,.9) 0 2px, transparent 2px 4px); }
.map-legend .sw.limit { width: 16px; height: 6px; background: var(--kv); box-shadow: 0 0 0 2px var(--k); margin: 0 3px; }
.map-legend .sw.limit.over { box-shadow: 0 0 0 2px var(--k), 0 0 6px 3px rgba(248, 81, 73, .7); }
@keyframes fd-over-pulse { 50% { box-shadow: 0 0 0 2px var(--k), 0 0 2px 1px rgba(248, 81, 73, .25); } }
@media (prefers-reduced-motion: no-preference) { .map-legend .sw.limit.over { animation: fd-over-pulse 1.3s ease-in-out infinite; } }
.map-legend .sw.thin { height: 1px; width: 20px; }
.map-legend .rev-chip { display: inline-block; font-style: normal; font-weight: 700; font-size: 10px; line-height: 1; padding: 3px 5px; color: #fff; background: #161b22; border: 1.5px solid #8b949e; border-radius: 6px; white-space: nowrap; }
.map-legend .sw.wide { width: 24px; height: 7px; background: linear-gradient(90deg, #8b949e, #8b949e) left center / 6px 2px no-repeat, linear-gradient(#8b949e, #8b949e) right center / 14px 7px no-repeat; background-color: transparent; }
.map-legend .sw.flow { width: 20px; background: repeating-linear-gradient(90deg, #fff 0 5px, transparent 5px 9px) center / 100% 2px no-repeat; }
.map-legend .sw.flows-dash { width: 24px; height: 8px; background: repeating-linear-gradient(90deg, #aab2bd 0 5px, transparent 5px 9px) center / 100% 2px no-repeat; }
.map-legend .sq { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid #0d1117; }
.map-legend .sq.star { background: #ffd33d; border-radius: 50%; }
.map-legend .flows-glyph { color: #e6edf3; }
.map-legend .flows-link { color: #79c0ff; }
.map-legend .flows-kv-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; padding: 0 7px; border-radius: 12px; color: #8b949e; background: none; border: 1px solid #30363d; text-decoration: line-through; cursor: pointer; }
.map-legend .flows-kv-chip.on { color: #e6edf3; background: rgba(255, 255, 255, .1); border-color: #8b949e; text-decoration: none; }
.map-legend .flows-kv-chip.lod { opacity: .6; border-style: dashed; }
.map-legend .flows-kv-lod { color: #8b949e; }
/* #300: the keys for the arrow size, the % circle and the cross */
.map-legend .ml-arrow { display: block; flex: none; }
.map-legend .ml-pct { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid #0d1117;
  font: 700 9px/1 -apple-system, Segoe UI, Helvetica, Arial, sans-serif; font-style: normal; color: #0d1117; background: #e3b341; }
.map-legend .ml-pct.red { background: #f85149; color: #fff; }
.map-legend .ml-x { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #0d1117; border: 1px solid #8b949e;
  color: #fff; font: 700 10px/1 -apple-system, Segoe UI, Helvetica, Arial, sans-serif; font-style: normal; }
.map-legend .ml-key { min-height: 18px; }
.map-legend .poi-ring { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #ffd33d; background: rgba(255, 211, 61, .35); box-sizing: border-box; }
.maplibregl-popup { z-index: 30; }  /* #306: the hover popup sits above every card, the legend and the station diagrams */
/* #292: one label style on the map, a card: near-black, white text, the role colour only as a stripe and a thin leader line */
.mc-pin { width: 0; height: 0; pointer-events: none; z-index: 2; }
.mc-pin * { pointer-events: none; }
.mc-pin .mc-leader { position: absolute; left: 0; top: 0; overflow: visible; }
.mc-pin .mc-card { position: absolute; left: 0; top: 0; width: max-content; max-width: 200px; box-sizing: border-box; background: rgba(13, 17, 23, .94); color: #fff;
  border-left: 3px solid var(--role, #8b949e); border-radius: 3px; padding: 4px 8px 4px 7px; font-size: 12px; line-height: 1.3; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.mc-pin.mc-wait .mc-card, .mc-pin.mc-wait .mc-leader { visibility: hidden; }
.mc-title { font-weight: 600; }
.mc-tag { display: inline-block; padding: 0 4px; margin-right: 2px; border-radius: 3px; background: var(--role); color: #0d1117; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; vertical-align: 1px; }
.mc-num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; font-size: 11.5px; }
.fd-pop { max-width: 250px; }
.fd-pop > div { margin: 2px 0; }
.fd-pop-head { font-size: 13px; }
.fd-pop-flow { font-variant-numeric: tabular-nums; }
.fd-pop-limit { padding-left: 6px; border-left: 3px solid #f85149; }
.fd-pop-note { color: var(--muted); font-size: 11px; }
.fd-pop .fd-i { margin-right: 2px; }
@media (max-width: 480px) {
  .map-legend { left: 6px; bottom: 32px; font-size: 10px; max-width: calc(100% - 12px); }
  .map-legend .ml-row { gap: 0 4px; }
  .mc-pin .mc-card { max-width: 150px; font-size: 11px; padding: 3px 6px 3px 6px; }
  .mc-num { font-size: 10.5px; }
}

/* #294: a station's one-line diagram (near zoom) is a map marker that only shows; the map keeps every click */
.stn-diagram { pointer-events: none; line-height: 0; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
/* #308: only a line stub takes the pointer (to name its line); the rest of the diagram never blocks the map. The hovered diagram rises above every other marker. */
.stn-diagram .stn-hit { pointer-events: stroke; cursor: pointer; }
/* #321: a bus, a transformer or a line stub brightens under the pointer (no new colours) */
.stn-diagram .stn-hov:hover { filter: brightness(1.45); }
.stn-diagram .stn-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 4px); white-space: nowrap; font: 600 11px/1.2 -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; color: #e6edf3; background: rgba(13, 17, 23, 0.94); border: 1px solid #58a6ff; border-radius: 4px; padding: 3px 7px; pointer-events: none; }
.stn-diagram:hover { z-index: 10; }
.stn-diagram .stn-name { display: none; pointer-events: none; }
.stn-diagram .stn-stub:hover .stn-name { display: inline; }

/* issue #293: a bold word in the panel is a button with a colour key, the twin of an element on the map */
.fd-twin { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; border-bottom: 1px dotted var(--muted); padding: 0; margin: 0; cursor: pointer; text-align: left; }
.fd-twin:hover, .fd-twin:focus-visible { border-bottom-style: solid; background: #eef4ff; border-radius: 2px; }
.fd-twin:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fd-twin-t { font-weight: 700; }
.fd-key { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; box-sizing: border-box; background: var(--k); border: 1.5px solid #0d1117; border-radius: 50%; }
/* #307: the limited line is its own voltage colour inside a bright casing */
.fd-key-line { width: 16px; height: 8px; border-radius: 2px; vertical-align: 0; background: var(--kv, #a3a3a3); border: 0; box-shadow: 0 0 0 2px var(--k); margin: 0 6px 0 3px; }
.fd-key-trip { width: 14px; height: 0; border: 0; border-top: 3px dashed var(--k); background: none; border-radius: 0; vertical-align: 2px; }
.fd-key-plant { border-radius: 3px; width: 11px; height: 11px; }
/* the story's dots: the current one is wide */
.fd-dots { display: flex; align-items: center; }
.fd-dot { position: relative; width: 22px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; flex: none; }
.fd-dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 4px; background: #b6c2d1; transition: width .2s, margin .2s, background .2s; }
.fd-dot:hover::after { background: #8b9bb0; }
.fd-dot.on::after { width: 22px; margin-left: -11px; background: var(--accent); }
.fd-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.fd-cap-title { font-weight: 700; margin: 0 0 4px; }
.fd-story-head { font-weight: 700; }
.fd-private { margin: 12px 0 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.mc-pin .mc-card, .mc-pin .mc-leader { transition: opacity .15s; }
/* the marker element carries an inline opacity from MapLibre, so the dim goes on what is inside it */
.mc-pin.mc-dim .mc-card, .mc-pin.mc-dim .mc-leader { opacity: .22; }
@media (prefers-reduced-motion: reduce) { .fd-dot::after, .mc-pin .mc-card, .mc-pin .mc-leader { transition: none; } }
.flows-sites { display: flex; gap: 8px; align-items: center; margin: 8px 0; cursor: pointer; }
.flows-sites input { margin: 0; }
/* #300: the open legend is two columns on a wide screen, so it covers less of the map */
@media (min-width: 700px) {
  .map-legend { max-width: min(680px, calc(100% - 20px)); }
  .map-legend .ml-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; align-items: start; }
  .map-legend .ml-panel .ml-sec + .ml-sec { margin-top: 0; }
}

/* #332: the private workspace, two solve buttons and the result header */
.fw-solves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 4px; }
.fw-solve .flows-solve { width: 100%; }
.fw-solve .flows-solve.fw-cancel:not(:disabled) { background: #fff; color: #b42318; border-color: #b42318; }
.fw-solve .flows-solve.fw-cancel:hover:not(:disabled) { background: #fdecea; }
.fw-solve p { margin: 4px 0 0; }
.fw-result { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.fw-result-head { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.fw-stale { color: #9a6700; font-weight: 400; }
@media (prefers-color-scheme: dark) { .fw-stale { color: #e3b341; } }  /* #326: the amber on a dark page */
#fw-form input { width: 6em; }
#fw-form .fw-row { margin: 4px 0; }
@media (max-width: 480px) { .fw-solves { grid-template-columns: 1fr; } }

/* #330: an (i) on each mode card opens the article's comparison table */
.flows-mode-card { position: relative; display: flex; }
.flows-mode-card .flows-mode { flex: 1; padding-right: 30px; }
.flows-mode-card .info-badge { position: absolute; top: 8px; right: 8px; }
.info-popover:has(.fd-compare) { max-width: min(46em, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; }
.fd-compare table { border-collapse: collapse; width: 100%; font-size: 12px; }
.fd-compare th, .fd-compare td { text-align: left; vertical-align: top; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.fd-compare thead th { font-weight: 700; }
.fd-compare tbody th { font-weight: 600; white-space: nowrap; }
@media (max-width: 480px) {
  .fd-compare thead { display: none; }
  .fd-compare table, .fd-compare tbody, .fd-compare tr, .fd-compare th, .fd-compare td { display: block; }
  .fd-compare tr { padding: 4px 0; border-bottom: 1px solid var(--line); }
  .fd-compare th, .fd-compare td { border: 0; padding: 1px 0; }
  .fd-compare tbody th { white-space: normal; }
  .fd-compare td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); }
}
@media (max-width: 480px) { .info-popover:has(.fd-compare) { top: 12px !important; left: 12px !important; right: 12px; max-width: none; } }

/* #331: the (i) beside "a limit that cannot be met" in the map legend */
.map-legend .ml-info { margin: 0 4px 0 2px; flex: none; }
.map-legend .ml-keyi { display: inline-flex; align-items: center; }

/* #363: the labelled result switch, and the re-dispatch's Before / After / Difference (only After shows the case's own words) */
.fw-flip { align-items: center; }
.fw-flip-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
#flows-dispatch[data-view="before"] #fd-story, #flows-dispatch[data-view="change"] #fd-story,
#flows-dispatch[data-view="before"] #fd-caption, #flows-dispatch[data-view="change"] #fd-caption,
#flows-dispatch[data-view="before"] #fd-constraints, #flows-dispatch[data-view="change"] #fd-constraints,
#flows-dispatch[data-view="before"] #fd-units, #flows-dispatch[data-view="change"] #fd-units { display: none; }

/* issue #384: the example-town card. On the public site it is the whole Study panel. */
html[data-site="static"] #view-study > :not(h1):not(#study-card) { display: none !important; }
#study-card .sc-label { margin-top: 10px; }
#study-card .sc-mw { font-size: 13px; color: var(--text); text-transform: none; letter-spacing: 0; margin-left: 4px; }
#sc-size { width: 100%; margin: 4px 0 0; }
.sc-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin: 0 2px 2px; }
/* the outcome under each tested size: a text mark and the size, so the outcome never rests on colour alone */
.sc-tick { display: flex; flex-direction: column; align-items: center; min-width: 22px; line-height: 1.25; }
.sc-tick i { font-style: normal; font-weight: 700; font-size: 13px; }
.sc-tick.clean i, .sc-band.clean .sc-mark { color: #1a7f37; }
.sc-tick.upgrades i, .sc-band.upgrades .sc-mark, .sc-tick.open i, .sc-band.open .sc-mark, .sc-tick.uopen i, .sc-band.uopen .sc-mark { color: #9a6700; }
.sc-tick.none i, .sc-tick.nosol i, .sc-band.none .sc-mark, .sc-band.nosol .sc-mark { color: #b42318; }
.sc-tick.cur { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.sc-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 2px 0 0; }
.sc-legend i { font-style: normal; font-weight: 700; color: var(--text); }
.sc-mapbar { display: none; margin-top: 8px; }
.sc-map-toggle { min-height: 44px; padding: 8px 14px; font-size: 14px; }
.sc-result { margin-top: 10px; }
.sc-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.sc-head { padding: 10px 12px; border-left: 6px solid var(--muted); }
.sc-head.yes_now, .sc-head.yes_with_upgrades { border-left-color: var(--green); background: #f1faf3; }
.sc-head.yes_with_upgrades { border-left-color: var(--yellow); background: #fdf8e8; }
.sc-head.no_workable_plan, .sc-head.no_solution { border-left-color: var(--red); background: #fdf1f0; }
.sc-where { font-size: 12px; color: var(--muted); }
.sc-verdict { font-size: 17px; font-weight: 700; line-height: 1.25; margin: 2px 0; }
.sc-verdict:focus { outline: none; }
.sc-verdict:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.sc-verdict .sc-mark { display: inline-block; min-width: 1.1em; text-align: center; border: 2px solid currentColor; border-radius: 50%; font-size: 13px; line-height: 1.2; margin-right: 2px; }
.sc-head.yes_now .sc-mark { color: #1a7f37; }
.sc-head.yes_with_upgrades .sc-mark { color: #9a6700; }
.sc-head.no_workable_plan .sc-mark, .sc-head.no_solution .sc-mark { color: #b42318; }
.sc-facts { margin: 6px 0 4px; display: grid; gap: 4px; }
.sc-facts > div { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.sc-facts dt { font-size: 12px; color: var(--muted); min-width: 9.5em; }
.sc-facts dd { margin: 0; font-weight: 700; }
.sc-flag { display: inline-block; font-size: 12px; font-weight: 600; color: #7a4b00; background: #fff1cc; border: 1px solid #e3b341; border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.sc-basis { font-size: 12px; color: var(--muted); }
.sc-scope { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sc-sec { padding: 8px 12px; border-top: 1px solid var(--line); }
.sc-sec h4 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px; }
.sc-sec p { margin: 4px 0; }
.sc-sec ul { margin: 0; padding-left: 18px; }
.sc-sec li { margin: 3px 0; }
.sc-small { font-size: 12px; color: var(--muted); }
.sc-bands { list-style: none; padding-left: 0 !important; }
.sc-band .sc-mark { display: inline-block; min-width: 1em; text-align: center; font-weight: 700; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.sc-try { display: flex; flex-direction: column; align-items: flex-start; text-align: left; font-size: 13px; line-height: 1.25; padding: 6px 10px; min-height: 36px; cursor: pointer; }
.sc-try span { font-size: 11px; color: var(--muted); font-weight: 400; }
.sc-try-row { display: inline-block; min-height: 32px; }
.sc-compare { margin-top: 6px; }
.sc-compare summary, .sc-more > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.sc-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.sc-table th, .sc-table td { text-align: left; padding: 4px 6px 4px 0; border-top: 1px solid var(--line); vertical-align: top; font-weight: 400; }
.sc-table thead th { font-weight: 600; color: var(--muted); border-top: 0; }
.sc-table tr.cur { background: #f1f5ff; }
.sc-table tr.cur th { font-weight: 700; }
.sc-more > summary { text-transform: none; }
.sc-more h4 { margin-top: 8px; }
.sc-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; padding: 10px 12px; border-top: 3px solid var(--yellow); background: #24292f; color: #fff; }
.sc-cta div { flex: 1 1 200px; }
.sc-cta b { display: block; }
.sc-cta span { font-size: 12px; color: #d0d7de; }
.sc-cta button { min-height: 36px; background: var(--yellow); color: #24292f; border-color: var(--yellow); font-weight: 600; }
.sc-up { display: flex; flex-direction: column; gap: 1px; }
.sc-up b { font-weight: 600; }
.sc-up span { font-size: 12px; color: var(--muted); }
.sc-rules { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin-top: 8px; font-size: 12px; }
.sc-rules h4 { font-size: 12px; font-weight: 600; margin: 0 0 4px; text-transform: none; letter-spacing: 0; color: var(--text); }
.sc-rules h4 .muted { font-weight: 400; }
.sc-rules ul { margin: 0; padding-left: 18px; }
.sc-rules li { margin: 3px 0; }
.sc-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.sc-busy { color: var(--muted); font-style: italic; padding: 6px 0; }
.sc-err { color: #b42318; padding: 6px 0; }
/* UX review 2 (2026-11-02): the result as numbers and bars. Status is always a mark and a word as well as a colour. */
.sc-glance { padding: 8px 12px; }
.sc-tiles { list-style: none; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.sc-tile { margin: 0 !important; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-tile-l { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.sc-tile-v { font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sc-tile.none .sc-tile-v, .sc-tile.na .sc-tile-v { font-size: 15px; color: #57606a; font-weight: 600; }
.sc-tile-s { font-size: 11px; color: var(--muted); line-height: 1.3; }
.sc-tile .sc-flag { margin: 4px 0 0; align-self: flex-start; white-space: normal; }
/* timeline */
.sc-gl { list-style: none; margin: 4px 0 0 !important; padding: 0 !important; display: grid; gap: 7px; }
.sc-gr { margin: 0 !important; }
.sc-gr-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 12px; }
.sc-gr-n { color: var(--text); }
.sc-gr.par .sc-gr-n::after { content: ' (alongside the other)'; color: var(--muted); font-size: 11px; }
.sc-gr-h b { font-variant-numeric: tabular-nums; }
.sc-track { position: relative; height: 10px; background: #eef1f4; border-radius: 5px; margin-top: 3px; overflow: hidden; }
.sc-track i { position: absolute; top: 0; bottom: 0; display: block; }
.sc-gr .solid { background: #8c959f; }
.sc-gr .light { background: repeating-linear-gradient(45deg, #c4cad1 0 4px, #dfe3e8 4px 8px); }
.sc-gr.par .solid { background: var(--accent); }
.sc-gr.par .light { background: repeating-linear-gradient(45deg, #9ec1f7 0 4px, #cfe0fb 4px 8px); }
.sc-gr.done .solid { background: #1a7f37; }
.sc-gr.done .light { background: repeating-linear-gradient(45deg, #8fd1a3 0 4px, #c7e9d1 4px 8px); }
.sc-gr.done .sc-gr-n { font-weight: 700; }
.sc-axis { position: relative; height: 14px; margin: 3px 0 0; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.sc-axis span:first-child { transform: none; }
.sc-axis .end { transform: translateX(-100%); }
.sc-axis .lim { color: var(--text); font-weight: 600; }
.sc-axis-t { margin-top: 2px; }
/* the constraints */
.sc-frows { list-style: none; padding: 0 !important; margin: 0 0 6px !important; display: grid; gap: 4px; }
.sc-frows li { margin: 0 !important; }
.sc-frow { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; min-height: 44px; font-size: 13px; line-height: 1.3; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.sc-frow[aria-pressed="true"], .sc-frow.fx-on { border-color: var(--accent); background: #f1f5ff; box-shadow: inset 3px 0 0 var(--accent); }
.sc-frow-m { font-size: 11px; color: var(--muted); }
.sc-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 5px; border-radius: 3px; border: 1px solid var(--line); color: #57606a; background: #f6f8fa; }
.sc-tag.existing, .sc-tag.open { border-color: #d4a72c; background: #fff8e1; color: #7a4b00; }
.sc-st.ok { color: #1a7f37; } .sc-st.bad { color: #b42318; } .sc-st.warn { color: #9a6700; }
.sc-fd { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.sc-fd-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sc-bars { display: grid; gap: 8px; margin-top: 8px; }
.sc-bar-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: baseline; }
.sc-bar-l { white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); }
.sc-bar-t { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.sc-bar-t.bad { color: #b42318; font-weight: 600; } .sc-bar-t.ok { color: #1a7f37; } .sc-bar-t.warn { color: #9a6700; } .sc-bar-t.na { color: var(--muted); }
.sc-bar-row .sc-track { grid-column: 1 / -1; height: 12px; margin: 0; overflow: visible; background: #eef1f4; }
.sc-bar-row .sc-track .fill { left: 0; background: #57a0f0; border-radius: 6px 0 0 6px; }
.sc-bar-row .sc-track .fill.over { background: #3b82d6; }
.sc-bar-row .sc-track .excess { background: repeating-linear-gradient(45deg, #f85149 0 4px, #c93c37 4px 8px); border-radius: 0 6px 6px 0; }
.sc-bar-row .sc-track .limit { width: 2px; margin-left: -1px; top: -3px; bottom: -3px; background: var(--text); }
.sc-bar-row .sc-track.volt .low { left: 0; background: repeating-linear-gradient(45deg, #fbd0cd 0 4px, #fde8e6 4px 8px); border-radius: 6px 0 0 6px; }
.sc-bar-row .sc-track.volt .band { background: #c7e9d1; }
.sc-bar-row .sc-track.volt .pin { width: 4px; margin-left: -2px; top: -3px; bottom: -3px; background: #1f2328; border-radius: 2px; }
.sc-bar-row .sc-track.volt .pin.bad { background: #b42318; }
.sc-bars .sc-axis { margin-top: 0; }
.sc-bars-u { margin-top: 2px; }
.sc-chain { display: flex; flex-direction: column; align-items: stretch; gap: 2px; margin-top: 10px; }
.sc-node { flex: none; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; background: #fff; border: 2px solid var(--line); border-radius: 8px; font-size: 12px; line-height: 1.25; cursor: pointer; min-height: 44px; }
.sc-node b { font-weight: 600; overflow-wrap: anywhere; }
.sc-node-k { font-size: 11px; font-weight: 700; }
.sc-node-s { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.sc-node.out { border-style: dashed; border-color: #6e7781; } .sc-node.out .sc-node-k { color: #424a53; }
.sc-node.over { border-color: #f85149; background: #fff5f4; } .sc-node.over .sc-node-k { color: #b42318; }
.sc-node.up { border-color: #3b82d6; background: #f1f7ff; } .sc-node.up .sc-node-k { color: #0b5cad; }
.sc-node.none { border-style: dotted; border-color: #8c959f; } .sc-node.norm { border-color: var(--line); }
.sc-arrow { transform: rotate(90deg); align-self: center; color: var(--muted); font-size: 14px; flex: 0 0 auto; line-height: 1; }
.sc-onmap { margin-top: 8px; min-height: 36px; }
/* the cost breakdown */
.sc-cost { margin: 2px 0 6px; }
.sc-stack { display: flex; height: 18px; gap: 2px; border-radius: 5px; overflow: hidden; }
.sc-stack i, .sc-cost-l .sw { background: #3b82d6; }
.sc-stack i.s1, .sc-cost-l .sw.s1 { background: #8250df; } .sc-stack i.s2, .sc-cost-l .sw.s2 { background: #bf8700; } .sc-stack i.s3, .sc-cost-l .sw.s3 { background: #1a7f37; }
.sc-stack i { min-width: 4px; }
.sc-cost-l { list-style: none; padding: 0 !important; margin: 6px 0 0 !important; display: grid; gap: 4px; }
.sc-cost-l li { margin: 0 !important; display: grid; grid-template-columns: 12px 1fr auto; gap: 0 8px; align-items: baseline; font-size: 13px; }
.sc-cost-l .sw { width: 10px; height: 10px; border-radius: 2px; align-self: center; }
.sc-cost-n { overflow-wrap: anywhere; }
.sc-cost-x { grid-column: 2 / -1; font-size: 11px; color: var(--muted); }
.sc-cost-t { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; font-size: 13px; }
.sc-ulist { margin-top: 6px !important; }
/* the plot over the tested sizes */
.sc-plot { margin: 8px 0 4px; }
.sc-plot svg { width: 100%; height: auto; display: block; font-family: inherit; }
.sc-plot .grid { stroke: #e4e7ec; stroke-width: 1; }
.sc-plot .tick { font-size: 9.5px; fill: #667085; }
.sc-plot .mw { font-size: 11px; fill: #1f2328; }
.sc-plot .mw.cur { font-weight: 700; text-decoration: underline; }
.sc-plot .val { font-size: 10px; fill: #1f2328; font-weight: 600; }
.sc-plot .mk { font-size: 12px; font-weight: 700; }
.sc-plot .sym.clean { fill: #dff3e4; stroke: #1a7f37; stroke-width: 1.5; } .sc-plot .mk.clean { fill: #1a7f37; }
.sc-plot .sym.upgrades { fill: #fff1cc; stroke: #9a6700; stroke-width: 1.5; } .sc-plot .mk.upgrades { fill: #7a4b00; }
.sc-plot .sym.none { fill: #fde8e6; stroke: #b42318; stroke-width: 1.5; } .sc-plot .mk.none { fill: #b42318; }
.sc-plot .sym.na { fill: #fff; stroke: #667085; stroke-width: 1.5; stroke-dasharray: 3 2; } .sc-plot .mk.na { fill: #57606a; }
.sc-plot .curcol { fill: #eaf1ff; }
.sc-plot .hit { fill: transparent; }
.sc-plot g.col[role="button"] { cursor: pointer; outline: none; }
.sc-plot g.col[role="button"]:hover .hit { fill: rgba(31, 111, 235, .08); }
.sc-plot g.col[role="button"]:focus-visible .hit { fill: rgba(31, 111, 235, .12); stroke: var(--accent); stroke-width: 2; }
.sc-plot figcaption span { white-space: nowrap; margin-right: 8px; }
.sc-plot figcaption b.clean { color: #1a7f37; } .sc-plot figcaption b.upgrades { color: #9a6700; } .sc-plot figcaption b.none { color: #b42318; }
#study-card .sc-node:focus-visible, #study-card .sc-frow:focus-visible, #study-card .sc-onmap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) {
  .sc-onmap { min-height: 44px; }
}
}
@media (prefers-reduced-motion: reduce) { .sc-frow, .sc-node { transition: none; } }
/* a visible keyboard focus on every control of the card */
#study-card button:focus-visible, #study-card summary:focus-visible, #study-card a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#sc-size:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
/* the sticky "Request access" bar is not shown over the Study card: its own last section points to the private app */
html[data-site="static"] body:has(#view-study:not([hidden])) #waitlist-bar { display: none; }
/* touch targets of 44 px on a phone */
@media (max-width: 900px), (pointer: coarse) {
  #sc-towns .flows-btn { min-height: 44px; }
  #sc-size { height: 44px; margin: 0; }
  .sc-try, .sc-try-row, .sc-map-toggle, .sc-cta button { min-height: 44px; }
  .sc-compare summary, .sc-more > summary { min-height: 44px; display: flex; align-items: center; }
}
/* the phone layout (class set by scMapPlace): one page scroll; the map is out of the way until "Show map", then sits in the card */
@media (max-width: 900px) {
  html.sc-phone, html.sc-phone body { height: auto; min-height: 100%; }
  html.sc-phone #layout { flex: 0 0 auto; min-height: 0; }
  html.sc-phone #panel { flex: 0 0 auto; overflow: visible; }
  html.sc-phone #layout > #map-wrap { display: none; }
  html.sc-phone .sc-mapbar { display: block; }
  #sc-map-slot #map-wrap { flex: none; height: min(60vh, 460px); margin: 8px 0; border-radius: 6px; overflow: hidden; }
}

/* issue #390: propose projects (private only) */
#proj-progress { width: 100%; height: 8px; margin: 4px 0; }
.proj-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 6px 0; }
.proj-table th, .proj-table td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); }
.proj-table tbody tr { cursor: pointer; }
.proj-table tr.selected, .proj-card.selected { background: #fff8d6; outline: 2px solid #facc15; }
.proj-card { cursor: pointer; }
.proj-card ul { margin: 2px 0 2px 16px; padding: 0; }
.ol-dialog { width: min(96vw, 1500px); max-height: 92vh; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.ol-dialog::backdrop { background: rgba(0,0,0,.45); }
.ol-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 12px; }
.ol-body { overflow: auto; max-height: 80vh; background: #fff; }
.ol-body svg { display: block; max-width: none; }
.eq-table td { vertical-align: top; }
.eq-table td:nth-child(3), .eq-table td:nth-child(4) { max-width: 420px; }
.eq-banner { margin: 8px 0; padding: 8px 10px; border-left: 3px solid #d29922; background: #fff8e1; }

/* the one Run (owner review 2026-10-16, design canvas "Study panel redesign") */
.setup-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
#study-setup .setup-label:first-child { margin-top: 2px; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.setup-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.setup-grid input { font: inherit; font-size: 15px; padding: 7px 9px; min-height: 36px; box-sizing: border-box; width: 100%; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checks li { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 13px; }
.checks li > label { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.checks li > span:first-of-type { flex: 1; }
.checks input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: none; }
#ramp-box { margin: 4px 0 4px 24px; }
.setup-year { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.setup-year label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.setup-year input { width: 96px; font: inherit; padding: 6px 8px; }
/* A2 (#465): a field's own error, next to it, in plain words; Run stays disabled while one shows */
.field-err { color: var(--red); font-size: 12px; line-height: 1.3; }
.field-err.field-note { color: var(--muted); }
.setup-year label { flex-wrap: wrap; }
.setup-year .field-err { flex-basis: 100%; text-align: right; }
#study-setup input[aria-invalid="true"] { border: 1px solid var(--red); outline-color: var(--red); }
/* A3 (#466): the inputs changed after the run; the result shown is the previous request's */
.ss-stale { border: 1px solid #f0c36d; background: #fff8e6; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.4; }
#study-summary.ss-previous { opacity: 0.6; }
.run-big { width: 100%; min-height: 44px; font-size: 15px; font-weight: 600; margin-top: 14px; border-radius: 8px; }
.run-note { text-align: center; margin-top: 6px; }
.sp-steps { list-style: none; margin: 4px 0 0; padding: 0; }
.sp-steps li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.sp-steps li:last-child { border-bottom: 0; }
.sp-dot { width: 20px; height: 20px; border-radius: 50%; flex: none; box-sizing: border-box; border: 2px solid #d0d7de; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.sp-done .sp-dot { background: #1a7f37; border-color: #1a7f37; }
.sp-failed .sp-dot { background: #cf222e; border-color: #cf222e; font-weight: 700; }
.sp-active .sp-dot { border-color: var(--accent); border-right-color: #c9d8f5; animation: sp-spin 0.9s linear infinite; }
.sp-pending { color: var(--muted); }
.sp-body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sp-ms { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-bar { height: 5px; background: #dbe5f7; border-radius: 3px; overflow: hidden; position: relative; }
.sp-bar i { position: absolute; top: 0; bottom: 0; width: 35%; background: var(--accent); border-radius: 3px; animation: sp-slide 1.3s ease-in-out infinite; }
.sp-bar.sp-det i { left: 0; animation: none; transition: width .2s linear; }
.sp-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.sp-replay { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sp-replay[hidden] { display: none; }
.sp-replay input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.sp-replay #rb-label { flex-basis: 100%; }
@keyframes sp-spin { to { transform: rotate(360deg); } }
@keyframes sp-slide { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .sp-active .sp-dot, .sp-bar i { animation: none; } .sp-bar i { left: 0; width: 100%; opacity: .4; } }
/* owner review 2026-10-17, design pass: the answer reads at a glance. A tinted verdict block, three cards, the path to power
   on with its phases in words under the bar, the rows of what the load breaks with their value as a pill, the checks. */
.ss-answer { border-radius: 10px; padding: 12px 14px; border: 1px solid; }
.ss-answer.ss-ok { background: #effaf2; border-color: #b7e4c4; }
.ss-answer.ss-bad { background: #fff3f1; border-color: #f5c2bc; }
.ss-where { font-size: 12px; color: var(--muted); }
.ss-verdict { margin: 4px 0 0; font-size: 21px; line-height: 1.25; display: flex; align-items: center; gap: 9px; }
.ss-ok .ss-verdict { color: #0f5323; } .ss-bad .ss-verdict { color: #a40e26; }
.ss-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; }
.ss-ok .ss-mark { background: #1a7f37; } .ss-bad .ss-mark { background: #cf222e; }
/* A1 (#464): amber while a selected check is unresolved or did not finish; never the green of a full pass */
.ss-answer.ss-warn { background: #fff7e6; border-color: #f0c674; }
.ss-warn .ss-verdict { color: #7a4a00; } .ss-warn .ss-mark { background: #b76e00; }
.ss-statement { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.ss-report-fail { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; background: #f6f7f9; }
.ss-checks .warn { color: #8a5300; }
.ss-coverage { margin-top: 6px; }
/* Task #495: four cards across when the panel is wide, 2 x 2 when narrow (never three and one alone) */
#study-summary { container-type: inline-size; container-name: ssum; }
.ss-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
@container ssum (min-width: 600px) { .ss-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ss-kpi-sub { overflow-wrap: anywhere; }
.ss-kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ss-kpi-label { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ss-kpi b { font-size: 18px; line-height: 1.25; color: var(--text); font-variant-numeric: tabular-nums; }
.ss-kpi-sub { font-size: 11px; color: var(--muted); }
.ss-sched { margin: 16px 0 4px; }
.ss-sched-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.ss-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; }
.ss-bar i { display: block; min-width: 6px; }
.ss-study { background: #8c959f; } .ss-rpg { background: #8250df; } .ss-permit { background: #bf8700; } .ss-build { background: var(--accent); } .ss-on { background: #1a7f37; }
.ss-bar .ss-on { flex: none; width: 12px; }
.ss-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.ss-phases { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.ss-phases li { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ss-phases li:last-child { border-bottom: 0; }
.ss-phases li span { flex: 1; min-width: 0; }
.ss-phases li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ss-phases .ss-phase-on b { color: #0f5323; }
.ss-sw { flex: none; width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.ss-pdf { display: flex; align-items: center; justify-content: center; min-height: 42px; margin: 14px 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
.ss-pdf:hover { filter: brightness(1.08); }
.ss-rows { display: flex; flex-direction: column; gap: 6px; }
.ss-row { font: inherit; color: var(--text); text-align: left; display: flex; flex-direction: column; gap: 3px; background: #fff; border: 1px solid var(--line); border-left: 3px solid #cf222e; border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.ss-row:hover, .ss-row:focus-visible { border-color: var(--accent); border-left-color: #cf222e; background: #f3f7ff; }
.ss-what { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ss-name { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.ss-val { flex: none; font-size: 12px; font-weight: 700; color: #a40e26; background: #ffebe9; border-radius: 10px; padding: 1px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ss-when { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.ss-hint { margin-top: 6px; }
.ss-checks div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ss-checks div:last-child { border-bottom: 0; }
.ss-checks span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ss-checks b { white-space: nowrap; }
.ss-checks b.warn, .ss-checks b.bad { white-space: normal; text-align: right; max-width: 62%; }  /* a long result ("10 maintenance pairs and 4 maintenance-alone findings unresolved") wraps instead of widening the panel */
.ss-checks .ok { color: #1a7f37; } .ss-checks .bad { color: #b42318; } .ss-checks .na { color: var(--muted); font-weight: 500; }
.ss-table-scroll { max-width: 100%; overflow-x: auto; }  /* a wide table scrolls inside the panel at 390 px, never the panel itself */
.ss-fix { width: 100%; border-collapse: collapse; font-size: 13px; }
.ss-fix th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ss-fix td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ss-fix td + td, .ss-fix th + th { padding-left: 10px; white-space: nowrap; }
.ss-fix .ss-total td { font-weight: 700; border-bottom: 0; }
/* the cost scope (A5 #468): an unpriced line reads as such, never as $0; the combined total sits above the customer's spend */
.ss-scope td.muted { color: var(--muted); font-style: italic; }
.ss-scope .ss-total td { border-top: 1px solid var(--text); border-bottom: 1px solid var(--line); }
.ss-scope tr[data-info-html] { cursor: help; }
.ss-scope tr[data-info-html]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ss-sched-note { margin-top: 6px; }
/* a tag that explains itself (tagTip): a real button, so it takes focus; it looks like the tag it was */
button.tag-tip { font: inherit; font-size: 11px; line-height: inherit; border: 0; cursor: help; color: inherit; }
button.tag-tip:not(.new):not(.thermal):not(.voltage):not(.islanded):not(.diverged) { color: var(--text); }
button.tag-tip:hover { filter: brightness(.95); text-decoration: underline dotted; }
button.tag-tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.tag-tip[aria-expanded="true"] { box-shadow: 0 0 0 1.5px var(--accent); }
.info-popover ul { margin: 0 0 6px; padding-left: 18px; }
#study-details { margin: 8px 0; }
#study-details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.step-run { display: none; }
.setup-compact { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.setup-compact[hidden] { display: none; }
/* owner review 2026-10-16: the Study panel as drawn on the design canvas: flat sections, larger type, the POI as a card */
#view-study > h1 { font-size: 22px; margin-bottom: 4px; }
#view-study #step-poi, #view-study #study-setup, #view-study #setup-compact, #view-study #study-summary, #view-study #study-progress { border: 0; padding: 0; margin: 18px 0; }
#view-study #study-summary { border-top: 1px solid var(--line); padding-top: 14px; }
#view-study #study-progress { border-top: 1px solid var(--line); padding-top: 12px; }
#view-study .setup-label { font-size: 12px; margin: 16px 0 8px; }
#view-study .checks li { min-height: 38px; font-size: 14px; }
#view-study .setup-grid input { font-size: 16px; min-height: 42px; }
.poi-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #d0d7de; border-radius: 8px; padding: 10px 12px; }
.poi-card.muted { border-style: dashed; }
.poi-card b { display: block; font-size: 15px; }
.poi-card .poi-from { display: block; margin-top: 4px; }  /* #515: the address line under the bus details */
.link-btn { font: inherit; font-size: 14px; color: var(--accent); background: none; border: 0; padding: 8px; cursor: pointer; min-height: 40px; }
#poi-search-row[hidden] { display: none; }
#btn-poi-pin { flex-basis: 100%; text-align: left; padding: 2px 0; min-height: 0; }  /* #517: under the box, folds away with it */
.study-replay { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4; width: 520px; max-width: calc(100% - 40px); box-sizing: border-box;
  background: rgba(13, 17, 23, .95); border: 1px solid #30363d; border-radius: 10px; padding: 10px 14px 30px; color: #e6edf3; font-size: 13px; line-height: 1.45;
  display: flex; flex-direction: column; gap: 2px; pointer-events: auto; }
.study-replay[hidden] { display: none; }
.study-replay .rp-head { display: flex; justify-content: space-between; gap: 16px; }
.study-replay .rp-head span { color: #9da7b3; font-variant-numeric: tabular-nums; }
.study-replay .rp-ok { color: #56d364; }
.study-replay .rp-bad { color: #ff9b94; }
/* owner review 2026-10-17: Prev, Play or Pause, Next and Skip on top of the caption (one node each, kept across frames; on top so they do not move as the text below grows or shrinks) */
.study-replay { padding-bottom: 10px; }
.study-replay .rp-ctl { display: flex; justify-content: flex-end; gap: 6px; margin: 0 0 7px; padding-bottom: 7px; border-bottom: 1px solid #30363d; }
.study-replay .rp-ctl button { background: transparent; color: #c9d1d9; border: 1px solid #30363d; min-height: 28px; padding: 2px 10px; border-radius: 6px; cursor: pointer; }
.study-replay .rp-ctl button:hover:not(:disabled), .study-replay .rp-ctl button:focus-visible { border-color: #8b949e; color: #fff; }
.study-replay .rp-ctl button:disabled { opacity: .4; cursor: default; }
.study-replay .rp-ctl button[hidden] { display: none; }
.study-replay .rp-ctl #rp-skip { color: #9da7b3; margin-left: 6px; }
.study-replay.paused { border-color: #8b949e; }
.study-replay .rp-text { display: flex; flex-direction: column; gap: 2px; }
/* owner review 2026-10-17: a grid element named in the Study panel highlights on the map on hover or focus; a click zooms to it */
#view-study .map-ref { cursor: pointer; }
#view-study span.map-ref { border-bottom: 1px dotted currentColor; }
#view-study span.map-ref:hover, #view-study span.map-ref:focus-visible { background: #f3f7ff; border-bottom-style: solid; outline: none; }
#view-study tr.map-ref:hover > td, #view-study tr.map-ref:focus-visible > td { background: #f3f7ff; }
#view-study tr.map-ref:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.info-popover ol { margin: 0 0 6px; padding-left: 18px; }
.info-popover li { margin-bottom: 4px; }
/* owner review 2026-10-17: the Study map's halo under an element whose loss fails N-1 (the line itself stays in service) */
.map-legend .sw.halo { position: relative; width: 18px; height: 9px; border-radius: 5px; opacity: .75; }
.map-legend .sw.halo::after { content: ''; position: absolute; left: 1px; right: 1px; top: 3.5px; height: 2px; background: #a3a3a3; }
/* owner review 2026-10-17: a transformer named in the Study panel opens its station's diagram over the map, the unit in the
   hover pair's colours, and a ring around the station */
.stn-diagram.stn-focus { z-index: 12; }
.stn-focus .stn-close { position: absolute; top: 3px; right: 4px; pointer-events: auto; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #9da7b3; font: 600 16px/22px -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; cursor: pointer; }
.stn-focus .stn-close:hover, .stn-focus .stn-close:focus-visible { color: #fff; background: rgba(255, 255, 255, .12); }
.stn-ring { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #39d0ff; box-shadow: 0 0 0 3px rgba(57, 208, 255, .25); pointer-events: none; z-index: 11; }
@media (prefers-reduced-motion: no-preference) { .stn-ring { animation: stn-ring-pulse 1.4s ease-in-out infinite; } }
@keyframes stn-ring-pulse { 50% { box-shadow: 0 0 0 7px rgba(57, 208, 255, .08); } }
/* A12 (#475): read by a screen reader, not drawn */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* A9 (#472): the Before / After switch, and each finding with its values before, with the load and after the upgrades */
.ss-view { display: inline-flex; margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ss-view-btn { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; min-height: 36px; border: 0; background: #fff; color: var(--text); cursor: pointer; }
.ss-view-btn + .ss-view-btn { border-left: 1px solid var(--line); }
.ss-view-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.ss-view-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ss-view-note { margin-bottom: 4px; }
.ss-val { white-space: normal; text-align: right; max-width: 60%; }
.ss-val-ok { color: #0f5323; background: #dafbe1; }
.ss-row.ss-st-resolved, .ss-row.ss-st-pass { border-left-color: #1a7f37; }
.ss-row.ss-st-resolved:hover, .ss-row.ss-st-resolved:focus-visible, .ss-row.ss-st-pass:hover { border-left-color: #1a7f37; }
.ss-ba { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.ss-ba span { overflow-wrap: anywhere; }
.ss-status { align-self: flex-start; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 8px; }
.ss-status-unresolved { color: #a40e26; background: #ffebe9; }
.ss-status-resolved, .ss-status-pass { color: #0f5323; background: #dafbe1; }
.ss-grp .ss-val { color: var(--text); background: #eaeef2; }
.ss-group { display: flex; flex-direction: column; gap: 4px; }
.ss-sub { display: flex; flex-direction: column; gap: 4px; margin-left: 14px; padding-left: 8px; border-left: 2px solid var(--line); }
.ss-subrow { padding: 6px 10px; }
.ss-subrow .ss-name { font-size: 12.5px; font-weight: 600; }
.ss-subrow .ss-status { display: none; }
/* A13 (#476): the row whose scene is on the map; a pinned one keeps an outline */
.ss-row.fx-on, #view-study tr.map-ref.fx-on > td { background: #eef4ff; }
.ss-row[aria-pressed="true"], #view-study tr.map-ref[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.ss-more-btn { margin-top: 4px; align-self: flex-start; }
/* the map caption's state, its compact key, the bus rings */
.study-replay .rp-state { margin-right: auto; align-self: center; font-size: 12px; color: #9da7b3; flex: 1 1 160px; }
.study-replay .rp-ctl { flex-wrap: wrap; }
.study-replay .rp-ctl button { white-space: nowrap; }
.study-replay { width: 580px; }
.study-replay.paused .rp-state { color: #e3b341; }
.study-replay #rp-follow, .study-replay #rp-release { color: #e6edf3; border-color: #58a6ff; }
.fx-key { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 7px; padding-top: 6px; border-top: 1px solid #30363d; font-size: 11.5px; color: #c9d1d9; }
.fx-key span, .stn-focus-key span { display: inline-flex; align-items: center; gap: 5px; }
.fx-key i, .stn-focus-key i { display: inline-block; width: 18px; height: 6px; border-radius: 3px; }
.fxk-out { background: repeating-linear-gradient(90deg, #fff 0 5px, transparent 5px 8px); height: 3px !important; }
.fxk-m1 { background: repeating-linear-gradient(90deg, #8b949e 0 5px, transparent 5px 8px); height: 3px !important; }
.fxk-over { background: #f85149; box-shadow: 0 0 4px #f85149; }
.fxk-bus { width: 11px !important; height: 11px !important; border-radius: 50% !important; border: 2px solid #ffd33d; background: transparent; }
.fxk-up { background: #58a6ff; }
.fxk-ok { background: #3fb950; }
.fxk-plant { width: 10px !important; height: 10px !important; border-radius: 2px !important; background: #8b949e; }
.fxk-in { background: #e6edf3; height: 2px !important; }
.fx-bus { position: relative; width: 34px; height: 34px; pointer-events: none; z-index: 10; }
.fx-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid #ffd33d; box-shadow: 0 0 0 3px rgba(255, 211, 61, .25); }
.fx-bus.ok .fx-ring { border-color: #3fb950; box-shadow: 0 0 0 3px rgba(63, 185, 80, .25); }
/* the pulse is a second ring growing and fading (transform and opacity only: the compositor animates it, no map repaint) */
.fx-ring::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid #ffd33d; opacity: 0; }
.fx-bus.ok .fx-ring::after { border-color: #3fb950; }
@media (prefers-reduced-motion: no-preference) { .fx-ring::after { animation: fx-ring-pulse 1.3s ease-out infinite; } }
@keyframes fx-ring-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
.fx-bus-label { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: rgba(13, 17, 23, .92); color: #fff;
  border: 1px solid #ffd33d; border-radius: 6px; padding: 2px 7px; font: 700 12px/1.35 -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; }
.fx-bus.ok .fx-bus-label { border-color: #3fb950; }
.stn-focus-key { display: flex; gap: 10px; padding: 6px 30px 5px 9px; margin-bottom: -3px; font: 600 11px/1.3 -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; color: #c9d1d9;
  background: rgba(13, 17, 23, .94); border: 1.5px solid #30363d; border-bottom: 0; border-radius: 8px 8px 0 0; }
.stn-focus-key .fxk-out { background: repeating-linear-gradient(90deg, #fff 0 4px, transparent 4px 7px); }
.sp-reconnect { color: #9a6700; font-weight: 600; }
/* A12 (#475): the bus search is a combobox; its options take the active highlight from the keyboard too */
.dropdown [role="option"][aria-selected="true"] { background: #dbe9ff; outline: 1px solid var(--accent); }
@media (max-width: 480px) { .ss-val { max-width: 55%; } .ss-view-btn { padding: 7px 10px; } .study-replay .rp-ctl { flex-wrap: wrap; } }
.fx-dimmed .stn-diagram:not(.stn-focus) { opacity: .3; transition: opacity .3s; }
.ss-val-na { color: var(--muted); background: #eaeef2; font-weight: 600; }

/* Alternatives (A14 #477): one card per option; an estimate card is shaded and tagged; "Study this size" starts a new case */
.ss-alt { display: grid; gap: 8px; margin: 6px 0; }
.ss-alt-card { border: 1px solid var(--line, #2c333b); border-radius: 8px; padding: 9px 11px; font-size: 13px; }
.ss-alt-est { background: rgba(250, 204, 21, 0.09); border-color: rgba(250, 204, 21, 0.45); }
.ss-alt-head { margin-bottom: 3px; }
.ss-alt-how, .ss-alt-result { margin: 2px 0; }
.ss-alt-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 2px; }
.ss-alt-figs div { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.ss-alt-k { font-size: 11px; opacity: 0.7; }
.ss-study-size { margin-top: 8px; white-space: nowrap; }
.ss-alt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ss-alt-actions button { margin-top: 8px; }
.ss-alt-back { margin: 4px 0 8px; }  /* #517: a smaller-size study offers the full request back */
.ss-alt-val { margin: 6px 0; padding: 6px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); }
.ss-alt-checks { margin: 4px 0; padding-left: 16px; }
.ss-val-fits { border-left: 3px solid #3fb950; }
.ss-val-does_not_fit, .ss-alt-val.error { border-left: 3px solid #f85149; }
.ss-val-incomplete { border-left: 3px solid #d29922; }
.ss-st-worsened { border-left: 3px solid #d29922; }
.ss-status-worsened { color: #d29922; }
.ss-more { margin-top: 6px; font-size: 12px; } .ss-more summary { cursor: pointer; color: var(--muted); }
.ss-bg { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* UX review 3 (2026-11-02): the map says which state its numbers are in; what a selected problem marks has a text equivalent */
.pop-state { display: inline-block; margin: 1px 0; padding: 0 5px; border-radius: 3px; background: #eef1f5; color: #57606a; font-size: 11px; font-weight: 600; }
.pop-sel { color: #9a1a12; font-weight: 600; }
.sc-map-state { position: absolute; top: 52px; right: 10px; z-index: 3; max-width: min(210px, 45%); box-sizing: border-box; padding: 5px 8px; border-radius: 6px;
  background: rgba(13, 17, 23, .94); border: 1px solid #30363d; color: #c9d1d9; font-size: 11px; line-height: 1.3; pointer-events: none; }
.sc-map-state[hidden] { display: none; }
.sc-map-state b { display: block; color: #fff; font-size: 12px; }
body.fx-dimmed .sc-map-state { display: none; }  /* a marked problem's caption says the same, over the map */
.sc-maptext { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f6f8fa; }
.sc-maptext h5 { margin: 0 0 4px; font-size: 12px; }
.sc-maptext ul { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.4; }
.sc-maptext .sc-small { margin: 4px 0 0; }
/* the phone's map is short: the caption keeps the heading, the state and the key; the lines it dropped are in the text under the problem */
html.sc-phone #study-replay { left: 50px; right: 92px; top: 8px; width: auto; max-width: none; transform: none; padding: 6px 10px 6px; max-height: 60%; overflow: auto; }  /* clear of the zoom buttons (left) and Satellite (right) */
html.sc-phone #study-replay .rp-text > div:not(.rp-head) { display: none; }  /* the lines it drops are in the text under the problem; the key and the map state are under "Key" */
html.sc-phone #study-replay .rp-ctl { margin-bottom: 4px; padding-bottom: 4px; }
html.sc-phone #study-replay #rp-state { display: none; }
html.sc-phone #study-replay .rp-head { flex-wrap: wrap; gap: 0 8px; }
.fx-key-d { margin-top: 4px; font-size: 11.5px; }
.fx-key-d summary { cursor: pointer; min-height: 28px; display: flex; align-items: center; font-weight: 600; color: #c9d1d9; }
.fx-key-d .fx-key { margin-top: 2px; padding-top: 4px; gap: 2px 10px; font-size: 10.5px; }
.fx-key-d .small { color: #9da7b3; margin-top: 3px; }
html.sc-phone #sc-map-slot #map-wrap { height: min(68vh, 540px); }

/* Study (private): the public result visuals on the private data. The bars, axes, chain nodes and cost stack are the public
   panel's own classes (sc-*); only the placement in the private panel is here. */
/* tiles: the public tile look (small label, large value, short sub-line, a missing value in muted type) */
.ss-kpi { border-radius: 8px; padding: 8px 10px; gap: 2px; }
.ss-kpi-label { font-size: 11px; line-height: 1.25; }
.ss-kpi b { font-size: 20px; line-height: 1.2; overflow-wrap: anywhere; }
.ss-kpi.na b, .ss-kpi.none b { font-size: 15px; color: #57606a; font-weight: 600; }
.ss-kpi.value { border-top: 3px solid #3b82d6; }
.ss-kpi.none { border-top: 3px solid #8c959f; } .ss-kpi.na { border-top: 3px dotted #8c959f; }
/* timeline */
.ss-gl { margin-top: 2px !important; }
.ss-gr .sc-gr-h { align-items: baseline; }
.ss-gr .sc-gr-n { font-weight: 600; }
.ss-gr-side { margin-top: 2px; }
.ss-gr.ph-study .solid { background: #8c959f; } .ss-gr.ph-study .light { background: repeating-linear-gradient(45deg, #c4cad1 0 4px, #dfe3e8 4px 8px); }
.ss-gr.ph-rpg .solid { background: #8250df; } .ss-gr.ph-rpg .light { background: repeating-linear-gradient(45deg, #c9b3f2 0 4px, #e6dcf9 4px 8px); }
.ss-gr.ph-permit .solid { background: #bf8700; } .ss-gr.ph-permit .light { background: repeating-linear-gradient(45deg, #e8c870 0 4px, #f5e4b5 4px 8px); }
.ss-gr.ph-build .solid { background: var(--accent); } .ss-gr.ph-build .light { background: repeating-linear-gradient(45deg, #9ec1f7 0 4px, #cfe0fb 4px 8px); }
.sc-gr.done.ss-phase-on b { color: #0f5323; }
.sc-track .ss-flag { width: 3px; margin-left: -3px; background: #0f5323; }
/* findings: the comparison and the trace under each row */
.ss-fitem { display: flex; flex-direction: column; }
.ss-fitem > .ss-row { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ss-viz { border: 1px solid var(--line); border-top: 0; border-left: 3px solid #cf222e; border-radius: 0 0 8px 8px; padding: 6px 11px 8px; background: #fbfcfd; }
.ss-fitem.ss-st-resolved > .ss-viz, .ss-fitem.ss-st-pass > .ss-viz { border-left-color: #1a7f37; }
.ss-viz-h { margin-bottom: 2px; }
.ss-viz .sc-bars { margin-top: 4px; }
.ss-viz summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.ss-fsub > .ss-viz { padding: 4px 10px 6px; }
.sc-tag.ss-new { border-color: #f5c2bc; background: #fff3f1; color: #a40e26; }
.sc-bar-row .sc-track.volt .high { background: repeating-linear-gradient(45deg, #fbd0cd 0 4px, #fde8e6 4px 8px); border-radius: 0 6px 6px 0; }
.sc-axis .lim.hi { transform: translateX(-100%); }
.ss-viz .sc-node.map-ref { font: inherit; font-size: 12px; color: var(--text); text-align: left; }
.ss-viz .sc-node.fx-on, .ss-viz .sc-node[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
@container ssum (min-width: 520px) {
  .ss-viz .sc-chain { flex-direction: row; align-items: stretch; flex-wrap: nowrap; gap: 4px; }
  .ss-viz .sc-node { flex: 1 1 0; }
  .ss-viz .sc-arrow { transform: none; align-self: center; }
}
.ss-viz .sc-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* cost bar above the fix table */
.ss-cost { margin: 2px 0 8px; }

/* ---- IOU chapter (real public data; the og- prefix keeps it apart from the grid chapters) ---- */
.og-credit { position: absolute; left: 10px; bottom: 30px; z-index: 2; max-width: calc(100% - 20px); font-size: 10px; line-height: 1.3; color: #c9d1d9;
  background: rgba(13, 17, 23, .8); padding: 2px 6px; border-radius: 4px; pointer-events: none; }
.og-map-note { font-size: 11.5px; line-height: 1.35; color: #fff; margin-bottom: 3px; }
.og-notice { border: 1.5px solid #a2312c; border-radius: 6px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.og-notice strong { color: #a2312c; }
.og-err { color: #a2312c; }
.og-toggles { display: grid; gap: 4px; font-size: 13px; }
.og-toggles label { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; }
.og-toggles input { margin: 2px 0 0; flex: none; }
.og-toggles .og-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 4px 0 0 0; flex: none; border: 1px solid rgba(0,0,0,.35); }
.og-toggles .og-loading { color: var(--muted); font-size: 12px; }
.og-ramp { display: flex; gap: 2px; margin: 0 0 2px 22px; }
.og-ramp span { flex: 1; font-size: 11px; color: var(--muted); }
.og-ramp i { display: block; height: 8px; margin-bottom: 2px; border-radius: 2px; }
.og-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; }
/* Stays at the top of the panel while reading a candidate. The scroll padding keeps a focused link clear of it, and covers the bar at its tallest: 62px when a name wraps at phone width. */
body.app-sites #panel { scroll-padding-top: 70px; }
.og-current { position: sticky; top: -12px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px -16px 0; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.og-current[hidden] { display: none; }
.og-current h2 { margin: 0; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.og-back { flex: none; font-size: 12.5px; padding: 3px 9px; }
.og-layers summary { cursor: pointer; }
.og-layers summary h2 { display: inline; margin: 0; }
.og-layers[open] summary { margin-bottom: 6px; }
.og-row { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 1px 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.og-row:last-child { border-bottom: 0; }
.og-row:hover { background: var(--bg); }
.og-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.og-row[aria-pressed="true"] { background: var(--accent); color: #fff; }
.og-row .og-rk { font-weight: 700; font-size: 18px; grid-row: span 2; }
.og-row .og-nm { font-weight: 600; overflow-wrap: anywhere; }
.og-row .og-sub { color: var(--muted); font-size: 12px; }
.og-row[aria-pressed="true"] .og-sub { color: inherit; opacity: .9; }
.og-sheet { display: grid; gap: 14px; margin-top: 8px; min-width: 0; }
.og-sheet > * { min-width: 0; }
.og-sheet h3 { font-size: 14px; margin: 0; }
.og-sheet p { margin: 0; }
.og-sheet ul, .og-sheet ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.og-sheet table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.og-sheet th, .og-sheet td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.og-sheet th { font-weight: 600; color: var(--muted); }
.og-tablewrap { overflow-x: auto; }
.og-tiers { display: flex; flex-wrap: wrap; gap: 5px; }
.og-tier { font-size: 12px; border: 1px solid var(--line); padding: 0 7px; color: var(--muted); border-radius: 3px; }
.og-tier.on { border-color: var(--accent); color: var(--accent); }
.og-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.og-fact b { display: block; font-size: 20px; line-height: 1.15; }
.og-fact span { color: var(--muted); font-size: 12px; }
.og-tag { display: inline-block; font: 500 10.5px/1.5 ui-monospace, Menlo, monospace; padding: 0 5px; border: 1px solid currentColor; white-space: nowrap; }
.og-t-model { color: #0b6e8a; } .og-t-rating { color: #4a5fa5; } .og-t-record { color: #3f6f4e; } .og-t-proxy { color: #8a5a12; } .og-t-derived { color: var(--muted); }
.og-bars { display: grid; gap: 6px; }
.og-bar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 30px; gap: 6px; align-items: center; font-size: 12.5px; }
.og-track { height: 7px; background: var(--line); }
.og-track i { display: block; height: 100%; background: var(--accent); }
.og-sheet .og-fine { color: var(--muted); font-size: 12px; }
