:root {
  --bg: #f7f5f0; --surface: #ffffff; --surface-2: #eef2ec;
  --ink: #1e2a24; --muted: #5d6f65; --line: #e3e7e1;
  --brand: #2f7d5f; --brand-ink: #ffffff; --brand-soft: #e2efe7;
  --amber: #8a6d1b; --amber-bg: #faf3dd; --blue: #2b5f8a; --blue-bg: #e7f0f7;
  --radius: 16px; --shadow: 0 8px 28px rgba(30,42,36,.08);
  --font: "Avenir Next","Segoe UI",system-ui,-apple-system,Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-theme="dark"] {
  --bg: #121715; --surface: #1b221e; --surface-2: #232d27;
  --ink: #e9f0ea; --muted: #a9bcB1; --line: #2c3831;
  --brand: #5cb98f; --brand-ink: #0e1a14; --brand-soft: #22352b;
  --amber-bg: #2e2a17; --amber: #e3c46a; --blue-bg: #1c2b38; --blue: #8fc3ea;
  --shadow: 0 8px 28px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; }
a { color: var(--brand); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 96px; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 640px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.logo { width: 36px; height: 36px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 20px; font-weight: 700; }
.brand-name { font-weight: 800; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -3px; }
.spacer { flex: 1; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 8px 10px; font-size: 16px; cursor: pointer; }
h1 { font-size: 30px; line-height: 1.15; margin: 22px 0 6px; letter-spacing: -.4px; }
.lede { color: var(--muted); margin: 0 0 16px; font-size: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 14px 0; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.hero { background: linear-gradient(135deg, var(--brand-soft), var(--surface)); }
.hero h2 { margin: 0 0 4px; font-size: 20px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-weight: 800; font-size: 17px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; border: 1px solid transparent; padding: 14px 18px; font-size: 17px; font-weight: 700; cursor: pointer; width: 100%; text-decoration: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); width: auto; padding: 10px 14px; font-size: 15px; }
.btn-small { padding: 9px 12px; font-size: 14px; width: auto; }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; } .stack { display: grid; gap: 10px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--ink); border: 1px solid var(--line); }
.badge.due { background: var(--amber-bg); color: var(--amber); border-color: currentColor; }
.badge.gp { background: var(--blue-bg); color: var(--blue); border-color: currentColor; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.item .t { font-weight: 700; } .item .m { color: var(--muted); font-size: 13px; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); }
.nav-inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5,1fr); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.nav button { background: none; border: 0; color: var(--muted); font-size: 11px; padding: 8px 4px; border-radius: 10px; cursor: pointer; display: grid; gap: 2px; justify-items: center; }
.nav button .e { font-size: 20px; }
.nav button[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 700; }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .3s; }
.opt { display: grid; gap: 8px; margin-top: 10px; }
.opt label { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.opt input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; }
.opt label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.q { padding: 16px 0; border-bottom: 1px solid var(--line); } .q:last-child { border-bottom: 0; }
.q fieldset { border: 0; margin: 0; padding: 0; } .q legend { font-weight: 700; padding: 0; margin-bottom: 2px; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.notice.gp { background: var(--blue-bg); border-color: var(--blue); }
.notice.calm { background: var(--brand-soft); }
.sources { margin-top: 12px; } .sources summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.sources ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
input[type="text"], input[type="date"], input[type="number"], input[type="time"], select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; }
label.f { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.track { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; transition: .2s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + .track { background: var(--brand); } .switch input:checked + .track::after { left: 25px; background: #fff; }
.switch input:focus-visible + .track { outline: 3px solid var(--brand); outline-offset: 2px; }
.timeline { border-left: 3px solid var(--line); margin-left: 8px; padding-left: 18px; display: grid; gap: 14px; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); margin-left: -25px; float: left; margin-top: 6px; }
.photo { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.disclaimer { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--muted); background: var(--surface); }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 10px; }
@media (min-width: 560px) { h1 { font-size: 36px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
