:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f2f0e9;
  --ink: #1c2333;
  --ink-muted: #5b6272;
  --border: #e1ddd2;
  --accent: #8a6a30;
  --accent-ink: #6e5527;
  --accent-bg: #f2e9d6;
  --yea: #2f7d5a;
  --yea-bg: #e4f0e9;
  --nay: #b14a3a;
  --nay-bg: #f5e6e2;
  --present: #6e7787;
  --present-bg: #ececea;
  --enacted: #3d6fb4;
  --enacted-bg: #e4edf7;
  --shadow: 0 1px 2px rgba(28,35,51,0.06), 0 10px 28px rgba(28,35,51,0.06);
  --glow: none;
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141b;
    --surface: #171b24;
    --surface-2: #1e2330;
    --ink: #e9e6dc;
    --ink-muted: #9ca3b4;
    --border: #2a2f3c;
    --accent: #d9b76a;
    --accent-ink: #e9cd8f;
    --accent-bg: #2c2517;
    --yea: #57c08a;
    --yea-bg: #17281f;
    --nay: #e27b6c;
    --nay-bg: #301f1c;
    --present: #9aa3b5;
    --present-bg: #202432;
    --enacted: #6fa3e0;
    --enacted-bg: #182432;
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 10px 28px rgba(0,0,0,0.35);
    --glow: 0 0 0 1px currentColor, 0 0 10px 1px currentColor;
  }
}
:root[data-theme="dark"] {
  --bg: #11141b;
  --surface: #171b24;
  --surface-2: #1e2330;
  --ink: #e9e6dc;
  --ink-muted: #9ca3b4;
  --border: #2a2f3c;
  --accent: #d9b76a;
  --accent-ink: #e9cd8f;
  --accent-bg: #2c2517;
  --yea: #57c08a;
  --yea-bg: #17281f;
  --nay: #e27b6c;
  --nay-bg: #301f1c;
  --present: #9aa3b5;
  --present-bg: #202432;
  --enacted: #6fa3e0;
  --enacted-bg: #182432;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 10px 28px rgba(0,0,0,0.35);
  --glow: 0 0 0 1px currentColor, 0 0 10px 1px currentColor;
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); }
.wrap { max-width: 760px; margin: 0 auto; padding: 2.75rem 1.25rem 5rem; }
header.masthead {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--border);
}
.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
h1.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 2.85rem);
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
.dek { font-size: 1.02rem; color: var(--ink-muted); max-width: 46ch; margin: 0; }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
}
.meta-row strong { color: var(--ink); font-weight: 500; }
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2.25rem;
}
.stat { background: var(--surface); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; }
.stat .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 600; }
.stat .l { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
#readonly-banner {
  display: none;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}
.bills { display: flex; flex-direction: column; gap: 1rem; }
.bill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}
@media (prefers-reduced-motion: reduce) { .bill { animation: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.bill-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 0.55rem; }
.code { font-family: var(--font-mono); font-weight: 600; font-size: 0.86rem; color: var(--accent-ink); }
.chamber { font-size: 0.72rem; color: var(--ink-muted); border-left: 1px solid var(--border); padding-left: 0.55rem; }
.badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 100px;
}
.badge--committee { background: var(--surface-2); color: var(--ink-muted); }
.badge--reported { background: var(--accent-bg); color: var(--accent-ink); }
.badge--floor { background: var(--enacted-bg); color: var(--enacted); }
.badge--enacted { background: var(--yea-bg); color: var(--yea); }
.bill-title { font-family: var(--font-body); font-weight: 600; font-size: 1.08rem; line-height: 1.35; margin: 0 0 0.3rem; text-wrap: balance; }
.bill-action { font-size: 0.86rem; color: var(--ink-muted); margin: 0 0 1rem; }
.bill-action time { font-family: var(--font-mono); font-size: 0.8rem; }
.vote-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 0.65rem; }
.board { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.light {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: none;
  background: var(--surface-2);
  color: var(--ink-muted);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.light:last-child { border-right: none; }
.light:hover { color: var(--ink); }
.light:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.light:disabled { cursor: default; opacity: 0.6; }
.light--yea[aria-pressed="true"] { background: var(--yea); color: #fff; box-shadow: var(--glow); }
.light--nay[aria-pressed="true"] { background: var(--nay); color: #fff; box-shadow: var(--glow); }
.light--present[aria-pressed="true"] { background: var(--present); color: #fff; box-shadow: var(--glow); }
.tally { display: flex; flex-direction: column; gap: 0.3rem; min-width: 140px; flex: 1 1 160px; }
.tally-bar { display: flex; height: 7px; width: 100%; border-radius: 100px; overflow: hidden; background: var(--surface-2); }
.seg { height: 100%; transition: width 0.35s ease; }
.seg--yea { background: var(--yea); }
.seg--nay { background: var(--nay); }
.seg--present { background: var(--present); }
.tally-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-muted); text-align: right; font-variant-numeric: tabular-nums; }
.source-link { font-size: 0.78rem; text-decoration: none; border-bottom: 1px solid transparent; }
.source-link:hover { border-bottom-color: currentColor; }
.card-links { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; }
.details-toggle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.details-toggle:hover { color: var(--ink); }
.details-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.details-toggle .chev { display: inline-block; transition: transform 0.15s ease; font-size: 0.6rem; }
.details-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.details { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.details-grid { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0 0 1rem; font-size: 0.86rem; }
.details-grid dt { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); padding-top: 0.15rem; }
.details-grid dd { margin: 0; }
.details-grid a { color: var(--accent-ink); }
.tracker { display: flex; margin: 0 0 1.1rem; }
.tracker-step {
  flex: 1;
  position: relative;
  padding-top: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-muted);
}
.tracker-step::before {
  content: "";
  position: absolute;
  top: 0.28rem;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  transform: translateX(-50%);
  z-index: 1;
}
.tracker-step::after {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
}
.tracker-step:last-child::after { display: none; }
.tracker-step.is-done, .tracker-step.is-current { color: var(--accent-ink); font-weight: 600; }
.tracker-step.is-done::before, .tracker-step.is-current::before { background: var(--accent); border-color: var(--accent); }
.tracker-step.is-done::after { background: var(--accent); }
.summary-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 0.35rem; }
.summary-label span { text-transform: none; letter-spacing: 0; }
.summary-text { font-size: 0.88rem; line-height: 1.55; margin: 0; }
.summary-empty { font-size: 0.86rem; color: var(--ink-muted); font-style: italic; margin: 0; }
.card-toggles { display: flex; gap: 1rem; flex-wrap: wrap; }

.auth-bar {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.auth-form { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.auth-label { color: var(--ink-muted); }
.auth-email, .auth-name {
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  min-width: 200px;
}
.auth-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  cursor: pointer;
}
.auth-btn:hover { background: var(--accent); color: #fff; }
.auth-status { color: var(--ink); }
.auth-link {
  font: inherit;
  color: var(--accent-ink);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.auth-notice { margin: 0; font-style: italic; }

.comments-panel { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.comment-list { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1rem; }
.comment-item { padding-bottom: 0.9rem; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; padding-bottom: 0; }
.comment-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.3rem;
  font-size: 0.76rem;
}
.comment-author { font-weight: 600; color: var(--ink); }
.comment-date { font-family: var(--font-mono); color: var(--ink-muted); }
.comment-delete {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--nay);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-left: auto;
}
.comment-delete:hover { text-decoration: underline; }
.comment-body { font-size: 0.88rem; line-height: 1.55; margin: 0; white-space: pre-wrap; }
.comment-note { font-size: 0.86rem; color: var(--ink-muted); font-style: italic; margin: 0 0 0.75rem; }
.comment-form { display: flex; flex-direction: column; gap: 0.6rem; }
.comment-textarea {
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 4.5rem;
  resize: vertical;
}
.comment-textarea:disabled { opacity: 0.6; }
.comment-submit {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  cursor: pointer;
}
.comment-submit:hover { background: var(--accent); color: #fff; }
.comment-submit:disabled { opacity: 0.6; cursor: default; }

.error-banner {
  display: none;
  background: var(--nay-bg);
  color: var(--nay);
  border: 1px solid var(--nay);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.loading-note { font-size: 0.88rem; color: var(--ink-muted); font-style: italic; }
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
footer a { color: var(--ink-muted); }
