:root {
  --bg: #f4f6f1; --card: #ffffff; --text: #1d2a20; --muted: #6a776c; --line: #e2e7df;
  --accent: #2f7d4f; --accent-text: #ffffff; --danger: #b3412f; --done: #9aa59c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121714; --card: #1b221d; --text: #e8efe9; --muted: #95a398; --line: #2b352e;
          --accent: #4caf78; --accent-text: #0d1a12; --danger: #e07a68; --done: #5e6a61; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
body { padding: env(safe-area-inset-top) 0 calc(76px + env(safe-area-inset-bottom)); }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 4px; }
.brand { font-weight: 700; font-size: 20px; }
.who { color: var(--muted); font-size: 15px; }
main { padding: 8px 16px; max-width: 640px; margin: 0 auto; }
.view { display: none; }
.view.on { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 10px 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; margin-bottom: 6px; }
.center { text-align: center; }
.big { font-size: 56px; }
h1 { font-size: 22px; margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.plan { white-space: pre-wrap; word-wrap: break-word; font: inherit; margin: 0; }
button { font: inherit; border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-text); font-weight: 600; }
button.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); width: 100%; margin: 6px 0; }
.row .ghost, .row.wrap .ghost { width: auto; flex: 1; }
button.danger { color: var(--danger); }
.small-btn { padding: 10px 14px; min-width: 48px; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
input { flex: 1; font: inherit; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); min-width: 0; }
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; background: transparent; color: var(--text); padding: 8px; }
.seg button.on { background: var(--card); font-weight: 600; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { padding: 11px 4px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.items li:last-child { border-bottom: 0; }
.items li .box { width: 22px; height: 22px; border: 2px solid var(--muted); border-radius: 6px; flex: none; margin-top: 2px; }
.items li.done { color: var(--done); text-decoration: line-through; }
.items li.done .box { background: var(--done); border-color: var(--done); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabs button { flex: 1; background: transparent; color: var(--muted); display: flex; flex-direction: column;
  align-items: center; padding: 4px; font-size: 22px; }
.tabs button span { font-size: 12px; }
.tabs button.on { color: var(--accent); }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet-box { background: var(--bg); width: 100%; max-height: 85vh; overflow: auto; border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--text);
  color: var(--bg); padding: 12px 14px; border-radius: 12px; font-size: 15px; z-index: 20; white-space: pre-wrap; }
.toast[hidden] { display: none; }
