:root {
  --bg: #f4efe6;
  --paper: #fffaf2;
  --surface: #fffaf2;
  --surface-variant: #f0ebdf;
  --ink: #1b1f23;
  --muted: #404854;
  --accent: #0052cc;
  --accent-2: #d97706;
  --danger: #b42318;
  --line: #d8d0c0;
  --link: #4f9fcf;
  --link-visited: #3d7fa8;
}

/* ====================================
   EXTRACTED INLINE STYLES (CSS REFACTOR)
   Classes generated from inline style attributes for maintainability
   ==================================== */

/* Margin utilities */
.mt-0-2rem {
  margin-top: 0.2rem;
}

.mt-0-3rem {
  margin-top: 0.3rem;
}

.mt-0-6rem {
  margin-top: 0.6rem;
}

.mt-0-7rem {
  margin-top: 0.7rem;
}

.mt-0-8rem {
  margin-top: 0.8rem;
}

.mt-0-9rem {
  margin-top: 0.9rem;
}

.mt-1rem {
  margin-top: 1rem;
}

.mb-0-3rem {
  margin-bottom: 0.3rem;
}

.mb-0-5rem {
  margin-bottom: 0.5rem;
}

.mb-1rem {
  margin-bottom: 1rem;
}

.mb-0-75rem {
  margin-bottom: 0.75rem;
}

.m-0 {
  margin: 0;
}

.m-0-5rem-0-1-2rem {
  margin: 0.5rem 0 1.2rem;
}

.m-0-0-0-3rem {
  margin: 0 0 0.3rem;
}

.m-0-0-0-5rem {
  margin: 0 0 0.5rem;
}

.m-0-0-0-9rem {
  margin: 0 0 0.9rem;
}

.m-0-7rem-0-0 {
  margin: 0.7rem 0 0;
}

.m-0-5rem-0-0 {
  margin: 0.5rem 0 0;
}

.m-0-35rem-0-0 {
  margin: 0.35rem 0 0;
}

.m-0-8rem-0 {
  margin: 0.8rem 0;
}

/* Font size utilities */
.font-0-84rem {
  font-size: 0.84rem;
}

.font-0-85rem {
  font-size: 0.85rem;
}

.font-0-9rem {
  font-size: 0.9rem;
}

.font-1-05rem {
  font-size: 1.05rem;
}

.font-1rem {
  font-size: 1rem;
}

/* Font weight utilities */
.font-400 {
  font-weight: 400;
}

.font-600 {
  font-weight: 600;
}

.font-700 {
  font-weight: 700;
}

/* Color utilities */
.color-muted {
  color: var(--muted);
}

.color-ink {
  color: var(--ink);
}

.color-accent {
  color: var(--accent);
}

.color-danger {
  color: var(--danger);
}

/* Display utilities */
.display-none {
  display: none;
}

.display-flex {
  display: flex;
}

/* Flex utilities */
.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

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

.flex-nowrap {
  flex-wrap: nowrap;
}

.flex-1-1-0 {
  flex: 1 1 0;
}

.gap-0-5rem {
  gap: 0.5rem;
}

.gap-0-6rem {
  gap: 0.6rem;
}

.gap-0-7rem {
  gap: 0.7rem;
}

.gap-1rem {
  gap: 1rem;
}

.mt-auto {
  margin-top: auto;
}

/* Padding utilities */
.p-1rem {
  padding: 1rem;
}

/* Background utilities */
.bg-surface {
  background-color: var(--surface);
}

/* Border radius utilities */
.rounded-0-5rem {
  border-radius: 0.5rem;
}

/* Border utilities */
.border-l-4-accent {
  border-left: 4px solid var(--accent);
}

.border-r-4-accent {
  border-right: 4px solid var(--accent);
}

.border-l-4-accent-2 {
  border-left: 4px solid var(--accent-2);
}

/* Combined utilities */
.box-stat-percent {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.stat-label-small {
  font-size: 0.9rem;
  color: var(--muted);
}

.stat-percent-small {
  font-size: 0.9rem;
  color: var(--muted);
}

.winner-section {
  display: none;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: var(--surface);
  border-radius: 0.5rem;
  border-left: 4px solid var(--accent);
}

.tie-section {
  display: none;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: var(--surface);
  border-radius: 0.5rem;
  border-left: 4px solid var(--accent-2);
}

.result-header-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-list-with-margin {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tally-header-accent {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--accent);
}

.tally-winner-row {
  background-color: var(--surface-variant);
}

.tally-tie-row {
  background-color: rgba(244, 180, 0, 0.12);
}

html[data-theme="dark"] .tally-winner-row,
html:not([data-theme]) .tally-winner-row {
  background-color: color-mix(in srgb, var(--accent) 88%, transparent);
}

html[data-theme="dark"] .tally-tie-row,
html:not([data-theme]) .tally-tie-row {
  background-color: color-mix(in srgb, var(--accent-2) 88%, transparent);
}

@supports not (background-color: color-mix(in srgb, red 1%, blue)) {
  html[data-theme="dark"] .tally-winner-row,
  html:not([data-theme]) .tally-winner-row {
    background-color: rgba(59, 130, 246, 0.18);
  }

  html[data-theme="dark"] .tally-tie-row,
  html:not([data-theme]) .tally-tie-row {
    background-color: rgba(217, 119, 6, 0.18);
  }
}

.p-margin-none {
  margin: 0;
}

.vote-form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.progress-metrics {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.progress-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tally-locked-notice {
  color: var(--muted);
}

.panel.quorum-section {
  margin-top: 1rem;
  display: none;
  min-height: 84px;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-left: 4px solid var(--accent);
  border-right: 4px solid var(--accent);
  background: var(--surface-variant);
}

.panel.quorum-section h2 {
  margin: 0;
}

.panel.quorum-section.no-quorum {
  border-left-color: var(--danger) !important;
  border-right-color: var(--danger) !important;
}

.quorum-status-icon {
  color: var(--danger);
  margin-right: 0.3rem;
}

.result-value {
  font-weight: 700;
  color: var(--ink);
}

.copy-button {
  margin-top: 0.6rem;
  max-width: 200px;
}

.button-max-width-260 {
  margin-top: 0.9rem;
  max-width: 260px;
}

.button-max-width-240 {
  margin-top: 0.8rem;
  max-width: 240px;
}

.setup-section-spacing {
  margin-top: 1rem;
  display: none;
}

.setup-heading-spacing {
  margin-bottom: 0.7rem;
}

.setup-heading-small {
  margin-bottom: 0.3rem;
}

.setup-divider {
  margin-bottom: 1rem;
}

.secret-banner-section {
  margin-bottom: 1rem;
}

.secret-code-font {
  font-size: 1rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.secret-warning {
  margin: 0 0 0.3rem;
  font-weight: 700;
  color: var(--danger);
}

.secret-description {
  margin: 0.5rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.secret-link-row {
  margin: 0.7rem 0 0;
}

.secret-link-alt {
  margin: 0.35rem 0 0;
}

.links-table {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 0.8rem;
}

.links-table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
}

.links-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  box-shadow: inset 0 -1px 0 var(--line);
}

.audit-heading {
  margin-bottom: 0.3rem;
}

.audit-meta {
  margin: 0 0 0.5rem;
}

.audit-question {
  margin: 0.2rem 0 0.7rem;
}

.audit-status {
  margin: 0 0 0.9rem;
}

.auth-button {
  margin-top: 0.8rem;
  max-width: 240px;
}

.auth-error {
  display: none;
  margin-top: 0.8rem;
}

.cta-row-center {
  justify-content: center;
}

.missing-election-id {
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink);
  word-break: break-all;
}

.regen-input {
  margin-top: 0.3rem;
}

.copy-controls {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}

/* PAGE-SPECIFIC OVERRIDES: index.html */
.index-heading-home {
  margin-top: 0.7rem;
}

.index-hero-panel {
  position: relative;
  z-index: 20;
}

.index-tagline {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0.5rem 0 1.2rem;
}

.promise-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.promise-card {
  background: var(--surface-variant);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
}

.promise-card[data-preview-light] {
  cursor: pointer;
}

.promise-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  color: var(--ink);
}

.promise-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.promise-card-transparent {
  position: relative;
}

.promise-card-instant {
  position: relative;
}

.promise-progress-preview {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.55rem);
  transform: translateX(-50%);
  width: min(360px, 82vw);
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(30, 40, 60, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 2000;
}

html[data-theme="dark"] .promise-progress-preview {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}

.promise-card-transparent:hover .promise-progress-preview,
.promise-card-transparent:focus-within .promise-progress-preview,
.promise-card-instant:hover .promise-progress-preview,
.promise-card-instant:focus-within .promise-progress-preview {
  opacity: 1;
  visibility: visible;
}

.promise-progress-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.promise-progress-preview .promise-progress-preview-dark {
  display: none;
}

html[data-theme="dark"] .promise-progress-preview .promise-progress-preview-light {
  display: none;
}

html[data-theme="dark"] .promise-progress-preview .promise-progress-preview-dark {
  display: block;
}

.promise-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  vertical-align: middle;
  outline: none;
}

.promise-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.promise-info-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  transform: translateX(-50%);
  width: min(320px, 78vw);
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(30, 40, 60, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
  z-index: 2001;
}

html[data-theme="dark"] .promise-info-tooltip {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.promise-info:hover .promise-info-tooltip,
.promise-info:focus .promise-info-tooltip,
.promise-info:focus-within .promise-info-tooltip {
  opacity: 1;
  visibility: visible;
}

.promise-preview-modal-box {
  width: min(920px, 94vw);
  max-height: 88vh;
  overflow: auto;
}

.promise-preview-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.index-panel-spacing {
  margin-top: 1rem;
}

.index-screenshot-margin {
  margin-top: 0.9rem;
}

/* PAGE-SPECIFIC OVERRIDES: vote.html */
.vote-panel-spacing {
  margin-top: 1rem;
}

.vote-form-section {
  margin-top: 1rem;
}

/* PAGE-SPECIFIC OVERRIDES: progress.html */
.progress-election-name {
  margin-top: 0.2rem;
}

/* PAGE-SPECIFIC OVERRIDES: audit.html */
.audit-panel-spacing {
  margin-top: 1rem;
}

/* PAGE-SPECIFIC OVERRIDES: setup.html */
.setup-first-section {
  margin-top: 1rem;
}

.setup-h2-first {
  margin-bottom: 0.7rem;
}

.setup-floor-configs {
  margin-top: 1rem;
}

.setup-grid-building {
  margin-top: 1rem;
}

.exclusion-hint.setup-exclusion-note {
  margin-top: 1rem;
  display: block;
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface-variant);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 0.62rem 0.78rem;
}

.setup-exclusion-note:empty {
  display: none;
}

html[data-theme="dark"] .setup-exclusion-note,
html:not([data-theme]) .setup-exclusion-note {
  color: #e8ecf1;
  background: #1f2731;
  border-color: #2f3c4b;
  border-left-color: #5aa2ff;
}

.setup-form-section {
  margin-bottom: 1rem;
}

.setup-form-text {
  margin-top: 1rem;
}

.setup-submit-button {
  margin-top: 1rem;
}

.setup-result-grid {
  margin-bottom: 1rem;
}

.setup-result-heading-grid {
  margin-bottom: 1rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f1419;
    --paper: #1a1f26;
    --surface: #1a1f26;
    --surface-variant: #252c36;
    --ink: #e8ecf1;
    --muted: #9ba6b2;
    --accent: #3b82f6;
    --accent-2: #d97706;
    --danger: #e74c3c;
    --line: #2d3139;
    --link: #4f9fcf;
    --link-visited: #3d7fa8;
  }
}

html[data-theme="dark"] {
  --bg: #0f1419;
  --paper: #1a1f26;
  --surface: #1a1f26;
  --surface-variant: #252c36;
  --ink: #e8ecf1;
  --muted: #9ba6b2;
  --accent: #3b82f6;
  --accent-2: #d97706;
  --danger: #e74c3c;
  --line: #2d3139;
  --link: #4f9fcf;
  --link-visited: #3d7fa8;
}

html[data-theme="light"] {
  --bg: #f4efe6;
  --paper: #fffaf2;
  --surface: #fffaf2;
  --surface-variant: #f0ebdf;
  --ink: #1b1f23;
  --muted: #404854;
  --accent: #0052cc;
  --accent-2: #d97706;
  --danger: #b42318;
  --line: #d8d0c0;
  --link: #4f9fcf;
  --link-visited: #3d7fa8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", "Avenir Next", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #ffeec8 0, transparent 30%),
    radial-gradient(circle at 80% 20%, #dbeafe 0, transparent 35%),
    linear-gradient(160deg, #f6efe3 0%, #ece7df 45%, #dde6e2 100%);
  min-height: 100vh;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) h1,
  html:not([data-theme]) h2,
  html:not([data-theme]) h3,
  html:not([data-theme]) h4,
  html:not([data-theme]) h5,
  html:not([data-theme]) h6 {
    color: #e8ecf1;
  }

  html:not([data-theme]) body {
    background:
      radial-gradient(circle at 10% 10%, #1a2f4a 0, transparent 30%),
      radial-gradient(circle at 80% 20%, #1a2a35 0, transparent 35%),
      linear-gradient(160deg, #0f1419 0%, #121820 45%, #161e26 100%);
  }
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: #e8ecf1;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 10%, #1a2f4a 0, transparent 30%),
    radial-gradient(circle at 80% 20%, #1a2a35 0, transparent 35%),
    linear-gradient(160deg, #0f1419 0%, #121820 45%, #161e26 100%);
}

.container {
  width: min(980px, 92vw);
  margin: 2rem auto 4rem;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: 0 12px 40px rgba(30, 40, 60, 0.08);
  backdrop-filter: blur(6px);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .panel {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  }
}

html[data-theme="dark"] .panel {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

h2 {
  margin-top: 0;
}

p,
label {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
}

input,
textarea,
button,
select {
  width: 100%;
  border-radius: 0.25rem;
  border: 1px solid var(--line);
  padding: 0.72rem 0.8rem;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}

select {
  padding-right: 2.2rem;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) input,
  html:not([data-theme]) textarea,
  html:not([data-theme]) select {
    background: rgba(26, 31, 38, 0.6);
  }

  html:not([data-theme]) input[type="number"] {
    color-scheme: dark;
  }
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: rgba(26, 31, 38, 0.6);
}

html[data-theme="dark"] input[type="number"] {
  color-scheme: dark;
}

textarea {
  min-height: 100px;
}

button {
  background: linear-gradient(135deg, var(--accent), #003d99);
  color: #fff;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

button:disabled,
button:disabled:hover,
button:disabled:focus-visible {
  background: linear-gradient(135deg, #9aa3af, #7b8491);
  background-image: linear-gradient(135deg, #9aa3af, #7b8491);
  color: #f3f4f6;
  cursor: not-allowed;
  filter: none;
  transform: none;
  opacity: 0.9;
}

html[data-theme="dark"] button:disabled,
html[data-theme="dark"] button:disabled:hover,
html[data-theme="dark"] button:disabled:focus-visible,
html:not([data-theme]) button:disabled,
html:not([data-theme]) button:disabled:hover,
html:not([data-theme]) button:disabled:focus-visible {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  background-image: linear-gradient(135deg, #6b7280, #4b5563);
  color: #e5e7eb;
}

button.secondary {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: #fff;
  border: 0;
}

button.abstain {
  background: linear-gradient(135deg, #0a84ff, #0066d6);
  color: #fff;
  border: 0;
}

button.abstain:hover {
  filter: brightness(1.08);
}

button.danger-secondary {
  background: linear-gradient(135deg, #cf2e2e, #a92020);
  color: #fff;
  border: 0;
}

button.danger-secondary:hover {
  filter: brightness(1.06);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) button {
    background: linear-gradient(135deg, var(--accent), #2563eb);
  }

  html:not([data-theme]) button.abstain {
    background: linear-gradient(135deg, #2997ff, #0a84ff);
    color: #c9d1d9;
  }

  html:not([data-theme]) button.danger-secondary {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #c9d1d9;
    border: 0;
  }

  html:not([data-theme]) button:not(.secondary):not(.theme-btn) {
    color: #c9d1d9;
  }
}

html[data-theme="dark"] button:not(.secondary):not(.theme-btn) {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #c9d1d9;
}

html[data-theme="dark"] button.abstain {
  background: linear-gradient(135deg, #2997ff, #0a84ff);
  color: #c9d1d9;
}

html[data-theme="dark"] button.danger-secondary {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #c9d1d9;
  border: 0;
}

button:disabled,
button:disabled:hover,
button:disabled:focus-visible,
html[data-theme="dark"] button:disabled,
html[data-theme="dark"] button:disabled:hover,
html[data-theme="dark"] button:disabled:focus-visible,
html:not([data-theme]) button:disabled,
html:not([data-theme]) button:disabled:hover,
html:not([data-theme]) button:disabled:focus-visible {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  background-image: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: #e5e7eb !important;
  cursor: not-allowed !important;
  filter: none !important;
  transform: none !important;
  opacity: 0.9 !important;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 130px;
  flex: 1 1 calc(50% - 0.4rem);
  text-align: center;
}

.stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: auto;
  text-align: center;
}

@media (min-width: 768px) {
  .stat {
    flex: 1 1 calc(33.333% - 0.54rem);
  }
}

@media (min-width: 1024px) {
  .stats {
    flex-wrap: nowrap;
  }
  .stat {
    flex: 1 1 0;
    min-width: 0;
  }
}

.pulse-border {
  animation: pulse-border 1.6s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: var(--line);
    box-shadow:
      0 12px 40px rgba(30, 40, 60, 0.08),
      0 0 0 0 rgba(0, 95, 204, 0);
  }
  50% {
    border-color: #005fcc;
    box-shadow:
      0 12px 40px rgba(30, 40, 60, 0.08),
      0 0 0 4px rgba(0, 95, 204, 0.24),
      0 0 18px rgba(0, 95, 204, 0.26);
  }
}

@keyframes pulse-border-dark {
  0%, 100% {
    border-color: var(--line);
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.3),
      0 0 0 0 rgba(90, 162, 255, 0);
  }
  50% {
    border-color: #5aa2ff;
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.3),
      0 0 0 3px rgba(90, 162, 255, 0.2),
      0 0 14px rgba(90, 162, 255, 0.22);
  }
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .pulse-border {
    animation-name: pulse-border-dark;
  }
}

html[data-theme="dark"] .pulse-border {
  animation-name: pulse-border-dark;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  border: 1px solid #bfd0ea;
  color: #0b3f91;
  background: #eaf2ff;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.88rem;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .badge {
    border: 1px solid rgba(96, 165, 250, 0.4);
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.18);
  }
}

html[data-theme="dark"] .badge {
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th,
td {
  text-align: left;
  padding: 0.48rem 0.38rem;
}

.helper {
  font-size: 0.85rem;
}

.ok {
  color: var(--accent);
}

.error {
  color: var(--danger);
}

.floor-config-row {
  display: grid;
  grid-template-columns: 110px minmax(160px, 240px) minmax(180px, 260px);
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 0.8rem;
}

.floor-config-label {
  font-weight: 700;
  color: var(--ink);
}

.floor-config-small-label {
  margin-bottom: 0.25rem;
}

.floor-config-input-wrap input {
  max-width: 240px;
}

.vote-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  text-align: left;
  width: 100%;
}

.vote-option input {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}

.vote-option span {
  text-align: left;
  color: var(--ink);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

a:visited {
  color: var(--link);
}

@media (max-width: 640px) {
  .container {
    margin-top: 1rem;
  }

  .index-hero-panel .badge {
    font-size: 0.72rem;
  }

  .index-tagline {
    font-size: 0.78rem;
  }

  .index-hero-panel {
    padding-bottom: 0.5rem;
  }

  .index-hero-panel .cta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .index-hero-panel .cta-link {
    display: flex;
    width: 100%;
    min-height: 2.5rem;
    box-sizing: border-box;
  }

  .panel {
    padding: 1rem;
    overflow-x: hidden;
  }

  .index-hero-panel {
    padding: 1rem 1rem 0.8rem;
    overflow: visible;
  }

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

  .floor-config-row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .floor-config-input-wrap input {
    max-width: 100%;
  }

  .floor-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .floor-label {
    width: 100%;
    text-align: left;
  }

  .floor-units {
    width: 100%;
  }
}

/* ── Unit grid ─────────────────────────────────────────────────────────── */

.grid-building {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.floor-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.floor-label {
  width: 58px;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: right;
  flex-shrink: 0;
  font-weight: 600;
}

.floor-units {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.floor-row-divider {
  width: 100%;
  margin: 0.18rem 0 0.22rem;
  border: 0;
  border-top: 1px solid var(--line);
  opacity: 0.7;
}

.unit-cell {
  width: 86px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  position: relative;
  background: #fff;
  transition: border-color 0.13s, background 0.13s;
  user-select: none;
  color: var(--ink);
  overflow: visible;
}

.unit-cell .unit-number {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  pointer-events: none;
  min-width: 0;
  cursor: pointer;
}

.unit-edit {
  width: 28px;
  flex-shrink: 0;
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0 6px 6px 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.13s, color 0.13s;
}

.unit-edit:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.unit-edit:disabled,
.unit-edit:disabled:hover,
.unit-edit:disabled:focus-visible {
  background: #edf1f5;
  background-image: none;
  border-left-color: var(--line);
  color: #9aa3af;
  cursor: not-allowed;
  opacity: 0.9;
}

.unit-inline-editor {
  position: fixed;
  z-index: 9999;
  min-width: 175px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.unit-inline-input {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  background: var(--bg);
  color: var(--ink);
}

.unit-inline-actions {
  display: flex;
  gap: 0.3rem;
}

.unit-inline-actions button {
  width: auto;
  flex: 1 1 0;
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
  border-radius: 6px;
}

.unit-cell:hover {
  border-color: var(--accent);
  background: #f0faf7;
}

.unit-cell.excluded {
  background: #fff0f0;
  border-color: var(--danger);
  color: var(--danger);
}

.unit-cell.included {
  background: #eaf8ef;
  border-color: #2f9e62;
  color: #1f7a4b;
}

.unit-cell.cast-locked {
  background: #eceff3;
  border-color: #9aa3af;
  color: #667085;
}

.unit-cell.cast-locked:hover {
  background: #eceff3;
  border-color: #9aa3af;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .unit-cell {
    background: #20262f;
  }

  html:not([data-theme]) .unit-edit {
    background: rgba(26, 31, 38, 0.85);
    color: #ffffff;
  }

  html:not([data-theme]) .unit-edit:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  html:not([data-theme]) .unit-edit:disabled,
  html:not([data-theme]) .unit-edit:disabled:hover,
  html:not([data-theme]) .unit-edit:disabled:focus-visible {
    background: #2c333d;
    background-image: none;
    color: #98a2b3;
    border-left-color: #4b5563;
  }

  html:not([data-theme]) .unit-inline-editor {
    background: rgba(26, 31, 38, 0.97);
  }

  html:not([data-theme]) .unit-cell:hover {
    background: #1d3a31;
  }

  html:not([data-theme]) .unit-cell.excluded {
    background: #342325;
  }

  html:not([data-theme]) .unit-cell.included {
    background: #1e3b2f;
    border-color: #3fb878;
    color: #8de6b5;
  }

  html:not([data-theme]) .unit-cell.cast-locked {
    background: #2a303a;
    border-color: #6b7280;
    color: #c4ccd8;
  }

  html:not([data-theme]) .unit-cell.cast-locked:hover {
    background: #2a303a;
    border-color: #6b7280;
  }
}

html[data-theme="dark"] .unit-cell {
  background: #20262f;
}

html[data-theme="dark"] .unit-edit {
  background: rgba(26, 31, 38, 0.85);
  color: #ffffff;
}

html[data-theme="dark"] .unit-edit:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

html[data-theme="dark"] .unit-edit:disabled,
html[data-theme="dark"] .unit-edit:disabled:hover,
html[data-theme="dark"] .unit-edit:disabled:focus-visible {
  background: #2c333d;
  background-image: none;
  color: #98a2b3;
  border-left-color: #4b5563;
}

html[data-theme="dark"] .unit-inline-editor {
  background: rgba(26, 31, 38, 0.97);
}

html[data-theme="dark"] .unit-cell:hover {
  background: #1d3a31;
}

html[data-theme="dark"] .unit-cell.excluded {
  background: #342325;
}

html[data-theme="dark"] .unit-cell.included {
  background: #1e3b2f;
  border-color: #3fb878;
  color: #8de6b5;
}

html[data-theme="dark"] .unit-cell.cast-locked {
  background: #2a303a;
  border-color: #6b7280;
  color: #c4ccd8;
}

html[data-theme="dark"] .unit-cell.cast-locked:hover {
  background: #2a303a;
  border-color: #6b7280;
}



.exclusion-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.proxy-guidance-note {
  color: #1f7a4b;
  font-weight: 700;
}

html[data-theme="dark"] .proxy-guidance-note,
html:not([data-theme]) .proxy-guidance-note {
  color: #8de6b5;
}

.eligibility-mode-toggle {
  margin-top: 0.45rem;
  position: relative;
}

.eligibility-mode-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.5rem);
  width: min(360px, 82vw);
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(30, 40, 60, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
  z-index: 2001;
}

html[data-theme="dark"] .eligibility-mode-tooltip {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.eligibility-mode-toggle.is-disabled:hover .eligibility-mode-tooltip,
.eligibility-mode-toggle.is-disabled:focus-within .eligibility-mode-tooltip {
  opacity: 1;
  visibility: visible;
}

.toggle-switch input:disabled {
  cursor: not-allowed;
}

.toggle-switch input:disabled ~ .toggle-slider {
  background: #9aa3af;
  cursor: not-allowed;
}

html[data-theme="dark"] .toggle-switch input:disabled ~ .toggle-slider,
html:not([data-theme]) .toggle-switch input:disabled ~ .toggle-slider {
  background: #6b7280;
  cursor: not-allowed;
}

.toggle-switch input:disabled ~ .toggle-label-text {
  color: #9ba6b2;
  opacity: 0.65;
  cursor: not-allowed;
}

html[data-theme="dark"] .toggle-switch input:disabled ~ .toggle-label-text,
html:not([data-theme]) .toggle-switch input:disabled ~ .toggle-label-text {
  color: #858d99;
  opacity: 0.65;
  cursor: not-allowed;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-variant);
  position: relative;
  flex-shrink: 0;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: transform 0.16s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(47, 158, 98, 0.2);
  border-color: #2f9e62;
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(20px);
  border-color: #2f9e62;
}

.toggle-label-text {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Admin secret banner ────────────────────────────────────────────────── */

.secret-banner {
  background: var(--surface-variant);
  border: 2px solid var(--danger);
  border-radius: 14px;
  padding: 1rem;
}

html[data-theme="dark"] .secret-banner {
  background: var(--surface-variant);
}

.secret-code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: var(--ink);
}

/* ── Modal overlay ──────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  backdrop-filter: blur(3px);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .modal-overlay {
    background: rgba(0, 0, 0, 0.65);
  }
}

html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.65);
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
  width: min(420px, 90vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .modal-box {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  }
}

html[data-theme="dark"] .modal-box {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-box,
.overlay-content {
  position: relative;
  overflow: hidden;
}

.modal-box {
  padding-bottom: 2.3rem;
}

.overlay-content {
  padding-bottom: 2.8rem;
}

.modal-box::after,
.overlay-content::after {
  content: "";
  position: absolute;
  right: 0.8rem;
  bottom: 0.7rem;
  width: 20px;
  height: 20px;
  background: url("/stratavoter-mark.svg") center / contain no-repeat;
  opacity: 0.92;
  pointer-events: none;
}

.modal-box h3 {
  margin: 0 0 0.3rem;
}

.modal-box p {
  margin: 0 0 0.8rem;
}

.modal-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
}

.modal-error {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 0.4rem;
  min-height: 1.2em;
}

.election-controls {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.election-controls button {
  width: auto;
  min-width: 170px;
}

/* ── Voting closed overlay ──────────────────────────────────────────────── */

.voting-closed-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 30, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 950;
  backdrop-filter: blur(4px);
  animation: fade-in 0.6s ease-out;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .voting-closed-overlay {
    background: rgba(0, 0, 0, 0.8);
  }
}

html[data-theme="dark"] .voting-closed-overlay {
  background: rgba(0, 0, 0, 0.8);
}

.voting-not-started-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 30, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 870;
  backdrop-filter: blur(2px);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .voting-not-started-overlay {
    background: rgba(0, 0, 0, 0.28);
  }
}

html[data-theme="dark"] .voting-not-started-overlay {
  background: rgba(0, 0, 0, 0.28);
}

.voting-not-started-overlay.hidden {
  display: none;
}

.voting-closed-overlay.hidden {
  display: none;
}

@keyframes fade-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
}

.overlay-content {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2rem;
  width: min(480px, 90vw);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: slide-up 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .overlay-content {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  }
}

html[data-theme="dark"] .overlay-content {
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overlay-content h2 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  color: var(--ink);
}

.overlay-election-name {
  margin: -0.5rem 0 1rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  animation: fade-in-delay 0.8s ease-out 0.1s both;
}

.overlay-message {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  animation: fade-in-delay 0.8s ease-out 0.2s both;
}

@keyframes fade-in-delay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.overlay-units-voted {
  background: rgba(0, 82, 204, 0.1);
  border: 1px solid rgba(0, 82, 204, 0.25);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  animation: fade-in-delay 0.8s ease-out 0.3s both;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .overlay-units-voted {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
  }
}

html[data-theme="dark"] .overlay-units-voted {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.overlay-label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
}

.overlay-value {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
}

.overlay-countdown-section {
  animation: fade-in-delay 0.8s ease-out 0.4s both;
}

.overlay-countdown {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent-2);
  margin: 0.5rem 0;
  font-variant-numeric: tabular-nums;
}

/* ── Theme Switcher ────────────────────────────────────────────────────── */

.theme-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  gap: 0.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .theme-switcher {
    top: auto;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: 1rem;
    right: auto;
  }
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .theme-switcher {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

html[data-theme="dark"] .theme-switcher {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
  opacity: 0.6;
}

.theme-btn:hover {
  filter: brightness(1.08);
  transform: none;
}

.theme-btn.active,
.theme-btn[aria-pressed="true"] {
  background: rgb(96 165 250);
  color: #fff;
  border-color: rgb(96 165 250);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .theme-btn.active,
  html:not([data-theme]) .theme-btn[aria-pressed="true"] {
    color: #c9d1d9;
  }
}

html[data-theme="dark"] .theme-btn.active,
html[data-theme="dark"] .theme-btn[aria-pressed="true"] {
  color: #c9d1d9;
}

/* ── Scroll to top button ─────────────────────────────────────────────── */

.scroll-top-btn {
  position: fixed;
  right: 1rem;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  width: 2.625rem;
  height: 2.625rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent), #003d99);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1000;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(30, 40, 60, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, filter 0.16s ease;
}

.scroll-top-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

.scroll-top-btn:hover,
.scroll-top-btn:focus-visible {
  filter: brightness(1.06);
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .scroll-top-btn {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #c9d1d9;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  }
}

html[data-theme="dark"] .scroll-top-btn {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #c9d1d9;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
  .scroll-top-btn {
    right: 1rem;
  }
}

/* ── Setup links table controls ─────────────────────────────────────────── */

.legal-unit-controls {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  width: max-content;
  max-width: 100%;
}

.legal-unit-input {
  margin: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.84rem;
  min-width: 0;
  width: 4rem;
  max-width: 4rem;
}

.legal-unit-save {
  width: auto;
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.table-action-btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-icon {
  line-height: 1;
  font-size: 0.95em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.legal-unit-cell {
  width: 1%;
  white-space: nowrap;
}

.url-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.url-actions button {
  width: auto;
  padding: 0.3rem 0.7rem;
  font-size: 0.84rem;
}

.url-actions button.secondary.is-copied {
  background: linear-gradient(135deg, #2f9e62, #1f7a4a) !important;
  border: 0;
  color: #fff;
}

.url-actions button.secondary.is-copied:hover,
.url-actions button.secondary.is-copied:focus-visible {
  background: linear-gradient(135deg, #3fb878, #2f9e62);
  border: 0;
  color: #fff;
}

.action-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.action-actions button {
  width: auto;
  padding: 0.3rem 0.7rem;
  font-size: 0.84rem;
}

.links-table-wrap table th:nth-child(1),
.links-table-wrap table td:nth-child(1),
.links-table-wrap table th:nth-child(2),
.links-table-wrap table td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
}

.links-table-wrap table th:nth-child(3),
.links-table-wrap table td:nth-child(3) {
  padding-right: 1rem;
}

.links-table-wrap table th:nth-child(4),
.links-table-wrap table td:nth-child(4) {
  padding-left: 1rem;
}

.links-table-wrap table th:nth-child(5),
.links-table-wrap table td:nth-child(5) {
  width: 1%;
  white-space: nowrap;
}

.links-table-wrap table th:nth-child(6),
.links-table-wrap table td:nth-child(6) {
  white-space: nowrap;
}

.link-status-badge {
  min-width: 5.4rem;
  text-align: center;
}

.links-table-wrap tbody tr.floor-separator td,
.links-table-wrap tbody tr.floor-separator.floor-first-row td {
  border-top: 3px solid var(--accent);
  border-bottom: 0;
  padding-top: 0.8rem;
}

.links-table-wrap tbody tr.floor-first-row td {
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding-top: 0.8rem;
}

.links-table-wrap tbody tr.floor-separator td,
.links-table-wrap tbody tr.floor-separator.floor-first-row td {
  border-bottom: 0;
}

.links-table-wrap tbody tr:not(.floor-separator):not(.floor-first-row) td {
  border-bottom: 1px solid var(--line);
}

.links-table-wrap tbody tr.floor-first-row td:first-child {
  font-weight: 800;
  color: var(--accent);
}

.url-modal-link {
  margin: 0.3rem 0 0.9rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--ink);
  word-break: break-all;
}

.url-modal-details {
  margin: 0 0 1.2rem;
  padding: 0.9rem;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  gap: 0.6rem;
}

.url-modal-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  gap: 0.8rem;
}

.url-modal-detail-row label {
  font-weight: 600;
  color: var(--muted);
  flex: 0 0 auto;
}

.url-modal-detail-row span {
  color: var(--ink);
  text-align: right;
  flex: 1;
}

.url-modal-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
}

.url-modal-status-badge.status-created {
  background: rgba(100, 200, 200, 0.2);
  color: #1a8b8b;
}

.url-modal-status-badge.status-sent {
  background: rgba(59, 130, 246, 0.2);
  color: #1e40af;
}

.url-modal-status-badge.status-opened {
  background: rgba(147, 51, 234, 0.2);
  color: #5b21b6;
}

.url-modal-status-badge.status-cast {
  background: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .url-modal-status-badge.status-created {
    background: rgba(100, 200, 200, 0.3);
    color: #7dd3d3;
  }
  html:not([data-theme]) .url-modal-status-badge.status-sent {
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
  }
  html:not([data-theme]) .url-modal-status-badge.status-opened {
    background: rgba(147, 51, 234, 0.3);
    color: #d8b4fe;
  }
  html:not([data-theme]) .url-modal-status-badge.status-cast {
    background: rgba(34, 197, 94, 0.3);
    color: #86efac;
  }
}

html[data-theme="dark"] .url-modal-status-badge.status-created {
  background: rgba(100, 200, 200, 0.3);
  color: #7dd3d3;
}

html[data-theme="dark"] .url-modal-status-badge.status-sent {
  background: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

html[data-theme="dark"] .url-modal-status-badge.status-opened {
  background: rgba(147, 51, 234, 0.3);
  color: #d8b4fe;
}

html[data-theme="dark"] .url-modal-status-badge.status-cast {
  background: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.date-time-stack {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
}

.date-time-stack-time {
  font-size: 0.85em;
  color: var(--muted);
}

.audit-overview-metrics {
  margin-top: 0.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.audit-overview-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.audit-overview-value {
  font-weight: 600;
  color: var(--ink);
}

.audit-links-table .audit-cell-value {
  display: inline;
  width: auto;
  margin-left: 0;
  text-align: inherit;
}

.audit-links-table td {
  vertical-align: top;
}

.audit-links-table .audit-cell-date,
.audit-links-table .audit-cell-time {
  display: block;
}

.audit-links-table .audit-cell-time {
  font-size: 0.82em;
  color: var(--muted);
}

#url-modal-open {
  background: rgb(96, 165, 250);
  color: #fff;
  border: 0;
}

#url-modal-open:hover {
  filter: brightness(1.06);
}

#url-modal-close {
  background: #cf2e2e;
  color: #fff;
  border: 0;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) #url-modal-open,
  html:not([data-theme]) #url-modal-close {
    color: #c9d1d9;
  }
}

html[data-theme="dark"] #url-modal-open,
html[data-theme="dark"] #url-modal-close {
  color: #c9d1d9;
}

#url-modal-close:hover {
  filter: brightness(1.06);
}

@media (max-width: 640px) {
  .audit-overview-metrics {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .audit-overview-item {
    padding: 0.55rem 0.65rem;
  }

  .links-table-wrap {
    overflow-x: hidden !important;
  }

  .links-table-wrap table,
  .links-table-wrap thead,
  .links-table-wrap tbody,
  .links-table-wrap tr,
  .links-table-wrap th,
  .links-table-wrap td {
    display: block;
    width: 100%;
  }

  .links-table-wrap thead {
    display: none;
  }

  .links-table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 0.6rem;
    background: var(--paper);
  }

  .links-table-wrap tbody tr.floor-separator,
  .links-table-wrap tbody tr.floor-first-row {
    border-top: 3px solid var(--accent);
    margin-top: 0.9rem;
    padding-top: 0.65rem;
  }

  .links-table-wrap td {
    border-bottom: 0;
    padding: 0.3rem 0;
  }

  .links-table-wrap tbody tr.floor-first-row td {
    border-bottom: 1px solid var(--line);
  }

  .links-table-wrap tbody tr.floor-separator td,
  .links-table-wrap tbody tr.floor-separator.floor-first-row td {
    border-bottom: 0;
  }

  .links-table-wrap td[data-label] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
  }

  .links-table-wrap td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
  }

  .audit-links-table td[data-label] {
    display: grid;
    grid-template-columns: 7.25rem minmax(0, 1fr);
    align-items: flex-start;
    column-gap: 0.6rem;
    padding-left: 0;
    padding-right: 0;
  }

  .audit-links-table td[data-label]::before {
    display: block;
    width: 100%;
    text-align: left;
    justify-self: start;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    text-indent: 0;
    line-height: 1.2;
  }

  .audit-links-table .audit-cell-value {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    text-align: right;
    margin-left: 0;
  }

  .audit-links-table .audit-cell-date,
  .audit-links-table .audit-cell-time {
    display: block;
    text-align: right;
  }

  .legal-unit-cell {
    width: 100%;
  }

  .legal-unit-controls {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .legal-unit-save {
    width: auto;
  }

  .url-actions {
    width: auto;
    justify-content: flex-end;
  }

  .url-actions button {
    flex: 0 0 auto;
    min-width: 0;
  }
}

.cta-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0.72rem 0.95rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #003d99);
  border: 1px solid transparent;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .cta-link {
    color: #c9d1d9;
  }
}

html[data-theme="dark"] .cta-link {
  color: #c9d1d9;
}

.cta-link.secondary-link {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
}

blockquote {
  margin: 0.8rem 0;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-variant);
  color: var(--ink);
  border-radius: 8px;
}

.site-footer {
  width: min(980px, 92vw);
  margin: 0 auto 2.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.brand-bar {
  width: min(980px, 92vw);
  margin: 1.1rem auto 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-link:visited,
.brand-link:hover,
.brand-link:active {
  color: var(--ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-name-voter {
  color: rgb(96 165 250);
}

.footer-accent {
  color: rgb(96 165 250);
}

/* ── Home page blue accent theme ──────────────────────────────────────── */
body:not([data-theme]) main.container button:not(.theme-btn),
html[data-theme="dark"] main.container button:not(.theme-btn) {
  background: linear-gradient(135deg, #0052cc, #003d99);
}

body:not([data-theme]) main.container .cta-link,
html[data-theme="dark"] main.container .cta-link {
  background: #0052cc;
}

body:not([data-theme]) main.container .cta-link:not(.secondary-link):visited,
html[data-theme="light"] main.container .cta-link:not(.secondary-link):visited {
  color: #fff;
}

body:not([data-theme]) main.container .cta-link.secondary-link,
html[data-theme="dark"] main.container .cta-link.secondary-link {
  background: transparent;
  color: #0052cc;
  border-color: #0052cc;
}

body:not([data-theme]) main.container .helper.ok,
html[data-theme="dark"] main.container .helper.ok {
  color: #0052cc;
}

body:not([data-theme]) main.container .badge {
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #0a5f99;
  background: rgba(96, 165, 250, 0.15);
}

html[data-theme="dark"] main.container .badge {
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: rgb(96 165 250);
  background: rgba(96, 165, 250, 0.15);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) main.container .cta-link.secondary-link {
    color: #93c5fd;
    border-color: #93c5fd;
  }

  html:not([data-theme]) main.container .helper.ok {
    color: #93c5fd;
  }

  html:not([data-theme]) main.container .badge {
    border: 1px solid rgba(96, 165, 250, 0.4);
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.18);
  }
}

html[data-theme="dark"] main.container .cta-link.secondary-link {
  color: #93c5fd;
  border-color: #93c5fd;
}

html[data-theme="dark"] main.container .helper.ok {
  color: #93c5fd;
}

body:not([data-theme]) main.container blockquote {
  border-left-color: rgb(96 165 250);
}

html[data-theme="dark"] main.container blockquote {
  border-left-color: rgb(96 165 250);
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 1rem;
}

.docs-sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: var(--surface-variant);
}

.docs-sidebar h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.docs-sidebar a {
  display: block;
  color: var(--link);
  text-decoration: none;
  font-size: 0.93rem;
  padding: 0.3rem 0;
}

.docs-sidebar a:hover {
  color: var(--link-visited);
  text-decoration: none;
}

.docs-content {
  min-width: 0;
}

.docs-section {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--line);
}

.docs-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.docs-section h2 {
  margin: 0 0 0.5rem;
}

.docs-section ol,
.docs-section ul {
  margin: 0.5rem 0 0.4rem 1.2rem;
  color: var(--ink);
}

.docs-section li {
  margin-bottom: 0.38rem;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

  .pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .pricing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.1rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-variant);
    text-align: center;
  }

  .pricing-card-icon {
    font-size: 1.6rem;
    line-height: 1;
  }

  .pricing-card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
  }

.screenshot-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.screenshot-card img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot-card figcaption {
  padding: 0.62rem 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.diagram-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.diagram-card img {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-card figcaption {
  padding: 0.62rem 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Election Closed State ──────────────────────────────────────────────── */

/* Applied to form sections, the unit grid, and the links table after closure.
   pointer-events: none blocks clicks on all children (unit cells, table buttons). */
.election-closed {
  opacity: 0.65;
  pointer-events: none;
  cursor: not-allowed;
}

/* Ensure individual interactive children inside a closed container also look inert */
.election-closed .unit-cell,
.election-closed button,
.election-closed input,
.election-closed select {
  cursor: not-allowed;
}
