/* Reminders. A sibling of Chores: cream paper, a colored header band, Bricolage Grotesque for titles,
   Figtree for the rest. Teal instead of wine so the two are easy to tell apart on a home screen.
   Big tap targets and plain words: this is for someone who just wants the texts to go out. */

:root {
  --bg:#F7F5F0; --card:#FFFFFF; --panel:#ECEAE3; --ink:#1D2523; --muted:#5D6965; --faint:#98A29E; --line:#E2DED5;
  --brand:#1F6B5E; --brand-ink:#FFFFFF; --soft:#E1EFEB; --soft-ink:#175548;
  --hero:#123F3A; --hero-ink:#F8FBF9; --hero-muted:#A9CFC6;
  --gold:#E2A84B; --gold-soft:#FBF0DC; --warn:#965A06; --err:#A32A22; --err-soft:#FBE7E5;
  --tint:18, 63, 58;
  --shadow:0 1px 2px rgba(var(--tint), .07), 0 8px 20px rgba(var(--tint), .06);
  --r:18px;
  --display:"Bricolage Grotesque", Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans:Figtree, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --spring:cubic-bezier(.3, 1.4, .5, 1);
  --tabbar:calc(66px + env(safe-area-inset-bottom, 0px));
  color-scheme:light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --bg:#141917; --card:#1D2421; --panel:#26302C; --ink:#EDF3F0; --muted:#A8B6B1; --faint:#77857F;
    --line:#2F3A36; --brand:#7FCDBB; --brand-ink:#0B2520; --soft:#1E3A33; --soft-ink:#9FDCCD;
    --hero:#0C2622; --hero-ink:#EFF8F5; --hero-muted:#8FBDB2; --gold:#E7B865; --gold-soft:#3A301D; --warn:#F2C27A;
    --err:#F2BDB7; --err-soft:#3A2220; --shadow:0 1px 2px rgba(0,0,0,.3); color-scheme:dark; }
}
:root[data-theme=dark] { --bg:#141917; --card:#1D2421; --panel:#26302C; --ink:#EDF3F0; --muted:#A8B6B1; --faint:#77857F;
  --line:#2F3A36; --brand:#7FCDBB; --brand-ink:#0B2520; --soft:#1E3A33; --soft-ink:#9FDCCD;
  --hero:#0C2622; --hero-ink:#EFF8F5; --hero-muted:#8FBDB2; --gold:#E7B865; --gold-soft:#3A301D; --warn:#F2C27A;
  --err:#F2BDB7; --err-soft:#3A2220; --shadow:0 1px 2px rgba(0,0,0,.3); color-scheme:dark; }

* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; background:var(--bg); color:var(--ink); font:400 17px/1.5 var(--sans); -webkit-font-smoothing:antialiased; }
body { min-height:100dvh; overscroll-behavior-y:none; }
button { font:inherit; color:inherit; cursor:pointer; }
input, textarea, select { font:inherit; color:var(--ink); }
:focus-visible { outline:3px solid var(--brand); outline-offset:2px; border-radius:8px; }

main { max-width:560px; margin:0 auto; padding:18px max(18px, env(safe-area-inset-right, 0px)) calc(var(--tabbar) + 40px) max(18px, env(safe-area-inset-left, 0px)); }
main.plain { padding-top:calc(env(safe-area-inset-top, 0px) + 18px); padding-bottom:48px; }

/* Header band */
.hero { position:relative; overflow:hidden; background:var(--hero); color:var(--hero-ink);
  padding:calc(env(safe-area-inset-top, 0px) + 24px) max(20px, env(safe-area-inset-right, 0px)) 22px max(20px, env(safe-area-inset-left, 0px)); }
.hero-in { position:relative; max-width:560px; margin:0 auto; }
.doodle { position:absolute; right:-20px; top:-10px; width:200px; height:160px; color:var(--hero-muted); opacity:.22; pointer-events:none; }
@media (min-width:720px) { .doodle { right:4%; } }
.kicker { margin:0; color:var(--hero-muted); font-size:15px; font-weight:600; }
.hero h1 { margin:4px 0 0; font-family:var(--display); font-weight:700; font-size:34px; line-height:1.1; letter-spacing:-.01em; }
.squiggle { display:block; margin-top:6px; color:var(--gold); }

/* Labels and text */
.label { margin:26px 0 10px; font-size:18px; font-weight:700; display:flex; align-items:center; gap:8px; }
.label:first-child { margin-top:8px; }
.label .count { min-width:24px; height:24px; padding:0 7px; border-radius:999px; background:var(--panel); color:var(--muted);
  font-size:13px; font-weight:700; display:inline-grid; place-items:center; }
.lead { margin:0 0 16px; color:var(--muted); }
.note { margin:10px 0 0; font-size:15px; color:var(--muted); }

/* Practice-mode banner */
.banner { display:flex; gap:12px; align-items:flex-start; padding:12px 14px; margin-bottom:16px; border-radius:14px;
  background:var(--gold-soft); color:var(--warn); font-size:15px; font-weight:600; line-height:1.4; }
.banner svg { flex:none; width:20px; height:20px; margin-top:1px; }

/* Rows */
.slist { display:grid; gap:10px; }
.srow { display:flex; align-items:center; gap:12px; width:100%; padding:14px 16px; border:0; border-radius:var(--r); background:var(--card);
  box-shadow:var(--shadow); text-align:left; transition:transform .14s var(--spring);
  animation:rise .4s cubic-bezier(.2,.9,.3,1) both; animation-delay:calc(var(--i, 0) * 30ms); }
@keyframes rise { from { opacity:0; transform:translateY(10px) scale(.98); } }
.srow:active { transform:scale(.98); }
.srow .body { flex:1; min-width:0; }
.srow .title { display:block; font-weight:700; font-size:17px; line-height:1.35; overflow-wrap:anywhere;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.srow .go { width:18px; height:18px; color:var(--faint); flex:none; }
.srow.paused .title { color:var(--muted); }
.meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; margin-top:3px; font-size:14px; color:var(--muted); }
.meta .grp { display:inline-flex; align-items:center; gap:5px; }
.meta svg { width:15px; height:15px; }
.pill { flex:none; padding:4px 10px; border-radius:999px; background:var(--soft); color:var(--soft-ink); font-size:13px; font-weight:700; white-space:nowrap; }
.pill.soon { background:var(--gold-soft); color:var(--warn); }
.pill.off { background:var(--panel); color:var(--muted); }
.pill.bad { background:var(--err-soft); color:var(--err); }

/* History */
.hist { display:grid; gap:10px; list-style:none; margin:0; padding:0; }
.hist li { padding:12px 16px; background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); }
.hist .top { display:flex; align-items:center; gap:10px; }
.hist .when { flex:1; font-size:14px; color:var(--muted); font-weight:600; }
.hist .msg { margin:6px 0 2px; white-space:pre-wrap; overflow-wrap:anywhere; }
.hist .detail { font-size:14px; color:var(--muted); }

/* Empty */
.empty { text-align:center; padding:30px 12px 12px; color:var(--muted); }
.empty strong { display:block; font-family:var(--display); font-size:23px; font-weight:700; color:var(--ink); margin-bottom:4px; }
.empty svg { width:88px; height:88px; margin-bottom:8px; }

/* Buttons */
.btn { border:1.5px solid var(--line); background:var(--card); border-radius:14px; min-height:48px; padding:10px 18px; font-weight:700; font-size:16px;
  display:inline-flex; align-items:center; justify-content:center; gap:8px; transition:transform .14s var(--spring); }
.btn:active { transform:scale(.97); }
.btn.primary { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); }
.btn.quiet { border-color:transparent; background:none; color:var(--muted); }
.btn.danger { border-color:transparent; background:none; color:var(--err); padding-left:4px; }
.btn svg { width:18px; height:18px; }
.btn:disabled { opacity:.55; pointer-events:none; }
.add { width:100%; border:0; background:var(--brand); color:var(--brand-ink); border-radius:16px; min-height:54px; padding:14px;
  font-weight:700; font-size:17px; display:flex; align-items:center; justify-content:center; gap:8px;
  box-shadow:0 6px 16px color-mix(in srgb, var(--brand) 25%, transparent); transition:transform .14s var(--spring); }
.add:active { transform:scale(.97); }
.add.ghost { background:var(--card); color:var(--brand); box-shadow:var(--shadow); }
.chip { min-height:40px; padding:0 15px; border-radius:999px; border:1.5px solid var(--line); background:var(--card); color:var(--ink);
  font-weight:700; font-size:15px; display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }

/* Tab bar */
nav.tabs { position:fixed; left:0; right:0; bottom:0; z-index:10; background:var(--card); border-top:1px solid var(--line);
  padding:6px max(4px, env(safe-area-inset-left, 0px)) calc(env(safe-area-inset-bottom, 0px) + 8px); }
nav.tabs .inner { max-width:560px; margin:0 auto; display:grid; grid-template-columns:repeat(4, 1fr); }
.tab { border:0; background:none; color:var(--muted); display:flex; flex-direction:column; align-items:center; gap:3px; padding:2px 0;
  font-size:12px; font-weight:600; border-radius:12px; min-height:52px; }
.tab .ico { width:54px; height:32px; border-radius:16px; display:grid; place-items:center; transition:background-color .2s ease; }
.tab svg { width:22px; height:22px; }
.tab[aria-current=page] { color:var(--brand); font-weight:800; }
.tab[aria-current=page] .ico { background:var(--soft); animation:hop .55s ease .05s both; }
@keyframes hop { 0%, 100% { transform:none; } 35% { transform:translateY(-6px); } 65% { transform:translateY(1px); } }

/* Bottom sheet */
.scrim { position:fixed; inset:0; z-index:20; background:rgba(10, 25, 22, .45); animation:fade .25s ease both; }
@keyframes fade { from { opacity:0; } }
.sheet { position:fixed; left:0; right:0; bottom:0; z-index:21; max-width:560px; max-height:92dvh; margin:0 auto; overflow:auto;
  background:var(--bg); border-radius:26px 26px 0 0; padding:10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  animation:sheetUp .42s cubic-bezier(.2,.9,.3,1) both; }
@keyframes sheetUp { from { transform:translateY(100%); } }
.sheet .grab { width:40px; height:5px; border-radius:5px; background:var(--line); margin:0 auto 14px; }
.sheet h3 { margin:0 0 6px; font-family:var(--display); font-size:26px; font-weight:700; }
label.f { display:block; margin:18px 0 8px; font-size:15px; font-weight:700; }
.input { width:100%; min-height:50px; border:1.5px solid var(--line); border-radius:14px; background:var(--card); padding:12px 14px; font-size:16px; }
.input:focus { outline:none; border-color:var(--brand); }
textarea.input { min-height:96px; resize:vertical; line-height:1.4; }
.counter { margin:6px 2px 0; font-size:13px; color:var(--faint); text-align:right; }
.seg { display:grid; grid-template-columns:repeat(4, 1fr); gap:4px; background:var(--panel); border-radius:14px; padding:4px; }
.seg.two { grid-template-columns:repeat(2, 1fr); }
.seg button { min-height:44px; border:0; border-radius:10px; background:none; font-weight:700; font-size:15px; color:var(--muted); padding:0 4px; }
.seg button[aria-pressed=true] { background:var(--card); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.12); }
.picks { display:flex; flex-wrap:wrap; gap:8px; }
.picks button { min-height:44px; padding:0 16px; border-radius:999px; border:1.5px solid var(--line); background:var(--card);
  font-weight:700; font-size:15px; display:inline-flex; align-items:center; gap:7px; }
.picks button[aria-pressed=true] { background:var(--soft); border-color:var(--brand); color:var(--soft-ink); }
.picks button svg { width:16px; height:16px; }
.days { display:grid; grid-template-columns:repeat(7, 1fr); gap:6px; }
.days button { aspect-ratio:1; max-height:48px; border:1.5px solid var(--line); border-radius:50%; background:var(--card); font-weight:700; font-size:15px; padding:0;
  transition:transform .14s var(--spring), background .15s; }
.days button:active { transform:scale(.9); }
.days button[aria-pressed=true] { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); }
.inline { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:12px; color:var(--muted); font-size:16px; }
.inline select { width:auto; min-height:44px; padding:8px 12px; }
.pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.hint { margin:8px 0 0; font-size:14px; color:var(--muted); }
.actions { display:flex; align-items:center; gap:10px; margin-top:24px; flex-wrap:wrap; }
.actions .btn:last-child { margin-left:auto; min-width:140px; }
.extra { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:18px; }
.err { color:var(--err); font-size:15px; font-weight:600; min-height:22px; margin-top:10px; }

/* Sign in */
.center { min-height:84dvh; display:flex; flex-direction:column; justify-content:center; }
.center h1 { margin:0; font-family:var(--display); font-weight:700; font-size:36px; line-height:1.1; }
.center .squiggle { margin-bottom:12px; }
.center form { margin-top:22px; display:grid; gap:12px; }
.logo { width:64px; height:64px; border-radius:18px; display:block; margin-bottom:16px; box-shadow:0 6px 18px rgba(var(--tint), .25); }

/* Toast */
#toast { position:fixed; left:50%; bottom:calc(var(--tabbar) + 20px); z-index:30; transform:translate(-50%, 16px); opacity:0; pointer-events:none;
  max-width:min(440px, calc(100vw - 24px)); background:#1D2523; color:#F7F5F0; border-radius:16px; padding:12px 16px;
  font-size:15px; font-weight:600; box-shadow:0 12px 28px rgba(0,0,0,.28);
  transition:opacity .2s, transform .3s cubic-bezier(.2,.9,.3,1.2); }
:root[data-theme=dark] #toast { background:#2F3A36; color:#EDF3F0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) #toast { background:#2F3A36; color:#EDF3F0; } }
#toast.show { opacity:1; transform:translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; }
}

/* Chores: Today's status line, task rows, and the chore editor */
.status { display:flex; align-items:center; gap:14px; padding:16px 18px; margin-bottom:16px; border-radius:var(--r); background:var(--soft); color:var(--soft-ink);
  animation:rise .35s var(--spring) both; }
.status p { margin:0; font-family:var(--display); font-size:21px; font-weight:700; line-height:1.25; }
.status .ico { flex:none; width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background:var(--card); color:var(--brand); }
.status .ico svg { width:24px; height:24px; }
.status.good .ico { background:var(--brand); color:var(--brand-ink); }
.status.warn { background:var(--gold-soft); color:var(--warn); }
.status.warn .ico { color:var(--warn); }
.status.slim { padding:12px 14px; margin:12px 0 0; animation:none; }
.status.slim p { font-family:var(--sans); font-size:16px; font-weight:600; }
.srow.task.done .title, .srow.task.skipped .title { color:var(--muted); }
.problem { display:flex; gap:6px; align-items:flex-start; margin-top:6px; font-size:14px; font-weight:600; color:var(--err); }
.problem svg { flex:none; width:16px; height:16px; margin-top:2px; }
.pill { display:inline-flex; align-items:center; gap:4px; }
.pill svg { width:14px; height:14px; }
.pill.in { background:var(--panel); color:var(--ink); }
.picks .num { display:inline-grid; place-items:center; width:20px; height:20px; margin-right:6px; border-radius:50%; background:var(--brand); color:var(--brand-ink); font-size:12px; font-weight:800; }
.preview { margin:0; padding:12px 14px; border-radius:18px 18px 18px 6px; background:var(--panel); font-size:15px; line-height:1.4; max-width:92%; }
.extra .btn.primary { grid-column:1 / -1; }
.extra .btn.wide { grid-column:1 / -1; }
.dayc { display:flex; gap:12px; padding:12px 16px; border-radius:var(--r); background:var(--card); box-shadow:var(--shadow); animation:rise .35s var(--spring) both; animation-delay:calc(var(--i, 0) * 30ms); }
.dayc .day { flex:none; width:84px; padding-top:6px; font-size:14px; font-weight:700; color:var(--muted); }
.dayc .lines { flex:1; min-width:0; display:grid; }
.dayc .line { display:flex; align-items:baseline; gap:10px; width:100%; min-height:36px; padding:6px 0; border:0; background:none; text-align:left; font-size:16px; }
.dayc .line + .line { border-top:1px solid var(--line); }
.dayc .line .t { flex:1; min-width:0; font-weight:600; }
.dayc .line .w { flex:none; font-size:14px; color:var(--muted); }
.dayc .line.skipped .t, .dayc .line.done .t { color:var(--faint); text-decoration:line-through; }
