@font-face{font-family:"Figtree";font-style:normal;font-weight:300 900;font-display:swap;src:url(/fonts/figtree-latin-wght-normal.woff2) format("woff2")}
@font-face{font-family:"Bricolage Grotesque";font-style:normal;font-weight:200 800;font-display:swap;src:url(/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2")}

/* Layout: one narrow column. Date bar on top, stacked cards, fixed three-tab bar at the bottom. */
:root{
  --bg:#f1f4f7;
  --surface:#ffffff;
  --ink:#16202c;
  --muted:#586373;
  --line:#d9dfe7;
  --accent:#1d6f73;
  --accent-ink:#ffffff;
  --accent-soft:#e0f0ef;
  --c-mood:#1d6f73;
  --c-stress:#b0690f;
  --c-anx:#6d4bb5;
  --c-energy:#2a74b8;
  --ok:#1f7a45;
  --warn:#9a5a00;
  --font-display:"Bricolage Grotesque",system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-body:"Figtree",system-ui,-apple-system,"Segoe UI",sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0e141b;
    --surface:#17202a;
    --ink:#e7ecf3;
    --muted:#9aa5b5;
    --line:#2a3542;
    --accent:#4fb3b1;
    --accent-ink:#06191a;
    --accent-soft:#16313a;
    --c-mood:#4fb3b1;
    --c-stress:#e3a64d;
    --c-anx:#ab8cf2;
    --c-energy:#6db4ee;
    --ok:#5cc58a;
    --warn:#e5a24a;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0e141b;
  --surface:#17202a;
  --ink:#e7ecf3;
  --muted:#9aa5b5;
  --line:#2a3542;
  --accent:#4fb3b1;
  --accent-ink:#06191a;
  --accent-soft:#16313a;
  --c-mood:#4fb3b1;
  --c-stress:#e3a64d;
  --c-anx:#ab8cf2;
    --c-energy:#6db4ee;
  --ok:#5cc58a;
  --warn:#e5a24a;
  color-scheme:dark;
}

*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font:16px/1.45 var(--font-body);-webkit-text-size-adjust:100%}
button,input,textarea{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:default}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
h1,h2,p{margin:0}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.app{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:14px;
  padding:calc(14px + env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom))}

.datebar{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:8px}
.datebar .mid{text-align:center}
.datebar h1,.titlebar h1{font-family:var(--font-display);font-weight:700;font-size:26px;line-height:1.15;text-wrap:balance}
.sub{font-size:13px;color:var(--muted);margin-top:2px}
.titlebar{text-align:center}
.step{width:44px;height:44px;border:1px solid var(--line);background:var(--surface);border-radius:12px;display:grid;place-items:center}
.step:disabled{opacity:.35}
.step svg{width:18px;height:18px}

.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:14px}
.card h2{font-family:var(--font-display);font-size:18px;font-weight:700;line-height:1.2}
.hint{font-size:13px;color:var(--muted)}
.banner{border:1px dashed var(--line);border-radius:12px;padding:10px 12px;font-size:14px;color:var(--muted);background:var(--surface)}
.banner.warn{border-style:solid;border-left:4px solid var(--warn);color:var(--ink)}

.slots{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.slot{border:1px solid var(--line);background:var(--bg);border-radius:12px;padding:10px 6px;text-align:center;display:flex;flex-direction:column;gap:2px;min-height:58px;justify-content:center}
.slot .sn{font-weight:650}
.slot .ss{font-size:12px;color:var(--muted)}
.slot .ss.due{color:var(--accent);font-weight:650}
.slot.on{background:var(--accent-soft);border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}

.metric{display:flex;flex-direction:column;gap:8px}
.mhead{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.mn{font-weight:650}
.mv{font-size:14px;font-weight:600;color:var(--accent);min-height:21px}
.mv.empty{color:var(--muted);font-weight:500}
.chips{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.chip{height:52px;border:1px solid var(--line);background:var(--bg);border-radius:12px;font-size:18px;font-weight:600;transition:background .12s,border-color .12s}
.chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.chips.words .chip{font-size:13px;padding:0 2px;height:48px}
.ends{display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}

.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:14px;font-weight:600}
textarea,input[type="text"],input[type="number"],input[type="password"],input[type="time"]{width:100%;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:10px;padding:10px 12px;font-size:16px}
textarea{min-height:68px;resize:vertical}
.primary{width:100%;height:50px;border:none;border-radius:12px;background:var(--accent);color:var(--accent-ink);font-weight:700}
.primary:disabled{background:var(--line);color:var(--muted)}
.status{font-size:14px;color:var(--ok);min-height:20px;font-weight:600}
.status.err{color:var(--warn)}
.ghost{height:44px;padding:0 16px;border:1px solid var(--line);background:var(--surface);border-radius:12px;font-weight:600}
.ghost:disabled{opacity:.45}
.ghost.danger{color:var(--warn)}

.pills{display:flex;flex-wrap:wrap;gap:8px}
.pill{min-height:44px;padding:8px 16px;border:1px solid var(--line);background:var(--bg);border-radius:999px;font-weight:550}
.pill[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);font-weight:650}
.pill[aria-pressed="true"]::before{content:"\2713\00a0";color:var(--accent)}
.pillwrap{display:inline-flex;align-items:center;gap:4px}
.rm{width:32px;height:32px;border:none;background:transparent;border-radius:50%;color:var(--muted);font-size:18px;line-height:1}
.addrow{display:flex;gap:8px}
.addrow input{flex:1;min-width:0}

.chartwrap svg{width:100%;height:auto;display:block}
.legend{display:flex;flex-wrap:wrap;gap:8px}
.lg{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:6px 12px;border:1px solid var(--line);background:var(--bg);border-radius:999px;font-size:13px;font-weight:600;color:var(--muted)}
.lg[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--ink)}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.segbtn{height:44px;border:1px solid var(--line);background:var(--bg);border-radius:10px;font-weight:600;color:var(--muted)}
.segbtn[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--ink);box-shadow:inset 0 0 0 1px var(--accent)}
.crow{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line);font-size:14px}
.crow b{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:16px}

.tbl{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}
th{font-size:12px;color:var(--muted);font-weight:600;text-align:right;padding:0 0 6px 8px;white-space:nowrap}
td{padding:9px 0 9px 8px;text-align:right;border-top:1px solid var(--line);white-space:nowrap}
th:first-child,td:first-child{text-align:left;padding-left:0;white-space:normal}
.good{color:var(--ok);font-weight:650}
.bad{color:var(--warn);font-weight:650}
.flat{color:var(--muted)}

.srow{display:grid;grid-template-columns:1fr repeat(3,62px) 14px;align-items:center;gap:4px;font-variant-numeric:tabular-nums}
.shead{font-size:12px;color:var(--muted);font-weight:600;padding:0 0 6px}
.shead span{display:flex;align-items:center;gap:5px}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%}
details.day{border-top:1px solid var(--line)}
details.day summary{list-style:none;cursor:pointer;padding:12px 0;min-height:44px}
details.day summary::-webkit-details-marker{display:none}
.sd{font-weight:600}
.sv{text-align:left}
.chev{color:var(--muted);transition:transform .12s}
details[open] .chev{transform:rotate(90deg)}
.detail{padding:0 0 14px;display:flex;flex-direction:column;gap:6px;font-size:14px}
.drow{display:grid;grid-template-columns:84px 1fr;gap:8px}
.dl{color:var(--muted)}
.dnote{margin:0 0 0 92px;color:var(--muted);font-style:italic;overflow-wrap:anywhere}
.muted{color:var(--muted)}

.btnrow{display:flex;flex-wrap:wrap;gap:8px}
.csvbox{min-height:110px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px}

.tabs{position:fixed;left:0;right:0;bottom:0;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
.tabs .in{max-width:560px;margin:0 auto;display:grid;grid-template-columns:repeat(3,1fr)}
.tab{height:58px;border:none;background:transparent;font-weight:600;color:var(--muted);font-size:15px}
.tab[aria-current="page"]{color:var(--accent);font-weight:700;box-shadow:inset 0 3px 0 var(--accent)}

@media (prefers-reduced-motion:reduce){*{transition:none!important}}
.wall{max-width:400px;margin:18vh auto 0;gap:16px}
.wall h1{font-family:var(--font-display);font-size:26px;font-weight:800;line-height:1.1}
.wall input{height:50px;padding:0 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:18px}
.wall .status:empty{display:none}
.times{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.time{display:flex;flex-direction:column;gap:4px;font-size:13px;font-weight:600;color:var(--muted)}
.time input{padding:8px;min-width:0}
