@font-face {
  font-family: Lora;
  src: url('/brand/lora-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans';
  src: url('/brand/noto-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans';
  src: url('/brand/noto-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f8fa;
  --ink: #001936;
  --muted: #58595e;
  --line: #d7dce2;
  --accent: #fe312e;
  --accent-soft: #ffe8e7;
  --navy-soft: #eaf0f6;
  --display: Lora, Georgia, serif;
  --white: #ffffff;
  --green: #285844;
  --red: #913b2c;
  font-family: 'Noto Sans', Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #185aa1; outline-offset: 4px; }
h1:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: var(--display); font-size: clamp(2.8rem, 5.1vw, 4.5rem); font-weight: 400; letter-spacing: -.055em; line-height: 1.06; }
h2 { font-size: 1.45rem; line-height: 1.2; letter-spacing: -.035em; }
h3 { font-size: 1.3rem; line-height: 1.25; }
code { font-size: .87em; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 10; background: var(--accent); padding: 12px 20px; }
.skip-link:focus { top: 12px; }
.site-shell { width: min(1120px, calc(100% - 72px)); margin: 0 auto; min-height: 100svh; display: flex; flex-direction: column; }
.site-shell-wide { width: min(1664px, calc(100% - 80px)); }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 100px; border-bottom: 1px solid var(--ink); gap: 4px 24px; padding-block: 12px; }
.header-brands { display: flex; flex: 0 0 auto; align-items: center; gap: 17px; max-width: 100%; }
.wordmark { display: block; width: 118px; }
.wordmark img { width: 100%; height: auto; }
.event-wordmark { width: 126px; height: auto; min-width: 0; padding-inline-start: 17px; border-inline-start: 1px solid var(--line); }
.header-right { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 24px; max-width: 100%; margin-inline-start: auto; }
.site-header .text-button { min-width: 44px; min-height: 44px; }
.header-section { font-size: 10px; font-weight: 600; letter-spacing: .15em; }
.main-content { flex: 1; padding: 50px 0 60px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 23px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.demo-banner { font-size: 12px; padding: 12px 15px; background: var(--navy-soft); border-bottom: 1px solid var(--line); }
.demo-banner strong { letter-spacing: .07em; font-size: 10px; }
.test-round-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; }
.test-round-banner:has(.results-test-back) { padding-block: 0; }
.eyebrow { font-size: 11px; line-height: 1.4; font-weight: 600; letter-spacing: .14em; }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.5; color: var(--muted); max-width: 660px; }
.body-copy { color: var(--muted); max-width: 720px; }
.small-copy { font-size: 13px; line-height: 1.5; color: var(--muted); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 48px; padding: 13px 22px; border: 1px solid var(--ink); background: var(--ink); color: var(--white); text-decoration: none; font-size: 14px; font-weight: 600; line-height: 1.35; border-radius: 4px; transition: background-color .15s ease, transform .15s ease; text-align: center; }
.button:hover:not(:disabled) { background: #17375a; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-large { min-height: 56px; padding: 16px 27px; font-size: 16px; }
.button-secondary { background: transparent; color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: var(--navy-soft); }
.button-row { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; }
.text-button, .text-link { font-size: 13px; font-weight: 600; color: var(--ink); background: transparent; border: 0; padding: 9px 0; text-underline-offset: 4px; }
.text-button:hover:not(:disabled), .text-link:hover { text-decoration: underline; }
.notice { margin: 0 0 26px; padding: 17px 20px; border-left: 3px solid var(--green); background: #e8eee5; font-size: 14px; line-height: 1.5; }
.notice-error { background: #f4e6df; border-color: var(--red); color: #733121; }
.notice-quiet { border-color: #8193a8; background: var(--navy-soft); }
.action-dialog { width: min(450px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: clamp(20px, 5vw, 30px); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 4px; background: var(--white); color: var(--ink); box-shadow: 0 18px 60px #00193630; }
.action-dialog::backdrop { background: #0019368c; }
.action-dialog h2 { font-family: var(--display); font-size: 1.6rem; font-weight: 400; }
.action-dialog p { margin-top: 12px; color: var(--muted); }
.action-dialog-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.welcome-grid { display: grid; grid-template-columns: 1fr .86fr; gap: 80px; padding: 20px 0 34px; align-items: center; }
.welcome-title { font-size: clamp(3.6rem, 7.6vw, 6.2rem); line-height: .98; }
.welcome-copy .lead { margin-top: 30px; max-width: 390px; }
.welcome-intro { max-width: 400px; font-size: 14px; margin-top: 16px; }
.welcome-copy .button { margin-top: 30px; }
.welcome-copy .small-copy { margin-top: 12px; }
.welcome-ballot { border: 1px solid var(--ink); background: var(--white); padding: 30px 30px 24px; transform: rotate(1.2deg); box-shadow: 8px 8px 0 #dce5ee; }
.ballot-heading { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 20px; }
.ballot-stamp { color: var(--ink); }
.ballot-stamp { width: 47px; height: 47px; border: 1px solid var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 28px; border-radius: 50%; background: var(--accent); }
.office-list { list-style: none; margin: 0; padding: 0; }
.office-list li { display: flex; gap: 15px; padding: 19px 0; align-items: center; border-bottom: 1px solid var(--line); font-size: 14px; }
.office-list .office-tick { margin-left: auto; font-size: 20px; }
.row-number { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); }
.ballot-footnote { margin-top: 22px; font-size: 11px; color: var(--muted); }
.ballot-page { max-width: 990px; margin: 0 auto; }
.site-shell:has(.ballot-page) .site-header { min-height: 64px; padding-block: 8px; }
.main-content:has(.ballot-page) { padding-block-start: clamp(10px, 2vw, 18px); }
.review-page .summary-row .text-button { min-height: 44px; }
.ballot-progress { appearance: none; display: block; grid-column: 1 / -1; width: 100%; height: 4px; margin: 0; border: 0; border-radius: 0; background: #ffffff38; }
.ballot-progress::-webkit-progress-bar { background: #ffffff38; }
.ballot-progress::-webkit-progress-value { background: var(--accent); }
.ballot-progress::-moz-progress-bar { background: var(--accent); }
.step-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-content: start; align-items: center; gap: 6px 12px; margin: 0 0 14px; padding: 10px clamp(12px, 2vw, 22px) 12px; border-top: 4px solid var(--accent); border-radius: 0 0 10px 10px; background: var(--ink); color: var(--white); }
.step-heading h1 { font-size: clamp(1.9rem, 4.3vw, 3.6rem); line-height: 1.08; overflow-wrap: anywhere; text-wrap: balance; }
.step-prompt { grid-column: 2 / -1; color: #dbe5ef; font-size: clamp(.875rem, 1.6vw, 1rem); line-height: 1.35; overflow-wrap: anywhere; }
.ballot-back { min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; font-weight: 600; }
.step-heading .ballot-back { font-size: 24px; line-height: 1; }
.step-heading .ballot-back:hover { background: #ffffff20; }
.step-heading .ballot-back:focus-visible { outline-color: var(--white); outline-offset: -3px; }
.step-position { color: #dbe5ef; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-edit-heading { margin: 0 0 14px; overflow-wrap: anywhere; }
.review-edit-heading .ballot-back { font-size: .875rem; }
.review-edit-heading .ballot-back:hover { text-decoration: underline; }
.review-edit-heading h1 { font-size: clamp(1.5rem, 4vw, 1.875rem); line-height: 1.18; letter-spacing: -.035em; }
.review-edit-heading p { margin-top: 6px; font-size: 15px; color: var(--muted); }
.review-edit-heading strong { color: var(--ink); font-weight: 600; }
.ballot-heading-pin { position: sticky; top: 0; z-index: 2; display: flow-root; block-size: 0; pointer-events: none; }
.ballot-heading-pin header { block-size: var(--heading-expanded, auto); clip-path: inset(0 round 0 0 10px 10px); pointer-events: auto; }
.ballot-heading-pin.is-compact header { clip-path: inset(0 0 calc(var(--heading-expanded, 0px) - var(--heading-collapsed, 0px)) 0 round 0 0 10px 10px); padding: 10px clamp(12px, 3vw, 24px); border-top: 4px solid var(--accent); border-radius: 0 0 10px 10px; background: var(--ink); color: var(--white); }
.ballot-heading-pin.is-compact .step-heading { gap: 6px 12px; }
.ballot-heading-pin.is-compact h1 { margin: 0; font-size: clamp(1.125rem, 3vw, 1.5rem); line-height: 1.2; }
.ballot-heading-pin.is-compact .step-position { font-size: .75rem; }
.ballot-heading-pin.is-compact .ballot-progress { height: 2px; }
.ballot-heading-pin.is-compact :is(.review-edit-heading p, .step-prompt) { display: none; }
.ballot-heading-pin.is-measuring header { block-size: auto; }
@media (prefers-reduced-motion: no-preference) {
  .ballot-heading-pin.animate-scroll:not(.is-measuring) header { will-change: clip-path; transition: clip-path 180ms ease-out; }
}
.ballot-choices { min-width: 0; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--navy-soft); }
.ballot-choices ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr)); gap: 8px; list-style: none; margin: 0; padding: 8px; }
.ballot-choices li { min-width: 0; }
.ballot-choice { display: flex; align-items: center; gap: 10px; width: 100%; height: 100%; min-height: 58px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); text-align: left; }
.ballot-choice:hover { border-color: var(--ink); background: var(--navy-soft); }
.ballot-choice:focus-visible { outline-offset: 1px; }
.ballot-choice .portrait, .ballot-choice .blank-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 50%; }
.ballot-choice .portrait-initials { font-size: 13px; }
.ballot-choice-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ballot-choice-copy strong, .ballot-choice-copy > span { display: block; font-size: 12px; }
.ballot-choice-copy > span { color: var(--muted); }
.ballot-choice-edit { font-size: 11px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.candidates-fieldset { padding: 0; border: 0; min-width: 0; margin: 0; }
.ballot-choices button, .candidate-toolbar > :is(input, button), .candidates-fieldset button, .ballot-actions button { scroll-margin-block-start: 5.5rem; }
.candidate-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.candidate-card { position: relative; display: grid; justify-items: center; align-content: start; gap: 12px; min-width: 0; min-height: 178px; padding: 18px 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); text-align: center; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.candidate-card:not(.is-selected):not(:disabled):hover { border-color: var(--ink); box-shadow: 0 4px 12px #00193612; }
.candidate-card.is-selected { background: var(--accent-soft); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.candidate-card:disabled { opacity: 1; background: var(--navy-soft); color: var(--muted); }
.candidate-card:disabled .portrait { filter: grayscale(1); opacity: .65; }
.candidate-card:disabled .selection-mark { visibility: hidden; }
.candidate-card.is-confirming { animation: ballot-selection 480ms ease-out; }
@keyframes ballot-selection {
  0%, 100% { box-shadow: inset 0 0 0 0 transparent; }
  35% { box-shadow: inset 0 0 0 3px var(--accent); }
}
.candidate-copy { min-width: 0; max-width: 100%; }
.candidate-name { display: block; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.candidate-subtitle { display: block; font-size: 14px; color: var(--muted); line-height: 1.35; margin-top: 5px; overflow-wrap: anywhere; }
.selection-mark { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #8193a8; font-size: 12px; color: transparent; background: var(--white); }
.is-selected .selection-mark { color: var(--white); border-color: var(--ink); background: var(--ink); }
.portrait { position: relative; flex: none; width: 64px; aspect-ratio: 1; border: 1px solid #77777726; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #e4e4e4; color: #444; }
.candidate-card .portrait { width: min(100%, 110px); }
.candidate-card .portrait-initials { font-size: clamp(1.45rem, 5vw, 2.25rem); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.portrait-initials { font-family: var(--display); font-size: 24px; letter-spacing: -.03em; }
.blank-mark { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; border: 1px dashed #c4c5b7; border-radius: 3px; font-size: 23px; color: var(--muted); }
.blank-choice { grid-column: 1 / -1; display: flex; align-items: center; min-height: 62px; padding: 10px 36px 10px 12px; border-style: dashed; text-align: left; }
.blank-choice .blank-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 50%; }
.blank-choice .selection-mark { top: 50%; transform: translateY(-50%); }
.ballot-actions { display: flex; justify-content: flex-end; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.candidate-tools { max-width: 600px; margin-bottom: 14px; }
.candidate-toolbar { display: flex; border: 1px solid #8193a8; border-radius: 7px; background: var(--white); }
.candidate-toolbar input { flex: 1; width: 0; min-width: 0; min-height: 46px; padding: 0 12px; border: 0; border-radius: 6px 0 0 6px; background: transparent; color: var(--ink); }
.login-form input, .setup-field input, .setup-field select, .setup-field textarea { display: block; width: 100%; padding: 12px 14px; min-height: 48px; color: var(--ink); background: var(--white); border: 1px solid #8193a8; border-radius: 4px; }
.candidate-toolbar button { flex: none; min-height: 46px; padding: 0 11px; border: 0; border-inline-start: 1px solid var(--line); background: transparent; color: var(--ink); font-size: .875rem; font-weight: 600; white-space: nowrap; }
.candidate-toolbar button:last-child { border-radius: 0 6px 6px 0; }
.candidate-toolbar button:hover, .ballot-choices-toggle[aria-expanded="true"] { background: var(--navy-soft); }
.candidate-toolbar > :focus-visible { outline-offset: -3px; }
.candidate-order-toggle[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }
.candidate-order-toggle[aria-pressed="true"]:focus-visible { outline-color: var(--white); }
.search-status:not(:empty) { margin-top: 8px; }
.review-page { max-width: 760px; margin: 0 auto; }
.review-page > .lead { margin-top: 20px; }
.ballot-summary { margin: 32px 0; border-top: 1px solid var(--ink); }
.summary-row { display: flex; align-items: center; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.summary-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.summary-copy strong { display: block; font-size: 16px; }
.summary-office { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.review-page .summary-office { color: var(--ink); font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 600; letter-spacing: 0; }
.summary-candidate { display: block; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.portrait-small { width: 46px; flex-basis: 46px; }
.portrait-small .portrait-initials { font-size: 18px; }
.review-submit { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.receipt-page { text-align: center; max-width: 700px; margin: 10px auto 40px; }
.receipt-seal { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-soft); margin: 0 auto 14px; }
.receipt-seal img { width: 29px; height: auto; }
.receipt-detail { display: flex; flex-direction: column; gap: 4px; margin: 20px auto; padding: 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-width: 460px; font-size: 12px; color: var(--muted); }
.receipt-picks { max-width: 510px; margin: 24px auto 0; text-align: start; }
.receipt-picks dl { margin: 12px 0 0; padding: 2px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.receipt-picks dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: baseline; gap: 6px 12px; padding-block: 8px; overflow-wrap: anywhere; }
.receipt-picks dl > div + div { border-top: 1px solid var(--line); }
.receipt-picks dt { color: var(--muted); font-size: .875rem; }
.receipt-picks dd { margin: 0; font-weight: 600; }
.receipt-results-time { margin: 16px auto 12px; color: var(--muted); font-size: .875rem; }
.receipt-story { display: grid; grid-template-columns: clamp(76px, 19vw, 112px) minmax(0, 1fr); align-items: center; gap: clamp(14px, 4vw, 26px); max-width: 510px; margin: 30px auto 0; padding: clamp(14px, 4vw, 24px); border: 1px solid var(--line); border-radius: 12px; background: var(--white); text-align: left; }
.receipt-story > img { display: block; width: 100%; height: auto; border-radius: 5px; background: var(--ink); }
.receipt-story h2 { font-family: var(--display); font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.1; letter-spacing: -.04em; }
.story-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 14px; margin-top: 11px; }
.story-actions .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.story-actions .button { padding-inline: 12px; }
.story-status:not(:empty) { margin-top: 8px; }
.empty-state { max-width: 740px; margin: 45px auto; }
.empty-state h1 { margin: 25px 0; }
.empty-state .body-copy { margin-top: 20px; }
.empty-state .button-row { margin-top: 30px; }
.empty-state > .button { margin-top: 25px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; padding: 6px 10px; background: var(--navy-soft); color: var(--ink); border-radius: 30px; white-space: nowrap; }
.status-open { background: #e1ebdd; color: #2f5c37; }
.status-published { background: var(--accent-soft); color: var(--ink); }
.status-dot { display: inline-block; background: currentColor; width: 6px; height: 6px; border-radius: 50%; }
.loading-page { min-height: 100svh; display: grid; place-content: center; gap: 25px; padding: 40px; }
.noscript { padding: 30px; border: 1px solid var(--line); }
.login-page { max-width: 520px; margin: 0 auto 35px; }
.login-page h1 { margin-top: 18px; }
.login-page .lead { margin-top: 24px; }
.login-form { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.login-form label { font-size: 13px; font-weight: 600; }
.login-form .button { margin-top: 5px; }
.demo-login-hint { margin: 16px 0; }
.login-page > .text-link { display: inline-block; margin-top: 20px; }
.admin-page { max-width: 1180px; margin: 0 auto; }
.admin-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.admin-heading h1 { font-size: clamp(2rem, 4vw, 3rem); }
.admin-heading > .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.admin-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.admin-heading-actions > a { display: inline-flex; align-items: center; min-height: 44px; }
.test-round-page { max-width: 900px; }
.test-round-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; }
.test-round-control { margin-bottom: 18px; border-top: 3px solid var(--accent); }
.test-round-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 18px; }
.test-round-tools > :is(button, a) { display: inline-flex; align-items: center; min-height: 44px; }
.test-round-phase { font-size: .875rem; color: var(--muted); }
.test-round-sign-in {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.25rem;
  min-height: 48svh;
  text-align: center;
}
.test-round-sign-in .button { margin-block-start: .5rem; }
.control-panel { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 28px; padding: clamp(14px, 2vw, 24px); border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.control-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.control-turnout { display: flex; align-items: baseline; gap: 8px; }
.metric-value { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.metric-label { font-size: 13px; color: var(--muted); }
.control-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.control-actions > :is(.button, .text-button) { min-height: 44px; padding: 9px 12px; }
.control-actions .control-reset { color: var(--red); }
.control-actions .control-refresh { color: var(--muted); }
.admin-advanced { margin-top: 22px; padding-inline: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.admin-advanced summary { min-height: 44px; padding-block: 10px; font-size: .875rem; font-weight: 600; cursor: pointer; }
.admin-advanced-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-bottom: 10px; }
.admin-advanced-actions > :is(button, a) { display: inline-flex; align-items: center; min-height: 44px; }
.admin-advanced-actions .control-reset { color: var(--red); }
.action-confirmation { display: grid; gap: 6px; margin-top: 16px; font-size: .875rem; font-weight: 600; }
.action-confirmation input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #8193a8; border-radius: 4px; font-size: 16px; }
.control-actions .small-copy { flex-basis: 100%; }
.readiness-panel { padding: 24px 28px; background: var(--navy-soft); border: 1px solid var(--line); margin-top: 22px; }
.readiness-panel h2 { font-size: 17px; }
.readiness-panel ul { margin: 15px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.8; }
.admin-meta { margin: 14px 0 30px; font-size: 13px; color: var(--muted); display: grid; gap: 5px; }
.allocation-section { margin-bottom: 45px; }
.allocation-section .body-copy { font-size: 14px; }
.winner-meta { display: flex; flex-direction: column; gap: 2px; font-size: 14px; text-align: right; }
.winner-meta .small-copy { font-size: 11px; }
.tie-panel { background: var(--accent-soft); border: 1px solid var(--accent); padding: 25px; margin: 25px 0; }
.tie-panel h3 { margin: 9px 0 14px; }
.tie-panel .small-copy { color: var(--muted); margin-top: 13px; max-width: 650px; }
.tie-panel .button { margin-top: 20px; }
.admin-tally-layout { display: grid; grid-template-columns: minmax(175px, 22%) minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.tally-offices { display: grid; align-self: start; gap: 4px; }
.tally-office { min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-inline-start: 3px solid transparent; border-radius: 5px; background: transparent; color: var(--ink); font-size: .875rem; font-weight: 600; line-height: 1.25; text-align: start; overflow-wrap: anywhere; }
.tally-office:hover { background: var(--navy-soft); }
.tally-office[aria-pressed="true"] { border-color: var(--line); border-inline-start-color: var(--accent); background: var(--white); }
.admin-tally { min-width: 0; padding: clamp(14px, 2.7vw, 26px); border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.admin-tally h3 { margin-bottom: 4px; }
.tally-basis { margin-bottom: 12px; color: var(--muted); font-size: .875rem; }
.admin-tally table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.admin-tally th, .admin-tally td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: start; overflow-wrap: anywhere; }
.admin-tally thead th { color: var(--muted); font-size: .875rem; }
.admin-tally tbody th { font-weight: 400; }
.admin-tally tfoot > tr > * { border-bottom: 0; font-weight: 600; padding-bottom: 0; }
.admin-tally .numeric { width: 1%; padding-inline-start: 12px; white-space: nowrap; text-align: end; font-variant-numeric: tabular-nums; }
.admin-tally .tally-share { width: 34%; padding-inline-start: clamp(10px, 2.5vw, 26px); }
.admin-tally tbody .tally-share { font-weight: 600; }
.admin-tally .vote-share-track { height: 7px; border-radius: 4px; }
.table-note { display: block; font-size: .8125rem; color: var(--green); margin-top: 2px; }
.export-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 28px; }
.export-panel h2 { font-size: 18px; }
.export-panel .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.main-content:has(.results-page, .office-results-page) { padding-block-start: clamp(20px, 3vw, 36px); }
.results-heading { display: flex; gap: 18px 30px; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.results-heading h1 { margin-top: 6px; font-size: clamp(2.7rem, 4.6vw, 5.3rem); }
.results-test-back { display: inline-flex; align-items: center; min-height: 44px; }
.results-count { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--muted); }
.results-count strong { font-size: 42px; color: var(--ink); line-height: 1; letter-spacing: -.05em; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.results-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.results-nav a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 5px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; }
.results-nav a:hover { color: var(--ink); text-decoration: underline; }
.results-nav a[aria-current="page"] { border-color: var(--accent); color: var(--ink); }
.office-results-page { max-width: 1040px; margin-inline: auto; }
.office-results-page .results-heading { margin-bottom: 8px; }
.office-results-page .results-heading h1 { font-size: clamp(2rem, 4.2vw, 3.5rem); }
.office-results-grid { display: grid; grid-template-columns: minmax(175px, 210px) minmax(0, 1fr); align-items: start; gap: 24px; }
.office-results-panel { min-width: 0; }
.office-results-nav { position: sticky; top: 12px; display: grid; gap: 3px; }
.office-results-nav a { display: flex; align-items: center; min-height: 44px; padding: 6px 12px; border-inline-start: 3px solid transparent; border-radius: 3px; font-size: .875rem; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.office-results-nav a:hover { background: var(--navy-soft); }
.office-results-nav a[aria-current="location"] { border-inline-start-color: var(--accent); background: var(--navy-soft); }
.office-results-pager { display: none; }
.office-result { min-width: 0; padding: clamp(14px, 3vw, 28px); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 0 0 8px 8px; background: var(--white); overflow-wrap: anywhere; }
.office-result:focus-visible { outline: 2px solid #8193a8; outline-offset: 2px; }
.office-result-heading { margin-bottom: 16px; }
.office-result h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
.office-appointee { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 5px; }
.office-appointee > span, .office-assignment-note, .office-empty { color: var(--muted); }
.office-appointee > span, .office-assignment-note { font-size: .875rem; }
.office-assignment-note { display: block; margin-top: 2px; font-weight: 400; }
.office-ballot-totals { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.office-ballot-totals > div { display: flex; flex-wrap: wrap; gap: 0 6px; }
.office-ballot-totals dd { margin: 0; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.office-more { min-height: 44px; margin-top: 4px; padding-inline: 10px; border: 1px solid var(--line); border-radius: 4px; }
.office-more:hover { background: var(--navy-soft); }
.results-footer-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; margin-top: 12px; }
.results-footer-tools .text-button { min-height: 44px; margin-inline-start: auto; }
.results-share-note { color: var(--muted); font-size: .8125rem; }
.office-ranking { width: 100%; border-collapse: collapse; text-align: start; font-size: .9375rem; }
.office-ranking th, .office-ranking td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.office-ranking tr > :first-child { width: 1%; padding-inline-end: 8px; color: var(--muted); white-space: nowrap; }
.office-ranking .office-vote-count, .office-ranking tr > :last-child { padding-inline-start: 8px; text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.office-ranking .office-vote-count { width: 1%; }
.office-ranking tr > :last-child { width: clamp(64px, 25%, 190px); }
.office-ranking .vote-share-track { height: 6px; }
.office-ranking thead th { color: var(--muted); font-size: .875rem; }
.office-ranking tbody tr:last-child > * { border-bottom: 0; }
.ranked-person { display: flex; align-items: center; gap: 8px; }
.ranked-person-copy { min-width: 0; }
.ranked-person-name { display: block; line-height: 1.2; }
.ranked-person .portrait { width: 32px; }
.ranked-person .portrait-initials { font-size: 13px; }
.office-ranking .portrait-initials, .result-portrait .portrait-initials { font-family: inherit; font-weight: 600; letter-spacing: 0; }
.vote-share-track { appearance: none; display: block; width: 100%; height: 4px; margin-top: 4px; padding: 0; border: 0; border-radius: 2px; background: var(--navy-soft); overflow: hidden; }
.vote-share-track::-webkit-progress-bar { background: var(--navy-soft); }
.vote-share-track::-webkit-progress-value { background: var(--vote-share-fill, var(--ink)); }
.vote-share-track::-moz-progress-bar { background: var(--vote-share-fill, var(--ink)); }
.office-elected .vote-share-track { --vote-share-fill: var(--accent); }
.results-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) repeat(3, minmax(0, 1fr)); gap: 18px; }
.result-card { border: 1px solid var(--line); border-top: 2px solid var(--ink); background: var(--white); padding: 20px; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.result-office { display: flex; align-items: baseline; gap: 10px; width: 100%; min-height: 38px; }
.result-office h2 { font-size: clamp(.875rem, 1vw, 1rem); font-weight: 600; letter-spacing: 0; line-height: 1.25; }
.result-office a { display: inline-flex; align-items: center; min-height: 28px; text-decoration-color: #00193655; text-underline-offset: 3px; }
.result-office a:hover { text-decoration-color: currentColor; }
.result-portrait { width: 80px; flex-basis: auto; margin: 12px 0 17px; }
.result-portrait .portrait-initials { font-size: 30px; }
.result-person { min-width: 0; max-width: 100%; }
.result-person h3 { font-size: var(--result-name-size, clamp(1.2rem, 1.7vw, 1.65rem)); font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
.result-subtitle { color: var(--muted); font-size: clamp(1rem, 1.15vw, 1.25rem); font-weight: 400; line-height: 1.35; margin-top: 5px; }
.result-draw { font-size: .875rem; color: var(--muted); }
.result-share { margin-top: 8px; font-size: clamp(1.5rem, 2.1vw, 2.25rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.result-draw { margin-top: 3px; }
.election-bar { width: 100%; height: var(--bar-height); background: var(--election-bar-color, var(--election-neutral, #385b7f)); }
.cabinet-runners-up { grid-column: 1 / -1; width: 100%; min-width: 0; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--stage-line, var(--line)); }
.result-card .cabinet-runners-up { font-size: .875rem; }
.cabinet-runners-label { margin: 0 0 6px; font: inherit; font-weight: 600; color: var(--stage-muted, var(--muted)); }
.cabinet-mini-chart { display: grid; gap: var(--mini-row-gap, 8px); margin: 0; padding: 0; list-style: none; }
.cabinet-mini-chart li {
  display: grid;
  grid-template-columns: var(--mini-portrait, 32px) minmax(0, 1fr) auto;
  grid-template-areas: "portrait name share" "portrait note note" "portrait bar bar";
  align-items: center;
  column-gap: .6em;
  min-width: 0;
  line-height: 1.15;
}
.cabinet-mini-portrait { grid-area: portrait; width: var(--mini-portrait, 32px); }
.cabinet-mini-portrait .portrait-initials { font: 600 calc(var(--mini-portrait, 32px) * .38)/1 "Noto Sans", Arial, sans-serif; letter-spacing: 0; }
.cabinet-mini-name { grid-area: name; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.cabinet-mini-share { grid-area: share; justify-self: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cabinet-mini-track { grid-area: bar; margin-top: .3em; height: var(--mini-bar-height, 6px); border-radius: 99px; background: var(--stage-line, var(--navy-soft)); overflow: hidden; }
.cabinet-mini-track .election-bar { width: var(--bar-width); height: 100%; border-radius: inherit; }
.cabinet-mini-assignment { grid-area: note; color: var(--stage-muted, var(--muted)); font-size: .86em; }
.cabinet-mini-excluded { --election-bar-color: var(--election-excluded, #a3a9b1); }
.election-fit-name { overflow-wrap: anywhere; text-wrap: wrap; }
.result-president { --result-name-size: clamp(1.65rem, 2.4vw, 2.75rem); grid-row: span 2; border-top: 4px solid var(--accent); padding: 26px; }
.result-president .result-portrait { width: min(100%, 225px); margin: 20px 0 25px; }
.result-president .result-portrait .portrait-initials { font-size: 65px; }
.vacant-portrait { display: grid; place-items: center; width: 80px; aspect-ratio: 1; border-radius: 50%; font-size: 40px; color: var(--muted); border: 1px dashed #b2b4a6; margin: 12px 0 17px; }
.results-waiting { text-align: center; max-width: 900px; margin: 0 auto 30px; }
.waiting-symbol { display: block; margin: 0 auto 30px; }
.waiting-metrics { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.waiting-metrics:empty { display: none; }
.waiting-metrics > * { flex: 1 1 145px; max-width: 220px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 0 0 8px 8px; background: var(--white); font-size: 13px; color: var(--muted); }
.waiting-metrics .results-count, .results-countdown { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.results-waiting .results-count strong { font-size: clamp(2.4rem, 5vw, 3.5rem); }
.results-countdown-time { margin-top: 6px; color: var(--ink); font-weight: 600; font-size: clamp(1.35rem, 4vw, 2.25rem); font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; max-width: 100%; }
.results-waiting h1 { font-size: clamp(3.2rem, 6vw, 6rem); margin: 24px 0; }
.results-waiting .lead { margin: 0 auto; max-width: 650px; }
.results-waiting > .small-copy { margin-top: 20px; }
.waiting-controls { display: flex; align-items: center; justify-content: center; gap: 25px; margin-top: 32px; }
.waiting-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

@media (min-width: 1600px) {
  .results-page .result-card { min-height: 280px; padding: 23px 25px; }
  .results-page .result-president { padding: 30px; }
  .results-page :is(.result-portrait, .vacant-portrait) { width: 96px; margin-block: 8px 14px; }
  .results-page .result-president .result-portrait { width: 245px; }
}

@media (max-width: 1000px) {
  .site-shell, .site-shell-wide { width: calc(100% - 48px); }
  .welcome-grid { gap: 40px; }
  .welcome-ballot { padding: 22px; }
  .candidate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-president { grid-column: 1 / -1; grid-row: auto; display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 25px; }
  .result-president .result-office { grid-column: span 2; }
  .result-president .result-portrait { width: 140px; margin: 15px 0 0; }
  .result-president .result-person { align-self: center; }
}

@media (max-width: 680px) {
  .office-results-grid { display: block; }
  .office-results-nav { display: none; }
  .office-results-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; margin: -5px 0 8px; color: var(--muted); font-size: .875rem; }
  .office-results-pager a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; }
  .office-results-pager a:last-child { justify-self: end; }
  .office-result-heading { margin-bottom: 10px; }
  .site-shell, .site-shell-wide { width: calc(100% - 36px); }
  .site-header { min-height: 76px; column-gap: 16px; }
  .header-brands { gap: 11px; }
  .wordmark { width: 100px; }
  .event-wordmark { width: 88px; padding-inline-start: 11px; }
  .header-right { column-gap: 18px; }
  .header-section { display: none; }
  .main-content { padding: 30px 0 42px; }
  .site-footer { flex-direction: column; gap: 5px; font-size: 11px; padding: 20px 0; }
  .demo-banner { padding: 9px 10px; font-size: 10px; }
  .demo-banner strong { font-size: 9px; }
  .welcome-grid { grid-template-columns: 1fr; gap: 36px; padding-top: 5px; }
  .welcome-title { font-size: clamp(3.5rem, 14vw, 5.8rem); }
  .welcome-copy .lead { margin-top: 24px; }
  .welcome-copy .button { width: 100%; margin-top: 25px; }
  .welcome-ballot { transform: none; box-shadow: 5px 5px 0 #dce5ee; max-width: calc(100% - 5px); }
  .office-list li { padding: 14px 0; }
  .site-shell:has(.ballot-page) .site-header { min-height: 56px; }
  .step-heading { gap: 6px 8px; padding-inline: 8px 12px; }
  .step-position { font-size: .8125rem; }
  .candidate-grid { gap: 8px; }
  .candidate-card:not(.blank-choice) { min-height: 145px; gap: 8px; padding: 16px 8px 10px; }
  .candidate-card .portrait { width: min(100%, 94px); }
  .candidate-name { font-size: 15px; }
  .candidate-subtitle { font-size: 13px; }
  .ballot-actions { margin-top: 22px; }
  .ballot-actions .button { width: 100%; }
  .summary-row { gap: 12px; padding: 14px 0; }
  .summary-row > .row-number { display: none; }
  .summary-copy strong { font-size: 14px; }
  .summary-office { font-size: 11px; }
  .summary-row .text-button { font-size: 11px; }
  .review-page .summary-row .text-button { font-size: 13px; }
  .review-page .summary-row { padding-block: 8px; }
  .review-page > .lead { font-size: 16px; }
  .review-submit { align-items: stretch; }
  .review-submit .small-copy { text-align: center; }
  .review-page .button-row { flex-direction: column; align-items: stretch; }
  .receipt-page h1 { font-size: 3rem; }
  .empty-state { margin: 18px auto; }
  .empty-state .button-row { flex-direction: column; align-items: stretch; }
  .readiness-panel { padding: 20px; }
  .winner-meta { font-size: 12px; }
  .winner-meta .small-copy { font-size: 10px; }
  .tie-panel { padding: 20px; }
  .tie-panel .button { width: 100%; }
  .admin-tally-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tally-offices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally-office { border-color: var(--line); }
  .results-heading { align-items: flex-start; gap: 15px; margin-bottom: 25px; }
  .results-heading h1 { font-size: clamp(2.25rem, 8vw, 2.9rem); }
  .results-count { flex-shrink: 0; font-size: .75rem; padding-top: 4px; }
  .results-count strong { font-size: 30px; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .result-card { padding: 15px; }
  .result-office { min-height: 35px; gap: 6px; }
  .result-office .row-number { font-size: 9px; }
  .result-portrait { width: 60px; }
  .result-president { --result-name-size: 1.2rem; grid-template-columns: 95px minmax(0, 1fr); column-gap: 17px; padding: 19px; }
  .result-president .result-portrait { width: 90px; margin-top: 12px; }
  .result-president .result-portrait .portrait-initials { font-size: 32px; }
  .results-footnote { font-size: 11px; }
  .results-waiting { margin-top: 15px; }
  .results-waiting h1 { font-size: 3.2rem; }
  .waiting-controls { flex-direction: column; gap: 12px; }
  .waiting-symbol { width: 80px; height: 80px; }
}

@media (max-width: 540px) {
  .results-grid { grid-template-columns: minmax(0, 1fr); }
  .result-card { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: start; gap: 12px 16px; }
  .result-card .result-office { grid-column: 1 / -1; min-height: 0; }
  .result-card :is(.result-portrait, .vacant-portrait) { width: 100%; margin: 0; }
  .cabinet-runners-up { margin-top: 0; }
  .result-president { grid-template-columns: 78px minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .candidate-grid { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
  .candidate-grid .candidate-card:not(.blank-choice), .candidate-grid .blank-choice {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 20px;
    align-items: center;
    align-content: center;
    justify-items: start;
    gap: 10px;
    min-height: 69px;
    padding: 2px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    text-align: start;
  }
  .candidate-grid .candidate-card:first-child { border-start-start-radius: 7px; border-start-end-radius: 7px; }
  .candidate-grid .candidate-card:last-child { border-bottom: 0; border-end-start-radius: 7px; border-end-end-radius: 7px; }
  .candidate-card:focus-visible { outline-offset: -3px; z-index: 1; }
  .candidate-card .portrait { width: 64px; }
  .candidate-card .selection-mark { position: static; transform: none; }
  .candidate-subtitle { margin-top: 2px; }
}

@media (max-width: 380px) {
  .candidate-toolbar input { padding-inline: 9px; }
  .candidate-toolbar input::placeholder { font-size: 14px; }
  .results-heading { flex-direction: column; }
  .results-count { flex-direction: row; gap: 9px; align-items: baseline; }
  .ranked-person { gap: 5px; }
  .ranked-person .portrait { width: 24px; }
  .ranked-person .portrait-initials { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .results-nav, .office-results-nav, .office-results-pager, .office-more, .results-footer-tools { display: none; }
  .site-header .header-right, .demo-banner, .button, .text-button, .site-footer { display: none; }
  .site-shell, .site-shell-wide { width: 100%; }
  .main-content { padding: 15px 0; }
  .results-grid { break-inside: avoid; }
}

.setup-page { max-width: 1080px; margin: 0 auto; }
.setup-page .page-heading h1 { font-size: clamp(2rem, 5vw, 3.15rem); }
.setup-page .page-heading .small-copy { margin: 8px 0 0; }
.setup-form { margin-top: clamp(16px, 3vw, 28px); }
.setup-editor, .setup-candidate { min-width: 0; margin: 0; }
.setup-editor { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); border: 0; padding: 0; }
.setup-tabs { position: sticky; top: 16px; align-self: start; display: grid; gap: 4px; }
.setup-tab { min-height: 46px; padding: 8px 14px; border: 1px solid transparent; border-inline-start: 3px solid transparent; border-radius: 4px; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.setup-tab:not([aria-selected="true"]):hover { background: var(--navy-soft); }
.setup-tab[aria-selected="true"] { border-color: var(--line); border-inline-start-color: var(--accent); background: var(--white); }
.setup-workspace { min-width: 0; }
.setup-section { padding: clamp(16px, 3vw, 32px); border: 1px solid var(--line); border-radius: 8px; background: var(--white); scroll-margin-block-start: 16px; }
.setup-section-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: clamp(16px, 3vw, 24px); }
.setup-section-heading h2 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); line-height: 1.3; }
.setup-section-note { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.setup-section > .small-copy { margin-bottom: 12px; }
.setup-schedule { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.setup-schedule .small-copy { margin: 4px 0 12px; }
.setup-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.setup-field { display: grid; align-content: end; gap: 7px; min-width: 0; font-size: 14px; font-weight: 600; }
.setup-field-wide { grid-column: 1 / -1; }
.setup-field input, .setup-field select, .setup-field textarea { width: 100%; min-width: 0; font-size: 16px; font-weight: 400; }
.setup-field textarea { resize: vertical; }
.setup-schedule-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.setup-schedule-field legend { margin-bottom: 7px; padding: 0; font-weight: 600; }
.setup-schedule-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .7fr); gap: 10px; }
.setup-section .setup-candidate-order { width: min(360px, 100%); }
.setup-candidate-order:not(:last-child) { margin-bottom: 24px; }
.setup-roster-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.setup-roster-tools:has(.setup-field:only-child) { grid-template-columns: minmax(0, 1fr); }
.setup-search-feedback { margin: 8px 0 0; }
.setup-search-feedback:empty, .setup-candidates:empty { display: none; }
.setup-import { margin-top: 14px; padding: 4px 14px; border-radius: 8px; background: var(--navy-soft); }
.setup-import summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 600; }
.setup-import[open] { padding-bottom: 14px; }
.setup-import .setup-field, .setup-import .button { margin-top: 10px; }
.setup-import .small-copy:not([role]) { margin-top: 8px; }
.setup-import [role="status"]:empty { display: none; }
.setup-import [role="status"] { margin: 10px 0 0; }
.setup-candidates { display: grid; gap: 8px; margin: 20px 0; }
.setup-candidate { border: 1px solid var(--line); border-radius: 8px; }
.setup-candidate > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 10px 14px; border-radius: 8px; list-style: none; cursor: pointer; }
.setup-candidate > summary::-webkit-details-marker { display: none; }
.setup-candidate > summary:hover { background: var(--navy-soft); }
.setup-candidate > summary::after { content: ''; flex: 0 0 auto; width: 8px; height: 8px; margin-inline-end: 3px; border-inline-end: 2px solid; border-block-end: 2px solid; transform: translateY(-2px) rotate(45deg); }
.setup-candidate[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.setup-candidate-summary { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; overflow-wrap: anywhere; }
.setup-candidate-description { color: var(--muted); font-size: .8rem; }
.setup-candidate-description:empty { display: none; }
.setup-candidate-fields { padding: 16px 14px; border-top: 1px solid var(--line); }
.setup-candidate-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.setup-candidate-actions > .text-button { min-height: 44px; flex-shrink: 0; }
.setup-portrait { display: flex; gap: 12px; align-items: center; min-width: 0; }
.setup-portrait-actions { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; }
.setup-portrait-actions [role="status"] { flex: 0 0 100%; margin-bottom: 0; }
.setup-portrait-actions [role="status"]:empty { display: none; }
.setup-portrait-picker { min-height: 44px; padding: 8px 12px; cursor: pointer; }
.setup-portrait-picker:focus-within { outline: 3px solid #185aa1; outline-offset: 4px; }
.setup-portrait-picker:has(:disabled) { opacity: .45; cursor: wait; }
.setup-order { margin: 16px 0 0; padding-inline-start: 34px; }
.setup-order li { padding-inline-start: 5px; border-bottom: 1px solid var(--line); }
.setup-order li::marker { font-variant-numeric: tabular-nums; }
.setup-order-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; padding: 6px 0; }
.setup-order-row > .small-copy { margin: 0; }
.setup-order-actions { display: flex; flex-shrink: 0; gap: 6px; }
.setup-order-button { min-height: 44px; width: 44px; padding: 0; font-size: 18px; }
.setup-confirmation { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; min-height: 32px; }
.setup-confirmation input { margin: 4px 0 0; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--ink); }
.setup-feedback:not(:empty) { padding: 12px 0 16px; }
.setup-actions { position: sticky; z-index: 1; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.setup-actions .text-button { min-height: 44px; }
.setup-editor :is(input, select, textarea, summary, button) { scroll-margin-block-end: 76px; }
@media (max-width: 700px) {
  .setup-editor { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .setup-tabs { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-tab { border-color: var(--line); }
}
@media (max-width: 540px) {
  .setup-fields, .setup-roster-tools { grid-template-columns: minmax(0, 1fr); }
  .setup-roster-tools .button { justify-self: start; }
  .setup-candidate-actions { align-items: flex-start; flex-direction: column; }
  .setup-candidate-summary { display: grid; }
  .setup-actions .button { padding-inline: 12px; }
}
