/* Reservolt — one stylesheet for the public pages and the app.
   Colour carries meaning: blue = grid / buying, amber = solar, aqua = battery, violet = export. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/static/fonts/archivo-latin-ext-standard-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/static/fonts/archivo-latin-standard-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #eceff1;
  --surface: #fbfcfc;
  --surface-2: #f3f5f6;
  --ink: #102231;
  --ink-2: #4a5967;
  --ink-3: #6f7d89;
  --line: #d3dae0;
  --line-2: #e3e8eb;
  --accent: #1f5fc4;          /* buttons, links, focus */
  --accent-ink: #ffffff;
  --accent-wash: #e2ebf9;
  --grid: #2a78d6;            /* series: grid / buying */
  --sun: #eda100;             /* series: solar */
  --batt: #1baf7a;            /* series: battery */
  --export: #6250d6;          /* series: export */
  --house: #4a5967;           /* series: house use (neutral ink) */
  --bar-idle: #b9c3cc;        /* price bars not used for buying */
  --good: #0f7f3a;
  --warn: #8a5a00;
  --warn-wash: #fbf1dc;
  --bad: #b3322a;
  --bad-wash: #f9e3e1;
  --good-wash: #def3e5;
  --shadow: 0 6px 24px rgba(16, 34, 49, 0.12);
  --r-panel: 12px;
  --r-ctl: 7px;
  --gap: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --paper: #0d151d;
    --surface: #16212c;
    --surface-2: #1b2834;
    --ink: #e8eef3;
    --ink-2: #a5b3bf;
    --ink-3: #8191a0;
    --line: #2a3a49;
    --line-2: #223140;
    --accent: #6d9bf0;
    --accent-ink: #0d151d;
    --accent-wash: #1d2f4a;
    --grid: #3987e5;
    --sun: #c98500;
    --batt: #199e70;
    --export: #9085e9;
    --house: #a5b3bf;
    --bar-idle: #3c4d5d;
    --good: #4cc27a;
    --warn: #e2b04a;
    --warn-wash: #2e2717;
    --bad: #f07a6f;
    --bad-wash: #36201f;
    --good-wash: #16301f;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d151d; --surface: #16212c; --surface-2: #1b2834; --ink: #e8eef3; --ink-2: #a5b3bf; --ink-3: #8191a0;
  --line: #2a3a49; --line-2: #223140; --accent: #6d9bf0; --accent-ink: #0d151d; --accent-wash: #1d2f4a;
  --grid: #3987e5; --sun: #c98500; --batt: #199e70; --export: #9085e9; --house: #a5b3bf; --bar-idle: #3c4d5d;
  --good: #4cc27a; --warn: #e2b04a; --warn-wash: #2e2717; --bad: #f07a6f; --bad-wash: #36201f; --good-wash: #16301f;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-stretch: 100%;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; max-width: 68ch; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
h1 { font-stretch: 122%; font-weight: 800; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.04; letter-spacing: -0.015em; }
h2 { font-stretch: 115%; font-weight: 760; font-size: clamp(1.45rem, 2.6vw, 1.95rem); line-height: 1.12; letter-spacing: -0.01em; }
h3 { font-stretch: 104%; font-weight: 680; font-size: 1.08rem; line-height: 1.3; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ------------------------------------------------------------------ header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand b { font-stretch: 125%; font-weight: 820; font-size: 1.22rem; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--r-ctl); font-weight: 520; }
.top nav a:hover { color: var(--ink); background: var(--surface-2); }
.top nav a.on { color: var(--ink); background: var(--accent-wash); }
.top nav a.btn, .top nav a.btn:hover { color: var(--accent-ink); background: var(--accent); }
.top .lang { font-weight: 640; }
@media (max-width: 820px) { .top nav .opt { display: none; } }
@media (max-width: 600px) {
  .is-app .brand b { display: none; }
  .is-app .top nav { flex-wrap: nowrap; overflow-x: auto; }
  .top nav a { padding: 8px 8px; white-space: nowrap; }
}

/* ------------------------------------------------------------------ buttons & forms */
.btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 640; font-size: 0.98rem; line-height: 1; padding: 13px 18px; border-radius: var(--r-ctl);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { min-height: 34px; padding: 8px 12px; font-size: 0.9rem; }
.btn.link { background: none; border: none; color: var(--accent); padding: 4px 0; min-height: 0; font-weight: 560; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 600; font-size: 0.93rem; margin: 0 0 6px; }
.field { margin: 0 0 18px; }
.field .help { color: var(--ink-2); font-size: 0.86rem; margin-top: 6px; max-width: 60ch; }
.field .err { color: var(--bad); font-size: 0.86rem; margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=month], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-ctl); padding: 10px 12px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
input[type=number] { font-variant-numeric: tabular-nums; }
.unit { position: relative; }
.unit input { padding-right: 64px; }
.unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 0.9rem; pointer-events: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 450; margin: 0 0 14px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check .help { margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { appearance: none; border: 0; background: transparent; font: inherit; padding: 9px 14px; color: var(--ink-2); cursor: pointer; font-weight: 560; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--accent-wash); color: var(--ink); }

.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-panel);
  padding: 14px 16px; background: var(--surface); cursor: pointer; }
.choice:hover { border-color: var(--ink-3); }
.choice input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.choice.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice b { display: block; font-weight: 650; }
.choice span { color: var(--ink-2); font-size: 0.92rem; }

.note { border-left: 3px solid var(--line); padding: 10px 14px; background: var(--surface-2); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; margin: 0 0 16px; }
.note.warn { border-color: var(--warn); background: var(--warn-wash); }
.note.bad { border-color: var(--bad); background: var(--bad-wash); }
.note.good { border-color: var(--good); background: var(--good-wash); }
.note p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ landing */
.hero { padding: 64px 0 28px; }
.hero h1 { font-size: clamp(2.5rem, 6.4vw, 5.1rem); max-width: 15ch; font-stretch: 125%; line-height: 0.98; }
.hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 58ch; margin: 22px 0 28px; }
.strip { margin: 44px 0 0; padding: 22px 0 6px; border-top: 1px solid var(--line); }
.strip-head { display: flex; flex-wrap: wrap; gap: 6px 28px; align-items: baseline; justify-content: space-between; }
.strip-head h2 { font-size: 1.12rem; font-stretch: 108%; }
.strip-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.strip-stats div { min-width: 120px; }
.strip-stats b { display: block; font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.strip-stats span { color: var(--ink-2); font-size: 0.88rem; }
.strip svg { width: 100%; height: auto; margin-top: 16px; overflow: visible; }
.strip .legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-2); font-size: 0.88rem; margin-top: 10px; }
.key { display: inline-flex; align-items: center; gap: 7px; }
.key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.key i.line { height: 3px; border-radius: 2px; width: 16px; }
.strip-tabs { margin-top: 12px; }

.sec { padding: 72px 0; border-top: 1px solid var(--line); }
.sec > .wrap > h2 { margin-bottom: 28px; max-width: 26ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-top: 52px; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 0; width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 760; font-stretch: 115%; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 19px; left: 48px; right: -18px; height: 2px; background: var(--line); }
.steps p { color: var(--ink-2); margin-top: 6px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } .steps li::after { display: none; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 56px; }
.pairs > div { border-top: 3px solid var(--ink); padding-top: 16px; }
.pairs > div.grid-k { border-color: var(--grid); }
.pairs > div.sun-k { border-color: var(--sun); }
.pairs > div.batt-k { border-color: var(--batt); }
.pairs p { color: var(--ink-2); margin-top: 8px; }
@media (max-width: 760px) { .pairs { grid-template-columns: 1fr; } }

.value { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; }
.value .lead { font-size: 1.25rem; font-stretch: 105%; font-weight: 560; max-width: 30ch; }
.vtable { width: 100%; border-collapse: collapse; }
.vtable td { padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.vtable td:first-child { color: var(--ink-2); padding-right: 20px; width: 46%; }
.vtable td:last-child { font-weight: 620; }
@media (max-width: 860px) { .value { grid-template-columns: 1fr; gap: 20px; } }

.safety { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; }
.safety li { padding-left: 34px; position: relative; color: var(--ink-2); }
.safety li svg { position: absolute; left: 0; top: 2px; width: 22px; height: 22px; }
@media (max-width: 760px) { .safety { grid-template-columns: 1fr; } }

.inv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.inv > div { padding: 22px; }
.inv > div + div { border-left: 1px solid var(--line); }
.inv h3 { font-size: 1.35rem; font-stretch: 118%; font-weight: 780; }
.inv p { color: var(--ink-2); margin: 8px 0 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 620; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.badge.ok::before { background: var(--good); }
.badge.beta::before { background: var(--warn); }
.wait { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 4px; }
.wait > div:first-child { grid-column: 1 / -1; }
@media (max-width: 860px) { .inv { grid-template-columns: 1fr; } .inv > div + div { border-left: 0; border-top: 1px solid var(--line); } }

.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 640; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 500; color: var(--ink-3); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); margin: 10px 0 0; }

.cta-band { padding: 64px 0 80px; border-top: 1px solid var(--line); }
.cta-band h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-stretch: 122%; max-width: 20ch; }
.cta-band p { color: var(--ink-2); margin: 14px 0 24px; }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-2); font-size: 0.9rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.foot .wrap > :first-child { margin-right: auto; }
.foot a { color: var(--ink-2); }

/* ------------------------------------------------------------------ auth pages */
.auth { min-height: calc(100vh - 140px); display: grid; place-items: start center; padding: 56px 16px; }
.auth .box { width: 100%; max-width: 420px; }
.auth h1 { font-size: 2rem; margin-bottom: 10px; }
.auth .lead { color: var(--ink-2); margin-bottom: 24px; }
.auth form { margin-top: 18px; }
.auth .alt { margin-top: 18px; display: grid; gap: 6px; }
.prose { padding: 48px 0 72px; }
.prose h1 { margin-bottom: 18px; }
.prose h2 { font-size: 1.25rem; margin: 30px 0 10px; }
.prose li { max-width: 68ch; margin-bottom: 6px; }

/* ------------------------------------------------------------------ app */
.app-main { padding: 26px 0 64px; }
.app-head { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; margin-bottom: 18px; }
.app-head h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.app-head .spacer { flex: 1; }
.site-pick { min-width: 200px; max-width: 280px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px; }
.panel + .panel { margin-top: var(--gap); }
.panel > h2, .panel > header h2 { font-size: 1.15rem; font-stretch: 108%; }
.panel > header { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.layout > .side > .panel + .panel { margin-top: var(--gap); }
@media (max-width: 1040px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.statusline { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 16px; }
.statusline p { margin: 0; font-size: 1.05rem; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 0.9rem; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pill.live::before { background: var(--good); }
.pill.dry::before { background: var(--accent); }
.pill.paused::before { background: var(--warn); }
.pill.error::before { background: var(--bad); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); margin-bottom: var(--gap); }
.tile { padding: 16px 18px; }
.tile + .tile { border-left: 1px solid var(--line); }
.tile .lbl { color: var(--ink-2); font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.tile .lbl i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tile .val { font-size: 1.85rem; font-weight: 680; line-height: 1.15; margin-top: 4px; }
.tile .val small { font-size: 1rem; font-weight: 520; color: var(--ink-2); margin-left: 2px; }
.tile .sub { color: var(--ink-3); font-size: 0.84rem; }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); margin-top: 10px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--batt); border-radius: 3px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } .tile:nth-child(3) { border-left: 0; } .tile:nth-child(n+3) { border-top: 1px solid var(--line); } }

.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart-wrap .ax { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-wrap .ptitle { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: 0.86rem; margin-top: 10px; }
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); padding: 10px 12px; font-size: 0.86rem; min-width: 170px; }
.tip .t { color: var(--ink-2); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .r span:first-child { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.tip .r b { font-variant-numeric: tabular-nums; }
.tip .k { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.range-tabs { margin-bottom: 12px; }

.dialrow { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.dial svg { width: 100%; max-width: 240px; height: auto; }
.dial .hour { fill: var(--ink-3); font-size: 10px; }
.dial .centre { fill: var(--ink); font-weight: 700; }
@media (max-width: 640px) { .dialrow { grid-template-columns: 1fr; } .dial svg { margin: 0 auto; } }
.sched { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.sched td { padding: 9px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.sched td:first-child { white-space: nowrap; padding-right: 14px; font-variant-numeric: tabular-nums; color: var(--ink-2); width: 1%; }
.sched i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 8px; vertical-align: -1px; }

.kv { display: grid; grid-template-columns: auto auto; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-weight: 620; font-variant-numeric: tabular-nums; }
.big { font-size: 2.6rem; font-weight: 700; line-height: 1.05; }
.events { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.events li { padding: 8px 0; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 54px 1fr; gap: 10px; }
.events li time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.events li.warn span { color: var(--warn); }
.events li.error span { color: var(--bad); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button { appearance: none; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink-2); padding: 10px 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-color: var(--accent); }
.form-sec { max-width: 760px; }
.form-sec h3 { margin: 26px 0 12px; }
.form-sec h3:first-child { margin-top: 0; }
.savebar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.wins { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 0.93rem; }
.wins td, .wins th { padding: 8px 6px; border-bottom: 1px solid var(--line-2); text-align: left; }
.wins th { color: var(--ink-2); font-weight: 600; }

.wizard { max-width: 820px; }
.wizard > h1 { margin-bottom: 16px; }
.wizard h2 { margin: 4px 0 14px; }
.wsteps { display: flex; gap: 6px; list-style: none; margin: 0 0 26px; padding: 0; flex-wrap: wrap; }
.wsteps li { font-size: 0.86rem; color: var(--ink-3); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); }
.wsteps li.on { color: var(--ink); border-color: var(--accent); background: var(--accent-wash); font-weight: 620; }
.wsteps li.done { color: var(--ink-2); }
.brands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.brands button { appearance: none; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px; cursor: pointer; }
.brands button:hover { border-color: var(--ink-3); }
.brands button b { display: block; font-size: 1.3rem; font-stretch: 118%; font-weight: 780; margin-bottom: 4px; }
.brands button span { color: var(--ink-2); font-size: 0.9rem; }
@media (max-width: 700px) { .brands { grid-template-columns: 1fr; } }
ol.howto { padding-left: 22px; margin: 0 0 18px; }
ol.howto li { margin-bottom: 10px; max-width: 70ch; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.stations { display: grid; gap: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.table th { color: var(--ink-2); font-weight: 600; }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 8px;
  box-shadow: var(--shadow); font-weight: 560; z-index: 50; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
.banner { border-radius: var(--r-panel); padding: 14px 16px; margin-bottom: 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); background: var(--surface); }
.banner p { margin: 0; flex: 1 1 320px; }
.banner.warn { background: var(--warn-wash); border-color: transparent; }
.banner.bad { background: var(--bad-wash); border-color: transparent; }
.banner.info { background: var(--accent-wash); border-color: transparent; }
.empty { text-align: left; padding: 28px 0; }
.empty h2 { margin-bottom: 8px; }
dialog { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); color: var(--ink); padding: 24px; max-width: 520px; width: calc(100vw - 32px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 20, 30, 0.45); }
dialog h2 { margin-bottom: 10px; font-size: 1.3rem; }

@media (prefers-reduced-motion: no-preference) {
  .strip .bars rect { transform-origin: bottom; transform-box: fill-box; animation: rise 0.7s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}

/* legend / key swatches (no inline styles: CSP) */
.k-grid { background: var(--grid); }
.k-idle { background: var(--bar-idle); }
.k-sun { background: var(--sun); }
.k-batt { background: var(--batt); }
.k-batt-plan { background: var(--batt); opacity: .7; }
.k-export { background: var(--export); }
.k-house { background: var(--house); }
.k-hold { background: var(--ink-3); }
