/* BKV Solar — single stylesheet. Tokens first, then primitives, header, dashboard, pages. */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #050506;
  --surface: #0e0e10;
  --surface-2: #141416;
  --surface-3: #1c1c1f;
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.13);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --accent: #30d158;
  --accent-soft: rgba(48,209,88,.10);
  --accent-line: rgba(48,209,88,.25);
  --solar: #c98500;
  --solar-bright: #f0b13c;
  --grid: #3987e5;
  --grid-bright: #5aa4f2;
  --output: #199e70;
  --output-bright: #4ed49c;
  --battery: #9085e9;
  --battery-bright: #a99ff0;
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif;
  --top-extra: 0px; /* extra header breathing room under the iOS status bar in the installed app */
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Aliases kept for the sub-page rules below. */
  --green: var(--accent); --green2: var(--output); --sun: var(--solar-bright); --blue: var(--grid-bright);
  --violet: var(--battery-bright); --muted: var(--text-2); --panel: var(--surface);
  font-family: var(--font);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
a { color: var(--text); text-decoration: none; }
button { font-family: inherit; }
main { width: min(1400px, calc(100% - 40px)); margin: 0 auto; padding: 14px 0 18px; }
footer { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
footer { display: flex; justify-content: space-between; gap: 12px; width: min(1400px, calc(100% - 40px)); margin: 0 auto; padding: 4px 4px 22px; color: var(--text-3); font-size: 10.5px; }
footer a { color: var(--text-2); } footer a:hover { color: var(--accent); }

/* Primitives */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.lbl, .kicker { display: inline-block; color: var(--text-3); font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.mono { font-family: var(--mono); }
.big { font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.big .unit { margin-left: 2px; color: var(--text-2); font-size: .55em; font-weight: 400; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-head h2, .details h2 { margin: 4px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); color: var(--text-2); font-size: 11px; white-space: nowrap; }
.chip b { font-weight: 600; color: var(--text); }
.chip.on { border-color: var(--accent-line); background: var(--accent-soft); color: #7ee2a0; }
.chip.sun { border-color: rgba(240,177,60,.28); background: rgba(240,177,60,.10); color: var(--solar-bright); }
.chip.warn { border-color: rgba(255,107,107,.3); background: rgba(255,107,107,.1); color: #ff9a9a; }
.chip.violet { border-color: rgba(144,133,233,.3); background: rgba(144,133,233,.1); color: var(--battery-bright); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px rgba(48,209,88,.6); flex: none; }
.dot.warn { background: var(--solar-bright); box-shadow: 0 0 6px rgba(240,177,60,.6); }
.dot.off { background: var(--text-3); box-shadow: none; }
.range-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 0; border-radius: 8px; background: rgba(255,255,255,.05); }
.range-tabs button { padding: 4px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); font: 500 10px var(--mono); letter-spacing: .06em; cursor: pointer; }
.range-tabs button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.metric-card { min-width: 0; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.metric-card > div { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 11px; }
.metric-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.metric-dot.sun { background: var(--solar-bright); } .metric-dot.mint { background: var(--output-bright); } .metric-dot.blue, .metric-dot.cyan { background: var(--grid-bright); } .metric-dot.violet { background: var(--battery-bright); }
.metric-card strong { display: block; margin: 8px 0 3px; overflow: hidden; font-size: 22px; font-weight: 400; letter-spacing: -.03em; white-space: nowrap; text-overflow: ellipsis; }
.metric-card small { display: block; overflow: hidden; color: var(--text-3); font-size: 10.5px; white-space: nowrap; text-overflow: ellipsis; }
.history-count { align-self: center; color: var(--text-3); font: 500 10px var(--mono); }
.outage-empty { display: grid; min-height: 160px; place-items: center; color: var(--text-3); font-size: 11.5px; text-align: center; }
.chart-empty { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; }
.chart-empty.show { display: flex; }
.switch { position: relative; flex: none; width: 30px; height: 18px; border: 0; border-radius: 999px; background: rgba(255,255,255,.14); cursor: pointer; transition: background .2s ease; padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #d8d8dc; transition: left .2s ease; }
.switch.active { background: var(--solar-bright); } .switch.active::after { left: 14px; background: #1a1200; }
.switch:disabled { opacity: .5; cursor: wait; }
.h-scroll { overflow-x: auto; scrollbar-width: none; } .h-scroll::-webkit-scrollbar { display: none; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 14px; height: calc(52px + env(safe-area-inset-top, 0px) + var(--top-extra)); padding: calc(env(safe-area-inset-top, 0px) + var(--top-extra)) max(20px, calc((100vw - 1400px) / 2)) 0; border-bottom: 1px solid var(--line); background: rgba(5,5,6,.92); }
.header-left, .header-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-left { position: relative; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: var(--accent); color: #03210c; }
.brand-mark svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.brand > span:last-child span { color: var(--accent); }
.primary-nav { display: flex; align-items: center; gap: 2px; }
.primary-nav a { padding: 6px 10px; border-radius: 7px; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.primary-nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.primary-nav a.active { color: var(--text); background: rgba(255,255,255,.07); }
.menu-button { display: none; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-2); cursor: pointer; }
.menu-button[aria-expanded="true"] { color: var(--text); border-color: var(--line-strong); }
.menu-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-panel { position: absolute; z-index: 20; top: 42px; max-height: calc(100vh - 70px - env(safe-area-inset-top, 0px)); overflow-y: auto; left: 0; width: 272px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.menu-panel > a { display: block; padding: 9px 11px; border-radius: 8px; color: var(--text); }
.menu-panel > a:hover, .menu-panel > a.active { background: rgba(255,255,255,.06); }
.menu-panel > a span, .camping-toggle b { display: block; font-size: 12.5px; font-weight: 600; }
.menu-panel small { display: block; margin-top: 2px; color: var(--text-3); font-size: 10.5px; }
.menu-divider { height: 1px; margin: 6px 5px; background: var(--line); }
.camping-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.camping-toggle:hover { background: rgba(255,255,255,.04); }
.camping-toggle > i { position: relative; flex: none; width: 30px; height: 18px; border-radius: 999px; background: rgba(255,255,255,.14); transition: background .2s ease; }
.camping-toggle > i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #d8d8dc; transition: left .2s ease; }
.camping-toggle.active > i { background: var(--solar-bright); } .camping-toggle.active > i::after { left: 14px; background: #1a1200; }
.camping-toggle:disabled { opacity: .55; cursor: wait; }
.services { display: flex; align-items: center; gap: 12px; }
.services span { display: flex; align-items: center; gap: 5px; color: var(--text-3); font: 400 10px var(--mono); }
.camping-header { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 11px; white-space: nowrap; }
.battery-pill { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.battery-pill > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.battery-pill > div:last-child span { font-size: 13px; font-weight: 600; line-height: 1; }
.battery-pill > div:last-child small { color: var(--text-3); font: 400 9.5px var(--mono); line-height: 1; white-space: nowrap; }
.battery-glyph { --soc: 0%; --battery-color: var(--accent); position: relative; flex: none; width: 34px; height: 16px; border: 1.5px solid #8e8e93; border-radius: 4px; }
.battery-glyph::after { content: ""; position: absolute; right: -5px; top: 4px; width: 3px; height: 6px; border-radius: 0 2px 2px 0; background: #8e8e93; }
.battery-glyph i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: calc(var(--soc) * .86); max-width: calc(100% - 4px); border-radius: 2px; background: var(--battery-color); transition: width .35s ease; }
.battery-pill.low .battery-glyph { --battery-color: var(--danger); }
.battery-pill.charging .battery-glyph { border-color: rgba(48,209,88,.7); }
.battery-pill.offline { opacity: .55; } .battery-pill.offline .battery-glyph { --battery-color: var(--text-3); }
.outage-notification { --swipe-x: 0px; display: flex; align-items: center; border: 1px solid rgba(240,177,60,.3); border-radius: 10px; background: rgba(240,177,60,.08); transform: translateX(var(--swipe-x)); transition: transform .16s ease, opacity .16s ease; touch-action: pan-y; }
.outage-notification.active { border-color: rgba(255,107,107,.42); background: rgba(255,107,107,.08); }
.outage-notification.storm { border-color: rgba(144,133,233,.4); background: rgba(144,133,233,.09); }
.outage-notification.storm svg { stroke: var(--battery-bright); }
.outage-notification.dismissing { opacity: 0; transform: translateX(calc(var(--swipe-x) + 100px)); }
.outage-notification > a { display: flex; align-items: center; gap: 7px; padding: 6px 6px 6px 9px; color: var(--text); }
.outage-notification svg { width: 16px; fill: none; stroke: var(--solar-bright); stroke-width: 1.8; stroke-linecap: round; }
.outage-notification.active svg { stroke: #ff9a9a; }
.outage-notification span { display: flex; flex-direction: column; min-width: 0; }
.outage-notification b { max-width: 150px; overflow: hidden; font-size: 10.5px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.outage-notification small { max-width: 150px; margin-top: 2px; overflow: hidden; color: var(--text-2); font-size: 9.5px; white-space: nowrap; text-overflow: ellipsis; }
.outage-notification > button { width: 25px; height: 28px; padding: 0; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--text-3); font-size: 17px; cursor: pointer; }
.outage-notification > button:hover { color: var(--text); }
.camping-banner, .connection-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 9px 14px; border: 1px solid rgba(240,177,60,.25); border-radius: 10px; background: rgba(240,177,60,.07); }
.camping-banner strong { color: var(--solar-bright); font-size: 11.5px; } .camping-banner span { color: var(--text-2); font-size: 11px; }
.connection-banner { border-color: rgba(255,107,107,.3); background: rgba(255,107,107,.08); }
.connection-banner strong { color: #ff9a9a; font-size: 11.5px; } .connection-banner span { color: var(--text-2); font-size: 11px; }

/* Dashboard */
#dashboard-page { display: flex; flex-direction: column; gap: 14px; }
.hero { --flow-duration: 1.4s; position: relative; display: grid; grid-template-columns: minmax(250px, 1fr) minmax(120px, 1.1fr) auto minmax(120px, 1.1fr) minmax(250px, 1fr); align-items: center; min-height: 176px; padding: 20px 26px; }
.hero-sources { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-width: 0; }
.hero-node { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hero-node.end { align-items: flex-end; text-align: right; }
.node-head { display: flex; align-items: center; gap: 7px; }
.node-icon { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.05); }
.node-icon svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.node-solar .node-icon { color: var(--solar-bright); } .node-grid .node-icon { color: var(--grid-bright); } .node-load .node-icon { color: var(--output-bright); }
.node-value { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.hero-node.end .node-value { flex-direction: row-reverse; }
.node-value strong { font-size: 28px; font-weight: 300; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.node-value strong .unit { font-size: 15px; color: var(--text-2); font-weight: 400; margin-left: 2px; }
.node-value span { overflow: hidden; color: var(--text-2); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.node-load .chip { margin-top: 6px; }
.hero-lines { width: 100%; height: 136px; overflow: visible; }
.hero-lines path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.hero-lines .base { stroke: rgba(255,255,255,.06); }
.hero-lines .flow { stroke-dasharray: 3 9; stroke-linecap: round; opacity: 0; transition: opacity .35s ease; }
.hero-lines .flow.active { opacity: 1; animation: flow var(--flow-duration, 1.4s) linear infinite; }
.hero-lines .flow.solar { stroke: var(--solar); } .hero-lines .flow.grid { stroke: var(--grid); } .hero-lines .flow.load { stroke: var(--output); }
.hero-lines text { fill: var(--text-3); font: 400 9px var(--mono); letter-spacing: .15em; }
@keyframes flow { to { stroke-dashoffset: -12; } }
.sun-track { --sunrise: 27%; --sunset: 80%; --now: 50%; position: absolute; z-index: 2; top: -1.5px; right: 22px; left: 22px; height: 3px; border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(255,255,255,.06) 0,
    rgba(255,255,255,.10) calc(var(--sunrise) - 3%),
    var(--solar) calc(var(--sunrise) + 2%),
    var(--solar-bright) calc((var(--sunrise) + var(--sunset)) / 2),
    var(--solar) calc(var(--sunset) - 2%),
    rgba(255,255,255,.10) calc(var(--sunset) + 3%),
    rgba(255,255,255,.06) 100%);
  box-shadow: 0 0 12px rgba(240,177,60,.10); }
.sun-track::before, .sun-track::after { content: ""; position: absolute; top: -2px; width: 1.5px; height: 7px; border-radius: 1px; background: rgba(255,255,255,.28); }
.sun-track::before { left: var(--sunrise); } .sun-track::after { left: var(--sunset); }
.sun-track-now { position: absolute; top: 50%; left: var(--now); width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--solar-bright); box-shadow: 0 0 0 1.5px rgba(240,177,60,.35), 0 0 14px rgba(240,177,60,.85); transform: translate(-50%, -50%); }
.sun-track[data-phase="night"] .sun-track-now { background: #dfe3ea; box-shadow: 0 0 0 1.5px rgba(223,227,234,.25), 0 0 10px rgba(223,227,234,.5); }
.sun-track[data-phase="night"] { box-shadow: none; }
.hero[data-mode="offline"] .sun-track-now { opacity: .5; box-shadow: none; }
.hero-lines-mobile { display: none; }
.hero-lines-mobile .base { stroke: rgba(255,255,255,.06); }
.hero-lines-mobile .flow { stroke-dasharray: 3 9; stroke-linecap: round; opacity: 0; transition: opacity .35s ease; }
.hero-lines-mobile .flow.active { opacity: 1; animation: flow var(--flow-duration, 1.4s) linear infinite; }
.hero-lines-mobile .flow.solar { stroke: var(--solar); } .hero-lines-mobile .flow.grid { stroke: var(--grid); } .hero-lines-mobile .flow.load { stroke: var(--output); }
.hero-battery { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 18px; text-align: center; }
.hero-battery-row { display: flex; align-items: center; gap: 16px; }
.battery-big { --soc: 0%; --battery-color: var(--accent); position: relative; width: 84px; height: 40px; border: 2px solid #8e8e93; border-radius: 9px; }
.battery-big::after { content: ""; position: absolute; right: -8px; top: 11px; width: 5px; height: 13px; border-radius: 0 3px 3px 0; background: #8e8e93; }
.battery-big i { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc(var(--soc) * .74); max-width: calc(100% - 6px); border-radius: 5px; background: linear-gradient(90deg, var(--output), var(--battery-color)); transition: width .4s ease; }
.hero.low .battery-big { --battery-color: var(--danger); } .hero.low .battery-big i { background: var(--danger); }
.hero-battery strong { font-size: 62px; font-weight: 200; letter-spacing: -.04em; line-height: 1; }
.hero-battery strong .unit { font-size: 28px; font-weight: 300; color: var(--text-2); }
.hero-battery > span { color: var(--text-2); font-size: 11px; white-space: nowrap; }
.battery-input-note { margin-top: -2px; color: var(--text-3) !important; font-family: var(--mono); font-size: 10px !important; letter-spacing: .02em; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }
.hero[data-mode="offline"] .node-value strong, .hero[data-mode="offline"] .hero-battery strong { color: var(--text-3); }
.chart-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px 12px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.chart-head > div { display: flex; align-items: center; gap: 14px; min-width: 0; }
.chart-title { font-size: 14px; font-weight: 600; white-space: nowrap; }
.chart-title b { font-weight: 600; }
.chart-legend { display: flex; gap: 14px; margin: 0; color: var(--text-2); font-size: 11px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-legend i { width: 12px; height: 2px; border-radius: 2px; }
.chart-legend i.solar { background: var(--solar); } .chart-legend i.load { background: var(--output); } .chart-legend i.battery { background: var(--battery); }
.chart-legend i.grid { background: repeating-linear-gradient(90deg, var(--grid) 0 4px, transparent 4px 7px); }
.chart-totals { display: flex; gap: 16px; color: var(--text-2); font-size: 11px; white-space: nowrap; }
.chart-totals b { color: var(--text); font-weight: 600; }
.chart-wrap { position: relative; height: 252px; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }
.chart-wrap canvas:focus-visible { outline: 1px solid var(--accent-line); outline-offset: -2px; border-radius: 6px; }
.chart-tooltip { position: absolute; z-index: 3; top: 6px; left: 50%; display: none; min-width: 150px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(20,20,22,.96); box-shadow: 0 10px 28px rgba(0,0,0,.45); pointer-events: none; transform: translateX(-50%); }
.chart-tooltip.show { display: block; }
.chart-tooltip > strong { display: block; margin-bottom: 5px; color: var(--text-2); font-size: 10.5px; font-weight: 500; }
.chart-tooltip span { display: grid; grid-template-columns: 6px 1fr auto; align-items: center; gap: 6px; font-size: 10.5px; line-height: 1.7; }
.chart-tooltip span i { width: 6px; height: 6px; border-radius: 50%; }
.chart-tooltip span i.solar { background: var(--solar); } .chart-tooltip span i.load { background: var(--output); } .chart-tooltip span i.grid { background: var(--grid); } .chart-tooltip span i.battery { background: var(--battery); }
.chart-tooltip span b { color: var(--text-3); font-weight: 400; } .chart-tooltip span em { color: var(--text); font-style: normal; font-weight: 600; }
.tiles { display: grid; grid-template-columns: .95fr 1.9fr 1.05fr; gap: 14px; }
.tile { display: flex; flex-direction: column; padding: 14px 18px 12px; min-width: 0; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tile-head h2 { margin: 0; font-size: 13px; font-weight: 600; }
.tile-head .mono, .tile-head small { color: var(--text-3); font: 400 10px var(--mono); }
.tile-head svg { width: 15px; fill: none; stroke: var(--solar-bright); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.energy-list > div { display: grid; grid-template-columns: 70px 1fr auto; align-items: baseline; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.energy-list span { color: var(--text-2); font-size: 11px; }
.energy-list strong { font-size: 17px; font-weight: 400; letter-spacing: -.02em; white-space: nowrap; }
.energy-list small { color: var(--text-3); font: 400 10px var(--mono); white-space: nowrap; }
.energy-list > .harvest-bar { display: flex; align-items: center; gap: 8px; margin: -2px 0 4px; padding: 0 0 4px; border-top: 0; }
.harvest-bar > div { flex: 1; height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255,255,255,.07); }
.harvest-bar > div i { display: block; width: var(--pct, 0%); height: 100%; border-radius: 2px; background: var(--solar); transition: width .5s ease; }
.harvest-bar span { color: var(--text-3); font: 400 9.5px var(--mono); white-space: nowrap; }
.weather-tile { display: grid; grid-template-columns: 1fr 280px; gap: 18px; }
.weather-tile > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.weather-now { display: flex; align-items: center; gap: 12px; }
.weather-now svg { width: 30px; height: 30px; fill: none; stroke: var(--solar-bright); stroke-width: 1.5; stroke-linecap: round; flex: none; }
.weather-now.night svg { stroke: var(--text-2); }
.weather-now > div { display: flex; flex-direction: column; }
.weather-now strong { font-size: 30px; font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.weather-now strong .unit { font-size: 16px; color: var(--text-2); font-weight: 400; }
.weather-now span { margin-top: 4px; color: var(--text-2); font-size: 11px; }
.weather-stats { display: grid; grid-template-columns: .7fr 1fr 1.3fr; gap: 8px; margin-top: 2px; padding-top: 0; border: 0; }
.weather-stats > div { display: flex; flex-direction: column; gap: 2px; }
.weather-stats strong { font-size: 14px; font-weight: 400; }
.forecast-head { display: flex; justify-content: space-between; gap: 8px; }
.forecast-spark { display: block; width: 100%; height: 64px; overflow: visible; }
.forecast-spark .night { fill: rgba(255,255,255,.035); }
.forecast-spark .area { fill: url(#forecast-fill); }
.forecast-spark .line { fill: none; stroke: var(--solar); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.forecast-spark .axis { stroke: rgba(255,255,255,.10); }
.forecast-spark text { fill: var(--text-3); font: 400 9px var(--mono); }
.forecast-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--text-2); font-size: 10.5px; }
.system-tile { gap: 9px; }
.policy-grid { display: grid; grid-template-columns: 2.1fr 1fr .9fr .9fr; gap: 8px; }
.policy-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.policy-grid strong { overflow: hidden; font-size: 13px; font-weight: 400; white-space: nowrap; text-overflow: ellipsis; }
.load-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.load-chips span { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); color: var(--text-2); font-size: 10.5px; }
.rate-box { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); text-align: left; }
.rate-box small { color: var(--text-2); font-size: 11px; }
.rate-box strong { font-size: 15px; font-weight: 400; white-space: nowrap; }
.rate-box strong span { color: var(--text-3); font-size: 10px; }
.status-row { display: grid; grid-template-columns: 2fr 1.25fr 1fr; gap: 14px; }
.smart-status-card { display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px 18px; }
.smart-status-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.smart-status-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.smart-status-card > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.smart-status-card > div > div { display: flex; align-items: center; gap: 10px; }
.smart-status-card h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.smart-status-card p { margin: 0; color: var(--text-2); font-size: 11px; line-height: 1.45; }
.smart-status-card > div > div > small { height: 18px; font-size: 9.5px; letter-spacing: .1em; }
.smart-status-card[data-state="camping"] > div > div > small, .smart-status-card[data-state="settling"] > div > div > small { border-color: rgba(240,177,60,.28); background: rgba(240,177,60,.10); color: var(--solar-bright); }
.smart-status-card[data-state="storm"] > div > div > small { border-color: rgba(144,133,233,.3); background: rgba(144,133,233,.1); color: var(--battery-bright); }
.smart-status-card[data-state="stale"] > div > div > small, .smart-status-card[data-state="unknown"] > div > div > small { border-color: var(--line); background: rgba(255,255,255,.05); color: var(--text-2); }
.summary-link { --link-accent: var(--accent); display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 16px; color: var(--text); transition: border-color .2s ease; }
.summary-link:hover { border-color: var(--line-strong); }
.summary-link > div { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.summary-link .lbl { color: var(--link-accent); }
.summary-link strong { font-size: 13px; font-weight: 600; }
.summary-link em { overflow: hidden; color: var(--text-2); font-size: 10.5px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }
.summary-link > svg.chev { width: 16px; flex: none; fill: none; stroke: var(--text-3); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.summary-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid color-mix(in srgb, var(--link-accent) 25%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--link-accent) 10%, transparent); color: var(--link-accent); flex: none; }
.summary-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.backup-summary-card[data-state="ready"] { --link-accent: var(--accent); } .backup-summary-card[data-state="prepared"] { --link-accent: var(--grid-bright); } .backup-summary-card[data-state="watch"] { --link-accent: var(--solar-bright); } .backup-summary-card[data-state="risk"], .backup-summary-card[data-state="limited"] { --link-accent: var(--danger); } .backup-summary-card[data-state="unknown"] { --link-accent: var(--text-2); }
.storm-summary-card { --link-accent: var(--battery-bright); }
.ring { width: 52px; height: 52px; flex: none; }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .track { stroke: rgba(255,255,255,.08); }
.ring .value { stroke: var(--link-accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray .6s ease; }
.ring text { fill: var(--text); font: 500 15px var(--font); }
.ring text tspan { fill: var(--text-3); font-size: 8px; }
.backup-card-confidence { display: none; }

@media (max-width: 1180px) {
  .primary-nav { display: none; }
  .menu-button { display: grid; }
  .services span { font-size: 0; } .services span .dot { width: 7px; height: 7px; }
}
@media (max-width: 1000px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .weather-tile { grid-column: 1 / -1; }
  .status-row { grid-template-columns: 1fr 1fr; }
  .smart-status-card { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  main { width: calc(100% - 24px); padding-top: 10px; }
  footer { width: calc(100% - 24px); }
  #dashboard-page { gap: 10px; }
  .topbar { height: calc(50px + env(safe-area-inset-top, 0px) + var(--top-extra)); padding: calc(env(safe-area-inset-top, 0px) + var(--top-extra)) calc(12px + env(safe-area-inset-right, 0px)) 0 calc(12px + env(safe-area-inset-left, 0px)); gap: 8px; }
  main, footer { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .header-left { gap: 10px; }
  .camping-header, .services { display: none; }
  .battery-pill { height: 36px; padding: 0 10px; }
  .hero { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 16px 16px 14px; }
  .sun-track { right: 14px; left: 14px; }
  .hero-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
  .hero-sources .hero-lines-mobile { grid-column: 1 / -1; order: 3; }
  .hero-sources .hero-node { min-width: 0; }
  .hero-node .node-value span { white-space: normal; }
  .node-value { flex-direction: column; align-items: flex-start; gap: 4px; }
  .node-value strong { font-size: 24px; }
  .hero-lines { display: none; }
  .hero-lines-mobile { display: block; width: 100%; height: 26px; overflow: visible; }
  .hero-lines-mobile path { fill: none; stroke-width: 2; }
  .hero-lines-mobile.load-line { height: 22px; }
  .hero-battery { padding: 0; }
  .hero-battery strong { font-size: 48px; } .hero-battery strong .unit { font-size: 22px; }
  .hero-battery > span { white-space: normal; font-size: 10.5px; }
  .hero-chips .chip { height: 20px; font-size: 10.5px; }
  .battery-big { width: 64px; height: 32px; } .battery-big::after { top: 8px; height: 10px; }
  .node-load { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head value" "chip value"; align-items: center; gap: 4px 12px; width: 100%; }
  .node-load.end { align-items: center; text-align: left; }
  .node-load .node-head { grid-area: head; }
  .node-load .node-value { grid-area: value; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
  .node-load .node-value span { white-space: normal; }
  .node-load .chip { grid-area: chip; justify-self: start; margin-top: 0; }
  .chart-card { padding: 12px 14px 10px; }
  .chart-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .chart-head > div:first-child { justify-content: space-between; }
  .chart-head > div:last-child { flex-direction: row-reverse; justify-content: space-between; }
  .chart-legend { gap: 10px; font-size: 10px; }
  .chart-totals { gap: 12px; font-size: 10.5px; }
  .chart-wrap { height: 222px; }
  .tiles, .status-row { grid-template-columns: 1fr; gap: 10px; }
  .weather-tile { grid-template-columns: 1fr; gap: 10px; }
  .tile { padding: 12px 14px 10px; }
  .smart-status-card { align-items: flex-start; padding: 12px 14px; }
  .smart-status-card > div > div { flex-wrap: wrap; gap: 6px; }
  .summary-link { padding: 10px 14px; }
  .summary-link em { white-space: normal; }
  .ring { width: 44px; height: 44px; }
  .hero-node.end { align-items: flex-end; }
}
@media (max-width: 420px) {
  .brand > span:last-child { display: none; }
  .outage-notification small { display: none; }
  .outage-notification b { max-width: 74px; }
  .camping-banner, .connection-banner { align-items: flex-start; flex-direction: column; gap: 3px; }
}
@media (display-mode: standalone) {
  :root { --top-extra: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .sun-track-now { transition: none; }
  .hero-lines .flow.active, .hero-lines-mobile .flow.active { animation: none; }
  .battery-big i, .battery-glyph i, .harvest-bar > div i, .ring .value { transition: none; }
}

/* ---- Sub-pages: ported onto the new tokens ---- */
.system-page { display: grid; gap: 14px; }
.outages-page { display: grid; gap: 8px; }
.outage-hero { display: flex; min-height: 170px; align-items: center; justify-content: space-between; gap: 35px; padding: 28px 32px; }
.outage-hero h1 { margin: 7px 0 6px; font-size: clamp(32px,5vw,52px); line-height: 1; letter-spacing: -.055em; }
.outage-hero p { margin: 0; color: var(--muted); font-size: 12px; }
.grid-state { display: flex; min-width: 180px; align-items: center; gap: 12px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.grid-state > i { width: 11px; height: 11px; border-radius: 50%; background: var(--text-2); }
.grid-state span { display: flex; flex-direction: column; }
.grid-state small { color: var(--text-2); font: 600 10px/1 var(--mono); letter-spacing: .1em; }
.grid-state strong { margin-top: 5px; font-size: 14px; }
.grid-state.online > i { background: var(--green);  }
.grid-state.outage > i { background: var(--danger);  }
.grid-state.paused > i { background: var(--sun);  }
.outage-summary-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.outage-history { padding: 17px 20px; }
.history-count { align-self: center; color: var(--text-2); font: 600 11px var(--mono); }
.outage-list { margin-top: 12px; border-top: 1px solid var(--line); }
.outage-list.scrollable { max-height: 650px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--text-3) transparent; }
.outage-row { display: grid; min-height: 64px; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 11px 5px; border-bottom: 1px solid var(--line); }
.outage-row > i { width: 7px; height: 7px; border-radius: 50%; background: var(--sun); }
.outage-row.active > i { background: var(--danger);  }
.outage-row strong { display: block; font-size: 12px; }
.outage-row small { display: block; margin-top: 4px; color: var(--text-2); font-size: 11px; }
.outage-length { text-align: right; }
.outage-empty { display: grid; min-height: 190px; place-items: center; color: var(--text-2); font-size: 11px; text-align: center; }

.storm-page { display: grid; gap: 8px; }
.storm-hero { display: flex; min-height: 170px; align-items: center; justify-content: space-between; gap: 35px; padding: 28px 32px; }
.storm-hero h1 { margin: 7px 0 6px; font-size: clamp(32px,5vw,52px); line-height: 1; letter-spacing: -.055em; }
.storm-hero p { max-width: 700px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.storm-toggle { display: flex; min-width: 205px; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); color: var(--text); text-align: left; cursor: pointer; }
.storm-toggle span { display: flex; flex-direction: column; }
.storm-toggle small { color: var(--text-2); font: 600 10px/1 var(--mono); letter-spacing: .08em; }
.storm-toggle strong { margin-top: 5px; font-size: 14px; }
.storm-toggle > i { position: relative; width: 38px; height: 22px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); }
.storm-toggle > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: .2s ease; }
.storm-toggle.active > i { border-color: rgba(144,133,233,.55); background: rgba(144,133,233,.13); }
.storm-toggle.active > i::after { left: 19px; background: var(--violet);  }
.storm-toggle:disabled { opacity: .55; cursor: wait; }
.storm-status-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.storm-explainer, .storm-history { padding: 20px 22px; }
.storm-explainer h2 { margin: 6px 0 9px; font-size: 20px; letter-spacing: -.035em; }
.storm-explainer p { max-width: 900px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.storm-list { margin-top: 12px; border-top: 1px solid var(--line); }
.storm-row { display: grid; min-height: 68px; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 11px 5px; border-bottom: 1px solid var(--line); }
.storm-row > i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); }
.storm-row.active > i { background: var(--violet);  }
.storm-row strong { display: block; font-size: 12px; }
.storm-row small { display: block; max-width: 750px; margin-top: 4px; color: var(--text-2); font-size: 11px; line-height: 1.35; }
.storm-timing { text-align: right; }

.app-page { display: grid; gap: 8px; }
.app-hero { display: flex; min-height: 180px; align-items: center; gap: 24px; padding: 28px 32px; }
.app-hero img { flex: none; border-radius: 12px;  }
.app-hero h1 { margin: 7px 0 7px; font-size: clamp(32px,5vw,52px); line-height: 1; letter-spacing: -.055em; }
.app-hero p { margin: 0; color: var(--muted); font-size: 12px; }
.app-status-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.app-status-card { padding: 18px 20px; }
.app-status-card strong { display: block; margin-top: 10px; font-size: 20px; letter-spacing: -.04em; }
.app-status-card p { margin: 5px 0 0; color: var(--text-2); font-size: 10px; line-height: 1.5; }
.push-card { padding: 24px 26px; }
.push-card-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.push-card h2 { margin: 6px 0 6px; font-size: 21px; letter-spacing: -.035em; }
.push-card p { margin: 0; color: var(--muted); font-size: 11px; }
.push-toggle { display: flex; min-width: 132px; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); color: var(--text); font-size: 11px; font-weight: 650; cursor: pointer; }
.push-toggle > i { position: relative; width: 35px; height: 20px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); }
.push-toggle > i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: .2s ease; }
.push-toggle.active > i { border-color: rgba(48,209,88,.5); background: rgba(48,209,88,.12); }
.push-toggle.active > i::after { left: 17px; background: var(--green);  }
.push-toggle:disabled { opacity: .55; cursor: wait; }
.push-event-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 20px; }
.push-event-grid span { position: relative; padding: 10px 10px 10px 28px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); color: var(--text); font-size: 10px; }
.push-event-grid span::before { content: ""; position: absolute; left: 11px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--green);  }
.push-test { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.push-test-button { height: 32px; padding: 0 14px; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-soft); color: #7ee2a0; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.push-test-button:hover:not(:disabled) { background: rgba(48,209,88,.16); }
.push-test-button:disabled { opacity: .45; cursor: default; }
.push-test small { color: var(--text-3); font-size: 10.5px; }
.push-card > small { display: block; margin-top: 14px; color: var(--text-2); font-size: 11px; line-height: 1.5; }

.timeline-page { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 100%; min-width: 0; gap: 8px; }
.timeline-page > * { width: auto; max-width: 100%; min-width: 0; }
.timeline-hero { display: flex; min-height: 170px; align-items: center; justify-content: space-between; gap: 30px; padding: 28px 32px; }
.timeline-hero h1 { margin: 7px 0 6px; font-size: clamp(32px,5vw,52px); line-height: 1; letter-spacing: -.055em; }
.timeline-hero p { max-width: 740px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.timeline-event-total { display: grid; min-width: 126px; min-height: 90px; place-items: center; align-content: center; gap: 4px; border: 1px solid rgba(90,164,242,.2); border-radius: 12px; background: rgba(90,164,242,.05); }
.timeline-event-total strong { color: var(--blue); font-size: 31px; letter-spacing: -.06em; }
.timeline-event-total span { color: var(--text-2); font: 600 10px var(--mono); letter-spacing: .1em; }
.timeline-chart-card { padding: 20px 22px 14px; }
.timeline-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.timeline-chart-head h2 { margin: 6px 0 0; font-size: 20px; letter-spacing: -.035em; }
.timeline-filters { display: flex; max-width: 100%; min-width: 0; gap: 6px; margin: 16px -3px 0; padding: 3px; overflow-x: auto; scrollbar-width: none; }
.timeline-filters::-webkit-scrollbar { display: none; }
.timeline-filters button { display: flex; flex: none; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); color: var(--text-2); font-size: 11px; cursor: pointer; }
.timeline-filters button span { display: grid; min-width: 16px; height: 16px; place-items: center; border-radius: 999px; background: rgba(255,255,255,.05); font: 650 10px var(--mono); }
.timeline-filters button:hover, .timeline-filters button.active { border-color: rgba(90,164,242,.28); background: rgba(90,164,242,.07); color: var(--text); }
.timeline-legend { display: flex; align-items: center; gap: 15px; margin: 15px 0 1px; color: var(--text-2); font-size: 11px; }
.timeline-legend span { display: flex; align-items: center; gap: 6px; }
.timeline-legend i { width: 13px; height: 2px; border-radius: 2px; }
.timeline-legend i.solar { background: var(--sun); }.timeline-legend i.load { background: var(--green); }.timeline-legend i.battery { background: var(--violet); }
.timeline-legend small { margin-left: auto; color: var(--text-2); font-size: 10px; }
.timeline-canvas-wrap { position: relative; height: 285px; }
.timeline-canvas-wrap canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.timeline-detail { min-height: 105px; padding: 18px 22px; }
.timeline-detail-empty { display: flex; min-height: 68px; align-items: center; justify-content: center; gap: 13px; color: var(--text-2); }
.timeline-detail-empty > span { font-size: 27px; }
.timeline-detail-empty div { display: flex; flex-direction: column; }
.timeline-detail-empty strong { color: var(--text); font-size: 11px; }
.timeline-detail-empty small { margin-top: 4px; font-size: 11px; }
.timeline-detail-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 13px; }
.timeline-kind { padding: 5px 7px; border: 1px solid rgba(90,164,242,.2); border-radius: 999px; background: rgba(90,164,242,.05); color: var(--blue); font: 650 10px var(--mono); letter-spacing: .08em; }
.timeline-detail[data-kind="outage"] .timeline-kind { color: #ff9a9a; border-color: rgba(255,107,107,.25); background: rgba(255,107,107,.06); }
.timeline-detail[data-kind="camping"] .timeline-kind { color: var(--sun); border-color: rgba(240,177,60,.25); background: rgba(240,177,60,.06); }
.timeline-detail[data-kind="storm"] .timeline-kind { color: var(--violet); border-color: rgba(144,133,233,.25); background: rgba(144,133,233,.06); }
.timeline-detail h2 { margin: 0; font-size: 15px; letter-spacing: -.025em; }
.timeline-detail p { margin: 4px 0 0; color: var(--text-2); font-size: 11px; }
.timeline-detail time { color: var(--text-2); font: 600 10px var(--mono); text-align: right; }
.timeline-snapshots { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-top: 15px; }
.timeline-snapshots article { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); }
.timeline-snapshots span { display: block; color: var(--text-2); font-size: 10px; }
.timeline-snapshots strong { display: block; margin-top: 5px; font-size: 12px; }
.timeline-snapshots small { display: block; margin-top: 4px; color: var(--text-2); font-size: 10px; line-height: 1.45; }
.timeline-history { padding: 18px 21px; }
.timeline-list { max-height: 620px; margin-top: 12px; overflow-y: auto; border-top: 1px solid var(--line); overscroll-behavior: contain; scrollbar-color: var(--text-3) transparent; }
.timeline-row { --event-color: var(--text); display: grid; width: 100%; min-height: 68px; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 11px 5px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.timeline-row:hover, .timeline-row.selected { background: rgba(255,255,255,.025); }
.timeline-row.selected { box-shadow: inset 2px 0 var(--event-color); }
.timeline-row > i { width: 8px; height: 8px; border-radius: 50%; background: var(--event-color);  }
.timeline-row > span:nth-child(2) { min-width: 0; }
.timeline-row strong { display: block; font-size: 10px; }
.timeline-row small { display: block; margin-top: 4px; overflow: hidden; color: var(--text-2); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; }
.timeline-row-time { text-align: right; }
.timeline-row-time strong { font-size: 11px; }
.timeline-row-time small { white-space: nowrap; }

.backup-page { display: grid; grid-template-columns: minmax(0,1fr); width: 100%; max-width: 100%; min-width: 0; gap: 8px; }
.backup-page > * { max-width: 100%; min-width: 0; }
.backup-hero { --readiness-accent: var(--blue); display: grid; min-height: 245px; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 34px; padding: 30px 35px; overflow: hidden; }
.backup-hero[data-state="ready"] { --readiness-accent: var(--green); }.backup-hero[data-state="prepared"] { --readiness-accent: var(--blue); }.backup-hero[data-state="watch"] { --readiness-accent: var(--sun); }.backup-hero[data-state="risk"], .backup-hero[data-state="limited"] { --readiness-accent: var(--danger); }.backup-hero[data-state="unknown"] { --readiness-accent: var(--text-2); }
.backup-hero h1 { margin: 8px 0 7px; font-size: clamp(34px,5vw,56px); line-height: 1; letter-spacing: -.06em; }
.backup-hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.backup-confidence-line { display: flex; align-items: center; gap: 10px; margin-top: 21px; }
.backup-confidence-line strong { padding: 5px 7px; border: 1px solid color-mix(in srgb, var(--readiness-accent) 24%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--readiness-accent) 6%, transparent); color: var(--readiness-accent); font: 650 10px var(--mono); letter-spacing: .09em; }
.backup-confidence-line span { color: var(--text-2); font-size: 11px; }
.backup-score { --score: 0%; display: grid; width: 150px; height: 150px; place-items: center; align-content: center; border: 1px solid color-mix(in srgb, var(--readiness-accent) 30%, transparent); border-radius: 50%; background: radial-gradient(circle at center,var(--surface) 61%,transparent 62%),conic-gradient(var(--readiness-accent) var(--score),rgba(255,255,255,.06) 0); color: var(--readiness-accent);  }
.backup-score strong { font-size: 46px; line-height: .9; letter-spacing: -.07em; }.backup-score > span { margin-top: 7px; font: 650 10px var(--mono); letter-spacing: .1em; }.backup-score small { max-width: 110px; margin-top: 7px; color: var(--text-2); font-size: 10px; text-align: center; }
.backup-metrics-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.backup-components-card { padding: 22px 24px; }
.backup-component-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 17px; }
.backup-component { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 14px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.016); }
.backup-component > div:first-child strong { display: block; font-size: 11px; }.backup-component > div:first-child small { display: block; margin-top: 3px; color: var(--text-2); font-size: 10px; }
.backup-component-value { color: var(--text); font: 650 10px var(--mono); text-align: right; }
.backup-component-bar { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.05); }
.backup-component-bar i { display: block; width: var(--component-score,0%); height: 100%; border-radius: inherit; background: var(--green); }
.backup-component.watch .backup-component-bar i { background: var(--sun); }.backup-component.risk .backup-component-bar i { background: var(--danger); }.backup-component.unknown .backup-component-bar i { background: var(--text-2); }
.backup-component-meta { grid-column: 1 / -1; color: var(--text-2); font: 600 10px var(--mono); }.backup-component p { grid-column: 1 / -1; margin: 0; color: var(--text-2); font-size: 11px; line-height: 1.45; }
.backup-lower-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: 8px; }
.backup-method-card, .backup-history-card { padding: 22px 24px; }
.backup-method-card h2, .backup-history-card h2 { margin: 6px 0 7px; font-size: 19px; letter-spacing: -.035em; }
.backup-method-card > p { margin: 0; color: var(--text-2); font-size: 10px; line-height: 1.55; }
.backup-missing { display: flex; flex-direction: column; gap: 5px; margin-top: 20px; padding: 13px 14px; border: 1px solid rgba(48,209,88,.16); border-radius: 11px; background: rgba(48,209,88,.035); }
.backup-missing.has-missing { border-color: rgba(240,177,60,.2); background: rgba(240,177,60,.04); }.backup-missing strong { font-size: 10px; }.backup-missing span { color: var(--text-2); font-size: 10px; line-height: 1.45; }
.backup-method-card > small { display: block; margin-top: 16px; color: var(--text-2); font-size: 10px; line-height: 1.5; }
.backup-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.backup-chart-wrap { position: relative; height: 175px; margin-top: 12px; }
.backup-chart-wrap canvas { display: block; width: 100%; height: 100%; }
.backup-history-list { max-height: 178px; margin-top: 10px; overflow-y: auto; border-top: 1px solid var(--line); overscroll-behavior: contain; }
.backup-history-row { display: grid; min-height: 51px; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.backup-history-row > strong { color: var(--green); font: 700 13px var(--mono); }.backup-history-row > span { min-width: 0; }.backup-history-row > span strong { display: block; font-size: 11px; }.backup-history-row small { display: block; margin-top: 3px; color: var(--text-2); font-size: 10px; }.backup-history-row time { color: var(--text-2); font: 600 10px var(--mono); text-align: right; }

.impact-page { display: grid; width: 100%; max-width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); gap: 8px; }
.impact-page > * { max-width: 100%; min-width: 0; }
.impact-hero { position: relative; display: flex; min-height: 218px; align-items: center; justify-content: space-between; gap: 35px; padding: 31px 35px; overflow: hidden; }
.impact-hero::after { content: ""; position: absolute; right: -55px; bottom: -125px; width: 310px; height: 310px; border: 1px solid rgba(240,177,60,.11); border-radius: 50%;  pointer-events: none; }
.impact-hero h1 { margin: 8px 0 7px; font-size: clamp(34px,5vw,56px); line-height: 1; letter-spacing: -.06em; }
.impact-hero p { max-width: 700px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.impact-coverage { display: inline-flex; margin-top: 19px; padding: 6px 8px; border: 1px solid rgba(48,209,88,.2); border-radius: 999px; background: rgba(48,209,88,.045); color: var(--green); font: 650 10px var(--mono); letter-spacing: .055em; }
.impact-hero[data-coverage="partial"] .impact-coverage, .impact-hero[data-coverage="gaps"] .impact-coverage { border-color: rgba(240,177,60,.22); background: rgba(240,177,60,.045); color: var(--sun); }
.impact-hero[data-coverage="no-data"] .impact-coverage { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: var(--text); }
.impact-month-control { position: relative; z-index: 1; display: grid; min-width: 270px; grid-template-columns: 38px minmax(155px,1fr) 38px; align-items: stretch; gap: 5px; padding: 5px; border: 1px solid rgba(240,177,60,.15); border-radius: 12px; background: rgba(14,14,16,.65); }
.impact-month-control button { border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); color: var(--text); font-size: 22px; cursor: pointer; }
.impact-month-control button:hover:not(:disabled) { border-color: rgba(240,177,60,.27); background: rgba(240,177,60,.055); color: var(--sun); }
.impact-month-control button:disabled { opacity: .3; cursor: default; }
.impact-month-control label { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 10px; text-align: center; }
.impact-month-control label span { color: var(--text-2); font: 650 10px var(--mono); letter-spacing: .12em; }
.impact-month-control select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 650 11px var(--font); text-align: center; }
.impact-month-control option { background: var(--surface); }
.impact-metrics-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.impact-metric { --impact-accent: var(--green); display: grid; min-height: 145px; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 16px; padding: 21px 22px; overflow: hidden; }
.impact-metric.solar, .impact-metric.savings { --impact-accent: var(--sun); }.impact-metric.avoided { --impact-accent: var(--blue); }.impact-metric.outage { --impact-accent: #ff9a9a; }.impact-metric.stored { --impact-accent: var(--violet); }
.impact-glyph { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid color-mix(in srgb,var(--impact-accent) 24%,transparent); border-radius: 12px; background: color-mix(in srgb,var(--impact-accent) 6%,transparent); color: var(--impact-accent); font: 600 20px var(--mono);  }
.impact-metric div { min-width: 0; }.impact-metric small { color: var(--impact-accent); font: 650 10px var(--mono); letter-spacing: .09em; }.impact-metric strong { display: block; margin-top: 6px; overflow: hidden; font-size: clamp(22px,3vw,34px); line-height: 1.05; letter-spacing: -.06em; text-overflow: ellipsis; white-space: nowrap; }.impact-metric p { margin: 7px 0 0; color: var(--text-2); font-size: 10px; line-height: 1.4; }
.impact-chart-card { padding: 22px 24px 18px; }
.impact-chart-card h2, .impact-definitions-card h2, .impact-method-card h2 { margin: 6px 0 0; font-size: 19px; letter-spacing: -.035em; }
.impact-legend { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 10px; }
.impact-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }.impact-legend i { width: 12px; height: 3px; border-radius: 3px; }.impact-legend i.solar { background: var(--sun); }.impact-legend i.output { background: var(--green); }.impact-legend i.powered { background: var(--blue); }
.impact-canvas-wrap { position: relative; height: 235px; margin-top: 9px; }
.impact-canvas-wrap canvas { display: block; width: 100%; height: 100%; }
.impact-totals { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.impact-totals div { padding: 12px 14px; background: var(--surface); }.impact-totals span { display: block; color: var(--text-2); font-size: 10px; }.impact-totals strong { display: block; margin-top: 4px; font: 650 11px var(--mono); }
.impact-detail-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 8px; }
.impact-definitions-card, .impact-method-card { padding: 22px 24px; }
.impact-definitions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 17px; }
.impact-definitions article { padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.016); }.impact-definitions strong { display: block; color: var(--text); font-size: 11px; }.impact-definitions p { margin: 5px 0 0; color: var(--text-2); font-size: 10px; line-height: 1.45; }
.impact-rate { display: flex; flex-direction: column; margin-top: 18px; padding: 15px; border: 1px solid rgba(240,177,60,.17); border-radius: 11px; background: rgba(240,177,60,.035); }.impact-rate small { color: var(--text-2); font-size: 10px; }.impact-rate strong { margin-top: 6px; color: var(--sun); font: 650 16px var(--mono); }.impact-rate span { margin-top: 3px; color: var(--text-2); font-size: 10px; }
.impact-method-card > p { margin: 11px 0 0; color: var(--text-2); font-size: 10px; line-height: 1.5; }
.impact-data-window { display: flex; flex-direction: column; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }.impact-data-window span { color: var(--text-2); font-size: 10px; }.impact-data-window strong { margin-top: 5px; font-size: 11px; line-height: 1.45; }.impact-data-window small { margin-top: 7px; color: var(--text-2); font-size: 10px; line-height: 1.45; }

.battery-health-page { display: grid; width: 100%; max-width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); gap: 8px; }
.battery-health-page > * { max-width: 100%; min-width: 0; }
.health-hero { --health-accent: var(--green); display: grid; min-height: 245px; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 36px; padding: 30px 35px; overflow: hidden; }
.health-hero[data-state="calibrating"] { --health-accent: var(--blue); }.health-hero[data-state="watch"] { --health-accent: var(--sun); }.health-hero[data-state="unknown"] { --health-accent: var(--text-2); }
.health-hero h1 { margin: 8px 0 7px; font-size: clamp(34px,5vw,56px); line-height: 1; letter-spacing: -.06em; }
.health-hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.health-confidence { display: flex; align-items: center; gap: 10px; margin-top: 20px; }.health-confidence strong { padding: 6px 8px; border: 1px solid color-mix(in srgb,var(--health-accent) 24%,transparent); border-radius: 999px; background: color-mix(in srgb,var(--health-accent) 6%,transparent); color: var(--health-accent); font: 650 10px var(--mono); letter-spacing: .09em; }.health-confidence span { color: var(--text-2); font-size: 11px; }
.health-cell-badge { position: relative; display: grid; width: 165px; height: 165px; place-items: center; align-content: center; overflow: hidden; border: 1px solid color-mix(in srgb,var(--health-accent) 28%,transparent); border-radius: 12px; background: radial-gradient(circle at 50% 20%,color-mix(in srgb,var(--health-accent) 13%,transparent),rgba(255,255,255,.018) 60%);  }
.health-cell-badge::before { content: ""; position: absolute; inset: 13px; border: 1px solid color-mix(in srgb,var(--health-accent) 12%,transparent); border-radius: 12px; }.health-cell-badge span { color: var(--health-accent); font: 750 34px var(--mono); letter-spacing: -.07em; }.health-cell-badge strong { margin-top: 5px; font-size: 15px; }.health-cell-badge small { margin-top: 6px; color: var(--text-2); font: 600 10px var(--mono); letter-spacing: .1em; }
.health-metrics-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.health-metric { --metric-accent: var(--green); min-height: 136px; padding: 22px 23px; overflow: hidden; }.health-metric.cycles, .health-metric.capacity { --metric-accent: var(--violet); }.health-metric.efficiency { --metric-accent: var(--blue); }.health-metric.temperature, .health-metric.full { --metric-accent: var(--sun); }.health-metric.drain { --metric-accent: #ff9a9a; }
.health-metric > small { color: var(--metric-accent); font: 650 10px var(--mono); letter-spacing: .09em; }.health-metric > strong { display: block; margin-top: 10px; overflow: hidden; font-size: clamp(23px,3vw,35px); line-height: 1.05; letter-spacing: -.055em; text-overflow: ellipsis; white-space: nowrap; }.health-metric > p { margin: 8px 0 0; color: var(--text-2); font-size: 10px; line-height: 1.45; }
.health-main-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 8px; }
.health-chart-card, .lfp-context-card, .health-exposure-card, .health-evidence-card, .health-method-card { padding: 22px 24px; }
.health-chart-card h2, .lfp-context-card h2, .health-exposure-card h2, .health-evidence-card h2, .health-method-card h2 { margin: 6px 0 0; font-size: 19px; letter-spacing: -.035em; }
.health-chart-legend { display: flex; gap: 14px; color: var(--text-2); font-size: 10px; }.health-chart-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }.health-chart-legend i { width: 13px; height: 3px; border-radius: 3px; }.health-chart-legend i.cycles { background: var(--violet); }.health-chart-legend i.temp { background: var(--sun); }
.health-chart-wrap { position: relative; height: 220px; margin-top: 9px; }.health-chart-wrap canvas { display: block; width: 100%; height: 100%; }
.health-chart-totals { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }.health-chart-totals div { padding: 12px 14px; background: var(--surface); }.health-chart-totals span { display: block; color: var(--text-2); font-size: 10px; }.health-chart-totals strong { display: block; margin-top: 4px; font: 650 11px var(--mono); }
.lfp-context-card { position: relative; overflow: hidden; background: linear-gradient(145deg,rgba(144,133,233,.05),rgba(255,255,255,.012) 55%); }.lfp-context-card > p { margin: 15px 0 0; color: var(--text-2); font-size: 10px; line-height: 1.65; }.lfp-life { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 19px; }.lfp-life div { padding: 13px; border: 1px solid rgba(144,133,233,.16); border-radius: 11px; background: rgba(144,133,233,.035); }.lfp-life strong { display: block; color: var(--violet); font: 700 19px var(--mono); }.lfp-life span { display: block; margin-top: 4px; color: var(--text-2); font-size: 10px; }.lfp-context-card > small { display: block; margin-top: 15px; color: var(--text-2); font-size: 10px; line-height: 1.5; }
.health-exposure-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; margin-top: 17px; }.health-exposure-grid article { --exposure: var(--green); padding: 14px 15px; border: 1px solid color-mix(in srgb,var(--exposure) 17%,transparent); border-radius: 11px; background: color-mix(in srgb,var(--exposure) 3%,transparent); }.health-exposure-grid .warm, .health-exposure-grid .combined { --exposure: var(--sun); }.health-exposure-grid .hot, .health-exposure-grid .cold { --exposure: var(--danger); }.health-exposure-grid span { display: block; color: var(--text-2); font-size: 10px; }.health-exposure-grid strong { display: block; margin-top: 6px; color: var(--exposure); font: 650 16px var(--mono); }.health-exposure-grid small { display: block; margin-top: 5px; color: var(--text-2); font-size: 10px; line-height: 1.4; }
.health-lower-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 8px; }
.health-session-list { max-height: 430px; margin-top: 15px; overflow-y: auto; border-top: 1px solid var(--line); }.health-session { display: grid; min-height: 62px; grid-template-columns: 27px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }.health-session > i { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid rgba(48,209,88,.18); border-radius: 8px; color: var(--green); font-style: normal; }.health-session.discharge > i { border-color: rgba(144,133,233,.2); color: var(--violet); }.health-session strong { display: block; font-size: 11px; }.health-session small { display: block; margin-top: 4px; color: var(--text-2); font-size: 10px; }.health-session time { color: var(--text-2); font: 600 10px var(--mono); text-align: right; }
.health-methodology { display: grid; gap: 6px; margin-top: 15px; }.health-methodology article { display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }.health-methodology span { color: var(--blue); font: 650 10px var(--mono); }.health-methodology p { margin: 0; color: var(--text-2); font-size: 10px; line-height: 1.5; }.health-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }.health-sources a { padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 10px; text-decoration: none; }.health-sources a:hover { border-color: rgba(90,164,242,.25); color: var(--blue); }.health-method-card > p { margin: 14px 0 0; color: var(--text); font-size: 11px; line-height: 1.5; }.health-method-card > small { display: block; margin-top: 9px; color: var(--text-2); font: 600 10px var(--mono); line-height: 1.5; }

@media (max-width: 700px) {
  .outage-hero { align-items: flex-start; flex-direction: column; padding: 23px 20px; }
  .grid-state { width: 100%; }
  .outage-summary-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .outage-summary-grid article:first-child { grid-column: 1 / -1; }
  .storm-hero { align-items: flex-start; flex-direction: column; padding: 23px 20px; }
  .storm-toggle { width: 100%; }
  .storm-status-grid { grid-template-columns: 1fr; gap: 5px; }
  .app-hero { align-items: flex-start; padding: 23px 20px; }
  .app-hero img { width: 72px; height: 72px; border-radius: 12px; }
  .app-status-grid { grid-template-columns: 1fr; gap: 5px; }
  .push-event-grid { grid-template-columns: repeat(2,1fr); }
  .timeline-hero { padding: 23px 20px; }
  .timeline-event-total { min-width: 90px; }
  .timeline-chart-card { padding: 18px 12px 10px; }
  .timeline-snapshots { grid-template-columns: 1fr 1fr; }
  .backup-hero { padding: 25px 22px; }
  .backup-score { width: 118px; height: 118px; }.backup-score strong { font-size: 37px; }
  .backup-metrics-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .backup-lower-grid { grid-template-columns: 1fr; }
  .impact-hero { align-items: flex-start; flex-direction: column; padding: 25px 22px; }
  .impact-month-control { width: 100%; min-width: 0; }
  .impact-metrics-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .impact-metric { min-height: 132px; padding: 17px; }
  .impact-detail-grid { grid-template-columns: 1fr; }
  .health-hero { padding: 25px 22px; }.health-cell-badge { width: 120px; height: 120px; }
  .health-metrics-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
  .health-main-grid, .health-lower-grid { grid-template-columns: 1fr; }
  .health-exposure-grid { grid-template-columns: 1fr 1fr; }.health-exposure-grid article:first-child { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .outage-row { grid-template-columns: 8px minmax(0,1fr); }
  .outage-length { grid-column: 2; text-align: left; }
  .outage-length strong, .outage-length small { display: inline; margin-right: 7px; }
  .storm-row { grid-template-columns: 8px minmax(0,1fr); }
  .storm-timing { grid-column: 2; text-align: left; }
  .storm-timing strong, .storm-timing small { display: inline; margin-right: 7px; }
  .app-hero { flex-direction: column; }
  .push-card { padding: 20px 17px; }
  .push-card-head { align-items: flex-start; flex-direction: column; }
  .push-toggle { width: 100%; }
  .push-event-grid { grid-template-columns: 1fr; }
  .timeline-hero { align-items: flex-start; flex-direction: column; }
  .timeline-event-total { width: 100%; min-height: 70px; }
  .timeline-chart-head { flex-direction: column; }
  .timeline-ranges { margin-top: 0; }
  .timeline-legend { flex-wrap: wrap; }
  .timeline-legend small { width: 100%; margin-left: 0; }
  .timeline-canvas-wrap { height: 240px; }
  .timeline-detail { padding: 17px 14px; }
  .timeline-detail-head { grid-template-columns: 1fr; }
  .timeline-kind { width: max-content; }
  .timeline-detail time { text-align: left; }
  .timeline-snapshots { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 9px minmax(0,1fr); }
  .timeline-row-time { grid-column: 2; text-align: left; }
  .timeline-row-time strong, .timeline-row-time small { display: inline; margin-right: 7px; }
  .backup-hero { grid-template-columns: 1fr; }
  .backup-score { width: 100%; height: 92px; border-radius: 12px; background: linear-gradient(90deg,color-mix(in srgb,var(--readiness-accent) 9%,transparent) var(--score),rgba(255,255,255,.02) var(--score)); }
  .backup-score strong { font-size: 35px; }.backup-score > span { margin-top: 4px; }.backup-score small { margin-top: 5px; }
  .backup-confidence-line { align-items: flex-start; flex-direction: column; }
  .backup-components-card, .backup-method-card, .backup-history-card { padding: 19px 16px; }
  .backup-component-list { grid-template-columns: 1fr; }
  .backup-history-head { flex-direction: column; }.backup-ranges { margin-top: 0; }
  .backup-history-row { grid-template-columns: auto minmax(0,1fr); }.backup-history-row time { grid-column: 2; text-align: left; }
  .impact-metrics-grid { grid-template-columns: 1fr; }
  .impact-metric { min-height: 116px; }
  .impact-chart-card, .impact-definitions-card, .impact-method-card { padding: 19px 16px; }
  .impact-chart-card .section-head { align-items: flex-start; flex-direction: column; }
  .impact-legend { margin-top: 11px; }
  .impact-canvas-wrap { height: 205px; }
  .impact-totals { grid-template-columns: 1fr 1fr; }
  .impact-definitions { grid-template-columns: 1fr; }
  .health-hero { grid-template-columns: 1fr; }.health-cell-badge { display: none; }.health-confidence { align-items: flex-start; flex-direction: column; }
  .health-metrics-grid { grid-template-columns: 1fr; }
  .health-metric { min-height: 112px; padding: 18px 17px; }
  .health-chart-card, .lfp-context-card, .health-exposure-card, .health-evidence-card, .health-method-card { padding: 19px 16px; }
  .health-chart-card .section-head { align-items: flex-start; flex-direction: column; }.health-chart-legend { margin-top: 11px; }
  .health-chart-totals { grid-template-columns: 1fr; }.health-chart-totals div { padding: 10px 12px; }
  .health-exposure-grid { grid-template-columns: 1fr; }.health-exposure-grid article:first-child { grid-column: auto; }
  .health-session { grid-template-columns: 27px minmax(0,1fr); }.health-session time { grid-column: 2; text-align: left; }
}


/* ---- Sub-page pass: compact heroes, tighter empties, trip prep flow ---- */
.outage-hero, .storm-hero, .timeline-hero, .backup-hero, .impact-hero, .health-hero, .app-hero, .planner-hero { min-height: 0; padding: 18px 22px; gap: 20px; }
.outage-hero h1, .storm-hero h1, .timeline-hero h1, .backup-hero h1, .impact-hero h1, .health-hero h1, .app-hero h1, .planner-hero h1 { margin: 4px 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.outage-hero p, .storm-hero p, .timeline-hero p, .backup-hero p, .impact-hero p, .health-hero p, .app-hero p, .planner-hero p { font-size: 11.5px; }
.impact-hero::after { display: none; }
.backup-confidence-line, .health-confidence, .impact-coverage { margin-top: 10px; }
.backup-score { width: 96px; height: 96px; }
.backup-score strong { font-size: 28px; } .backup-score > span { margin-top: 3px; } .backup-score small { max-width: 84px; margin-top: 3px; font-size: 9px; line-height: 1.2; }
.health-cell-badge { width: 96px; height: 96px; border-radius: 16px; }
.health-cell-badge::before { inset: 8px; border-radius: 10px; }
.health-cell-badge span { font-size: 22px; } .health-cell-badge strong { margin-top: 2px; font-size: 12px; } .health-cell-badge small { margin-top: 3px; font-size: 8.5px; }
.app-hero img { width: 56px; height: 56px; border-radius: 14px; }
.timeline-event-total { min-width: 96px; min-height: 60px; } .timeline-event-total strong { font-size: 22px; }
.grid-state, .storm-toggle { min-width: 0; padding: 10px 14px; }
.impact-month-control { min-width: 240px; }
.outage-empty { min-height: 72px; }
.impact-metric { min-height: 0; padding: 16px 18px; } .impact-metric strong { font-size: 24px; }
.health-metric { min-height: 0; padding: 16px 18px; } .health-metric > strong { margin-top: 6px; font-size: 24px; }
.backup-metrics-grid .metric-card strong { white-space: normal; font-size: 20px; }
.outage-hero, .storm-hero, .timeline-hero, .app-hero, .impact-hero { display: flex; align-items: center; justify-content: space-between; }
.backup-hero, .health-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }

.planner-hero { --planner-accent: var(--solar-bright); display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: center; overflow: hidden; }
.planner-hero[data-state="ready"] { --planner-accent: var(--accent); }
.planner-hero[data-state="on-track"], .planner-hero[data-state="charging"], .planner-hero[data-state="preparing"] { --planner-accent: var(--grid-bright); }
.planner-hero[data-state="attention"], .planner-hero[data-state="delayed"] { --planner-accent: var(--danger); }
.planner-hero[data-state="last-known"], .planner-hero[data-state="unavailable"], .planner-hero[data-state="waiting"] { --planner-accent: var(--text-2); }
.planner-hero-copy p { max-width: 640px; margin: 0; color: var(--text-2); line-height: 1.5; }
.planner-hero-status { display: flex; align-items: center; gap: 14px; }
.planner-state { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.planner-state-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid color-mix(in srgb, var(--planner-accent) 35%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--planner-accent) 10%, transparent); color: var(--planner-accent); }
.planner-state-mark svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.planner-hero[data-state="attention"] .planner-state-mark svg, .planner-hero[data-state="delayed"] .planner-state-mark svg { display: none; }
.planner-hero[data-state="attention"] .planner-state-mark::after, .planner-hero[data-state="delayed"] .planner-state-mark::after { content: "!"; font-size: 18px; font-weight: 600; }
.planner-state small { color: var(--planner-accent); font: 500 9px var(--mono); letter-spacing: .12em; }
.planner-progress-block { flex: 1; min-width: 0; }
.planner-progress { --progress: 0%; height: 6px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); }
.planner-progress i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--planner-accent); transition: width .4s ease; }
.planner-progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--text-2); font-size: 10.5px; }
.planner-progress-label strong { color: var(--planner-accent); font: 500 13px var(--mono); }
.planner-steps { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 14px; align-items: start; }
.step { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.step-head { display: flex; align-items: flex-start; gap: 10px; }
.step-head > div { flex: 1; min-width: 0; }
.step-head h2 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.step-head p { margin: 0; color: var(--text-2); font-size: 11px; line-height: 1.45; }
.step-num { display: grid; width: 22px; height: 22px; flex: none; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--text); font: 600 11px var(--mono); }
.planner-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.planner-fields > label { min-width: 0; }
.planner-form label { display: grid; gap: 5px; color: var(--text-2); font-size: 10.5px; font-weight: 500; }
.planner-form input { display: block; width: 100%; min-width: 0; height: 36px; -webkit-appearance: none; appearance: none; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: rgba(255,255,255,.04); color: var(--text); font: 500 12px var(--mono); color-scheme: dark; }
.planner-form input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(48,209,88,.08); }
.planner-load-input { position: relative; }
.planner-load-input input { padding-right: 28px; }
.planner-load-input span { position: absolute; top: 11px; right: 10px; color: var(--text-3); font: 500 10px var(--mono); }
.planner-save { height: 36px; padding: 0 14px; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-soft); color: #7ee2a0; font-size: 12px; font-weight: 600; cursor: pointer; }
.planner-save:hover { background: rgba(48,209,88,.16); }
.planner-save:disabled { opacity: .5; cursor: wait; }
.planner-form > small { color: var(--text-3); font-size: 10.5px; line-height: 1.45; }
.camping-page-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255,255,255,.04); color: var(--text); text-align: left; cursor: pointer; }
.camping-page-toggle span { display: flex; flex-direction: column; }
.camping-page-toggle small { color: var(--text-3); font: 500 9.5px var(--mono); letter-spacing: .1em; }
.camping-page-toggle strong { margin-top: 3px; font-size: 14px; }
.camping-page-toggle > i { position: relative; flex: none; width: 36px; height: 21px; border-radius: 999px; background: rgba(255,255,255,.14); transition: background .2s ease; }
.camping-page-toggle > i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #d8d8dc; transition: left .2s ease; }
.camping-page-toggle.active { border-color: rgba(240,177,60,.35); background: rgba(240,177,60,.08); }
.camping-page-toggle.active > i { background: var(--solar-bright); } .camping-page-toggle.active > i::after { left: 17px; background: #1a1200; }
.camping-page-toggle:disabled { opacity: .55; cursor: wait; }
.camping-control-note { color: var(--text-3); font-size: 10.5px; line-height: 1.5; }
.start-by { --start-accent: var(--accent); display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--start-accent) 30%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--start-accent) 8%, transparent); }
.start-by[data-state="late"] { --start-accent: var(--solar-bright); }
.start-by[data-state="unknown"] { --start-accent: var(--text-2); }
.start-by .lbl { color: var(--start-accent); }
.start-by strong { font-size: 15px; font-weight: 600; }
.start-by small { color: var(--text-2); font-size: 10.5px; line-height: 1.4; }
.readiness-list { display: flex; flex-direction: column; margin-top: -4px; }
.readiness-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.readiness-row > i { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--text-2); font-size: 10px; font-style: normal; }
.readiness-row.pass > i { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.readiness-row.warn > i { border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.1); color: #ff9a9a; }
.readiness-row.pending > i { border-color: rgba(90,164,242,.35); background: rgba(90,164,242,.1); color: var(--grid-bright); }
.readiness-row span { min-width: 0; }
.readiness-row strong { display: block; font-size: 11.5px; font-weight: 600; }
.readiness-row small { display: block; margin-top: 2px; color: var(--text-3); font-size: 10.5px; line-height: 1.35; }
.planner-metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.system-facts-card { padding: 14px 18px; }
.system-facts-card .tile-head small { color: var(--text-3); font: 400 10px var(--mono); }
.facts-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 8px 0 0; }
.facts-strip > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.facts-strip dt { color: var(--text-3); font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.facts-strip dd { margin: 0; overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 1000px) {
  .planner-steps { grid-template-columns: 1fr 1fr; }
  .readiness-card { grid-column: 1 / -1; }
  .facts-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .system-page { gap: 10px; }
  .planner-hero { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px; }
  .planner-hero-status { align-items: flex-start; }
  .planner-steps, .planner-metrics-grid { grid-template-columns: 1fr; gap: 10px; }
  .planner-fields { grid-template-columns: 1fr; }
  .planner-form input[type="datetime-local"] { text-align: left; }
  .facts-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outage-hero, .storm-hero, .timeline-hero, .app-hero, .impact-hero, .backup-hero, .health-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 16px; }
  .outage-hero h1, .storm-hero h1, .timeline-hero h1, .backup-hero h1, .impact-hero h1, .health-hero h1, .app-hero h1, .planner-hero h1 { font-size: 22px; }
  .backup-score { width: 100%; height: 64px; }
  .health-cell-badge { display: flex; width: 100%; height: 56px; flex-direction: row; gap: 10px; }
  .health-cell-badge::before { display: none; }
  .timeline-event-total { width: 100%; }
  .impact-metrics-grid, .health-metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .impact-metric { grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; } .impact-metric strong { font-size: 20px; }
  .health-metric { padding: 12px 14px; } .health-metric > strong { font-size: 20px; }
  .impact-metric .impact-glyph { width: 30px; height: 30px; font-size: 14px; }
  .health-exposure-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .health-exposure-grid article:first-child { grid-column: 1 / -1; }
  .health-exposure-grid article { padding: 10px 12px; }
}

/* Battery charge history: permanent daily observations. */
.tiles { grid-template-columns: 1fr 1.15fr 1.5fr 1fr; align-items: start; }
.charge-card { min-width: 0; }
.charge-periods { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; width: fit-content; margin: 0 0 14px; }
.charge-periods button { color: var(--text-3); background: transparent; border: 0; padding: 5px 13px; border-radius: 5px; font: 500 11px var(--mono); cursor: pointer; }
.charge-periods button[aria-pressed="true"] { color: var(--text); background: rgba(156,130,255,.17); }
.charge-periods button:focus-visible, .charge-details summary:focus-visible { outline: 2px solid #ad91ff; outline-offset: 3px; }
.charge-hero { display: flex; flex-direction: column; gap: 3px; }
.charge-hero strong { font: 500 36px/1.1 var(--mono); letter-spacing: -2px; color: #b79aff; }
.charge-hero span, .charge-metrics span { color: var(--text-2); font-size: 11px; }
.charge-dates, .charge-note { font-size: 10px; line-height: 1.5; color: var(--text-3); margin: 8px 0; }
#charge-spark { display: block; width: 100%; height: 100px; overflow: visible; }
.charge-legend { display: flex; justify-content: space-between; gap: 6px; color: #b79aff; font: 9px var(--mono); }
.charge-legend span:last-child { color: var(--text-3); }
.charge-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0 10px; }
.charge-metrics > div { display: flex; flex-direction: column; gap: 5px; }
.charge-metrics strong { font: 500 17px var(--mono); }
.charge-details { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 10px; font-size: 10px; color: var(--text-3); line-height: 1.5; }
.charge-details summary { cursor: pointer; color: var(--text-2); }
.charge-details p { margin: 8px 0; }
.charge-table-wrap { overflow: auto; max-height: 230px; }
.charge-table-wrap table { border-collapse: collapse; width: 100%; white-space: nowrap; font: 9px var(--mono); }
.charge-table-wrap th, .charge-table-wrap td { padding: 6px 5px; text-align: right; border-bottom: 1px solid var(--line); }
.charge-table-wrap th:first-child, .charge-table-wrap td:first-child { text-align: left; }
.charge-table-wrap th { font-weight: 500; }
@media (max-width: 1180px) { .tiles { grid-template-columns: 1fr 1fr; } .weather-tile { grid-column: auto; } }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } .charge-hero strong { font-size: 40px; } }
/* Give charge history a wide chart without squeezing the existing tiles. */
@media (min-width: 761px) {
  .tiles { grid-template-columns: .95fr 1.9fr 1.05fr; }
  .charge-card { grid-column: 1 / -1; order: 4; display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 0 28px; align-items: center; }
  .charge-card .tile-head { margin-bottom: 8px; }
  .charge-periods { margin-bottom: 10px; }
  .charge-details { grid-column: 1 / -1; }
  .charge-table-wrap table { font-size: 11px; }
  .charge-note, .charge-dates { font-size: 11px; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .weather-tile { grid-column: 1 / -1; order: 2; }
  .charge-card { grid-template-columns: 1fr 1fr; }
  .charge-insights { grid-column: 1 / -1; display: flex; gap: 24px; align-items: center; }
  .charge-metrics { flex: 1; }
}
