/*
 * Design tokens ported from the Abundant America editorial system, so this
 * reads as part of the same body of work rather than a separate product.
 */

:root {
  --bg: #f4f0e6;
  --bg-card: #faf6ec;
  --bg-card-2: #ede7d6;
  --ink: #1a1a1a;
  --ink-soft: #5a5a52;
  --ink-faint: #8a8275;
  --rule: #d4ccb8;
  --rule-soft: #e2dcc8;

  --econ: #2d5b3d;
  --econ-soft: #b7cdb8;
  --econ-tint: #d8e4d3;
  --civic: #1f3a5f;
  --civic-soft: #b5c2d4;
  --civic-tint: #d3dbe5;
  --social: #b85c38;
  --social-soft: #e0bba6;
  --social-tint: #ecd5c4;
  --none: #8a8275;
  --none-tint: #d8d1bc;

  /* Reserved for the finding that runs against the project, and for the
     modified-assumption state. Deliberately distinct from the category hues. */
  --warn: #8a5a00;
  --warn-tint: #f0e2c0;

  --max: 1180px;
  --col: 62ch;

  --s1: 8px;
  --s2: 14px;
  --s3: 22px;
  --s4: 34px;
  --s5: 54px;
  --s6: 88px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 56px);
}

/* ---------------------------------------------------------------- type */

.display {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-size: clamp(38px, 7vw, 76px);
}

h2.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 72;
  font-weight: 600;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 36;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
}

.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.lede {
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: var(--col);
}

.prose {
  max-width: var(--col);
  color: var(--ink-soft);
  font-size: 16px;
}

.prose + .prose {
  margin-top: var(--s2);
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

a:hover {
  text-decoration-color: currentColor;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--civic);
  outline-offset: 2px;
  border-radius: 2px;
}
/* ---------------------------------------------------------------- chrome */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: var(--s3) 0 var(--s3);
}

.site-header .brand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s3);
  flex-wrap: wrap;
}

.hero {
  padding: var(--s5) 0 var(--s4);
}

.hero .display {
  margin-bottom: var(--s3);
}

.hero .lede {
  margin-bottom: var(--s3);
}

.premise {
  border-left: 3px solid var(--ink);
  padding-left: var(--s3);
  max-width: var(--col);
  font-size: 17px;
  margin-top: var(--s3);
}

/* ---------------------------------------------------- data-version banner */

.version-banner {
  background: var(--warn-tint);
  border: 1px solid var(--warn);
  border-radius: 3px;
  padding: var(--s2) var(--s3);
  margin: var(--s3) 0;
  font-size: 14px;
  max-width: var(--col);
}

/* ---------------------------------------------------------- scenario toggle */

.scenario-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: var(--s2) 0;
}

.scenario-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--ink);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.scenario-toggle button {
  flex: 1 1 0;
  appearance: none;
  border: 0;
  border-right: 1px solid var(--rule);
  background: var(--bg-card);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: var(--s2) var(--s2);
  cursor: pointer;
  text-align: left;
  line-height: 1.25;
  transition: background 120ms ease;
}

.scenario-toggle button:last-child {
  border-right: 0;
}

.scenario-toggle button:hover {
  background: var(--bg-card-2);
}

.scenario-toggle button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
}

.scenario-toggle .st-label {
  display: block;
  font-weight: 600;
}

.scenario-toggle .st-sub {
  display: block;
  font-size: 12px;
  opacity: 0.75;
}

.scenario-explainer {
  margin-top: var(--s3);
  display: grid;
  gap: var(--s2);
  max-width: 78ch;
}

.scenario-explainer .counterfactual {
  border-left: 2px solid var(--rule);
  padding-left: var(--s2);
  font-size: 15px;
  color: var(--ink-soft);
}

.scenario-explainer .counterfactual strong {
  color: var(--ink);
  font-weight: 600;
}

/* ------------------------------------------------------------ mode + delay */

.controls-row {
  display: flex;
  gap: var(--s3);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--s3);
}

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.mode-switch button {
  appearance: none;
  border: 0;
  background: var(--bg-card);
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 7px 12px;
  cursor: pointer;
}

.mode-switch button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
}

.delay-control {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 14px;
}

.delay-control input[type='range'] {
  width: 180px;
  accent-color: var(--econ);
}

/* --------------------------------------------------------- override strip */

.override-strip {
  position: sticky;
  bottom: 0;
  z-index: 45;
  background: var(--warn-tint);
  border-top: 1px solid var(--warn);
  padding: var(--s2) 0;
  font-size: 14px;
}

.override-strip .container {
  display: flex;
  gap: var(--s3);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.override-strip button {
  appearance: none;
  border: 1px solid var(--warn);
  background: transparent;
  color: var(--warn);
  font-family: inherit;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 3px;
  cursor: pointer;
}

.override-strip button:hover {
  background: var(--warn);
  color: var(--warn-tint);
}

/* ---------------------------------------------------------------- sections */

.category {
  padding: var(--s5) 0 var(--s3);
  border-top: 1px solid var(--rule);
}

.category-head {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  margin-bottom: var(--s2);
}

.category-head .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.category.economic .dot { background: var(--econ); }
.category.civic .dot { background: var(--civic); }
.category.social .dot { background: var(--social); }

.category-blurb {
  max-width: var(--col);
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: var(--s4);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--s3);
}

/* ------------------------------------------------------------ metric card */

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.metric-card.economic { border-top: 3px solid var(--econ); }
.metric-card.civic { border-top: 3px solid var(--civic); }
.metric-card.social { border-top: 3px solid var(--social); }

.metric-card.cuts-against {
  border-top-color: var(--warn);
  background: linear-gradient(180deg, var(--warn-tint) 0%, var(--bg-card) 90px);
}

.metric-card .metric-question {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 36;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}

.metric-card .metric-label {
  font-size: 13px;
  color: var(--ink-faint);
}

.cuts-against-flag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 2px;
  padding: 2px 6px;
}

/* the figure button — every number on the page is one of these */
.figure {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: block;
  border-bottom: 1px dashed var(--rule);
}

.figure:hover .figure-v {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}

.figure-v {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 96;
  font-size: clamp(30px, 4.4vw, 42px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  display: block;
  font-variant-numeric: tabular-nums;
}

.figure-range {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-faint);
  display: block;
  margin-top: 3px;
}

.figure-u {
  font-size: 13px;
  color: var(--ink-soft);
  display: block;
}

.figure-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-top: 6px;
  display: block;
}

.figure-blocked {
  font-size: 15px;
  color: var(--ink-faint);
  font-style: italic;
  border-left: 2px solid var(--rule);
  padding-left: var(--s2);
}

.confidence-chip {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--none-tint);
  color: var(--ink-soft);
}

.confidence-chip.placeholder {
  background: var(--warn-tint);
  color: var(--warn);
}

.chart-wrap {
  margin-top: var(--s1);
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.source-line {
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--s1);
}

/* ------------------------------------------------------- provenance drawer */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.35);
  z-index: 90;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  background: var(--bg-card);
  border-left: 1px solid var(--rule);
  z-index: 91;
  overflow-y: auto;
  padding: var(--s3) var(--s3) var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

@media (max-width: 620px) {
  .drawer {
    top: auto;
    left: 0;
    width: 100vw;
    max-height: 88vh;
    border-left: 0;
    border-top: 1px solid var(--rule);
    border-radius: 8px 8px 0 0;
  }
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s2);
  position: sticky;
  top: calc(-1 * var(--s3));
  background: var(--bg-card);
  padding: var(--s3) 0 var(--s1);
  margin: calc(-1 * var(--s3)) 0 0;
  border-bottom: 1px solid var(--rule);
  z-index: 2;
}

.drawer-close {
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 3px;
  width: 30px;
  height: 30px;
  flex: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-soft);
}

.drawer-block {
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--s2);
}

.drawer-block > .eyebrow {
  display: block;
  margin-bottom: var(--s1);
}

/* formula, with each identifier as a navigable chip */
.formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 2.1;
  word-break: break-word;
}

.formula .chip {
  appearance: none;
  border: 1px solid var(--civic-soft);
  background: var(--civic-tint);
  color: var(--civic);
  font-family: inherit;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 3px;
  cursor: pointer;
}

.formula .chip:hover {
  background: var(--civic);
  color: var(--bg-card);
}

.formula .op {
  color: var(--ink-faint);
  padding: 0 3px;
}

.formula-result {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  margin-top: var(--s2);
  padding-top: var(--s1);
  border-top: 1px dashed var(--rule);
}

.step-list {
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  display: grid;
  gap: 4px;
  margin-top: var(--s2);
}

.step-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  color: var(--ink-soft);
}

/* assumption sliders inside the drawer */
.assumption {
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  padding: var(--s2);
  margin-bottom: var(--s2);
  background: var(--bg);
}

.assumption.modified {
  border-color: var(--warn);
  background: var(--warn-tint);
}

.assumption-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s2);
  margin-bottom: 6px;
}

.assumption-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
}

.assumption input[type='range'] {
  width: 100%;
  accent-color: var(--econ);
}

.assumption-rationale {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 6px;
}

.assumption-reset {
  appearance: none;
  border: 0;
  background: none;
  color: var(--warn);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* sources, grouped by the input they back */
.source-group {
  margin-bottom: var(--s2);
}

.source-group-head {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.source-item {
  font-size: 13px;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule);
  padding-left: var(--s2);
  margin-bottom: var(--s1);
}

.source-item .src-quote {
  font-style: italic;
  color: var(--ink);
  display: block;
  margin: 3px 0;
}

.source-item .src-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  display: block;
}

.caveat-list {
  font-size: 14px;
  color: var(--ink-soft);
  padding-left: 1.1em;
  display: grid;
  gap: var(--s1);
}

.contested {
  border: 1px solid var(--warn);
  background: var(--warn-tint);
  border-radius: 3px;
  padding: var(--s2);
  font-size: 13px;
  margin-top: var(--s2);
}

.contested .claim {
  font-weight: 600;
}

.contested .counter {
  margin-top: 5px;
  color: var(--ink-soft);
}

.drawer-actions {
  display: flex;
  gap: var(--s1);
  flex-wrap: wrap;
}

.drawer-actions button {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--bg);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink-soft);
}

.drawer-actions button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ------------------------------------------------------------ comparisons */

.comparison-list {
  display: grid;
  gap: var(--s1);
  margin-top: var(--s2);
}

.comparison-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s2);
  align-items: baseline;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.comparison-row .cmp-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  white-space: nowrap;
}

.comparison-row .cmp-basis {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  display: block;
}

/* Caveats are sentences, not labels. Uppercasing a sentence makes it shout
   and become hard to read, which is the opposite of the intent. */
.comparison-row .cmp-note {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 11.5px;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--ink-faint);
  display: block;
  margin-top: 2px;
}

/* ------------------------------------------------------------ methodology */

.methodology {
  padding: var(--s5) 0 var(--s6);
  border-top: 1px solid var(--rule);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s4);
  margin-top: var(--s3);
}

.inputs-table-wrap {
  overflow-x: auto;
  margin-top: var(--s3);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

table.inputs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}

table.inputs-table th,
table.inputs-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

table.inputs-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  background: var(--bg-card-2);
  position: sticky;
  top: 0;
}

table.inputs-table td.num {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--s4) 0 var(--s6);
  font-size: 13px;
  color: var(--ink-faint);
}

/* ================================================================ v2
 *
 * One question, two columns, three dedicated sections, then the working.
 * The visual job here is restraint: the figures carry the page, so almost
 * everything else is whitespace, rules and a single accent per section.
 */

/* ---------------------------------------------------------------- knob */

.knob-block {
  padding: var(--s5) 0 var(--s4);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-card);
  text-align: center;
}

.knob-question {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 72;
  font-weight: 600;
  font-size: clamp(22px, 3.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 22ch;
  margin: 0 auto var(--s4);
}

.knob-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 5vw, 54px);
}

.knob-side {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(15px, 2.4vw, 22px);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  transition: color 200ms ease, opacity 200ms ease;
  opacity: 0.45;
  min-width: 3.5em;
}

.knob-side.on {
  color: var(--ink);
  opacity: 1;
}

.knob {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  border-radius: 50%;
  color: var(--ink);
}

.knob svg {
  display: block;
}

/* The dial is the only moving part on the page. Two detents, 60 degrees
   apart, with a little overshoot so it reads as a physical control. */
.knob .knob-dial {
  transform-origin: 60px 60px;
  transition: transform 340ms cubic-bezier(0.34, 1.4, 0.5, 1);
}

.knob.is-yes .knob-dial {
  transform: rotate(-32deg);
}

.knob.is-no .knob-dial {
  transform: rotate(32deg);
}

.knob:hover .knob-knurls {
  opacity: 0.75;
}

.knob-hint {
  margin-top: var(--s3);
  font-size: 13px;
  color: var(--ink-faint);
  max-width: 46ch;
  margin-inline: auto;
}

.counterfactual-bar {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule);
}

.counterfactual-bar .prose {
  max-width: 76ch;
}

.weak-flag {
  margin-top: var(--s1);
  border-left: 2px solid var(--warn);
  padding-left: var(--s2);
  font-size: 14px;
}

/* ---------------------------------------------------------------- columns */

.compare {
  padding: var(--s5) 0 var(--s4);
}

.compare-heads,
.compare-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 1.35fr 1.35fr;
  gap: clamp(16px, 3vw, 40px);
}

.compare-heads {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--ink);
  margin-bottom: var(--s4);
}

.compare-head-title {
  font-size: 20px;
}

.compare-head-sub {
  font-size: 13px;
  color: var(--ink-faint);
}

.compare-head-flag {
  margin-top: 6px;
  font-size: 12px;
  color: var(--warn);
  max-width: 34ch;
}

/* Muted, never hidden. The comparison is the content, so the column you are
   not asking about stays legible and its footnotes stay clickable. */
.compare-head.muted,
.compare-cell.muted {
  opacity: 0.38;
  filter: saturate(0.25);
  transition: opacity 260ms ease, filter 260ms ease;
}

.compare-head.active,
.compare-cell.active {
  opacity: 1;
  transition: opacity 260ms ease, filter 260ms ease;
}

.compare-cell.muted:hover,
.compare-cell.muted:focus-within {
  opacity: 0.72;
}

.compare-row {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--rule-soft);
}

.compare-area-title {
  font-size: 21px;
  margin-bottom: 6px;
}

.compare-area-blurb {
  font-size: 14px;
  color: var(--ink-faint);
  max-width: 34ch;
}

.story + .story {
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px dashed var(--rule-soft);
}

.story-q {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: var(--s1);
  max-width: 40ch;
}

.story-na {
  font-size: 14px;
  color: var(--ink-faint);
  font-style: italic;
}

.equivalents {
  margin-top: var(--s2);
}

.eq-lead {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.eq-list {
  list-style: none;
  display: grid;
  gap: 5px;
}

.eq-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.eq-n {
  font-weight: 600;
  font-size: 16px;
  min-width: 3.2em;
  text-align: right;
  color: var(--econ);
}

.eq-t {
  flex: 1;
}

.eq-basis {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1px 4px;
  white-space: nowrap;
  cursor: help;
}

/* ---------------------------------------------------------------- footnotes */

.fn-ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  vertical-align: super;
  margin-left: 3px;
  text-decoration: none;
  color: var(--civic);
  border-bottom: 1px solid currentColor;
  padding: 0 1px;
}

.fn-ref:hover {
  background: var(--civic-tint);
}

/* ---------------------------------------------------------------- features */

.feature {
  padding: var(--s6) 0;
  border-top: 1px solid var(--rule);
}

.feature .section-title {
  margin: var(--s1) 0 var(--s3);
  max-width: 24ch;
}

.feature.water {
  background: var(--bg-card);
}

.water-head {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: clamp(20px, 4vw, 52px);
  align-items: center;
  margin-bottom: var(--s5);
}

.water-subject {
  text-align: center;
  padding: var(--s3);
  border: 1px solid var(--social-soft);
  border-radius: 4px;
  background: var(--bg);
}

.water-subject-label {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 6px;
}

.water-lead {
  max-width: 62ch;
}

.wicon {
  width: 100%;
  height: auto;
  max-width: 64px;
  color: var(--social);
}

.wcard-icon.big .wicon {
  max-width: 92px;
}

.wgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s3);
}

.wcard {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: var(--s3) var(--s2);
  background: var(--bg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
}

/* A measured actual and a permitted ceiling are not the same kind of number.
   The dashed edge marks which is which before anyone reads the caption. */
.wcard.measured {
  border-style: dashed;
}

.wcard figcaption {
  display: grid;
  gap: 4px;
}

.wcard-n {
  font-size: 30px;
  font-weight: 600;
  color: var(--social);
  line-height: 1;
}

.wcard-t {
  font-size: 14px;
  line-height: 1.3;
}

.wcard-basis {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.wcard-note {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.4;
  margin-top: 4px;
}

.air-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s4);
  margin: var(--s4) 0;
}

.air-card {
  border-left: 2px solid var(--social);
  padding-left: var(--s3);
}

.air-card h3 {
  font-size: 17px;
  margin-bottom: var(--s2);
  max-width: 30ch;
}

.air-label,
.noise-label {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 6px;
}

.air-note {
  border-top: 1px solid var(--rule);
  padding-top: var(--s3);
  max-width: 70ch;
}

.feature.noise {
  background: var(--warn-tint);
}

.cuts-against-flag.standalone {
  display: inline-block;
  margin: var(--s1) 0;
}

.noise-body {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr;
  gap: clamp(20px, 4vw, 52px);
  align-items: start;
  margin-bottom: var(--s4);
}

.caveat-list {
  list-style: none;
  display: grid;
  gap: var(--s2);
  max-width: 72ch;
  margin-top: var(--s3);
}

.caveat-list li {
  font-size: 14px;
  color: var(--ink-soft);
  padding-left: var(--s2);
  border-left: 2px solid var(--rule);
  line-height: 1.5;
}

.caveat-list.small li {
  font-size: 13px;
}

/* ---------------------------------------------------------------- assumptions */

.assumptions {
  padding: var(--s6) 0;
  border-top: 1px solid var(--ink);
  background: var(--bg-card);
}

.assumption {
  border-top: 1px solid var(--rule);
  padding: var(--s4) 0;
  scroll-margin-top: var(--s4);
}

.assumption-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s2);
  align-items: start;
  margin-bottom: var(--s3);
}

.assumption-n {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.assumption-value {
  font-size: 15px;
  margin-top: 4px;
}

.assumption-value span {
  color: var(--ink-faint);
  font-size: 12px;
}

.assumption-back {
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.assumption-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: var(--s3) 0;
}

.assumption-table th,
.assumption-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

.assumption-table thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.assumption-table tbody th {
  font-weight: 500;
}

.assumption-table tr.is-modified {
  background: var(--warn-tint);
}

.slider-row td {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  background: var(--bg);
}

.slider-row label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.slider-row input[type='range'] {
  flex: 1 1 180px;
  accent-color: var(--civic);
}

.slider-why {
  flex: 1 1 100%;
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.45;
}

.contested-row td {
  background: var(--bg);
}

.contested {
  font-size: 13px;
  color: var(--ink-soft);
  border-left: 2px solid var(--warn);
  padding-left: var(--s2);
  max-width: 78ch;
}

.contested em {
  display: block;
  margin-top: 4px;
}

/* ---------------------------------------------------------------- switcher */

.project-switcher {
  display: flex;
  gap: 2px;
}

.project-switcher button {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
}

.project-switcher button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 860px) {
  .compare-heads,
  .compare-row {
    grid-template-columns: 1fr 1fr;
  }

  .compare-spacer,
  .compare-label {
    grid-column: 1 / -1;
  }

  .compare-heads {
    position: static;
  }

  .water-head,
  .noise-body {
    grid-template-columns: 1fr;
  }

  .assumption-head {
    grid-template-columns: auto 1fr;
  }

  .assumption-back {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  .compare-heads,
  .compare-row {
    grid-template-columns: 1fr;
  }

  /* Stacked, the muted column would read as broken rather than de-emphasised,
     so on a phone the inactive one collapses to its heading only. */
  .compare-cell.muted .story .figure,
  .compare-cell.muted .equivalents {
    display: none;
  }

  .compare-cell.muted::after {
    content: 'Turn the dial to see this column';
    font-size: 12px;
    color: var(--ink-faint);
  }
}

/* ================================================================ outcomes
 *
 * The picker and the summary it produces. The three abundance categories each
 * own a hue that was already in tokens.css, so the framework reads as colour
 * across the whole page rather than as another label to parse.
 */

.picker {
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--rule);
}

.picker .section-title {
  margin: var(--s1) 0 var(--s2);
}

.pick-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s4);
  margin-top: var(--s4);
}

.pick-group {
  border-top: 2px solid var(--rule);
  padding-top: var(--s2);
}

.pick-group.economic { border-top-color: var(--econ); }
.pick-group.civic    { border-top-color: var(--civic); }
.pick-group.social   { border-top-color: var(--social); }

.pick-group-title {
  font-size: 15px;
  margin-bottom: 4px;
}

.pick-group-def {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: var(--s2);
  max-width: 38ch;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s2);
}

/* Chips are role="switch", so the pressed state has to be unmistakable
   without relying on colour alone: the fill inverts and a tick appears. */
.chip {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  padding: 7px 11px;
  border-radius: 15px;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.chip:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.chip::before {
  content: '+';
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin-right: 6px;
  opacity: 0.6;
}

.chip[aria-checked='true']::before {
  content: '✓';
  opacity: 1;
}

.chip.economic[aria-checked='true'] {
  background: var(--econ);
  border-color: var(--econ);
  color: var(--bg);
}

.chip.civic[aria-checked='true'] {
  background: var(--civic);
  border-color: var(--civic);
  color: var(--bg);
}

.chip.social[aria-checked='true'] {
  background: var(--social);
  border-color: var(--social);
  color: var(--bg);
}

/* ---------------------------------------------------------------- tags */

.cat-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 2px;
  margin-bottom: 6px;
  color: var(--ink);
}

.cat-tag.economic { background: var(--econ-tint); }
.cat-tag.civic    { background: var(--civic-tint); }
.cat-tag.social   { background: var(--social-tint); }

/* ---------------------------------------------------------------- summary */

.summary {
  padding: var(--s5) 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--ink);
}

.summary .prose {
  margin-bottom: var(--s4);
}

.sum-heads,
.sum-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) 1fr 1fr;
  gap: clamp(14px, 3vw, 36px);
}

.sum-heads {
  padding-bottom: var(--s1);
  border-bottom: 1px solid var(--ink);
}

.sum-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.sum-row {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: start;
}

.sum-row.runs-against {
  background: var(--warn-tint);
  margin-inline: calc(var(--s2) * -1);
  padding-inline: var(--s2);
}

.sum-question {
  font-size: 15px;
  font-weight: 500;
  max-width: 30ch;
}

.sum-jump {
  font-size: 11px;
  color: var(--ink-faint);
  display: inline-block;
  margin-top: 4px;
}

.sum-a.muted {
  opacity: 0.38;
  filter: saturate(0.25);
}

.sum-metric + .sum-metric {
  margin-top: var(--s2);
}

.sum-metric-label {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
}

.sum-na {
  font-size: 13px;
  color: var(--ink-faint);
  font-style: italic;
}

@media (max-width: 720px) {
  .sum-heads {
    display: none;
  }

  .sum-row {
    grid-template-columns: 1fr 1fr;
  }

  .sum-q {
    grid-column: 1 / -1;
  }
}

/* ---------------------------------------------------------------- the frame */

.abundance {
  padding: var(--s6) 0;
  border-top: 1px solid var(--rule);
}

.abundance .lede {
  margin-top: var(--s2);
  max-width: 68ch;
}

.abundance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s4);
  margin-top: var(--s4);
}

/* One rule per card, in the category's own hue — the same colour the reader has
   been following on every figure above. */
.abundance-card {
  border-top: 3px solid var(--rule);
  padding-top: var(--s2);
}

.abundance-card.economic { border-top-color: var(--econ); }
.abundance-card.civic    { border-top-color: var(--civic); }
.abundance-card.social   { border-top-color: var(--social); }

.abundance-card h3 {
  font-size: 18px;
}

.abundance-tagline {
  font-size: 15px;
  font-weight: 500;
  margin: 6px 0 var(--s2);
  max-width: 34ch;
}

.abundance-card.economic .abundance-tagline { color: var(--econ); }
.abundance-card.civic    .abundance-tagline { color: var(--civic); }
.abundance-card.social   .abundance-tagline { color: var(--social); }

.abundance-rationale {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: var(--s3);
}

.abundance-pillar {
  margin-top: var(--s2);
  padding-left: var(--s2);
  border-left: 1px solid var(--rule);
}

.abundance-pillar-t {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.abundance-pillar p {
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.5;
}
