/* Supervisor No. 12 — plain, typographic, one thing at a time. */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #5c5c5c;
  --faint: #8a8a8a;
  --rule: #dcdcdc;
  --link: #1a3fc4;
  --press: #f2f2f2;
  --font: "Times New Roman", Times, "Liberation Serif", "Noto Serif", Georgia, serif;
  --bar-h: 76px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --fg: #ededed;
    --muted: #a6a6a6;
    --faint: #7a7a7a;
    --rule: #333333;
    --link: #93b2ff;
    --press: #1d1d1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111111; --fg: #ededed; --muted: #a6a6a6; --faint: #7a7a7a; --rule: #333333; --link: #93b2ff; --press: #1d1d1d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--link); text-underline-offset: 2px; }
p { margin: 0 0 0.75em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.25rem 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Header: just the name and one link. */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: baseline;
  max-width: 40rem; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 20px 10px;
  background: var(--bg);
  font-size: 17px;
}
.mark { color: var(--fg); text-decoration: none; letter-spacing: 0.01em; }
.toplink { font-size: 16px; }

main {
  max-width: 40rem; margin: 0 auto;
  padding: 8px 20px calc(var(--bar-h) + 40px + env(safe-area-inset-bottom));
  outline: none;
  min-height: calc(100dvh - 60px);
}
.screen { animation: enter 0.18s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

/* Type */
.kicker { font-size: 16px; color: var(--muted); margin: 6px 0 14px; display: flex; justify-content: space-between; gap: 12px; }
.kicker .count { color: var(--faint); white-space: nowrap; }
h1, .q {
  font-weight: normal;
  font-size: clamp(29px, 7.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 18px;
  text-wrap: balance;
}
h2 { font-weight: normal; font-size: 24px; line-height: 1.25; margin: 0 0 14px; }
.lede { font-size: 21px; margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.big { font-size: clamp(40px, 11vw, 56px); line-height: 1.05; margin: 0 0 18px; font-weight: normal; }
.fine { font-size: 15px; color: var(--muted); }
ul.plain { list-style: none; padding: 0; margin: 0 0 18px; }
ul.facts { padding-left: 1.1em; margin: 0 0 18px; }
ul.facts li { margin-bottom: 0.45em; }
.meta { font-size: 17px; color: var(--muted); }
.meta p { margin-bottom: 0.4em; }
.officialtext { white-space: pre-wrap; font-size: 17px; line-height: 1.5; border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 14px; }

/* Links that act like buttons */
.textlink {
  appearance: none; background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.back { font-size: 16px; display: inline-block; margin: 4px 0 10px; }
.deeper { display: inline-block; margin-top: 6px; }

/* Buttons: square, bordered, typographic. */
.btn {
  appearance: none; display: block; width: 100%;
  font: inherit; font-size: 20px; line-height: 1;
  min-height: 52px; padding: 15px 16px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--fg); border-radius: 0;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.btn:active { background: var(--press); }
.btn.primary { background: var(--fg); color: var(--bg); }
.btn.primary:active { opacity: 0.85; }
.btn.chosen { background: var(--fg); color: var(--bg); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn + .btn { margin-top: 10px; }
.stack { display: grid; gap: 10px; margin: 8px 0 16px; }
.stack .btn + .btn { margin-top: 0; }

/* The fixed action bar at the bottom of the screen. */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--bg);
  border-top: 1px solid var(--rule);
  padding: 12px 20px calc(10px + env(safe-area-inset-bottom));
}
.bar-inner { max-width: 40rem; margin: 0 auto; }
.bar .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bar .pair .btn + .btn { margin-top: 0; }
.bar .under { text-align: center; font-size: 16px; margin-top: 8px; min-height: 20px; }
.bar .under .textlink { color: var(--muted); }

/* Lists of choices (districts, record) */
.choices { list-style: none; padding: 0; margin: 0 0 18px; border-top: 1px solid var(--rule); }
.choices li { border-bottom: 1px solid var(--rule); }
.choice {
  appearance: none; display: block; width: 100%; text-align: left;
  background: none; border: 0; padding: 13px 0; margin: 0;
  font: inherit; color: var(--fg); cursor: pointer;
}
.choice:active { background: var(--press); }
.choice .sub { display: block; font-size: 16px; color: var(--muted); margin-top: 2px; }
.choice.selected { font-style: italic; }
.choice .mine { float: right; font-size: 16px; color: var(--muted); }

/* Result */
.result p.line { font-size: 20px; }
.tally { font-size: 16px; color: var(--muted); margin-top: 4px; }
.rollcall { columns: 2; column-gap: 24px; font-size: 18px; margin: 0 0 18px; padding: 0; list-style: none; }
.rollcall li { break-inside: avoid; padding: 3px 0; }
.rollcall .v { color: var(--muted); }
.rollcall .you { font-style: italic; }

/* Agreement table on the record page */
.align { width: 100%; border-collapse: collapse; font-size: 18px; margin-bottom: 18px; font-variant-numeric: tabular-nums; }
.align td { padding: 7px 0; border-bottom: 1px solid var(--rule); }
.align td.n { text-align: right; color: var(--muted); }
.align tr.top td:first-child { font-style: italic; }

/* iOS install steps */
ol.steps { padding-left: 1.2em; margin: 0 0 18px; }
ol.steps li { margin-bottom: 0.6em; }
.shareglyph { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--fg); color: var(--bg); font-size: 16px; padding: 8px 14px; z-index: 10;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: calc(100vw - 40px); text-align: center;
}
#toast.show { opacity: 1; }

.loading { color: var(--muted); padding-top: 24px; }
.spacer { height: 8px; }

@media (min-width: 700px) {
  body { font-size: 21px; }
  main { padding-top: 28px; }
}
