/* Oscoda Township Watch: friendly local news.
   Light by default; dark via the header toggle ([data-theme="dark"] on <html>). */
:root {
  --bg: #fbf8f3;          /* warm off-white */
  --surface: #ffffff;
  --surface-2: #f4efe6;   /* sand */
  --ink: #1d2733;
  --ink-2: #3b4654;
  --muted: #667180;
  --line: #e9e2d6;
  --accent: #1660a8;      /* Lake Huron blue */
  --accent-strong: #0e467e;
  --accent-ink: #ffffff;
  --accent-soft: #e7f0fa;
  --sun: #b4531a;         /* sunset orange (text-safe) */
  --sun-bright: #f08a3c;
  --sun-soft: #fdeedd;
  --chart: #1f6fbf;
  /* Fund series (validated categorical order; see spending chart). --s0 = all other funds. */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s0: #b4bcc6;
  --mark: #fff0b3;
  --good: #1d6b3c;   --good-soft: #e2f3e8;
  --bad: #a7322a;    --bad-soft: #fbe6e3;
  --hold: #7a5d00;   --hold-soft: #fbf1d2;
  --info: #1660a8;   --info-soft: #e7f0fa;
  --neutral: #4d5866; --neutral-soft: #eef0f2;
  --shadow: 0 1px 2px rgba(29, 39, 51, .06), 0 4px 14px rgba(29, 39, 51, .06);
  --shadow-lg: 0 2px 4px rgba(29, 39, 51, .06), 0 12px 32px rgba(29, 39, 51, .10);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #11161c;
  --surface: #19212a;
  --surface-2: #1f2933;
  --ink: #e9edf2;
  --ink-2: #c6ced8;
  --muted: #95a1ae;
  --line: #2a3440;
  --accent: #6aaef0;
  --accent-strong: #9ccbf7;
  --accent-ink: #0d1722;
  --accent-soft: #1a2c40;
  --sun: #f3a463;
  --sun-bright: #f3a463;
  --sun-soft: #352418;
  --chart: #4b95e0;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s0: #5d6874;
  --mark: #5a4a10;
  --good: #82d19c;   --good-soft: #17301f;
  --bad: #f2a097;    --bad-soft: #3a1d1b;
  --hold: #e8cf75;   --hold-soft: #322a10;
  --info: #8cc0f2;   --info-soft: #1a2c40;
  --neutral: #c0c8d1; --neutral-soft: #26303a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; } /* keep #anchors clear of the sticky header */
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 20; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.brand-name { font-weight: 800; font-size: 1.12rem; line-height: 1.1; letter-spacing: -.01em; }
.brand-name small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: 0; }
.mainnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.header-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
/* Phones: a one-row header; sections move to the bottom tab bar. */
@media (max-width: 860px) {
  html { scroll-padding-top: 76px; }
  .site-header .wrap { min-height: 58px; gap: 12px; }
  .mainnav, .header-actions .btn { display: none; }
  .brand-name small { display: none; }
  .header-actions { margin-left: auto; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- tab bar (phones) */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px;
    font: 600 .7rem/1.1 var(--font); color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent; position: relative; }
  .tabbar [aria-current="page"] { color: var(--accent); font-weight: 800; }
  .tabbar [aria-current="page"]:not(.tab-ask)::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .tab-ask { color: var(--accent); font-weight: 800; }
  .tab-ask-btn { width: 50px; height: 50px; margin-top: -20px; border-radius: 999px; display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); border: 3px solid var(--surface);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 38%, transparent); }
  .tab-ask:active .tab-ask-btn { transform: scale(.94); }
}

/* ---------------------------------------------------------------- sheets (More, Ask) */
dialog.sheet { border: 0; padding: 16px 20px 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow-y: auto; overscroll-behavior: contain; }
dialog.sheet:focus { outline: none; }
dialog.sheet::backdrop { background: rgba(12, 17, 24, .45); }
.sheet-grip { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: -6px auto 12px; }
.more-sheet { width: min(440px, calc(100% - 32px)); border-radius: var(--radius); }
.more-list { list-style: none; margin: 0; padding: 0; }
.more-list a, .more-list button { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 13px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; text-decoration: none; color: var(--ink); font: inherit; cursor: pointer; }
.more-list span { font-size: .85rem; color: var(--muted); }
.more-list [aria-current] strong { color: var(--accent); }
.more-foot { margin: 14px 4px 0; color: var(--muted); }
@media (max-width: 860px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88dvh; border-radius: 20px 20px 0 0;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet-up .22s ease-out; }
}
@media (min-width: 861px) { .sheet-grip { display: none; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }

/* ---------------------------------------------------------------- Ask launcher + panel */
.ask-fab { position: fixed; right: 24px; bottom: 24px; z-index: 25; display: inline-flex; align-items: center; gap: 12px; padding: 9px 22px 9px 9px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; text-align: left;
  box-shadow: var(--shadow-lg); cursor: pointer; transition: border-color .15s, transform .15s; }
.ask-fab:hover { border-color: var(--accent); transform: translateY(-1px); }
.ask-fab-badge { width: 40px; height: 40px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.ask-fab-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.ask-fab-text strong { font-size: .95rem; font-weight: 800; }
.ask-fab-text span { font-size: .8rem; font-weight: 500; color: var(--muted); }
.ask-fab:hover .ask-fab-text strong { color: var(--accent); }
.ask-teaser { position: fixed; z-index: 26; right: 24px; bottom: 96px; max-width: 290px; display: flex; align-items: flex-start; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px 6px 12px 14px; animation: teaser-in .3s ease-out; }
.ask-teaser[hidden] { display: none; }
.ask-teaser::after { content: ""; position: absolute; bottom: -7px; right: 44px; width: 12px; height: 12px; background: var(--surface);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.ask-teaser-body { font: 600 .92rem/1.4 var(--font); color: var(--ink); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.ask-teaser-x { background: none; border: 0; color: var(--muted); font: 400 1.3rem/1 var(--font); padding: 0 6px; cursor: pointer; }
@keyframes teaser-in { from { transform: translateY(8px); opacity: 0; } }
.ask-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ask-panel-head h2 { font-size: 1.2rem; }
.ask-panel-head .icon-btn { width: 34px; height: 34px; }
.ask-panel-note { margin: 6px 0 12px; }
.ask-panel .ask-row { margin-top: 8px; }
.ask-panel .ask-row .ask-scope { flex-direction: row; align-items: center; gap: 6px; }
.ask-panel .examples { margin: 12px 0 0; gap: 6px; }
.ask-panel .examples button { text-align: left; font-size: .86rem; padding: 6px 12px; }
.ask-panel .answer { padding: 2px 16px; margin-top: 14px; box-shadow: none; }
.ask-sources-title { font-size: 1rem; margin: 16px 0 6px; }
@media (min-width: 861px) {
  .ask-panel { margin: auto 24px 24px auto; width: 430px; max-width: calc(100% - 48px); max-height: calc(100dvh - 48px);
    border: 1px solid var(--line); border-radius: var(--radius); animation: teaser-in .2s ease-out; }
  .ask-panel::backdrop { background: rgba(12, 17, 24, .18); }
}
@media (max-width: 860px) {
  .ask-fab { display: none; }
  .ask-teaser { left: 16px; right: 16px; margin: 0 auto; max-width: 340px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .ask-teaser::after { right: auto; left: 50%; margin-left: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.sheet, .ask-panel, .ask-teaser { animation: none; }
}

/* ---------------------------------------------------------------- type */
h1, h2, h3, h4 { line-height: 1.18; margin: 0; letter-spacing: -.015em; font-weight: 800; }
.page-head { padding: 34px 0 18px; }
.page-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.page-head p { margin: 10px 0 0; color: var(--ink-2); max-width: 62ch; font-size: 1.05rem; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 40px 0 14px; font-size: 1.3rem; font-weight: 800; }
.section-title a { font-size: .92rem; font-weight: 600; text-decoration: none; }
.section-title a:hover { text-decoration: underline; }
.kicker { font-size: .8rem; font-weight: 700; color: var(--sun); margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.kicker .dot::before { content: "•"; margin: 0 7px; color: var(--muted); opacity: .7; }
.dek { font-size: 1.05rem; line-height: 1.55; color: var(--ink-2); margin: 8px 0 0; }
.tag-upcoming { background: var(--info-soft); color: var(--info); border-radius: 999px; padding: 2px 8px; font-size: .72rem; margin-left: 8px; }

/* ---------------------------------------------------------------- hero */
.hero { background: linear-gradient(135deg, #0f4f8f 0%, #1a6fbd 58%, #3b8fd6 100%); color: #fff; border-radius: 0 0 28px 28px; padding: 38px 0 30px; position: relative; overflow: hidden; }
:root[data-theme="dark"] .hero { background: linear-gradient(135deg, #0b2742 0%, #12406c 60%, #1a568f 100%); }
.hero h1 { font-size: clamp(1.8rem, 4.4vw, 2.7rem); max-width: 22ch; }
.hero p { margin: 10px 0 0; font-size: 1.08rem; opacity: .92; max-width: 58ch; }
.hero .searchbar { margin-top: 20px; max-width: 620px; }
.hero .searchbar input { border: 0; box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 1rem; }
.hero .searchbar .btn { background: var(--sun-bright); color: #1d1206; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-stat { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 10px 14px; min-width: 140px; color: #fff; text-decoration: none; }
.hero-stat:hover { background: rgba(255,255,255,.2); color: #fff; }
.hero-stat b { display: block; font-size: 1.45rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: .84rem; opacity: .9; }

/* ---------------------------------------------------------------- layout */
.front { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; margin-top: 28px; }
@media (max-width: 960px) { .front { grid-template-columns: 1fr; } }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- cards */
.card, .story, .panel, .rail-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.story { padding: 18px 20px; display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .12s ease; }
.story:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.story h3 { font-size: 1.2rem; }
.story h3 a { color: var(--ink); text-decoration: none; }
.story h3 a::after { content: ""; position: absolute; inset: 0; }
.story { position: relative; }
.story .kicker a, .story .chip { position: relative; z-index: 1; }
.story .dek { font-size: .98rem; }
.story .chips { margin-top: auto; padding-top: 12px; }
.story.compact h3 { font-size: 1.05rem; }
.stack > .story + .story { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); text-decoration: none; border: 1px solid transparent; }
.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-ink); }

.lead { padding: 26px 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); position: relative; }
.lead::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 5px; border-radius: 0 4px 4px 0; background: var(--sun-bright); }
.lead h2 { font-size: clamp(1.6rem, 3.6vw, 2.25rem); }
.lead h2 a { color: var(--ink); text-decoration: none; }
.lead h2 a:hover { color: var(--accent); }
.lead .dek { font-size: 1.12rem; }
.lead-label { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sun); background: var(--sun-soft); border-radius: 999px; padding: 3px 10px; margin-bottom: 10px; }
.why { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin: 18px 0; display: flex; gap: 12px; }
.why svg { flex: none; color: var(--accent); margin-top: 3px; }
.why strong { display: block; font-size: .85rem; color: var(--accent); margin-bottom: 2px; }
.why p { margin: 0; color: var(--ink); }

/* ---------------------------------------------------------------- outcomes */
.decisions { list-style: none; padding: 0; margin: 0; }
.decisions li { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.decisions li:first-child { border-top: 0; }
.decisions .d-title { font-weight: 700; }
.decisions .d-title a { color: inherit; text-decoration: none; }
.decisions .d-title a:hover { color: var(--accent); }
.decisions .d-desc { grid-column: 2; color: var(--ink-2); font-size: .96rem; }
.decisions .d-meta { grid-column: 2; font-size: .84rem; color: var(--muted); }
.outcome { font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; align-self: start; margin-top: 1px; display: inline-flex; gap: 5px; align-items: center; }
.o-approved { color: var(--good); background: var(--good-soft); }  .o-approved::before { content: "✓"; }
.o-denied { color: var(--bad); background: var(--bad-soft); }      .o-denied::before { content: "✕"; }
.o-tabled { color: var(--hold); background: var(--hold-soft); }    .o-tabled::before { content: "⏸"; }
.o-scheduled { color: var(--info); background: var(--info-soft); } .o-scheduled::before { content: "◷"; }
.o-discussed, .o-other { color: var(--neutral); background: var(--neutral-soft); } .o-discussed::before { content: "💬"; font-size: .7rem; }
.card-pad { padding: 6px 20px; }

/* ---------------------------------------------------------------- rail */
.rail-card { padding: 18px 20px; margin-bottom: 16px; }
.rail-card > h2 { font-size: 1.05rem; display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; }
.rail-card > h2 a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.upcoming { list-style: none; padding: 0; margin: 0; }
.upcoming li { display: grid; grid-template-columns: 50px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.upcoming li:first-child { border-top: 0; }
.datebox { text-align: center; border-radius: 10px; background: var(--sun-soft); padding: 5px 0 7px; align-self: start; }
.datebox .mo { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--sun); }
.datebox .dy { font-size: 1.35rem; font-weight: 800; line-height: 1; color: var(--ink); }
.upcoming .u-board { font-size: .78rem; font-weight: 700; color: var(--muted); }
.upcoming .u-title { font-weight: 700; line-height: 1.35; color: var(--ink); text-decoration: none; display: block; margin-top: 1px; }
.upcoming .u-title:hover { color: var(--accent); }
.upcoming .u-when { font-size: .82rem; color: var(--sun); font-weight: 600; margin-top: 2px; }
.list-card { list-style: none; margin: 0; padding: 0; }
.list-card li { padding: 10px 0; border-top: 1px solid var(--line); }
.list-card li:first-child { border-top: 0; }
.list-card a.i-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.list-card a.i-name:hover { color: var(--accent); }
.list-card .i-meta { font-size: .84rem; color: var(--muted); }
.money .big { font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.money .lbl { font-size: .88rem; color: var(--muted); }
.money ul { list-style: none; margin: 12px 0 0; padding: 0; font-size: .92rem; }
.money li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.signup { background: linear-gradient(135deg, var(--sun-soft), var(--accent-soft)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.signup h3 { font-size: 1.15rem; margin-bottom: 4px; }
.signup p { margin: 0 0 14px; font-size: .95rem; color: var(--ink-2); }

/* ---------------------------------------------------------------- buttons/forms */
.btn { display: inline-flex; align-items: center; gap: 6px; font: 700 .95rem/1 var(--font); padding: 11px 18px; border-radius: 999px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); color: var(--accent); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.sun { background: var(--sun-bright); color: #1d1206; }
.btn:disabled { opacity: .6; cursor: wait; }
input[type=search], input[type=email], input[type=text], input[type=password], input[type=date], select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; max-width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.searchbar { display: flex; gap: 8px; }
.searchbar input { flex: 1; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 6px; font-size: .88rem; color: var(--muted); }
.filters label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 600; }
.tabs a:hover { border-color: var(--accent); }
.tabs a[aria-current] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 28px 0; }

/* ---------------------------------------------------------------- article */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 36px; padding-top: 30px; }
@media (max-width: 960px) { .article { grid-template-columns: 1fr; gap: 8px; } }
.article h1 { font-size: clamp(1.9rem, 4.6vw, 2.7rem); }
.article .dek { font-size: 1.18rem; }
.ai-note { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin: 22px 0; }
.ai-note svg { flex: none; margin-top: 2px; }
.prose { font-size: 1.1rem; line-height: 1.75; color: var(--ink); max-width: 68ch; }
.prose p { margin: 0 0 1.05em; }
.prose h3 { font-size: 1.3rem; margin: 1.5em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.05em; }
.prose li { margin-bottom: .4em; }
.panel { padding: 18px 20px; margin-bottom: 16px; }
.panel h2, .panel h3 { font-size: 1rem; margin: 0 0 10px; }
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.doclist li:first-child { border-top: 0; }
.doclist .k { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 64px; }
.follow { display: flex; flex-wrap: wrap; gap: 8px; }
.transcript { list-style: none; padding: 0; margin: 10px 0 0; max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.transcript li { padding: 7px 14px; border-top: 1px solid var(--line); font-size: .96rem; }
.transcript li:first-child { border-top: 0; }
.transcript li:target { background: var(--mark); }
.ts { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; margin-right: 8px; }
.speaker { font-weight: 700; margin-right: 4px; }
details > summary { cursor: pointer; font-weight: 700; }
.filter { width: 100%; max-width: 380px; margin: 12px 0 4px; }

/* ---------------------------------------------------------------- timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 3px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 22px 10px; }
.timeline > li::before { content: ""; position: absolute; left: -36px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); }
.timeline > li.preview::before { border-color: var(--sun-bright); }
.timeline .t-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.timeline .t-date { font-size: .82rem; font-weight: 700; color: var(--sun); }
.timeline h3 { font-size: 1.15rem; margin: 3px 0 0; }
.timeline h3 a { color: var(--ink); text-decoration: none; }
.timeline h3 a:hover { color: var(--accent); }
.timeline .decisions { margin-top: 8px; }
.timeline .decisions li { padding: 8px 0; }

/* ---------------------------------------------------------------- data */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.data { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .v { font-size: 1.8rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font: 12px var(--font); }
.chart .bar { fill: var(--chart); }
.chart .hit { fill: transparent; }
.chart g.b:hover .bar, .chart g.b:focus .bar { fill: var(--sun-bright); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .82rem; font-weight: 700; padding: 6px 10px; border-radius: 8px; transform: translate(-50%, -110%); white-space: nowrap; display: none; z-index: 3; }
.chart-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 8px 0; font-size: .92rem; }
.hbars .track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbars .fill { height: 100%; background: var(--chart); border-radius: 999px; }
.hbars .amt { font-variant-numeric: tabular-nums; font-weight: 700; }
.hbars a { color: var(--ink); text-decoration: none; font-weight: 600; }
.hbars a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- search/ask */
.results { list-style: none; padding: 0; margin: 0; }
.results > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.results .r-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.results .r-title:hover { color: var(--accent); }
.snippet { margin: 6px 0 0; color: var(--ink-2); font-size: .96rem; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
.ask-form textarea { width: 100%; resize: vertical; font-size: 1.08rem; }
.ask-row { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: 10px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.ask-row label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.examples { margin: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .92rem; }
.examples button { font: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; color: var(--ink-2); }
.examples button:hover { border-color: var(--accent); color: var(--accent); }
.answer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 22px; margin-top: 18px; line-height: 1.7; }
.cite { display: inline-block; font-size: .7rem; font-weight: 800; min-width: 1.5em; text-align: center; padding: 0 5px; margin: 0 1px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); text-decoration: none; vertical-align: super; line-height: 1.4; }
.sources { padding-left: 1.2em; font-size: .92rem; }
.error { color: var(--bad); }

/* ---------------------------------------------------------------- alerts */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin: 6px 0 4px; }
.checks label { display: flex; gap: 9px; align-items: flex-start; padding: 5px 0; }
.checks input, fieldset input[type=checkbox], fieldset input[type=radio] { margin-top: 5px; accent-color: var(--accent); width: 17px; height: 17px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 16px; background: var(--surface); box-shadow: var(--shadow); }
legend { font-weight: 800; padding: 0 6px; }
.notice { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 18px; }
.feeds li { margin-bottom: 6px; }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: 64px; background: var(--surface); border-top: 1px solid var(--line); padding: 34px 0 40px; font-size: .92rem; color: var(--muted); }
.site-footer .cols-3 { gap: 28px; }
.site-footer h4 { font-size: .95rem; color: var(--ink); margin-bottom: 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 5px; }
.empty { color: var(--muted); padding: 16px 0; }
.empty-card { text-align: center; padding: 36px 24px; color: var(--ink-2); }
.empty-card svg { color: var(--accent); }

/* ---------------------------------------------------------------- spending */
.spend-bar { position: sticky; top: 64px; z-index: 5; background: var(--bg);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 0; margin: 4px 0 0; border-bottom: 1px solid var(--line); }
.spend-bar .presets { margin: 0; }
.spend-bar .range { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; font-size: .8rem; font-weight: 700; color: var(--muted); }
.spend-bar .range label { display: flex; flex-direction: column; gap: 2px; }
.spend-bar input[type=month] { font: inherit; font-size: .9rem; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; width: 11.5em; }
.spend-bar .btn { padding: 7px 14px; }
.pills { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pill { font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; border: 1px solid transparent; }
.pill:hover { border-color: var(--accent); }
@media (max-width: 860px) { .spend-bar { position: static; } }
.stat .v a { color: inherit; text-decoration: none; }
.stat .v a:hover { color: var(--accent); }
.delta { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-top: 6px; }
.delta.muted { color: var(--muted); font-weight: 600; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; margin-bottom: 8px; }
.chart-hint { margin: 0; max-width: 46ch; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; }
.legend a { color: inherit; text-decoration: none; display: flex; align-items: center; }
.legend a:hover { color: var(--accent); text-decoration: underline; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--s0); }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); }
.sw.s4 { background: var(--s4); } .sw.s5 { background: var(--s5); }
.sw.nodata-sw { background: repeating-linear-gradient(45deg, var(--line) 0 2px, transparent 2px 4px); border: 1px solid var(--line); }
.chart.stacked { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.chart .seg { fill: var(--s0); transition: opacity .12s; }
.chart .seg.s1 { fill: var(--s1); } .chart .seg.s2 { fill: var(--s2); } .chart .seg.s3 { fill: var(--s3); }
.chart .seg.s4 { fill: var(--s4); } .chart .seg.s5 { fill: var(--s5); }
.chart a.b { cursor: pointer; outline: none; }
.chart a.b.dim .seg { opacity: .28; }
.chart a.b:hover .seg, .chart a.b:focus-visible .seg { opacity: 1; }
.chart a.b:focus-visible .hit { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.chart a.b:hover .hit { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.chart .selband { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.chart .brush { fill: color-mix(in srgb, var(--accent) 18%, transparent); stroke: var(--accent); stroke-width: 1; display: none; pointer-events: none; }
.chart .nodata { fill: url(#hatch); }
.hatch-line { stroke: var(--line); stroke-width: 2.5; }
.chart .gap text { fill: var(--muted); font: italic 11px var(--font); }
.chart .grid line.yr { stroke: var(--muted); stroke-opacity: .35; stroke-dasharray: 2 3; }
.chart .brk { stroke: var(--surface); stroke-width: 2.5; fill: none; }
.chart .cap-label { fill: var(--ink); font: 700 12px var(--font); }
.chart-tip strong { display: block; }
.chart-tip span { display: block; font-weight: 500; opacity: .85; }
.chart-tip span:empty { display: none; }
.hbars .pct { font-weight: 600; color: var(--muted); font-size: .82rem; margin-left: 4px; display: inline-block; min-width: 3ch; text-align: right; }
.hbars .fill.s1 { background: var(--s1); } .hbars .fill.s2 { background: var(--s2); } .hbars .fill.s3 { background: var(--s3); }
.hbars .fill.s4 { background: var(--s4); } .hbars .fill.s5 { background: var(--s5); } .hbars .fill.s0 { background: var(--s0); }
.hbars .meta { grid-column: 1 / -1; }
.hbars a[aria-current] { color: var(--accent); }
.spend-grid { row-gap: 0; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 10px 0; }
.list-head p { margin: 0; }
.list-head .tabs { margin: 0; }
.list-head .csv { margin-left: auto; padding: 7px 14px; font-size: .88rem; }

/* Spending on phones: compact filters and KPIs, a chart you swipe instead of squint at, bills as cards. */
@media (max-width: 700px) {
  .spend-bar { gap: 10px; }
  .spend-bar .presets { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 16px); margin-right: -16px; padding: 2px 16px 4px 0; scrollbar-width: none; }
  .spend-bar .presets::-webkit-scrollbar { display: none; }
  .spend-bar .presets .chip { flex: none; padding: 7px 12px; }
  .spend-bar .range { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
  .spend-bar .range label { min-width: 0; }
  .spend-bar input[type=month] { width: 100%; min-width: 0; font-size: .8rem; padding: 7px 4px 7px 7px; }
  .spend-bar .range .btn { padding: 7px 11px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis .stat { padding: 12px 14px; }
  .kpis .stat .v { font-size: 1.35rem; }
  .kpis .stat .l, .kpis .delta { font-size: .78rem; }
  .kpis .stat:first-child { grid-column: 1 / -1; }
  .kpis .stat:first-child .v { font-size: 1.8rem; }
  .chart-box { padding: 14px 12px; }
  .spend-grid table.data th, .spend-grid table.data td { padding: 9px 11px; }
  .spend-grid table.data tbody tr:nth-child(n+6) { display: none; }
  table.bills thead { display: none; }
  table.bills tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "vendor amt" "desc desc" "fund fund" "date src";
    gap: 3px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.bills tr:last-child { border-bottom: 0; }
  table.bills td { padding: 0; border: 0; }
  table.bills td.empty { grid-column: 1 / -1; }
  table.bills .c-vendor { grid-area: vendor; font-weight: 600; }
  table.bills .c-amt { grid-area: amt; font-weight: 700; }
  table.bills .c-desc { grid-area: desc; font-size: .88rem; }
  table.bills .c-fund { grid-area: fund; color: var(--muted); }
  table.bills .c-fund div { display: inline; }
  table.bills .c-fund div::before { content: " · "; }
  table.bills .c-date { grid-area: date; font-size: .8rem; color: var(--muted); }
  table.bills .c-src { grid-area: src; text-align: right; }
  .list-head .csv { margin-left: 0; }
}

/* Timeline: full history on wide screens, one year at a time on phones. */
.chart .defs, svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.tl-mobile, .hint-narrow { display: none; }
.chart.year { touch-action: pan-y; }
.chart.year .axis text { font-size: 11px; }
.chart a.b.picked .seg { stroke: var(--ink); stroke-width: 1.5; }
.chart a.b.picked .hit { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.yc + .yc { margin-top: 18px; }
.yc.js-hidden, .yc[hidden] { display: none; }
.yc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 6px; }
.yc-head h3 { margin: 0; font-size: 1.05rem; text-align: center; flex: 1; }
.yc-head h3 a { color: var(--ink); text-decoration: none; }
.yc-head h3 span { font-variant-numeric: tabular-nums; margin-left: 6px; }
.yc-head small { font-weight: 600; font-size: .78rem; }
.yc-nav { width: 42px; height: 42px; flex: none; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 1.4rem/1 var(--font); cursor: pointer; }
.yc-nav:disabled { opacity: .3; cursor: default; }
.yc-pick { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 3px; }
.yc-pick[hidden] { display: none; }
.yc-pick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.yc-pick-actions .btn { padding: 8px 14px; font-size: .9rem; }
@media (max-width: 700px) {
  .tl-desktop, .hint-wide { display: none; }
  .tl-mobile { display: block; }
  .hint-narrow { display: inline; }
}
