:root {
  --bg: #f4f6fa; --card: #ffffff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --go: #16a34a; --go-ink: #ffffff; --stop: #dc2626; --accent: #2563eb; --night: #6d28d9;
  --chip: #eef2f7; --chip-on: #0f172a; --chip-on-ink: #ffffff; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --card: #131c2e; --ink: #e5e9f0; --muted: #8a97ad; --line: #22304a;
    --go: #22c55e; --go-ink: #052e12; --stop: #ef4444; --accent: #60a5fa; --night: #a78bfa;
    --chip: #1c2740; --chip-on: #e5e9f0; --chip-on-ink: #0b1120; --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) 0 calc(76px + env(safe-area-inset-bottom)); }
main { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.top { max-width: 560px; margin: 0 auto; padding: 18px 16px 8px; display: flex; justify-content: space-between; align-items: flex-end; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 2px 0 0; font-size: 26px; }
h2 { font-size: 18px; margin: 20px 0 10px; }
.net { font-size: 12px; background: #f59e0b; color: #1f1300; padding: 4px 10px; border-radius: 99px; }
.card { background: var(--card); border-radius: 16px; padding: 16px; margin: 12px 0; box-shadow: var(--shadow); border: 1px solid var(--line); }
.sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.label { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.meter + .meter { margin-top: 14px; }
.meter-head { display: flex; align-items: baseline; gap: 8px; }
.meter-head span:first-child { width: 48px; color: var(--muted); font-size: 14px; }
.meter-head b { font-size: 28px; font-variant-numeric: tabular-nums; }
.of { color: var(--muted); }
.bar { height: 10px; background: var(--chip); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s; }
.bar.night i { background: var(--night); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chips button { border: 0; background: var(--chip); color: var(--ink); padding: 10px 16px; border-radius: 99px; font: inherit; }
.chips.small button { padding: 8px 12px; font-size: 14px; }
.chips button.on { background: var(--chip-on); color: var(--chip-on-ink); }
button { cursor: pointer; }
.big { width: 100%; border: 0; border-radius: 14px; padding: 20px; font-family: inherit; font-size: 20px; font-weight: 600; line-height: 1; }
.go { background: var(--go); color: var(--go-ink); }
.stop { background: var(--stop); color: #fff; }
.link { background: none; border: 0; color: var(--accent); font: inherit; padding: 12px 0 0; width: 100%; }
.danger { color: var(--stop); }
.running { text-align: center; border-color: var(--go); }
.clock { font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0; }
.sun { text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.pill { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 16px; border-radius: 99px; font: inherit; }
.pill.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.ghost { background: none; }
.drive { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.drive:last-child { border-bottom: 0; }
.drive .when { font-weight: 600; }
.drive .mins { text-align: right; font-variant-numeric: tabular-nums; }
.drive .meta { color: var(--muted); font-size: 13px; grid-column: 1 / -1; }
.drive .n { color: var(--night); }
.drive svg { grid-column: 1 / -1; width: 100%; height: 70px; margin-top: 6px; }
.drive svg polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.checks div { padding: 6px 0; display: flex; gap: 10px; }
.checks .ok::before { content: "\2713"; color: var(--go); font-weight: 700; }
.checks .no::before { content: "\25CB"; color: var(--muted); }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
input, select { display: block; width: 100%; margin-top: 4px; font-family: inherit; font-size: 16px; padding: 11px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabs button { flex: 1; max-width: 180px; background: none; border: 0; color: var(--muted); font-family: inherit; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; }
.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--accent); }
.sheet { position: fixed; inset: 0; background: rgba(2,6,23,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-body { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet-body h2 { margin-top: 0; }
.sheet-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.sheet-actions span { flex: 1; }
.sheet-actions .link { width: auto; padding: 0; }
.split { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.split a { color: var(--accent); margin-left: 6px; }
.err { color: var(--stop); font-size: 14px; min-height: 1em; }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 20; max-width: 90vw; }
[hidden] { display: none !important; }
button.drive { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.drive:last-child { border-bottom: 0; }
.fine { font-size: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.center { text-align: center; }
#restore { margin-top: 10px; }
.demo-bar{background:#fef3c7;color:#713f12;font-size:13px;text-align:center;padding:8px 12px}.demo-bar a{color:#713f12;font-weight:700}
