/* Civic Agendas — one stylesheet, no build step. */
:root {
  --paper: #f7f5f0;
  --card: #ffffff;
  --ink: #17191c;
  --ink-2: #4a4f57;
  --ink-3: #737983;
  --rule: #e3dfd6;
  --rule-2: #cfc9bd;
  --accent: #b8460b;
  --accent-ink: #ffffff;
  --accent-soft: #fbeee5;
  --link: #1846b3;
  --good: #1d7a3e;
  --good-soft: #e5f3ea;
  --bad: #b42318;
  --bad-soft: #fbe9e7;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
  --info-soft: #e8eefb;
  --mark: #ffe58a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 25, 28, .06), 0 2px 8px rgba(23, 25, 28, .04);
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131416;
    --card: #1b1d20;
    --ink: #ecebe7;
    --ink-2: #b9bcc2;
    --ink-3: #8d929a;
    --rule: #2c2f34;
    --rule-2: #3b3f45;
    --accent: #f08a4b;
    --accent-ink: #1a0d05;
    --accent-soft: #3a2416;
    --link: #8fb1ff;
    --good: #6fd08f;
    --good-soft: #17301f;
    --bad: #ff8a80;
    --bad-soft: #3a1c1a;
    --warn: #f2c25b;
    --warn-soft: #33290f;
    --info-soft: #1c2639;
    --mark: #6b5a12;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--sans); text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
mark { background: var(--mark); color: inherit; padding: 0 .1em; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; margin-top: 2rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }
small, .muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: .9em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Header */
.top { background: #17191c; color: #f4f1ea; }
@media (prefers-color-scheme: dark) { .top { background: #0b0c0d; border-bottom: 1px solid var(--rule); } }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 800 .82rem/1 var(--sans); letter-spacing: -.02em; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: #e9e6df; text-decoration: none; padding: 7px 11px; border-radius: 7px; font-size: .94rem; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a.cta { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 7px; padding: 6px 10px; font: inherit; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; padding: 0 0 12px; margin: 0; }
  .nav.open { display: flex; }
  .top .wrap { flex-wrap: wrap; }
  .nav a { padding: 10px 12px; }
}

/* Status banner */
.syncbar { background: var(--warn-soft); color: var(--warn); font-size: .88rem; }
.syncbar .wrap { padding-top: 7px; padding-bottom: 7px; display: flex; gap: 10px; align-items: center; }
.spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

main { padding: 28px 0 64px; }

/* Hero + search */
.hero { padding: 34px 0 8px; }
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.1rem); max-width: 17ch; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 60ch; }
.search { display: flex; gap: 8px; margin: 18px 0 10px; position: relative; }
.search input[type="search"] {
  flex: 1; min-width: 0; font: inherit; font-size: 1.08rem; padding: 14px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--rule-2); background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
.search input[type="search"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 1rem/1 var(--sans);
  padding: 14px 20px; border-radius: var(--radius); border: 0; background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--card); color: var(--ink); border: 1.5px solid var(--rule-2); }
.btn.small { padding: 9px 14px; font-size: .92rem; }
.btn.link { background: none; color: var(--link); padding: 0; font-weight: 500; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.suggest li { padding: 9px 12px; border-radius: 7px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.chips a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--rule); color: var(--ink-2); text-decoration: none; font-size: .92rem; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.hint { font-size: .9rem; color: var(--ink-3); }

/* Layout grids */
.grid { display: grid; gap: 24px; }
.grid.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid.halves { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .grid.two, .grid.halves { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 6px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font: 700 1.6rem/1.1 var(--serif); }
.stat span { font-size: .86rem; color: var(--ink-3); }

/* Cards and lists */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 10px; }
.section-head h2 { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 0; border-top: 1px solid var(--rule); }
.list > li:first-child { border-top: 0; }
.item-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.item-title:hover { color: var(--link); text-decoration: underline; }
.meta { font-size: .88rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.snippet { font-size: .93rem; color: var(--ink-2); margin-top: 4px; }
.empty { padding: 18px; text-align: center; color: var(--ink-3); border: 1px dashed var(--rule-2); border-radius: var(--radius); }

/* Day groups (calendar) */
.day { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--rule); }
.day:first-child { border-top: 0; }
.datebox { text-align: center; border-radius: 9px; border: 1px solid var(--rule); background: var(--card); padding: 8px 4px; align-self: start; }
.datebox .dow { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.datebox .dnum { font: 700 1.7rem/1 var(--serif); }
.datebox .mon { font-size: .8rem; color: var(--ink-3); }
.datebox.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.mtg { padding: 2px 0 10px; }
.mtg + .mtg { border-top: 1px dashed var(--rule); padding-top: 10px; }
@media (max-width: 520px) { .day { grid-template-columns: 62px minmax(0, 1fr); gap: 12px; } .datebox .dnum { font-size: 1.35rem; } }

/* Badges */
.badge { display: inline-block; font: 600 .74rem/1.5 var(--sans); padding: 1px 8px; border-radius: 999px; background: var(--info-soft); color: var(--ink-2); letter-spacing: .01em; white-space: nowrap; vertical-align: 1px; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.fileno { font: 600 .82rem/1.4 var(--mono); color: var(--ink-2); }

/* Bill page */
.crumbs { font-size: .9rem; color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-3); }
.headline { font-size: 1.12rem; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); border-left: 4px solid var(--accent); margin: 14px 0 18px; }
.headline.good { background: var(--good-soft); border-color: var(--good); }
.headline.bad { background: var(--bad-soft); border-color: var(--bad); }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; list-style: none; margin: 8px 0 24px; padding: 0; counter-reset: s; }
.steps li { position: relative; padding-top: 22px; font-size: .84rem; color: var(--ink-3); text-align: center; }
.steps li::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--rule); }
.steps li.done::before { background: var(--good); }
.steps li.current::before { background: linear-gradient(90deg, var(--accent) 50%, var(--rule) 50%); }
.steps li.stopped::before { background: var(--bad); }
.steps li.done, .steps li.current { color: var(--ink); font-weight: 600; }
.steps li.current { color: var(--accent); }
@media (max-width: 600px) {
  .steps { grid-auto-flow: row; grid-auto-columns: auto; gap: 0; }
  .steps li { text-align: left; padding: 6px 0 6px 26px; }
  .steps li::before { top: 9px; bottom: auto; left: 0; right: auto; width: 14px; height: 14px; border-radius: 50%; }
  .steps li.current::before { background: var(--accent); }
}
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -8px; width: 2px; background: var(--rule); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink-3); }
.timeline li.good::after { background: var(--good); border-color: var(--good); }
.timeline li.bad::after { background: var(--bad); border-color: var(--bad); }
.timeline li.future::after { border-style: dashed; border-color: var(--accent); }
.timeline .when { font-size: .82rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.timeline .what { font-weight: 600; }
.timeline .why { font-size: .9rem; color: var(--ink-2); }
.timeline .clerk { font-size: .8rem; color: var(--ink-3); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .94rem; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; }
@media (max-width: 480px) { dl.facts { grid-template-columns: 1fr; gap: 0; } dl.facts dd { margin-bottom: 8px; } }

/* Votes */
.tally { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--rule); margin: 8px 0 6px; }
.tally span { display: block; height: 100%; }
.tally .yes { background: var(--good); } .tally .no { background: var(--bad); } .tally .abstain { background: var(--warn); } .tally .absent { background: var(--rule-2); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.voters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; list-style: none; padding: 0; margin: 10px 0 0; font-size: .92rem; }
.voters li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--rule); }
.voters .v-yes { color: var(--good); } .voters .v-no { color: var(--bad); font-weight: 700; } .voters .v-abstain { color: var(--warn); font-weight: 600; } .voters .v-absent { color: var(--ink-3); }
details.vote { border-top: 1px solid var(--rule); padding: 12px 0; }
details.vote:first-of-type { border-top: 0; }
details.vote summary { cursor: pointer; list-style: none; }
details.vote summary::-webkit-details-marker { display: none; }
details.vote summary::after { content: "Show members"; float: right; font-size: .85rem; color: var(--link); }
details.vote[open] summary::after { content: "Hide"; }

/* People */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.person { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; text-decoration: none; color: inherit; }
.person:hover { border-color: var(--accent); }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--rule); flex: none; display: grid; place-items: center; font-weight: 700; color: var(--ink-3); }
.avatar.big { width: 112px; height: 112px; font-size: 2rem; }
.profile { display: flex; gap: 22px; align-items: center; }
@media (max-width: 520px) { .profile { flex-direction: column; align-items: flex-start; } }

/* Forms */
form.stack { display: grid; gap: 14px; }
label { font-weight: 600; font-size: .94rem; }
input[type="text"], input[type="email"], select {
  width: 100%; font: inherit; padding: 11px 13px; border-radius: 8px; border: 1.5px solid var(--rule-2); background: var(--card); color: var(--ink);
}
.seg { display: inline-flex; border: 1.5px solid var(--rule-2); border-radius: 9px; overflow: hidden; }
.seg label { font-weight: 500; padding: 9px 16px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + span { color: var(--accent); font-weight: 700; }
.seg label:has(input:checked) { background: var(--accent-soft); }
.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--info-soft); margin: 0 0 16px; }
.notice.good { background: var(--good-soft); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 6px 0 16px; }
.filters > * { flex: 1 1 200px; }
.filters .btn { flex: 0 0 auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); border: 1px solid var(--rule); background: var(--card); font-size: .92rem; }
.tabs a[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 820px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; }
.plan .price { font: 700 2rem/1 var(--serif); margin: 6px 0 10px; }
.plan ul { padding-left: 18px; margin: 0 0 16px; flex: 1; }
.plan.featured { border: 2px solid var(--accent); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }

footer { border-top: 1px solid var(--rule); padding: 26px 0 40px; font-size: .88rem; color: var(--ink-3); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer a { color: var(--ink-2); }

/* Grid children may shrink below their content (long tables, URLs). */
.grid > * { min-width: 0; }

/* Tables become stacked cards on phones. */
@media (max-width: 640px) {
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  table.stack-sm td { border: 0; padding: 2px 0; }
  table.stack-sm td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: .85rem; }
  table.stack-sm td:first-child { font-weight: 600; }
}

/* AI-generated content (lib/ai): always labeled, visually secondary to the official record */
.badge.ai { background: var(--warn-soft); color: var(--warn); }
.badge.ai-exp { background: var(--warn); color: var(--bg, #fff); }
.ai-experimental { color: var(--warn); font-weight: 600; }
.ai-card { border-left: 3px solid var(--warn); }
.ai-card h3 { font-size: 1rem; margin-top: 12px; }
.ai-changes { margin: 4px 0 8px; padding-left: 1.2em; }
.ai-changes li { margin: 6px 0; }
.ai-quote { color: var(--ink-3); font-size: .88rem; margin-top: 2px; }
.ai-row { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--rule); color: var(--ink-2); text-decoration: none; font-size: .86rem; }
a.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.small { font-size: .76rem; padding: 0 8px; }
.ai-label { font-size: .85rem; color: var(--ink-3); margin: 12px 0 4px; }
.ai-report summary { cursor: pointer; font-size: .85rem; color: var(--link); }
.ai-report form { display: grid; gap: 6px; margin-top: 8px; max-width: 32rem; }
.ai-report textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--card); color: var(--ink); }
.ai-line { margin-top: 4px; font-size: .9rem; color: var(--ink-2); }
.ai-abstain { margin: 0 0 12px; }
