/* Power Hopper Grid Atlas v2. All colors are tokens declared in the two theme blocks below; nothing else sets a color literal.
   Brand green (#1D8A4A) marks controls, selection and identity. The map's cartographic palette lives in grid-theme.js. */
:root, [data-ui-theme="dark"] {
  --ga-brand: #1D8A4A; --ga-brand-ink: #FFFFFF; --ga-accent: #F5C451; --ga-warn: #FF5C7A;
  --ga-bg: #0B1220; --ga-panel: #0F1829; --ga-raised: #15213A; --ga-raised-2: #1B2A47; --ga-ink: #E6EDF7; --ga-muted: #93A3BC; --ga-line: #24324D; --ga-focus: #F5C451;
  --ga-top-bg: #070C16; --ga-top-ink: #E6EDF7; --ga-shadow: rgba(0, 0, 0, 0.45); --ga-glass: rgba(11, 18, 32, 0.86); --ga-chip: #13203A;
  --lvl-chronic: #FF2D55; --lvl-severe: #FF7A1A; --lvl-frequent: #FFB627; --lvl-occasional: #E8C66A;
  --v765: #F8F9FA; --v500: #FF9F43; --v345: #22D3EE; --v230: #60A5FA; --v138: #A78BFA; --v69: #34D399; --vlow: #7C8BA1;
  --ga-article-bg: #F7F8FA; --ga-article-ink: #1B2230; --ga-article-muted: #5B6578; --ga-article-line: #DDE2EA; --ga-article-raised: #FFFFFF; --ga-link: #1D8A4A;
}
[data-ui-theme="light"] {
  --ga-bg: #F4F6F9; --ga-panel: #FFFFFF; --ga-raised: #FFFFFF; --ga-raised-2: #EEF1F5; --ga-ink: #1B2230; --ga-muted: #5B6578; --ga-line: #DDE2EA; --ga-focus: #B7791F;
  --ga-top-bg: #FFFFFF; --ga-top-ink: #1B2230; --ga-shadow: rgba(27, 34, 48, 0.16); --ga-glass: rgba(255, 255, 255, 0.92); --ga-chip: #F4F6F9;
}
* { box-sizing: border-box; }
.ga-body [hidden] { display: none !important; }
html, body { margin: 0; }
.ga-body { background: var(--ga-bg); color: var(--ga-ink); font: 14.5px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --ga-top-h: 60px; }
.ga-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ga-skip { position: absolute; left: -999px; top: 0; background: var(--ga-brand); color: var(--ga-brand-ink); padding: 8px 12px; z-index: 50; }
.ga-skip:focus { left: 8px; top: 8px; }
a { color: var(--ga-accent); }
[data-ui-theme="light"] a { color: var(--ga-link); }
:focus-visible { outline: 3px solid var(--ga-focus); outline-offset: 2px; }

/* Top bar (inside the shared site-header markup) */
.ga-body .site-header { position: sticky; top: 0; z-index: 30; background: var(--ga-top-bg); color: var(--ga-top-ink); border-bottom: 1px solid var(--ga-line); }
.ga-top { display: flex; align-items: center; gap: 14px; height: var(--ga-top-h); padding: 0 16px; }
.ga-body .brand-mark { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 800; white-space: nowrap; }
.ga-body .brand-mark-img { width: 34px; height: 34px; object-fit: contain; }
.ga-title { margin: 0; font-size: 0.98rem; font-weight: 600; white-space: nowrap; color: var(--ga-muted); }
.ga-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--ga-brand); color: var(--ga-brand-ink); font-size: 0.68rem; font-weight: 700; vertical-align: 2px; letter-spacing: 0.02em; }
.ga-search { position: relative; flex: 1 1 320px; max-width: 460px; }
.ga-search input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--ga-line); border-radius: 8px; background: var(--ga-raised); color: var(--ga-ink); font: inherit; }
.ga-search input::placeholder { color: var(--ga-muted); }
.ga-results { position: absolute; top: 42px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: var(--ga-raised); color: var(--ga-ink); border: 1px solid var(--ga-line); border-radius: 8px; box-shadow: 0 12px 32px var(--ga-shadow); max-height: 60vh; overflow: auto; z-index: 40; }
.ga-results li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.ga-results li small { color: var(--ga-muted); white-space: nowrap; }
.ga-results li:hover, .ga-results li[aria-selected="true"] { background: var(--ga-raised-2); }
.ga-results .ga-empty { cursor: default; color: var(--ga-muted); }
.ga-fresh { display: flex; flex-direction: column; font-size: 0.72rem; line-height: 1.3; color: var(--ga-muted); min-width: 0; }
.ga-fresh span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.ga-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.ga-btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--ga-line); border-radius: 8px; background: var(--ga-raised); color: var(--ga-ink); font: inherit; font-size: 0.86rem; cursor: pointer; list-style: none; }
.ga-btn:hover { border-color: var(--ga-brand); }
.ga-dl { position: relative; }
.ga-dl summary::-webkit-details-marker { display: none; }
.ga-dl ul { position: absolute; right: 0; top: 42px; z-index: 40; width: min(360px, 90vw); margin: 0; padding: 8px; list-style: none; background: var(--ga-raised); border: 1px solid var(--ga-line); border-radius: 8px; box-shadow: 0 12px 32px var(--ga-shadow); }
.ga-dl li a { display: block; padding: 7px 8px; border-radius: 6px; color: var(--ga-ink); text-decoration: none; font-size: 0.86rem; }
.ga-dl li a:hover { background: var(--ga-raised-2); }
.ga-layers-toggle { display: none; }

/* App grid */
.ga-app { display: grid; grid-template-columns: 300px minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; height: calc(100dvh - var(--ga-top-h) - 1px); min-height: 540px; }
.ga-panel { grid-row: 1 / 3; overflow-y: auto; padding: 12px 14px 28px; background: var(--ga-panel); border-right: 1px solid var(--ga-line); scrollbar-width: thin; }
.ga-group { margin: 0 0 14px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--ga-line); }
.ga-group legend { padding: 0; margin-bottom: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ga-muted); }
.ga-layer { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 0.88rem; cursor: pointer; }
.ga-layer input { margin-top: 3px; accent-color: var(--ga-brand); width: 16px; height: 16px; flex: none; }
.ga-layer small { display: block; color: var(--ga-muted); font-size: 0.75rem; }
.ga-layer.is-planned { color: var(--ga-muted); cursor: default; }
.ga-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; background: var(--ga-chip); border: 1px solid var(--ga-line); border-radius: 9px; }
.ga-seg label { position: relative; cursor: pointer; }
.ga-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.ga-seg span { display: block; text-align: center; padding: 6px 4px; border-radius: 7px; font-size: 0.8rem; color: var(--ga-muted); }
.ga-seg input:checked + span { background: var(--ga-brand); color: var(--ga-brand-ink); font-weight: 600; }
.ga-seg input:focus-visible + span { outline: 3px solid var(--ga-focus); }
.ga-filter { display: block; margin: 8px 0 10px; }
.ga-filter-label { display: block; font-size: 0.78rem; color: var(--ga-muted); margin-bottom: 4px; }
.ga-filter select, .ga-range input { width: 100%; min-height: 36px; border: 1px solid var(--ga-line); border-radius: 8px; background: var(--ga-raised); color: var(--ga-ink); font: inherit; font-size: 0.86rem; padding: 0 8px; }
.ga-filter input[type="range"] { width: 100%; accent-color: var(--ga-brand); }
.ga-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; color: var(--ga-muted); }
.ga-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ga-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--ga-line); border-radius: 999px; background: var(--ga-chip); font-size: 0.76rem; cursor: pointer; }
.ga-chip input { accent-color: var(--ga-brand); margin: 0; }
.ga-note { font-size: 0.78rem; color: var(--ga-muted); }
.ga-project-list { margin: 4px 0 0; padding: 0; list-style: none; max-height: 260px; overflow: auto; }
.ga-project-list[hidden] { display: none; }
.ga-project-list li { padding: 4px 0; border-bottom: 1px dashed var(--ga-line); }
.ga-project-list small { display: block; color: var(--ga-muted); font-size: 0.72rem; }
.ga-linkbtn { background: none; border: 0; padding: 2px 0; color: var(--ga-accent); font: inherit; font-size: 0.85rem; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
[data-ui-theme="light"] .ga-linkbtn { color: var(--ga-link); }

/* Swatches (chips + legend). Chip colors follow the dark theme's voltage hues. */
.ga-swatch { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--ga-muted); }
.ga-swatch.is-dashed { background: transparent; height: 0; }
.v-765 { background: var(--v765); height: 5px; } .v-500 { background: var(--v500); height: 4px; } .v-345 { background: var(--v345); height: 4px; } .v-230 { background: var(--v230); height: 3px; }
.v-138 { background: var(--v138); height: 2px; } .v-69 { background: var(--v69); height: 2px; } .v-sub69 { background: var(--vlow); height: 1px; } .v-unknown { background: repeating-linear-gradient(90deg, var(--vlow) 0 4px, transparent 4px 7px); height: 2px; }
.ga-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--ga-bg); }
.ga-dot.is-hollow { background: transparent; border: 2px solid var(--ga-ink); }
.ga-shape { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--ga-bg); }
.ga-shape-circle, .ga-shape-hexagon { border-radius: 50%; }
.ga-shape-diamond { transform: rotate(45deg) scale(0.85); }
.ga-shape-triangle { clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; }

/* Map */
.ga-map-wrap { position: relative; grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; }
.ga-map-wrap .ga-map { position: absolute; inset: 0; background: var(--ga-bg); }
.ga-map-msg { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 14px; background: var(--ga-raised); color: var(--ga-ink); border: 1px solid var(--ga-line); border-radius: 8px; box-shadow: 0 6px 18px var(--ga-shadow); font-size: 0.86rem; z-index: 2; max-width: calc(100% - 32px); }
.ga-map-msg[hidden], .ga-map-msg:empty { display: none; }
.ga-legend { position: absolute; left: 12px; bottom: 34px; z-index: 2; display: grid; gap: 4px; max-width: min(640px, calc(100% - 24px)); padding: 8px 10px; background: var(--ga-glass); color: var(--ga-ink); border: 1px solid var(--ga-line); border-radius: 10px; font-size: 0.72rem; backdrop-filter: blur(6px); box-shadow: 0 6px 18px var(--ga-shadow); }
.ga-legend-row { display: flex; flex-wrap: wrap; gap: 3px 12px; align-items: center; }
.ga-legend-row strong { margin-right: 4px; }
.ga-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ga-pricebar { position: absolute; top: 12px; left: 12px; z-index: 3; max-width: min(560px, calc(100% - 80px)); padding: 10px 12px; background: var(--ga-glass); color: var(--ga-ink); border: 1px solid var(--ga-line); border-left: 4px solid var(--ga-accent); border-radius: 10px; box-shadow: 0 8px 24px var(--ga-shadow); backdrop-filter: blur(6px); font-size: 0.8rem; }
.ga-pricebar[hidden] { display: none; }
.ga-pricebar p { margin: 0; }
.ga-price-meta { margin-top: 6px !important; color: var(--ga-muted); font-size: 0.74rem; max-height: 9em; overflow: auto; }
.ga-age { color: var(--ga-accent); font-weight: 600; }

/* Drawer */
.ga-drawer { grid-column: 3; grid-row: 1 / 3; width: 380px; overflow-y: auto; padding: 14px 16px 28px; background: var(--ga-panel); border-left: 1px solid var(--ga-line); }
.ga-drawer[hidden] { display: none; }
.ga-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ga-kicker { margin: 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ga-accent); font-weight: 700; }
.ga-drawer h2 { margin: 2px 0 10px; font-size: 1.12rem; }
.ga-drawer h3 { font-size: 0.86rem; margin: 18px 0 6px; padding-top: 10px; border-top: 1px solid var(--ga-line); }
.ga-dl-rows { display: grid; grid-template-columns: 40% 60%; gap: 6px 10px; margin: 0; font-size: 0.84rem; }
.ga-dl-rows dt { color: var(--ga-muted); }
.ga-dl-rows dd { margin: 0; overflow-wrap: anywhere; }
.ga-dl-rows dd.is-na { color: var(--ga-muted); font-style: italic; }
.ga-src { font-size: 0.78rem; }
.ga-evidence { padding-left: 18px; font-size: 0.8rem; }
.ga-evidence q { display: block; color: var(--ga-muted); margin: 2px 0 8px; }
.ga-where { display: block; color: var(--ga-muted); font-size: 0.74rem; }
.ga-proj-card { display: grid; gap: 2px; padding: 8px 10px; margin: 6px 0; background: var(--ga-raised); border: 1px solid var(--ga-line); border-left: 3px solid var(--ga-accent); border-radius: 8px; font-size: 0.8rem; }
.ga-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--ga-line); font-size: 0.8rem; }
.ga-timeline li { position: relative; padding: 2px 0 8px 10px; color: var(--ga-muted); }
.ga-timeline li::before { content: ""; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ga-bg); border: 2px solid var(--ga-line); }
.ga-timeline li.is-on { color: var(--ga-ink); }
.ga-timeline li.is-on::before { background: var(--ga-accent); border-color: var(--ga-accent); }
.ga-timeline strong { display: block; font-weight: 600; }

/* Charts */
.ga-charts { grid-column: 2; grid-row: 2; position: relative; border-top: 1px solid var(--ga-line); background: var(--ga-panel); }
.ga-charts-toggle { position: absolute; right: 10px; top: 6px; min-height: 30px; z-index: 1; }
.ga-charts-body { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 10px 14px 12px; max-height: 236px; overflow-y: auto; }
.ga-charts-closed .ga-charts-body { display: none; }
.ga-charts-closed .ga-charts { min-height: 44px; }
.ga-chart { margin: 0; min-width: 0; }
.ga-chart figcaption { font-size: 0.76rem; font-weight: 700; margin: 0 0 6px; }
.ga-chart:last-child figcaption { margin-right: 80px; }
.ga-chart-meta { font-size: 0.7rem; color: var(--ga-muted); margin: 6px 0 0; }
/* v8l: one-series line chart in panels (EPA hourly output); brand green line, recessive grid, text in text tokens */
.ga-lc { position: relative; margin: 8px 0 0; }
.ga-lc svg { width: 100%; height: auto; display: block; font-size: 9px; fill: var(--ga-muted); touch-action: pan-y; }
.ga-lc-line { fill: none; stroke: var(--ga-brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ga-lc-grid { stroke: var(--ga-line); stroke-width: 1; }
.ga-lc-x { stroke: var(--ga-muted); stroke-width: 1; stroke-dasharray: 2 2; }
.ga-lc-tip { position: absolute; right: 0; top: 0; font-size: 0.7rem; color: var(--ga-ink); background: var(--ga-raised-2); border: 1px solid var(--ga-line); border-radius: 4px; padding: 1px 6px; }
.ga-bars { display: grid; gap: 4px; font-size: 0.74rem; }
.ga-bars > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.ga-bars > div:has(> span:nth-child(3)) { grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr) minmax(0, 1fr); }
.ga-bars-head { color: var(--ga-muted); font-size: 0.68rem; }
.ga-bars [role="cell"] { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.ga-bar { display: inline-block; height: 9px; border-radius: 3px; background: var(--ga-brand); min-width: 2px; }
.ga-bar.is-rt { background: var(--ga-accent); }
.ga-bar-v { white-space: nowrap; }
.ga-bar-v.is-na { color: var(--ga-muted); font-style: italic; }
.ga-bars [role="rowheader"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Written guide: always a light, readable document */
.ga-about { background: var(--ga-article-bg); color: var(--ga-article-ink); padding: 40px max(16px, calc((100% - 980px) / 2)) 72px; }
.ga-about a { color: var(--ga-link); }
.ga-about h2 { font-size: 1.55rem; margin-top: 0; }
.ga-about h3 { font-size: 1.1rem; margin-top: 30px; }
.ga-about .ga-note { color: var(--ga-article-muted); }
.ga-table-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--ga-article-line); border-radius: 10px; background: var(--ga-article-raised); }
.ga-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; min-width: 760px; }
.ga-table caption { text-align: left; padding: 10px 12px; font-weight: 700; }
.ga-table th, .ga-table td { padding: 9px 12px; border-top: 1px solid var(--ga-article-line); text-align: left; vertical-align: top; }
.ga-table small { display: block; color: var(--ga-article-muted); font-size: 0.74rem; }

/* MapLibre controls */
.ga-body .maplibregl-ctrl-group { border-radius: 9px !important; background: var(--ga-raised) !important; border: 1px solid var(--ga-line); box-shadow: 0 6px 18px var(--ga-shadow) !important; }
.ga-body[data-ui-theme="dark"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }
.ga-body .maplibregl-ctrl-group button + button { border-top-color: var(--ga-line); }
.ga-body .maplibregl-ctrl-scale { border-color: var(--ga-ink) !important; color: var(--ga-ink) !important; background: var(--ga-glass) !important; }
.ga-body .maplibregl-ctrl-attrib { background: var(--ga-glass) !important; color: var(--ga-muted); }
.ga-body .maplibregl-ctrl-attrib a { color: var(--ga-ink); }

.ga-has-drawer .ga-charts-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1240px) { .ga-charts-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ga-fresh span { max-width: 240px; } }
@media (max-width: 1100px) { .ga-fresh { display: none; } .ga-drawer { width: 330px; } }

/* Mobile: full-width map, collapsible layers, bottom-sheet details */
@media (max-width: 760px) {
  .ga-body { --ga-top-h: 104px; }
  .ga-top { flex-wrap: wrap; height: var(--ga-top-h); gap: 6px 10px; padding: 8px 16px; align-content: center; }
  .ga-body .brand-mark-img { width: 28px; height: 28px; }
  .ga-title { font-size: 0.86rem; }
  .ga-search { order: 5; flex: 1 1 100%; max-width: none; }
  .ga-actions { gap: 6px; }
  .ga-actions .ga-btn, .ga-layers-toggle { min-height: 34px; padding: 0 10px; font-size: 0.8rem; }
  .ga-layers-toggle { display: inline-flex; }
  .ga-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: calc(100dvh - var(--ga-top-h) - 1px); min-height: 440px; }
  .ga-panel { position: fixed; z-index: 25; top: var(--ga-top-h); left: 0; bottom: 0; width: min(330px, 88vw); transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: 8px 0 24px var(--ga-shadow); }
  .ga-panel-open .ga-panel { transform: none; }
  .ga-map-wrap, .ga-charts { grid-column: 1; }
  .ga-legend { bottom: 30px; font-size: 0.66rem; padding: 6px 8px; max-height: 32%; overflow: auto; }
  .ga-legend-row:nth-child(n+2) { display: none; }
  .ga-prices-on .ga-legend-row:nth-child(3) { display: flex; }
  .ga-pricebar { left: 8px; right: 56px; max-width: none; top: 8px; font-size: 0.74rem; }
  .ga-price-meta { max-height: 4.5em; }
  .ga-drawer { position: fixed; z-index: 26; left: 0; right: 0; bottom: 0; width: auto; max-height: 64dvh; border-left: 0; border-top: 1px solid var(--ga-line); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px var(--ga-shadow); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .ga-charts-body { grid-template-columns: minmax(0, 1fr); max-height: 50dvh; }
  .ga-dl ul { position: fixed; left: 16px; right: 16px; top: var(--ga-top-h); width: auto; }
  .ga-dl-rows { grid-template-columns: 44% 56%; }
}
@media (prefers-reduced-motion: reduce) { .ga-panel { transition: none; } }

/* v4: map modes, interval player, congestion ranking */
.ga-modes { position: absolute; top: 12px; left: 12px; z-index: 6; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--ga-line); border-radius: 12px; background: var(--ga-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 28px var(--ga-shadow); max-width: calc(100% - 80px); overflow-x: auto; scrollbar-width: none; }
.ga-modes button { flex: none; min-height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ga-muted); font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.ga-modes button:hover { color: var(--ga-ink); background: var(--ga-raised-2); }
.ga-modes button[aria-pressed="true"] { background: var(--ga-brand); color: var(--ga-brand-ink); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 4px 14px rgba(29, 138, 74, 0.45); }
.ga-scrub { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.ga-scrub input[type="range"] { flex: 1 1 auto; min-width: 120px; accent-color: var(--ga-brand); }
.ga-scrub span { font-size: 0.78rem; color: var(--ga-muted); white-space: nowrap; }
.ga-scrub .ga-btn { min-height: 30px; }
.ga-scrub .ga-btn[aria-pressed="true"] { background: var(--ga-brand); color: var(--ga-brand-ink); border-color: var(--ga-brand); }
.ga-rank { margin: 8px 0 6px; padding-left: 20px; font-size: 0.82rem; }
.ga-rank li { padding: 3px 0; }
.ga-rank small { display: block; color: var(--ga-muted); font-size: 0.72rem; }
@media (max-width: 760px) {
  .ga-modes { top: 8px; left: 8px; right: 56px; max-width: none; }
  .ga-modes button { padding: 0 10px; font-size: 0.8rem; min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) { .ga-modes button { transition: none; } }
.ga-pricebar { top: 62px; max-height: calc(100% - 200px); overflow: auto; }
@media (max-width: 760px) { .ga-pricebar { top: 52px; } }
/* v5: congestion flag */
.ga-cong-flag { display: grid; gap: 3px; margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--lvl); background: color-mix(in srgb, var(--lvl) 16%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--lvl) 30%, transparent); }
.ga-cong-flag strong { color: var(--lvl); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.82rem; }
.ga-cong-flag span { font-size: 0.8rem; }
.ga-cong-flag.is-chronic, .ga-lvl.is-chronic { --lvl: var(--lvl-chronic); }
.ga-cong-flag.is-severe, .ga-lvl.is-severe { --lvl: var(--lvl-severe); }
.ga-cong-flag.is-frequent, .ga-lvl.is-frequent { --lvl: var(--lvl-frequent); }
.ga-cong-flag.is-occasional, .ga-lvl.is-occasional { --lvl: var(--lvl-occasional); }
.ga-lvl { color: var(--lvl); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.06em; margin-right: 4px; }
/* v5: line catalog */
.ga-catalog { position: absolute; z-index: 7; top: 62px; right: 12px; bottom: 12px; width: min(860px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--ga-glass); color: var(--ga-ink); border: 1px solid var(--ga-line); border-radius: 12px; box-shadow: 0 16px 40px var(--ga-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ga-catalog-head { display: flex; align-items: center; justify-content: space-between; }
.ga-catalog-head h2 { margin: 0; font-size: 1rem; }
.ga-catalog-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ga-catalog-filters input[type="search"], .ga-catalog-filters select { height: 34px; padding: 0 10px; border: 1px solid var(--ga-line); border-radius: 8px; background: var(--ga-raised); color: var(--ga-ink); font: inherit; font-size: 0.84rem; }
.ga-catalog-filters input[type="search"] { flex: 1 1 200px; }
.ga-catalog-table { flex: 1 1 auto; overflow: auto; border: 1px solid var(--ga-line); border-radius: 8px; }
.ga-catalog table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ga-catalog th { position: sticky; top: 0; background: var(--ga-raised-2); text-align: left; padding: 7px 8px; cursor: pointer; white-space: nowrap; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ga-muted); }
.ga-catalog th[aria-sort="ascending"]::after { content: " ▲"; } .ga-catalog th[aria-sort="descending"]::after { content: " ▼"; }
.ga-catalog td { padding: 6px 8px; border-top: 1px solid var(--ga-line); vertical-align: top; }
.ga-catalog td small { display: block; color: var(--ga-muted); font-size: 0.7rem; }
.ga-catalog tr:hover td { background: var(--ga-raised-2); }
.ga-catalog tr.is-unmapped .ga-linkbtn { color: var(--ga-ink); }
.ga-catalog .is-na { color: var(--ga-muted); }
@media (max-width: 760px) { .ga-catalog { top: 52px; left: 8px; right: 8px; bottom: 8px; width: auto; padding: 10px; } .ga-catalog th:nth-child(2), .ga-catalog td:nth-child(2) { display: none; } }
/* v6: live congestion indicator */
.ga-live { position: absolute; z-index: 6; top: 62px; right: 56px; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid var(--lvl-chronic); border-radius: 999px; background: var(--ga-glass); color: var(--ga-ink); font: inherit; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; cursor: pointer; backdrop-filter: blur(8px); }
.ga-live.is-snapshot { border-color: var(--ga-line); box-shadow: none; font-weight: 600; }
.ga-live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lvl-chronic); } /* static: the lines themselves flash */
.ga-live.is-snapshot .ga-live-dot { background: var(--ga-muted); animation: none; }
@keyframes ga-pulse { 0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--lvl-chronic) 70%, transparent); } 50% { opacity: 0.55; transform: scale(0.8); box-shadow: 0 0 0 8px transparent; } }
.ga-live-panel { position: absolute; z-index: 6; top: 100px; right: 56px; width: min(420px, calc(100% - 80px)); max-height: 50%; overflow: auto; padding: 10px 12px; background: var(--ga-glass); color: var(--ga-ink); border: 1px solid var(--ga-line); border-radius: 10px; box-shadow: 0 12px 30px var(--ga-shadow); backdrop-filter: blur(8px); font-size: 0.8rem; }
.ga-live-panel p { margin: 0 0 6px; }
.ga-now { color: var(--lvl-chronic); }
.ga-flash-red { background: var(--lvl-chronic); height: 5px; animation: ga-pulse 1.4s ease-in-out infinite; }
.ga-flash-amber { background: var(--lvl-frequent); height: 5px; animation: ga-pulse 1.8s ease-in-out infinite; }
@media (max-width: 760px) { .ga-live { top: 52px; right: 52px; font-size: 0.7rem; } .ga-live-panel { top: 90px; left: 8px; right: 8px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .ga-live-dot, .ga-flash-red, .ga-flash-amber { animation: none; } }
/* v6: upgrade outlook + queue */
.ga-upg { display: grid; gap: 4px; margin: 4px 0 10px; padding: 9px 12px; border: 1px solid var(--ga-line); border-left: 4px solid var(--ga-brand); border-radius: 10px; background: var(--ga-raised); font-size: 0.8rem; }
.ga-upg.is-none_public { border-left-color: var(--ga-muted); }
.ga-rates { width: 100%; margin: 6px 0; border-collapse: collapse; font-size: 0.78rem; }
.ga-rates th, .ga-rates td { padding: 3px 6px; border-bottom: 1px solid var(--ga-line); text-align: left; }
.ga-rates td:first-child { text-transform: capitalize; }

/* v8: simplified panel, insight card, contextual legend */
.ga-group > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 2px 0 8px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ga-muted); }
.ga-group > summary::-webkit-details-marker { display: none; }
.ga-group > summary::after { content: "+"; font-size: 1rem; font-weight: 400; color: var(--ga-muted); }
.ga-group[open] > summary::after { content: "–"; }
.ga-group > summary:hover { color: var(--ga-ink); }
.ga-sub { margin: 0 0 12px; }
.ga-sub-title { margin: 0 0 6px; font-size: 0.78rem; font-weight: 600; color: var(--ga-ink); }
.ga-insight { position: absolute; z-index: 5; top: 62px; left: 12px; width: min(380px, calc(100% - 80px)); padding: 12px 14px 10px; background: var(--ga-glass); color: var(--ga-ink); border: 1px solid var(--ga-line); border-radius: 12px; box-shadow: 0 10px 30px var(--ga-shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ga-insight-head { display: flex; justify-content: space-between; align-items: center; }
.ga-insight .ga-kicker { margin: 0; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ga-brand); }
.ga-insight h2 { margin: 2px 0 6px; font-size: 1rem; line-height: 1.3; }
.ga-insight-toggle { border: 0; background: transparent; color: var(--ga-muted); font: inherit; font-size: 0.75rem; cursor: pointer; }
.ga-insight-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.84rem; }
.ga-insight-list .ga-linkbtn { text-align: left; }
.ga-insight-meta { color: var(--ga-muted); font-size: 0.76rem; margin-top: 2px; }
.ga-insight.is-collapsed #ga-insight-body { display: none; }
.ga-insight.is-collapsed h2 { margin-bottom: 0; font-size: 0.9rem; }
.ga-now-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--lvl-chronic); vertical-align: 1px; }
body[data-mode="prices"] .ga-insight { display: none; }
.ga-legend-toggle { justify-self: start; border: 0; padding: 0 0 2px; background: transparent; color: var(--ga-muted); font: inherit; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.ga-legend-toggle::after { content: " –"; }
.ga-legend-closed .ga-legend-toggle::after { content: " +"; }
.ga-legend-closed .ga-legend-rows { display: none; }
.ga-legend-rows { display: grid; gap: 4px; }
.ga-legend-row.is-compact { opacity: 0.8; font-size: 0.66rem; }
.ga-live { top: 62px; }
.ga-live-panel { top: 100px; }
@media (max-width: 760px) {
  .ga-insight { top: 52px; left: 8px; right: 56px; width: auto; padding: 8px 10px; } /* clears the zoom and compass buttons (v8 self-review) */
  .ga-insight h2 { font-size: 0.85rem; }
  .ga-live { top: auto; bottom: 64px; right: 8px; }
  .ga-live-panel { top: auto; bottom: 104px; }
}
.ga-panel-actions { display: grid; gap: 10px; margin-top: 8px; }
.ga-dl-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.8rem; }
@media (min-width: 761px) { .ga-panel-actions > .ga-btn { display: none; } }
@media (max-width: 760px) {
  .ga-actions { display: none; }
  .ga-title { display: none; }
  .ga-top { flex-wrap: wrap; }
  .ga-modes { -webkit-mask-image: linear-gradient(90deg, currentColor 85%, transparent); mask-image: linear-gradient(90deg, currentColor 85%, transparent); }
}
/* v8f (founder 2026-11-19): phone bar under the map. Legend (far left) and the LIVE chip share the row with Charts so nothing
   covers the map; the open legend and the live panel pop up above the bar. Desktop is unchanged (the bar is empty there). */
.ga-phonebar { display: none; }
@media (max-width: 760px) {
  .ga-phonebar { position: absolute; z-index: 3; left: 8px; right: 92px; top: 6px; display: flex; align-items: center; gap: 6px; min-width: 0; }
  .ga-phonebar .ga-legend { position: static; display: block; max-width: none; max-height: none; overflow: visible; padding: 0; background: none; border: 0; box-shadow: none; }
  .ga-phonebar .ga-legend-toggle { min-height: 30px; padding: 0 10px; border: 1px solid var(--ga-line); border-radius: 999px; background: var(--ga-glass); color: var(--ga-ink); }
  .ga-phonebar .ga-legend-rows { position: absolute; left: 0; bottom: calc(100% + 12px); width: calc(100vw - 16px); max-height: 42dvh; overflow: auto; padding: 8px 10px; background: var(--ga-glass); color: var(--ga-ink); border: 1px solid var(--ga-line); border-radius: 12px; box-shadow: 0 8px 24px var(--ga-shadow); }
  .ga-phonebar .ga-live { position: static; min-height: 30px; padding: 0 10px; font-size: 0.72rem; min-width: 0; white-space: nowrap; }
  .ga-phonebar .ga-live[data-short] #ga-live-text { display: none; }
  .ga-phonebar .ga-live[data-short]::after { content: attr(data-short); overflow: hidden; text-overflow: ellipsis; }
  .ga-live-panel { top: auto; bottom: 8px; left: 8px; right: 8px; }
}
