
:root{
  --ground:#F3F5F1; --surface:#FFFFFF; --ink:#1B231F; --muted:#5E6A63; --line:#DAE0D8;
  --simon:#2E8753; --simon-tint:#D5EDDD; --simon-ink:#1D5E38;
  --becs:#DB6429; --becs-tint:#FBE0CF; --becs-ink:#9A3E12;
  --amelia:#8446A0; --amelia-tint:#EEDDF5;
  --hist:#E6E8E3; --focus:#2F5FD0;
  --display:"Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body:"Instrument Sans", "Helvetica Neue", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ground:#111513; --surface:#1A201C; --ink:#E5EAE5; --muted:#9AA59E; --line:#2C3530;
    --simon:#5CBF87; --simon-tint:#1E3A29; --simon-ink:#9FE0B9;
    --becs:#F08852; --becs-tint:#46291A; --becs-ink:#FFC3A1;
    --amelia:#C58EE0; --amelia-tint:#35243F; --hist:#242A26; --focus:#8FB0FF;
  }
}
:root[data-theme="dark"]{
  --ground:#111513; --surface:#1A201C; --ink:#E5EAE5; --muted:#9AA59E; --line:#2C3530;
  --simon:#5CBF87; --simon-tint:#1E3A29; --simon-ink:#9FE0B9;
  --becs:#F08852; --becs-tint:#46291A; --becs-ink:#FFC3A1;
  --amelia:#C58EE0; --amelia-tint:#35243F; --hist:#242A26; --focus:#8FB0FF;
}
*{box-sizing:border-box}
body{background:var(--ground);color:var(--ink);font-family:var(--body);font-size:15px;line-height:1.45;padding-inline:16px;padding-block:20px 48px}
.wrap{max-width:980px;margin:0 auto;display:flex;flex-direction:column;gap:22px}
h1,h2,h3{font-family:var(--display);font-weight:700;letter-spacing:-.01em;text-wrap:balance;margin:0}
h1{font-size:clamp(26px,5vw,36px);line-height:1.05}
h2{font-size:20px}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible,.day:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.muted{color:var(--muted)}
.eyebrow{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600}
.s{color:var(--simon-ink)} .b{color:var(--becs-ink)}
.top{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:12px}
.actions{display:flex;flex-wrap:wrap;gap:8px}
.btn{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 14px;font-weight:600;font-size:14px}
.btn.primary{background:var(--ink);color:var(--ground);border-color:var(--ink)}
.btn.small{padding:5px 11px;font-size:13px}
.btn:disabled{opacity:.45;cursor:default}

/* Tonight */
.tonight{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:20px;display:grid;gap:16px}
.tn-head{display:flex;flex-wrap:wrap;gap:6px 18px;align-items:baseline}
.tn-big{font-family:var(--display);font-size:clamp(28px,6vw,44px);font-weight:700;line-height:1}
.tn-sub{font-size:15px;color:var(--muted)}
.ribbon{display:grid;grid-template-columns:repeat(14,minmax(0,1fr));gap:4px}
.rn{border-radius:8px;padding:6px 0 7px;text-align:center;font-variant-numeric:tabular-nums;position:relative}
.rn .wd{font-size:11px;font-weight:600;opacity:.8}
.rn .dn{font-family:var(--display);font-size:17px;font-weight:700;line-height:1.1}
.rn.S{background:var(--simon-tint);color:var(--simon-ink)}
.rn.B{background:var(--becs-tint);color:var(--becs-ink)}
.rn.X{background:var(--hist);color:var(--muted)}
.rn.today{box-shadow:inset 0 0 0 2px currentColor}
.rn .am{position:absolute;top:3px;right:4px;width:7px;height:7px;border-radius:50%;background:var(--amelia)}
.rn.wkstart{margin-left:6px}
@media (max-width:560px){.ribbon{grid-template-columns:repeat(7,minmax(0,1fr))}.rn.wkstart{margin-left:0}}

.cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:720px){.cols{grid-template-columns:1fr}}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px;display:flex;flex-direction:column;gap:12px}
.bal{display:flex;align-items:center;gap:14px}
.bal-num{font-family:var(--display);font-size:40px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.meter{height:10px;border-radius:99px;overflow:hidden;display:flex;background:var(--hist)}
.meter span{display:block;height:100%}
.meter .ms{background:var(--simon)} .meter .mb{background:var(--becs)}
.kv{display:flex;justify-content:space-between;font-variant-numeric:tabular-nums;font-size:14px}

/* Month */
.month-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.nav{display:flex;gap:6px}
.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.dow{font-size:12px;font-weight:600;color:var(--muted);text-align:center;padding-bottom:2px}
.day{min-height:92px;border-radius:10px;padding:6px 7px;display:flex;flex-direction:column;gap:3px;border:1px solid transparent;text-align:left;background:var(--hist);position:relative;overflow:hidden}
.day.S{background:var(--simon-tint)} .day.B{background:var(--becs-tint)}
.day.empty{background:transparent;cursor:default}
.day .n{display:flex;justify-content:space-between;align-items:center;gap:4px}
.day .num{font-family:var(--display);font-weight:700;font-size:17px;font-variant-numeric:tabular-nums}
.day .who{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
.day.S .num,.day.S .who{color:var(--simon-ink)} .day.B .num,.day.B .who{color:var(--becs-ink)} .day.X .who{color:var(--muted)}
.day.today{border-color:var(--ink);border-width:2px}
.day.past{opacity:.62}
.ev{font-size:11.5px;line-height:1.25;color:var(--ink);overflow-wrap:anywhere}
.ev.birthday{font-weight:700}
.ev.school{color:var(--muted)}
.chips{display:flex;flex-wrap:wrap;gap:3px;margin-top:auto}
.chip{font-size:10.5px;font-weight:600;border-radius:99px;padding:1px 6px;line-height:1.5}
.chip.am{background:var(--amelia-tint);color:var(--amelia)}
.chip.sw{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.chip.pr{background:repeating-linear-gradient(135deg,var(--surface) 0 4px,var(--hist) 4px 8px);border:1px dashed var(--muted);color:var(--ink)}
.chip.bo{background:var(--surface);color:var(--muted)}
@media (max-width:560px){.day{min-height:62px;padding:4px}.day .who{display:none}.ev{display:none}.day .ev.birthday{display:block;font-size:10px}.chip{font-size:0;width:9px;height:9px;padding:0;border-radius:50%}.chip.am{background:var(--amelia)}.chip.sw{background:var(--ink)}.chip.bo{background:var(--muted)}}

.legend{display:flex;flex-wrap:wrap;gap:8px 16px;font-size:13px;color:var(--muted)}
.legend i{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:-2px;margin-right:5px}

/* Year strip */
.year{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:16px 18px}
.ym{display:flex;flex-direction:column;gap:4px;border:0;background:none;padding:0;text-align:left}
.ym b{font-size:13px}
.ym .g{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;width:100%;max-width:126px}
.ym .c{aspect-ratio:1;border-radius:2px;background:var(--hist);max-width:100%}
.ym .c.S{background:var(--simon)} .ym .c.B{background:var(--becs)} .ym .c.e{background:transparent}
.ym .c.t{outline:2px solid var(--ink);outline-offset:1px}
.ym.cur b{text-decoration:underline;text-underline-offset:3px}

/* Log */
.log{display:flex;flex-direction:column}
.log-row{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;padding:9px 0;border-top:1px solid var(--line);font-size:14px}
.log-row:first-child{border-top:0}
.dot{width:10px;height:10px;border-radius:50%}
.dot.S{background:var(--simon)} .dot.B{background:var(--becs)}

/* Sheet */
.scrim{position:fixed;inset:0;background:rgba(10,14,12,.45);display:flex;align-items:flex-end;justify-content:center;z-index:10;padding:16px}
@media (min-width:640px){.scrim{align-items:center}}
.sheet{background:var(--surface);color:var(--ink);border-radius:18px;padding:20px;width:100%;max-width:460px;max-height:88vh;overflow:auto;display:flex;flex-direction:column;gap:14px;margin-bottom:env(safe-area-inset-bottom,0px)}
.seg{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.seg button{border:2px solid var(--line);background:var(--surface);border-radius:12px;padding:12px;font-weight:700;font-family:var(--display);font-size:17px}
.seg button.on.S{border-color:var(--simon);background:var(--simon-tint);color:var(--simon-ink)}
.seg button.on.B{border-color:var(--becs);background:var(--becs-tint);color:var(--becs-ink)}
label.row{display:flex;gap:8px;align-items:center;font-size:14px}
input[type=text],select,textarea{font:inherit;color:var(--ink);background:var(--ground);border:1px solid var(--line);border-radius:10px;padding:9px 11px;width:100%}
textarea{min-height:84px;resize:vertical}
.field{display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--muted)}
.sheet-foot{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.note{font-size:13px;color:var(--muted)}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(20px + env(safe-area-inset-bottom,0px));background:var(--ink);color:var(--ground);padding:10px 16px;border-radius:99px;font-weight:600;z-index:20;font-size:14px}
.banner{background:var(--surface);border:1px dashed var(--line);border-radius:12px;padding:10px 14px;font-size:13px;color:var(--muted)}
@media (prefers-reduced-motion:no-preference){.sheet{animation:up .18s ease-out}@keyframes up{from{transform:translateY(12px);opacity:.6}}}

/* site additions */
html{-webkit-text-size-adjust:100%}
body{margin:0}
.login{max-width:420px;margin:8vh auto 0;display:flex;flex-direction:column;gap:14px}
.login .panel{gap:14px}
.err{color:var(--becs-ink);font-size:14px}
.who-pill{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.pending{background:var(--surface);border:2px solid var(--amelia);border-radius:18px;padding:16px 18px;display:flex;flex-direction:column;gap:10px}
.pending .req{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:10px}
.pending .req:first-of-type{border-top:0;padding-top:0}
.chip.to-S{background:var(--simon-tint);color:var(--simon-ink)} .chip.to-B{background:var(--becs-tint);color:var(--becs-ink)}
.copyrow{display:flex;gap:6px}
.copyrow input{font-size:12.5px}
.day.hist{opacity:.5}
code{font-size:12.5px}
