:root {
  color-scheme: light;
  --ink: #17151f;
  --muted: #686476;
  --line: #ded9e8;
  --line-strong: #c9c1d7;
  --soft: #f7f3fb;
  --soft-mint: #edf7f5;
  --panel: #ffffff;
  --volt: #582c83;
  --volt-dark: #432163;
  --mint: #0f9d88;
  --amber: #d68a00;
  --rose: #bd2f63;
  --blue: #315ca8;
  --shadow: 0 14px 40px rgba(38, 22, 56, .12);
  --shadow-soft: 0 8px 22px rgba(50, 38, 67, .07);
  --radius: 8px;
  --page: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, #fff 0, #fbf9fd 310px, #f4f7f6 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(88, 44, 131, .05), transparent 38%),
    linear-gradient(245deg, transparent 52%, rgba(15, 157, 136, .045)),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, .5));
  transform: translateZ(0);
  animation: ambient-pan 18s ease-in-out infinite alternate;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--volt);
  font-weight: 800;
}

a:hover {
  color: var(--volt-dark);
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(222, 217, 232, .85);
  backdrop-filter: blur(16px);
  animation: topbar-in .46s cubic-bezier(.16, 1, .3, 1) both;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logout {
  min-height: 42px;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  min-width: max-content;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
  background: linear-gradient(90deg, var(--ink), var(--volt), var(--mint), var(--ink));
  background-size: 240% 100%;
  background-clip: text;
  color: transparent;
  animation: word-sheen 8s ease-in-out infinite;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 6px 18px rgba(50, 38, 67, .05);
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

nav a:hover {
  color: var(--ink);
  background: var(--soft);
}

nav a.active {
  background: var(--volt);
  color: #fff;
  box-shadow: 0 6px 14px rgba(88, 44, 131, .22);
  animation: active-pop .34s cubic-bezier(.16, 1, .3, 1);
}

main {
  flex: 1;
  width: 100%;
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(16px, 4vw, 42px) clamp(34px, 5vw, 56px);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px clamp(16px, 4vw, 42px);
  border-top: 1px solid rgba(222, 217, 232, .85);
  background: rgba(255, 255, 255, .82);
  color: var(--muted);
  font-size: 14px;
}

.site-footer span {
  margin-right: auto;
  font-weight: 850;
  color: var(--ink);
}

.site-footer a {
  color: var(--volt);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-footer a:hover {
  text-decoration: underline;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: center;
  width: min(var(--page), 100%);
  margin: 0 auto;
  min-height: calc(100dvh - 128px);
  padding-bottom: 22px;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(24px, 5vw, 54px);
  align-items: center;
  width: min(1040px, 100%);
  margin: 0 auto;
  min-height: calc(100dvh - 128px);
}

.auth-card {
  display: grid;
  gap: 16px;
  align-self: center;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.segmented button {
  width: 100%;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 8px;
}

.segmented button.active {
  background: var(--volt);
  color: #fff;
}

.election-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.election-select {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 100%);
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 13px;
  animation: float-select 5.5s ease-in-out infinite;
}

.election-select span {
  font-weight: 850;
  color: var(--ink);
}

.election-select select {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border-color: transparent;
  background: #fff;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--mint);
  font-weight: 850;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0;
  animation: fade-slide-right .58s cubic-bezier(.16, 1, .3, 1) both;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 74px);
  line-height: .98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 18px;
}

.lead {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2.1vw, 21px);
  line-height: 1.55;
  max-width: 720px;
}

.hero-visual {
  min-height: 390px;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(88, 44, 131, .9), rgba(15, 157, 136, .74)),
    url("data:image/svg+xml,%3Csvg width='900' height='900' viewBox='0 0 900 900' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.22' stroke-width='26'%3E%3Cpath d='M78 272c178-182 368-204 570-68 108 73 167 171 180 292'/%3E%3Cpath d='M71 568c125-125 259-172 401-141 136 30 245 116 328 257'/%3E%3Cpath d='M147 767c79-70 167-95 265-76 113 23 201 82 264 178'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Ccircle cx='259' cy='307' r='43'/%3E%3Ccircle cx='541' cy='398' r='55' fill-opacity='.88'/%3E%3Ccircle cx='372' cy='615' r='50' fill-opacity='.78'/%3E%3Ccircle cx='681' cy='625' r='38' fill-opacity='.92'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: var(--shadow);
  animation: hero-drift 14s ease-in-out infinite alternate;
}

.actions,
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.actions {
  margin-top: 26px;
}

.button,
button {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--volt);
  color: #fff;
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.button::after,
button::after {
  content: "";
  position: absolute;
  inset: -80% auto -80% -45%;
  width: 38%;
  transform: skewX(-18deg) translateX(-160%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .32), transparent);
  pointer-events: none;
}

.button:hover::after,
button:hover::after {
  animation: control-sheen .72s cubic-bezier(.16, 1, .3, 1);
}

.button:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(88, 44, 131, .2);
}

.button:active,
button:active {
  transform: translateY(0) scale(.99);
}

.button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

button.secondary,
.button.secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

button.secondary:hover,
.button.secondary:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

button.ghost {
  color: var(--volt);
  background: transparent;
  border: 1px solid transparent;
}

button.danger {
  background: var(--rose);
}

button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.section {
  width: min(var(--page), 100%);
  margin: 0 auto;
  padding: 30px 0;
}

.compare-section {
  padding-top: clamp(12px, 3vw, 28px);
}

.legal-page {
  width: min(900px, 100%);
}

.legal-page .card {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.legal-page h1 {
  font-size: clamp(38px, 6vw, 64px);
}

.legal-page h2 {
  font-size: clamp(22px, 3vw, 30px);
}

.legal-page section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.legal-page section:first-child {
  padding-top: 0;
}

.legal-page section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.6;
}

.legal-page ul {
  margin: 0;
  padding-left: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(50, 38, 67, .1);
}

.card h2,
.card h3 {
  line-height: 1.15;
}

.card p:first-child,
.card h2:first-child,
.card h3:first-child {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.table-card,
.panel-list {
  margin-top: 14px;
}

.table-card {
  overflow-x: auto;
}

.panel-subhead {
  margin-top: 22px;
  font-size: clamp(22px, 3vw, 30px);
}

.candidate-page {
  display: grid;
  gap: 18px;
}

.candidate-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding-bottom: 2px;
}

.candidate-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
}

.candidate-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  align-items: stretch;
}

.candidate-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.candidate-card:hover {
  transform: translateY(-4px);
}

.candidate-card-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.candidate-card h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.candidate-facts {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.candidate-facts div {
  display: grid;
  grid-template-columns: minmax(112px, .48fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(222, 217, 232, .75);
}

.candidate-facts div:last-child {
  border-bottom: 0;
}

.candidate-facts dt,
.candidate-facts dd {
  margin: 0;
}

.candidate-facts dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.candidate-facts dd {
  color: var(--ink);
  font-weight: 750;
  min-width: 0;
  overflow-wrap: anywhere;
}

.candidate-bio {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.candidate-link {
  margin: auto 0 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--volt);
  font-weight: 900;
  font-size: 24px;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.candidate-card:hover .avatar {
  transform: rotate(-2deg) scale(1.04);
  background: var(--volt);
  color: #fff;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

form .meta {
  margin: -2px 0 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft-mint);
  color: #126b5f;
  font-size: 12px;
  font-weight: 800;
}

.question-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.question-stack {
  display: grid;
  gap: 14px;
  max-width: 920px;
}

.question-stack > .card {
  padding: clamp(18px, 3vw, 28px);
}

.evaluation-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.evaluation-note h3 {
  margin-bottom: 6px;
}

.progress {
  height: 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, #ebe6f2, #f4eef9, #ebe6f2);
  overflow: hidden;
  margin: 4px 0 18px;
  box-shadow: inset 0 0 0 1px rgba(88, 44, 131, .06);
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .38), transparent 40%),
    linear-gradient(90deg, var(--volt), var(--mint));
  background-size: 54px 100%, 100% 100%;
  box-shadow: 0 0 18px rgba(15, 157, 136, .22);
  transition: width .72s cubic-bezier(.16, 1, .3, 1);
  animation: score-shimmer 1.35s linear infinite;
}

.stance-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.stance-buttons button {
  min-height: 74px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.stance-buttons button:hover {
  border-color: var(--volt);
  background: #fbf8ff;
  transform: translateY(-3px) scale(1.01);
}

.stance-buttons button.is-confirming {
  color: #fff;
  background: var(--volt);
  border-color: var(--volt);
}

.stance-buttons button.selected {
  border-color: var(--volt);
  box-shadow: inset 0 0 0 2px var(--volt);
}

.weight {
  margin-top: 16px;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  animation: soft-breathe 4.5s ease-in-out infinite;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 800;
}

.toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--volt);
  transition: transform .18s ease;
}

.toggle:hover input {
  transform: scale(1.15) rotate(-4deg);
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 2fr) 64px;
  gap: 12px;
  align-items: center;
  transition: transform .2s ease, color .2s ease;
}

.result-row:hover {
  transform: translateX(5px);
}

.bar {
  height: 12px;
  border-radius: 99px;
  background: #ece7f2;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--score, 0%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .24), transparent 38%),
    linear-gradient(90deg, var(--mint), var(--volt));
  background-size: 48px 100%, 100% 100%;
  animation:
    score-grow .9s cubic-bezier(.16, 1, .3, 1) both,
    score-shimmer 1.6s linear infinite;
}

.stance-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 14px;
}

.stance-table th,
.stance-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.stance-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  background: #fbfafd;
}

.stance-table tbody tr {
  transition: background .18s ease, transform .18s ease;
}

.stance-table tbody tr:hover {
  background: #fbf8ff;
  transform: translateX(3px);
}

.stance-table tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 850;
  font-size: 13px;
  transition: transform .16s ease;
}

.pill:hover {
  transform: translateY(-1px);
}

.pill.agree {
  background: #eaf8f3;
  color: #116d5a;
}

.pill.neutral {
  background: #fff5df;
  color: #805300;
}

.pill.disagree {
  background: #faeaf0;
  color: #8c2349;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-card {
  display: grid;
  gap: 14px;
}

.profile-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-facts div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.profile-facts div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.profile-facts dt,
.profile-facts dd {
  margin: 0;
}

.profile-facts dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.profile-facts dd {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.danger-zone {
  grid-column: 2;
  border-color: rgba(189, 47, 99, .35);
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tabs {
  display: grid;
  gap: 8px;
  align-content: start;
  position: sticky;
  top: 90px;
}

.tabs button {
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.tabs button.active {
  background: var(--volt);
  color: #fff;
  animation: tab-snap .42s cubic-bezier(.16, 1, .3, 1);
}

form {
  display: grid;
  gap: 12px;
}

form.card {
  align-content: start;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 10px 11px;
  transition: border-color .14s ease, box-shadow .14s ease;
}

input:focus,
select:focus,
textarea:focus,
a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(15, 157, 136, .24);
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(15, 157, 136, .12);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--soft-mint);
  color: #126b5f;
  border: 1px solid #c8ebe3;
  font-weight: 750;
  animation: notice-drop .46s cubic-bezier(.16, 1, .3, 1) both;
}

.warning {
  background: #fff7e9;
  color: #744c00;
  border-color: #f0d294;
}

.danger {
  background: #fff0f3;
  color: #8a2041;
  border-color: #f1bccb;
}

.state {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid #e8e1f1;
  border-top-color: var(--volt);
  animation: spin .9s linear infinite;
}

.motion-wipe {
  position: fixed;
  inset: -12dvh 0;
  z-index: 60;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .28), transparent 34%),
    linear-gradient(135deg, var(--volt), var(--mint));
  box-shadow: 0 0 40px rgba(88, 44, 131, .18);
}

@keyframes topbar-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ambient-pan {
  from {
    transform: translate3d(-1%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(1%, 1%, 0) scale(1.02);
  }
}

@keyframes word-sheen {
  0%, 45% {
    background-position: 0 50%;
  }
  70%, 100% {
    background-position: 100% 50%;
  }
}

@keyframes active-pop {
  0% {
    transform: scale(.94);
  }
  70% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fade-slide-right {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float-select {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes soft-breathe {
  0%, 100% {
    box-shadow: inset 0 0 0 1px rgba(88, 44, 131, .02);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(15, 157, 136, .16), 0 10px 24px rgba(15, 157, 136, .07);
  }
}

@keyframes tab-snap {
  0% {
    transform: translateX(-6px) scale(.98);
  }
  70% {
    transform: translateX(2px) scale(1.02);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

@keyframes notice-drop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-drift {
  from {
    background-position: 50% 50%;
  }
  to {
    background-position: 58% 44%;
  }
}

@keyframes control-sheen {
  from {
    transform: skewX(-18deg) translateX(-160%);
  }
  to {
    transform: skewX(-18deg) translateX(520%);
  }
}

@keyframes score-grow {
  from {
    width: 0;
  }
}

@keyframes score-shimmer {
  from {
    background-position: -48px 0, 0 0;
  }
  to {
    background-position: 96px 0, 0 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 820px) {
  .topbar {
    position: sticky;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    min-height: auto;
    padding: 10px 12px;
  }

  .brand small {
    display: none;
  }

  .topbar-actions {
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  nav {
    width: 100%;
    overflow-x: auto;
  }

  nav a {
    flex: 1 0 auto;
    text-align: center;
    padding: 9px 10px;
  }

  main {
    width: 100%;
    min-height: calc(100dvh - 106px);
    padding: 18px 10px 34px;
  }

  .site-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 16px 12px;
  }

  .site-footer a {
    white-space: normal;
  }

  .site-footer span {
    margin-right: 0;
  }

  .hero,
  .auth-screen,
  .question-shell,
  .profile-grid,
  .admin-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    align-content: start;
    gap: 18px;
    min-height: calc(100dvh - 142px);
    padding-bottom: 12px;
  }

  .auth-screen {
    align-content: start;
    min-height: calc(100dvh - 142px);
  }

  .hero-visual {
    min-height: clamp(180px, 34dvh, 260px);
  }

  .stance-buttons,
  .result-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    font-size: clamp(36px, 12vw, 52px);
  }

  h2 {
    font-size: clamp(24px, 8vw, 34px);
  }

  .card {
    padding: 14px;
  }

  .tabs {
    position: static;
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .candidate-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .candidate-count {
    width: fit-content;
  }

  .candidate-grid {
    grid-template-columns: 1fr;
  }

  .candidate-card {
    min-height: auto;
  }

  .candidate-card-head {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .candidate-facts div {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 9px 0;
  }

  .profile-facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .danger-zone {
    grid-column: auto;
  }

  .avatar {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .weight {
    align-items: stretch;
    flex-direction: column;
  }

  .header-logout {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .election-bar {
    align-items: stretch;
  }

  .election-select {
    width: 100%;
  }

  .election-select select {
    max-width: none;
  }

  .stance-table {
    display: block;
    overflow-x: auto;
    min-width: 100%;
  }
}

@media (max-width: 430px) {
  nav a {
    font-size: 13px;
    padding-inline: 8px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .header-logout {
    width: 100%;
  }

  .election-select {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .actions,
  .row {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  button {
    justify-content: center;
    width: 100%;
  }
}
