/* R5 Solar: R5 Systems brand (tokens mirror r5systems.co.za css/styles.css). Volt only on dark; text on volt is ink. */
@font-face { font-family: 'Inter Variable'; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Manrope Variable'; src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --obsidian: #0E1012; --charcoal: #1A1D20; --coal2: #22262B; --coal3: #2A2F35;
  --volt: #CCFF00; --volt-dim: #9FCC00; --red: #FF2D2D; --slate: #8A95A5;
  --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #F0F2F5; --ink: #14171A; --ink-soft: #525E6C; --muted: #6B7685;
  --line: rgba(20,23,26,.08); --line-strong: rgba(20,23,26,.14); --focus: #5C7A00; --link: #4A6B00;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px;
  --shadow-soft: 0 1px 2px rgba(20,23,26,.04), 0 12px 32px -8px rgba(20,23,26,.10);
  --shadow-dark: 0 40px 80px -24px rgba(0,0,0,.55), 0 0 0 1px rgba(245,246,248,.06);
  --font-body: 'Inter Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Manrope Variable', var(--font-body);
  /* Chart series (validated: light surface) */
  --c-pv: #7FA300; --c-load: #3B6FD8; --c-grid: #E0782B; --c-batt: #8A3FC7;
  --good: #2E7D32; --warn: #B26A00; --bad: #C62828;
  --good-bg: rgba(46,125,50,.10); --warn-bg: rgba(178,106,0,.10); --bad-bg: rgba(198,40,40,.09);
  --side-w: 252px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1012; --surface: #1A1D20; --surface-2: #22262B; --ink: #F5F6F8; --ink-soft: #B4BCC8; --muted: #8A95A5;
    --line: rgba(245,246,248,.08); --line-strong: rgba(245,246,248,.16); --focus: #CCFF00; --link: #CCFF00;
    --shadow-soft: 0 0 0 1px rgba(245,246,248,.06);
    /* Chart series (validated: charcoal surface) */
    --c-pv: #7A9F00; --c-load: #5B8DEF; --c-grid: #D2702F; --c-batt: #A56BDD;
    --good: #66BB6A; --warn: #FFB74D; --bad: #FF6B6B;
    --good-bg: rgba(102,187,106,.12); --warn-bg: rgba(255,183,77,.12); --bad-bg: rgba(255,107,107,.12);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; margin: 0; }
h2 { font-size: 1.05rem; font-weight: 700; }
a { color: var(--link); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }
.lede { color: var(--ink-soft); margin: 4px 0 0; font-size: .9rem; max-width: 70ch; }
.right { text-align: right; }
code.small { font-size: .75rem; color: var(--ink-soft); word-break: break-all; }

/* ---------- shell: dark sidebar + light main ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: none; background: var(--obsidian); color: #F5F6F8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #F5F6F8; padding: 2px 8px 18px; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--coal2); display: grid; place-items: center; flex: none; }
.mark i { width: 12px; height: 12px; border-radius: 4px; background: var(--volt); box-shadow: 6px 6px 0 -2px rgba(204,255,0,.35); }
.brand b { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand span { color: #8A95A5; font-weight: 500; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a, .side summary { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: #B4BCC8; text-decoration: none; font-weight: 500; font-size: .92rem; cursor: pointer; list-style: none; position: relative; }
.side summary::-webkit-details-marker { display: none; }
.side summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 1.6px solid #8A95A5; border-bottom: 1.6px solid #8A95A5; transform: rotate(-45deg); transition: transform .15s; }
.side details[open] > summary::after { transform: rotate(45deg); }
.side nav a:hover, .side summary:hover { background: var(--charcoal); color: #F5F6F8; }
.side nav a.child { padding-left: 42px; font-size: .88rem; }
.side nav a.active { background: var(--charcoal); color: #F5F6F8; }
.side nav a.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--volt); }
.side nav a.active .ico { stroke: var(--volt); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { border-top: 1px solid rgba(245,246,248,.08); padding: 14px 8px 2px; display: flex; flex-direction: column; gap: 10px; }
.who b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { color: #8A95A5; font-size: .78rem; }
.main { flex: 1; min-width: 0; padding: 0 24px 48px; }
.page { outline: none; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 0 16px; }
.page-title { font-size: 1.35rem; font-weight: 800; }
.top .spacer { flex: 1; }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; margin: 0 auto; }
.menu-btn span::before, .menu-btn span::after { content: ''; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; } .menu-btn span::after { top: 6px; }
.scrim { display: none; }
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-dark); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(14,16,18,.5); z-index: 25; }
  .menu-btn { display: block; }
  .main { padding: 0 16px 40px; }
}

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface); box-shadow: var(--shadow-soft); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.live .dot { background: var(--good); } .pill.stale .dot { background: var(--warn); } .pill.offline .dot { background: var(--bad); }

/* ---------- buttons, badges, callouts ---------- */
.btn { border-radius: 999px; padding: 8px 16px; font-size: .88rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: .9; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink-soft); }
.btn.on-dark { color: #F5F6F8; border-color: rgba(245,246,248,.18); }
.btn:disabled { opacity: .4; cursor: default; }
.danger-text { color: var(--bad) !important; }
.badge { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; vertical-align: 1px; background: var(--surface-2); color: var(--ink-soft); }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.ok { background: var(--good-bg); color: var(--good); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge[hidden] { display: none; }
.callout { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-soft), inset 4px 0 0 var(--slate); padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; }
.callout.warn { box-shadow: var(--shadow-soft), inset 4px 0 0 var(--warn); }
.callout.bad { box-shadow: var(--shadow-soft), inset 4px 0 0 var(--bad); }
.callout.good { box-shadow: var(--shadow-soft), inset 4px 0 0 var(--good); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- grid & cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.card { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-soft); padding: 20px; min-width: 0; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
@media (max-width: 1100px) { .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } .span-3 { grid-column: span 6; } }
@media (max-width: 560px) { .span-3 { grid-column: span 12; } }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; margin-bottom: 14px; }
.actions { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sub-h { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 20px 0 6px; font-family: var(--font-body); }
.sub-h:first-of-type { margin-top: 4px; }

/* ---------- battery charging control ---------- */
/* battery charging card: three facts, mode tiles */
.cg-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.cg-facts div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.cg-facts span { display: block; font-size: .72rem; color: var(--muted); }
.cg-facts b { display: block; font: 700 1rem var(--font-display); }
.cg-facts small { display: block; color: var(--ink-soft); font-size: .78rem; }
.charge-card .cg-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.charge-card .cg-modes button { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: inherit; cursor: pointer; }
.charge-card .cg-modes button b { font-size: .9rem; }
.charge-card .cg-modes button small { grid-column: 2; color: var(--muted); font-size: .74rem; }
.charge-card .cg-modes .cg-ico { grid-row: span 2; width: 22px; height: 22px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cg-ico.sun { stroke: var(--c-pv); } .cg-ico.night { stroke: var(--c-batt); } .cg-ico.boost { stroke: var(--c-grid); }
.charge-card .cg-modes button[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); }
.charge-card .cg-modes button:disabled { cursor: default; opacity: .6; }
@media (max-width: 640px) { .cg-facts, .charge-card .cg-modes { grid-template-columns: 1fr; } }
.cg-desc { color: var(--ink-soft); font-size: .85rem; margin: 12px 0 10px; min-height: 3.6em; }
.cg-target { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: .85rem; color: var(--ink-soft); }
.cg-target input { accent-color: var(--ink); min-height: 0; padding: 0; border: 0; background: none; }
@media (prefers-color-scheme: dark) { .cg-target input { accent-color: var(--volt); } }
.cg-target b { color: var(--ink); min-width: 3em; text-align: right; }
.cg-est { font-size: .85rem; color: var(--ink-soft); margin-top: 10px; min-height: 1.3em; }
.cg-est b { color: var(--ink); }
.cg-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.cg-foot .fine { margin: 0; }

/* ---------- weather icons (the strip at the top of the Home card) ---------- */
.wx { width: 40px; height: 40px; flex: none; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wx * { vector-effect: non-scaling-stroke; }
.wx-sun { stroke: #FFCF5A; } .wx-moon { stroke: #D7DEE8; } .wx-cloud { stroke: #C3CAD4; } .wx-drop { stroke: #6FA0F5; } .wx-bolt { stroke: #FFCF5A; }

/* ---------- month calendar (History) ---------- */
.cal-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .85rem; color: var(--ink-soft); margin: -4px 0 12px; }
.cal-sum b { color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: .72rem; color: var(--muted); text-align: center; }
.cal-day { position: relative; min-height: 76px; border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.cal-day .d { font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.cal-day b { font: 700 1.05rem var(--font-display); }
.cal-day small { font-size: .72rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day.none { box-shadow: inset 0 0 0 1px var(--line); }
.cal-day.future { opacity: .35; box-shadow: inset 0 0 0 1px var(--line); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-day.free::after { content: '★'; position: absolute; top: 6px; right: 9px; font-size: .75rem; color: var(--c-pv); }
.cal-scale { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.cal-scale i { display: block; width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2), color-mix(in srgb, var(--c-pv) 60%, var(--surface-2))); }
@media (max-width: 640px) { .cal-day { min-height: 52px; padding: 6px; } .cal-day small { display: none; } .cal-day b { font-size: .85rem; } }

/* ---------- work mode, plain words ---------- */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); }
.choice:has(input:disabled) { cursor: default; }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input { flex: none; width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; padding: 0; border: 0; background: none; accent-color: var(--ink); }
@media (prefers-color-scheme: dark) { .choice input { accent-color: var(--volt); } }
.choice-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.choice-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.choice-title b { font-size: 1rem; }
.choice-text { color: var(--ink-soft); font-size: .9rem; }
.choice small { color: var(--muted); font-size: .75rem; }
.choice-note { color: var(--ink-soft); font-size: .9rem; margin: 0 0 8px; }
.now-flows { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.now-flows div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.now-flows span { display: block; font-size: .75rem; color: var(--muted); }
.now-flows b { font: 700 1.05rem var(--font-display); }

/* ---------- battery page ---------- */
.bh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.bh-stat { background: var(--surface-2); border-radius: 14px; padding: 14px; min-width: 0; }
.bh-stat .big { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.15; margin: 4px 0 2px; }
.bh-stat .big small { font-size: .9rem; font-weight: 600; color: var(--ink-soft); margin-left: 2px; }
.bh-stat .note { color: var(--ink-soft); font-size: .8rem; }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 420px) { .cells { grid-template-columns: repeat(2, 1fr); } }
.cell { position: relative; border-radius: 12px; padding: 10px 8px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.cell .i { display: block; font-size: .7rem; color: var(--muted); }
.cell b { display: block; font: 700 1rem var(--font-display); font-variant-numeric: tabular-nums; margin: 2px 0; }
.cell .d { font-size: .72rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cell .tag { position: absolute; top: 5px; right: 7px; font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.cell.hi, .cell.lo { box-shadow: inset 0 0 0 1.5px var(--ink-soft); }
.temps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.temps div { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; text-align: center; min-width: 74px; }
.temps span { display: block; font-size: .7rem; color: var(--muted); }
.temps b { font: 700 1rem var(--font-display); }
.spark { width: 100%; height: 90px; display: block; }
.spark-line { fill: none; stroke: var(--c-batt); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.spark-meta b { color: var(--ink); }
.empty.small { padding: 20px 0; }

/* ---------- home showpiece (always dark; series colours from the dark-validated palette) ---------- */
.homecard {
  --c-pv: #7A9F00; --c-load: #5B8DEF; --c-grid: #D2702F; --c-batt: #A56BDD;
  grid-column: span 12; position: relative; overflow: hidden; border-radius: var(--r-lg); box-shadow: var(--shadow-dark);
  background: radial-gradient(120% 140% at 30% 110%, #1A1D20 0%, #0E1012 55%), #0E1012; color: #F5F6F8;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(200px, 260px); gap: 8px 28px; align-items: center; padding: 22px 26px;
}
/* The card's sky follows the sun (sky.ts sets the phase): night, dawn and dusk, day. */
.homecard.night { background: linear-gradient(180deg, #0A0D19 0%, #0E1012 60%), #0E1012; }
.homecard.dawn, .homecard.dusk { background: linear-gradient(180deg, #2A2142 0%, #2E2330 28%, #0E1012 68%), #0E1012; }
.homecard.day { background: linear-gradient(180deg, #17324C 0%, #13202E 34%, #0E1012 72%), #0E1012; }
.home-sky { grid-column: 1 / -1; position: relative; z-index: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px 26px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid rgba(245, 246, 248, .07); }
.home-sky > div + div { border-left: 1px solid rgba(245, 246, 248, .07); padding-left: 24px; }
.hs-clock b { display: block; font: 800 clamp(2.2rem, 4vw, 3rem)/1 var(--font-display); letter-spacing: -.02em; }
.hs-clock span { color: #B4BCC8; font-size: .85rem; }
.hs-wx { display: flex; align-items: center; gap: 10px; }
.hs-wx b { display: block; font: 800 1.7rem/1 var(--font-display); }
.hs-wx span { color: #B4BCC8; font-size: .85rem; }
.hs-facts { display: flex; flex-wrap: wrap; gap: 2px 10px; color: #B4BCC8; font-size: .78rem; margin-top: 6px; }
.hs-facts b { color: #F5F6F8; }
.hs-spark { display: block; width: 100%; height: 46px; margin: 6px 0 0; }
.hs-spark .base { stroke: rgba(245, 246, 248, .15); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hs-spark .made { fill: rgba(204, 255, 0, .22); stroke: #CCFF00; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.hs-spark .fc { fill: none; stroke: rgba(204, 255, 0, .6); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.hs-kwh { color: #B4BCC8; font-size: .85rem; margin-top: 4px; }
.hs-kwh b { color: #CCFF00; font: 800 1.25rem var(--font-display); margin-right: 4px; }
.hs-msg { grid-column: 2 / -1; color: #B4BCC8; font-size: .9rem; }
@media (max-width: 1100px) { .home-sky { grid-template-columns: 1fr 1fr; } .home-sky > div:nth-child(odd) { border-left: 0; padding-left: 0; } }
@media (max-width: 640px) { .home-sky { grid-template-columns: 1fr; } .home-sky > div + div { border-left: 0; padding-left: 0; } }
.homecard::before { content: ''; position: absolute; inset: auto auto -40% -10%; width: 60%; height: 90%; background: radial-gradient(closest-side, rgba(204,255,0,.10), transparent 70%); pointer-events: none; }
@media (max-width: 1100px) { .homecard { grid-template-columns: 1fr 1fr; } .home-scene { grid-column: span 2; } }
@media (max-width: 640px) { .homecard { grid-template-columns: 1fr; padding: 18px; } .home-scene { grid-column: auto; } }
.homecard .eyebrow { color: #8A95A5; }
.scene { width: 100%; height: auto; max-height: 480px; display: block; }
.scene .ground { stroke: rgba(245,246,248,.10); stroke-width: 1.5; }
.scene .pylon { fill: none; stroke: #6B7685; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scene .wire { fill: none; stroke: rgba(245,246,248,.10); stroke-width: 2; stroke-linecap: round; }
.scene .wire.on.grid { stroke: rgba(210,112,47,.45); }
.scene .wire.on.batt { stroke: rgba(165,107,221,.5); }
.scene .house { fill: #1A1D20; stroke: rgba(245,246,248,.16); stroke-width: 1.5; }
.scene .roof { fill: #22262B; stroke: rgba(245,246,248,.18); stroke-width: 1.5; stroke-linejoin: round; }
.scene .chimney { fill: #22262B; stroke: rgba(245,246,248,.14); }
.scene .panel { fill: #0E1012; stroke: rgba(204,255,0,.35); stroke-width: 1; }
.scene .panel-line { fill: none; stroke: rgba(204,255,0,.22); stroke-width: .8; }
.scene .panel-lit { fill: #CCFF00; }
.scene .glint, .scene .cone, .scene .flash { mix-blend-mode: screen; }
/* smart switches: the geyser in the roof space, the pool in the garden */
.scene .geyser .tank { fill: #16191C; stroke: rgba(245,246,248,.3); stroke-width: 1.2; }
.scene .geyser .pipe { fill: none; stroke: rgba(245,246,248,.26); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.scene .geyser.on .tank { stroke: rgba(255,138,92,.75); }
.scene .geyser .element { fill: #FF6B3D; }
.scene .heatline { fill: none; stroke: rgba(255,168,120,.75); stroke-width: 1.2; stroke-linecap: round; animation: heat-rise 1.7s ease-out infinite; }
@keyframes heat-rise { from { transform: translateY(2px); opacity: 0; } 35% { opacity: .9; } to { transform: translateY(-7px); opacity: 0; } }
.scene .pool .rim { fill: #22262B; stroke: rgba(245,246,248,.22); stroke-width: 1.2; }
.scene .pool .water { fill: url(#waterg); opacity: .4; transition: opacity .8s ease; }
.scene .pool.on .water { opacity: .95; }
.scene .ripple { fill: none; stroke: rgba(225,243,255,.6); stroke-width: 1; stroke-linecap: round; animation: ripple-drift 2.6s ease-in-out infinite alternate; }
@keyframes ripple-drift { from { transform: translateX(-6px); opacity: .3; } to { transform: translateX(6px); opacity: .85; } }
.scene .offline { opacity: .45; }
.scene .l-cap { fill: #8A95A5; font: 600 10px var(--font-body); }
.scene .l-val { fill: #F5F6F8; font: 700 11px var(--font-display); }
.scene .l-val.off { fill: #8A95A5; }
@media (prefers-reduced-motion: reduce) { .scene .heatline, .scene .ripple { animation: none; } }
.scene .flash { fill: #FFF3CC; }
.scene .corona path { fill: none; stroke: #FFD27A; stroke-width: 1.5; stroke-linecap: round; }
.scene.overcast .beams { opacity: .45; }
.scene .win rect, .scene #h-glow rect { fill: #CCFF00; }
.scene #h-glow { mix-blend-mode: screen; }
.scene .win { transition: opacity .8s ease; }
.scene .pane { stroke: #1A1D20; stroke-width: 2.2; }
.scene .door { fill: #2A2F35; stroke: rgba(245,246,248,.14); }
.scene .knob { fill: #8A95A5; }
.scene .batt { fill: rgba(14,16,18,.6); stroke: rgba(245,246,248,.22); stroke-width: 1.6; }
.scene .batt-term { fill: rgba(245,246,248,.22); }
.scene #b-fill { transition: height .8s ease, y .8s ease; }
.scene .sun circle { fill: rgba(204,255,0,.25); } .scene .sun path { stroke: rgba(204,255,0,.25); stroke-width: 2; stroke-linecap: round; }
.scene .sun.on circle { fill: #CCFF00; } .scene .sun.on path { stroke: #CCFF00; }
.scene .moon { fill: #B4BCC8; }
.scene .stars circle { fill: #8A95A5; }
/* the real sky: the sun's arc, the sun, clouds and what falls from them */
.scene .sky-arc { fill: none; stroke: rgba(245, 246, 248, .13); stroke-width: 1.2; stroke-dasharray: 2 6; }
.scene .sky-arc-done { fill: none; stroke: rgba(255, 207, 90, .5); stroke-width: 2; stroke-linecap: round; }
.scene .sky-sun .disc { fill: #FFD27A; }
.scene .sky-sun .halo { fill: #FFB020; opacity: .5; }
.scene.overcast .sky-sun { opacity: .55; }
.scene .cloud ellipse, .scene .cloud circle:not(.flake) { fill: rgba(200, 208, 220, .45); }
.homecard.night .scene .cloud ellipse, .homecard.night .scene .cloud circle:not(.flake) { fill: rgba(120, 130, 150, .4); }
.scene .cloud { animation: cloud-drift 18s ease-in-out infinite alternate; }
.scene .cloud.c1 { animation-duration: 25s; animation-direction: alternate-reverse; }
@keyframes cloud-drift { from { transform: translateX(-7px); } to { transform: translateX(9px); } }
.scene .drop { stroke: #6FA0F5; stroke-width: 1.6; stroke-linecap: round; animation: drop-fall .9s linear infinite; }
@keyframes drop-fall { from { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(26px); opacity: 0; } }
.scene .flake { fill: #E6ECF3; animation: flake-fall 3s linear infinite; }
@keyframes flake-fall { from { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(30px); opacity: 0; } }
.scene .bolt { fill: none; stroke: #FFCF5A; stroke-width: 2; stroke-linejoin: round; animation: bolt-flash 4s steps(1) infinite; }
@keyframes bolt-flash { 0%, 100% { opacity: 0; } 2%, 6% { opacity: 1; } 4% { opacity: .2; } }
.scene .fog rect { fill: rgba(200, 208, 220, .1); }
@media (prefers-reduced-motion: reduce) { .scene .cloud, .scene .drop, .scene .flake, .scene .bolt { animation: none; } .scene .bolt { opacity: .8; } }
/* the 3D house (house3d/view.ts): a canvas over the card's sky, with labels that follow points in the scene */
.house3d { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; }
.h3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.h3d-canvas:active { cursor: grabbing; }
.h3d-label { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap;
  font: 600 11px var(--font-body); color: #F5F6F8; background: rgba(14, 16, 18, .74); border: 1px solid rgba(245, 246, 248, .14);
  padding: 3px 9px; border-radius: 999px; }
.h3d-label b { font: 700 11.5px var(--font-display); }
.h3d-label .off { color: #8A95A5; }
.h3d-label.north { background: none; border: 0; transform: translate(-50%, -50%); color: rgba(245, 246, 248, .55); font: 800 13px var(--font-display); }
.h3d-label.hint { translate: none !important; left: 50%; top: auto; bottom: 10px; transform: translateX(-50%); color: #B4BCC8; transition: opacity .6s; }
.h3d-label.hint.gone { opacity: 0; }
.h3d-sun { position: absolute; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none; transition: opacity .8s; }
.h3d-sun svg { display: block; overflow: visible; }
.h3d-sun .halo { transform-box: fill-box; transform-origin: center; animation: h3d-breathe 5s ease-in-out infinite; }
.h3d-sun .corona { opacity: .75; transform-box: fill-box; transform-origin: center; animation: h3d-spin 80s linear infinite; }
.h3d-sun .corona path { fill: none; stroke: #FFD27A; stroke-width: 1.5; stroke-linecap: round; }
.h3d-sun .disc { fill: #FFD27A; }
.h3d-sun.low .disc { fill: #FFB36B; } .h3d-sun.low .corona path { stroke: #FFB36B; }
@keyframes h3d-breathe { 50% { transform: scale(1.15); } }
@keyframes h3d-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .h3d-sun .halo, .h3d-sun .corona { animation: none; } }
.h3d-cap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; text-align: center; }
.h3d-cap span { display: block; color: #8A95A5; font: 600 10.5px var(--font-body); }
.h3d-cap b { display: block; color: #F5F6F8; font: 700 13px var(--font-display); }
.scene-mode { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; background: rgba(14, 16, 18, .6); border: 1px solid rgba(245, 246, 248, .12); border-radius: 999px; padding: 2px; }
.scene-mode button { border: 0; background: none; color: #B4BCC8; font: 600 11px var(--font-body); padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.scene-mode button.on { background: rgba(204, 255, 0, .16); color: #CCFF00; }
.home-scene { position: relative; }
.scene .s-cap { fill: #8A95A5; font: 600 10.5px var(--font-body); }
.scene .s-val { fill: #F5F6F8; font: 700 13px var(--font-display); }
.home-stats { position: relative; min-width: 0; }
.home-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 7vw, 4.6rem); line-height: 1; letter-spacing: -.03em; margin: 8px 0 6px; }
.home-big small { font-size: .32em; font-weight: 700; color: #CCFF00; margin-left: 6px; letter-spacing: 0; }
.home-sub { color: #B4BCC8; font-size: .92rem; }
.home-sub b { color: #F5F6F8; }
.mix { margin-top: 18px; }
.mix-bar { display: flex; gap: 2px; height: 12px; margin: 8px 0; border-radius: 999px; overflow: hidden; background: rgba(245,246,248,.06); }
.mix-bar i { display: block; height: 100%; transition: flex .8s ease; }
.mix-bar i.none { flex: 1; background: transparent; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .84rem; color: #B4BCC8; }
.mix-legend b { color: #F5F6F8; margin-left: 4px; }
.runtime { margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: rgba(245,246,248,.05); box-shadow: inset 3px 0 0 #A56BDD; font-size: .86rem; color: #B4BCC8; }
.runtime b { color: #F5F6F8; }
.runtime:empty { display: none; }
.home-ring { position: relative; justify-self: center; width: 100%; max-width: 260px; }
.ring { width: 100%; height: auto; display: block; }
.ring .track { fill: rgba(245,246,248,.05); }
.ring .hr.now .track { fill: rgba(204,255,0,.10); stroke: rgba(204,255,0,.55); stroke-width: 1; }
.ring .hr:hover .track { fill: rgba(245,246,248,.12); }
.ring text { fill: #8A95A5; font: 600 9px var(--font-body); }
.ring .ring-big { fill: #F5F6F8; font: 800 30px var(--font-display); }
.ring .ring-sub { fill: #8A95A5; font: 600 10px var(--font-body); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- tiles & key/values ---------- */
.tile .big { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 2px; }
.tile .big small { font-size: .95rem; font-weight: 600; color: var(--ink-soft); margin-left: 2px; }
.tile .note, .ratio .note { color: var(--ink-soft); font-size: .85rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.meter { height: 8px; border-radius: 999px; background: var(--line-strong); overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--c-batt); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; margin: 0; }
.kv dt { color: var(--ink-soft); } .kv dd { margin: 0; font-weight: 700; text-align: right; }
.ratio { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ratio .big { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.facts div { border-left: 2px solid var(--line-strong); padding-left: 10px; min-width: 0; }
.facts b { display: block; font-size: 1rem; overflow-wrap: anywhere; }
.facts span { color: var(--muted); font-size: .78rem; }

/* ---------- charts ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--ink-soft); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; }
.daynav { display: inline-flex; align-items: center; gap: 6px; }
.daynav button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.daynav button:disabled { opacity: .35; cursor: default; }
.daynav b { min-width: 9.5em; text-align: center; font-weight: 600; font-size: .9rem; }
.chart { width: 100%; min-height: 280px; position: relative; }
.uplot, .uplot * { font-family: var(--font-body); }
.tip { position: absolute; pointer-events: none; z-index: 50; background: var(--surface); color: var(--ink); border-radius: var(--r-sm); box-shadow: var(--shadow-soft), 0 0 0 1px var(--line-strong); padding: 8px 10px; font-size: .8rem; line-height: 1.55; white-space: nowrap; display: none; }
.tip b { display: block; margin-bottom: 2px; }
.bars { width: 100%; height: 240px; display: block; }
.bars .grid-line { stroke: var(--line); }
.bars text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.bars rect.hit { fill: transparent; }
.bars g.day:hover rect.hit { fill: var(--line); }
.empty { color: var(--muted); font-size: .9rem; padding: 40px 0; text-align: center; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--ink-soft); padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
details.table { margin-top: 12px; }
details.table summary { cursor: pointer; color: var(--link); font-size: .85rem; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
details.table table { margin-top: 10px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
details.table td, details.table th { text-align: right; } details.table td:first-child, details.table th:first-child { text-align: left; }
table.tou td { vertical-align: middle; }
table.tou input[type=number] { width: 7.5em; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; min-height: 40px; max-width: 100%; }
textarea { width: 100%; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(92,122,0,.18); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-soft); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.modal .field { margin-bottom: 12px; } .modal .field input, .modal .field select { width: 100%; }
.settings { display: flex; flex-direction: column; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-of-type { border-bottom: 0; }
.setting p { margin: 2px 0 0; color: var(--ink-soft); font-size: .83rem; }
.setting > div:last-child { display: flex; justify-content: flex-end; }
.setting > div:last-child > input:not([type=checkbox]), .setting > div:last-child > select, .setting > div:last-child > textarea { width: 100%; }
.setting.inline { display: inline-flex; grid-template-columns: none; gap: 10px; border: 0; padding: 0; }
.settings.compact .setting { padding: 6px 0; }
@media (max-width: 640px) { .setting { grid-template-columns: 1fr; } .setting > div:last-child { justify-content: flex-start; } }
.sw-head { font: 700 1rem var(--font-display); margin: 22px 0 2px; }
.sw-head:first-child { margin-top: 4px; }
.unit-input { display: inline-flex; align-items: center; gap: 6px; }
.unit-input input { width: 8em; text-align: right; }
.unit-input em { font-style: normal; color: var(--muted); font-size: .85rem; min-width: 1.5em; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .15s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(18px); }
@media (prefers-color-scheme: dark) {
  /* On dark, "on" is volt with an ink knob (volt only on dark; ink on volt). */
  .switch input:checked + i { background: var(--volt); }
  .switch input:checked + i::after { background: #14171A; }
}
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + i { opacity: .5; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip input:disabled + span { opacity: .6; }
/* battery schedule: 24-hour bar */
.sched { display: flex; gap: 2px; height: 44px; margin-top: 4px; border-radius: 12px; overflow: hidden; }
.sched div { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 0 10px; font-size: .82rem; white-space: nowrap; }
.sched b { overflow: hidden; text-overflow: ellipsis; }
.sched .batt { background: color-mix(in srgb, var(--c-batt) 32%, var(--surface-2)); }
.sched .eskom { background: color-mix(in srgb, var(--c-grid) 38%, var(--surface-2)); }
.sched .off { background: var(--surface-2); color: var(--muted); }
.sched-ticks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin: 4px 2px 12px; }
details.sched-edit { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
details.sched-edit > summary { cursor: pointer; font-weight: 600; color: var(--link); }
details.sched-edit[open] > summary { margin-bottom: 12px; }
.days-lbl { font-size: .85rem; }
.path { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; }
.path div { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.path div b { font-size: .88rem; } .path div span { font-size: .75rem; color: var(--muted); }
.path i { width: 18px; height: 2px; background: var(--line-strong); }
.secret { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.secret code { font-size: 1.05rem; flex: 1; word-break: break-all; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(14,16,18,.55); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-dark); width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; }
.modal.wide { width: min(720px, 100%); }
.modal h2 { font-size: 1.2rem; margin-bottom: 12px; }
.modal p { color: var(--ink-soft); margin: 0 0 12px; }
.modal table { margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-err { color: var(--bad); min-height: 0; margin: 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--obsidian); color: #F5F6F8; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-dark); z-index: 70; font-size: .9rem; max-width: min(560px, calc(100% - 32px)); transition: opacity .4s, transform .4s; }
.toast.err { box-shadow: var(--shadow-dark), inset 4px 0 0 var(--red); }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--obsidian); padding: 16px; position: relative; overflow: hidden; }
.login::before { content: ''; position: absolute; width: 640px; height: 640px; right: -180px; top: -220px; background: radial-gradient(closest-side, rgba(204,255,0,.16), transparent 70%); }
.login form { position: relative; width: min(400px, 100%); background: rgba(26,29,32,.86); backdrop-filter: blur(18px); border-radius: var(--r-lg); padding: 30px; box-shadow: var(--shadow-dark); color: #F5F6F8; }
.login .mark { margin-bottom: 18px; }
.login h1 { font-size: 1.6rem; font-weight: 800; }
.login p { color: #B4BCC8; margin: 6px 0 22px; }
.login label { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #8A95A5; margin: 14px 0 6px; }
.login input { width: 100%; height: 48px; border-radius: 12px; border: 1px solid rgba(245,246,248,.12); background: rgba(14,16,18,.6); color: #F5F6F8; padding: 0 14px; font: inherit; }
.login input:focus { outline: none; border-color: var(--volt); box-shadow: 0 0 0 3px rgba(204,255,0,.18); }
.login .volt { width: 100%; height: 48px; margin-top: 22px; border: 0; border-radius: 999px; background: var(--volt); color: #14171A; font-weight: 700; transition: transform .15s, box-shadow .15s; }
.login .volt:hover { transform: translateY(-1px); box-shadow: 0 18px 36px -12px rgba(140,180,0,.7); }
.login .err { color: #FF8A8A; min-height: 1.4em; margin: 12px 0 0; font-size: .88rem; }

/* smart switches on the Home card (home.ts paintLoads): their state, and On / Off for admins. The card is always dark. */
.btn.small { padding: 5px 12px; font-size: .8rem; }
.loads { margin-top: 16px; }
.loads:empty { display: none; }
.load-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(245,246,248,.07); }
.load-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: rgba(245,246,248,.22); }
.load-dot.on { background: #CCFF00; box-shadow: 0 0 0 3px rgba(204,255,0,.16); }
.load-dot.gone { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(245,246,248,.3); }
.load-text { flex: 1; min-width: 0; color: #B4BCC8; font-size: .86rem; line-height: 1.35; }
.load-text b { color: #F5F6F8; font-weight: 600; margin-right: 3px; }
.loads .btn { color: #F5F6F8; background: rgba(14,16,18,.35); border-color: rgba(245,246,248,.2); }
.loads .btn:hover { border-color: rgba(245,246,248,.5); }
.loads .btn:disabled { opacity: .5; }
.load-link { display: inline-block; color: #CCFF00; }
.run-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.run-choices .choice { padding: 10px 12px; align-items: center; gap: 8px; }
/* schedules (System → Smart switches) */
.plan-list { display: grid; gap: 8px; margin: 6px 0 4px; }
.plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.plan-row .days { display: flex; gap: 4px; }
.plan-row .day { position: relative; }
.plan-row .day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plan-row .day span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: .74rem; font-weight: 700; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; }
.plan-row .day input:checked + span { background: var(--volt); color: #14171A; box-shadow: none; }
.plan-row .day input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.plan-row .times { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.plan-row .times input { width: auto; }
.plan-row [hidden] { display: none; }
.plan-row [data-del] { margin-left: auto; }
.plan-add { margin: 4px 0 18px; }
