/*
VOICE: a coach's pit board — short, loud, zero clutter.
IDEA: a race-day board: one hot "now" lane, everything else waits in quiet rows.
PICTURE: the Top 3 lane is the hero; huge numerals, big tap targets.
COLOUR and TYPE: white / deep ink, one hot orange-red, teal for "done". Archivo for titles, Inter for text.
LAYOUT: one phone column, sticky tab bar, sheets slide up from the bottom.
*/
:root{
  color-scheme:light dark;
  --bg:light-dark(#ffffff,#111315);
  --bg2:light-dark(#f3f3f1,#1b1e21);
  --bg3:light-dark(#e8e8e4,#262a2e);
  --ink:light-dark(#131416,#f1f1ee);
  --mut:light-dark(#62666b,#9ca2a8);
  --line:light-dark(#e3e3df,#2c3034);
  --hot:#ff4f1f;
  --hot-ink:#ffffff;
  --hot-soft:light-dark(#ffe7df,#3a1d14);
  --ok:light-dark(#0f7a6c,#3ccfb8);
  --ok-soft:light-dark(#dcf3ef,#123a35);
  --warn:light-dark(#b25e00,#ffb45c);
  --r:16px;
  --disp:Archivo,Inter,system-ui,-apple-system,sans-serif;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
}
:root[data-theme=light]{color-scheme:light}
:root[data-theme=dark]{color-scheme:dark}
*{box-sizing:border-box;min-width:0}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{font:16px/1.5 Inter,system-ui,-apple-system,sans-serif;overflow-x:clip;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
h1,h2,h3{font-family:var(--disp);margin:0;line-height:1.08;text-wrap:balance}
h1{font-size:34px;font-weight:800;letter-spacing:-.01em}
h2{font-size:20px;font-weight:700}
h3{font-size:16px;font-weight:700}
.muted{color:var(--mut)}
.small{font-size:13px}
a{color:inherit}

.wrap{max-width:640px;margin:0 auto;padding:calc(var(--safe-t) + 18px) 16px calc(var(--safe-b) + 150px)}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.top .sub{font-size:14px;color:var(--mut);margin-top:4px}
.iconbtn{width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:var(--bg);display:grid;place-items:center;cursor:pointer;flex:none}
.iconbtn svg{width:22px;height:22px}

section{margin:22px 0}
.sec-h{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.card{background:var(--bg2);border-radius:var(--r);padding:16px}
.card+.card{margin-top:10px}
.hero{background:var(--hot);color:var(--hot-ink);border-radius:22px;padding:20px}
.hero h2{font-size:26px}
.hero .muted{color:rgba(255,255,255,.85)}

.btn{min-height:44px;padding:10px 16px;border-radius:12px;border:0;background:var(--ink);color:var(--bg);font-weight:600;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap}
.btn.hot{background:var(--hot);color:var(--hot-ink)}
.btn.ghost{background:transparent;color:var(--ink);border:1px solid var(--line)}
.btn.soft{background:var(--bg3);color:var(--ink)}
.btn.white{background:#fff;color:#131416}
.btn.sm{min-height:36px;padding:6px 12px;font-size:14px;border-radius:10px}
.btn.wide{width:100%}
.btn:disabled{opacity:.5}
.btn:focus-visible,.iconbtn:focus-visible,.chip:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--hot);outline-offset:2px}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.row.end{justify-content:flex-end}
.grow{flex:1}

.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{min-height:38px;padding:6px 14px;border-radius:999px;border:1px solid var(--line);background:var(--bg);cursor:pointer;font-size:14px;font-weight:500}
.chip.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.hero .chip{background:transparent;border-color:rgba(255,255,255,.55);color:#fff}
.hero .chip.on{background:#fff;color:var(--hot);border-color:#fff}
.pill{display:inline-block;font-size:12px;font-weight:600;padding:2px 9px;border-radius:999px;background:var(--bg3);white-space:nowrap}
.pill.focus{background:var(--hot);color:#fff}
.pill.paused{background:transparent;border:1px solid var(--line);color:var(--mut)}
.pill.ok{background:var(--ok-soft);color:var(--ok)}

/* Top 3 lane */
.lane{display:grid;gap:10px}
.slot{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:10px;background:var(--bg2);border-radius:18px;padding:12px 12px 12px 6px;min-height:72px}
.slot .num{font-family:var(--disp);font-weight:800;font-size:40px;text-align:center;color:var(--hot);line-height:1}
.slot.empty{background:transparent;border:2px dashed var(--line);cursor:pointer}
.slot.empty .num{color:var(--line)}
.slot.done .num{color:var(--ok)}
.slot.done .t-title{text-decoration:line-through;color:var(--mut)}

/* task rows */
.list{display:grid;gap:2px}
.task{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:6px;padding:6px 0;border-bottom:1px solid var(--line)}
.task:last-child{border-bottom:0}
.check{width:44px;height:44px;border:0;background:none;display:grid;place-items:center;cursor:pointer;padding:0}
.check i{width:24px;height:24px;border-radius:50%;border:2px solid var(--mut);display:block}
.check.on i{background:var(--ok);border-color:var(--ok);box-shadow:inset 0 0 0 4px var(--bg2)}
.task .check.on i{box-shadow:inset 0 0 0 4px var(--bg)}
.t-main{cursor:pointer;padding:4px 0}
.t-title{font-weight:500;overflow-wrap:anywhere}
.task.done .t-title{text-decoration:line-through;color:var(--mut)}
.t-meta{font-size:13px;color:var(--mut);display:flex;gap:6px;flex-wrap:wrap;margin-top:1px}
.star{width:44px;height:44px;border:0;background:none;cursor:pointer;display:grid;place-items:center;color:var(--mut)}
.star.on{color:var(--hot)}
.star svg{width:22px;height:22px}

.nudge{display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 14px;background:var(--hot-soft);border-radius:14px}
.nudge+.nudge{margin-top:8px}
.nudge .dot{width:10px;height:10px;border-radius:50%;background:var(--hot)}
.nudge.n-stale .dot{background:var(--warn)}

.big-now{width:100%;min-height:64px;font-size:19px;border-radius:18px;font-family:var(--disp);font-weight:800}
.stats{display:flex;gap:18px;flex-wrap:wrap}
.stat b{display:block;font-family:var(--disp);font-size:28px;line-height:1}
.stat span{font-size:13px}

.timer{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--ink);color:var(--bg);border-radius:18px;padding:14px 16px}
.timer b{font-family:var(--disp);font-size:38px;font-variant-numeric:tabular-nums}

/* areas */
.area{background:var(--bg2);border-radius:20px;padding:16px;margin-bottom:12px}
.area-h{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;cursor:pointer}
.metric{display:flex;align-items:baseline;gap:8px;margin-top:10px;flex-wrap:wrap}
.metric b{font-family:var(--disp);font-size:26px}
.subs{margin-top:10px;display:grid;gap:6px}
.subrow{display:flex;justify-content:space-between;align-items:center;gap:10px;background:var(--bg);border-radius:12px;padding:10px 12px;min-height:48px;cursor:pointer}
.lock{width:14px;height:14px;vertical-align:-2px}

/* talk */
.thread{display:grid;gap:12px}
.bub{max-width:86%;padding:12px 14px;border-radius:18px;background:var(--bg2);overflow-wrap:anywhere}
.bub .txt{white-space:pre-wrap}
.bub.me{justify-self:end;background:var(--ink);color:var(--bg);border-bottom-right-radius:6px}
.bub.them{justify-self:start;border-bottom-left-radius:6px}
.bub .explain{margin-top:10px;padding:10px 12px;border-radius:12px;background:var(--ok-soft);color:var(--ink);font-size:14px}
.bub .explain b{display:block;font-size:12px;color:var(--ok);margin-bottom:2px}
.bub .meta{font-size:12px;opacity:.7;margin-top:6px}
.bub details{margin-top:8px;font-size:14px}
.bub summary{cursor:pointer;opacity:.8}
.bub.me details .alt{background:var(--bg);color:var(--ink);border-radius:10px;padding:8px 10px;margin-top:6px}
.composer{position:fixed;left:0;right:0;bottom:calc(var(--safe-b) + 64px);background:var(--bg);border-top:1px solid var(--line);padding:10px 12px;z-index:5}
.composer .in{max-width:640px;margin:0 auto}
.composer textarea{width:100%;min-height:48px;max-height:140px}

/* forms */
label.f{display:block;font-size:13px;font-weight:600;color:var(--mut);margin:14px 0 6px}
input[type=text],input[type=password],input[type=date],input[type=number],select,textarea{width:100%;font-size:16px;padding:12px;border-radius:12px;border:1px solid var(--line);background:var(--bg);min-height:46px}
textarea{resize:vertical;min-height:84px}
.steps{display:grid;gap:4px}
.step{display:grid;grid-template-columns:44px minmax(0,1fr) 36px;align-items:center}
.step input[type=text]{min-height:40px;padding:8px 10px}
.x{border:0;background:none;color:var(--mut);font-size:22px;cursor:pointer;width:36px;height:36px}

/* tab bar + fab */
.tabs{position:fixed;left:0;right:0;bottom:0;background:var(--bg);border-top:1px solid var(--line);padding-bottom:var(--safe-b);z-index:6}
.tabs .in{max-width:640px;margin:0 auto;display:grid;grid-template-columns:repeat(5,minmax(0,1fr))}
.tab{height:64px;border:0;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;font-weight:600;color:var(--mut);cursor:pointer;position:relative}
.tab svg{width:24px;height:24px}
.tab.on{color:var(--ink)}
.tab.on svg{color:var(--hot)}
.badge{position:absolute;top:8px;left:calc(50% + 6px);background:var(--hot);color:#fff;font-size:11px;min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 5px}
.fab{position:fixed;right:max(16px,calc(50% - 304px));bottom:calc(var(--safe-b) + 80px);width:60px;height:60px;border-radius:50%;border:0;background:var(--hot);color:#fff;box-shadow:0 8px 24px rgba(255,79,31,.35);cursor:pointer;z-index:7;display:grid;place-items:center}
.fab svg{width:28px;height:28px}

/* sheet */
.scrim{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:20;display:flex;align-items:flex-end;justify-content:center;animation:fade .15s}
.sheet{background:var(--bg);width:100%;max-width:640px;max-height:92dvh;overflow:auto;border-radius:24px 24px 0 0;padding:10px 18px calc(var(--safe-b) + 20px);animation:up .22s ease-out}
.grab{width:42px;height:5px;border-radius:3px;background:var(--line);margin:4px auto 14px}
@keyframes up{from{transform:translateY(40px);opacity:.4}}
@keyframes fade{from{opacity:0}}
@media (prefers-reduced-motion:reduce){.scrim,.sheet{animation:none}}

#toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--safe-b) + 150px);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-size:14px;z-index:30;opacity:0;pointer-events:none;transition:opacity .2s;max-width:90vw}
#toast.show{opacity:1}

.login{min-height:100dvh;display:grid;align-content:center;gap:18px;max-width:420px;margin:0 auto;padding:24px}
.login .brand{font-family:var(--disp);font-weight:800;font-size:52px;line-height:.95;color:var(--hot)}
.empty-note{padding:18px;text-align:center;color:var(--mut);border:2px dashed var(--line);border-radius:16px}
.ai-card{border:2px solid var(--hot);border-radius:18px;padding:16px;margin-top:12px}
.spin{width:18px;height:18px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:sp .8s linear infinite;display:inline-block}
@keyframes sp{to{transform:rotate(360deg)}}
.days7{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.d7{border:1px solid var(--line);background:var(--bg);border-radius:12px;padding:8px 0;text-align:center;cursor:pointer;min-height:56px}
.d7 b{display:block;font-family:var(--disp);font-size:18px}
.d7 span{font-size:11px;color:var(--mut)}
.d7.on{background:var(--hot);border-color:var(--hot);color:#fff}
.d7.on span{color:#fff}
.habit{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}
.habit:last-child{border-bottom:0}
.habit.late .h-when{color:var(--hot);font-weight:600}
.code{font:13px/1.4 ui-monospace,Menlo,monospace;background:var(--bg2);padding:10px;border-radius:10px;overflow-wrap:anywhere;user-select:all}

/* content + calendar */
.hscroll{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:2px 16px}
.hscroll::-webkit-scrollbar{display:none}
.hscroll .chip{flex:none;display:inline-flex;align-items:center;gap:6px}
.fdot{display:inline-block;width:10px;height:10px;border-radius:50%;flex:none;margin-right:2px}
.fcard{margin-top:14px}
.cgrid{display:grid;gap:10px}
.ccard{background:var(--bg2);border-radius:16px;padding:12px 14px;cursor:pointer}
.cc-top{display:flex;align-items:center;gap:6px;margin-bottom:4px}
.cc-hook{margin-top:2px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.late{color:var(--hot);font-weight:600}
.bar{height:8px;border-radius:4px;background:var(--bg3);overflow:hidden}
.bar i{display:block;height:100%;border-radius:4px}
.prog{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) 36px;gap:10px;align-items:center;padding:5px 0}
.prog .small:last-child{text-align:right}
.swatch{width:40px;height:40px;border-radius:50%;border:3px solid transparent;cursor:pointer}
.swatch.on{border-color:var(--ink)}
.strip{width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:48px;padding:10px 14px;border-radius:14px;border:1px solid var(--line);background:var(--bg);cursor:pointer;margin-bottom:14px;font-size:15px}
.seg{display:grid;grid-template-columns:1fr 1fr;background:var(--bg2);border-radius:12px;padding:4px;margin-bottom:16px}
.seg button{min-height:40px;border:0;border-radius:9px;background:none;font-weight:600;cursor:pointer;color:var(--mut)}
.seg button.on{background:var(--bg);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
.cal .sec-h h2{font-size:19px}
.cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.cal-h span{text-align:center;font-size:12px;color:var(--mut);font-weight:600;padding:4px 0}
.cal-d{aspect-ratio:1/1.05;border:0;border-radius:12px;background:var(--bg);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;padding:0}
.cal-d b{font-family:var(--disp);font-size:16px;font-weight:700}
.cal-d.today b{color:var(--hot)}
.cal-d.sel{background:var(--ink);color:var(--bg)}
.cal-d.sel.today b{color:var(--hot)}
.cal-d.off{box-shadow:inset 0 0 0 2px var(--hot)}
.dots{display:flex;gap:2px;height:6px}
.dots i,.lg{width:6px;height:6px;border-radius:50%;display:inline-block}
.tdot{background:var(--ink)}
.cal-d.sel .tdot{background:var(--bg)}
.lg{margin-right:4px;vertical-align:1px;width:8px;height:8px}
.offlg{box-shadow:inset 0 0 0 2px var(--hot);border-radius:3px}
