:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #1a1040;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #ffffff;
}

a {
  color: #5a31bd;
}

a:focus-visible,
[tabindex]:focus-visible,
button:focus-visible {
  /* White clears primary purple; navy clears white. Both pairs exceed 3:1. */
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px #111827;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #ffffff;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.site-header a {
  display: block;
  width: min(300px, calc(100vw - 2rem));
}

.site-logo {
  display: block;
  width: 100%;
  height: auto;
}

main {
  width: min(100% - 2rem, 34rem);
  margin: auto;
}

.shell-card {
  padding: clamp(1.5rem, 6vw, 3rem);
  border: 1px solid #e8e0ff;
  border-radius: 1.5rem;
  background: #ffffff;
  box-shadow: 0 1rem 3rem rgb(75 37 159 / 12%);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #6b3fdb;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  line-height: 1.1;
}

.shell-card > p:not(.eyebrow) {
  color: #4b5563;
  line-height: 1.6;
}

.lead {
  margin-bottom: 1.5rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0.9rem;
  background: #f3f0ff;
  font-weight: 700;
}

.status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #6b3fdb;
  animation: pulse 1.4s ease-in-out infinite;
}

.notice {
  margin-top: 1rem;
  padding: 1rem;
  border-left: 4px solid #b45309;
  background: #fff8ec;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 2px solid transparent;
  border-radius: 0.8rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  background: #6b3fdb;
  color: #ffffff;
}

.button-secondary {
  border-color: #6b3fdb;
  background: #ffffff;
  color: #4b259f;
}

.button:disabled {
  background: #d1d5db;
  color: #4b5563;
  cursor: not-allowed;
}

.candidate-list {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.candidate-card {
  padding: 1rem;
  border: 1px solid #ded5f7;
  border-radius: 1rem;
  background: #fbfaff;
}

.join-code-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.join-code-form label {
  color: #341878;
  font-weight: 800;
}

.join-code-form input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 2px solid #c4b5e8;
  border-radius: 0.8rem;
  color: #1a1040;
  background: #ffffff;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.join-code-form input:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px #111827;
}

.join-code-form .fine-print,
.install-guidance {
  margin: 0;
}

.ballot-progress-row,
.availability-row,
.card-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ballot-progress-copy {
  color: #341878;
}

.ballot-answered {
  color: #4b5563;
  font-size: 0.9rem;
}

.ballot-progress {
  width: 100%;
  height: 0.55rem;
  margin: 0.55rem 0 1rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  accent-color: #6b3fdb;
}

.ballot-progress::-webkit-progress-bar {
  background: #e8e0ff;
}

.ballot-progress::-webkit-progress-value,
.ballot-progress::-moz-progress-bar {
  background: #6b3fdb;
}

.vote-card-stack {
  position: relative;
  isolation: isolate;
}

.vote-card-stack::before,
.vote-card-stack::after {
  position: absolute;
  z-index: -1;
  inset: 0.5rem 0.8rem -0.45rem;
  border: 1px solid #ded5f7;
  border-radius: 1.2rem;
  background: #f3f0ff;
  content: '';
}

.vote-card-stack::after {
  inset: 0.25rem 0.4rem -0.2rem;
  background: #fbfaff;
}

.vote-card {
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 1.2rem;
  background: #ffffff;
  box-shadow: 0 0.9rem 2rem rgb(75 37 159 / 18%);
  touch-action: pan-y;
}

.candidate-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eeeaf8;
}

.candidate-photo-empty {
  display: grid;
  place-items: center;
  padding: 2rem;
  color: #6b7280;
  text-align: center;
}

.candidate-details {
  padding: 1rem;
}

.availability-row {
  justify-content: flex-start;
  margin-bottom: 0.75rem;
}

.closed-chip,
.restaurant-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.closed-chip {
  background: #fee2e2;
  color: #991b1b;
}

.view-hours {
  font-size: 0.82rem;
  font-weight: 750;
}

.restaurant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.restaurant-chip {
  background: #eee8ff;
  color: #4b259f;
}

.candidate-facts,
.candidate-address {
  margin: 0.4rem 0;
  color: #4b5563;
  font-size: 0.92rem;
}

.card-navigation {
  margin-top: 1rem;
}

.card-navigation-button {
  min-width: 7rem;
}

.candidate-name {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
}

.place-tags {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag-chip {
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #6b3fdb;
  border-radius: 999px;
  background: #ffffff;
  color: #341878;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.tag-chip-personal {
  background: #f3f0ff;
}

.tag-empty {
  color: #4b5563;
  font-size: 0.9rem;
}

.tag-editor {
  padding: 0.65rem;
  border: 1px solid #ded5f7;
  border-radius: 0.7rem;
  background: #ffffff;
}

.tag-visibility-control {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #e8e0ff;
  border-radius: 0.9rem;
  background: #f8f6ff;
}

.tag-visibility-control h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.tag-editor summary {
  color: #4b259f;
  font-weight: 800;
  cursor: pointer;
}

.tag-editor label {
  display: grid;
  gap: 0.35rem;
  margin: 0.65rem 0;
  color: #341878;
  font-weight: 700;
}

.tag-editor input,
.tag-editor select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem;
  border: 2px solid #c4b5e8;
  border-radius: 0.65rem;
  color: #1a1040;
  background: #ffffff;
  font: inherit;
}

.result-summary {
  color: #4b5563;
}

.choice-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.choice-button {
  min-height: 2.75rem;
  padding: 0.55rem;
  border: 2px solid #c4b5e8;
  border-radius: 0.7rem;
  background: #ffffff;
  color: #341878;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.choice-button.is-selected {
  border-color: #6b3fdb;
  background: #e9e2ff;
  box-shadow: inset 0 0 0 1px #6b3fdb;
}

.choice-button.is-selected:focus-visible {
  box-shadow: inset 0 0 0 1px #6b3fdb, 0 0 0 7px #111827;
}

.choice-never {
  border-color: #f0a5a5;
  color: #991b1b;
}

.choice-pass {
  border-color: #cbd5e1;
  color: #334155;
}

.choice-like {
  border-color: #9fd4bb;
  color: #166534;
}

.ballot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.fine-print,
.receipt-label {
  color: #4b5563;
  font-size: 0.9rem;
}

.receipt-code {
  display: block;
  overflow-wrap: anywhere;
  padding: 0.75rem;
  border-radius: 0.6rem;
  background: #f3f0ff;
}

.decision {
  padding: 1rem;
  border-radius: 0.8rem;
  background: #e9e2ff;
  color: #341878;
  font-size: 1.15rem;
  font-weight: 800;
}

.install-offer {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid #c4b5e8;
  border-radius: 1rem;
  background: #fbfaff;
}

.install-offer h2 {
  margin: 0;
  color: #341878;
  font-size: 1.35rem;
}

.install-offer p {
  color: #4b5563;
  line-height: 1.55;
}

.install-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.install-status {
  width: 100%;
  margin: 0;
  font-weight: 800;
}

.verification-panel {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ded5f7;
}

.verification-panel h3,
.verification-panel p {
  margin: 0;
}

.verification-panel label {
  color: #341878;
  font-weight: 800;
}

.verification-panel input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  border: 2px solid #c4b5e8;
  border-radius: 0.7rem;
  color: #1a1040;
  background: #ffffff;
  font: inherit;
}

.verification-panel input:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px #111827;
}

.verification-message {
  color: #4b259f;
  font-weight: 700;
}

.verification-recaptcha {
  min-height: 1px;
  overflow-x: auto;
}

dialog {
  width: min(100% - 2rem, 30rem);
  padding: 1.5rem;
  border: 1px solid #c4b5e8;
  border-radius: 1rem;
  color: #1a1040;
  background: #ffffff;
}

dialog::backdrop {
  background: rgb(17 24 39 / 65%);
}

dialog h2 {
  margin-top: 0;
}

dialog p {
  line-height: 1.6;
}

footer {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.5rem 1rem;
  color: #6b7280;
  font-size: 0.9rem;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 28rem) {
  .ballot-actions,
  .install-offer-actions {
    width: 100%;
  }

  .ballot-actions > .button,
  .install-offer-actions > .button {
    width: 100%;
  }

  .card-navigation-button {
    min-width: 0;
  }
}

.compact-install-button {
  display: flex;
  width: fit-content;
  min-height: 2.4rem;
  margin: 0 auto;
  padding: 0.5rem 0.9rem;
}

.install-offer-details {
  margin-top: 0.75rem;
}

.waiting-mascot {
  display: block;
  width: min(76%, 19rem);
  height: auto;
  margin: -0.25rem auto 0.75rem;
}
