:root {
  --bg: #f6f5fa; --card: #ffffff; --text: #1d1b26; --muted: #6b6880; --line: #e6e3ef;
  --accent: #5f3dc4; --accent-soft: #ece7fb; --good: #2f9e44; --bad: #e03131; --warn: #f08c00;
  --radius: 14px; --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 2px 8px rgb(0 0 0 / 4%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14131a; --card: #1e1c27; --text: #ecebf3; --muted: #9a97ad; --line: #2e2b3b;
    --accent: #9775fa; --accent-soft: #2b2540; --good: #51cf66; --bad: #ff6b6b; --warn: #ffa94d; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
header h1 { margin: 0; font-size: 20px; }
#who { color: var(--muted); font-size: 14px; }
main { max-width: 640px; margin: 0 auto; padding: 12px 16px; }
h2 { font-size: 17px; margin: 22px 4px 8px; }
h2:first-child { margin-top: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 0; margin-bottom: 12px; }
.card.pad { padding: 14px 16px; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.chip.overdue { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.chip.today { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.pos { color: var(--good); font-weight: 600; } .neg { color: var(--bad); font-weight: 600; }
button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer;
  background: var(--accent); color: #fff; text-decoration: none; display: inline-block; }
button.ghost { background: var(--accent-soft); color: var(--accent); }
button.plain { background: none; color: var(--muted); padding: 6px 8px; }
button.big { width: 100%; padding: 14px; font-size: 17px; }
button:disabled { opacity: .5; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.inline { display: flex; gap: 8px; } .inline > * { flex: 1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { margin: 0; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 99px; color: var(--text); font-size: 14px; }
.checks input { width: auto; margin: 0; }
details summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--accent); list-style: none; }
details[open] summary { border-bottom: 1px solid var(--line); }
details > .pad { padding: 4px 16px 14px; }
.stat { display: flex; gap: 10px; } .stat > div { flex: 1; text-align: center; padding: 12px 8px; }
.stat b { display: block; font-size: 22px; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: none; padding: 0; flex: none; }
.agent { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 4px; margin-left: 4px; }
code, pre { font: 13px ui-monospace, Menlo, monospace; background: var(--bg); border-radius: 8px; }
pre { padding: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 3; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav a { flex: 1; text-align: center; padding: 8px 0 6px; font-size: 11px; color: var(--muted); text-decoration: none; }
nav a span { display: block; font-size: 20px; }
nav a.on { color: var(--accent); font-weight: 600; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 4; max-width: 600px;
  margin: 0 auto; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.center { text-align: center; padding: 40px 8px; }
.center .logo { font-size: 56px; }
#flat-switch { font: inherit; font-size: 19px; font-weight: 700; width: auto; max-width: 70vw; padding: 2px 4px; border: 0; background: none; }
