:root {
  color-scheme: light dark;
  --bg: #f5f6f3;
  --surface: #ffffff;
  --ink: #222c29;
  --muted: #626f69;
  --line: #dce3dc;
  --accent: #23694f;
  --accent-soft: #e9f2ec;
  --on-accent: #ffffff;
  --shadow: 0 3px 16px rgb(22 40 30 / 3%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#131a17; --surface:#1c2520; --ink:#edf2ed; --muted:#acb9b0; --line:#35443a; --accent:#94d4af; --accent-soft:#293f31; --on-accent:#10271b; --shadow:none; }
}
* { box-sizing: border-box; }
body { margin:0; min-width:0; }
a { color:var(--accent); text-underline-offset:3px; overflow-wrap:anywhere; }
button, input, textarea, select { font:inherit; }
button, input, textarea, select { border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); }
button { min-height:44px; padding:9px 16px; cursor:pointer; font-weight:600; }
button:hover { background:var(--accent-soft); }
button:disabled { opacity:.55; cursor:wait; }
button.primary { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
input, textarea, select { width:100%; min-width:0; min-height:48px; padding:11px 12px; }
textarea { min-height:150px; resize:vertical; line-height:1.6; }
label { display:block; font-weight:600; margin:16px 0 7px; }
:focus-visible { outline:3px solid var(--accent); outline-offset:4px; }
h1,h2,h3,p { margin-top:0; }
h1 { font-size:clamp(1.65rem,4vw,2.2rem); line-height:1.2; letter-spacing:-.04em; margin-bottom:0; }
h2 { font-size:1.15rem; line-height:1.35; margin-bottom:12px; }
h3 { font-size:1rem; margin-bottom:8px; }
p { margin-bottom:14px; }
.muted { color:var(--muted); }
.small { font-size:.85rem; }
.eyebrow { font-size:.68rem; letter-spacing:.15em; font-weight:700; color:var(--muted); margin-bottom:9px; }
.site-header { max-width:1120px; margin:auto; padding:24px 16px 16px; display:flex; justify-content:space-between; gap:16px; align-items:center; }
.brand { text-decoration:none; color:var(--ink); font-size:.83rem; letter-spacing:.08em; font-weight:750; }
.brand span { color:var(--muted); margin-left:6px; font-weight:400; }
.site-header p { margin:0; text-align:right; }
.nav { max-width:1088px; margin:0 16px; padding:5px; border:1px solid var(--line); border-radius:14px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; background:var(--surface); }
.nav a { min-height:44px; display:flex; align-items:center; justify-content:center; padding:9px 2px; border-radius:9px; color:var(--muted); font-size:.8rem; text-decoration:none; font-weight:600; }
.nav a[aria-current="page"] { color:var(--accent); background:var(--accent-soft); }
main:not(.login-card) { max-width:1120px; margin:auto; padding:30px 16px 64px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; }
.page-heading button { font-size:.85rem; }
.grid { display:grid; gap:16px; }
.stack { display:grid; gap:16px; }
.card { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:20px; box-shadow:var(--shadow); overflow-wrap:anywhere; }
.card p:last-child { margin-bottom:0; }
.card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; }
.card-head h2 { margin-bottom:4px; }
.card-head p { margin:0; }
.badge { display:inline-block; flex-shrink:0; padding:4px 9px; border:1px solid var(--line); border-radius:20px; font-size:.75rem; font-weight:600; color:var(--muted); }
.badge.accent { background:var(--accent-soft); color:var(--accent); border-color:transparent; }
.actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:20px; }
.actions > button { flex:1 1 auto; }
.chips { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px; }
.chips button { font-size:.8rem; padding:8px 13px; }
.chips button[aria-pressed="true"] { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
.stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
.stat { padding:18px; }
.stat strong { display:block; font-size:1.9rem; line-height:1.2; letter-spacing:-.03em; margin-bottom:7px; }
.stat span { display:block; color:var(--muted); font-size:.85rem; }
.spend-row { display:flex; justify-content:space-between; gap:12px; margin:18px 0 8px; font-size:.88rem; }
progress { display:block; width:100%; height:9px; border:0; border-radius:10px; overflow:hidden; appearance:none; background:var(--line); color:var(--accent); accent-color:var(--accent); }
progress::-webkit-progress-bar { background:var(--line); }
progress::-webkit-progress-value { background:var(--accent); border-radius:10px; }
progress::-moz-progress-bar { background:var(--accent); }
.body-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.75; }
.draft-body { padding:18px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
details { margin-top:12px; }
summary { cursor:pointer; min-height:44px; padding:9px 0; font-weight:600; font-size:.9rem; }
details > .body-text { color:var(--muted); font-size:.9rem; }
.research ul { padding-left:20px; }
.research li { margin:8px 0; }
.data-list { margin:0; }
.data-list div { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:9px 0; border-bottom:1px solid var(--line); }
.data-list dt { color:var(--muted); }
.data-list dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.empty { text-align:center; color:var(--muted); border:1px dashed var(--line); border-radius:16px; padding:40px 20px; }
.toast { position:fixed; bottom:24px; left:16px; right:16px; max-width:560px; margin:auto; padding:16px 20px; background:var(--ink); color:var(--bg); border-radius:12px; box-shadow:0 6px 30px #0003; z-index:10; overflow-wrap:anywhere; }
dialog { max-width:440px; width:calc(100% - 32px); background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:18px; padding:24px; }
dialog::backdrop { background:#0007; }
.login-page { min-height:100svh; display:grid; place-items:center; padding:16px; }
.login-card { width:100%; max-width:430px; padding:32px 24px; background:var(--surface); border:1px solid var(--line); border-radius:20px; box-shadow:var(--shadow); }
.login-card h1 { margin-bottom:16px; }
.login-card form button { width:100%; margin:20px 0; }
.login-card .small { margin:0; }
.skip-link { position:fixed; top:-100px; left:16px; background:var(--surface); padding:12px; z-index:20; }
.skip-link:focus { top:12px; }
[hidden] { display:none !important; }
@media (min-width:720px) {
  .site-header { padding-top:32px; padding-bottom:24px; }
  .nav { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .nav a { font-size:.9rem; }
  main:not(.login-card) { padding-top:40px; }
  .grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .card { padding:24px; }
  .actions > button { flex:0 1 auto; }
}
@media (min-width:1120px) { .nav { margin-left:auto; margin-right:auto; } }
@media (prefers-reduced-motion:no-preference) { button,a { transition:background-color .15s; } }
/* Login: Google button and passphrase fallback */
a.button { display:flex; align-items:center; justify-content:center; min-height:48px; padding:10px 16px; border-radius:10px; font-weight:600; text-decoration:none; border:1px solid var(--line); margin:22px 0 6px; }
a.button.primary { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
a.button.primary:hover { filter:brightness(1.06); }
a.button:focus-visible { outline:3px solid var(--accent-soft); outline-offset:2px; }
.login-card details.fallback { margin-top:14px; }
.login-card details.fallback summary { cursor:pointer; color:var(--muted); font-size:.9rem; }
.login-card details.fallback form { margin-top:10px; }
/* Privacy page */
.login-card.privacy { max-width:640px; }
.login-card.privacy h2 { font-size:1.05rem; margin:20px 0 6px; }
.login-card.privacy p { line-height:1.6; }
