:root {
  --paper: #f4f3ee;
  --ink: #171814;
  --muted: #5c5f56;
  --line: #d5d2c8;
  --tally: #c81e1e;
  --bar: #171814;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
}
.skip:focus { top: 0.5rem; }

.mast, .colophon, main { 
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.mast {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.1rem 0 0.9rem;
  border-bottom: 1px solid var(--ink);
}

.mark {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  font-size: 1.05rem;
}

.mast-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: flex-end;
  font-size: 0.92rem;
}

.mast-nav a { text-decoration: none; }
.mast-nav a:hover { text-decoration: underline; }

.inline { display: inline; margin: 0; }

button.linkish {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
button.linkish:hover { text-decoration: underline; }

main { padding: 2.2rem 0 3rem; }

.kicker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.8rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.lamp {
  width: 0.65rem;
  height: 0.65rem;
  background: var(--tally);
  display: inline-block;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
  max-width: 16ch;
}

h2 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.lede {
  max-width: 42rem;
  font-size: 1.15rem;
  margin: 0 0 2rem;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

ol.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

ol.steps li {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.8rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

ol.steps span {
  font-family: var(--mono);
  color: var(--muted);
}

.program {
  border: 1px solid var(--ink);
  background:
    linear-gradient(to bottom, transparent 0 72%, var(--paper) 72% 100%),
    repeating-linear-gradient(90deg, #eceae3 0 1px, transparent 1px 18px);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.program figcaption, .lower-third .brand {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.program-label {
  padding: 0.7rem 0.9rem 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lower-third {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 0.8rem;
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  border-top: 4px solid var(--ink);
}

.lower-third strong {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: -0.03em;
}

.grammar {
  margin-top: 2.5rem;
  border-top: 1px solid var(--ink);
  padding-top: 1.2rem;
}

.grammar dl {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) 1fr;
  gap: 0.35rem 1.5rem;
  margin: 0;
}

.grammar dt {
  font-family: var(--mono);
  font-size: 0.95rem;
}

.grammar dd { margin: 0 0 0.8rem; }

code, .mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.colophon {
  border-top: 1px solid var(--line);
  padding: 1rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.colophon p { margin: 0.2rem 0; }
.colophon a { margin-right: 1rem; }

.sheet-page { max-width: 46rem; }
.prose p, .prose li { max-width: 65ch; }
.prose h2 { margin-top: 1.8rem; }

form.stack { display: grid; gap: 0.8rem; max-width: 32rem; margin: 1rem 0 2rem; }
label { display: grid; gap: 0.25rem; font-size: 0.92rem; }
input, select, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.45rem 0;
  width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
button.solid, a.solid {
  justify-self: start;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  text-decoration: none;
  font: inherit;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}
.errors { color: var(--tally); padding-left: 0.7rem; border-left: 3px solid var(--tally); }
.errors p { margin: 0.2rem 0; }

table.sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.5rem 0 2rem;
}
table.sheet th {
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  padding: 0.4rem 0.6rem 0.4rem 0;
}
table.sheet td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.6rem 0.55rem 0;
  vertical-align: top;
}
table.sheet .num, .stat b { font-family: var(--mono); font-weight: 500; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
  margin: 1rem 0 1.5rem;
}
.stat { margin: 0; }
.stat span { display: block; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; }

.table-wrap { overflow-x: auto; }
.banner-row { display: grid; gap: 0.4rem; margin: 0 0 1.4rem; }
.banner-row img { width: min(100%, 720px); height: auto; border-top: 4px solid var(--ink); background: var(--paper); }
.note { color: var(--muted); max-width: 46rem; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  margin: 0 0 1.5rem;
}
.kpi { margin: 0; padding: 0.85rem 1rem 0.85rem 0; border-right: 1px solid var(--line); }
.kpi:nth-child(4n) { border-right: 0; padding-right: 0; }
.kpi span { display: block; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.kpi b { display: block; margin: 0.2rem 0; font-family: var(--mono); font-size: 1.35rem; font-weight: 500; letter-spacing: -0.03em; }
.kpi .delta, .delta { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
abbr { text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: help; }
.filters { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: end; margin: 0.5rem 0 1rem; }
.filters fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end; }
.filters legend { font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 0; }
.filters label { min-width: 8rem; }
.filters input, .filters select { width: 11rem; }
.presets { display: flex; gap: 0.7rem; align-items: center; }
.preset { text-decoration: none; font-size: 0.92rem; }
.preset.is-on { border-bottom: 2px solid var(--ink); }
.chart-frame { height: 240px; margin: 0.4rem 0 1.4rem; }
.chart-block h2 { margin-bottom: 0.4rem; }
.report-split { margin-top: 0.5rem; }
.empty { border-top: 1px solid var(--line); padding-top: 0.8rem; max-width: 40rem; }
.flag { margin-left: 0.4rem; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.clip { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; gap: 1rem; align-items: center; margin: 0.4rem 0 1rem; }
h1.mono { font-family: var(--mono); letter-spacing: -0.04em; }

@media (max-width: 800px) {
  .split, .grammar dl, .kpi-row, .report-split { grid-template-columns: 1fr 1fr; }
  .mast { flex-direction: column; align-items: flex-start; }
  .mast-nav { justify-content: flex-start; }
  .kpi:nth-child(4n) { border-right: 1px solid var(--line); }
  .clip { max-width: 9rem; }
}
@media (max-width: 560px) {
  .kpi-row, .report-split { grid-template-columns: 1fr; }
}
.mast-nav a.solid { color: var(--paper); background: var(--ink); text-decoration: none; padding: 0.35rem 0.7rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; align-items: center; margin: 0 0 1.5rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
textarea { font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 0.45rem 0; width: 100%; }
