:root {
  color-scheme: light;
  --bg-page: #f4f7fb;
  /* make panels slightly translucent so the page background shows through */
  --bg-panel: rgba(255,255,255,0.94);
  --bg-accent: #f0f5ff;
  --bg-muted: #f8f9fc;
  --border: #d4d9e1;
  --border-strong: #c0c7d4;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-subtle: #6b7280;
  --text-inverse: #ffffff;
  --brand: #1d4ed8;
  --brand-soft: rgba(29, 78, 216, 0.16);
  --brand-strong: #153eac;
  --danger: #b91c1c;
  --shadow: 0 18px 32px -22px rgba(15, 23, 42, 0.45);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  font-size: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*:focus,
*:focus-visible,
*:active {
  outline: none !important;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  /* page-wide subtle gradient plus header overlay so it shows site-wide */
  background: 
    linear-gradient(180deg, rgba(29,78,216,0.04), rgba(29,78,216,0.02)),
    linear-gradient(180deg, var(--bg-page) 0%, #ffffff 60%);
  background-attachment: fixed, fixed;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
.link:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.shell {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}

.page-header {
  /* header sits on top of the page-wide background */
  background: transparent;
  padding: clamp(40px, 7vw, 72px) 0 32px;
}

.page-header__content {
  display: grid;
  gap: clamp(20px, 4vw, 28px);
}

.page-header__intro {
  max-width: 720px;
}

.page-header__intro[role="presentation"] {
  display: none !important;
}

.page-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

.page-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 60ch;
}

.callout {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 241, 204, 0.9), rgba(255, 249, 229, 0.95));
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-soft);
  color: #7c4a03;
}

.callout__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  color: #7c4a03;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.callout__close:hover {
  background: rgba(0, 0, 0, 0.15);
}

.callout__close:active {
  transform: scale(0.95);
}

.callout__title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #9a5c0a;
}

.callout p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.callout__signature {
  font-weight: 600;
  margin-left: 4px;
}

.layout-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vw, 40px);
  padding-bottom: 64px;
}

.panel {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 30px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.sample-ballot {
  display: grid;
  gap: 28px;
}

.panel--accent {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.06), transparent);
}

.panel--muted {
  background: var(--bg-muted);
  border-color: transparent;
  box-shadow: none;
}

.body-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 65ch;
}

.panel__header {
  display: grid;
  gap: 8px;
}

.panel__lede {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  position: relative;
  display: grid;
  gap: 6px;
}

.field-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.field-hint {
  font-size: 0.85rem;
  color: var(--text-subtle);
  order: 10;
}

input[type='text'] {
  position: relative;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1rem;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type='text']::placeholder {
  color: rgba(55, 65, 81, 0.7);
}

input[type='text']:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.autocomplete-dropdown.active {
  border-color: var(--brand);
}

.autocomplete-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: -1px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-soft);
  max-height: 260px;
  overflow-y: auto;
  display: none;
  z-index: 10;
  padding: 4px 0;
  order: 5;
}

.autocomplete-dropdown.active {
  display: block;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  color: var(--text-secondary);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected,
.autocomplete-item:focus {
  background: rgba(29, 78, 216, 0.12);
  color: var(--brand-strong);
}

.autocomplete-item.loading {
  cursor: default;
  text-align: center;
  color: var(--text-subtle);
  font-style: italic;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-inverse);
  background: var(--brand);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  box-shadow: 0 12px 20px rgba(29, 78, 216, 0.18);
}

.button:active {
  transform: scale(0.95);
}

.button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: -3px;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.45);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.button--ghost {
  background: transparent;
  color: var(--brand);
  border-color: var(--border);
  box-shadow: none;
}

.button--ghost:hover {
  background: rgba(29, 78, 216, 0.08);
  box-shadow: none;
}

.loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  color: var(--text-secondary);
}

.loading.active {
  display: flex;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(29, 78, 216, 0.2);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

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

.results {
  display: none;
}

.results.active {
  display: block;
}

.results:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.ballot-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-md);
  padding: clamp(18px, 3vw, 22px);
  display: grid;
  gap: 12px;
  box-shadow: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ballot-card + .ballot-card {
  margin-top: clamp(14px, 2.6vw, 20px);
}

.ballot-card:hover {
  border-color: rgba(29, 78, 216, 0.35);
  transform: translateY(-2px);
}

.ballot-card h4 {
  font-size: 1.05rem;
}

.ballot-card ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.ballot-card li {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
}

.ballot-card strong {
  font-weight: 600;
  color: var(--text-primary);
}

.ballot-view-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.ballot-view-toggle__button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ballot-view-toggle__button:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.ballot-view-toggle__button.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-inverse);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.25);
}

.ballot-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: rgba(148, 163, 184, 0.2);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ballot-progress.active {
  opacity: 1;
}

.ballot-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  width: 0%;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 8px rgba(29, 78, 216, 0.4);
}

.ballot-section {
  position: relative;
  padding-top: clamp(24px, 4vw, 32px);
  border-top: 1px solid rgba(148, 163, 184, 0.32);
}

.ballot-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.ballot-section > h3 {
  margin-bottom: 12px;
}

.ballot-question {
  display: grid;
  gap: 14px;
  padding-left: clamp(16px, 3vw, 22px);
  padding-top: clamp(14px, 2.6vw, 20px);
  padding-bottom: clamp(14px, 2.6vw, 20px);
  border-left: 4px solid rgba(29, 78, 216, 0.22);
}

.ballot-question + .ballot-question {
  padding-top: clamp(14px, 2.6vw, 20px);
  padding-bottom: clamp(14px, 2.6vw, 20px);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.ballot-question__header {
  display: grid;
  gap: 8px;
}

.ballot-question__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.ballot-question__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

.ballot-question__choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.ballot-question__choices li {
  display: block;
}

.ballot-question__choices strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  display: block;
  margin-bottom: 12px;
  margin-top: 6px;
}

.ballot-question__title {
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.ballot-question__body {
  color: var(--text-secondary);
  display: grid;
  gap: 12px;
}

.ballot-question__view {
  display: none;
  color: var(--text-secondary);
  gap: 12px;
}

.ballot-question__view p + .ballot-question__arguments {
  margin-top: 8px;
}

.ballot-question__arguments {
  font-size: 0.9rem;
  line-height: 1.45;
}

.ballot-question__arguments h5 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ballot-question__arguments ul {
  list-style: disc;
  display: block;
  padding-left: 20px;
  margin: 0;
}

.ballot-question__arguments li {
  display: list-item;
  margin-bottom: 4px;
  gap: 0;
}

.ballot-question__arguments li:last-child {
  margin-bottom: 0;
}

.ballot-question__empty {
  color: var(--text-subtle);
  font-style: italic;
}

#ballot-sections[data-ballot-view="official"] .ballot-question__view[data-view-section="official"],
#ballot-sections[data-ballot-view="plain"] .ballot-question__view[data-view-section="plain"],
#ballot-sections[data-ballot-view="plain-arguments"] .ballot-question__view[data-view-section="plain-arguments"] {
  display: grid;
}

@media (min-width: 640px) {
  .ballot-card li {
    grid-template-columns: minmax(140px, auto) 1fr;
    align-items: flex-start;
  }

  .ballot-card strong {
    padding-right: 12px;
  }
}

.ballot-info {
  background: var(--bg-accent);
  border-radius: var(--radius-md);
  border: 1px solid rgba(29, 78, 216, 0.15);
  padding: 20px;
  display: grid;
  gap: 8px;
}

.ballot-info p {
  color: var(--text-secondary);
}

.ballot-header {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.ballot-header h2 {
  margin-bottom: 4px;
}

.location-section {
  margin-top: clamp(12px, 2.5vw, 20px);
}

.location-list {
  display: grid;
  gap: clamp(16px, 3vw, 22px);
}

.location-list-secondary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2.5vw, 18px);
  margin-top: clamp(14px, 2.5vw, 18px);
}

.location-card {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: #fff;
  padding: clamp(14px, 2.5vw, 18px);
  display: grid;
  gap: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.location-card:hover {
  border-color: rgba(29, 78, 216, 0.32);
  box-shadow: 0 12px 22px -18px rgba(15, 23, 42, 0.35);
}


.location-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.location-card__title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.location-card__title h4 {
  font-size: clamp(0.95rem, 2.4vw, 1.08rem);
  font-weight: 600;
  margin: 0;
}

.location-card__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  color: var(--brand-strong);
  font-weight: 600;
  font-size: 0.8rem;
}

.location-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.15);
  color: var(--brand-strong);
}

.location-card__meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.location-card__meta strong {
  color: var(--text-primary);
}

.location-card--primary {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.38);
  box-shadow: 0 14px 28px -20px rgba(15, 23, 42, 0.42);
}

.location-card--primary .location-card__rank {
  background: rgba(29, 78, 216, 0.9);
  color: var(--text-inverse);
}

.location-card--primary .button {
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.24);
}

.location-card--secondary {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: clamp(12px, 2vw, 14px);
  box-shadow: 0 4px 12px -8px rgba(15, 23, 42, 0.15);
}

.location-card--secondary:hover {
  border-color: rgba(29, 78, 216, 0.28);
  box-shadow: 0 8px 18px -14px rgba(15, 23, 42, 0.28);
}

.location-card--secondary .location-card__rank {
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  background: rgba(59, 130, 246, 0.08);
}

.location-card--secondary .location-card__title h4 {
  font-size: clamp(0.9rem, 2.2vw, 0.98rem);
}

.location-card--secondary .location-card__meta {
  font-size: 0.85rem;
  gap: 6px;
}

.location-card--secondary .button {
  font-size: 0.9rem;
  padding: 9px 16px;
}

.location-card__cta {
  flex-shrink: 0;
  padding-left: 24px;
  padding-right: 24px;
}

@media (max-width: 640px) {
  .location-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .location-card__cta {
    width: 100%;
    justify-content: center;
  }

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

/* Voting hours section */
.voting-hours-section {
  margin-top: 12px;
}

.voting-hours {
  display: grid;
  gap: 24px;
}

.voting-hours__group h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.voting-periods {
  display: grid;
  gap: 8px;
}

.voting-period {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.voting-period:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.voting-period--election-day {
  background: var(--bg-accent);
  border-color: rgba(29, 78, 216, 0.2);
}

.voting-period--election-day:hover {
  border-color: rgba(29, 78, 216, 0.35);
}

.voting-period__dates {
  flex: 1;
}

.voting-period__dates-primary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.voting-period__dates-secondary {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-top: 2px;
  font-style: italic;
}

.voting-period__hours {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .voting-period {
    flex-direction: column;
    gap: 8px;
  }

  .voting-period__hours {
    align-self: flex-start;
  }
}

.ballot-header h2,
.ballot-header h3 {
  font-size: 1.35rem;
  font-weight: 600;
}

.ballot-subtitle {
  color: var(--text-subtle);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.ballot-view-source-notice {
  margin-top: 8px;
  margin-bottom: 4px;
}

.ballot-view-source-notice small {
  font-size: 0.85rem;
  color: var(--text-subtle);
  line-height: 1.4;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-muted);
  color: var(--text-subtle);
}

.pill--alert {
  background: rgba(185, 28, 28, 0.12);
  color: var(--danger);
}

.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.choice-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: #fff;
  font-size: 1rem;
  font-weight: 500;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease;
  cursor: pointer;
}

.choice-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-muted);
}

.choice-option:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.choice-option:active {
  transform: scale(0.98);
}

.choice-option input[type='radio'] {
  accent-color: var(--brand);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.actions-bar {
  display: none;
  gap: 12px;
  flex-wrap: wrap;
}

.actions-bar.active {
  display: flex;
}

.actions-bar .button {
  flex: 1 1 220px;
}

.disclaimer {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 196, 38, 0.35);
  background: rgba(255, 220, 128, 0.18);
  color: #7c4a03;
  font-size: 0.9rem;
}

.disclaimer a {
  color: inherit;
  text-decoration: underline;
}

.error {
  text-align: center;
  padding: 28px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(185, 28, 28, 0.25);
  background: rgba(254, 226, 226, 0.6);
  color: var(--danger);
  display: grid;
  gap: 12px;
}

.error p {
  color: #7f1d1d;
}

.link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

.link--button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--brand);
}

.stack-xs {
  display: grid;
  gap: 6px;
}

.stack-sm {
  display: grid;
  gap: 12px;
}

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

.ballot-section.stack-md {
  display: block;
}

.ballot-section.stack-md > * + * {
  margin-top: clamp(12px, 2.6vw, 18px);
}

.stack-lg {
  display: grid;
  gap: 24px;
}

.results h2,
.results h3 {
  font-weight: 600;
}

.results h2 {
  font-size: 1.5rem;
}

.results h3 {
  font-size: 1.2rem;
  margin-top: 24px;
}

.meta-list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.meta-term {
  font-weight: 600;
  color: var(--text-primary);
}

.meta-description {
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  .page-header {
    padding: 32px 0 24px;
  }

  .panel {
    padding: 20px;
  }

  .actions-bar .button {
    flex: 1 1 100%;
  }

  .ballot-card {
    padding: 16px;
  }

  .ballot-card li {
    gap: 4px;
  }

  .choice-option {
    width: 100%;
    justify-content: space-between;
  }

}

body.modal-open {
  overflow: hidden;
  padding-right: var(--scrollbar-width, 0);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal.closing .modal__overlay {
  animation: fadeOut 0.2s ease;
}

.modal__content {
  position: relative;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
  max-width: 500px;
  width: 100%;
  animation: slideUp 0.25s ease;
}

.modal.closing .modal__content {
  animation: slideDown 0.25s ease;
}

.modal__header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal__body {
  padding: 24px;
  display: grid;
  gap: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal__body p {
  margin: 0;
}

.modal__body strong {
  color: var(--text-primary);
}

.modal__footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal__footer .button {
  flex: 0 1 auto;
  min-width: 120px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

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

@media (max-width: 640px) {
  .modal__footer {
    flex-direction: column-reverse;
  }

  .modal__footer .button {
    width: 100%;
  }
}

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