:root {
  color-scheme: light;
  --brand: #003366;
  --brand-2: #1578c1;
  --gold: #f4bb33;
  --ink: #17212b;
  --muted: #52606b;
  --line: #d9e3ea;
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-2: #eaf3fa;
  --danger: #96352f;
  --success: #2f7d61;
  --shadow: 0 16px 38px rgba(0, 35, 70, 0.1);
  --shadow-soft: 0 8px 20px rgba(0, 35, 70, 0.08);
  font-family: "Gantari", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 44%, #ffffff 100%);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.evote-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.mode-switch,
.hero-actions,
.submit-row,
.form-actions,
.section-heading,
.cycle-row,
.candidate-meta,
.result-head {
  display: flex;
  align-items: center;
}

.mode-switch {
  flex-wrap: wrap;
  gap: 12px;
}

.mode-button,
.primary-button,
.ghost-button,
.icon-button,
.staff-section-button {
  border-radius: 8px;
  font-weight: 800;
}

.mode-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 0;
  padding: 10px 18px;
  background: rgba(234, 243, 250, 0.72);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(21, 120, 193, 0.08);
}

.mode-button.active {
  background: #dbeaf8;
  box-shadow: inset 0 0 0 1px rgba(21, 120, 193, 0.16);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 18px;
  border-bottom: 6px solid var(--gold);
  padding: 28px 42px;
  background: linear-gradient(135deg, rgba(0, 51, 102, 0.98), rgba(21, 120, 193, 0.9));
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  align-content: center;
}

.hero-mode-copy,
#heroStudentPanel,
#heroStaffPanel {
  display: grid;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-2);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--gold);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--brand);
  font-weight: 850;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 720px;
  margin-bottom: 10px;
  color: #ffffff;
  font-size: clamp(2.35rem, 4.05vw, 4.05rem);
  line-height: 1;
}

.lead {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  line-height: 1.45;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hero-actions span,
.hero-info-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.93rem;
  font-weight: 750;
}

.hero-info-button:hover,
.hero-info-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.12);
}

.hero-panel,
.section-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 240px;
  padding: 22px 24px;
}

.hero-panel strong {
  color: var(--brand);
  font-size: 1.45rem;
  line-height: 1.08;
}

.hero-panel span,
.section-heading p,
.feedback,
.muted {
  color: var(--muted);
  line-height: 1.5;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.mini-metrics div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface-2);
}

.mini-metrics b {
  color: var(--brand);
  font-size: 1.65rem;
  line-height: 1;
}

.student-layout,
.staff-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

.student-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 0 auto 22px;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}

.student-intro h2 {
  margin-bottom: 6px;
  font-size: 1.65rem;
}

.student-intro p {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.student-intro-points {
  display: grid;
  gap: 8px;
  min-width: 280px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.student-intro-points li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--brand);
  font-weight: 800;
}

.student-intro-points .fa-icon {
  color: var(--brand-2);
}

.student-layout {
  grid-template-columns: minmax(0, 1fr);
}

.student-layout.ballot-active {
  grid-template-columns: minmax(0, 1fr);
}

.student-layout.ballot-active .ballot-panel,
.student-results-panel,
.student-status {
  grid-column: 1 / -1;
}

.staff-grid {
  grid-template-columns: minmax(280px, 0.32fr) minmax(0, 1fr);
}

.staff-workspace {
  display: grid;
  gap: 18px;
}

.staff-context-panel {
  display: grid;
  gap: 16px;
}

.staff-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.staff-section-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  padding: 7px 11px;
  background: var(--surface);
  color: var(--brand);
}

.staff-section-button.active {
  border-color: var(--brand-2);
  background: var(--surface-2);
}

.staff-section-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.staff-screen {
  display: grid;
  gap: 18px;
}

.staff-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-panel {
  padding: 22px;
}

.ballot-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 20px 24px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.ballot-panel:has(.ballot-progress:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) 230px;
}

.ballot-panel > .section-heading,
.ballot-panel > .ballot-stack,
.ballot-panel > .submit-row,
.ballot-panel > .feedback {
  grid-column: 1;
}

.ballot-progress {
  position: sticky;
  top: 108px;
  grid-column: 2;
  grid-row: 1 / span 3;
  border: 1px solid rgba(217, 227, 234, 0.88);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(0, 35, 70, 0.12);
  backdrop-filter: blur(16px);
}

.ballot-progress strong {
  display: block;
  margin: 8px 0 10px;
  color: var(--brand);
  font-size: 2.1rem;
  line-height: 1;
}

.ballot-progress p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.progress-track {
  display: block;
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--brand-2));
  transition: width 180ms ease;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.field,
.check-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-weight: 750;
}

.field span,
.check-field span {
  color: var(--brand);
  font-size: 0.9rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
}

.field input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field input[type="color"] {
  min-height: 52px;
  padding: 6px;
  overflow: hidden;
  cursor: pointer;
}

.field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 4px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(21, 120, 193, 0.14);
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.admin-stepper__input {
  min-height: 52px;
  border: 0;
  border-radius: 0;
  text-align: center;
  padding-inline: 8px;
}

.field .admin-stepper__input {
  width: 100%;
}

.admin-stepper__step {
  min-height: 52px;
  border: 0;
  border-right: 1px solid #d8e4ed;
  border-radius: 0;
  background: #f8fbfd;
  color: var(--brand);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 900;
}

.admin-stepper__step:last-child {
  border-right: 0;
  border-left: 1px solid #d8e4ed;
}

.admin-stepper__step:hover {
  background: rgba(21, 120, 193, 0.09);
}

.admin-stepper__step:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(21, 120, 193, 0.18);
  outline-offset: -3px;
}

.admin-stepper:focus-within {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(21, 120, 193, 0.14);
}

.field .admin-stepper__input:focus {
  border-color: transparent;
  box-shadow: none;
}

.wide {
  grid-column: 1 / -1;
}

.hero-login,
.admin-form {
  display: grid;
  gap: 14px;
}

.hero-login {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.hero-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-panel-actions .primary-button {
  flex: 1 1 180px;
}

.hero-panel-actions .ghost-button {
  flex: 0 0 auto;
}

.hero-login .field {
  gap: 6px;
}

.hero-login .primary-button {
  width: 100%;
}

.hero-login-feedback {
  padding: 9px 10px;
  font-size: 0.92rem;
}

.ballot-loader {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(21, 120, 193, 0.18);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(110deg, rgba(234, 243, 250, 0.92), rgba(255, 255, 255, 0.98), rgba(244, 187, 51, 0.16)),
    #ffffff;
  background-size: 240% 100%;
  animation: loader-sheen 1.8s ease-in-out infinite;
}

.ballot-loader strong {
  display: block;
  color: var(--brand);
  line-height: 1.2;
}

.ballot-loader p {
  margin: 3px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.3;
}

.loader-ring {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(21, 120, 193, 0.18);
  border-top-color: var(--gold);
  border-right-color: var(--brand-2);
  border-radius: 999px;
  animation: loader-spin 880ms linear infinite;
}

.confirmation-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.confirmation-panel h2 {
  margin: 0;
  font-size: 1.3rem;
}

.confirmation-panel > strong {
  display: block;
  border: 1px dashed rgba(21, 120, 193, 0.36);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: 0.08em;
  text-align: center;
}

.confirmation-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
}

.confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.confirmation-actions .primary-button {
  flex: 1 1 160px;
}

.confirmation-actions .ghost-button {
  flex: 0 0 auto;
}

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

@keyframes loader-sheen {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.primary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  padding: 9px 13px;
}

.primary-button {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--brand);
}

.ghost-button,
.icon-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--brand);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  filter: brightness(0.97);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.3);
  opacity: 0.62;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.feedback {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface-2);
  font-weight: 700;
}

.feedback.error {
  border-color: rgba(150, 53, 47, 0.28);
  background: #fae8e6;
  color: var(--danger);
}

.feedback.success {
  border-color: rgba(47, 125, 97, 0.28);
  background: #e4f4ec;
  color: var(--success);
}

.ballot-stack,
.cycle-list,
.detail-grid,
.results-grid {
  display: grid;
  gap: 12px;
}

.ballot-stack {
  gap: 28px;
}

.branch-group {
  display: grid;
  gap: 16px;
}

.branch-heading {
  border-bottom: 2px solid rgba(21, 120, 193, 0.18);
  padding-bottom: 10px;
}

.branch-heading h2 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  line-height: 1.02;
}

.branch-position-stack {
  display: grid;
  gap: 18px;
}

.ballot-position {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.ballot-position h3 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.12;
}

.position-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.position-instruction {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.4;
}

.rank-status {
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(21, 120, 193, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.25;
}

.candidate-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.candidate-option {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  border: 1px solid rgba(217, 227, 234, 0.92);
  border-radius: 16px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(0, 35, 70, 0.08);
  cursor: pointer;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.candidate-option::before {
  content: "";
  position: absolute;
  top: -28px;
  left: -20px;
  width: 148px;
  height: 148px;
  border-radius: 999px;
  background: var(--party-color, #eaf3fa);
  opacity: 0.08;
  filter: blur(8px);
  pointer-events: none;
}

.candidate-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 35, 70, 0.12);
}

.readonly-ballot .candidate-option {
  cursor: default;
}

.readonly-ballot .candidate-option:hover {
  transform: none;
}

.candidate-option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.candidate-option:has(input:checked),
.candidate-option.ranked {
  border-color: var(--brand-2);
  background: var(--surface-2);
  box-shadow: 0 18px 36px rgba(0, 51, 102, 0.14);
}

.candidate-card-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.candidate-avatar {
  display: inline-flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--party-accent, var(--brand));
  font-size: 0.98rem;
  font-weight: 850;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px var(--party-color-border, rgba(21, 120, 193, 0.18)),
    0 0 0 4px var(--party-color-soft, rgba(21, 120, 193, 0.12)),
    0 16px 28px var(--party-color-soft, rgba(21, 120, 193, 0.14));
}

.candidate-avatar__initials {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.candidate-avatar__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candidate-avatar--fallback .candidate-avatar__initials {
  display: inline-flex;
}

.candidate-avatar--modal {
  width: 92px;
  height: 92px;
  flex-basis: 92px;
  box-shadow:
    inset 0 0 0 1px var(--party-color-border, rgba(21, 120, 193, 0.16)),
    0 0 0 6px var(--party-color-soft, rgba(21, 120, 193, 0.14)),
    0 22px 38px var(--party-color-soft, rgba(0, 35, 70, 0.14));
}

.candidate-card-body {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 16px;
}

.candidate-card-head {
  display: block;
  min-height: 0;
  padding-right: 0;
}

.candidate-card-identity {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.candidate-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.candidate-option strong {
  position: relative;
  display: inline-block;
  width: fit-content;
  color: var(--brand);
  font-size: 1.85rem;
  line-height: 1.12;
  padding-bottom: 6px;
}

.candidate-option strong::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: min(100%, 12rem);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f4bb33 0%, #f4bb33 82%, rgba(244, 187, 51, 0.18) 100%);
}

.candidate-inline-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(21, 120, 193, 0.16);
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-2);
  font-size: 0.82rem;
  font-weight: 725;
  line-height: 1;
}

.candidate-inline-detail:hover {
  color: var(--brand);
  border-color: rgba(21, 120, 193, 0.34);
}

.candidate-inline-detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
}

.candidate-inline-detail-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.candidate-card-copy {
  display: block;
  max-width: 600px;
  color: #3f4d5a;
  font-size: 1.02rem;
  line-height: 1.6;
}

.candidate-more-button {
  display: inline;
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-2);
  font-size: 0.98rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.candidate-more-button:hover {
  color: var(--brand);
}

.rank-marker {
  position: absolute;
  inset-block-start: 18px;
  inset-inline-end: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 46px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 1rem;
  font-weight: 900;
}

.candidate-option.ranked .rank-marker {
  background: var(--brand);
  color: #ffffff;
}

.platform-button,
.external-link-button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(21, 120, 193, 0.2);
  border-radius: 8px;
  padding: 9px 11px;
  background: #ffffff;
  color: var(--brand-2);
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(0, 35, 70, 0.07);
  cursor: pointer;
  text-decoration: none;
}

.platform-button:hover,
.external-link-button:hover {
  border-color: var(--brand-2);
  filter: brightness(0.99);
}

.platform-button svg,
.external-link-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.candidate-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-candidate-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.candidate-link-list.compact {
  margin-top: 0;
  flex: 1;
}

.candidate-link-list.compact .external-link-button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 0.9rem;
}

.platform-empty {
  color: var(--muted);
  font-weight: 800;
}

.party-pill,
.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--party-color, var(--surface-2));
  color: var(--party-ink, var(--brand));
  font-size: 0.92rem;
  font-weight: 850;
}

.party-pill-button {
  border: 0;
  cursor: pointer;
  gap: 0;
}

.candidate-card-identity .party-pill {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--party-accent, var(--brand));
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--party-color-border, rgba(21, 120, 193, 0.12));
}

.submit-row {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.submit-row .primary-button {
  margin-inline-start: auto;
}

.form-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.form-actions .primary-button {
  margin-inline-start: 0;
}

#adminOverview {
  margin-bottom: 14px;
}

.admin-overview-grid {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.admin-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-summary-item {
  display: grid;
  gap: 6px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface-2);
}

.admin-summary-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-summary-value {
  color: var(--brand);
  font-size: 0.96rem;
  font-weight: 760;
}

.admin-warning-panel {
  display: grid;
  gap: 8px;
}

.admin-warning-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.admin-warning-item {
  margin: 0;
  border: 1px solid rgba(82, 96, 107, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

.admin-warning-item.error {
  border-color: rgba(150, 53, 47, 0.5);
  color: var(--danger);
  background: #fce8e7;
}

#adminSmokeSummary {
  margin-top: 10px;
}

.admin-smoke-report {
  border: 1px dashed rgba(21, 120, 193, 0.38);
  border-radius: 8px;
  padding: 12px;
  background: rgba(234, 243, 250, 0.65);
}

.admin-check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.admin-check-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
}

.admin-check-item strong {
  color: var(--brand);
}

.admin-check-item span {
  color: var(--muted);
  font-style: italic;
}

.admin-form--disabled {
  opacity: 0.75;
}

.admin-form--disabled input,
.admin-form--disabled select,
.admin-form--disabled textarea,
.admin-form--disabled button {
  cursor: not-allowed;
}

.admin-form--editing {
  border: 1px solid rgba(21, 120, 193, 0.45);
  box-shadow: inset 0 0 0 1px rgba(21, 120, 193, 0.08);
}

.platform-modal {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}

.platform-modal[hidden] {
  display: none !important;
}

.platform-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 22, 44, 0.54);
  backdrop-filter: blur(10px);
}

.platform-modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(calc(100dvh - 48px), 860px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 251, 0.98)),
    #ffffff;
  box-shadow: 0 34px 90px rgba(0, 22, 44, 0.32);
  outline: 0;
}

.modal-sticky-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid rgba(206, 220, 231, 0.85);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(247, 250, 252, 0.97)),
    #ffffff;
}

.modal-sticky-header__copy {
  min-width: 0;
}

.modal-sticky-header__copy .eyebrow {
  margin-bottom: 10px;
}

.modal-sticky-header__copy h2 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.modal-scroll-body,
.admin-form {
  padding: 24px 34px 34px;
}

.modal-scroll-body > p:first-child {
  margin-top: 0;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.65;
}

.modal-scroll-body > p:last-child {
  margin-bottom: 0;
}

.candidate-qa-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.candidate-qa-item {
  border: 1px solid rgba(217, 227, 234, 0.88);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.74);
}

.candidate-qa-item h3 {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 1rem;
  line-height: 1.3;
}

.candidate-qa-item p {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.admin-response-group {
  border-top: 1px solid rgba(217, 227, 234, 0.88);
  padding-top: 16px;
}

.admin-response-group + .admin-response-group {
  margin-top: 16px;
}

.admin-response-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-response-group summary::-webkit-details-marker {
  display: none;
}

.response-group-affordance {
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  transform-origin: center;
  transition: transform 160ms ease, color 160ms ease;
}

.admin-response-group[open] .response-group-affordance {
  transform: rotate(180deg);
  color: var(--brand);
}

.admin-response-group .candidate-answer-preview {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding-left: 22px;
}

.admin-response-group .candidate-qa-item {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.admin-response-group .candidate-qa-item h3 {
  margin-bottom: 10px;
}

.admin-response-group .candidate-meta {
  margin-top: 12px;
  gap: 18px;
}

.response-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
}

.response-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.response-status--answered .response-status-icon {
  color: #1c7b45;
  background: rgba(28, 123, 69, 0.12);
}

.response-status--missing .response-status-icon {
  color: #b65a12;
  background: rgba(182, 90, 18, 0.14);
}

.inline-response-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 650;
}

.inline-response-action:hover {
  color: var(--brand-2);
}

.inline-response-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  line-height: 1;
}

.inline-response-action-icon svg {
  width: 100%;
  height: 100%;
}

.privacy-modal-card {
  width: min(820px, 100%);
}

.admin-entry-modal-card {
  width: min(720px, 100%);
}

.modal-sticky-header--form {
  padding-bottom: 16px;
}

.admin-entry-modal-card .admin-form {
  padding-top: 22px;
}

#answerForm textarea {
  padding: 18px 20px;
  line-height: 1.6;
}

.privacy-detail-list {
  display: grid;
  gap: 14px;
}

.privacy-detail-list p {
  margin: 0;
  border: 1px solid rgba(217, 227, 234, 0.88);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.privacy-detail-list strong {
  color: var(--brand);
}

.platform-modal-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(13, 50, 96, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand);
  box-shadow: 0 10px 26px rgba(0, 22, 44, 0.08);
  transition:
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.platform-modal-close:hover {
  border-color: rgba(13, 50, 96, 0.4);
  color: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 22, 44, 0.12);
}

.platform-modal-close:focus-visible {
  outline: 2px solid rgba(37, 122, 195, 0.35);
  outline-offset: 2px;
}

.modal-close-glyph {
  display: inline-block;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-1px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.staff-rail {
  position: sticky;
  top: 120px;
}

.cycle-row {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.cycle-row.active,
.cycle-row:hover {
  border-color: var(--brand-2);
  background: var(--surface-2);
}

.cycle-row strong {
  color: var(--brand);
}

.cycle-row span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.cycle-form,
.candidate-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.position-card,
.party-card,
.candidate-card,
.question-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.position-card h3,
.party-card h3,
.candidate-card h3,
.question-card h3,
.result-card h3 {
  margin-bottom: 4px;
}

.admin-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.admin-list-row:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-row-actions .ghost-button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.88rem;
}

.candidate-meta {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.result-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.result-bar {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
}

.result-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-2);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

@media (max-width: 940px) {
  .hero,
  .student-intro,
  .student-layout,
  .ballot-panel,
  .staff-grid,
  .admin-columns,
  .cycle-form,
  .candidate-form {
    grid-template-columns: 1fr;
  }

  .ballot-panel > .section-heading,
  .ballot-panel > .ballot-stack,
  .ballot-panel > .submit-row,
  .ballot-panel > .feedback,
  .ballot-progress {
    grid-column: 1;
  }

  .ballot-progress {
    position: static;
    grid-row: auto;
    order: 2;
  }

  .ballot-stack {
    order: 3;
  }

  .submit-row,
  #ballotFeedback {
    order: 4;
  }

  .student-intro-points {
    min-width: 0;
  }

  .candidate-options {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .staff-rail {
    position: static;
  }

  .admin-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .evote-shell {
    width: min(100% - 24px, 1280px);
  }

  .hero {
    padding: 20px 18px;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

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

  .position-head {
    flex-direction: column;
  }

  .rank-status {
    width: 100%;
  }

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

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

  .candidate-option {
    min-height: 280px;
    height: 280px;
  }

  .platform-modal {
    padding: 14px;
  }

  .modal-sticky-header {
    padding: 18px 18px 14px;
    gap: 12px;
  }

  .platform-modal-card {
    max-height: calc(100dvh - 28px);
  }

  .modal-sticky-header__copy h2 {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }

  .modal-scroll-body,
  .admin-form {
    padding: 18px 20px 24px;
  }

  .admin-summary-grid {
    grid-template-columns: 1fr;
  }
}
