:root {
  --ground: #F7F3EA; --card: #FFFFFF; --line: #E6DFD0; --ink: #1A2620; --muted: #5E6B63;
  --forest: #1F4D3A; --forest-dark: #153628; --gold: #D9B26A; --gold-soft: #E6D3A8; --sand: #EDE6D6;
  --green-bg: #DCEFE3; --green-fg: #1F6B45; --amber-bg: #F6E7C4; --amber-fg: #7A4E00; --red-bg: #F8DEDA; --red-fg: #A3271B;
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
a { color: var(--forest); }
button, input, select, textarea { font: inherit; color: inherit; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
main { padding: calc(20px + env(safe-area-inset-top)) 20px 120px; outline: none; display: flex; flex-direction: column; gap: 14px; }
main.no-nav { padding-bottom: 40px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font-size: 12px; letter-spacing: 2px; color: var(--forest); font-weight: 600; text-transform: uppercase; }
.acct { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--forest); text-decoration: none; font-size: 13px; font-weight: 600; padding: 0 14px; }
h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.1; }
h2 { margin: 6px 0 0; font-size: 17px; font-weight: 600; }
.lede { margin: 6px 0 0; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.hero { background: var(--forest); color: var(--ground); border: 0; border-radius: 22px; }
.card.hero .muted { color: #D5DED8; }
.card.hero .kicker { color: var(--gold-soft); }
.card.now { border: 2px solid var(--forest); }
.card.warn { background: #FFF6E5; border-color: #EBCB8B; }
.kicker { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.big { font-family: var(--serif); font-size: 40px; font-weight: 700; line-height: 1; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bar > span { display: block; height: 10px; background: var(--forest); border-radius: 5px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--gold-soft); color: var(--forest); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; }
.avatar.alt { background: #DCE7E0; }
.time { width: 50px; flex: none; font-size: 13px; color: var(--muted); }
.time.now { color: var(--forest); font-weight: 600; }
.item { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.item.past { opacity: .6; background: transparent; }
.item.now { border: 2px solid var(--forest); }
.t { font-weight: 600; font-size: 15px; }
.s { font-size: 13px; color: var(--muted); }
.chip { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 6px 10px; white-space: nowrap; background: var(--sand); color: var(--muted); }
.chip.green { background: var(--green-bg); color: var(--green-fg); }
.chip.amber { background: var(--amber-bg); color: var(--amber-fg); }
.chip.red { background: var(--red-bg); color: var(--red-fg); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.dot.green { background: #2E8B57; } .dot.amber { background: #D99A1E; } .dot.red { background: #C0392B; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--forest); background: var(--forest); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--forest-dark); }
.btn.ghost { background: var(--card); color: var(--forest); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.ask { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-height: 92px; font-weight: 500; text-align: left; cursor: pointer; }
.ask svg, .ic { width: 24px; height: 24px; fill: none; stroke: var(--forest); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ask[aria-pressed="true"] { border: 2px solid var(--forest); }
.nums { display: flex; gap: 8px; }
.nums button { flex: 1; min-height: 46px; border-radius: 12px; border: 1px solid #D9D1C0; background: var(--card); font-weight: 600; font-size: 16px; cursor: pointer; }
.nums button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.seg { display: flex; background: var(--sand); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 44px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 48px; border: 1px solid #D9D1C0; border-radius: 14px; padding: 10px 14px; background: var(--card); font-size: 16px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(31,77,58,.35); outline-offset: 2px; }
.err { color: var(--red-fg); font-size: 14px; margin: 0; }
.ok { color: var(--green-fg); font-size: 14px; margin: 0; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 4px 16px; }
.list > div, .list > a, .list > details { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #EEE8DC; text-decoration: none; color: inherit; }
.list > :first-child { border-top: 0; }
.list > details { display: block; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; justify-content: space-between; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; font-size: 20px; color: var(--forest); }
details[open] summary::after { content: '–'; }
details p { margin: 8px 0 4px; line-height: 1.55; color: var(--ink); }
.empty { color: var(--muted); padding: 8px 0; margin: 0; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 96px; }
.chart > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart .b { width: 100%; background: #C9D6CE; border-radius: 6px; min-height: 3px; }
.chart .b.today { background: var(--forest); }
.chart .n { font-size: 11px; color: var(--muted); }
.msgs { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 12px 14px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; border-radius: 18px; }
.bubble.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--forest); color: #fff; border-bottom-right-radius: 6px; }
.meta { font-size: 11px; color: var(--muted); }
.meta.r { align-self: flex-end; }
.pillnote { align-self: center; font-size: 12px; color: var(--muted); background: var(--sand); border-radius: 999px; padding: 5px 12px; text-align: center; }
nav#nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
nav#nav .in { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-around; }
nav#nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 60px; min-height: 52px; font-size: 11px; color: var(--muted); text-decoration: none; }
nav#nav a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
nav#nav a[aria-current="page"] { color: var(--forest); font-weight: 600; }
.badge { position: absolute; top: 2px; right: 10px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red-fg); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); }
.toast.bad { background: var(--red-fg); }
.login { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.wordmark { font-family: var(--serif); font-size: 46px; font-weight: 700; color: var(--forest); line-height: 1; }
.sr { position: absolute; left: -9999px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.sendbar { display: flex; gap: 8px; align-items: flex-end; }
.sendbar textarea { min-height: 48px; height: 48px; }
.miles { display: flex; flex-direction: column; gap: 0; }
.mile { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.mile .ck { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; background: var(--sand); color: var(--muted); }
.mile.done .ck { background: var(--green-bg); color: var(--green-fg); }
@media (min-width: 600px) { main { padding-top: 32px; } }
