/* GovTally — public site styles. Lightweight, no framework. */
:root {
  --ink: #1b2230;
  --muted: #5b6573;
  --line: #e3e7ed;
  --bg: #f5f7fa;
  --paper: #ffffff;
  --accent: #234e9c;
  --accent-soft: #eaf0fb;
  --ai: #6d28d9;
  --ai-soft: #f3edff;
  --dem: #2b6cb0;
  --rep: #c53030;
  --ind: #6b7280;
  --ok: #1a7f5a;
  --no: #b45309;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.2; }
.muted { color: var(--muted); }
.sm { font-size: .82rem; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 5px; font-size: .85em; }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header__inner { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.brand__mark { color: var(--accent); letter-spacing: -3px; margin-right: 4px; }
.search-mini { flex: 1; display: flex; max-width: 460px; }
.search-mini input { flex: 1; border: 1px solid var(--line); border-radius: 8px 0 0 8px; padding: 8px 12px; font-size: .92rem; }
.search-mini button { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 0 8px 8px 0; padding: 0 14px; cursor: pointer; }
.site-nav { display: flex; gap: 16px; margin-left: auto; white-space: nowrap; }
.site-nav a { color: var(--muted); font-size: .92rem; }

/* Footer */
.site-footer { margin-top: 48px; background: #11161f; color: #aeb6c2; padding: 26px 0; font-size: .86rem; }
.site-footer__disclaimer { margin: 0 0 8px; max-width: 80ch; }
.site-footer__disclaimer strong { color: #e7ecf3; }
.site-footer__links a { color: #8fb4f0; }

main.wrap { padding-top: 28px; padding-bottom: 8px; }

/* Hero / home */
.hero { text-align: center; padding: 30px 0 14px; }
.hero h1 { font-size: 2.1rem; letter-spacing: -.02em; margin: 0 0 10px; }
.hero__sub { font-size: 1.1rem; color: var(--muted); max-width: 60ch; margin: 0 auto 22px; }
.search-hero { display: flex; max-width: 620px; margin: 0 auto; box-shadow: var(--shadow); border-radius: 12px; }
.search-hero input { flex: 1; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; padding: 14px 18px; font-size: 1.02rem; }
.search-hero button { border: 0; background: var(--accent); color: #fff; border-radius: 0 12px 12px 0; padding: 0 26px; font-size: 1rem; cursor: pointer; }
.hero__hint { color: var(--muted); margin-top: 12px; }

.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 28px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat__n { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.stat__l { color: var(--muted); font-size: .76rem; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel h2 { font-size: 1.05rem; margin: 0 0 4px; }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin-top: 18px; font-size: .92rem; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips--dense { gap: 5px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .85rem; color: var(--ink); }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); text-decoration: none; }
.chip--sm { padding: 3px 9px; font-size: .8rem; }
.chip__n { color: var(--muted); font-weight: 600; }

/* Search page */
.page-title { margin: 4px 0 16px; }
.search-bar { display: flex; max-width: 560px; margin-bottom: 16px; }
.search-bar input { flex: 1; border: 1px solid var(--line); border-radius: 8px 0 0 8px; padding: 10px 14px; }
.search-bar button { border: 0; background: var(--accent); color: #fff; border-radius: 0 8px 8px 0; padding: 0 20px; cursor: pointer; }
.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.banner--warn { background: #fff7e6; border: 1px solid #ffe1a8; color: #7a4b00; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filter-chip { background: var(--accent); color: #fff; border-radius: 999px; padding: 4px 10px; font-size: .82rem; }
.filter-chip:hover { background: #1a3d7d; text-decoration: none; }
.filter-chip__x { margin-left: 6px; opacity: .8; }
.filter-clear { font-size: .82rem; color: var(--muted); }

.search-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.facets { position: sticky; top: 76px; }
.facet { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.facet h3 { margin: 0 0 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.facet ul { list-style: none; margin: 0; padding: 0; }
.facet li a { display: flex; align-items: center; gap: 7px; padding: 3px 0; color: var(--ink); font-size: .88rem; }
.facet li a:hover { text-decoration: none; color: var(--accent); }
.facet li a.on { font-weight: 700; color: var(--accent); }
.facet__box { width: 15px; height: 15px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; line-height: 13px; text-align: center; color: var(--accent); flex: none; }
.facet li a.on .facet__box { border-color: var(--accent); background: var(--accent-soft); }
.facet__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet__n { color: var(--muted); font-size: .78rem; }

.results__count { color: var(--muted); margin: 0 0 14px; }
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card { display: flex; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.card__avatar img, .card__initials { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; flex: none; }
.card__initials { background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; }
.card__name { font-weight: 700; }
.card__office { color: var(--muted); font-size: .86rem; margin-bottom: 4px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 5px; }

/* Pills */
.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.pill--dem { background: #e7f0fa; color: var(--dem); border-color: #cfe1f5; }
.pill--rep { background: #fbe9e9; color: var(--rep); border-color: #f5d0d0; }
.pill--ind { background: #eef0f3; color: var(--ind); }
.pill--state { background: var(--accent-soft); color: var(--accent); border-color: #d4e1f7; }
.pill--past { background: #f1eee7; color: #8a6d2f; }
.pill--now { background: #e6f6ee; color: var(--ok); border-color: #c6ead7; }

/* Pager */
.pager { display: flex; align-items: center; gap: 16px; justify-content: center; margin: 22px 0; }
.pager__status { color: var(--muted); font-size: .88rem; }
.pager .disabled { color: #c2c8d0; }

/* Empty */
.empty { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; }
.empty--page { margin-top: 30px; }
.empty--page h1 { font-size: 3rem; margin: 0; color: var(--accent); }

/* Dossier (politician + bill) */
.dossier { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 26px 26px; }
.profile { display: flex; gap: 20px; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--line); }
.profile__avatar img, .profile__initials { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; flex: none; }
.profile__initials { background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 2.4rem; }
.profile__id h1 { margin: 0 0 4px; font-size: 1.8rem; }
.profile__office { font-size: 1.05rem; margin: 0 0 8px; }
.profile__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.profile__src { margin: 6px 0 0; font-size: .82rem; }
.profile__ids { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.extid { font-size: .8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }

.toc { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0; position: sticky; top: 60px; background: var(--paper); border-bottom: 1px solid var(--line); z-index: 5; }
.toc a { font-size: .85rem; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--bg); }
.toc a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

.sec { padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 120px; }
.sec:last-child { border-bottom: 0; }
.sec h2 { font-size: 1.25rem; margin: 0 0 10px; }
.sec h3 { font-size: 1rem; margin: 18px 0 8px; }

/* Tables */
.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data th { text-align: left; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--line); padding: 6px 10px; }
.data td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.data tr.is-current { background: #fafcff; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); }

/* Votes */
.vote { display: inline-block; font-weight: 700; font-size: .8rem; padding: 2px 9px; border-radius: 6px; }
.vote--yea { background: #e6f6ee; color: var(--ok); }
.vote--nay { background: #fbe9e9; color: var(--rep); }
.vote--present, .vote--abstain { background: #f1eee7; color: #8a6d2f; }
.vote--other { background: var(--bg); color: var(--muted); }

/* Funding */
.data--funding .bar { display: inline-block; height: 8px; width: var(--w); max-width: 90px; background: var(--accent); border-radius: 4px; margin-right: 7px; vertical-align: middle; }
.ftype { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.ftype--super_pac { background: #fbe9f0; color: #a3236a; }
.ftype--corporate_pac { background: #fff3e0; color: #9a5b00; }
.ftype--big_donor { background: #ede7fb; color: #5b35c9; }
.ftype--small_dollar { background: #e6f6ee; color: var(--ok); }
.ftype--party { background: var(--accent-soft); color: var(--accent); }
.ftype--self_funded { background: #eef0f3; color: var(--ind); }

/* Bills */
.bill-list { list-style: none; padding: 0; margin: 0; }
.bill-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.bill-list__src { margin-top: 4px; }
.bill-head { padding: 24px 0; border-bottom: 1px solid var(--line); }
.bill-head h1 { margin: 4px 0; font-size: 1.7rem; }
.bill-head__title { font-size: 1.1rem; color: var(--ink); margin: 4px 0 10px; }
.bill-summary { font-size: 1.02rem; }

/* Statements */
.statement { border-left: 3px solid var(--line); padding: 8px 0 12px 16px; margin-bottom: 14px; }
.statement__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.statement blockquote { margin: 6px 0; font-size: 1.05rem; font-style: italic; color: var(--ink); }
.statement__sum { color: var(--muted); margin: 6px 0; }
.stance { font-size: .76rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .02em; }
.stance--support { background: #e6f6ee; color: var(--ok); }
.stance--oppose { background: #fbe9e9; color: var(--rep); }
.stance--mixed, .stance--unclear { background: #f1eee7; color: #8a6d2f; }

/* Social */
.social-accounts { display: flex; flex-wrap: wrap; gap: 12px; }
.social-acct { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: .88rem; }
.posts { list-style: none; padding: 0; margin: 12px 0 0; }
.post { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.post__text { margin: 4px 0 8px; }
.post__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---- Provenance chips: THE source-link contract ---- */
.sources { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.src { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; line-height: 1.3; background: var(--accent-soft); color: var(--accent); border: 1px solid #d4e1f7; border-radius: 6px; padding: 2px 7px; }
.src:hover { background: #dbe7fb; text-decoration: none; }
.src__lic { color: var(--muted); font-size: .68rem; border-left: 1px solid #c5d6f1; padding-left: 5px; }
.src--ai { background: var(--ai-soft); color: var(--ai); border-color: #e0d2fb; }
.src--ai .src__lic { border-left-color: #e0d2fb; }
.src--nolink { background: #f5eee9; color: #9a6a3a; border-color: #ecd9c6; }
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ai); flex: none; }

.badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 5px; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.badge--ai { background: var(--ai-soft); color: var(--ai); border: 1px solid #e0d2fb; }

/* Prose (about) */
.prose { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 30px 30px; max-width: 820px; }
.prose h2 { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 8px 0; }
.ok { color: var(--ok); font-weight: 600; }
.no { color: var(--no); font-weight: 600; }

/* Responsive */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .cols, .card-grid { grid-template-columns: 1fr; }
  .search-layout { grid-template-columns: 1fr; }
  .facets { position: static; }
  .site-nav { display: none; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .profile { flex-direction: column; text-align: center; }
  .profile__meta, .profile__ids { justify-content: center; }
}

/* Corrections form (Phase 8 legal layer) — framework-free, matches the site palette. */
.form { display: flex; flex-direction: column; gap: 6px; max-width: 640px; margin-top: 8px; }
.form label { font-size: .82rem; font-weight: 600; color: var(--muted); margin-top: 10px; }
.form input, .form textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  font: inherit; font-size: .95rem; background: var(--paper); color: var(--ink); width: 100%;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form textarea { resize: vertical; }
.form__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.btn {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: 8px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: #1c4185; }
.prose ol { padding-left: 20px; }
.prose ol li { margin: 8px 0; }
.sm { font-size: .85rem; }
