:root {
  --ink: #111111;
  --paper: #ffffff;
  --grey: #6b6b6b;
  --grey-light: #a8a8a8;
  --rule: #d8d8d8;
  --red: #e3120b;
  --pink: #e6007e; /* placeholder copy only — unsigned strings ship pink (STYLE.md) */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Times New Roman", Times, serif;
  --pad: clamp(1rem, 3vw, 2rem);
  --measure: clamp(40em, 62vw, 46em);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.9375rem + 0.3vw, 1.1875rem);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover { text-decoration-thickness: 2px; }

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

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5em 1.5em;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.8em var(--pad);
  border-bottom: 2px solid var(--red);
}

.wordmark {
  font-size: 0.875em;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--grey-light);
}

.wordmark b {
  font-weight: 700;
  color: var(--ink);
}

.wordmark:hover { text-decoration: underline; }

.nav {
  list-style: none;
  display: flex;
  gap: 1.6em;
  margin: 0;
  padding: 0;
  font-size: 0.8125em;
  letter-spacing: 0.02em;
}

.nav a,
.footer-nav a,
.footer-secondary a,
.wordmark {
  padding: 0.8rem 0.5rem;
  margin: -0.8rem -0.5rem;
}

.nav a {
  color: var(--grey);
  text-decoration: none;
}

.nav a:hover { text-decoration: underline; }
.nav [aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; }
.nav-placeholder { color: #a3a3a3; }

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.2em var(--pad) 4em;
}

h1 {
  font-weight: 400;
  font-size: 1.55em;
  line-height: 1.28;
  margin: 0 0 0.7em;
}

.prompt {
  margin: 0 0 2em;
  color: var(--grey);
}

.ballot {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  max-width: 24em;
  margin: 0 0 1.3em;
}

.vote {
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.7em 0.9em;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.vote:hover {
  border-color: var(--red);
  box-shadow: inset 0.35em 0 0 var(--red);
}

.letter {
  font-weight: 700;
  color: var(--red);
}

.vote .letter { margin-right: 0.5em; }

.kicker {
  font-weight: 700;
  color: var(--red);
}

.note {
  font-size: 0.875em;
  color: var(--grey);
  border-left: 2px solid var(--red);
  padding-left: 0.8em;
}

/* A note owns its air above and below, so every note sits the same distance
   from what precedes it. */
.note, .prose .note { margin: 1.5em 0 1.6em; }

.terms {
  font-size: 0.8125em;
  color: var(--grey);
  margin: 0;
  padding: 1.4em 0 0 1.1em;
  border-top: 1px solid var(--rule);
}

.terms li { margin: 0 0 0.35em; }
.terms li::marker { color: var(--grey-light); }

.prose h1 {
  font-size: 2.1em;
  line-height: 1.15;
  margin: 0 0 0.9em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--rule);
}

.prose h2 {
  font-weight: 700;
  font-size: 1.2em;
  line-height: 1.3;
  margin: 2.4em 0 0.8em;
}

.prose h1 + section h2 { margin-top: 0; }

.prose p { margin: 0 0 1.05em; }
.prose ul { padding-left: 1.1em; }

.prose .chain {
  list-style: none;
  margin: 1.6em 0 2em;
  padding: 0;
}

.chain li {
  position: relative;
  margin: 0 0 0.5em;
  padding-left: 1.7em;
}

.chain li::before {
  content: "->";
  position: absolute;
  left: 0;
  color: var(--grey);
}

.reflist {
  font-size: 0.9375em;
  margin: 0;
  padding-left: 1.6em;
}

.reflist li {
  margin: 0 0 0.8em;
  line-height: 1.45;
  padding-left: 0.2em;
}

.reflist a {
  word-break: break-word;
  color: var(--grey);
  text-decoration-color: var(--rule);
}

cite { font-style: italic; }
sup { font-size: 0.6em; }

.limit {
  display: block;
  font-size: 0.85em;
  color: var(--grey);
  margin-top: 0.15em;
}

.site-footer {
  flex: none;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.1em var(--pad) 2.4em;
  border-top: 1px solid var(--rule);
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 1.5em;
  margin: 0;
  padding: 0;
  font-size: 0.8125em;
  letter-spacing: 0.02em;
}

.footer-nav a {
  color: var(--grey);
  text-decoration: none;
}

.footer-nav a:hover { text-decoration: underline; }
.footer-nav [aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; }

.footer-tier {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6em 1.5em;
  margin: 1.4em 0 0;
  font-size: 0.75em;
  letter-spacing: 0.02em;
}

.footer-secondary {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 1.5em;
  margin: 0;
  padding: 0;
}

.footer-secondary a { color: var(--grey-light); text-decoration: none; }
.footer-secondary a:hover { text-decoration: underline; }
.footer-secondary [aria-current="page"] { color: var(--grey); text-decoration: underline; text-underline-offset: 0.25em; }

.colophon {
  margin: 0;
  color: var(--grey-light);
}

/* The divider says "this is not a link" — only when the two share a row. */
@media (min-width: 34rem) {
  .colophon { padding-left: 1.5em; border-left: 1px solid var(--rule); }
}

.placeholder { color: var(--pink) !important; }

.vote:disabled {
  color: var(--grey);
  border-color: var(--rule);
  cursor: default;
  box-shadow: none;
}
.vote:disabled .letter { color: var(--grey); }

.headline {
  font-size: 1.35em;
  line-height: 1.28;
  margin: 0 0 1em;
}
.headline .figure { font-weight: 700; font-size: 2.1em; margin-right: 0.15em; }
.move { display: block; font-size: 0.75em; color: var(--grey); margin-top: 0.3em; }
.move .arrow { font-size: 0.8em; color: var(--grey); }

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8em 1.2em;
  margin: 1.8em 0 0.5em;
  font-size: 0.8125em;
}
.control-group { align-items: center; }
.chips button:disabled,
.chips button[aria-disabled="true"] {
  color: var(--grey-light);
  cursor: default;
}
.control-group { display: inline-flex; align-items: baseline; gap: 0.5em; }
.controls label { color: var(--grey); }

.select { position: relative; display: inline-block; }
.select select {
  font: inherit;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.25em 1.7em 0.25em 0.6em;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select::after {
  content: "";
  position: absolute;
  right: 0.6em;
  top: 50%;
  margin-top: -0.1em;
  border-left: 0.28em solid transparent;
  border-right: 0.28em solid transparent;
  border-top: 0.34em solid var(--ink);
  pointer-events: none;
}
.ext::after {
  content: "\2197";
  display: inline-block;
  font-size: 0.75em;
  margin-left: 0.15em;
  vertical-align: 0.15em;
}

.key { font-weight: 700; }
.key-1 { color: var(--red); }
.key-2 { color: var(--grey-light); }
.chips { display: inline-flex; border: 1px solid var(--ink); }
.chips button {
  font: inherit;
  line-height: 1.4;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-right: 1px solid var(--ink);
  padding: 0.25em 0.8em;
  cursor: pointer;
}
.chips button:last-child { border-right: 0; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.chart-frame { margin: 0 0 0.6em; }
.pole {
  display: block;
  font-size: 0.75em;
  letter-spacing: 0.02em;
  color: var(--grey);
}
.pole-b { margin-bottom: 0.2em; }
.pole-a { margin-top: 0.2em; }

.tracker-foot {
  margin-top: 2em;
  padding-top: 1.2em;
  border-top: 1px solid var(--rule);
}
.chart-meta {
  font-size: 0.8125em;
  color: var(--grey);
  margin: 0 0 0.5em;
}

.u-legend { font: inherit; font-size: 0.75em; color: var(--grey); }

.download {
  font-size: 0.8125em;
  color: var(--grey);
  margin: 0;
}

.firms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  margin: 1.6em 0 2em;
}
/* Rows shared across the pair, so the calc rules and the figures line up
   whatever line count the text wraps to. */
.firm {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 5;
  align-content: start;
  border: 1px solid var(--ink);
  padding: 0.9em 1em 1em 1.25em;
}
.firm h3 { font-size: 1em; font-weight: 700; margin: 0 0 0.4em; }
.firm p { font-size: 0.875em; color: var(--grey); margin: 0 0 0.9em; }
.firm .calc { font-size: 0.75em; color: var(--grey); border-top: 1px solid var(--rule); padding-top: 0.7em; }
.firm .figure { font-weight: 700; font-size: 1.9em; line-height: 1.1; }
.firm .figure-sub { display: block; font-size: 0.75em; color: var(--grey); margin-top: 0.15em; }
.firm-more { box-shadow: inset 0.35em 0 0 var(--ink); }
.firm-same { box-shadow: inset 0.35em 0 0 var(--grey-light); }

.inputs { margin: 0 0 2em; }
/* One source of truth for track width: rem, so the range input's own
   smaller UA font can't resolve the same `em` to a different number. */
.field { margin: 0 0 1.1em; --track: 24rem; }
.field label { display: block; font-size: 0.875em; margin-bottom: 0.15em; }
.field output { font-weight: 700; }
.field .hint { display: block; font-size: 0.8125em; color: var(--grey); margin-top: 0.1em; }
.field input[type="range"] {
  width: 100%;
  max-width: var(--track);
  accent-color: var(--ink);
  margin: 0.3em 0 0;
}

/* .prose p sets the margins; match its specificity. */
.prose .verdict { line-height: 1.55; margin: 2.2em 0 0.3em; }
.chart-notes { font-size: 0.8125em; color: var(--grey); margin: 0.8em 0 1.6em; padding-left: 1.1em; }
.chart-notes li { margin: 0 0 0.35em; }
.chart-notes li::marker { color: var(--grey-light); }
.workings h3 { font-size: 1em; font-weight: 700; margin: 0 0 0.4em; }
.workings h4 { font-size: 0.9375em; font-weight: 700; margin: 1.8em 0 0.3em; }
.workings h3 + h4 { margin-top: 0.7em; }
.workings .chart-notes { font-size: 0.9375em; color: var(--ink); list-style: none; margin: 0 0 1.2em; padding: 0; }
.workings .chart-notes li { margin: 0 0 0.45em; }
.loop-field { margin: 1.4em 0 0.4em; }
.loop-slider { max-width: var(--track); }
.loop-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.75em;
  color: var(--grey-light);
  margin-top: 0.05em;
}
.verdict .figure { font-weight: 700; }

@media (max-width: 34rem) {
  .firms { grid-template-columns: 1fr; }
}

@media (max-width: 30rem) {
  .ballot { max-width: none; }
  .masthead { padding-block: 0.7em; }
}

.share {
  position: static; margin: 1.5em 0 0;
  padding: 1.1em 1.4em 1.2em;
  border: 1px solid var(--rule); background: var(--paper);
  font-size: 0.9375em; color: var(--grey);
  z-index: 1;
}
.share ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6em 1.7em; }
.share a, .share button { font: inherit; color: var(--grey); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; text-decoration-color: var(--rule); }
.share a:hover, .share button:hover { text-decoration-thickness: 2px; }
.share .icon { width: 0.8em; height: 0.8em; vertical-align: -0.02em; margin-left: 0.25em; fill: none; stroke: currentColor; stroke-width: 1.5; }
.share .close { color: var(--grey-light); text-decoration: none; margin-left: 0.6em; }
.share:focus, .share:focus-visible { outline: none; }
