:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f2f4f6;
  --text: #20252c;
  --muted: #626975;
  --line: #e2e5e9;
  --line-strong: #c8ced6;
  --accent: #b63b50;
  --accent-strong: #982c40;
  --accent-soft: #fbeef0;
  --shadow: 0 8px 32px #20252c08;
}

html { scroll-padding-top: 90px; }
.recovery-shell { width: min(100%, 34rem); margin: 0 auto; padding: 2rem 1.25rem; }
.recovery-shell section { margin-top: 2rem; border-top: 1px solid var(--line); padding: 1.5rem 0; }
.recovery-shell h1 { margin: .5rem 0; font-size: 2rem; }
.recovery-shell form:not([hidden]) { display: grid; gap: 1rem; margin: 1.5rem 0; }
.recovery-shell .button, .recovery-shell input, #saveProfileButton, #forgotPasswordLink { min-height: 44px; }
.recovery-shell .button, #forgotPasswordLink { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
#forgotPasswordLink[hidden] { display: none; }
.recovery-shell [role=status] { line-height: 1.5; }
body, body.state-selected { background: var(--bg); }
body { font-size: 16px; -webkit-font-smoothing: antialiased; }
body.large-text { font-size: 18px; }
button, input, select { touch-action: manipulation; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 3px;
}
button, .button, .queue-tab, .tab-button { font-weight: 600; }
.eyebrow { letter-spacing: 0; font-size: .7rem; font-weight: 650; }
.app-shell { max-width: 1224px; width: 100%; padding: 0 32px 48px; overflow: visible; }
.topbar, body.state-selected .topbar {
  display: flex; align-items: center; padding: 22px 0; margin: 0; border: 0; border-radius: 0;
  background: transparent; min-height: 86px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; color: var(--accent); flex: 0 0 auto; }
.brand > span { font-size: 1.15rem; font-weight: 700; line-height: 1.1; }
.brand b { color: var(--accent-strong); }
.brand small { display: block; margin-top: 6px; font-size: .72rem; color: var(--muted); font-weight: 400; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions .button { white-space: nowrap; font-size: .78rem; padding: 8px 12px; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; color: var(--muted); }
.connection-status::before { content: ''; background: #9098a3; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.connection-status[data-status="online"]::before { background: #208067; }
.audience-panel, body.state-selected .audience-panel {
  grid-template-columns: 44px minmax(0, 1fr) minmax(150px, 210px);
  gap: 14px; align-items: center; padding: 15px 0; background: transparent;
  border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; margin: 0;
}
.state-flag { width: 44px; height: 30px; border: 0; border-radius: 2px; box-shadow: none; }
.state-flag span { inset: 0; text-align: center; line-height: 30px; font-size: .8rem; }
.audience-copy .eyebrow { display: none; }
.audience-copy h2 { font-size: 1rem; line-height: 1.3; }
.audience-copy p { margin: 3px 0 0; font-size: .76rem; }
.audience-panel .field { gap: 4px; grid-column: auto; min-width: 0; }
.audience-panel .field > span { font-size: .65rem; color: var(--muted); }
.audience-panel select { min-height: 38px; padding: 7px 10px; font-size: .8rem; background: var(--panel); }
.view-tabs, body.state-selected .view-tabs {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: flex-start;
  gap: 26px; border: 0; border-block: 1px solid var(--line); border-radius: 0;
  padding: 0; margin: 0 0 28px; background: var(--bg); box-shadow: none;
}
.tab-button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 58px; padding: 0 8px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-size: .88rem; }
.tab-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab-button.active { background: transparent; border-color: var(--accent); color: var(--accent-strong); }
.tab-button:hover { color: var(--accent-strong); background: var(--accent-soft); }
.section-nav { display: flex; gap: 6px; overflow-x: auto; margin: -6px 0 26px; padding: 3px; }
.section-nav button { border: 0; border-radius: 5px; min-height: 42px; padding: 8px 16px; background: transparent; color: var(--muted); white-space: nowrap; font-size: .85rem; }
.section-nav .active { color: var(--text); background: var(--panel); box-shadow: 0 1px 4px #20252c14; }
.workspace, .workspace.single-panel { display: block; }
.results-panel, body.state-selected .results-panel { background: transparent; border: 0; min-height: 0; overflow: visible; box-shadow: none; }
.swipe-panel { border: 0; background: transparent; padding: 0; gap: 24px; }
.swipe-layout { grid-template-columns: minmax(0, 720px) minmax(220px, 290px); justify-content: space-between; gap: 48px; }
.swipe-stage { gap: 22px; }
.swipe-stage > div:first-child h3, .panel-toolbar h2, .ideology-panel h3, .stats-panel h3, .newsroom-panel h3, .nearby-panel h3, .automation-panel h3 { font-size: 1.8rem; line-height: 1.25; font-weight: 700; margin: 0; }
.topic-summary { font-size: .88rem; font-weight: 400; line-height: 1.6; margin: 8px 0 0; }
.queue-tabs { gap: 4px; flex-wrap: nowrap; padding: 4px; background: transparent; border-bottom: 1px solid var(--line); overflow-x: auto; }
.queue-tab { flex: 0 0 auto; min-width: 0; min-height: 40px; padding: 7px 15px; font-size: .82rem; border: 0; background: transparent; border-radius: 5px; }
.queue-tab.active { background: var(--accent-soft); color: var(--accent-strong); }
.swipe-card-shell { padding: 0 0 12px; overflow: hidden; }
.swipe-card-shell::before, .swipe-card-shell::after { height: 100px; border-color: var(--line); bottom: 6px; left: 12px; right: 12px; transform: none; opacity: 1; }
.swipe-card-shell::after { bottom: 0; left: 24px; right: 24px; z-index: -2; }
.swipe-card { max-width: none; min-height: 470px; padding: 30px; gap: 20px; align-content: start; box-shadow: 0 4px 20px #20252c05; border-color: var(--line); will-change: auto; }
.swipe-card .detail-meta { gap: 8px; }
.status-pill { background: var(--accent-soft); color: var(--accent-strong); font-size: .72rem; font-weight: 600; border: 0; padding: 5px 9px; }
.poll-category, .question-kind { font-size: .72rem; color: var(--muted); }
.question-kind { margin-left: auto; }
.swipe-card h4 { font-size: 1.7rem; line-height: 1.3; font-weight: 650; margin: 0 0 3px; }
.swipe-option-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.swipe-option { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 57px; font-size: .96rem; font-weight: 500; background: var(--panel); border-color: var(--line); box-shadow: none; }
.option-letter { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; font-size: .72rem; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.swipe-option .option-check { margin: 0 0 0 auto; }
.swipe-option:hover, .swipe-option:focus-visible { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); box-shadow: none; }
.swipe-option.selected { background: var(--accent-soft); border-color: var(--accent); box-shadow: none; transform: none; }
.swipe-option.selected .option-letter { background: var(--accent); color: white; border-color: var(--accent); }
.swipe-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.swipe-actions > span { color: var(--muted); font-size: .73rem; }
.swipe-actions .button { min-height: 44px; font-size: .8rem; padding: 6px 0 6px 12px; flex-shrink: 0; }
.sign-in-note { margin: -10px 0 0; text-align: center; color: var(--muted); font-size: .8rem; }
.sign-in-note button { border: 0; background: transparent; color: var(--accent-strong); text-decoration: underline; min-height: 40px; }
.poll-context { border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: .8rem; }
.poll-context summary, .quiet-details summary { cursor: pointer; min-height: 35px; padding: 8px 0; font-weight: 500; }
.poll-context p { line-height: 1.65; }
.poll-context a { color: var(--accent-strong); }
.swipe-queue-panel { margin-top: 5px; padding: 0; border: 0; border-radius: 0; background: transparent; gap: 20px; }
.swipe-queue-panel h4 { font-size: .98rem; }
.queue-status { font-weight: 400; font-size: .78rem; }
.swipe-queue-list { max-height: none; overflow: visible; gap: 0; }
.queue-card { grid-template-columns: 25px minmax(0, 1fr); padding: 16px 0; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; gap: 10px; }
.queue-card.active, .queue-card:hover, .queue-card:focus { background: transparent; border-color: var(--line); box-shadow: none; }
.queue-card:hover b { color: var(--accent-strong); }
.queue-number { background: transparent; font-size: .74rem; font-weight: 500; width: 22px; height: 22px; color: var(--muted); }
.queue-card b { font-size: .86rem; line-height: 1.5; font-weight: 500; }
.queue-card em { font-size: .7rem; margin-top: 7px; color: var(--muted); font-weight: 400; }
.discovery-links { display: grid; gap: 0; }
.discovery-links button { background: transparent; border: 0; padding: 18px 0; text-align: left; border-bottom: 1px solid var(--line); }
.discovery-links strong { display: block; font-size: .88rem; font-weight: 650; color: var(--accent-strong); }
.discovery-links span { display: block; font-size: .74rem; color: var(--muted); font-weight: 400; line-height: 1.6; margin-top: 5px; }
.discovery-links span span { display: inline; }
.pulse-summary-grid { display: block; max-width: none; }
.participation-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .73rem; }
.participation-note > span:last-child { margin-left: auto; }
.participation-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.button { min-height: 44px; border-radius: 6px; font-size: .88rem; padding: 10px 17px; font-weight: 600; }
.button.primary { box-shadow: none; }
.confirm-dialog { max-width: 460px; width: calc(100% - 32px); padding: 28px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 20px 90px #20252c30; color: var(--text); background: var(--panel); }
.confirm-dialog::backdrop { background: #11182066; }
.confirm-dialog h2 { font-size: 1.45rem; margin: 0; line-height: 1.3; }
.confirm-dialog > p:not(.eyebrow) { font-size: .88rem; color: var(--muted); line-height: 1.6; }
.selected-answer { padding: 18px; background: var(--accent-soft); border-left: 3px solid var(--accent); font-weight: 650; margin: 20px 0; }
.confirmation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.confirmation-note { font-size: .78rem !important; }
.toast { z-index: 100; background: var(--text); color: white; border: 0; box-shadow: var(--shadow); font-weight: 500; font-size: .85rem; max-width: calc(100% - 32px); }
.panel-toolbar { padding: 0 0 22px; align-items: center; border: 0; }
.summary-line { font-weight: 400; line-height: 1.6; font-size: .84rem; }
.poll-browser-tabs { background: transparent; padding: 0 0 16px; margin-bottom: 20px; }
.board-layout { grid-template-columns: 290px minmax(0, 1fr); min-height: 0; gap: 24px; align-items: start; }
.poll-list { background: transparent; border: 0; padding: 0; max-height: 75vh; overscroll-behavior: contain; }
.poll-card { box-shadow: none; padding: 16px; }
.poll-card.active { background: var(--accent-soft); box-shadow: none; }
.poll-card h3 { font-size: .92rem; font-weight: 550; line-height: 1.5; }
.poll-detail { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 26px; min-width: 0; }
.poll-detail h3 { font-size: 1.45rem; line-height: 1.4; }
.detail-description { font-size: .86rem; font-weight: 400; line-height: 1.6; }
.account-panel, .profile-panel, .ideology-panel, .stats-panel, .newsroom-panel, .nearby-panel, .privacy-panel, .trust-panel, .moderation-panel, .automation-panel, .topic-panel {
  padding: 0 0 28px; margin: 0; border: 0 !important; border-radius: 0; box-shadow: none; background: transparent;
}
.account-panel, .profile-panel { max-width: 850px; margin: 0 auto; gap: 22px; }
.account-panel h2, .profile-panel h2 { font-size: 1.5rem; margin: 0; }
.account-form { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); gap: 18px; }
.account-actions { justify-content: flex-start; }
.account-actions .button { flex: 0 1 auto; }
.profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.field > span { font-weight: 500; font-size: .8rem; }
.field input, .field select { min-height: 44px; background: var(--panel); border-color: var(--line-strong); border-radius: 6px; font-size: .9rem; }
.quiet-details { margin: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; padding-top: 10px; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0; }
.profile-save-status { color: var(--muted); font-size: .78rem; }
.guest-entry { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 0; }
.guest-entry > span { font-size: .88rem; }
.guest-entry p { width: 100%; margin: 0; color: var(--muted); font-size: .8rem; }
.guest-vote-note { color: var(--muted); text-align: center; font-size: .76rem; margin: 0; }
.source-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.source-card { padding: 18px; box-shadow: none; background: var(--panel); content-visibility: auto; contain-intrinsic-size: auto 140px; }
.source-card h4 { font-size: .92rem; }
.source-type { color: var(--muted); font-size: .7rem; }
.source-brief { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.source-brief article { background: transparent; border: 0; border-radius: 0; padding: 20px 0; border-bottom: 1px solid var(--line); }
.source-brief span { font-size: .83rem; line-height: 1.7; font-weight: 400; }
body.large-text .swipe-option, body.large-text .button, body.large-text .field input, body.large-text .field select { font-size: 1.12rem; }
body.large-text .topic-summary, body.large-text .detail-description { font-size: 1rem; }
body.large-text .swipe-card h4 { font-size: 2rem; }
body.high-contrast { --text: #000; --muted: #222; --line: #777; --line-strong: #444; }
body.high-contrast .button.primary, body.high-contrast .swipe-option.selected .option-letter { background: #111; color: white; }

@media (max-width: 1050px) {
  .app-shell { padding-inline: 24px; }
  .swipe-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 26px; }
  .swipe-card { padding: 24px; }
  .swipe-card h4 { font-size: 1.55rem; }
  .board-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 18px 108px; }
  .topbar, body.state-selected .topbar { min-height: 72px; padding: 16px 0; }
  .brand > span { font-size: 1rem; }
  .brand-mark { width: 34px; height: 34px; }
  .brand small { font-size: .65rem; }
  .connection-status { font-size: .65rem; }
  .header-actions:has(#headerGuestButton:not([hidden])) .connection-status { display: none; }
  .audience-panel, body.state-selected .audience-panel { grid-template-columns: 35px minmax(0, 1fr) 144px; gap: 10px; padding: 14px 0; margin-bottom: 20px; }
  .state-flag { width: 35px; height: 24px; }
  .audience-copy h2 { font-size: .85rem; }
  .audience-copy p { display: none; }
  .audience-panel .field > span { display: none; }
  .audience-panel select { width: 100%; font-size: .75rem; }
  .view-tabs, body.state-selected .view-tabs { position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 5px 8px max(5px, env(safe-area-inset-bottom)); margin: 0; background: var(--panel); border: 0; border-top: 1px solid var(--line); box-shadow: 0 -3px 16px #20252c05; }
  .tab-button { flex-direction: column; gap: 5px; padding: 7px 2px; min-height: 59px; font-size: .65rem; border: 0; border-radius: 6px; }
  .tab-button svg { width: 21px; height: 21px; }
  .tab-button.active { background: var(--accent-soft); }
  .swipe-layout { display: block; }
  .swipe-stage { gap: 18px; }
  .swipe-stage > div:first-child h3, .panel-toolbar h2, .ideology-panel h3, .stats-panel h3, .newsroom-panel h3, .nearby-panel h3, .automation-panel h3 { font-size: 1.5rem; }
  .swipe-stage .topic-summary { font-size: .82rem; margin-top: 5px; }
  .queue-tabs { gap: 1px; padding: 0 0 5px; }
  .queue-tab { font-size: .75rem; padding: 7px 10px; min-height: 40px; }
  .swipe-card { padding: 22px 18px; gap: 18px; min-height: 440px; }
  .swipe-card h4 { font-size: 1.4rem; line-height: 1.4; }
  .swipe-option { padding: 12px; min-height: 58px; font-size: .9rem; }
  .swipe-actions > span { font-size: .7rem; }
  .swipe-actions .button { font-size: .73rem; }
  .question-kind { font-size: .65rem; }
  .poll-category { font-size: .67rem; }
  .swipe-queue-panel { display: none; }
  .participation-note { font-size: .7rem; }
  .participation-note > span:last-child { margin: 3px 0 0 14px; width: 100%; }
  .section-nav { margin: 0 0 22px; }
  .section-nav button { padding: 8px 11px; font-size: .77rem; }
  .panel-toolbar { display: grid; gap: 16px; }
  .toolbar-controls { flex-wrap: wrap; }
  .board-layout { display: flex; flex-direction: column; gap: 18px; }
  .poll-list { width: 100%; display: flex; gap: 10px; max-height: none; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 0; }
  .poll-card { flex: 0 0 85%; max-width: 330px; scroll-snap-align: start; margin: 0; }
  .poll-detail { padding: 20px 16px; width: 100%; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .account-form { padding: 20px 16px; grid-template-columns: minmax(0, 1fr); }
  .account-actions { gap: 8px; }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-brief { grid-template-columns: minmax(0, 1fr); }
  .confirm-dialog { padding: 24px 20px; }
  .confirmation-actions .button { padding-inline: 10px; font-size: .82rem; }
  .toast { bottom: 88px; }
}
@media (max-width: 370px) {
  .app-shell { padding-inline: 12px; }
  .audience-panel, body.state-selected .audience-panel { grid-template-columns: 28px minmax(0, 1fr) 126px; gap: 8px; }
  .state-flag { width: 28px; height: 20px; }
  .brand small { display: none; }
  .queue-tab { padding-inline: 8px; }
  .swipe-card { padding-inline: 15px; }
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation: none !important; }
}
/* State selection is shared by the header and profile; national voting stays available. */
.state-lock-status { margin: -8px 0 18px; font-size: 12px; line-height: 1.5; color: #59606b; }
select:disabled { opacity: 1; color: #59606b; background-color: #f1f3f5; cursor: not-allowed; }
.queue-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.queue-tabs .queue-tab { flex: 0 0 auto; white-space: nowrap; }
