@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-sans: "Inter", "Segoe UI", Arial, sans-serif;
  --font-display: var(--font-sans);
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 34px;
  --leading-tight: 1.18;
  --leading-body: 1.58;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-rgb: 255, 255, 255;
  --surface-2: #f8fafc;
  --line: #e1e6ef;
  --table-line: #edf1f6;
  --text: #30323b;
  --heading: #171923;
  --muted: #666b79;
  --primary: #7445e8;
  --primary-dark: #5e2dcd;
  --primary-button-hover: #5e2dcd;
  --accent-text: #5e2dcd;
  --focus-ring: #4c1d95;
  --primary-soft: #f0e8ff;
  --field: #ffffff;
  --field-text: #111111;
  --field-line: #8792a5;
  --button: #eef1f7;
  --success: #147a49;
  --danger: #c72c41;
  --warning: #956018;
  --success-bg: #e9f8ef;
  --success-text: #0f6631;
  --danger-bg: #fdecef;
  --danger-text: #9f1827;
  --pill-bg: #f0e8ff;
  --pill-text: #6d35e8;
  --aurora-a: rgba(139, 92, 246, .42);
  --aurora-b: rgba(21, 18, 107, .28);
  --aurora-c: rgba(255, 255, 255, .76);
  --aurora-d: rgba(111, 76, 255, .22);
  --auth-overlay: linear-gradient(120deg, rgba(255,255,255,.68), rgba(244,245,251,.54));
  --auth-card: rgba(255, 255, 255, .96);
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, .96);
  --voter-bg: #f6f5ff;
  --shadow-sm: 0 4px 14px rgba(31, 35, 48, .06);
  --shadow-md: 0 12px 34px rgba(31, 35, 48, .09);
  --shadow-lg: 0 24px 60px rgba(56, 35, 116, .16);
  --shadow: var(--shadow-sm);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #020617;
  --surface: #111827;
  --surface-rgb: 17, 24, 39;
  --surface-2: #172033;
  --line: #31405a;
  --table-line: #253149;
  --text: #f7f7fb;
  --heading: #ffffff;
  --muted: #c3b8da;
  --primary: #6842ce;
  --primary-dark: #b9a7ff;
  --primary-button-hover: #7c3aed;
  --accent-text: #c4b5fd;
  --focus-ring: #d8b4fe;
  --primary-soft: rgba(116, 87, 217, .16);
  --field: #0b1120;
  --field-text: #f7f7fb;
  --field-line: #60718e;
  --button: #1f2a40;
  --success: #19784c;
  --danger: #c9364d;
  --warning: #d49b35;
  --success-bg: rgba(47, 209, 124, .14);
  --success-text: #80f0b4;
  --danger-bg: rgba(255, 97, 116, .16);
  --danger-text: #ff9daa;
  --pill-bg: rgba(116, 87, 217, .18);
  --pill-text: #c4b5fd;
  --aurora-a: rgba(2, 132, 199, .7);
  --aurora-b: rgba(124, 58, 237, .64);
  --aurora-c: rgba(20, 184, 166, .34);
  --aurora-d: rgba(59, 130, 246, .22);
  --auth-overlay: linear-gradient(180deg, rgba(2, 6, 23, .14), rgba(2, 6, 23, .58));
  --auth-card: rgba(17, 24, 39, .88);
  --sidebar-bg: rgba(17, 24, 39, .92);
  --topbar-bg: rgba(17, 24, 39, .88);
  --voter-bg: #020617;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .22);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, .34);
  --shadow-lg: 0 28px 68px rgba(0, 0, 0, .48);
  --shadow: var(--shadow-sm);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: var(--leading-body);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.stats strong,
.count-badge,
.candidate-number {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--heading);
  color: var(--surface);
  font-weight: 700;
  transform: translateY(calc(-100% - 20px));
}

.skip-link:focus {
  transform: translateY(0);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: 11px;
  background: var(--field);
  color: var(--field-text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

textarea {
  resize: vertical;
}

label {
  display: block;
  color: var(--heading);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.4;
}

.form-grid > div,
.stack > div,
.settings-fields > div,
.editor-form .stack > div,
.danger-zone-form > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.password-field-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.password-field-actions .btn {
  min-height: 34px;
}

.media-remove-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.media-remove-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--primary);
}

.optional-label {
  color: var(--muted);
  font-size: .9em;
  font-weight: 500;
}

.required-label {
  color: var(--danger-text);
  font-size: .9em;
  font-weight: 500;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: var(--text-md);
  line-height: 1.45;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--table-line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .01em;
}

.table-wrap tbody tr {
  transition: background .16s ease;
}

.table-wrap tbody tr:hover {
  background: color-mix(in srgb, var(--primary-soft) 34%, var(--surface));
}

.auth-page {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background: var(--bg);
}

.auth-page::before,
.app-page::before,
.voter-page::before {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: -2;
  background:
    radial-gradient(ellipse at 16% 18%, var(--aurora-a) 0 18%, transparent 42%),
    radial-gradient(ellipse at 82% 8%, var(--aurora-b) 0 16%, transparent 40%),
    radial-gradient(ellipse at 50% 78%, var(--aurora-c) 0 15%, transparent 42%),
    radial-gradient(ellipse at 72% 66%, var(--aurora-d) 0 13%, transparent 36%),
    linear-gradient(135deg, var(--bg), var(--surface-2));
  filter: blur(28px) saturate(140%);
  transform: translate3d(0, 0, 0);
  animation: none;
}

:root[data-theme="dark"] .auth-page::before,
:root[data-theme="dark"] .app-page::before,
:root[data-theme="dark"] .voter-page::before {
  inset: -12%;
  background:
    radial-gradient(ellipse 74% 68% at 7% 34%, rgba(2, 132, 199, .78) 0 21%, transparent 56%),
    radial-gradient(ellipse 70% 74% at 93% 28%, rgba(124, 58, 237, .68) 0 24%, transparent 58%),
    radial-gradient(ellipse 58% 42% at 50% 105%, rgba(20, 184, 166, .42) 0 20%, transparent 56%),
    radial-gradient(ellipse 48% 42% at 68% 78%, rgba(59, 130, 246, .22) 0 18%, transparent 54%),
    linear-gradient(135deg, #031a34 0%, #071126 38%, #1c164d 100%);
  filter: blur(10px) saturate(145%);
}

.auth-page::after,
.app-page::after,
.voter-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    var(--auth-overlay),
    linear-gradient(180deg, rgba(var(--surface-rgb), .12), transparent 46%);
  pointer-events: none;
}

:root[data-theme="dark"] .auth-page::after,
:root[data-theme="dark"] .app-page::after,
:root[data-theme="dark"] .voter-page::after {
  background:
    radial-gradient(ellipse at 50% 112%, rgba(20, 184, 166, .18), transparent 44%),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .08), transparent 34%),
    var(--auth-overlay);
  background-size: auto;
}

.app-page::before {
  inset: 0;
  background:
    radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 30%),
    linear-gradient(145deg, var(--bg), var(--surface-2));
  filter: none;
  transform: none;
  animation: none;
}

:root[data-theme="dark"] .app-page::before {
  inset: 0;
  background:
    radial-gradient(circle at 10% 6%, rgba(104, 66, 206, .16), transparent 30%),
    linear-gradient(145deg, #07101f, var(--bg));
  filter: none;
}

.app-page::after,
:root[data-theme="dark"] .app-page::after {
  background: linear-gradient(180deg, rgba(var(--surface-rgb), .04), transparent 42%);
}

.app-page,
.voter-page {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

.auth-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px;
}

.auth-card,
.done-card {
  width: min(100%, 440px);
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--auth-card);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .done-card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .stats div,
:root[data-theme="dark"] .stats > a,
:root[data-theme="dark"] .result-card,
:root[data-theme="dark"] .candidate-card,
:root[data-theme="dark"] .ballot-heading {
  background: rgba(var(--surface-rgb), .84);
  backdrop-filter: blur(18px);
}

.admin-auth-card {
  width: min(100%, 920px);
}

.initial-setup-card {
  width: min(100%, 620px);
}

.initial-setup-card .auth-content > p:not(.eyebrow) {
  margin: 10px 0 22px;
}

.initial-setup-form {
  gap: 16px;
}

.alert.setup-configuration-alert {
  display: grid;
  gap: 4px;
  margin-top: 20px;
}

.setup-configuration-alert code,
.initial-setup-form code {
  overflow-wrap: anywhere;
}

.setup-security-note {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.setup-security-note strong {
  color: var(--heading);
  font-size: 13px;
}

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

.auth-card-with-art {
  display: grid;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1.08fr) minmax(220px, .92fr);
  align-items: center;
  gap: 28px;
}

.auth-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.auth-content form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.auth-content .btn {
  min-width: 0;
  overflow-wrap: anywhere;
}

.auth-art {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 260px;
  border-radius: 8px;
  overflow: hidden;
}

.auth-art img {
  display: block;
  width: min(100%, 320px);
  height: auto;
  max-height: none;
  object-fit: contain;
}

.voter-auth-card .auth-art {
  position: relative;
  min-height: 360px;
  padding: 16px 16px 82px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--surface-rgb), .9), transparent 44%),
    linear-gradient(155deg, var(--primary-soft), color-mix(in srgb, var(--success-bg) 55%, var(--surface)));
}

.voter-auth-art-copy {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--surface) 68%, var(--line));
  border-radius: var(--radius-md);
  background: rgba(var(--surface-rgb), .72);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.voter-auth-art-copy strong {
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 14px;
}

.voter-auth-art-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.login-unavailable {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
}

.login-unavailable-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.login-unavailable-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login-unavailable > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.login-unavailable strong {
  color: var(--heading);
  font-size: 13px;
}

.login-unavailable small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-static-illustration {
  display: block;
  width: min(100%, 320px);
  height: auto;
  object-fit: contain;
}

.vote-success-mark {
  display: grid;
  place-items: center;
  width: clamp(112px, 28vw, 132px);
  aspect-ratio: 1;
  margin: -4px auto 14px;
}

.vote-success-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.vote-success-mark circle {
  fill: var(--success-bg);
  stroke: var(--success);
  stroke-width: 5;
}

.vote-success-mark path {
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
}

:root[data-theme="dark"] .auth-art {
  background: transparent;
}

:root[data-theme="dark"] .voter-auth-card .auth-art {
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--surface-rgb), .84), transparent 44%),
    linear-gradient(155deg, var(--primary-soft), color-mix(in srgb, var(--success-bg) 55%, var(--surface)));
}

.auth-card h1,
.done-card h1,
.page-header h1,
.ballot-heading h1 {
  margin: 0;
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  font-weight: 700;
}

.auth-card p,
.ballot-heading p,
.page-header p,
.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .045em;
}

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

.btn,
button.btn,
a.btn,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--button);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.25;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn:not(:disabled) {
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 35, 48, .08);
}

.btn:not(:disabled):active,
.ghost:not(:disabled):active {
  transform: translateY(0) scale(.985);
  box-shadow: none;
}

.btn.primary:not(:disabled):hover {
  background: var(--primary-button-hover);
}

.btn.success {
  background: var(--success);
  color: #fff;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.danger-subtle {
  border: 1px solid rgba(220, 53, 69, .34);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.btn.danger-subtle:hover {
  border-color: var(--danger);
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.ghost {
  border: 1px solid var(--line);
  background: var(--surface);
}

.full {
  width: 100%;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
}

.voter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.voter-actions > form {
  flex: 0 0 auto;
  margin: 0;
}

.voter-actions .ghost {
  white-space: nowrap;
}

.voter-topbar .voter-identity {
  display: grid;
  min-width: 0;
  max-width: 210px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.voter-topbar .voter-identity strong {
  overflow: hidden;
  color: var(--heading);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(17, 17, 17, .08);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 8px 20px rgba(17, 17, 17, .12);
}

.theme-toggle:focus-visible {
  border-color: var(--primary);
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-toggle-floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  background: rgba(var(--surface-rgb), .88);
  box-shadow: 0 10px 26px rgba(17, 17, 17, .12);
  backdrop-filter: blur(16px);
}

.theme-icon {
  display: block;
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

:root:not([data-theme="dark"]) .theme-icon-light,
:root[data-theme="dark"] .theme-icon-dark {
  display: none;
}

:root[data-theme="dark"] .theme-toggle {
  border-color: var(--line);
  background: var(--button);
  color: #f4efff;
}

.toast,
.alert {
  margin: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}

.toast,
.alert[data-dismissible] {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  width: min(360px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}

.toast.is-hiding,
.alert.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .56);
  color: currentColor;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(255, 255, 255, .82);
}

.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.app-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.mobile-menu-button,
.mobile-menu-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.sidebar-header .brand {
  flex: 1 1 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: var(--text-sm);
  font-family: var(--font-display);
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.08;
}

.brand-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  letter-spacing: 0;
  font-family: var(--font-display);
}

.brand-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.nav-list {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-section-label {
  margin: 14px 12px 4px;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-section-label-danger {
  margin-top: 16px;
  color: var(--warning);
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.nav-icon,
.sidebar-action-icon {
  display: block;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-icon {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.nav-icon-solid,
.nav-icon-solid path {
  fill: currentColor;
  stroke: none;
}

.nav-label {
  min-width: 0;
}

.nav-list a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav-list a:focus-visible {
  background: var(--primary-soft);
  color: var(--primary-dark);
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.nav-list a:hover .nav-icon {
  background: rgba(var(--surface-rgb), .72);
  color: var(--primary-dark);
  transform: translateX(1px);
}

.nav-list a:focus-visible .nav-icon {
  color: var(--primary-dark);
}

.nav-list a.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}

.nav-list a.is-active .nav-icon {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
  stroke-width: 1.9;
}

.nav-list .nav-reset {
  border-radius: 10px;
}

.nav-list .nav-reset .nav-icon {
  color: var(--warning);
}

.nav-list .nav-reset:hover,
.nav-list .nav-reset:focus-visible {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
}

.nav-list .nav-reset.is-active {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 11%, var(--surface));
}

.nav-list .nav-reset.is-active .nav-icon {
  background: var(--warning);
  color: #fff;
}

.sidebar-logout {
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.sidebar-account > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.sidebar-account > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--heading);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account > small {
  align-self: center;
  color: var(--primary-dark);
  font-size: var(--text-2xs);
  font-weight: 600;
}

.sidebar-action-icon {
  color: var(--muted);
}

.mobile-menu-button:focus-visible,
.sidebar-logout:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.app-main {
  width: 100%;
  max-width: 1500px;
  min-width: 0;
  margin-inline: auto;
  padding: 28px;
}

.app-main > .alert {
  margin: 0 0 16px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading-copy {
  max-width: 720px;
}

.page-heading-copy > p:last-child {
  margin-bottom: 0;
}

.management-page-header {
  align-items: center;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.page-header-actions .btn {
  gap: 6px;
  white-space: nowrap;
}

.dashboard-page-header {
  align-items: center;
}

.dashboard-command {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 28px;
  margin-bottom: 20px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 12%, rgba(var(--surface-rgb), .72) 0 8%, transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 76%, var(--surface)), var(--surface));
  box-shadow: var(--shadow-md);
}

.dashboard-command::before,
.dashboard-command::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.dashboard-command::before {
  top: -110px;
  right: 18%;
  width: 260px;
  height: 260px;
  background: rgba(116, 69, 232, .1);
  filter: blur(2px);
}

.dashboard-command::after {
  right: -70px;
  bottom: -130px;
  width: 280px;
  height: 280px;
  background: rgba(20, 122, 73, .08);
}

.dashboard-command-main,
.dashboard-command-overview {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.dashboard-command-main {
  align-self: center;
}

.dashboard-command-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.election-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--surface-rgb), .76);
  color: var(--text);
}

.election-status-pill > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.election-status-pill.is-success > span {
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 14%, transparent);
}

.election-status-pill.is-warning > span {
  background: var(--warning);
}

.dashboard-command h1 {
  max-width: 760px;
  margin: 0;
  color: var(--heading);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.dashboard-command-description {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.6;
}

.dashboard-command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.dashboard-command-actions .btn {
  gap: 9px;
  min-height: 48px;
  padding-inline: 18px;
}

.dashboard-secondary-action {
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  background: rgba(var(--surface-rgb), .72);
}

.dashboard-command-overview {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--surface) 68%, var(--line));
  border-radius: var(--radius-lg);
  background: rgba(var(--surface-rgb), .72);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.participation-overview {
  display: grid;
  gap: 8px;
  padding: 4px 4px 12px;
}

.participation-overview > div {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.participation-overview span,
.participation-overview small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.participation-overview strong {
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
}

.participation-overview progress {
  display: block;
  width: 100%;
  height: 9px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--primary-soft);
}

.participation-overview progress::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--primary-soft);
}

.participation-overview progress::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #9b72f2);
}

.participation-overview progress::-moz-progress-bar {
  border-radius: inherit;
  background: var(--primary);
}

.dashboard-command .dashboard-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-command .dashboard-stats > a {
  position: relative;
  display: grid;
  grid-template: auto auto / 30px minmax(0, 1fr);
  gap: 2px 8px;
  min-height: 82px;
  padding: 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.dashboard-command .dashboard-stats svg {
  grid-row: 1 / 3;
  align-self: center;
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-dark);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dashboard-command .dashboard-stats span,
.dashboard-command .dashboard-stats strong {
  margin: 0;
}

.dashboard-command .dashboard-stats strong {
  font-size: 24px;
}

.setup-guide {
  margin: 0 0 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
}

.setup-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.setup-guide-header h2 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  line-height: 1.25;
}

.setup-guide-header p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.setup-guide-progress {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(31, 35, 48, .06);
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-step {
  min-width: 0;
}

.setup-step a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  height: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.setup-step a:hover,
.setup-step a:focus-visible {
  border-color: var(--primary);
  background: var(--surface);
  transform: translateY(-1px);
}

.setup-step-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.setup-step-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.setup-step-copy strong {
  color: var(--heading);
  font-size: 12px;
  line-height: 1.3;
}

.setup-step-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-step.is-complete .setup-step-index {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success-text);
}

.setup-step.is-current a {
  border-color: var(--line);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(116, 69, 232, .09);
}

.setup-step.is-current .setup-step-index {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.dashboard-editor {
  scroll-margin-top: 22px;
}

.dashboard-editor-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 24px;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  transition: background .18s ease;
}

.dashboard-editor-summary::-webkit-details-marker {
  display: none;
}

.dashboard-editor-summary:hover {
  background: var(--surface-2);
}

.dashboard-editor[open] .dashboard-editor-summary {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--primary-soft) 50%, var(--surface));
}

.dashboard-editor-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.dashboard-editor-icon svg,
.dashboard-editor-chevron {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dashboard-editor-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-editor-copy strong {
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.25;
}

.dashboard-editor-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-editor-status {
  padding: 5px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 11%, var(--surface));
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-editor-status.is-ready {
  background: var(--success-bg);
  color: var(--success-text);
}

.dashboard-editor-chevron {
  color: var(--muted);
  transition: transform .2s ease;
}

.dashboard-editor[open] .dashboard-editor-chevron {
  transform: rotate(180deg);
}

.form-disclosure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.form-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}

.form-disclosure > summary::-webkit-details-marker {
  display: none;
}

.form-disclosure > summary > span:first-child {
  display: grid;
  gap: 2px;
}

.form-disclosure > summary strong {
  color: var(--heading);
  font-size: 13px;
}

.form-disclosure > summary small {
  color: var(--muted);
  font-size: 11px;
}

.form-disclosure > summary > span:last-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1;
  transition: transform .18s ease;
}

.form-disclosure[open] > summary > span:last-child {
  transform: rotate(45deg);
}

.form-disclosure > .form-grid {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.dashboard-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 20px;
  align-items: start;
}

.dashboard-primary-grid > .panel {
  margin-bottom: 20px;
}

.form-grid.dashboard-single-column {
  grid-template-columns: 1fr;
}

.election-state {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.election-state strong {
  color: var(--heading);
  font-size: 14px;
}

.election-state span {
  color: var(--muted);
  font-size: 12px;
}

.election-state-success {
  border-color: color-mix(in srgb, var(--success) 38%, var(--line));
  background: var(--success-bg);
}

.election-state-success strong {
  color: var(--success-text);
}

.election-state-warning {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}

.election-state-warning strong {
  color: var(--warning);
}

.panel {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel > header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel > header h2,
.result-card h2,
.candidate-card h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
}

.panel > header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.management-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.count-badge {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.panel > form,
.panel > p,
.panel > .table-wrap,
.panel > div:not(header) {
  padding: 18px;
}

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

.form-grid .full,
.form-grid .span-2,
.actions {
  grid-column: 1 / -1;
}

.logo-upload {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.logo-upload img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid rgba(139, 92, 246, .16);
  border-radius: 14px;
  background: #f7f4ff;
  box-shadow: 0 8px 22px rgba(17, 17, 17, .08);
}

.report-logo-upload-preview {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
}

.report-logo-upload-preview img {
  display: block;
}

.report-logo-upload-preview.is-empty {
  padding: 8px;
  border: 1px dashed var(--field-line);
  border-radius: 14px;
  background: var(--field);
  color: var(--muted);
  text-align: center;
}

.report-logo-upload-preview.is-empty span {
  font-size: var(--text-2xs);
  font-weight: 600;
  line-height: 1.25;
}

.logo-upload > .form-help {
  grid-column: 2;
  margin-top: -8px;
}

.logo-upload > .media-remove-option {
  grid-column: 2;
}

.file-picker {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
}

.file-picker-control {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: var(--field);
  color: var(--field-text);
}

.file-picker:hover .file-picker-control {
  border-color: var(--primary);
}

.file-picker:focus-within .file-picker-control,
.file-picker.is-focus-within .file-picker-control {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.file-picker:has(~ .file-picker-input:focus-visible) .file-picker-control,
.file-picker:has(+ .file-picker-input:focus-visible) .file-picker-control {
  border-color: var(--primary);
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.file-picker-button {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  background: var(--button);
  font-size: 13px;
  font-weight: 700;
}

.file-picker-name {
  min-width: 0;
  overflow: hidden;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.report-settings-form {
  display: grid;
  gap: 18px;
}

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

.settings-group {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.settings-group-logos {
  grid-column: 1 / -1;
}

.settings-group-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.settings-group-heading > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
}

.settings-group-heading h2,
.settings-group-heading h3 {
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  line-height: 1.3;
}

.settings-group-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-fields {
  display: grid;
  gap: 14px;
}

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

.settings-group-preview {
  grid-column: 1 / -1;
}

.report-letterhead-preview {
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #111827;
  box-shadow: 0 10px 24px rgba(31, 35, 48, .06);
}

.report-letterhead-preview .report-letterhead {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 4px double #111827;
}

.report-letterhead-preview .report-logo-slot {
  display: grid;
  place-items: center;
  width: 72px;
  min-width: 0;
  height: 72px;
}

.report-letterhead-preview .print-logo {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.report-letterhead-preview .print-kop {
  min-width: 0;
  color: #111827;
  font-family: var(--font-sans);
  line-height: 1.18;
  text-align: center;
  overflow-wrap: anywhere;
}

.report-letterhead-preview .print-kop-line,
.report-letterhead-preview .print-kop-school,
.report-letterhead-preview .print-kop-contacts p {
  margin: 0;
}

.report-letterhead-preview .print-kop-line,
.report-letterhead-preview .print-kop-school {
  text-transform: uppercase;
}

.report-letterhead-preview .print-kop-primary {
  font-size: 15px;
  font-weight: 700;
}

.report-letterhead-preview .print-kop-secondary {
  font-size: 14px;
  font-weight: 700;
}

.report-letterhead-preview .print-kop-school {
  font-size: 19px;
  font-weight: 800;
}

.report-letterhead-preview .print-kop-contacts {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.3;
  text-transform: none;
}

.report-preview-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.report-preview-help a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-settings-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

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

.list-filters {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.6fr)
    minmax(140px, .72fr)
    minmax(150px, .72fr)
    minmax(130px, .62fr)
    auto
    auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.list-filters label,
.list-filters > div {
  min-width: 0;
}

.list-filters input,
.list-filters select,
.list-filters .btn {
  min-height: 42px;
}

.audit-filters {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  padding: 16px;
}

.audit-filters .filter-actions {
  align-self: end;
  flex-wrap: nowrap;
}

.filter-reset {
  color: var(--muted);
}

.management-list-panel > .table-wrap {
  padding-top: 12px;
}

.responsive-table {
  min-width: 0;
}

.class-table {
  table-layout: fixed;
}

.class-table th:first-child,
.class-table td:first-child {
  width: 90px;
}

.class-table th:last-child,
.class-table td:last-child {
  width: 210px;
}

.voter-table {
  min-width: 800px;
  table-layout: fixed;
}

.voter-table-with-actions {
  min-width: 1000px;
}

.voter-col-identity {
  width: 21%;
}

.voter-col-name {
  width: 22%;
}

.voter-col-gender {
  width: 12%;
}

.voter-col-class {
  width: 16%;
}

.voter-col-actions {
  width: 29%;
}

.voter-table th {
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: normal;
}

.voter-identity-heading > span,
.voter-identity-heading > small {
  display: block;
}

.voter-identity-heading > small {
  margin-top: 1px;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 500;
}

@media (min-width: 761px) {
  .voter-table th,
  .voter-table td {
    padding-right: 12px;
    padding-left: 12px;
  }

  .voter-table th:nth-child(3),
  .voter-actions-heading {
    white-space: nowrap;
  }

  .voter-actions-heading,
  .voter-actions-cell {
    text-align: right;
  }

  .voter-actions-cell .row-actions {
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .voter-actions-cell .row-actions > form {
    display: flex;
    flex: 0 0 auto;
    margin: 0;
  }

  .voter-actions-cell .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.attendance-table {
  table-layout: fixed;
}

.attendance-table th:nth-child(2),
.attendance-table td:nth-child(2) {
  width: 150px;
}

.attendance-table th:first-child,
.attendance-table td:first-child {
  width: 68px;
}

.attendance-table th:nth-child(4),
.attendance-table td:nth-child(4) {
  width: 130px;
}

.attendance-table th:last-child,
.attendance-table td:last-child {
  width: 150px;
}

.table-primary {
  color: var(--heading);
  font-weight: 700;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 42px 24px !important;
  text-align: center;
}

.empty-state-mark {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.empty-state h3 {
  margin: 0;
  color: var(--heading);
  font-size: 19px;
}

.empty-state p {
  max-width: 480px;
  margin: 7px 0 18px;
  color: var(--muted);
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.admin-candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 360px));
  justify-content: start;
  align-items: start;
  gap: 16px;
}

.admin-candidate-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.admin-candidate-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}

.admin-candidate-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.admin-candidate-photo.is-placeholder img {
  position: absolute;
  inset: 0;
  width: min(46%, 140px);
  height: min(70%, 140px);
  margin: auto;
  padding: 0;
  object-fit: contain;
  object-position: center;
}

.candidate-number {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.admin-candidate-content {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
}

.candidate-id {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.admin-candidate-content h3 {
  margin: 0;
  color: var(--heading);
  font-size: 19px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.candidate-vision {
  display: -webkit-box;
  min-height: 48px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.card-actions > *,
.card-actions .btn {
  flex: 1 1 0;
}

.card-actions .btn {
  width: 100%;
}

.app-dialog {
  width: min(820px, calc(100% - 40px));
  height: fit-content;
  max-width: 820px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(17, 17, 17, .22);
}

.app-dialog::backdrop {
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(3px);
}

.app-dialog-small {
  width: min(480px, calc(100% - 32px));
  max-width: 480px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  border-radius: 14px;
}

.app-dialog-medium {
  width: min(700px, calc(100% - 40px));
  max-width: 700px;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--surface-rgb), .96);
  backdrop-filter: blur(16px);
}

.dialog-header > div {
  min-width: 0;
}

.dialog-header .eyebrow {
  margin-bottom: 3px;
}

.dialog-header h2 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(20px, 2vw, 22px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dialog-header p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.dialog-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.dialog-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.dialog-actions {
  position: sticky;
  bottom: -20px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 2px -20px -20px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: rgba(var(--surface-rgb), .96);
  backdrop-filter: blur(16px);
}

.dialog-support {
  display: grid;
  gap: 12px;
  padding: 20px 20px 0;
}

.dialog-support > .btn {
  justify-self: start;
}

.dialog-form-with-support {
  padding-top: 16px;
}

.voter-import-help {
  display: grid;
  gap: 5px;
}

.voter-import-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.voter-import-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  min-height: 19px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--primary);
}

.voter-import-option > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.voter-import-option strong {
  line-height: 1.35;
}

.voter-import-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.submit-progress {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--primary-soft);
}

.submit-progress[hidden] {
  display: none;
}

.submit-progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.submit-progress-track::before {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  content: "";
  transform: scaleX(0);
  transform-origin: left center;
  animation: submit-progress-fill 2.4s cubic-bezier(.4, 0, .2, 1) infinite;
}

@keyframes submit-progress-fill {
  0% {
    transform: scaleX(0);
  }

  82%,
  100% {
    transform: scaleX(1);
  }
}

@media (forced-colors: active) {
  .submit-progress-track {
    border: 1px solid CanvasText;
    background: Canvas;
  }

  .submit-progress-track::before {
    background: Highlight;
  }
}

.submit-progress-copy {
  display: grid;
  gap: 2px;
  color: var(--text);
  line-height: 1.4;
}

.submit-progress-copy strong {
  color: var(--heading);
  font-size: 13px;
}

.submit-progress-copy small {
  color: var(--muted);
  font-size: 12px;
}

.dialog-inline-alert {
  margin: 0;
}

.dialog-inline-alert:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.voter-create-form {
  gap: 18px;
}

.voter-create-section {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.voter-create-section + .voter-create-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.voter-create-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.voter-create-section-heading h3 {
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  font-weight: 600;
}

.voter-create-section-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.voter-create-form .form-grid {
  align-items: start;
  gap: 14px 16px;
}

.voter-create-form .form-grid > div {
  align-content: start;
}

.voter-create-form label {
  display: block;
}

.voter-create-form .form-help {
  margin-top: 0;
}

.account-password-panel {
  max-width: 900px;
}

.account-password-content {
  padding: 24px;
}

.account-password-form {
  max-width: 680px;
}

.confirmation-form {
  display: grid;
  gap: 24px;
  padding: 24px;
}

.confirmation-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.confirmation-copy h2 {
  margin: 0;
  color: var(--heading);
  font-size: 21px;
  line-height: 1.25;
}

.confirmation-copy p {
  margin: 6px 0 0;
  color: var(--muted);
}

.confirmation-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 20px;
  font-weight: 700;
}

.confirmation-dialog .dialog-actions {
  position: static;
  margin: 0 -24px -24px;
}

.confirmation-token-field {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--line));
  border-radius: 11px;
  background: var(--danger-bg);
}

.confirmation-token-field[hidden] {
  display: none;
}

.confirmation-token-field .form-help {
  margin: 0;
  color: var(--danger-text);
}

.confirmation-token-field input {
  max-width: 260px;
  font-weight: 700;
  letter-spacing: .08em;
}

.session-timeout-dialog {
  padding: 24px;
}

.session-timeout-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.session-timeout-content h2,
.session-timeout-content p {
  margin: 0;
}

.session-timeout-content h2 {
  color: var(--heading);
  font-size: 21px;
  line-height: 1.25;
}

.session-timeout-content p {
  margin-top: 6px;
  color: var(--muted);
}

.session-timeout-dialog .dialog-actions {
  position: static;
  margin: 20px -24px -24px;
}

form.is-submitting {
  cursor: progress;
}

form.is-submitting [type="submit"] {
  opacity: .72;
  cursor: progress;
}

form.is-submitting [type="submit"]::after,
[data-session-keepalive][aria-busy="true"]::after {
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: pending-spin .7s linear infinite;
}

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

.character-count {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.data-freshness {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.data-freshness::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  content: "";
}

.readiness-panel {
  display: grid;
  gap: 12px;
}

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

.readiness-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
}

.readiness-list li::before {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger-bg);
  color: var(--danger-text);
  content: "!";
  font-size: 12px;
  font-weight: 700;
}

.readiness-list li.is-ready::before {
  background: var(--success-bg);
  color: var(--success-text);
  content: "✓";
}

.login-election-context {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.login-election-context strong,
.login-election-context span {
  display: block;
}

.login-election-context span {
  color: var(--muted);
  font-size: 12px;
}

.candidate-vision-details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.candidate-vision-details summary {
  color: var(--accent-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.candidate-vision-details p {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  white-space: pre-wrap;
}

.audit-details summary {
  color: var(--accent-text);
  cursor: pointer;
  font-weight: 600;
}

.audit-detail-list {
  display: grid;
  grid-template-columns: minmax(100px, .4fr) minmax(0, 1fr);
  gap: 4px 12px;
  margin: 8px 0 0;
  font-size: 12px;
}

.audit-detail-list dt {
  color: var(--muted);
  font-weight: 600;
}

.audit-detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.print-generated-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.editor-panel {
  max-width: 1080px;
}

.editor-panel-compact {
  max-width: 820px;
}

.editor-form {
  display: grid;
  gap: 20px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 22px;
  align-items: start;
}

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

.editor-preview > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.editor-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
  background: var(--surface);
}

.editor-preview.is-placeholder img {
  padding: 26px;
  object-fit: contain;
  object-position: center;
}

.editor-preview strong {
  color: var(--heading);
  font-size: 16px;
}

.editor-preview small {
  color: var(--muted);
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.recovery-panel {
  max-width: 920px;
}

.reset-action-zone {
  margin-top: 30px;
  border-color: var(--line);
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
}

.reset-action-zone > header {
  background: var(--primary-soft);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--primary-soft) 78%, var(--surface)),
      color-mix(in srgb, var(--primary) 4%, var(--surface))
    );
}

.reset-action-zone > header .eyebrow,
.reset-action-zone > header h2 {
  color: var(--accent-text);
}

.reset-action-zone .reset-action-note {
  border-color: var(--line);
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
  background: var(--primary-soft);
  background: color-mix(in srgb, var(--primary-soft) 64%, var(--surface));
  color: var(--text);
  font-weight: 500;
}

.reset-action-zone .reset-action-note.is-warning {
  border-color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 34%, var(--line));
  background: var(--surface-2);
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
  color: var(--text);
}

.reset-action-zone .reset-action-note.is-error {
  border-color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  background: var(--danger-bg);
  color: var(--danger-text);
  font-weight: 600;
}

.reset-action-zone .btn.danger:disabled {
  border-color: var(--line);
  background: var(--button);
  color: var(--muted);
  opacity: 1;
}

.danger-zone-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.danger-zone-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.danger-zone-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.danger-zone-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--heading);
  font-size: 24px;
}

.danger-zone-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.danger-zone-form .danger-note {
  grid-column: 1 / -1;
  margin: 0;
}

.reset-confirmation-label {
  display: block;
  white-space: nowrap;
}

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

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.pagination-summary {
  display: grid;
  gap: 2px;
}

.pagination-summary > span {
  color: var(--muted);
  font-size: 11px;
}

.pagination-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-control,
.pagination-link {
  display: inline-grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  place-items: center;
  background: var(--surface);
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease;
}

.pagination-control svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

a.pagination-control:hover,
a.pagination-link:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.pagination-ellipsis {
  display: inline-grid;
  flex: 0 0 26px;
  min-width: 26px;
  height: 40px;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.pagination .active,
.pagination .is-current {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.pagination .is-disabled {
  cursor: not-allowed;
  opacity: .42;
}

.print-only {
  display: none !important;
}

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

.class-reference strong {
  color: var(--heading);
  font-size: 13px;
}

.class-reference div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.class-reference span {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 12px;
  font-weight: 600;
}

.dialog-context-note {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.dialog-context-note > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.dialog-context-note > strong {
  color: var(--heading);
  font-size: 15px;
  font-weight: 600;
}

.dialog-context-note > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recovery-explanation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.recovery-explanation > p {
  margin: 0;
  padding: 0 !important;
}

.recovery-explanation > .btn {
  flex: 0 0 auto;
}

.action-unavailable {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  font-size: 12px;
}

.danger-note {
  margin: 18px;
  padding: 14px;
  border: 1px solid rgba(220, 53, 69, .28);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger-text);
  font-weight: 600;
}

.stats,
.result-grid,
.candidate-grid {
  display: grid;
  gap: 16px;
}

.stats.large {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 520px));
  justify-content: center;
  align-items: stretch;
}

.result-heading-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.result-heading-line h1 {
  margin-bottom: 0;
}

.result-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.result-status-neutral {
  background: var(--button);
  color: var(--muted);
}

.result-status-live {
  border-color: color-mix(in srgb, var(--success) 34%, var(--line));
  background: var(--success-bg);
  color: var(--success-text);
}

.result-status-final {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.result-notice {
  margin: -2px 0 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary-soft) 68%, var(--surface));
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.result-stats + .result-grid,
.result-stats + .result-notice,
.result-stats + .panel {
  margin-top: 20px;
}

.stats {
  grid-template-columns: repeat(3, 112px);
}

.archive-stats.stats {
  grid-template-columns: repeat(4, minmax(112px, 1fr));
}

.stats div,
.stats > a {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stats > a {
  display: grid;
  grid-template-rows: minmax(32px, auto) auto;
  align-content: space-between;
  min-height: 96px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.stats > a:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(17, 17, 17, .09);
}

.result-progress {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--primary-soft);
}

.result-progress::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--primary-soft);
}

.result-progress::-webkit-progress-value {
  border-radius: inherit;
  background: var(--primary);
}

.result-progress::-moz-progress-bar {
  border-radius: inherit;
  background: var(--primary);
}

.result-percentage {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stats strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(28px, 3vw, 32px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.participation-banner {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 16px 0 20px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--primary-soft), var(--surface));
}

.participation-banner > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.participation-banner span,
.participation-banner p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.participation-banner strong {
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 24px;
}

.participation-banner p {
  margin: 0;
}

.participation-banner progress {
  width: 100%;
  height: 9px;
  appearance: none;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
}

.participation-banner progress::-webkit-progress-bar {
  background: var(--surface);
}

.participation-banner progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--primary);
}

.participation-banner progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--primary);
}

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

.result-card,
.candidate-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.result-card {
  display: grid;
  grid-template-columns: clamp(120px, 26%, 140px) minmax(0, 1fr);
  grid-template-rows: 1fr;
  min-width: 0;
  border-radius: 12px;
}

.result-photo {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 214px;
  aspect-ratio: auto;
  overflow: hidden;
  background: var(--surface-2);
}

.result-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.result-photo.is-placeholder img {
  padding: 24px;
  object-fit: contain;
  object-position: center;
}

.result-candidate-number {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(17, 24, 39, .18);
}

.result-card-content {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.result-card-content h2 {
  display: -webkit-box;
  min-height: 50px;
  margin: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.result-metrics > div {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--surface-2);
}

.result-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.result-metrics strong {
  display: block;
  margin-top: 3px;
  color: var(--heading);
  font-size: 22px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.result-metrics small {
  font-size: 11px;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 12px;
  font-weight: 700;
}

.success-pill {
  background: var(--success-bg);
  color: var(--success-text);
}

.warning-pill {
  background: color-mix(in srgb, var(--warning) 14%, var(--surface));
  color: var(--warning);
}

.neutral-pill {
  background: var(--button);
  color: var(--muted);
}

.account-role-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, .8fr) auto;
  gap: 8px;
  align-items: center;
}

.account-role-form select {
  min-width: 0;
}

.account-row-actions {
  flex-wrap: wrap;
}

.account-delete-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.audit-details code {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.voter-page {
  background: var(--voter-bg);
}

.voter-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  min-height: 70px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.voter-topbar .brand {
  flex: 0 1 auto;
  min-width: 0;
}

.voter-topbar .brand > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voter-shell {
  min-width: 0;
  padding: 28px 0 46px;
}

.ballot-heading {
  margin-bottom: 22px;
  padding: clamp(22px, 4vw, 34px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 18%, rgba(116, 69, 232, .16), transparent 34%),
    linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--primary-soft) 68%, var(--surface)));
  box-shadow: var(--shadow-md);
}

.ballot-heading-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ballot-heading-meta span:first-child {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}

.ballot-instruction {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.ballot-instruction strong {
  color: var(--heading);
}

.ballot-instruction-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.candidate-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 380px));
  justify-content: center;
  align-items: stretch;
  min-width: 0;
}

.candidate-grid.is-single {
  grid-template-columns: minmax(min(600px, 100%), 760px);
}

.candidate-card {
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  min-width: 0;
  max-width: 380px;
  height: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: candidate-card-enter .42s both cubic-bezier(.2, .8, .2, 1);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.candidate-card:nth-child(2) {
  animation-delay: .07s;
}

.candidate-card:nth-child(3) {
  animation-delay: .14s;
}

.candidate-card:nth-child(4) {
  animation-delay: .21s;
}

@keyframes candidate-card-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.candidate-card:hover,
.candidate-card:focus-within {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.candidate-card:active {
  transform: scale(.992);
}

.candidate-card.is-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 34%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent), var(--shadow-lg);
  transform: translateY(-3px);
}

.candidate-grid.is-single .candidate-card {
  grid-template-columns: minmax(270px, 300px) minmax(0, 1fr);
  grid-template-rows: 1fr;
  max-width: 760px;
  min-height: 0;
  height: auto;
}

.candidate-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 70%, rgba(var(--surface-rgb), .9) 0 22%, transparent 54%),
    linear-gradient(145deg, var(--primary-soft), var(--surface-2));
}

.candidate-photo::before {
  position: absolute;
  inset: 10% 15%;
  z-index: 0;
  border: 1px solid rgba(var(--surface-rgb), .58);
  border-radius: 42% 58% 52% 48%;
  background: rgba(var(--surface-rgb), .34);
  content: "";
  transform: rotate(-5deg);
}

.candidate-grid.is-single .candidate-photo {
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 3;
}

.candidate-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.candidate-photo.is-placeholder img {
  position: absolute;
  inset: 0;
  width: min(48%, 160px);
  height: min(70%, 160px);
  margin: auto;
  padding: 0;
  object-fit: contain;
  object-position: center;
}

.candidate-grid.is-single .candidate-photo.is-placeholder img {
  width: min(52%, 160px);
  height: min(74%, 160px);
}

.candidate-photo .candidate-number {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  z-index: 3;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 700;
}

.candidate-selection-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-6px) scale(.94);
  transition: opacity .18s ease, transform .18s ease;
}

.candidate-selection-badge svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.candidate-card.is-selected .candidate-selection-badge {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.candidate-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  min-width: 0;
  padding: 18px;
}

.candidate-kicker {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.candidate-grid.is-single .candidate-body {
  gap: 16px;
  padding: 26px;
}

.candidate-body h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.candidate-body p {
  margin: 0;
  min-height: 72px;
  color: var(--muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.candidate-grid.is-single .candidate-body p {
  min-height: 0;
  font-size: 16px;
}

.candidate-body form {
  align-self: end;
}

.candidate-vote-button {
  gap: 8px;
}

.candidate-vote-button svg,
.voter-switch-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.voter-switch-button {
  gap: 7px;
}

.confirmation-dialog.is-primary-confirmation .confirmation-mark {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.vote-confirmation-preview {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line));
  border-radius: var(--radius-md);
  background: var(--primary-soft);
}

.vote-confirmation-preview[hidden] {
  display: none;
}

.vote-confirmation-preview img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface);
}

.vote-confirmation-preview > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.vote-confirmation-preview small {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.vote-confirmation-preview strong {
  overflow-wrap: anywhere;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 16px;
}

.done-card {
  margin: 54px auto;
  text-align: center;
}

.vote-recorded-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 12px;
  font-weight: 700;
}

.no-js [data-theme-toggle],
.no-js [data-dialog-open],
.no-js [data-password-generate],
.no-js [data-password-visibility],
.no-js [data-print-page],
.no-js [data-dismiss],
.no-js .confirmation-dialog,
.no-js .session-timeout-dialog,
.no-js #class-edit-dialog,
.no-js #voter-password-dialog,
.no-js [data-dialog-close] {
  display: none !important;
}

.no-js noscript {
  display: contents;
}

.no-js .file-picker-input {
  position: static;
  width: 100%;
  height: auto;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.no-js-confirm {
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 8px 0;
  color: var(--heading);
  font-size: 13px;
}

.no-js .row-actions,
.no-js .card-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.no-js .row-actions form,
.no-js .card-actions form {
  display: grid;
}

.no-js-action-panel {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.no-js-action-panel summary {
  cursor: pointer;
  color: var(--heading);
  font-weight: 600;
}

.no-js-action-panel form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.no-js dialog.app-dialog:not(.confirmation-dialog) {
  position: relative;
  inset: auto;
  display: block;
  width: auto;
  max-width: 820px;
  max-height: none;
  margin: 20px 0;
}

@media (max-width: 1320px) {
  .list-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .list-filters .filter-search,
  .list-filters .filter-reset {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1061px) and (max-height: 850px) {
  .sidebar {
    gap: 10px;
    padding: 14px 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav-list {
    gap: 2px;
  }

  .nav-section-label {
    margin: 6px 12px 2px;
    font-size: var(--text-2xs);
  }

  .nav-list a {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13.5px;
  }

  .sidebar-account {
    padding: 6px 10px;
  }

  .sidebar-actions {
    gap: 8px;
  }
}

@media (max-width: 1060px) {
  .app-page,
  .stats.large {
    grid-template-columns: 1fr;
  }

  .dashboard-primary-grid,
  .report-settings-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-command {
    grid-template-columns: 1fr;
  }

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

  .settings-group-logos {
    grid-column: auto;
  }

  .app-page {
    display: block;
  }

  .no-js .mobile-menu-button,
  .no-js .mobile-menu-backdrop {
    display: none;
  }

  .no-js .sidebar {
    position: relative;
    inset: auto;
    visibility: visible;
    width: auto;
    height: auto;
    margin: 12px;
    transform: none;
    pointer-events: auto;
  }

  .no-js .app-main {
    padding-top: 24px;
  }

  body.menu-open {
    overflow: hidden;
  }

  .mobile-menu-button {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 70;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(var(--surface-rgb), .86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    transition: opacity .18s ease, transform .18s ease, background .18s ease;
  }

  .mobile-menu-button.is-scroll-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-72px);
  }

  .mobile-menu-button.is-scroll-hidden:focus-visible,
  body.menu-open .mobile-menu-button {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .mobile-menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--heading);
    transition: transform .22s ease, opacity .22s ease;
  }

  .mobile-menu-button span + span {
    margin-top: 0;
  }

  body.menu-open .mobile-menu-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  body.menu-open .mobile-menu-button span:nth-child(2) {
    opacity: 0;
  }

  body.menu-open .mobile-menu-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    background: rgba(17, 17, 17, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }

  body.menu-open .mobile-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 12px;
    right: auto;
    bottom: 12px;
    left: 12px;
    z-index: 60;
    width: min(calc(100vw - 24px), 320px);
    height: auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(var(--surface-rgb), .94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    visibility: hidden;
    pointer-events: none;
    transform: translateX(calc(-100% - 24px));
    transition: transform .26s ease, visibility 0s linear .26s;
  }

  body.menu-open .sidebar {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }

  .sidebar .brand {
    display: inline-flex;
    padding-left: 52px;
  }

  .sidebar-actions {
    position: static;
    z-index: auto;
    display: grid;
    align-items: stretch;
    gap: 10px;
  }

  .sidebar-actions .full {
    width: 100%;
  }

  .sidebar-actions .ghost {
    min-height: 44px;
  }

  .nav-list {
    display: grid;
    gap: 8px;
    margin: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-list a {
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 14px;
    white-space: normal;
  }

  .app-main {
    padding: 84px 18px 32px;
  }

  .page-header {
    display: block;
  }

  .page-header-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }

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

  .pagination-actions {
    justify-content: flex-start;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 16px;
  }

  .result-stats.stats.large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .attendance-stats.stats.large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .result-stats + .result-grid,
  .result-stats + .result-notice,
  .result-stats + .panel {
    margin-top: 14px;
  }

  .participation-banner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .participation-banner p {
    margin-top: 2px;
  }

  .list-filters {
    grid-template-columns: 1fr 1fr;
  }

  .list-filters .filter-search {
    grid-column: 1 / -1;
  }

  .list-filters .filter-reset {
    grid-column: 1 / -1;
  }

  .management-list-panel > .table-wrap {
    padding: 12px;
    overflow: visible;
  }

  .responsive-table colgroup {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr {
    display: block;
    width: 100%;
  }

  .responsive-table {
    min-width: 0;
  }

  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .responsive-table tbody {
    display: grid;
    gap: 12px;
  }

  .responsive-table tbody tr {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
  }

  .responsive-table td,
  .class-table td:first-child,
  .class-table td:last-child,
  .voter-table td:first-child,
  .voter-table td:nth-child(3),
  .voter-table td:last-child,
  .attendance-table td:first-child,
  .attendance-table td:nth-child(2),
  .attendance-table td:nth-child(4),
  .attendance-table td:last-child {
    display: grid;
    grid-template-columns: minmax(108px, 38%) minmax(0, 1fr);
    gap: 12px;
    width: auto;
    padding: 8px 0;
    border: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
  }

  .responsive-table td[data-label="Aksi"] {
    display: block;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .responsive-table td[data-label="Aksi"]::before {
    display: none;
  }

  .responsive-table .row-actions {
    display: flex;
  }

  .responsive-table .row-actions > *,
  .responsive-table .row-actions .btn {
    flex: 1 1 0;
  }

  .responsive-table .row-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .class-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 14px;
  }

  .class-table td:nth-child(2) {
    display: block;
    grid-column: 1;
    grid-row: 1;
    padding: 0;
    font-size: 15px;
  }

  .class-table td:nth-child(2)::before {
    display: block;
    margin-bottom: 3px;
    font-size: var(--text-2xs);
  }

  .class-table td.class-row-number {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    align-items: center;
    gap: 4px;
    width: auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
  }

  .class-table td.class-row-number::before {
    content: "No.";
    color: inherit;
    font-size: var(--text-2xs);
  }

  .class-table td[data-label="Aksi"] {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 2px;
    padding-top: 10px;
  }

  .voter-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 12px;
  }

  .voter-table td.voter-name {
    display: block;
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 0;
    font-size: 16px;
    line-height: 1.3;
  }

  .voter-table td.voter-name::before {
    display: none;
  }

  .voter-table td.voter-identity {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: baseline;
    gap: 8px;
    padding: 2px 0 6px;
    color: var(--muted);
    font-size: 12px;
  }

  .voter-table td.voter-identity::before {
    flex: 0 0 auto;
    font-size: 11px;
  }

  .voter-table td.voter-gender,
  .voter-table td.voter-class {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--surface-2);
  }

  .voter-table td.voter-gender {
    grid-column: 1;
    grid-row: 3;
  }

  .voter-table td.voter-class {
    grid-column: 2;
    grid-row: 3;
  }

  .voter-table td.voter-gender::before,
  .voter-table td.voter-class::before {
    font-size: 11px;
  }

  .voter-table td.voter-actions-cell {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .admin-account-table td[data-label="Hak Akses"] {
    grid-template-columns: 1fr;
  }

  .account-role-form {
    grid-template-columns: 1fr;
  }

  .account-role-form .btn {
    width: 100%;
  }

  .account-delete-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .account-delete-form .btn {
    width: 100%;
  }

  .btn.small,
  .toast-close,
  .dialog-close,
  .pagination-actions > * {
    min-width: 44px;
    min-height: 44px;
  }

  .pagination-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    width: 100%;
    padding-bottom: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .pagination-pages {
    display: inline-flex;
  }

  .pagination-control,
  .pagination-link {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .pagination-ellipsis {
    height: 44px;
  }

  .app-dialog {
    width: calc(100% - 24px);
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .app-dialog-small {
    width: calc(100% - 24px);
    max-width: 480px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .app-dialog-medium {
    width: calc(100% - 24px);
    max-width: 700px;
  }

  .editor-layout,
  .danger-zone-form {
    grid-template-columns: 1fr;
  }

  .reset-confirmation-label {
    white-space: normal;
  }

  .danger-zone-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .auth-page::before,
  .voter-page::before,
  :root[data-theme="dark"] .auth-page::before,
  :root[data-theme="dark"] .voter-page::before {
    animation: none;
    filter: none;
    transform: none;
  }

  .auth-page {
    padding-top: 70px;
  }

  .auth-shell {
    min-height: calc(100vh - 70px);
    padding: 0 16px 16px;
    align-items: start;
  }

  .theme-toggle-floating {
    top: 14px;
    right: 14px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    z-index: 60;
  }

  .toast {
    top: 68px;
    right: 12px;
    left: 12px;
    width: auto;
    margin: 0;
  }

  .voter-create-dialog .dialog-header,
  .voter-create-dialog .dialog-form {
    padding: 16px;
  }

  .voter-create-form {
    gap: 16px;
  }

  .voter-create-section + .voter-create-section {
    padding-top: 16px;
  }

  .voter-create-form .form-grid {
    gap: 13px;
  }

  .voter-create-form .dialog-actions {
    bottom: -16px;
    margin: 0 -16px -16px;
    padding: 12px 16px;
  }

  .voter-create-form .dialog-actions .primary {
    flex: 1 1 auto;
  }

  .auth-card-with-art {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .auth-card,
  .done-card {
    padding: 24px;
  }

  .auth-art {
    order: -1;
    min-height: 152px;
  }

  .voter-auth-card .auth-art {
    min-height: 152px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .voter-auth-art-copy {
    display: none;
  }

  .auth-art img {
    width: clamp(190px, 56vw, 230px);
    height: auto;
    max-height: none;
  }

  .app-main {
    padding: 84px 14px 28px;
  }

  .container {
    width: calc(100% - 24px);
    max-width: 1180px;
  }

  .voter-topbar {
    position: sticky;
    top: 0;
    z-index: 35;
    min-height: 62px;
    padding: 10px 12px;
    gap: 10px;
    backdrop-filter: blur(18px);
  }

  .voter-topbar .brand {
    gap: 8px;
  }

  .voter-topbar .brand > span:last-child {
    display: none;
  }

  .voter-topbar .brand-mark {
    width: 42px;
    height: 42px;
  }

  .voter-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  .voter-topbar .voter-identity {
    max-width: 104px;
    padding: 5px 8px;
  }

  .voter-topbar .voter-identity span {
    display: none;
  }

  .voter-actions .theme-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .voter-actions .ghost {
    min-height: 44px;
    padding: 8px 13px;
  }

  .voter-shell {
    padding: 18px 0 34px;
  }

  .ballot-heading {
    margin-bottom: 16px;
    padding: 20px;
  }

  .ballot-heading p {
    margin-bottom: 0;
  }

  .candidate-grid {
    gap: 14px;
  }

  .candidate-card {
    border-radius: 12px;
  }

  .candidate-photo img {
    object-fit: contain;
    object-position: center;
  }

  .candidate-photo .candidate-number {
    left: 12px;
    top: 12px;
    padding: 7px 10px;
  }

  .candidate-body {
    padding: 16px;
  }

  .candidate-body p {
    min-height: auto;
  }

  .result-stats > div {
    padding: 11px 9px;
  }

  .attendance-stats > div {
    padding: 11px 9px;
  }

  .result-stats span {
    font-size: var(--text-2xs);
    line-height: 1.25;
    text-transform: none;
  }

  .attendance-stats span {
    font-size: var(--text-2xs);
    line-height: 1.25;
    text-transform: none;
  }

  .result-stats strong {
    font-size: 24px;
  }

  .attendance-stats strong {
    font-size: 24px;
  }

  .result-grid {
    gap: 10px;
  }

  .result-card {
    grid-template-columns: clamp(96px, 28vw, 112px) minmax(0, 1fr);
    grid-template-rows: 1fr;
  }

  .result-photo {
    height: 100%;
    min-height: 174px;
    aspect-ratio: auto;
  }

  .result-photo.is-placeholder img {
    padding: 18px;
  }

  .result-candidate-number {
    top: 8px;
    left: 8px;
    padding: 5px 7px;
    font-size: var(--text-2xs);
  }

  .result-card-content {
    gap: 9px;
    padding: 13px;
  }

  .result-card-content h2 {
    min-height: 0;
    font-size: 16px;
  }

  .result-metrics {
    gap: 6px;
  }

  .result-metrics > div {
    padding: 8px;
  }

  .result-metrics span {
    font-size: 11px;
    line-height: 1.25;
    text-transform: none;
  }

  .result-metrics strong {
    font-size: 18px;
  }

  .form-grid,
  .nav-list,
  .stats {
    grid-template-columns: 1fr;
  }

  .archive-stats.stats {
    grid-template-columns: 1fr;
  }

  .dashboard-school-form .span-2 {
    grid-column: auto;
  }

  .dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-stats > a {
    padding: 12px 10px;
  }

  .dashboard-stats span {
    font-size: 12px;
  }

  .dashboard-stats strong {
    font-size: 24px;
  }

  .report-logo-grid {
    grid-template-columns: 1fr;
  }

  .report-logo-grid .file-picker-control {
    display: grid;
    grid-template-columns: 1fr;
  }

  .report-logo-grid .file-picker-button {
    min-height: 40px;
    justify-content: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .report-logo-grid .file-picker-name {
    padding: 9px 10px;
    text-align: center;
  }

  .settings-group {
    padding: 15px;
  }

  .report-settings-actions .btn {
    width: 100%;
  }

  .management-panel-header {
    align-items: flex-start;
  }

  .page-header-actions,
  .page-header-actions .btn {
    width: 100%;
  }

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

  .list-filters .filter-search,
  .list-filters .filter-reset {
    grid-column: 1 / -1;
  }

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

  .admin-candidate-photo {
    height: clamp(150px, 42vw, 180px);
    aspect-ratio: auto;
  }

  .admin-candidate-photo.is-placeholder img {
    width: min(38%, 110px);
    height: min(68%, 110px);
  }

  .dialog-form .form-grid {
    grid-template-columns: 1fr;
  }

  .dialog-form .span-2 {
    grid-column: auto;
  }

  .editor-actions,
  .editor-actions .btn,
  .danger-zone-form .btn {
    width: 100%;
  }

  .editor-actions {
    flex-direction: column-reverse;
  }

  .danger-zone-summary {
    gap: 8px;
  }

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

  .recovery-explanation > .btn {
    width: 100%;
  }

  .danger-zone-summary div {
    padding: 11px;
  }

  .auth-card h1,
  .done-card h1,
  .page-header h1,
  .ballot-heading h1 {
    font-size: clamp(26px, 7vw, 29px);
  }
}

@media (max-width: 760px) {
  .dashboard-command {
    gap: 22px;
    padding: 22px;
    border-radius: 20px;
  }

  .dashboard-command h1 {
    font-size: clamp(32px, 8vw, 40px);
  }

  .dashboard-command-overview {
    padding: 14px;
  }

  .dashboard-editor-summary {
    grid-template-columns: 40px minmax(0, 1fr) 22px;
    row-gap: 6px;
    padding: 14px;
  }

  .dashboard-editor-icon {
    grid-row: 1 / span 2;
  }

  .dashboard-editor-status {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    padding: 3px 7px;
    font-size: var(--text-2xs);
  }

  .dashboard-editor-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .dashboard-editor-copy small {
    white-space: normal;
  }

  .setup-guide {
    padding: 16px;
  }

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

  .candidate-grid,
  .candidate-grid.is-single {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
  }

  .candidate-card,
  .candidate-grid.is-single .candidate-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    max-width: 520px;
    min-height: 0;
    height: auto;
  }

  .candidate-photo,
  .candidate-grid.is-single .candidate-photo {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .ballot-instruction {
    align-items: flex-start;
  }

  .candidate-photo.is-placeholder img,
  .candidate-grid.is-single .candidate-photo.is-placeholder img {
    width: min(42%, 150px);
    height: min(72%, 150px);
  }

  .candidate-body,
  .candidate-grid.is-single .candidate-body {
    gap: 10px;
    padding: 16px;
  }

  .candidate-body p,
  .candidate-grid.is-single .candidate-body p {
    min-height: 0;
    font-size: 14px;
    line-height: 1.5;
  }
}

@media (max-width: 480px) {
  .dashboard-command {
    padding: 18px;
  }

  .dashboard-command-kicker {
    display: grid;
    justify-items: start;
    margin-bottom: 18px;
  }

  .dashboard-command-description {
    font-size: 14px;
  }

  .dashboard-command-actions,
  .dashboard-command-actions .btn {
    width: 100%;
  }

  .dashboard-command .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-command .dashboard-stats > a {
    grid-template: 26px auto auto / 1fr;
    justify-items: center;
    min-height: 98px;
    padding: 10px 6px;
    text-align: center;
  }

  .dashboard-command .dashboard-stats > a:last-child {
    grid-column: 1 / -1;
  }

  .dashboard-command .dashboard-stats svg {
    grid-row: auto;
  }

  .dashboard-command .dashboard-stats span {
    font-size: var(--text-2xs);
  }

  .dashboard-command .dashboard-stats strong {
    font-size: 21px;
  }

  .setup-guide-header {
    display: grid;
    gap: 10px;
  }

  .setup-guide-progress {
    justify-self: start;
  }

  .setup-steps {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .setup-step a {
    padding: 9px;
  }

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

  .dashboard-stats > a:last-child {
    grid-column: 1 / -1;
  }

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

  .voter-topbar {
    gap: 8px;
    min-height: 60px;
    padding: 8px;
  }

  .voter-topbar .brand-mark {
    width: 40px;
    height: 40px;
  }

  .voter-actions {
    gap: 6px;
  }

  .voter-topbar .voter-identity {
    max-width: 90px;
    padding: 5px 7px;
  }

  .voter-actions .ghost {
    min-height: 44px;
    padding: 7px 10px;
  }

  .voter-switch-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .voter-switch-button span {
    display: none;
  }

  .voter-logout-question {
    display: none;
  }

  .container {
    width: calc(100% - 20px);
  }

  .voter-shell {
    padding: 14px 0 28px;
  }

  .ballot-heading {
    margin-bottom: 12px;
    padding: 18px;
  }

  .candidate-grid,
  .candidate-grid.is-single {
    gap: 12px;
  }

  .candidate-body,
  .candidate-grid.is-single .candidate-body {
    gap: 9px;
    padding: 14px;
  }

  .candidate-body h2 {
    font-size: var(--text-lg);
  }

  .candidate-photo .candidate-number {
    top: 10px;
    left: 10px;
  }
}

@media (max-width: 360px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-stats > a:last-child {
    grid-column: auto;
  }

  .dashboard-command .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-command .dashboard-stats > a:last-child {
    grid-column: auto;
  }

  .container {
    width: calc(100% - 16px);
  }

  .voter-topbar {
    gap: 6px;
    padding-inline: 6px;
  }

  .voter-topbar .voter-identity {
    max-width: 82px;
  }

  .voter-topbar .voter-identity strong {
    display: none;
  }

  .voter-topbar .voter-identity span {
    display: block;
  }

  .voter-actions .ghost {
    padding-inline: 8px;
  }

  .list-filters {
    grid-template-columns: 1fr;
  }

  .list-filters .filter-search,
  .list-filters .filter-reset {
    grid-column: auto;
  }

  .result-heading-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .result-stats.stats.large {
    gap: 6px;
  }

  .attendance-stats.stats.large {
    gap: 6px;
  }

  .result-stats > div {
    padding: 9px 7px;
  }

  .attendance-stats > div {
    padding: 9px 7px;
  }

  .result-stats span {
    font-size: var(--text-2xs);
  }

  .attendance-stats span {
    font-size: var(--text-2xs);
  }

  .result-stats strong {
    font-size: 22px;
  }

  .attendance-stats strong {
    font-size: 22px;
  }

  .result-card {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .result-photo {
    min-height: 174px;
  }

  .result-photo.is-placeholder img {
    padding: 12px;
  }

  .result-card-content {
    gap: 8px;
    padding: 11px;
  }

  .result-card-content h2 {
    min-height: 0;
    font-size: 15px;
  }

  .result-metrics > div {
    padding: 7px 6px;
  }

  .result-metrics strong {
    font-size: 16px;
  }
}

@media (max-width: 640px) and (max-height: 850px) {
  .auth-page {
    padding-top: 58px;
  }

  .auth-shell {
    min-height: calc(100vh - 58px);
    padding-bottom: 12px;
  }

  .theme-toggle-floating {
    top: 8px;
    right: 10px;
  }

  .auth-card,
  .done-card {
    padding: 20px;
  }

  .auth-card-with-art {
    gap: 8px;
  }

  .auth-art {
    min-height: 146px;
  }

  .auth-art img {
    width: clamp(150px, 42vw, 175px);
    height: auto;
    max-height: none;
  }

  .auth-card h1 {
    font-size: 27px;
  }

  .auth-card p {
    margin-top: 8px;
    margin-bottom: 12px;
  }

  .auth-content .stack {
    gap: 10px;
  }
}

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

  .nav-icon,
  .mobile-menu-button span,
  .mobile-menu-backdrop,
  .sidebar {
    transition: none;
  }

  .nav-list a:hover .nav-icon {
    transform: none;
  }

  .submit-progress-track::before {
    animation: none !important;
    opacity: .7;
    transform: scaleX(.65);
  }
}

@media screen and (max-width: 640px) {
  .report-letterhead-preview {
    padding: 14px 10px;
  }

  .report-letterhead-preview .report-letterhead {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 6px;
    padding-bottom: 9px;
  }

  .report-letterhead-preview .report-logo-slot {
    width: 44px;
    height: 44px;
  }

  .report-letterhead-preview .print-logo {
    width: 40px;
    height: 40px;
  }

  .report-letterhead-preview .print-kop-primary {
    font-size: 10px;
  }

  .report-letterhead-preview .print-kop-secondary {
    font-size: 10px;
  }

  .report-letterhead-preview .print-kop-school {
    font-size: 12px;
  }

  .report-letterhead-preview .print-kop-contacts {
    margin-top: 4px;
    font-size: 10px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm 12mm 18mm;

    @bottom-center {
      color: #4b5563;
      content: "Halaman " counter(page) " dari " counter(pages);
      font-family: "Inter", Arial, sans-serif;
      font-size: 8pt;
    }
  }

  .sidebar,
  .mobile-menu-button,
  .mobile-menu-backdrop,
  .voter-topbar,
  .alert,
  .screen-only,
  form {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  html,
  body {
    width: auto;
    min-height: auto;
    overflow: visible !important;
    color: #111827;
    background: #fff !important;
    font-family: "Inter", Arial, sans-serif;
    font-size: 11pt;
  }

  .app-page,
  .app-main {
    display: block;
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible !important;
    background: #fff !important;
  }

  .app-page::before,
  .app-page::after,
  .app-main::before,
  .app-main::after {
    display: none !important;
  }

  .panel,
  .stats div {
    box-shadow: none;
  }

  .print-report {
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  .print-letterhead {
    display: grid;
    grid-template-columns: 22mm minmax(0, 1fr) 22mm;
    gap: 3mm;
    align-items: center;
    padding-bottom: 3mm;
    border-bottom: 3px double #111827;
    break-inside: avoid-page;
    break-after: avoid-page;
    page-break-inside: avoid;
  }

  .print-letterhead .report-logo-slot {
    display: grid;
    place-items: center;
    width: 22mm;
    height: 22mm;
    min-width: 0;
  }

  .print-letterhead .print-logo {
    display: block;
    width: 20mm;
    height: 20mm;
    object-fit: contain;
  }

  .print-kop {
    min-width: 0;
    text-align: center;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .print-kop-line,
  .print-kop-school,
  .print-kop-contacts p {
    margin: 0;
  }

  .print-kop-line,
  .print-kop-school {
    text-transform: uppercase;
  }

  .print-kop-primary {
    font-size: 13pt;
    font-weight: 700;
  }

  .print-kop-secondary {
    font-size: 12pt;
    font-weight: 700;
  }

  .print-kop-school {
    font-size: 16pt;
    font-weight: 800;
  }

  .print-kop-contacts {
    display: grid;
    gap: 1mm;
    margin-top: 2mm;
    font-size: 9pt;
    line-height: 1.2;
    text-transform: none;
  }

  .print-report-title {
    margin: 18px 0 12px;
    text-align: center;
    break-inside: avoid-page;
    break-after: avoid-page;
    page-break-inside: avoid;
  }

  .print-report-title h1 {
    display: inline-block;
    margin: 0 0 8px;
    border-bottom: 1px solid #111827;
    font-size: 13pt;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .print-report-title div,
  .print-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    font-size: 9.5pt;
  }

  .print-generated-meta {
    color: #374151;
    font-size: 8.5pt;
    text-align: center;
  }

  .print-summary {
    justify-content: flex-start;
    margin: 0 0 10px;
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .print-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    overflow-wrap: anywhere;
    page-break-inside: auto;
  }

  .print-table thead {
    display: table-header-group;
  }

  .print-table tr {
    break-inside: avoid-page;
    page-break-inside: avoid;
    page-break-after: auto;
  }

  .print-table th,
  .print-table td {
    padding: 7px 8px;
    border: 1px solid #111827;
    color: #111827;
    background: #fff;
    font-size: 9.5pt;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .print-table th {
    text-align: center;
    text-transform: uppercase;
  }

  .print-attendance-table th,
  .print-attendance-table td {
    padding: 5px 6px;
    font-size: 8.5pt;
  }

  .print-attendance-col-number {
    width: 5%;
  }

  .print-attendance-col-identity {
    width: 20%;
  }

  .print-attendance-col-name {
    width: 25%;
  }

  .print-attendance-col-gender {
    width: 13%;
  }

  .print-attendance-col-class {
    width: 17%;
  }

  .print-attendance-col-status {
    width: 20%;
  }

  .print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 34px;
    break-inside: avoid-page;
    page-break-inside: avoid;
    text-align: center;
  }

  .print-signatures p,
  .print-signatures strong,
  .print-signatures small {
    display: block;
    margin: 0;
  }

  .signature-space {
    display: block;
    height: 68px;
  }
}
