/* Mobile-first: base rules target a phone viewport; wider layouts are the
   exception, not the default (docs/ARCHITECTURE.md §2.1, §10). */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #0f1115;
  color: #f2f2f2;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* --- Progress bar --- */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #2a2d35;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: #5b8def;
  transition: width 200ms ease;
}

/* --- Card stack --- */
.card {
  background: #1b1e26;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.card__text {
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 0;
}
.card__detail {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #c7cad1;
  margin: 0;
  border-top: 1px solid #2a2d35;
  padding-top: 12px;
}
.card__expand {
  align-self: flex-start;
  background: none;
  border: none;
  color: #5b8def;
  font-size: 0.9rem;
  padding: 4px 0;
}
.card__scale {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.card__scale-btn {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #2a2d35;
  background: #262a33;
  color: #f2f2f2;
  font-size: 1rem;
  min-height: 48px; /* touch target */
  min-width: 0; /* grid items default to a content-based min-width, which
    overflows the card at the 5-column breakpoint below without this — see
    memory.md */
  width: 100%;
  white-space: normal;
}
.card__scale-btn:active {
  background: #5b8def;
}

/* --- Intro --- */
.screen--intro {
  justify-content: center;
  text-align: center;
  gap: 20px;
}
.intro__heading {
  font-size: 1.6rem;
  margin: 0;
}
.intro__body {
  font-size: 1rem;
  line-height: 1.5;
  color: #c7cad1;
  margin: 0;
}
.intro__start {
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: #5b8def;
  color: #0f1115;
  font-weight: 600;
  font-size: 1rem;
  min-height: 48px;
}

/* --- Demographics --- */
.demographics__notice {
  font-size: 0.85rem;
  color: #b7bcc7;
  border-left: 3px solid #5b8def;
  padding-left: 10px;
  margin: 0;
}
.demographics__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.demographics__field select {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #2a2d35;
  background: #1b1e26;
  color: #f2f2f2;
  font-size: 1rem;
  min-height: 44px;
}
.demographics__error {
  font-size: 0.85rem;
  color: #f2f2f2;
  border-left: 3px solid #e0575b;
  padding-left: 10px;
  margin: 0;
}
.demographics__turnstile {
  display: flex;
  justify-content: center;
}
.demographics__continue {
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: #5b8def;
  color: #0f1115;
  font-weight: 600;
  font-size: 1rem;
  min-height: 48px;
}

/* --- Reveal --- */
.reveal__summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reveal__headline {
  font-size: 1.1rem;
  margin: 0;
}
.reveal__section-heading {
  font-size: 1rem;
  margin: 0;
  color: #c7cad1;
}
.reveal__president-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reveal__president-row {
  background: #1b1e26;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
}
.reveal__president-row--voted {
  border-color: #5b8def;
}
.reveal__president-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin: 0;
}
.reveal__voted-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: #0f1115;
  background: #5b8def;
  border-radius: 999px;
  padding: 2px 8px;
}
.reveal__president-user {
  margin: 4px 0 0;
  font-size: 0.95rem;
}
.reveal__president-crowd {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #b7bcc7;
}
.reveal__details-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  color: #5b8def;
  font-size: 0.9rem;
  padding: 4px 0;
}
.reveal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reveal__list[hidden] {
  display: none; /* [hidden]'s default display:none loses to the class rule
    above at equal specificity — restore it explicitly. */
}
.reveal__item {
  background: #1b1e26;
  border-radius: 12px;
  padding: 14px;
}

@media (min-width: 640px) {
  .card__scale {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .card__scale-btn {
    padding: 14px 6px;
    font-size: 0.9rem;
  }
}

/* --- Compare (Phase 4) --- */
#compare-app {
  min-height: 100vh;
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.compare__notice {
  font-size: 0.85rem;
  color: #b7bcc7;
  border-left: 3px solid #5b8def;
  padding-left: 10px;
}
.compare__crosstab,
.compare__axis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.compare__crosstab th,
.compare__crosstab td,
.compare__axis-table th,
.compare__axis-table td {
  border: 1px solid #2a2d35;
  padding: 8px 6px;
  text-align: right;
}
.compare__crosstab th:first-child,
.compare__crosstab td:first-child,
.compare__axis-table th:first-child,
.compare__axis-table td:first-child {
  text-align: left;
}
.compare__n {
  font-weight: 600;
}
.compare__axes,
.compare__cross-party {
  overflow-x: auto;
}
.compare__context {
  font-size: 0.8rem;
  color: #8b909c;
}

a {
  color: #5b8def;
}

/* --- Footer nav (Phase 6) --- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  max-width: 720px;
  margin: 24px auto 16px;
  padding: 16px;
  border-top: 1px solid #2a2d35;
  font-size: 0.85rem;
}
.site-footer a {
  color: #b7bcc7;
  text-decoration: none;
}
.site-footer a:hover {
  color: #5b8def;
}

/* --- Doc pages: methodology, privacy (Phase 6) --- */
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 0;
  line-height: 1.6;
}
.doc h1 {
  font-size: 1.6rem;
  margin-bottom: 0.2em;
}
.doc h2 {
  font-size: 1.15rem;
  margin-top: 2em;
  border-top: 1px solid #2a2d35;
  padding-top: 1em;
}
.doc p, .doc li {
  color: #d6d9e0;
}
.doc strong {
  color: #f2f2f2;
}
