/* ==========================================================================
   Goxeva — cost & mechanics desk
   Skin: "spec sheet". Left index rail + dense measured column + hairline
   data slabs + oversized tabular numerals.
   ========================================================================== */

:root {
  --paper:      #e9ebe4;
  --paper-deep: #dfe2d8;
  --paper-lift: #f4f5f0;
  --ink:        #12160f;
  --ink-soft:   #43483c;
  --ink-faint:  #6d7364;
  --rule:       #c4c8bc;
  --rule-soft:  #d6d9cf;
  --rust:       #c3410a;
  --rust-deep:  #963106;
  --teal:       #0f5c55;
  --amber:      #8a6a08;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --rail: 15.5rem;
  --measure: 39rem;
  --gutter: clamp(1.15rem, 4vw, 3.25rem);

  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0:  clamp(0.98rem, 0.95rem + 0.15vw, 1.06rem);
  --step-1:  clamp(1.16rem, 1.09rem + 0.34vw, 1.36rem);
  --step-2:  clamp(1.44rem, 1.28rem + 0.78vw, 1.95rem);
  --step-3:  clamp(1.86rem, 1.5rem + 1.75vw, 2.95rem);
  --step-4:  clamp(2.35rem, 1.6rem + 3.6vw, 4.6rem);
}

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

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.62;
  font-weight: 400;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

/* ---------- primitives ---------- */

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--rust); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.05em; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4rem 0;
}

code, kbd, samp {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper-deep);
  padding: 0.08em 0.34em;
  border-radius: 2px;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 0.5rem; top: 0.5rem;
  z-index: 99;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 0.9rem;
}

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--ink);
  padding: 0 var(--gutter);
  background: var(--paper);
}

.masthead__inner {
  max-width: 82rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 1.4rem;
  padding: 0.95rem 0 0.85rem;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: 0.13em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark:hover { color: var(--rust); }

.masthead__desc {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.055em;
  color: var(--ink-faint);
  margin-right: auto;
  padding-left: 0.9rem;
  border-left: 1px solid var(--rule);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.05rem;
  font-size: 0.88rem;
  font-weight: 500;
}
.nav a {
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { border-bottom-color: var(--rust); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* language switcher — a disclosure menu, each language written in its own name.
   Built on <details> so it opens on tap as well as on click, works with the
   keyboard on its own, and still works with scripting turned off. */
.lang {
  position: relative;
  padding-left: 0.9rem;
  border-left: 1px solid var(--rule);
}

.lang > summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary::after {
  content: "";
  width: 0.34rem;
  height: 0.34rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-0.12em) rotate(45deg);
}
.lang[open] > summary::after { transform: translateY(0.06em) rotate(-135deg); }
.lang > summary:hover { color: var(--rust); }

.lang__menu {
  position: absolute;
  top: calc(100% - 0.35rem);
  right: 0;
  z-index: 40;
  min-width: 10rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink);
  background: var(--paper-lift);
}
.lang__menu a {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0 0.9rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rule-soft);
}
.lang__menu a:last-child { border-bottom: 0; }
.lang__menu a:hover { background: var(--ink); color: var(--paper); }
.lang__menu a[aria-current="true"] { color: var(--ink); font-weight: 600; }

@media (max-width: 46rem) {
  .lang { padding-left: 0; border-left: 0; margin-left: auto; }
}
/* on a narrow screen the masthead wraps, so drop the menu into the flow
   rather than risk anchoring it off the left edge */
@media (max-width: 34rem) {
  .lang { width: 100%; margin-left: 0; }
  .lang__menu { position: static; margin: 0.35rem 0 0.2rem; min-width: 0; }
}

/* ---------- layout shells ---------- */

.shell {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.rail-layout {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.rail {
  position: sticky;
  top: 1.4rem;
  padding: 2.2rem 0 3rem;
  border-right: 1px solid var(--rule);
  padding-right: 1.4rem;
  font-size: var(--step--1);
}
.rail__title {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.7rem;
  font-weight: 500;
}
.rail ol { margin: 0 0 1.7rem; padding: 0; list-style: none; counter-reset: rail; }
.rail li { counter-increment: rail; margin-bottom: 0.42rem; display: flex; gap: 0.55rem; }
.rail li::before {
  content: counter(rail, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  padding-top: 0.16em;
}
.rail a { text-decoration: none; color: var(--ink-soft); line-height: 1.36; }
.rail a:hover { color: var(--rust); text-decoration: underline; }

.col { padding: 2.4rem 0 4rem; min-width: 0; }
.col--measure > p,
.col--measure > ul,
.col--measure > ol,
.col--measure > h2,
.col--measure > h3,
.col--measure > blockquote { max-width: var(--measure); }

@media (max-width: 62rem) {
  .rail-layout { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 1.6rem 0 1.2rem;
  }
  .rail ol { columns: 2; column-gap: 1.4rem; }
  .rail li { break-inside: avoid; }
}
@media (max-width: 30rem) {
  .masthead__desc { display: none; }
  .rail ol { columns: 1; }
}

/* ---------- hero (home) ---------- */

.hero {
  border-bottom: 1px solid var(--ink);
  padding: 0 var(--gutter);
}
.hero__inner {
  max-width: 82rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(1.5rem, 4vw, 3.1rem) 0 clamp(1.4rem, 3vw, 2.4rem);
  align-items: start;
}

.hero__lede { min-width: 0; }
.hero h1 {
  font-size: var(--step-4);
  max-width: 15ch;
  margin-bottom: 0.75rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--rust);
}
.hero__sub {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 34ch;
  line-height: 1.42;
  margin-bottom: 1.3rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.62rem 1.15rem;
  font: 600 0.92rem/1 var(--sans);
  letter-spacing: 0.005em;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 1px;
  cursor: pointer;
}
.btn:hover { background: var(--rust); border-color: var(--rust); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* invite slab — the conversion block, above the fold on desktop and 360px */
.slab {
  border: 1px solid var(--ink);
  background: var(--paper-lift);
  padding: 1.05rem 1.15rem 1.15rem;
}
.slab__label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.5rem;
}
.slab__code {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.slab__code output {
  flex: 1;
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.5rem, 5.5vw, 2.05rem);
  letter-spacing: 0.06em;
  line-height: 1.15;
  padding: 0.3rem 0.55rem;
  border: 1px dashed var(--rule);
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
}
.copy-btn {
  flex: 0 0 auto;
  min-width: 5.4rem;
  min-height: 44px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 600 0.82rem/1 var(--mono);
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 1px;
}
.copy-btn:hover { background: var(--rust); border-color: var(--rust); color: #fff; }
.copy-btn[data-state="done"] { background: var(--teal); border-color: var(--teal); color: #fff; }

.slab__benefit {
  font-size: 0.93rem;
  line-height: 1.45;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.slab__benefit b { font-weight: 700; }
.slab__note {
  font-size: 0.73rem;
  line-height: 1.42;
  color: var(--ink-faint);
  margin: 0;
}

@media (max-width: 62rem) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 1.35rem; }
  .hero h1 { max-width: 20ch; }
  .hero__sub { max-width: none; margin-bottom: 1rem; }
}
@media (max-width: 30rem) {
  .hero__inner { padding-top: 1.1rem; }
  .hero h1 { font-size: clamp(1.95rem, 10vw, 2.5rem); }
  .hero__sub { font-size: 1rem; margin-bottom: 0.85rem; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- index tables (wide internal linking) ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.45rem;
  margin: 2.9rem 0 0;
}
.section-head h2 { font-size: var(--step-2); }
.section-head .tag { margin-left: auto; }

.section-head__all {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  white-space: nowrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.1rem;
}
.section-head__all:hover { color: var(--rust); border-bottom-color: var(--rust); }
.section-head__all span { margin-left: 0.3rem; }

/* section index pages: group headings inside a listing */
.group {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 2.1rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}
.group:first-of-type { margin-top: 1.2rem; }

.idx { list-style: none; margin: 0; padding: 0; counter-reset: idx; }
.idx > li {
  counter-increment: idx;
  border-bottom: 1px solid var(--rule-soft);
}
.idx__row {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  gap: 0.3rem 1rem;
  align-items: baseline;
  padding: 0.72rem 0;
  text-decoration: none;
}
.idx__row:hover { background: var(--paper-lift); }
.idx__row:hover .idx__title { color: var(--rust); }
.idx__n {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}
.idx__title { font-weight: 600; line-height: 1.32; }
.idx__meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  white-space: nowrap;
}
.idx__blurb {
  grid-column: 2 / -1;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-top: 0.12rem;
}
@media (max-width: 34rem) {
  .idx__row { grid-template-columns: 1.9rem minmax(0, 1fr); }
  .idx__meta { grid-column: 2; white-space: normal; }
}

/* ---------- article ---------- */

.article-head { padding: 2.4rem 0 1.5rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.9rem; }
.article-head h1 { font-size: var(--step-3); max-width: 22ch; margin-bottom: 0.7rem; }
.article-head .standfirst {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 46ch;
  line-height: 1.44;
  margin-bottom: 1rem;
}
.byline {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.prose { font-size: var(--step-0); }
.prose > * { max-width: var(--measure); }
.prose h2 {
  font-size: var(--step-2);
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
}
.prose h3 { font-size: var(--step-1); margin: 1.9rem 0 0.55rem; font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1.15em; }
.prose li { margin-bottom: 0.42em; }
.prose li::marker { color: var(--ink-faint); }
.prose strong { font-weight: 700; }

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 3px solid var(--rust);
  color: var(--ink-soft);
}

/* the one-sentence direct answer that opens a section */
.answer {
  font-weight: 600;
  color: var(--ink);
  border-left: 3px solid var(--teal);
  padding-left: 0.85rem;
  margin: 0 0 1.05em;
}

figure { margin: 1.8rem 0; max-width: 100%; }
figure img { border: 1px solid var(--rule); background: var(--paper-lift); }
figcaption {
  font-family: var(--mono);
  font-size: 0.71rem;
  line-height: 1.5;
  color: var(--ink-faint);
  margin-top: 0.5rem;
  max-width: var(--measure);
}
.article-cover { margin: 0 0 2rem; }

.table-wrap { overflow-x: auto; margin: 1.5rem 0; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; min-width: 30rem; }

/* separates a dated platform reading from arithmetic on assumed inputs, so the
   distinction travels with the table rather than sitting in the prose above it */
caption {
  caption-side: top;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.71rem;
  line-height: 1.5;
  color: var(--ink-faint);
  padding: 0 0 0.6rem;
  max-width: var(--measure);
}
caption b {
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
caption.is-snapshot b { color: var(--rust); }
caption.is-example b { color: var(--teal); }
th, td {
  text-align: left;
  padding: 0.5rem 0.7rem 0.5rem 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--ink);
  font-weight: 500;
}
td.n, th.n { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--amber);
  background: var(--paper-lift);
  padding: 0.95rem 1.1rem;
  margin: 1.7rem 0;
  font-size: 0.93rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout--warn {
  border-left-color: var(--rust);
  background: #f7ece6;
}
.callout--warn .callout__label { color: var(--rust-deep); }

.callout__label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.35rem;
}

/* the single sponsored link block, registration guide only */
.reg-link {
  border: 1px solid var(--ink);
  background: var(--paper-lift);
  padding: 1rem 1.15rem;
  margin: 1.8rem 0;
}
.reg-link a { font-weight: 700; }
.reg-link .disclosure {
  display: block;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--ink-faint);
  margin-top: 0.5rem;
}

/* ---------- openers ---------- */

.tldr {
  border: 1px solid var(--ink);
  border-left-width: 5px;
  background: var(--paper-lift);
  padding: 1rem 1.15rem 1.05rem;
  margin: 0 0 2rem;
  max-width: var(--measure);
}
.tldr p { margin-bottom: 0.6rem; font-size: 1.02rem; line-height: 1.5; }
.tldr p:last-child { margin-bottom: 0; }
.tldr b { font-weight: 700; }

.stages {
  list-style: none;
  counter-reset: stage;
  margin: 0 0 2rem;
  padding: 0;
  max-width: var(--measure);
  border-top: 1px solid var(--rule);
}
.stages li {
  counter-increment: stage;
  border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0 0.7rem 3rem;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.5;
}
.stages li::before {
  content: counter(stage, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.72rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--rust);
  font-weight: 600;
}
.stages b { font-weight: 700; display: block; }

.tree {
  margin: 0 0 2rem;
  padding: 0.2rem 0 0.2rem 1.05rem;
  border-left: 2px solid var(--teal);
  max-width: var(--measure);
  font-size: 0.95rem;
}
.tree ul { list-style: none; margin: 0.4rem 0 0; padding-left: 1.1rem; }
.tree > p { font-weight: 600; margin-bottom: 0.3rem; }
.tree li {
  margin-bottom: 0.42rem;
  line-height: 1.5;
  position: relative;
}
.tree li::before {
  content: "\2192";
  position: absolute;
  left: -1.05rem;
  color: var(--ink-faint);
  font-family: var(--mono);
}
.tree li b { font-weight: 700; }

.scorecard {
  border: 1px solid var(--ink);
  margin: 0 0 2rem;
  max-width: var(--measure);
}
.scorecard > p {
  margin: 0;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--paper-lift);
}
.scorecard dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
}
.scorecard dt,
.scorecard dd {
  margin: 0;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.92rem;
}
.scorecard dd {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
}
.scorecard dt:last-of-type,
.scorecard dd:last-of-type { border-bottom: 0; }

.checklist {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  max-width: var(--measure);
}
.checklist li {
  padding: 0.42rem 0 0.42rem 1.7rem;
  position: relative;
  line-height: 1.5;
  font-size: 0.95rem;
  border-bottom: 1px dotted var(--rule);
}
.checklist li::before {
  content: "\25A1";
  position: absolute;
  left: 0.15rem;
  color: var(--rust);
  font-size: 1.05rem;
  line-height: 1.35;
}

/* collapsible guide block under a tool */
.guide {
  border-top: 1px solid var(--ink);
  margin-top: 2.4rem;
  max-width: var(--measure);
}
.guide > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.02rem;
}
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::before {
  content: "+";
  font-family: var(--mono);
  color: var(--rust);
  font-weight: 600;
}
.guide[open] > summary::before { content: "\2013"; }
.guide h3 { font-size: 1rem; margin: 1.4rem 0 0.4rem; font-weight: 700; }
.guide p, .guide li { font-size: 0.93rem; }
.guide > div { padding-bottom: 1.2rem; }

.faq { margin: 1.5rem 0; }
.faq details {
  border-bottom: 1px solid var(--rule-soft);
  padding: 0.15rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.7rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  font-family: var(--mono);
  color: var(--rust);
  margin-right: 0.6rem;
  font-weight: 600;
}
.faq details[open] summary::before { content: "\2013"; }
.faq details > *:not(summary) { padding-bottom: 0.5rem; }

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  border-top: 1px solid var(--ink);
  margin-top: 3rem;
  padding-top: 1rem;
  font-size: 0.9rem;
}
.pager a { text-decoration: none; font-weight: 600; }
.pager span { display: block; font-family: var(--mono); font-size: 0.68rem; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- tools ---------- */

.tool {
  border: 1px solid var(--ink);
  background: var(--paper-lift);
  margin: 1.9rem 0 2.2rem;
  max-width: var(--measure);
}
.tool__head {
  border-bottom: 1px solid var(--ink);
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}
.tool__head h2 { font-size: 1.02rem; border: 0; padding: 0; margin: 0; letter-spacing: 0; }
.tool__body { padding: 1.1rem; }

.field { margin-bottom: 0.95rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.28rem;
}
.field .hint {
  display: block;
  font-size: 0.73rem;
  color: var(--ink-faint);
  font-weight: 400;
  line-height: 1.4;
  margin-top: 0.15rem;
}
.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.6rem;
  font: 500 0.95rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 1px;
}
.field input:focus, .field select:focus { border-color: var(--ink); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.9rem; }
@media (max-width: 30rem) { .field-row { grid-template-columns: 1fr; } }

.seg { display: flex; gap: 0; border: 1px solid var(--rule); border-radius: 1px; overflow: hidden; }
.seg label {
  position: relative;
  flex: 1;
  margin: 0;
  text-align: center;
  padding: 0.62rem 0.4rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--paper);
  border-right: 1px solid var(--rule);
}
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.seg input:checked + span { font-weight: 700; }
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--rust); outline-offset: -2px; }

/* the result slab is deliberately dark — it is the thing you came for, and it
   should read as a display rather than as another form field */
.readout {
  margin: 1.2rem -1.1rem -1.1rem;
  padding: 1.05rem 1.1rem 1.15rem;
  background: var(--ink);
  color: var(--paper);
}
.readout__main {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: clamp(1.9rem, 8vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  word-break: break-word;
  color: #fff;
}
.readout__main.is-warn { color: #ff8a4c; }
.readout__main.is-ok { color: #6fd8a8; }
.readout__label {
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #9aa392;
  display: block;
  margin-bottom: 0.35rem;
}
.readout dl {
  margin: 1rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid #2e3529;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.36rem 1rem;
  font-size: 0.87rem;
}
.readout dt { color: #a8b09f; }
.readout dd {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
  color: var(--paper-lift);
}
.readout .err { color: #ff8a4c; font-size: 0.86rem; font-weight: 600; margin: 0; }
.readout .note { color: #a8b09f; font-size: 0.82rem; line-height: 1.5; margin: 0.7rem 0 0; }
.readout__list { list-style: none; margin: 0.9rem 0 0; padding: 0.8rem 0 0; border-top: 1px solid #2e3529; }
.readout__list li { font-size: 0.88rem; line-height: 1.5; padding-left: 1.1rem; position: relative; margin-bottom: 0.4rem; color: var(--paper-lift); }
.readout__list li::before { content: "\2022"; position: absolute; left: 0; color: #6fd8a8; }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--ink);
  background: var(--paper-deep);
  margin-top: 3rem;
  padding: 2rem var(--gutter) 2.6rem;
  font-size: 0.86rem;
}
.foot__inner {
  max-width: 82rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 1.6rem clamp(1.2rem, 3vw, 2.6rem);
}
.foot h2 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.32rem; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot__note { font-size: 0.79rem; color: var(--ink-soft); line-height: 1.55; max-width: 44ch; }
.foot__mail { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.01em; }
.foot__base {
  max-width: 82rem;
  margin: 1.8rem auto 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}
@media (max-width: 46rem) {
  .foot__inner { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 404 ---------- */

.stub { padding: clamp(3rem, 12vh, 7rem) 0 4rem; }
.stub h1 { font-size: var(--step-3); margin-bottom: 0.8rem; }
.stub p { max-width: 44ch; color: var(--ink-soft); }
.stub .num-big {
  font-family: var(--mono);
  font-size: clamp(4rem, 18vw, 9rem);
  font-weight: 600;
  line-height: 0.9;
  color: var(--rule);
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

/* ---------- print ---------- */
@media print {
  .masthead, .foot, .rail, .pager, .slab { display: none; }
  body { background: #fff; }
}

/* ---------- small comforts ---------- */

::selection { background: var(--rust); color: #fff; }
a, button, summary, label { -webkit-tap-highlight-color: rgba(195, 65, 10, 0.18); }

/* ---------- dark rendering ----------
   Only the tokens move. Every rule above reads its colour from one, so the
   whole sheet follows; the handful of places that hard-code a colour are
   corrected underneath. The result slab keeps its job by inverting with the
   page: on paper it is the dark block, on a dark page it is the light one. */

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #12160f;
    --paper-deep: #0b0e08;
    --paper-lift: #1b2017;
    --ink:        #e5e8dd;
    --ink-soft:   #bcc2b3;
    --ink-faint:  #8d9584;
    --rule:       #343b2d;
    --rule-soft:  #272d21;
    --rust:       #ef7139;
    --rust-deep:  #ff9563;
    --teal:       #52c1aa;
    --amber:      #d8ab30;
  }

  /* bright fills take dark text rather than white */
  .btn:hover,
  .copy-btn:hover,
  .copy-btn[data-state="done"] { color: #12160f; }

  /* the warning callout was a pale wash; it becomes a banked one */
  .callout--warn { background: #2b1b12; }

  /* the result slab is now the light panel, so its light-on-dark accents
     have to come back down to dark-on-light */
  .readout__main { color: #12160f; }
  .readout__main.is-warn,
  .readout .err { color: #a3350a; }
  .readout__main.is-ok { color: #0d5049; }
  .readout__label { color: #5f6855; }
  .readout dt,
  .readout .note { color: #4b5243; }
  .readout dl,
  .readout__list { border-top-color: #b9beb0; }
  .readout__list li::before { color: #0d5049; }
}

/* Desk collections and related write-ups reuse the existing index rows. */
.idx--plain .idx__row { grid-template-columns: minmax(0, 1fr); }
.idx--plain .idx__blurb { grid-column: 1; }
.related { margin-top: 2.6rem; }
.related h2 { font-size: var(--step-2); padding-top: 0.9rem; margin-bottom: 0.75rem; border-top: 1px solid var(--rule); }
.desk-sections { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0.25rem 0 1rem; }
.desk-sections a { display: inline-block; padding: 0.65rem 0; font-size: 0.9rem; font-weight: 600; }
.article-section a { display: inline-block; padding: 0.2rem 0; font-size: 0.82rem; color: var(--ink-soft); }
