[hidden] { display: none !important; }
:root {
  --bg: #f6f3ee; --card: #fffdf9; --ink: #1f2328; --muted: #6b6f76; --line: #e7e1d7;
  --accent: #2f6f5e; --accent-ink: #fff; --warn: #b4462c; --soft: #eef4f1; --amber: #b7791f;
  --r: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141617; --card: #1c1f21; --ink: #e9e7e3; --muted: #9aa0a6; --line: #2c3033; --soft: #1f2a26; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
main { max-width: 640px; margin: 0 auto; padding: 0 14px; }
.top { max-width: 640px; margin: 0 auto; display: flex; justify-content: space-between; align-items: end; padding: 22px 16px 10px; }
.date { color: var(--muted); font-size: 14px; }
h1 { margin: 2px 0 0; font-size: 28px; letter-spacing: -.02em; }
h2 { font-size: 15px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 12px 0; box-shadow: var(--shadow); }
.hint { color: var(--muted); font-size: 13px; margin: -4px 0 10px; }
.count { background: var(--warn); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.count:empty { display: none; }

.next { background: var(--accent); color: var(--accent-ink); border: 0; }
.next .label { opacity: .8; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.next .title { font-size: 21px; font-weight: 650; margin: 4px 0; }
.next .when { font-size: 15px; opacity: .9; }
.next .actions { margin-top: 10px; display: flex; gap: 8px; }
.next .actions button { background: rgba(255,255,255,.18); color: #fff; }
.brief { white-space: pre-wrap; background: var(--soft); }
.warn { background: #fff4e5; color: #7a4b00; border: 1px solid #f3d9a6; border-radius: var(--r); padding: 10px 12px; margin: 12px 0; font-size: 14px; }

button, .btn { font: inherit; border: 0; border-radius: 10px; padding: 9px 14px; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.small { padding: 5px 10px; font-size: 13px; }
.icon-btn { background: var(--card); color: var(--ink); border: 1px solid var(--line); width: 40px; height: 40px; padding: 0; font-size: 20px; }
input, select, textarea { font: inherit; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.row > * { flex: 1; } .row > button { flex: 0 0 auto; }
.stack { display: grid; gap: 8px; }
.inline { display: flex; gap: 8px; margin-bottom: 8px; } .inline button { flex: 0 0 auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.chips button:active { transform: scale(.97); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { color: var(--muted); font-size: 13px; }
.list.subtle li { color: var(--muted); font-size: 14px; padding: 6px 0; }
.list .acts { display: flex; gap: 6px; flex: 0 0 auto; }
.tag { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--accent); margin-left: 6px; }
.tag.over { background: #fde8e3; color: var(--warn); }
.tag.paid { background: #e7f3ec; color: #2f6f3e; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.timeline .nudge .what { color: var(--accent); }
.timeline .past { opacity: .5; }
.timeline .loc { color: var(--muted); font-size: 13px; }

.checklist { list-style: none; margin: 0; padding: 0; columns: 2; }
.checklist li { padding: 6px 0; break-inside: avoid; }
.checklist label { display: flex; gap: 8px; align-items: center; }
.checklist input { width: auto; }

.day { margin-bottom: 12px; } .day h3 { margin: 6px 0; font-size: 15px; }

.chat { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 140px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .acts { font-size: 12px; color: var(--muted); margin-top: 6px; }
.suggest { position: fixed; left: 0; right: 0; bottom: calc(126px + env(safe-area-inset-bottom)); display: flex; gap: 6px; overflow-x: auto; padding: 0 14px; max-width: 640px; margin: 0 auto; }
.suggest button { flex: 0 0 auto; background: var(--card); color: var(--ink); border: 1px solid var(--line); font-size: 13px; }
.chatbar { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px 14px; background: var(--bg); max-width: 640px; margin: 0 auto; }
.chatbar textarea { resize: none; max-height: 140px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; background: none; color: var(--muted); border-radius: 0; padding: 16px 0; font-weight: 600; }
.tabs button.on { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
pre.draft { white-space: pre-wrap; font: inherit; margin: 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 9; max-width: 90%; }

.login { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 20px; }
.login .card { max-width: 360px; }
