/* Thinking Voter, desktop first (Figma file omAhPVNlqBqnltlXoHehTv: Home 79:1592, Split ZIP 1:2,
   Who's on your ballot 7:156, Race page 78:833). Values are the design's own; frames are 1728px wide. */

@font-face { font-family: "Libre Baskerville"; src: url("fonts/LibreBaskerville-Variable.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap; }
/* Helvetica Neue is used where the reader has it installed; it is never served. TeX Gyre Heros is a free
   (GUST licence) Helvetica lookalike for everyone else. */
@font-face { font-family: "TV Heros"; src: url("fonts/TeXGyreHeros-Regular.woff2") format("woff2");
  font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "TV Heros"; src: url("fonts/TeXGyreHeros-Bold.woff2") format("woff2");
  font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f4f3f1; --ink: #000; --muted: #5e5550; --navy: #002472; --link: #0034a4; --line: #e8dfd9; --card: #fff;
  --serif: "Libre Baskerville", Baskerville, Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, "TV Heros", Arial, sans-serif;
  --page: 1525px; --gutter: 102px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: normal;
  min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; }
img { display: block; }
a { color: var(--link); }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.staging-banner { background: #fff3cd; color: #3d2e00; padding: 8px var(--gutter); font-size: 14px; }
.staging-banner label { margin-left: 12px; }
body[data-hide-upload] [data-origin=upload], body[data-hide-captured] [data-origin=captured] { display: none; }

/* Header: logo at 58px from the top; home/split-ZIP frames put it 56px from the left, the others 102px. */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: 58px var(--gutter) 0;
  max-width: calc(var(--page) + 2 * var(--gutter)); width: 100%; margin: 0 auto; }
.top--wide { max-width: none; padding-left: 56px; padding-right: 55px; }
.logo { justify-self: start; }
.logo img { width: 258px; height: 30px; }
/* "Pocket Ballot", centered between the logo and the menu icon (not drawn in Figma; styled like the header's
   "Back to all races" link). */
.pocket-open { justify-self: center; margin-top: 4px; background: none; border: 0; padding: 0; font: inherit; font-size: 18px;
  font-weight: 500; color: var(--ink); cursor: pointer; }
.pocket-open:hover { text-decoration: underline; }
.menu { position: relative; padding-top: 6px; justify-self: end; }
.menu-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.menu-list { position: absolute; right: 0; top: 34px; list-style: none; margin: 0; padding: 12px 0; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; min-width: 200px; z-index: 10; }
.menu-list a { display: block; padding: 8px 20px; color: var(--ink); text-decoration: none; font-size: 16px; }
.menu-list a:hover { text-decoration: underline; }

/* Type */
.display { font-family: var(--serif); font-weight: 400; font-size: 64px; letter-spacing: -3.2px; color: var(--ink);
  text-align: center; }
.display--left { text-align: left; }
.sub-display { font-family: var(--serif); font-weight: 400; font-size: 35px; letter-spacing: -1.75px; text-align: center; margin-top: 40px; }
.lede { font-size: 22px; color: var(--muted); text-align: center; }
.lede strong { font-weight: 500; color: var(--ink); }
.lede--left { text-align: left; margin-top: 24px; }
.fine { font-size: 12px; color: var(--muted); text-align: center; }
.fine--left { text-align: left; font-size: 14px; }
.link { color: var(--link); }
.muted-link { color: var(--muted); }
.form-error { color: #8a1c1c; font-size: 16px; text-align: center; margin-top: 12px; }

/* Home */
.hero { display: flex; flex-direction: column; align-items: center; padding: 283px 24px 160px; }
.hero .lede { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }
.orange { width: 60px; height: 60px; margin: -17px 0; }
.pill-form { display: flex; align-items: center; gap: 10px; width: 320px; height: 70px; background: var(--card);
  border: 1px solid var(--line); border-radius: 100px; padding: 0 7px 0 20px; margin-top: 45px; }
.pill-form input { flex: 1 1 0; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.pill-form input::placeholder { color: var(--muted); opacity: 1; }
.pill-form:focus-within { border-color: var(--ink); }
.go { flex: 0 0 55px; width: 55px; height: 55px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.hero .fine { margin-top: 15px; }

/* Split ZIP (Figma 1:2) */
.where { display: flex; flex-direction: column; align-items: center; padding: 86px 24px 120px; }
.place { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; text-align: right; }
.place--center { align-items: center; text-align: center; }
.place-name { font-family: var(--serif); font-size: 25px; letter-spacing: -1.25px; color: var(--ink); }
.place-zip { font-size: 16px; color: var(--muted); }
.place-zip strong { color: var(--ink); font-weight: 500; }
.where .display { margin-top: 50px; max-width: 1068px; }
.where .lede { margin-top: 24px; max-width: 895px; }
.pill-form--wide { width: 525px; border: 2px solid var(--ink); margin-top: 55px; }
.pill-form--wide input { font-size: 18px; }
.or { display: flex; align-items: center; gap: 20px; margin: 55px 0 41px; font-size: 14px; color: var(--ink); }
.outline-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 70px; padding: 0 21px 0 22px;
  background: var(--card); border: 1px solid var(--ink); border-radius: 78px; font: inherit; font-size: 18px; font-weight: 500;
  color: var(--ink); cursor: pointer; min-width: 246px; }
.outline-btn--sm { height: 49px; min-width: 0; font-size: 16px; margin-top: 16px; }
.where > .fine { margin-top: 29px; }
#pick-step { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 16px; }
#pick-options { display: flex; flex-direction: column; gap: 10px; min-width: 525px; }
.pick-opt { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 25px;
  padding: 18px 24px; font-size: 18px; cursor: pointer; }
.pick-opt:has(input:checked) { border-color: var(--ink); }
.pick-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 25px; padding: 14px 24px; font-size: 18px; }
.pick-row select { font: inherit; font-size: 18px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }

/* Header band: white on race and candidate pages (Figma 85:1769: 0-340px). */
.head-band--white { background: var(--card); }
.page-pad { max-width: calc(var(--page) + 2 * var(--gutter)); margin-left: auto; margin-right: auto; padding-left: var(--gutter);
  padding-right: var(--gutter); width: 100%; }

/* Ballot header (Figma 74:602): title left; county above the ZIP, right. */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 40px;
  max-width: calc(var(--page) + 2 * var(--gutter)); margin: 69px auto 0; padding: 0 var(--gutter) 0 94px; width: 100%; }
.page-head .display--left { max-width: 1080px; }
.place-name--lg { font-size: 35px; letter-spacing: -1.75px; }
.dash-rule { height: 1px; border: 0; margin: 49px 0 0; background: url("img/rule-h.svg") repeat-x left center; }
.pill { display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: var(--bg);
  font-weight: 500; font-size: 14px; height: 35px; padding: 0 21px 0 22px; border-radius: 78px; white-space: nowrap; }
.pill--lg { font-size: 18px; height: 45px; min-width: 115px; padding: 0 27px 0 28px; border-radius: 100px; }
.confirm-line { margin-top: 30px; font-size: 16px; }

/* Race header (Figma 85:1767): back link, then title + level pill + special-election tag; county + ZIP right. */
.race-head { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 73px var(--gutter) 40px; width: 100%; }
.back-link { display: inline-flex; align-items: center; gap: 13px; font-size: 18px; font-weight: 500; color: var(--ink); text-decoration: none; }
.back-link img { transform: rotate(180deg); }
.back-link:hover { text-decoration: underline; }
.race-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; margin-top: 45px; }
.race-title-row { display: flex; align-items: center; gap: 25px; flex-wrap: wrap; min-width: 0; }
.race-kicker { font-family: var(--serif); font-size: 35px; letter-spacing: -1.75px; }
.race-note-line { margin-top: 16px; font-size: 18px; color: var(--muted); }
.info-link { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; font: inherit;
  font-size: 16px; font-weight: 500; color: var(--muted); text-decoration: underline; cursor: pointer; }
.info-link--ballot { font-size: 18px; font-weight: 400; }

/* Popups (Figma 90:2232, 90:2233, 87:2132): open over their own trigger, dashed border, soft shadow. */
.pop-wrap { position: relative; display: inline-block; }
.popup { position: absolute; z-index: 30; top: -17px; left: -15px; width: 347px; display: flex; flex-direction: column; gap: 22px;
  padding: 17px 16px 22px 15px; background: var(--card); border: 1px dashed var(--ink); border-radius: 20px;
  filter: drop-shadow(-10px 10px 3.1px rgba(0, 0, 0, .15)); text-align: left; text-decoration: none; }
.popup-head { display: flex; align-items: center; gap: 10px; }
.popup-title { flex: 1 1 0; font-size: 16px; font-weight: 500; color: var(--ink); }
.popup-close { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; }
.popup-body { width: 261px; margin-left: 25px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 17px; }
.popup-em { font-weight: 500; color: var(--ink); }
.popup--sources { top: -15px; width: 273px; padding: 15px; gap: 15px; border-color: var(--link); }
.popup-title--src { flex: none; font-size: 14px; font-weight: 500; color: var(--link); }
.src-list { display: flex; flex-direction: column; gap: 8px; }
.src-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.src-item img { flex: 0 0 19px; }
.src-fav { border-radius: 50%; background: #fff; object-fit: contain; }
.src-item a, .src-text { flex: 1 1 0; min-width: 0; font-size: 12px; color: var(--link); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-decoration: none; }
.src-text { color: var(--muted); }
.src-item a:hover { text-decoration: underline; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--link); cursor: pointer; }
.link-btn--muted { color: var(--muted); text-decoration: underline; }

/* Who's on your ballot (Figma 7:156) */
.ballot { max-width: var(--page); width: calc(100% - 2 * var(--gutter)); margin: 50px auto 120px; display: flex; flex-direction: column; gap: 75px; }
.ballot-section { display: flex; flex-direction: column; gap: 50px; align-items: flex-start; }
.ballot-races { display: flex; flex-direction: column; gap: 50px; width: 100%; }
.not-on-ballot { font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -1.25px; color: var(--muted); }
.race-row { position: relative; display: grid; grid-template-columns: 1fr 55px; grid-template-rows: auto 115px; column-gap: 19px;
  row-gap: 35px; align-items: center; padding-bottom: 25px; color: inherit; width: 100%; }
.race-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 25px; }
.race-link { color: inherit; text-decoration: none; }
.race-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }          /* the whole row is the link */
.race-row .pop-wrap, .race-row .badge { position: relative; z-index: 2; }
.race-name { font-family: var(--serif); font-size: 35px; letter-spacing: -1.75px; color: var(--muted); }
.race-note { font-size: 18px; color: var(--muted); }
.race-photos { display: flex; gap: 20px; align-items: center; overflow: hidden; }
.thumb { width: 90px; height: 115px; flex: 0 0 90px; border-radius: 320px; overflow: hidden; background: var(--card); display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.race-go { visibility: hidden; }
.race-row:hover .race-name, .race-row:focus-within .race-name { color: #000; }
.race-row:hover .race-go, .race-row:focus-within .race-go { visibility: visible; }

/* Race page (Figma 78:833, 85:1771): one 400px column per candidate, 98px apart; issue rows span every column. */
.reveal-bar { display: flex; align-items: center; gap: 24px; max-width: calc(var(--page) + 2 * var(--gutter)); margin: 48px auto 0;
  padding: 0 var(--gutter) 0 104px; width: 100%; }
.reveal { display: inline-flex; align-items: center; gap: 10px; height: 49px; padding: 0 21px 0 22px; background: var(--card);
  border: 1px solid var(--ink); border-radius: 78px; font: inherit; font-size: 18px; color: var(--ink); cursor: pointer; }
.reveal .eye-open { display: none; }
.reveal[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.reveal[aria-pressed=true] .eye-open { display: block; }
.reveal[aria-pressed=true] .eye-closed { display: none; }

.race-scroll { overflow-x: auto; margin-top: 63px; padding: 0 var(--gutter) 0; max-width: calc(var(--page) + 2 * var(--gutter));
  margin-left: auto; margin-right: auto; width: 100%; }
.race-grid { display: grid; column-gap: 98px; grid-auto-flow: row; position: relative; width: max-content; padding-bottom: 60px; }
.cols-1 { grid-template-columns: repeat(1, 400px); } .cols-2 { grid-template-columns: repeat(2, 400px); }
.cols-3 { grid-template-columns: repeat(3, 400px); } .cols-4 { grid-template-columns: repeat(4, 400px); }
.cols-5 { grid-template-columns: repeat(5, 400px); } .cols-6 { grid-template-columns: repeat(6, 400px); }
.cols-7 { grid-template-columns: repeat(7, 400px); } .cols-8 { grid-template-columns: repeat(8, 400px); }
.cols-9 { grid-template-columns: repeat(9, 400px); } .cols-10 { grid-template-columns: repeat(10, 400px); }
.cols-11 { grid-template-columns: repeat(11, 400px); } .cols-12 { grid-template-columns: repeat(12, 400px); }
.cols-13 { grid-template-columns: repeat(13, 400px); } .cols-14 { grid-template-columns: repeat(14, 400px); }
.cols-15 { grid-template-columns: repeat(15, 400px); } .cols-16 { grid-template-columns: repeat(16, 400px); }
/* Dashed column rules sit mid-gap (49px past each 400px column, every 498px), the full height of the grid:
   a 1px line repeated every column, cut into 3px dashes (the design's 3 3 dash, 50% #5e5550). */
.race-grid::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(to right, transparent 449px, rgba(94, 85, 80, .5) 449px 450px, transparent 450px) 0 0 / 498px 100% repeat-x;
  -webkit-mask: repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 6px);
  mask: repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 6px); }

.cand { grid-row: 1; display: flex; flex-direction: column; gap: 50px; width: 400px; }
.cand-head { display: flex; gap: 27px; align-items: center; min-height: 225px; }
.photo { flex: 0 0 176px; width: 176px; height: 225px; border-radius: 999px; overflow: hidden; background: var(--card); display: block; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.cand-id { display: flex; flex-direction: column; gap: 27px; align-items: flex-start; min-width: 0; }
.party-slot { width: 197px; font-size: 18px; font-weight: 500; color: var(--muted); }
.cand-name { font-family: var(--serif); font-weight: 400; font-size: 35px; line-height: 36px; color: var(--ink); }
.cand-name a { color: inherit; text-decoration: none; }
.cand-name a:hover { text-decoration: underline; }
.cand-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 35px; padding: 6px 15px; background: var(--card);
  border-radius: 78px; font-size: 16px; font-weight: 500; color: var(--muted); text-align: center; }
.badge--sm { min-height: 24px; padding: 2px 10px; font-size: 13px; vertical-align: middle; }
/* Pocket Ballot "+" (Figma 89:2161 / 90:2231): outline; filled when picked. On hover the filled icon shows with
   "Add to my ballot" (or "On my ballot") beside it, laid over the row so nothing around it moves. */
.pocket-pick { position: relative; display: inline-flex; align-items: center; background: none; border: 0; padding: 0;
  cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); }
.pocket-pick .pick-on { display: none; }
.pocket-pick .pick-label { display: none; position: absolute; left: 45px; top: 50%; transform: translateY(-50%); z-index: 3;
  white-space: nowrap; background: var(--bg); padding: 6px 10px 6px 0; }
.pocket-pick:hover .pick-on, .pocket-pick:focus-visible .pick-on, .pocket-pick[aria-pressed=true] .pick-on { display: block; }
.pocket-pick:hover .pick-off, .pocket-pick:focus-visible .pick-off, .pocket-pick[aria-pressed=true] .pick-off { display: none; }
.pocket-pick:hover .pick-label, .pocket-pick:focus-visible .pick-label { display: block; }
/* Locked "+" (race not on the voter's ballot): grayed out; the note shows on hover, keyboard focus, or tap. */
.pick-wrap { position: relative; display: inline-flex; }
.pocket-pick.is-locked { opacity: .35; cursor: not-allowed; }
.pocket-pick.is-locked .pick-on, .pocket-pick.is-locked:hover .pick-on { display: none; }
.pocket-pick.is-locked .pick-off, .pocket-pick.is-locked:hover .pick-off { display: block; }
.pocket-pick.is-locked .pick-label { display: none !important; }
.pick-note { display: none; position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; white-space: nowrap;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; padding: 8px 12px; border-radius: 10px; }
.pick-note a { color: #fff; text-decoration: underline; margin-left: 6px; }
.pick-wrap:hover .is-locked + .pick-note, .pick-wrap:focus-within .is-locked + .pick-note, .pick-note.is-open { display: block; }
.return-note { margin-top: 24px; font-size: 18px; }
dialog.pocket-confirm { border: 0; border-radius: 20px; padding: 28px 32px; max-width: 420px; background: #fbfaf7; color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25); }
dialog.pocket-confirm::backdrop { background: rgba(94, 85, 80, .5); }
dialog.pocket-confirm p { font-size: 18px; line-height: 1.4; }
.pocket-confirm-actions { display: flex; gap: 12px; margin-top: 22px; }
.pocket-confirm-actions .pocket-btn { flex: 1 1 0; }
.cand-body { display: flex; flex-direction: column; gap: 35px; }
.bio { font-size: 16px; line-height: 22px; color: var(--muted); }
.bio--placeholder { font-style: italic; }
.cand-links { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.site-link { font-size: 18px; color: var(--muted); text-decoration: underline; }
.social { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.social a { display: inline-flex; line-height: 0; }
.social .social-text { line-height: normal; font-size: 14px; color: var(--muted); }
/* Photo credit + takedown: one quiet line under the photo, laid over the 50px gap so nothing moves. */
.photo-col { position: relative; flex: 0 0 176px; }
.credit { position: absolute; top: calc(100% + 8px); left: 0; width: 176px; font-size: 11px; line-height: 15px; color: var(--muted);
  opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.credit .link-btn { font-size: 11px; color: var(--muted); text-decoration: underline; }
.credit a { color: var(--muted); }
.cand--page .cand-body { margin-top: 20px; }
.issues-label { grid-row: 2; font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -1.25px; color: var(--ink);
  margin: 61px 0 37px; }
.issue-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; column-gap: 98px; row-gap: 21px;
  padding: 30px 62px 25px 22px; margin: 0 -62px 22px 0; border-radius: 7px; }
.issue-row:nth-of-type(odd) { background: var(--card); }
.issue-title { grid-column: 1 / -1; grid-row: 1; font-size: 20px; font-weight: 500; color: var(--ink); max-width: 377px; }
.cell { grid-row: 2; display: flex; flex-direction: column; gap: 25px; max-width: 377px; }
.quote { font-size: 14px; color: var(--muted); white-space: pre-line; }
.read-full { color: var(--link); white-space: nowrap; }
.cell-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 14px; color: var(--muted); }
.cell-meta a { color: var(--link); text-decoration: none; }
.cell-meta a:hover { text-decoration: underline; }
.cell-meta--left { justify-content: flex-start; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.race-notes { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto 100px; padding: 0 var(--gutter); width: 100%;
  display: flex; flex-direction: column; gap: 12px; }
.corrections { font-size: 16px; }

/* My ballot (Pocket Ballot): picks from this browser only; prints as a one-page cheat sheet. */
.mine { margin-top: 40px; margin-bottom: 120px; display: flex; flex-direction: column; gap: 24px; }
.mine-note { font-size: 18px; font-weight: 500; color: var(--ink); }
.mine-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.mine-actions .outline-btn--sm { margin-top: 0; }
.mine-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; max-width: 900px; }
.mine-item { display: flex; align-items: center; gap: 24px; background: var(--card); border-radius: 7px; padding: 16px 22px; }
.mine-text { flex: 1 1 0; display: flex; flex-direction: column; gap: 8px; }
.mine-race { font-size: 16px; font-weight: 500; color: var(--muted); }
.mine-name { font-family: var(--serif); font-size: 30px; letter-spacing: -1.2px; color: var(--ink); text-decoration: none; }
.mine-print-only { display: none; }
@media print {
  .staging-banner, .top, .foot, .mine-actions, .mine-remove, .dash-rule { display: none !important; }
  body { background: #fff; }
  .page-head { margin-top: 0; padding-left: 0; }
  .page-pad { padding: 0; }
  .mine-item { background: none; border-bottom: 1px solid #ccc; border-radius: 0; padding: 10px 0; break-inside: avoid; }
  .mine-print-only { display: block; }
}

/* Candidate page */
.cand--page { margin: 63px auto 0; max-width: calc(var(--page) + 2 * var(--gutter)); padding: 0 var(--gutter); width: 100%; }
.cand--page .bio { max-width: 640px; }
.cand--page .cand-name { font-size: 50px; line-height: 52px; }
.cand-section { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 70px auto 0; padding: 0 var(--gutter); width: 100%; }
.cand-section:last-child { margin-bottom: 100px; }
.section-title { font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -1.25px; color: var(--muted); margin-bottom: 30px; }
.issue-block { background: var(--card); border-radius: 7px; padding: 30px 22px 25px; margin-bottom: 22px; max-width: 900px; }
.issue-block .issue-title { margin-bottom: 21px; max-width: none; }
.claim { padding: 14px 0; border-top: 1px solid var(--line); }
.claim:first-of-type { border-top: 0; padding-top: 0; }
.quote--full { margin: 0; font-size: 16px; line-height: 22px; color: var(--ink); }
.checked { margin: 8px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); }
.checked li { margin: 4px 0; word-break: break-all; }

/* All races */
.index { max-width: var(--page); width: calc(100% - 2 * var(--gutter)); margin: 40px auto 100px; }
.index h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -1.25px; margin: 40px 0 12px; }
.index-list { list-style: none; padding: 0; margin: 0; columns: 3; column-gap: 40px; }
.index-list li { padding: 4px 0; font-size: 16px; break-inside: avoid; }
.search { width: 525px; height: 56px; border: 1px solid var(--line); border-radius: 100px; padding: 0 22px; font: inherit; font-size: 16px;
  margin-top: 20px; background: var(--card); }

/* Footer (navy band, Figma 78:979). The home and split-ZIP frames have none. */
body[data-page=home] .foot, body[data-page=where] .foot, body[data-page=outside] .foot { display: none; }
.foot { background: var(--navy); color: #fff; min-height: 344px; }
.foot-inner { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 76px 100px; position: relative; }
.foot-logo { position: relative; display: block; width: 258px; height: 30px; }
.foot-flag { position: absolute; left: 0; top: 0; }
.foot-word { position: absolute; left: 40.74px; top: 0.25px; }
.foot-note { margin-top: 53px; font-size: 16px; text-align: center; }
.foot-note--small { margin-top: 14px; font-size: 14px; opacity: .85; }
.foot-note a { color: #fff; }

/* Pocket Ballot dialog (Figma 95:2234): scrim, 580px card, Save as image / Print beside it. */
dialog.pocket { padding: 0; border: 0; background: transparent; width: 580px; max-width: calc(100vw - 32px); overflow: visible;
  max-height: calc(100vh - 48px); color: var(--ink); }
dialog.pocket::backdrop { background: rgba(94, 85, 80, .5); }
.pocket-box { display: flex; flex-direction: column; max-height: calc(100vh - 48px); background: #fbfaf7; border-radius: 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25); overflow: hidden; }
.pocket-head { display: flex; flex-direction: column; gap: 10px; padding: 32px 36px 20px; border-bottom: 1px solid #e6e2db; }
.pocket-title-row { display: flex; align-items: center; justify-content: space-between; }
.pocket-title { font-family: var(--serif); font-weight: 400; font-size: 35px; letter-spacing: -2.8px; }
.pocket-close { width: 44px; height: 44px; border-radius: 22px; border: 0; background: #efece6; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; }
.pocket-sub { font-size: 15px; }
.pocket-sub strong { font-weight: 700; }
.pocket-progress { display: flex; align-items: center; gap: 12px; }
.pocket-track { flex: 1 1 0; height: 6px; border-radius: 3px; background: #e6e2db; overflow: hidden; }
.pocket-fill { display: block; height: 6px; width: 0; background: var(--muted); }
.pocket-count { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.pocket-races { flex: 1 1 auto; overflow-y: auto; padding: 6px 36px 8px; }
.pocket-section { padding: 16px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.pocket-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid #ece9e3; }
.pocket-row:last-child { border-bottom: 0; }
.pocket-photo { flex: 0 0 40px; width: 40px; height: 48px; border-radius: 20px; background: #d9d5ce; overflow: hidden; }
.pocket-photo img { width: 100%; height: 100%; object-fit: cover; }
.pocket-row--open .pocket-photo { background: none; border: 1.5px dashed #b8b2a8; }
.pocket-text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pocket-race { font-size: 13px; }
.pocket-name { font-size: 17px; font-weight: 600; }
.pocket-row--open .pocket-name { font-weight: 400; color: var(--muted); }
.pocket-link { font-size: 12px; color: var(--ink); text-decoration: underline; white-space: nowrap; }
.pocket-row--open .pocket-link { font-weight: 600; }
.pocket-empty { padding: 24px 0; font-size: 15px; color: var(--muted); }
.pocket-foot { display: flex; flex-direction: column; gap: 16px; padding: 20px 36px 28px; background: #f4f2ee; border-top: 1px solid #e6e2db; }
.pocket-info { display: flex; gap: 20px; font-size: 13px; line-height: 1.45; }
.pocket-info > div { flex: 1 1 0; }
.pocket-info-h { font-weight: 600; }
.pocket-note { font-size: 12px; text-align: center; margin-top: -8px; }
.pocket-note:first-of-type { margin-top: 0; }
.pocket-actions { position: absolute; top: 18px; left: calc(100% + 29px); width: 235px; display: flex; flex-direction: column; gap: 12px; }
.pocket-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 26px;
  border: 1.5px solid var(--ink); background: transparent; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; }
.pocket-btn--dark { background: var(--ink); color: #fff; }
@media print {
  html.printing-pocket body > *:not(dialog) { display: none !important; }
  html.printing-pocket body { background: #fff; display: block; }
  html.printing-pocket dialog.pocket { position: static; display: block; width: 100%; max-width: none; max-height: none; margin: 0; }
  html.printing-pocket .pocket-actions, html.printing-pocket .pocket-close { display: none; }
  html.printing-pocket .pocket-box { box-shadow: none; max-height: none; border-radius: 0; }
  html.printing-pocket .pocket-races { overflow: visible; }
}

/* ---------- site-v1 round 4 (owner, 2026-10-03) ---------- */
/* Pieces that exist only on mobile are hidden here; the mobile layer below turns them on. */
.m-only, .mtop, .strip, .cpanel, .cpocket, .compare-note, .m-chev, .row-open, .row-none, .m-cue, .sheet, .sheet-scrim,
.m-orange, .m-zipline, .m-submit, .m-locate-note, .m-privacy { display: none; }
.street-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reveal .eye-sm, .reveal .lab-m { display: none; }
.pin-sentinel { height: 1px; margin-bottom: -1px; }

/* Ballot header: a white band holding the title and county (Figma 7:156: 0-294px, title row at 157px). */
.page-head--band { padding-bottom: 58px; }

/* Desktop: the candidates pinned above the issue rows once their columns have scrolled away (owner-approved
   compact row, 2026-10-03; colours from the mobile sticky panel, Figma 104:3421). A zero-height sticky holder,
   so nothing below moves when it shows; the row lines up with .race-scroll's columns and follows its scroll. */
.dpin { position: sticky; top: 0; height: 0; z-index: 25; }
.dpin-bar { position: absolute; top: 0; left: 0; right: 0; background: #f4f2ee; border-bottom: 1px solid #dcd8d0;
  opacity: 0; visibility: hidden; transform: translateY(-12px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
.dpin.is-pinned .dpin-bar { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease; }
.dpin-box { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); overflow: hidden; }
.dpin-inner { display: grid; column-gap: 98px; padding: 12px 0; will-change: transform; }
.dpin-cand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dpin-photo { flex: 0 0 44px; width: 44px; height: 56px; border-radius: 999px; overflow: hidden; background: var(--card); display: flex;
  align-items: center; justify-content: center; font-family: var(--serif); font-size: 14px; color: var(--muted); }
.dpin-photo img { width: 100%; height: 100%; object-fit: cover; }
.dpin-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dpin-party { width: auto; font-size: 13px; }
.dpin-name { font-family: var(--serif); font-size: 20px; letter-spacing: -.5px; color: var(--ink); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }

/* ---------- Mobile (Figma 390px frames: race 104:3073 / 125:4377 / 125:4136, sticky 104:3646, sheet 98:2805 /
   98:2876, home 129:5325, split ZIP 129:5122). Screens without a mobile frame (ballot, candidate, all races,
   My ballot, Pocket Ballot dialog, footer) are only kept from breaking at 390px until they're designed. ---------- */
@media (max-width: 767px) {
  :root { --gutter: 20px; }
  .d-only { display: none !important; }
  .m-only { display: revert; }

  /* Top bar: padded below the status bar / Dynamic Island (viewport-fit=cover). */
  .top { display: none; }
  .mtop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--card);
    padding: max(16px, env(safe-area-inset-top)) 21.5px 15px; border-bottom: 1px solid #d9d5ce; }
  .mtop--home { display: flex; justify-content: space-between; }
  .mtop-back { justify-self: start; line-height: 0; }
  .mtop-back img { transform: rotate(180deg); }                 /* Figma 104:3881: the "Go" arrow, turned */
  .mtop-flag { justify-self: center; line-height: 0; }
  .mtop-logo { line-height: 0; }
  .mtop-logo img { width: 223.6px; height: 26px; }
  .mtop-menu { justify-self: end; padding-top: 0; line-height: 0; }
  .mtop-menu .menu-list { top: 40px; line-height: normal; z-index: 60; }
  .menu-item-btn { display: block; width: 100%; padding: 8px 20px; background: none; border: 0; text-align: left; font: inherit;
    font-size: 16px; color: var(--ink); cursor: pointer; }
  .popup { width: min(347px, calc(100vw - 40px)); }

  .display { font-size: 32px; letter-spacing: -.6px; line-height: 1.15; }
  .lede { font-size: 16px; }

  /* Home (129:5325) */
  .hero { padding: 79px 24px 80px; }
  .m-orange { display: block; }
  .m-orange img { width: 72px; height: 72px; }
  .hero .display { font-size: 40px; letter-spacing: -2px; max-width: 341px; margin-top: 30px; }
  .hero .lede { display: block; font-size: 18px; line-height: 25px; margin-top: 22px; }
  .hero .lede strong { font-weight: 700; color: inherit; }
  .pill-form { width: 300px; margin-top: 30px; }
  .hero .fine { margin-top: 19px; }

  /* Split ZIP (129:5122) */
  .where { align-items: stretch; padding: 40px 24px max(24px, env(safe-area-inset-bottom)); max-width: 390px; margin: 0 auto;
    min-height: calc(100dvh - 106px); }
  .where > .place { display: none !important; }
  .m-zipline:not([hidden]) { display: block; text-align: center; font-size: 13px; font-weight: 500; }
  .where .display { margin-top: 20px; font-size: 32px; letter-spacing: -.6px; }
  .where .lede { margin-top: 14px; font-size: 16px; color: var(--ink); }
  .pill-form--wide { width: 100%; height: auto; flex-direction: column; align-items: stretch; gap: 16px; padding: 0; margin-top: 40px;
    background: none; border: 0; border-radius: 0; }
  .street-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 14px; font-weight: 500;
    margin-bottom: -8px; }
  .pill-form--wide input { flex: none; height: 52px; padding: 0 16px; background: var(--card); border: 1.5px solid var(--ink);
    border-radius: 12px; font-size: 16px; }
  .pill-form--wide .go { display: none; }
  .m-submit { display: flex; align-items: center; justify-content: center; height: 52px; padding: 0 28px; border: 0; border-radius: 26px;
    background: var(--ink); color: #fff; font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; }
  .or { margin: 16px 0; gap: 12px; font-size: 13px; text-transform: lowercase; }
  .or img { display: none; }
  .or::before, .or::after { content: ""; flex: 1 1 0; height: 1px; background: #d9d5ce; }
  #locate { width: 100%; min-width: 0; height: 52px; gap: 8px; padding: 0 28px; border-width: 1.5px; border-radius: 26px; background: none;
    font-size: 16px; }
  .m-locate-note { display: block; margin-top: 8px; font-size: 13px; text-align: center; }
  .m-privacy { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: auto; padding-top: 40px; font-size: 13px; }
  #pick-options { min-width: 0; width: 100%; }
  .pick-opt, .pick-row { font-size: 15px; padding: 14px 16px; }
  .form-error { font-size: 14px; }

  /* Ballot page (no mobile frame yet: kept from breaking) */
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 24px; padding: 0 20px; }
  .page-head--band { padding-bottom: 24px; }
  .place-name--lg { font-size: 22px; letter-spacing: -.6px; }
  .place { align-items: flex-start; text-align: left; }
  .ballot { width: calc(100% - 40px); margin: 30px auto 60px; gap: 40px; }
  .ballot-section, .ballot-races { gap: 30px; }
  .race-row { grid-template-columns: 1fr 40px; grid-template-rows: auto 70px; row-gap: 16px; column-gap: 12px; }
  .race-title { flex-wrap: wrap; gap: 10px; }
  .race-name { font-size: 22px; letter-spacing: -.6px; }
  .not-on-ballot { font-size: 22px; }
  .race-photos { gap: 10px; }
  .thumb { width: 55px; height: 70px; flex-basis: 55px; }
  .race-go { visibility: visible; width: 40px; height: 40px; }
  .pill--lg { height: 35px; min-width: 0; padding: 0 18px; font-size: 14px; }
  .confirm-line { font-size: 14px; }

  /* Race and candidate headers (104:4072): level tag, title, centred on white */
  .race-head { padding: 25px 20px 0; }
  .back-link, .race-head .place { display: none !important; }
  .race-head-row { display: block; margin-top: 0; }
  .race-title-row { flex-direction: column; align-items: center; gap: 15px; text-align: center; }
  .race-title-row .pill { order: -1; height: 30px; padding: 5px 12px; border-radius: 100px; font-size: 12px; }
  .race-title-row .display { font-size: 35px; letter-spacing: -2px; line-height: 1.15; text-align: center; }
  .race-kicker { font-size: 25px; letter-spacing: -1px; }
  .race-note-line { margin-top: 10px; font-size: 14px; text-align: center; }
  .reveal-bar { justify-content: center; max-width: none; margin: 0; padding: 15px 20px; background: var(--card); }
  .reveal-bar .pop-wrap { display: none; }                      /* not in the mobile design */
  .reveal { height: 40px; gap: 6px; padding: 0 16px; border-width: 1.5px; border-radius: 20px; font-size: 14px; font-weight: 500; }
  .reveal .eye-closed, .reveal .lab-d { display: none; }
  .reveal .eye-sm, .reveal .lab-m { display: block; }
  .reveal[aria-pressed=true] .eye-sm { display: none; }
  .page-pad { padding-left: 20px; padding-right: 20px; }

  /* Candidate strip (104:3406): every candidate; the two compared carry the ring. */
  .strip { display: block; overflow-x: auto; padding: 0 20px 15px; background: var(--card); scrollbar-width: none;
    overscroll-behavior-x: contain; }
  .strip::-webkit-scrollbar { display: none; }
  .strip-track { display: flex; gap: 14px; width: max-content; margin: 0 auto; padding: 4px; }
  .strip-btn { position: relative; flex: 0 0 44px; width: 44px; height: 52px; padding: 0; border: 0; border-radius: 100px; background: none;
    cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .strip-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 100px;
    background: #d9d5ce; font-family: var(--serif); font-size: 13px; color: var(--muted); }
  .strip-ph img { width: 100%; height: 100%; object-fit: cover; }
  .strip-btn::after { content: ""; position: absolute; inset: 0; border: 2px solid transparent; border-radius: 100px; }
  .strip-btn.is-slotted::after { border-color: var(--link); }
  .strip-btn.is-slotted .strip-ph { inset: 2px; }
  .strip-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

  /* Compare panel (104:3421) and its sticky state (104:3646). The panel keeps one height pinned and unpinned, so
     the issue list never jumps: pinned, the photo scales to 84x100 from its bottom edge (transform only) and the
     25px it frees at the top clears the status bar; the Pocket Ballot row below fades out and slides under. */
  .race-wrap { position: relative; }
  .cpanel { display: flex; gap: 16px; position: sticky; top: 0; z-index: 20; background: #f4f2ee;
    padding: max(25px, calc(env(safe-area-inset-top) - 9px)) 20px 15px; }
  .cpanel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: #dcd8d0; opacity: 0;
    transition: opacity .2s ease; }
  .cpanel.is-pinned::after { opacity: 1; }
  html.sheet-open .cpanel { visibility: hidden; }
  .cpanel--1 { justify-content: center; }
  .cslot { flex: 1 1 0; min-width: 0; }
  .cpanel--1 .cslot { flex: 0 0 167px; }
  .cslot-track { display: flex; overflow-x: hidden; scrollbar-width: none; }
  .cpanel[data-swipe="1"] .cslot-track { overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .cslot-track::-webkit-scrollbar { display: none; }
  .cpage { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; text-align: center; scroll-snap-align: center;
    scroll-snap-stop: always; }
  .cp-party { margin-bottom: 10px; font-size: 16px; font-weight: 500; color: var(--muted); transition: transform .2s ease; }
  .cp-photo-wrap { display: block; width: 105px; height: 125px; transform-origin: 50% 100%; transition: transform .2s ease; }
  .cp-photo { display: flex; align-items: center; justify-content: center; width: 105px; height: 125px; overflow: hidden; border-radius: 100px;
    background: #d9d5ce; font-family: var(--serif); font-size: 22px; color: var(--muted); }
  .cp-photo img { width: 100%; height: 100%; object-fit: cover; }
  .cp-name { display: flex; flex-direction: column; margin-top: 10px; font-family: var(--serif); font-size: 17px; line-height: 1.2;
    letter-spacing: -.3px; color: var(--ink); }
  .cp-badge { margin-top: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
  .cpanel.is-pinned .cp-photo-wrap { transform: scale(.8); }
  .cpanel.is-pinned .cp-party { transform: translateY(25px); }
  .cslot.is-pulse .cp-photo { animation: cpulse .35s ease; }
  @keyframes cpulse { 50% { transform: scale(1.06); } }

  .cpocket { display: flex; gap: 16px; position: relative; z-index: 1; padding: 5px 20px 25px; background: #f4f2ee;
    border-bottom: 1px solid #dcd8d0; }
  .cpocket--1 { justify-content: center; }
  .m-pick-wrap { flex: 1 1 0; display: flex; justify-content: center; transition: opacity .2s ease; }
  .cpocket--1 .m-pick-wrap { flex: 0 0 167px; }
  .cpanel.is-pinned + .cpocket .m-pick-wrap { opacity: 0; pointer-events: none; }
  .m-pick { min-height: 40px; }
  .pocket-pick.m-pick .pick-off, .pocket-pick.m-pick:hover .pick-off, .pocket-pick.m-pick:focus-visible .pick-off { display: block; }
  .pocket-pick.m-pick[aria-pressed=true] .pick-off, .pocket-pick.m-pick[aria-pressed=true]:hover .pick-off { display: none; }
  .m-pick-on { display: none; align-items: center; justify-content: center; gap: 6px; width: 159px; height: 40px; padding: 0 16px;
    border-radius: 20px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; }
  .m-pick[aria-pressed=true] .m-pick-on { display: flex; }
  .m-pick-wrap .pick-note { left: 50%; transform: translateX(-50%); white-space: normal; width: max-content; max-width: 160px; }

  /* "Now comparing A and B" (not in the design; the owner's optional note). */
  .compare-note { display: block; position: fixed; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 8px); z-index: 40;
    max-width: calc(100vw - 40px); padding: 10px 16px; border-radius: 20px; background: var(--ink); color: #fff; font-size: 13px;
    font-weight: 500; text-align: center; pointer-events: none; opacity: 0; transform: translate(-50%, 8px);
    transition: opacity .2s ease, transform .2s ease; }
  .compare-note.is-on { opacity: 1; transform: translate(-50%, 0); }
  .compare-note:empty { visibility: hidden; }

  /* Issue rows (104:3467...): both compared candidates side by side; a row where neither has a public position
     collapses to one line and isn't tappable; any other row opens the issue sheet. */
  .dpin { display: none; }
  .race-scroll { overflow: visible; max-width: none; margin-top: 0; padding: 0; }
  .race-grid { display: block; width: auto; padding-bottom: 0; }
  .race-grid::before, .race-grid > .cand, .issues-label { display: none; }
  .issues-label:first-of-type { display: block; margin: 0; padding: 25px 20px 15px; font-size: 30px; letter-spacing: -1.5px; text-align: center; }
  .issue-row { --row-pt: 18px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 50px; row-gap: 20px; position: relative;
    margin: 0; padding: var(--row-pt) 30px; border-radius: 0; scroll-margin-top: var(--pin-h, 235px); }
  .issue-row:nth-of-type(odd) { background: none; }
  .issue-row:nth-of-type(even) { --row-pt: 25px; background: var(--card); }
  .issue-title { grid-column: 1 / -1; grid-row: 1; max-width: none; padding-right: 30px; font-size: 18px; font-weight: 700; }
  .m-chev { display: block; position: absolute; top: calc(var(--row-pt) + 2px); right: 30px; }
  .row-open { display: block; position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; }
  .row-open:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
  .cell { display: none; grid-row: 2; align-self: stretch; justify-content: center; gap: 8px; max-width: none; min-width: 0; }
  .cell.is-l { display: flex; grid-column: 1; }
  .cell.is-r { display: flex; grid-column: 2; margin-left: -25px; padding-left: 25px; border-left: 1px solid #d9d5ce; }
  .cols-1 .cell.is-l { grid-column: 1 / -1; }
  .cell .cell-meta, .cell .read-full { display: none; }
  .cell--quoted .quote::before { content: "“"; }
  .cell--quoted .quote::after { content: "”"; }
  .m-cue { display: block; font-size: 13px; color: var(--link); text-decoration: underline; }
  .m-cue--checked { font-size: 12px; color: var(--ink); }
  .issue-row.is-collapsed { row-gap: 10px; }
  .issue-row.is-collapsed .cell, .issue-row.is-collapsed .m-chev, .issue-row.is-collapsed .row-open { display: none; }
  .issue-row.is-collapsed .row-none { display: block; grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
  .race-notes { margin-bottom: 40px; padding: 24px 20px 0; }

  /* Issue sheet (98:2805, 98:2876) */
  .sheet-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 20, .45); opacity: 0;
    transition: opacity .25s ease; }
  .sheet-scrim.is-open { opacity: 1; }
  .sheet:not([hidden]) { display: flex; }
  .sheet { flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; height: 90vh; height: 90dvh; padding-top: 8px;
    overflow: hidden; border-radius: 24px 24px 0 0; background: var(--bg); box-shadow: 0 -8px 32px rgba(0, 0, 0, .2); outline: none;
    transform: translateY(100%); transition: transform .25s ease; }
  .sheet.is-open { transform: none; }
  .sheet.is-dragging { transition: none; }
  .sheet-head { flex: none; touch-action: none; }
  .sheet-grab { display: flex; justify-content: center; padding-bottom: 25px; }
  .sheet-grab span { width: 36px; height: 5px; border-radius: 3px; background: #d9d5ce; }
  .sheet-nav { display: flex; align-items: flex-start; gap: 12px; padding: 0 20px 16px; border-bottom: 1px solid var(--bg); }
  .sheet-arrow { flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
  .sheet-prev img { transform: scaleX(-1); }                   /* Figma 126:4603: the same arrow, mirrored */
  .sheet-arrow .arrow-off, .sheet-arrow:disabled .arrow-on { display: none; }
  .sheet-arrow:disabled .arrow-off { display: block; }
  .sheet-arrow:disabled { cursor: default; }
  .sheet-titles { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
  .sheet-title { max-width: 227px; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -.3px; }
  .sheet-count { font-size: 12px; color: var(--muted); }
  .sheet-track { flex: 1 1 auto; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
    overscroll-behavior: contain; scrollbar-width: none; }
  .sheet-track::-webkit-scrollbar { display: none; }
  .sheet-track.lock-x { overflow-x: hidden; }
  /* y only: contain on x too would stop a sideways swipe from reaching the track. */
  .sp { flex: 0 0 100%; min-width: 0; overflow-y: auto; overscroll-behavior-y: contain; scroll-snap-align: start; scroll-snap-stop: always;
    padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .sp.lock-y { overflow-y: hidden; }
  .sc { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-bottom: 1px solid var(--bg); }
  .sc-head { display: flex; align-items: center; gap: 10px; }
  .sc-photo { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 44px; overflow: hidden;
    border-radius: 18px; background: #d9d5ce; font-family: var(--serif); font-size: 14px; color: var(--muted); }
  .sc-photo img { width: 100%; height: 100%; object-fit: cover; }
  .sc-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .sc-party { font-size: 12px; font-weight: 500; color: var(--muted); }
  .sc-name { font-family: var(--serif); font-size: 17px; letter-spacing: -.3px; color: var(--ink); }
  .sq, .snp { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 14px; }
  .sq { background: var(--card); }
  .sq-text { font-size: 15px; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
  .sq-text::before { content: "“"; }
  .sq-text::after { content: "”"; }
  .sq-meta { font-size: 12px; color: var(--muted); }
  .sq-src { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--link); text-decoration: none; }
  .snp { background: #efece6; }
  .snp-h { font-size: 15px; font-weight: 500; color: var(--ink); }
  .snp-label { font-size: 12px; color: var(--muted); }
  .snp-list { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
  .snp-list a { color: var(--link); overflow-wrap: anywhere; }
  .snp-list li { overflow-wrap: anywhere; }
  .sn { font-size: 15px; color: var(--ink); }
  .sn a { color: var(--link); }

  /* Candidate page, All races, My ballot, Pocket Ballot dialog, footer: no mobile frames yet, kept from breaking */
  .cand--page { margin-top: 24px; padding: 0 20px; }
  .cand--page .cand-head { flex-direction: column; align-items: flex-start; gap: 24px; }
  .cand--page .cand-name { font-size: 32px; line-height: 36px; }
  .cand--page .bio { max-width: none; }
  .cand-section { margin-top: 40px; padding: 0 20px; }
  .section-title { font-size: 22px; margin-bottom: 20px; }
  .issue-block { padding: 20px 16px; }
  .index { width: calc(100% - 40px); margin: 24px auto 60px; }
  .index-list { columns: 1; }
  .search { width: 100%; }
  .mine-item { gap: 14px; padding: 12px 14px; }
  .mine-name { font-size: 22px; letter-spacing: -.6px; }
  dialog.pocket { width: calc(100vw - 24px); max-width: none; max-height: calc(100dvh - 24px); }
  .pocket-box { max-height: calc(100dvh - 24px - 64px); border-radius: 22px; }
  .pocket-head { padding: 20px 20px 16px; }
  .pocket-title { font-size: 26px; letter-spacing: -1.5px; }
  .pocket-races { padding: 6px 20px 8px; }
  .pocket-foot { padding: 16px 20px; }
  .pocket-info { flex-direction: column; gap: 8px; }
  .pocket-actions { position: static; flex-direction: row; width: auto; margin-top: 12px; }
  .pocket-actions .pocket-btn { flex: 1 1 0; background: var(--card); }
  .pocket-actions .pocket-btn--dark { background: var(--ink); }
  dialog.pocket-confirm { max-width: calc(100vw - 32px); padding: 22px 20px; }
  .foot { min-height: 0; }
  .foot-inner { padding: 40px 20px max(40px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .dpin-bar, .cp-photo-wrap, .cp-party, .cpanel::after, .m-pick-wrap, .compare-note { transition-duration: .01s !important; }
  .cslot.is-pulse .cp-photo { animation: cflash .35s ease; }
  .sheet { transform: none !important; opacity: 0; transition: opacity .15s ease !important; }
  .sheet.is-open { opacity: 1; }
}
@keyframes cflash { 50% { opacity: .55; } }
