@layer utilities {
  /* Core Layout & Backgrounds */
  .theme-bg-app {
    background-color: #101a2d;
  }
  .theme-panel-dark {
    background-color: #1d2a3d;
    border-color: #35445c;
  }
  .theme-border-app {
    border-color: #35445c;
  }

  /* Typography Enhancements for Dark Mode Readability */
  .theme-text-primary {
    color: #f8fafc; /* Crisp off-white */
  }
  .theme-text-secondary {
    color: #cbd5e1; /* Soft slate gray */
  }
  .theme-text-muted {
    color: #91a4bf; /* Dimmer text for secondary metadata */
  }

  /* Keep the workspace pages aligned with the ballot's compact type system. */
  .theme-bg-app {
    font-family: "Avenir Next", "Trebuchet MS", sans-serif;
    font-size: 0.8125rem;
  }

  .theme-bg-app h1 {
    font-size: 1.25rem !important;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .theme-bg-app h2,
  .theme-bg-app h3,
  .theme-bg-app summary {
    font-size: 0.6875rem !important;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .theme-bg-app p,
  .theme-bg-app label,
  .theme-bg-app input,
  .theme-bg-app select,
  .theme-bg-app button,
  .theme-bg-app li,
  .theme-bg-app td,
  .theme-bg-app th {
    font-size: 0.8125rem;
  }

  .theme-surface {
    background-color: #142136;
  }

  .theme-surface-hover:hover {
    background-color: #1d2a3d;
  }

  .history-scroll {
    height: 20rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
    scrollbar-color: #41526d #142136;
  }

  .history-scroll [data-cy="history-row"] {
    min-height: 3.25rem;
  }

  @media (max-width: 47.9375rem) {
    .theme-bg-app {
      overflow-x: hidden;
    }

    .theme-bg-app [data-cy="admin-panel"] {
      padding: 1.5rem 1rem;
    }

    .theme-bg-app [data-cy="admin-panel"] > div.flex.border-b {
      flex-wrap: wrap;
      gap: 0;
    }

    .theme-bg-app [data-cy="admin-panel"] > div.flex.border-b > button {
      flex: 1 1 50%;
      min-width: 0;
      padding: 0.75rem 0.5rem;
    }

    .theme-bg-app button,
    .vote-page button {
      min-width: 1.75rem;
      min-height: 1.75rem;
    }
  }

  .vote-page {
    background: #101a2d;
    color: #f8fafc;
    font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  }

  .vote-shell {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    background: #101a2d;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  @media (min-width: 48rem) {
    .vote-shell {
      padding: 2rem 4rem;
    }
  }

  .vote-kicker {
    color: #ffad0d;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .vote-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
  }

  .vote-status {
    border: 1px solid #334155;
    background: #1e293b;
    color: #fbbf24;
    font-size: 0.625rem;
    letter-spacing: 0.08em;
  }

  .vote-section-title {
    color: #ffad0d;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .vote-instruction {
    color: #a8c7ee;
    font-size: 0.75rem;
  }

  .vote-slot {
    min-height: 2.75rem;
    border: 1px dashed #41526d;
    border-radius: 0.625rem;
    background: #101a2d;
    color: #7185a3;
    font-size: 0.75rem;
  }

  .vote-slot-filled {
    border-style: solid;
    border-color: #35445c;
    background: #1d2a3d;
    color: #ffffff;
    font-weight: 700;
  }

  .vote-rank-number {
    display: inline-flex;
    width: 1.375rem;
    height: 1.375rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 9999px;
    background: #ffa20a;
    color: #101a2d;
    font-size: 0.75rem;
    font-weight: 800;
  }

  .vote-control {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #34445c;
    border-radius: 0.375rem;
    background: #142136;
    color: #dbeafe;
    font-size: 0.75rem;
    font-weight: 800;
  }

  .vote-remove {
    border-color: #56364a;
    background: #3a2a3d;
    color: #fb5361;
  }

  .vote-candidate {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #35445c;
    border-radius: 0.625rem;
    background: #1d2a3d;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0.625rem 0.75rem;
    text-align: left;
  }

  .vote-candidate::after {
    content: "+";
    color: #91a4bf;
    font-size: 1rem;
    font-weight: 400;
  }

  .vote-submit {
    width: 100%;
    min-height: 2.75rem;
    border-radius: 0.75rem;
    background: #ffa20a;
    color: #101a2d;
    font-size: 0.8125rem;
    font-weight: 800;
  }

  .vote-submit:hover:not(:disabled) {
    background: #ffb52d;
  }

  .vote-submit:disabled {
    background: #405069;
    color: #a8b4c5;
  }
}

/* Click feedback for admin buttons; static/js/button-feedback.js sets data-clicked. */
@keyframes button-click-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.75); }
  100% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
}

button[data-clicked="true"] {
  animation: button-click-pulse 0.6s ease-out;
  filter: brightness(1.3);
}

@media (prefers-reduced-motion: reduce) {
  button[data-clicked="true"] {
    animation: none;
    outline: 2px solid rgb(52, 211, 153);
  }
}

/* Paper ballots: scaled pages on screen, one ballot per US Letter sheet in print. */
.paper-ballot-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.paper-ballot-page svg {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  border-radius: 0.25rem;
}

#paperBallotPrintRoot {
  display: none;
}

@media print {
  @page {
    size: letter;
    margin: 0;
  }

  html.printing-paper-ballots body {
    background: #ffffff !important;
    margin: 0;
    padding: 0;
  }

  html.printing-paper-ballots body > :not(#paperBallotPrintRoot) {
    display: none !important;
  }

  html.printing-paper-ballots #paperBallotPrintRoot {
    display: block;
  }

  #paperBallotPrintRoot .paper-ballot-page {
    width: 8.5in;
    height: 11in;
    break-after: page;
    page-break-after: always;
  }

  #paperBallotPrintRoot .paper-ballot-page svg {
    width: 8.5in;
    height: 11in;
    border-radius: 0;
  }
}

/* --- Site header and footer ---
   Unlayered, so these rules win over the utility layer above. Menus toggle with the
   hidden attribute rather than Tailwind's .hidden class for the same reason. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #101a2d;
  border-bottom: 1px solid #35445c;
}
.site-header-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.5rem 1rem;
}
.site-burger {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border: 1px solid #35445c;
  border-radius: 0.375rem;
  background: #1d2a3d;
  color: #f8fafc;
  font-size: 1.25rem;
  cursor: pointer;
}
.site-burger:hover { background: #26364d; }
.site-logo { display: inline-flex; min-width: 0; }
.site-logo img { display: block; width: auto; height: 1.625rem; max-width: 100%; }
.site-header-spacer { flex: 1; min-width: 0; }
.site-cta {
  flex: none;
  border-radius: 0.375rem;
  background: #b45309;
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.6rem 0.9rem;
  white-space: nowrap;
  text-decoration: none;
}
.site-cta:hover { background: #d97706; }
.site-cta-short { display: none; }
.site-nav {
  display: flex;
  gap: 1.5rem;
  padding: 0 1rem;
  border-top: 1px solid #35445c;
  overflow-x: auto;
  font-size: 0.875rem;
}
.site-nav a {
  padding: 0.6rem 0;
  color: #cbd5e1;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.site-nav a:hover { color: #fbbf24; }
.site-nav a[aria-current="page"] { color: #fbbf24; border-color: #fbbf24; }
.site-menu {
  position: fixed;
  left: 1rem;
  top: 4.5rem;
  z-index: 50;
  display: grid;
  gap: 0.25rem;
  width: 18rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem;
  border: 1px solid #35445c;
  border-radius: 0.375rem;
  background: #1d2a3d;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
}
.site-menu[hidden] { display: none; }
.site-menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid #35445c;
  font-weight: 700;
  color: #f8fafc;
}
.site-menu-top button { background: none; border: 0; color: #cbd5e1; font-size: 1.25rem; cursor: pointer; }
.site-menu a { padding: 0.5rem 0.75rem; border-radius: 0.375rem; color: #cbd5e1; text-decoration: none; }
.site-menu a:hover { background: #26364d; color: #fbbf24; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.1rem;
  padding: 1rem;
  border-top: 1px solid #35445c;
  background: #101a2d;
  color: #91a4bf;
  font-size: 0.8125rem;
}
.site-footer img { width: 1.5rem; height: 1.5rem; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-left: auto; }
.site-footer-links a { color: #cbd5e1; text-decoration: none; }
.site-footer-links a:hover { color: #fbbf24; }

/* Keep the footer at the bottom of the screen on short pages: the page's main
   wrapper grows to fill the space between the header and the footer. */
body:has(> .site-footer),
body:has(> .voter-footer) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
body:has(> .site-footer) > :is(div, main),
body:has(> .voter-footer) > :is(div, main) {
  flex: 1 0 auto;
  width: 100%;
}
body:has(> .voter-footer) > .vote-shell { min-height: 0; }

/* Minimal header and footer for pages voters reach through an election link */
.voter-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #35445c;
  background: #101a2d;
}
.voter-header-logo { display: block; width: auto; height: 1.25rem; }
.voter-header .voter-header-title {
  margin: 0 0 0 auto;
  min-width: 0;
  color: #f8fafc;
  font-size: 1rem !important;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.voter-status {
  flex: none;
  border-radius: 999px;
  border: 1px solid #35445c;
  padding: 0.15rem 0.65rem;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.voter-status[data-state="open"] { color: #34d399; border-color: #1f6f57; background: #0f2c26; }
.voter-status[data-state="final"] { color: #fbbf24; border-color: #92400e; background: #2a1d07; }
.voter-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1rem;
  padding: 1rem;
  border-top: 1px solid #35445c;
  background: #101a2d;
  color: #91a4bf;
  font-size: 0.75rem;
}
.voter-footer b { color: #cbd5e1; font-weight: 600; }
.voter-footer a { color: #cbd5e1; }

@media (max-width: 480px) {
  .site-cta-long { display: none; }
  .site-cta-short { display: inline; }
  .site-logo img { height: 1.125rem; }
  .site-header-bar { gap: 0.6rem; }
  .voter-status { order: 2; margin-left: auto; }
  .voter-header .voter-header-title { margin-left: 0; flex: 1 1 100%; order: 3; }
}

/* --- Home page ---
   Its own body class, so the dashboard's compact type sizes don't apply. */
.home-page {
  margin: 0;
  background: #101a2d;
  color: #f8fafc;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}
.home-page h1, .home-page h2, .home-page h3 { margin: 0; font-weight: 800; text-wrap: balance; }
.home-page p { margin: 0; color: #cbd5e1; }
.home-gutter { padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px)); }
.home-wrap { max-width: 67.5rem; margin: 0 auto; }
.home-stack { display: grid; gap: 1rem; align-content: start; }
.home-stack-lg { display: grid; gap: 2rem; }
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 3rem;
  align-items: center;
  padding-block: 4rem 3.5rem;
}
.home-hero h1 { font-size: clamp(2.1rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; }
.home-hero h1 em { font-style: normal; color: #fbbf24; }
.home-lead { font-size: 1.2rem; max-width: 34em; }
.home-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.home-cta {
  display: inline-block;
  border-radius: 0.375rem;
  background: #b45309;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  white-space: nowrap;
}
.home-cta:hover { background: #d97706; }
.home-cta-ghost { background: transparent; border: 1px solid #35445c; color: #cbd5e1; }
.home-cta-ghost:hover { background: #1d2a3d; color: #fbbf24; }
.home-fine { font-size: 0.85rem; color: #91a4bf !important; }
.home-rounds { display: grid; gap: 1rem; padding: 1.4rem; border: 1px solid #35445c; border-radius: 0.75rem; background: #1d2a3d; }
.home-rounds-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.home-rounds-head h2 { font-size: 1rem; }
.home-example { border: 1px solid #35445c; border-radius: 0.25rem; padding: 0 0.4rem; color: #91a4bf; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.home-round { display: grid; gap: 0.4rem; }
.home-round-label { color: #91a4bf; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.home-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 2.5em; gap: 0.6rem; align-items: center; font-size: 0.9rem; }
.home-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cbd5e1; }
.home-row-out .home-name { color: #91a4bf; text-decoration: line-through; }
.home-track { display: block; height: 0.6rem; border-radius: 0.3rem; background: #172234; overflow: hidden; }
.home-fill { display: block; height: 100%; border-radius: 0.3rem; background: #64748b; }
.home-fill-lead { background: #fbbf24; }
.home-fill-out { background: #475569; opacity: 0.5; }
.home-n { text-align: right; font-variant-numeric: tabular-nums; color: #cbd5e1; }
.home-winner { border-top: 1px solid #35445c; padding-top: 0.9rem; font-size: 0.9rem; }
.home-winner b { color: #34d399; }
.home-block .home-wrap { padding-block: 4rem; }
.home-section-head { display: grid; gap: 0.6rem; max-width: 46em; }
.home-section-head h2, .home-block h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); letter-spacing: -0.01em; }
.home-eyebrow { color: #fbbf24; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.home-eyebrow-muted { color: #91a4bf; }
.home-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #35445c; }
.home-steps li { display: grid; gap: 0.5rem; align-content: start; padding: 1.4rem 1.4rem 0 0; }
.home-steps li + li { padding-left: 1.4rem; border-left: 1px solid #35445c; }
.home-step-n { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: #fbbf24; color: #101a2d; font-weight: 800; }
.home-steps h3 { font-size: 1.05rem; }
.home-steps p { font-size: 0.95rem; }
.home-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #35445c; border-radius: 0.75rem; background: #35445c; }
.home-feature { display: grid; gap: 0.4rem; align-content: start; padding: 1.4rem; background: #101a2d; }
.home-feature h3 { font-size: 1rem; }
.home-feature p, .home-aud p { font-size: 0.92rem; }
.home-audience { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.home-aud { display: grid; gap: 0.4rem; padding: 0.25rem 0 0.25rem 1rem; border-left: 3px solid #fbbf24; }
.home-aud h3 { font-size: 1rem; }
.home-privacy { border-block: 1px solid #35445c; background: #1d2a3d; }
.home-privacy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; padding-block: 3rem; }
.home-privacy h2 { font-size: 1.6rem; }
.home-privacy ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.5rem; color: #cbd5e1; }
.home-code-box { justify-items: start; }
.home-code { display: inline-block; border: 1px dashed #35445c; border-radius: 0.5rem; background: #101a2d; padding: 0.85rem 1.1rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.35rem; letter-spacing: 0.08em; color: #f8fafc; }
.home-small { font-size: 0.88rem; }
.home-page a:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }

@media (max-width: 860px) {
  .home-hero-grid, .home-privacy-grid { grid-template-columns: 1fr; }
  .home-steps, .home-features, .home-audience { grid-template-columns: 1fr 1fr; }
  .home-steps li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) {
  .home-steps, .home-features, .home-audience { grid-template-columns: 1fr; }
  .home-steps li, .home-steps li + li { border-left: 0; padding-left: 0; }
}
/* Jumping to a section (the header's How it works link) stops below the sticky header. */
.home-page section[id] { scroll-margin-top: 7.5rem; }

/* --- FAQ page (uses the home page's base styles) --- */
.faq-layout { display: grid; gap: 3rem; padding-block: 3.5rem 4rem; max-width: 52rem; }
.faq-intro h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); letter-spacing: -0.02em; }
.faq-toc ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.faq-toc a { display: inline-block; border: 1px solid #35445c; border-radius: 999px; padding: 0.3rem 0.85rem; color: #cbd5e1; font-size: 0.875rem; text-decoration: none; }
.faq-toc a:hover { border-color: #fbbf24; color: #fbbf24; }
.faq-group { display: grid; gap: 1rem; scroll-margin-top: 7.5rem; }
.faq-group h2 { font-size: 1.4rem; }
.faq-list { border-top: 1px solid #35445c; }
.faq-item { border-bottom: 1px solid #35445c; scroll-margin-top: 7.5rem; }
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  list-style: none;
  cursor: pointer;
  color: #f8fafc;
  font-weight: 700;
  font-size: 1.02rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; color: #fbbf24; font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:hover { color: #fbbf24; }
.faq-item summary:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.faq-answer { display: grid; gap: 0.75rem; padding: 0 2rem 1.25rem 0; max-width: 46em; }
.faq-answer a { color: #fbbf24; }
.faq-closing { border-top: 1px solid #35445c; padding-top: 2.5rem; }
.faq-closing h2 { font-size: 1.6rem; }
.faq-answer ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.4rem; color: #cbd5e1; }
.faq-answer b { color: #f8fafc; }

/* On narrow phones the footer links can't share a line with the copyright, so they
   go first, left-aligned, with the logo and copyright on the line below. */
@media (max-width: 640px) {
  .site-footer-links { order: -1; flex-basis: 100%; margin-left: 0; }
}

/* --- Sign-in, account and message pages (use the home page's base styles) --- */
.auth-layout { display: grid; justify-items: center; padding-block: 3.5rem 4rem; }
.auth-card { display: grid; gap: 1.25rem; width: 100%; max-width: 28rem; padding: 1.75rem; border: 1px solid #35445c; border-radius: 0.75rem; background: #1d2a3d; }
.auth-card h1 { font-size: 1.6rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #35445c; border-radius: 0.5rem; overflow: hidden; }
/* The Sign up tab is a link to the plans while payments are on, so style links and buttons alike. */
.auth-tabs button, .auth-tabs a { display: block; padding: 0.6rem; background: transparent; border: 0; color: #cbd5e1; font: inherit; font-weight: 700; line-height: 1.5; text-align: center; text-decoration: none; cursor: pointer; }
.auth-tabs button[aria-selected="true"], .auth-tabs a[aria-selected="true"] { background: #101a2d; color: #fbbf24; }
.auth-card[data-mode="forgot"] .auth-tabs { display: none; }
.auth-form { display: grid; gap: 0.5rem; }
.auth-form label { margin-top: 0.5rem; color: #cbd5e1; font-size: 0.9rem; font-weight: 600; }
.auth-form input, .auth-form select, .auth-form textarea { width: 100%; border: 1px solid #35445c; border-radius: 0.375rem; background: #101a2d; color: #f8fafc; padding: 0.6rem 0.75rem; font: inherit; font-size: 1rem; }
.auth-form textarea { min-height: 8rem; resize: vertical; }
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus { outline: 2px solid #fbbf24; outline-offset: 1px; }
.auth-form .home-cta { margin-top: 1rem; justify-self: start; border: 0; cursor: pointer; }
.auth-optional { color: #91a4bf; font-weight: 400; }
.auth-form .auth-show-password { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }
.auth-form .auth-show-password input { width: auto; accent-color: #fbbf24; }
.auth-form .auth-agree { display: flex; align-items: flex-start; gap: 0.5rem; font-weight: 400; cursor: pointer; }
.auth-form .auth-agree input { width: auto; margin-top: 0.2rem; accent-color: #fbbf24; }
.auth-agree a, .auth-terms-note a { color: #fbbf24; text-decoration: underline; }
.auth-terms-note { color: #91a4bf; font-size: 0.9rem; }
.auth-rules { margin: 0.25rem 0 0; padding-left: 1.1rem; color: #91a4bf; font-size: 0.85rem; display: grid; gap: 0.15rem; }
.auth-link { justify-self: start; background: none; border: 0; padding: 0; color: #fbbf24; font-size: 0.9rem; cursor: pointer; text-decoration: underline; }
.auth-error { color: #fca5a5; }
.auth-message { color: #6ee7b7; }
.auth-page-message { font-size: 1.05rem; color: #f8fafc; }
.auth-logo { height: 1.5rem; width: auto; }
.auth-details { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; margin: 0; }
.auth-details dt { color: #91a4bf; }
.auth-details dd { margin: 0; color: #f8fafc; overflow-wrap: anywhere; }
.site-menu button[data-sign-out] { padding: 0.5rem 0.75rem; border: 0; border-radius: 0.375rem; background: none; color: #cbd5e1; text-align: left; font: inherit; cursor: pointer; }
.site-menu button[data-sign-out]:hover { background: #26364d; color: #fbbf24; }

/* Organization: people, invites and the menu switcher */
.auth-stack { gap: 1.5rem; }
.auth-stack .auth-card { max-width: 36rem; }
.auth-card h2 { font-size: 1.3rem; }
.auth-card h3 { font-size: 1rem; color: #cbd5e1; }
.auth-org-name { font-size: 1.05rem; color: #f8fafc; }
.auth-inline { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.auth-inline input { flex: 1 1 14rem; min-width: 0; }
.auth-form .auth-inline .home-cta { margin-top: 0; }
.auth-hint { color: #91a4bf; font-size: 0.85rem; }
/* Features above the organization's plan: a note at the bottom of the feature's box. */
.plan-lock-note, .auth-hint.plan-lock-note { color: #fcd34d; font-weight: 600; }
.auth-people { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.auth-people li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid #35445c; border-radius: 0.5rem; background: #101a2d; }
.auth-person { display: grid; flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; color: #cbd5e1; font-size: 0.9rem; }
.auth-person b { color: #f8fafc; }
.auth-role { color: #fbbf24; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.auth-person-actions { display: flex; gap: 0.75rem; }
.auth-confirm { display: grid; gap: 0.75rem; padding: 1rem; border: 1px solid #b45309; border-radius: 0.5rem; background: #2a2113; color: #f8fafc; }
.auth-confirm[hidden] { display: none; }
.site-menu-organizations { display: grid; gap: 0.25rem; padding-bottom: 0.5rem; margin-bottom: 0.25rem; border-bottom: 1px solid #35445c; }
.site-menu-label { padding: 0 0.75rem; color: #91a4bf; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.site-menu-current { padding: 0 0.75rem; color: #f8fafc; font-weight: 700; }
.site-menu button[data-switch-organization] { padding: 0.5rem 0.75rem; border: 0; border-radius: 0.375rem; background: none; color: #cbd5e1; text-align: left; font: inherit; cursor: pointer; }
.site-menu button[data-switch-organization]:hover { background: #26364d; color: #fbbf24; }

/* Sign in with Google, Apple or Facebook */
.auth-providers { display: grid; gap: 0.6rem; }
.auth-provider { display: flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 2.75rem; padding: 0.6rem 1rem; border: 1px solid #35445c; border-radius: 0.375rem; background: #f8fafc; color: #101a2d; font-weight: 600; text-decoration: none; }
.auth-provider:hover { background: #e2e8f0; }
.auth-provider:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.auth-provider svg { width: 1.25rem; height: 1.25rem; flex: none; }
.auth-or { display: flex; align-items: center; gap: 0.75rem; margin: 0; color: #91a4bf; font-size: 0.85rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid #35445c; }
.auth-card[data-mode="forgot"] .auth-providers, .auth-card[data-mode="forgot"] .auth-or { display: none; }

/* Deleting an account */
.auth-danger-link { color: #fca5a5; }
.auth-danger { border-color: #b91c1c; background: #2a1517; }
.auth-danger-cta { background: #b91c1c; }
.auth-danger-cta:disabled { opacity: 0.5; cursor: not-allowed; }
.home-notice { margin-block: 1.5rem 0; padding: 0.75rem 1rem; border: 1px solid #35445c; border-radius: 0.5rem; background: #1d2a3d; color: #6ee7b7; }

/* Privacy policy */
.privacy-policy { gap: 2.5rem; }
.privacy-updated { color: #91a4bf; font-size: 0.9rem; }
.privacy-section { gap: 0.75rem; max-width: 46em; color: #cbd5e1; }
.privacy-section h3 { margin-top: 0.5rem; font-size: 1.05rem; color: #f8fafc; }
.privacy-section ul, .privacy-section ol { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.privacy-section ul { list-style: disc; }
.privacy-section ol { list-style: decimal; }
.privacy-section a { color: #fbbf24; }
.privacy-section b { color: #f8fafc; }

/* Site admin: the site owner's page for organizations and accounts. */
.site-admin { display: grid; gap: 1.5rem; padding-block: 2.5rem 4rem; }
.site-admin-intro { display: grid; gap: 0.5rem; }
.site-admin-intro h1 { font-size: 1.8rem; }
.site-admin-card { max-width: none; }
.site-admin-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.site-admin-search, .site-admin-controls input, .site-admin-controls select { min-width: 0; border: 1px solid #35445c; border-radius: 0.375rem; background: #101a2d; color: #f8fafc; padding: 0.5rem 0.75rem; font-size: 0.95rem; }
.site-admin-search { flex: 1 1 16rem; max-width: 24rem; }
.site-admin-list { display: grid; gap: 1rem; }
.site-admin-item { display: grid; gap: 0.75rem; min-width: 0; padding: 1rem; border: 1px solid #35445c; border-radius: 0.5rem; background: #17233a; }
.site-admin-item h3 { font-size: 1.1rem; color: #f8fafc; overflow-wrap: anywhere; }
.site-admin-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.site-admin-controls label { display: grid; gap: 0.25rem; color: #cbd5e1; font-size: 0.85rem; font-weight: 600; min-width: 0; }
.site-admin-controls .home-cta { cursor: pointer; }
.site-admin-danger { color: #fca5a5; border-color: #7f1d1d; }
.site-admin-danger-solid { background: #991b1b; border: 0; color: #fff; }
.site-admin-message { color: #6ee7b7; font-weight: 600; }
.site-admin-message-error { color: #fca5a5; }
.site-admin-log { display: grid; gap: 0.5rem; margin: 0; padding-left: 1.25rem; color: #cbd5e1; }
.site-admin-billing { display: grid; gap: 0.75rem; min-width: 0; padding-top: 0.75rem; border-top: 1px solid #35445c; }
.site-admin-billing h4 { font-size: 0.95rem; color: #f8fafc; }
.site-admin-billing [hidden] { display: none !important; }
.site-admin-billing p { overflow-wrap: anywhere; }
.site-admin-refund { display: grid; gap: 0.5rem; padding: 0.75rem; border: 1px solid #7f1d1d; border-radius: 0.5rem; }
.site-admin-controls input[type="date"] { color-scheme: dark; }

/* Filing period: a badge for whether submissions are open, with its button, and a closing time box. */
#filingPeriod [hidden] { display: none !important; }
.filing-badge { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; border-radius: 9999px; padding: 0.375rem 0.875rem; font-size: 0.8125rem; font-weight: 700; background: #14532d; color: #bbf7d0; }
.filing-badge-dot { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #4ade80; }
.filing-badge[data-state="scheduled"] { background: #78350f; color: #fde68a; }
.filing-badge[data-state="scheduled"] .filing-badge-dot { background: #fbbf24; }
.filing-badge[data-state="closed"] { background: #4c1d1d; color: #fecaca; }
.filing-badge[data-state="closed"] .filing-badge-dot { background: #f87171; }
.filing-button { flex: none; border-radius: 0.5rem; border: 1px solid transparent; padding: 0.5rem 1rem; font-size: 0.8125rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.filing-button:disabled { cursor: not-allowed; opacity: 0.5; }
.filing-button-close { border-color: #f87171; color: #fca5a5; background: transparent; }
.filing-button-close:hover:not(:disabled) { background: rgba(248, 113, 113, 0.12); }
.filing-button-reopen { border-color: #4ade80; color: #86efac; background: transparent; }
.filing-button-reopen:hover:not(:disabled) { background: rgba(74, 222, 128, 0.12); }
.filing-button-cancel { border-color: #35445c; color: #cbd5e1; background: #17233a; }
.filing-button-save { flex: 1 1 auto; background: #b45309; color: #fff; }
.filing-button-save:hover:not(:disabled) { background: #d97706; }
@media (min-width: 640px) { .filing-button-save { flex: none; } }
.filing-links { display: flex; align-items: center; gap: 0.75rem; color: #91a4bf; }
.filing-link { border: 0; background: none; padding: 0; color: #fbbf24; font-size: 0.875rem; font-weight: 700; cursor: pointer; }
.filing-link:hover:not(:disabled) { text-decoration: underline; }
.filing-link:disabled { cursor: not-allowed; opacity: 0.5; }

/* Fit your new plan: the owner chooses what to keep after moving to a smaller plan. */
.plan-fit { display: grid; gap: 1.5rem; padding-block: 2.5rem 4rem; }
.plan-fit-list { display: grid; gap: 0.5rem; }
.plan-fit-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; min-width: 0; padding: 0.75rem 1rem; border: 1px solid #35445c; border-radius: 0.5rem; background: #17233a; color: #f8fafc; cursor: pointer; }
.plan-fit-choice span { overflow-wrap: anywhere; }
.plan-fit-choice input { width: 1.1rem; height: 1.1rem; accent-color: #d97706; }
.plan-fit-choice input:disabled { cursor: not-allowed; }
.plan-fit .home-cta:disabled { cursor: not-allowed; opacity: 0.5; }

/* Billing: the plans table and Stripe checkout. */
.billing { display: grid; gap: 1.5rem; padding-block: 2.5rem 4rem; }
.billing-table-wrap { overflow-x: auto; }
.billing-table { width: 100%; border-collapse: collapse; min-width: 32rem; }
.billing-table th, .billing-table td { padding: 0.75rem; border-bottom: 1px solid #35445c; text-align: left; vertical-align: middle; color: #f8fafc; }
.billing-table thead th { color: #cbd5e1; font-size: 0.85rem; }
.billing-table .home-cta { white-space: nowrap; cursor: pointer; }
.billing-current { color: #6ee7b7; font-weight: 700; white-space: nowrap; }
.billing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

/* Home page screenshots: real screens from the app, made by `npm run screenshots` in e2e-tests. */
.home-phone { justify-self: center; max-width: 20rem; margin: 0; }
.home-phone img { display: block; width: 100%; height: auto; border: 8px solid #2a3850; border-radius: 2rem; box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45); }
.home-shot { display: block; width: 100%; height: auto; border: 1px solid #35445c; border-radius: 0.5rem; }
.home-spotlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.home-spotlight { display: grid; gap: 0.75rem; margin: 0; }
.home-spotlight figcaption { display: grid; gap: 0.4rem; }
.home-spotlight h3 { font-size: 1rem; }
.home-spotlight p { font-size: 0.92rem; }
@media (max-width: 900px) { .home-spotlights { grid-template-columns: 1fr; } }
.home-zoom { display: block; border-radius: 0.5rem; cursor: zoom-in; }
.home-zoom:focus-visible { outline: 2px solid #fbbf24; outline-offset: 3px; }
.home-zoom:hover .home-shot { border-color: #fbbf24; }
/* The style reset removes a dialog's automatic margin, which is what centres it on screen. */
.home-lightbox { margin: auto; max-width: min(94vw, 1400px); max-height: 90vh; padding: 0; border: 1px solid #35445c; border-radius: 0.75rem; background: #101a2d; overflow: visible; }
.home-lightbox::backdrop { background: rgba(5, 10, 20, 0.85); }
.home-lightbox img { display: block; max-width: 100%; max-height: 88vh; width: auto; height: auto; border-radius: 0.75rem; }
.home-lightbox-close { position: absolute; top: 0.6rem; right: 0.6rem; width: 2.25rem; height: 2.25rem; border: 1px solid #35445c; border-radius: 50%; background: #1d2a3d; color: #f8fafc; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.home-lightbox-close:hover, .home-lightbox-close:focus-visible { border-color: #fbbf24; color: #fbbf24; }

/* --- Plan picker (sign-up and starting an organization) --- */
.plan-page { display: grid; gap: 1.5rem; }
.plan-picker { display: grid; gap: 1.25rem; }
.plan-switch { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; justify-self: start; padding: 0.25rem; border: 1px solid #35445c; border-radius: 999px; background: #1d2a3d; }
.plan-switch label { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem; border-radius: 999px; color: #cbd5e1; cursor: pointer; }
.plan-switch label:has(input:checked) { background: #26364d; color: #f8fafc; }
.plan-switch input { accent-color: #fbbf24; }
.plan-save { color: #6ee7b7; font-size: 0.8rem; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: 1rem; }
/* Each card shares five rows (name, price, details, button, one-election link) with the cards beside it, so the
   prices and buttons line up even when one card has more to say. */
.plan-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0.75rem; align-content: start; min-width: 0; padding: 1.25rem; border: 1px solid #35445c; border-radius: 0.75rem; background: #1d2a3d; color: #cbd5e1; }
.plan-card h2 { margin: 0; color: #f8fafc; font-size: 1.15rem; }
.plan-card .home-cta { justify-self: stretch; align-self: start; text-align: center; white-space: normal; cursor: pointer; }
.plan-card-chosen { border-color: #fbbf24; box-shadow: 0 0 0 1px #fbbf24; }
.plan-price { margin: 0; color: #fbbf24; font-size: 1.35rem; font-weight: 700; }
.plan-features { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; font-size: 0.9rem; }
.auth-chosen-plan { margin: 0; padding: 0.6rem 0.8rem; border: 1px solid #35445c; border-radius: 0.5rem; color: #f8fafc; }

/* The contact form's spam trap: out of sight and out of the tab order, so only bots fill it in. */
.contact-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.billing-table .billing-unavailable, .billing-table .billing-unavailable:hover { opacity: 0.45; cursor: not-allowed; background: none; color: #cbd5e1; }
.billing-enterprise .home-cta { margin-right: 0.5rem; }
/* The two size questions someone asking for Enterprise answers: on sign-up, on a new organization and on Billing. */
.enterprise-size { display: grid; gap: 0.5rem; }
.billing-enterprise-form { margin-top: 0.75rem; max-width: 24rem; text-align: left; }
