*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--green-d); outline-offset: 2px; }

.view { display: none; }
.view.view--active { display: block; }

.topcluster {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 40;
  display: flex;
  gap: 8px;
}

.back-fab {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: clamp(16px, 4vw, 32px);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease, background-color var(--dur) ease;
}
.back-fab:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); background: var(--surface-2); }
.back-fab[hidden] { display: none; }

@media (max-width: 519px) {
  .back-fab { width: 44px; padding: 0; justify-content: center; }
  .back-fab-label { display: none; }
}

.methodology-link {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 40;
}

.voter-faq-fab {
  /* Election portal primary CTA — reachable from anywhere, so it needs to
     read clearly rather than blend into page chrome like .topcluster does. */
  --fab-tint: var(--green-d);
  position: fixed;
  bottom: clamp(18px, 4vw, 28px);
  right: clamp(18px, 4vw, 28px);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: var(--green-d);
  color: #fff;
  border: none;
  border-radius: 100px;
  box-shadow: var(--shadow-2), 0 0 0 0 color-mix(in srgb, var(--fab-tint) 45%, transparent);
  text-decoration: none;
  font-family: var(--font-stat);
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 44px;
  cursor: pointer;
  animation: voterFaqPulse 2.5s ease-in-out infinite;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease, opacity var(--dur) ease;
}
[data-theme="dark"] .voter-faq-fab { --fab-tint: var(--green); background: var(--green); color: #10160b; }
.voter-faq-fab:hover, .voter-faq-fab:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3), 0 0 0 0 transparent;
  animation-play-state: paused;
}
.voter-faq-fab[hidden] { display: none; }

@keyframes voterFaqPulse {
  0%, 100% { box-shadow: var(--shadow-2), 0 0 0 0 color-mix(in srgb, var(--fab-tint) 45%, transparent); }
  50% { box-shadow: var(--shadow-2), 0 0 0 9px color-mix(in srgb, var(--fab-tint) 0%, transparent); }
}

.loading-indicator {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 100;
  transition: opacity .25s ease;
}
.loading-indicator[hidden] { display: none; }

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 24px) calc(var(--space-7) + env(safe-area-inset-bottom));
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
