/* The per-politician page. Tokens lifted unchanged from scorecard.html so the two
   surfaces are one design, and so a reader arriving from the scorecard does not
   feel they have left the site.

   A stylesheet rather than a <style> block: this page is served per politician and
   the CSS is identical across all of them, so a linked file is cached once for the
   whole site instead of re-sent with every card. */
:root{
  --page:#f4f2ee; --card:#fdfcfa; --ink:#171512; --ink-2:#514d45; --muted:#8a857b;
  --line:#e4e0d7; --line-2:#efece4;
  --brass:#8a5a1e; --brass-fill:#a9772f; --brass-soft:#f1e6d4;
  /* Categorical -- WHICH source of money -- so deliberately clear of the
     good/warn/crit palette, which encodes polarity. Same values the
     scorecard's funding profile uses. */
  --data-1:#2a78d6; --data-2:#1baf7a; --leftover:#b8b2a6;
  --good:#0ca30c; --warn:#c98a00; --serious:#d16b34; --crit:#d03b3b;
  --good-soft:#e4f3e2; --warn-soft:#f7ecd0; --serious-soft:#f7e6da; --crit-soft:#f7dede;
  --ring:#e9e5db;
  --shadow:0 1px 2px rgba(23,21,18,.04),0 6px 20px -12px rgba(23,21,18,.18);
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Times New Roman",serif;
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
}
/* Guarded so an explicit light choice beats a dark OS, matching scorecard.html. */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --page:#0e0d0b;--card:#171613;--ink:#f3f1ea;--ink-2:#c3bfb4;--muted:#8f8a7f;
  --line:#2a2823;--line-2:#211f1b;
  --brass:#d8ab63;--brass-fill:#bf8322;--brass-soft:#2a2115;
  --data-1:#3987e5;--data-2:#199e70;--leftover:#5a554b;
  --good:#3ec24a;--warn:#e0a63a;--serious:#e2895c;--crit:#e26060;
  --good-soft:#16241a;--warn-soft:#2a2413;--serious-soft:#2a1d14;--crit-soft:#2a1616;
  --ring:#2c2a24;--shadow:0 1px 2px rgba(0,0,0,.3),0 8px 26px -14px rgba(0,0,0,.6);}}
:root[data-theme="dark"]{
  --page:#0e0d0b;--card:#171613;--ink:#f3f1ea;--ink-2:#c3bfb4;--muted:#8f8a7f;
  --line:#2a2823;--line-2:#211f1b;
  --brass:#d8ab63;--brass-fill:#bf8322;--brass-soft:#2a2115;
  --data-1:#3987e5;--data-2:#199e70;--leftover:#5a554b;
  --good:#3ec24a;--warn:#e0a63a;--serious:#e2895c;--crit:#e26060;
  --good-soft:#16241a;--warn-soft:#2a2413;--serious-soft:#2a1d14;--crit-soft:#2a1616;
  --ring:#2c2a24;--shadow:0 1px 2px rgba(0,0,0,.3),0 8px 26px -14px rgba(0,0,0,.6);}

*{box-sizing:border-box}
body{margin:0;background:var(--page);color:var(--ink);font-family:var(--sans);
     font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased}
.wrap{max-width:760px;margin:0 auto;padding-block:34px 64px;
      padding-left:22px;padding-right:22px}
a{color:var(--brass)}
:focus-visible{outline:2px solid var(--brass);outline-offset:2px;border-radius:4px}

h1{font-family:var(--serif);font-size:31px;line-height:1.18;letter-spacing:-.02em;
   margin:0 0 6px;font-weight:600;text-wrap:balance}
.sub{margin:0 0 4px;font-size:13px;color:var(--muted)}

/* The masthead, laid out as a scorecard row. */
.row1{display:flex;flex-wrap:wrap;gap:15px;align-items:center}
.row1 .id{flex:1;min-width:0}
.chan{flex:none;display:grid;gap:2px;justify-items:end;text-align:right}
.chan a{color:var(--brass);text-decoration:none;font-size:11.5px;white-space:nowrap;
        border-bottom:1px solid transparent}
.chan a:hover,.chan a:focus-visible{border-bottom-color:currentColor}
/* Same 60px circle as the scorecard's, and removed by onerror when absent: most
   of the roster has no portrait, and an empty frame reads as a missing person. */
.photo{width:60px;height:60px;border-radius:50%;flex:none;object-fit:cover;
       background:var(--ring)}
/* At phone width three columns squeeze the name to nothing, so the channels wrap
   to their own line under the name and portrait rather than being hidden --
   content the page is published to carry must survive a narrow viewport. */
@media(max-width:560px){.chan{order:4;flex-basis:100%;justify-items:start;
                              text-align:left;grid-auto-flow:column;
                              justify-content:start;gap:12px}}
.seat{display:inline-block;font-family:var(--mono);font-size:10.5px;letter-spacing:.08em;
      text-transform:uppercase;padding:1px 7px;border-radius:7px;margin-left:4px;
      border:1px solid var(--line);color:var(--ink-2);background:var(--line-2)}

section{margin-top:30px;padding-top:15px;border-top:1px solid var(--line)}
h2{margin:0 0 4px;font-family:var(--mono);font-size:11.5px;letter-spacing:.14em;
   text-transform:uppercase;color:var(--brass);font-weight:600;
   display:flex;flex-wrap:wrap;gap:6px 12px;align-items:baseline}
/* The denominator, printed. The scorecard showed "Transparency 100" against two
   issues in twenty-nine and never said so anywhere on the card. */
h2 .cov{font-size:11.5px;letter-spacing:0;text-transform:none;color:var(--muted);
        font-weight:400;font-variant-numeric:tabular-nums}
.note,.empty{margin:0 0 12px;font-size:12.5px;color:var(--muted);max-width:68ch}

.iss{padding:13px 0;border-bottom:1px solid var(--line-2)}
.iss:last-of-type{border-bottom:none}
.iss h3{margin:0;font-size:15px;font-weight:600;display:flex;flex-wrap:wrap;
        gap:8px 12px;align-items:baseline}
/* Right-justified: the verdict is the thing a reader scans down the column for,
   and a badge that starts wherever the title happens to end cannot be scanned. */
.iss h3 .badge{margin-left:auto}
blockquote{margin:9px 0 0;padding-left:11px;border-left:2px solid var(--ring);
           font-family:var(--serif);font-style:italic;font-size:14.5px;color:var(--ink-2)}
.meta{margin:6px 0 0;font-size:12px;color:var(--muted)}
.meta b{font-family:var(--mono);color:var(--ink-2);font-weight:600}

/* Each verdict carries a glyph as well as a hue: these must read under
   deuteranopia and in a grayscale screenshot, which is the discipline the
   scorecard's status bars follow with texture. */
.badge{display:inline-flex;align-items:baseline;gap:5px;font-size:10.5px;font-weight:600;
       font-family:var(--mono);letter-spacing:.06em;text-transform:uppercase;
       border-radius:7px;padding:2px 8px;border:1px solid transparent;white-space:nowrap}
.badge::before{font-weight:700;font-size:11px}
.badge.confirmed{background:var(--good-soft);color:var(--good);border-color:var(--good)}
.badge.confirmed::before{content:"\2713"}
.badge.untested{background:var(--ring);color:var(--muted);border-color:var(--line)}
.badge.untested::before{content:"\2013"}
.badge.flag{background:var(--serious-soft);color:var(--serious);border-color:var(--serious)}
.badge.flag::before{content:"\2691"}

/* The receipts. Monospaced so ids line up when there are twelve of them. */
.calls{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0 0}
.rc{font-family:var(--mono);font-size:11.5px;text-decoration:none;color:var(--ink-2);
    border:1px solid var(--line);border-radius:6px;padding:2px 7px;background:var(--page);
    font-variant-numeric:tabular-nums;white-space:nowrap}
.rc span{color:var(--good);font-weight:600}
.rc:hover,.rc:focus-visible{border-color:var(--brass);color:var(--brass)}

.ask{margin:9px 0 0;display:flex;gap:9px;align-items:flex-start;
     background:var(--brass-soft);border-radius:9px;padding:9px 11px}
.ask span{flex:none;font-family:var(--mono);font-size:10px;letter-spacing:.1em;
          text-transform:uppercase;color:var(--brass);font-weight:600;padding-top:2px}
.ask q{font-family:var(--serif);font-size:14px;color:var(--ink);font-style:italic}

.chips{display:flex;flex-wrap:wrap;gap:5px;margin:0}
.chip{font-size:11.5px;color:var(--muted);border:1px dashed var(--line);
      border-radius:6px;padding:2px 8px}

code{font-family:var(--mono);font-size:12.5px}
footer{margin-top:38px;padding-top:15px;border-top:1px solid var(--line);
       font-size:12px;color:var(--muted);max-width:68ch}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* A cast that did NOT advance the measure. The word alone cannot carry this: on a
   resolution to end an operation a Nay is the vote against, so the receipts are
   coloured by what the cast did, never by which word it was. */
.rc.against{border-color:var(--serious)}
.rc.against span{color:var(--serious)}
.rc.against:hover,.rc.against:focus-visible{border-color:var(--serious);color:var(--serious)}

/* The tail of the question list. Ranked by how often the chamber voted, so what
   folds is what it returned to least. */
.more{margin-top:6px}
/* The rest of the ballot (gh #386). Collapsed: it is context, not the subject of the
   page, and a seat can carry six or more names. The holder is marked rather than
   merely ordered first, because "who holds this" is the fact a challenger's page is
   missing without it. */
.rivals{margin:10px 0;padding:8px 10px;border:1px solid var(--rule,#d8d2c4);border-radius:6px}
.rivals>summary{cursor:pointer;font-weight:600}
.rivals ul{margin:6px 0 0;padding-left:18px}
.rivals li{margin:3px 0}
.rivals li.holder{font-weight:600}
.rivals .party{opacity:.7;font-size:.9em}
.standing{display:inline-block;margin-left:8px;font-size:.78em;padding:1px 7px;
  border-radius:10px;vertical-align:middle;white-space:nowrap}
.standing.holds{background:var(--brass,#8a6f2b);color:#fff}
.standing.chal{background:transparent;color:var(--brass,#8a6f2b);
  border:1px solid var(--brass,#8a6f2b)}
.rivals .badge{font-size:.78em;padding:1px 6px;border-radius:10px;
  background:var(--brass,#8a6f2b);color:#fff;white-space:nowrap}
.more>summary{cursor:pointer;font-size:12.5px;color:var(--brass);padding:8px 0;
              list-style:none}
.more>summary::-webkit-details-marker{display:none}
.more>summary::before{content:"\25B8";display:inline-block;width:14px;
                      font-family:var(--mono)}
.more[open]>summary::before{content:"\25BE"}
.more>summary:focus-visible{outline:2px solid var(--brass);outline-offset:2px}

/* ── the candidate's own channels ─────────────────────────────────────────
   Fixed kinds in a fixed order, from the same helper the scorecard uses, so
   nothing about which links appear is a judgement about the person. */
.links{display:flex;flex-wrap:wrap;gap:14px;margin:8px 0 0;font-size:12px}
.links a{color:var(--brass);text-decoration:none;border-bottom:1px solid transparent}
.links a:hover,.links a:focus-visible{border-bottom-color:currentColor}

/* ── verdicts across the whole record ────────────────────────────────────
   A glyph as well as a hue: these have to read under deuteranopia and in a
   grayscale screenshot, the discipline the scorecard's bars follow with texture. */
.flags{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}
.flag{display:inline-flex;align-items:baseline;gap:7px;font-size:12px;border-radius:8px;
      padding:4px 10px;border:1px solid var(--line);color:var(--ink-2);background:var(--page)}
.flag::before{font-family:var(--mono);font-weight:700}
.flag.ok{border-color:var(--good);background:var(--good-soft)}
.flag.ok::before{content:"\2713";color:var(--good)}
.flag.warn{border-color:var(--serious);background:var(--serious-soft)}
.flag.warn::before{content:"\2691";color:var(--serious)}
.flag.na{border-style:dashed;color:var(--muted)}
.flag.na::before{content:"\2013";color:var(--muted)}
.flag b{font-family:var(--mono);font-weight:600;color:var(--ink);
        font-variant-numeric:tabular-nums}

/* ── the counted half ────────────────────────────────────────────────────
   First on the card: it is the part that does not wait on a reviewer, and
   leading with it is what makes a two-issue senator read as examined. */
.measured h2{color:var(--brass)}
.strip{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 11px}
.sbit{display:inline-flex;align-items:baseline;gap:6px;border:1px solid var(--line);
      border-radius:8px;padding:4px 10px;background:var(--page);font-size:12px;
      color:var(--muted)}
.sbit i{font-style:normal;color:var(--ink-2)}
.sbit b{font-family:var(--mono);font-size:13px;color:var(--ink);font-weight:600;
        font-variant-numeric:tabular-nums}
/* An absence gets a dashed edge and a sentence, never a bar at zero (gh #298). */
.sbit.na{border-style:dashed}
.sbit.na i{color:var(--muted)}

/* Hue is categorical here -- which source of money -- so it stays clear of the
   good/warn/crit palette, which encodes polarity. Same segments and same tokens
   as the scorecard's funding profile. */
.moneyline{display:flex;flex-direction:column;gap:6px;margin:0}
/* 24px and the percentage set INSIDE each segment, exactly as the scorecard's
   funding profile does it. A shorter bar with the label left unstyled spilled the
   three figures on top of one another outside the bar. */
.comp{height:24px;border-radius:9px;display:flex;gap:2px;overflow:hidden}
.comp .fseg{height:100%;min-width:0;display:flex;align-items:center;padding:0 8px;
            color:#fff;font-family:var(--mono);font-size:11px;font-weight:600;
            white-space:nowrap;font-variant-numeric:tabular-nums}
.comp .fseg.rest{background:var(--leftover);color:var(--ink)}
/* The legend names the segments and carries the total; the numbers are in the bar,
   so repeating them here would be the same figure twice on one line. */
.mlabel{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;
        font-size:11.5px;color:var(--ink-2)}
.mlabel i{font-style:normal}
.mlabel .tot{font-family:var(--mono);color:var(--muted);
             font-variant-numeric:tabular-nums}
.mlabel .dot{display:inline-block;width:10px;height:10px;border-radius:3px;
             margin-right:6px;vertical-align:-1px}
.srcline{margin:11px 0 0;font-size:11.5px;color:var(--muted)}
.srcline a{color:var(--brass);text-decoration:none;border-bottom:1px solid transparent}
.srcline a:hover,.srcline a:focus-visible{border-bottom-color:currentColor}

/* ── the three panels ────────────────────────────────────────────────────
   Counts live on the headers so every denominator stays readable whichever
   panel is open. The fold hides the list, never the number. */
.tiertabs{display:flex;flex-wrap:wrap;gap:9px;margin-top:30px;padding-top:15px;
          border-top:1px solid var(--line)}
.ttab{appearance:none;font:inherit;text-align:left;cursor:pointer;display:flex;
      align-items:baseline;gap:9px;border:1px solid var(--line);border-radius:10px;
      background:var(--page);padding:9px 13px;color:var(--ink-2)}
.ttab:hover{border-color:var(--brass)}
.ttab:focus-visible{outline:2px solid var(--brass);outline-offset:2px}
.ttab .tname{font-family:var(--mono);font-size:11.5px;letter-spacing:.14em;
             text-transform:uppercase;color:var(--brass);font-weight:600}
.ttab .cov{font-family:var(--mono);font-size:11.5px;color:var(--muted);
           font-variant-numeric:tabular-nums}
.ttab[aria-selected="true"]{background:var(--brass-soft);border-color:var(--brass)}
.ttab[aria-selected="true"] .cov{color:var(--ink-2)}
.ttab .chev{transition:transform .16s ease}
.ttab[aria-selected="true"] .chev{transform:rotate(90deg)}
/* No top rule: the tab row above already draws it. With script off these stack
   open, which is longer but complete. */
section.panel{margin-top:0;padding-top:14px;border-top:none}

/* A reader's one-tap signal (gh #395). Quiet on purpose: it sits under a question and
   must not compete with the record above it, and it carries no count -- staff-only
   until those numbers have been looked at. */
.signal{margin-top:8px;font:inherit;font-size:12.5px;padding:5px 11px;cursor:pointer;
  color:var(--brass);background:none;border:1px solid var(--brass);border-radius:999px}
.signal:hover,.signal:focus-visible{background:var(--brass-soft)}
.signal:disabled{opacity:.65;cursor:default;border-style:dashed}

/* ---- engagement heatmap (/engagement and the #engagement section) ----
   A dense heatmap: small type, hairline gaps, one hue from dark (strong) to light
   (some). Weak keeps a stripe as well as its own hue, so it reads without colour
   (status charts need texture, not just hue); grey is an empty outlined block. */
/* Red to green, after the user's reference heatmap. Weak keeps a faint stripe so it
   still reads for red-green colour blindness. */
:root{--hm-4:#3f9f5a;--hm-3:#a3d27d;--hm-2:#f6e08a;--hm-1a:#ef8a62;--hm-1b:#e37650;--hm-0:#e9e7e1;--hm-ink:#14240f;--hm-weak-ink:#3d1205}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--hm-4:#4fae68;--hm-3:#8dbb6c;--hm-2:#c8b45e;--hm-1a:#c4603f;--hm-1b:#b05436;--hm-0:#2c2a25;--hm-ink:#0d150a;--hm-weak-ink:#1f0a03}}
:root[data-theme="dark"]{--hm-4:#4fae68;--hm-3:#8dbb6c;--hm-2:#c8b45e;--hm-1a:#c4603f;--hm-1b:#b05436;--hm-0:#2c2a25;--hm-ink:#0d150a;--hm-weak-ink:#1f0a03}
.hm-scroll{overflow-x:auto;margin:.75rem 0}
.heatmap{border-collapse:separate;border-spacing:1px;font-size:11px;line-height:1.2;font-variant-numeric:tabular-nums}
.heatmap th{text-align:left;vertical-align:bottom;font-weight:600;padding:2px 6px 2px 0;white-space:nowrap}
.heatmap thead th{font-size:10.5px;text-align:center;padding:0 2px 3px}
.heatmap th a{color:inherit;text-decoration:none}
.heatmap th a:hover,.heatmap th a:focus-visible{text-decoration:underline}
.heatmap td{min-width:64px;height:20px;padding:2px 4px;text-align:center;vertical-align:middle;border-radius:0}
.heatmap .bandname{font-weight:600}
.cell.strong{background:var(--hm-4);color:var(--hm-ink)}
.cell.good{background:var(--hm-3);color:var(--hm-ink)}
.cell.some{background:var(--hm-2);color:var(--hm-ink)}
.cell.weak{background:repeating-linear-gradient(45deg,var(--hm-1a) 0 4px,var(--hm-1b) 4px 6px);color:var(--hm-weak-ink)}
.cell.no_record,.cell.not_asked{background:var(--hm-0);color:var(--ink-2,inherit);font-weight:400}
.heatmap details summary{cursor:pointer}
.heatmap details ul{text-align:left;margin:.3rem 0;padding-left:1rem;font-size:11px;font-weight:400;min-width:18rem}
/* The public grid: gapless colour squares, rotated column labels, a legend. */
.heatmap.grid{border-spacing:0;border-collapse:separate}
.heatmap.grid td{min-width:0;width:44px;height:13px;padding:0;border:0}
.heatmap.grid tbody th{font-size:10.5px;font-weight:500;padding:0 8px 0 0;height:13px;line-height:13px}
.heatmap.grid thead th.rot{vertical-align:bottom;padding:0 0 4px;height:9.5rem}
.heatmap.grid thead th.rot span{writing-mode:vertical-rl;transform:rotate(180deg);display:inline-block;white-space:nowrap}
.heatmap.grid thead th.corner{vertical-align:bottom;text-align:left}
.heatmap.grid tbody tr:hover th{text-decoration:underline}
.heatmap.grid.wide td{width:16px;min-width:16px;height:16px}
.heatmap.grid.wide tbody th{height:16px;line-height:16px}
.heatmap.grid.wide thead th.rot{height:15rem;max-width:16px}
.heatmap.grid.wide thead th.rot span{max-height:15rem;overflow:hidden;text-overflow:ellipsis}
.hm-tabs{display:flex;gap:.25rem;margin:.75rem 0 .5rem;border-bottom:1px solid var(--line)}
.hm-tabs .tab{font-size:12px;font-weight:600;padding:.35rem .75rem;color:inherit;text-decoration:none;border:1px solid transparent;border-bottom:0;border-radius:4px 4px 0 0;margin-bottom:-1px}
.hm-tabs .tab[aria-current="page"]{border-color:var(--line);background:var(--page)}
.hm-tabs .tab:hover,.hm-tabs .tab:focus-visible{text-decoration:underline}
.hm-filters{display:flex;flex-wrap:wrap;gap:.4rem .9rem;align-items:center;font-size:12px;margin:.25rem 0 .5rem}
.hm-filters label{display:inline-flex;gap:.3rem;align-items:center}
.hm-filters select,.hm-filters input{font:inherit;padding:.15rem .3rem;max-width:12rem}
.hm-filters button{font:inherit;padding:.2rem .7rem;cursor:pointer}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hm-legend{display:flex;flex-wrap:wrap;gap:.25rem 1rem;font-size:11px;margin:.5rem 0 1rem;align-items:center}
.hm-legend .key{display:inline-flex;align-items:center;gap:.35rem}
.hm-legend .sw{display:inline-block;width:28px;height:12px}
.readers{font-size:10px;font-weight:600;padding:0 .35rem;border-radius:999px;border:1px solid currentColor;white-space:nowrap}

/* The senator heatmap stacks at phone width: each issue becomes a block with its
   cells labelled, so a quote list opened in a cell stays readable (engagement spec,
   "Layout B stacks"). The public grid keeps its own horizontal scroll. */
@media (max-width:600px){
  .engagement .heatmap{min-width:0}
  .engagement .heatmap thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .engagement .heatmap tr{display:block;margin-bottom:.75rem;border:1px solid var(--line);border-radius:6px;padding:.4rem}
  .engagement .heatmap th,.engagement .heatmap td{display:block;text-align:left}
  .engagement .heatmap td[data-label]::before{content:attr(data-label) ": ";font-weight:600}
}
