/* Políticos Díscolos: a newsprint page carrying the Chamber's LED seat board.
   Grayscale only. One pixel square = one parliamentarian, everywhere.
   Mobile-first: base styles target phones (~360px); enhance with min-width
   queries at 40em (640px), 48em (768px) and 64em (1024px). */
/* Self-hosted Latin subsets (Google Fonts, SIL Open Font License). */
@font-face {
  font-family: "Doto";
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url("../fonts/doto.woff2") format("woff2");
}
@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/libre-franklin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/source-serif-4.woff2") format("woff2");
}
:root {
  --paper: #efefec;
  --paper-2: #e2e2de;
  --ink: #0d0d0d;
  --ink-2: #3a3a38;
  --ink-3: #62625f;
  --rule: #c4c4bf;
  --sq-dim: #8f8f8b;
  /* The board is always dark: it is an LED panel, not a theme. */
  --board: #0d0d0d;
  --led: #f4f4f0;
  --led-dim: #8c8c88;
  --led-off: #2b2b29;
  --led-text: #a9a9a4;

  --led-font: "Doto", ui-monospace, monospace;
  --head: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;

  --t-display: clamp(40px, 11vw, 96px);
  --t-h2: clamp(30px, 7.6vw, 60px);
  --t-h3: clamp(20px, 5vw, 23px);
  --t-lede: clamp(18px, 2.4vw, 22px);
  --t-body: 17px;
  --t-small: 14px;
  --t-label: 12px;
  --gutter: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--ink-3) var(--paper);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--ink);
  color: var(--paper);
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
input,
select {
  caret-color: var(--ink);
  accent-color: var(--ink);
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: var(--gutter) var(--gutter-r);
}
[id] {
  scroll-margin-top: calc(env(safe-area-inset-top) + 64px);
}
.px-arrow {
  width: 0.85em;
  height: 0.85em;
  fill: currentColor;
  shape-rendering: crispEdges;
  vertical-align: -0.08em;
  flex: none;
}
.px-arrow.down {
  vertical-align: -0.1em;
}

/* ── Masthead */
header.mast {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 3px double var(--ink);
  padding-top: env(safe-area-inset-top);
}
/* The one exception to the No-Hue Rule (DESIGN.md): a thin strip in the flag's colours
   along the top of the masthead. Decoration only; never use these colours for data. */
header.mast::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #0039a6 0 33.33%, #fff 33.33% 66.67%, #d52b1e 66.67%);
}
header.mast .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-block: 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font: 800 16px / 0.95 var(--head);
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}
/* Phones: the wordmark stacks in two lines so the period switch keeps the row. */
.brand {
  display: inline-grid;
  grid-template-columns: auto auto;
  column-gap: 8px;
  align-content: center;
}
.brand .mark {
  grid-row: span 2;
  align-self: center;
}
@media (min-width: 40em) {
  .brand {
    display: inline-flex;
    gap: 0 0.28em;
    font-size: 21px;
  }
  .brand .mark {
    margin-right: 4px;
  }
}
.mark {
  width: 18px;
  height: 18px;
  fill: currentColor;
  shape-rendering: crispEdges;
}
.mark .lit {
  fill: var(--sq-dim);
}
/* Chamber name beside the wordmark; phones keep the row for the period switch. */
.dateline {
  display: none;
}
@media (min-width: 48em) {
  .dateline {
    display: inline;
    align-self: center;
    margin-right: auto;
    padding-left: 14px;
    border-left: 1px solid var(--ink);
    font: 600 var(--t-label) / 1.3 var(--head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
  }
}

/* Period switcher: a native select at the right of the masthead. Native so it works
   with the phone picker and keyboards; 16px so iOS Safari doesn't zoom on focus. */
.periods {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.periods .lbl {
  display: none;
}
.periods select {
  appearance: none;
  font: 600 16px / 1.2 var(--head);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  min-height: 44px;
  padding: 0 34px 0 12px;
  cursor: pointer;
}
.periods select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.periods .px-arrow {
  position: absolute;
  right: 12px;
  pointer-events: none;
}
@media (min-width: 40em) {
  .periods .lbl {
    display: inline;
    font: 600 var(--t-label) / 1.3 var(--head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
  }
}

/* Downloads: an icon square on phones, icon + word from 40em. The menu drops from the
   masthead, right-aligned, and every choice is a 48px target. */
.dl {
  position: relative;
  flex: none;
}
.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font: 600 16px / 1.2 var(--head);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.dl-btn:hover,
.dl-btn[aria-expanded="true"] {
  background: var(--ink);
  color: var(--paper);
}
.px-dl {
  width: 16px;
  height: 16px;
  fill: currentColor;
  shape-rendering: crispEdges;
}
.dl-lbl {
  display: none;
}
@media (min-width: 40em) {
  .dl-btn {
    padding: 0 14px 0 12px;
  }
  .dl-lbl {
    display: inline;
  }
}
.dl-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(300px, calc(100vw - var(--gutter) - var(--gutter-r)));
  padding: 4px 14px 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.dl-menu[hidden] {
  display: none;
}
.dl-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 6px;
  font: 700 var(--t-label) / 1.3 var(--head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.dl-n {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.dl-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.dl-row button {
  min-height: 48px;
  font: 700 16px / 1.2 var(--head);
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.dl-row button.wide {
  grid-column: 1 / -1;
}
.dl-row button:hover {
  background: var(--ink);
  color: var(--paper);
}
.dl-note {
  margin: 8px 0 0;
  font: 400 13px / 1.4 var(--head);
  color: var(--ink-3);
}
.print-only {
  display: none;
}

/* ── Front page */
section.front {
  padding-top: 0;
}
.front h1 {
  font: 800 var(--t-display) / 0.94 var(--head);
  letter-spacing: -0.028em;
  margin: clamp(20px, 5vw, 48px) 0 14px;
  max-width: 13ch;
  text-wrap: balance;
}
.lede {
  font-size: var(--t-lede);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0;
}

.board {
  background: var(--board);
  color: var(--led);
  padding: 18px 0 20px;
  --u: min(15px, calc((100vw - 32px) / 25));
}
.led {
  font-family: var(--led-font);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
/* One scoreboard line, set entirely in the board's dot-matrix. */
.readout {
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--led-off);
  font: 900 clamp(17px, 4.8vw, 26px) / 1.2 var(--led-font);
  text-transform: uppercase;
  color: var(--led);
}
.readout .r {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-height: 44px;
  color: inherit;
  text-decoration: underline dotted 2px;
  text-underline-offset: 5px;
  -webkit-tap-highlight-color: transparent;
}
.readout .r:hover,
.readout .r:focus-visible {
  text-decoration-style: solid;
}
.readout .r:focus-visible {
  outline: 2px solid var(--led);
  outline-offset: 2px;
}
.readout .sep {
  color: var(--led-dim);
}
.readout .r.dim {
  color: var(--led-dim);
}
.chambers {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px 28px;
}
.hemi {
  margin: 0;
}
.hemi svg {
  display: block;
  width: calc(var(--cols, 25) * var(--u));
  height: auto;
  shape-rendering: crispEdges;
  touch-action: manipulation;
  cursor: pointer;
}
.hemi .s {
  fill: var(--led-off);
}
.hemi .c {
  outline: none;
}
.hemi .c.on {
  fill: var(--led);
}
.hemi .c.dim.on {
  fill: var(--led-dim);
}
.hemi .c.sel,
.hemi .c:focus-visible {
  stroke: var(--led);
  stroke-width: 0.18px;
  paint-order: stroke;
}
.hemi figcaption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--led-off);
  font: 700 var(--t-label) / 1 var(--head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--led-text);
}
.hemi figcaption small {
  margin-left: auto;
  font: 500 var(--t-label) / 1.2 var(--head);
  letter-spacing: 0.02em;
  text-transform: none;
  text-align: right;
}
.hemi figcaption .led {
  font-size: 26px;
  color: var(--led);
  letter-spacing: 0;
}
.ticker {
  min-height: 72px;
  margin: 18px 0 14px;
  padding: 10px 0 0;
  border-top: 1px solid var(--led-off);
  font: 500 15px/1.45 var(--head);
  color: var(--led-text);
}
.ticker.on {
  color: var(--led);
}
.ticker b {
  display: block;
  font: 900 22px/1.1 var(--led-font);
  margin-bottom: 2px;
}
.ticker span {
  color: var(--led-text);
}
.ticker .mv {
  display: block;
  color: var(--led);
  font-weight: 600;
}
.ticker a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  color: var(--led);
}
.key {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  font: 500 13px/1.35 var(--head);
  color: var(--led-text);
}
.key li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.k {
  width: 11px;
  height: 11px;
  flex: none;
}
.k.lit {
  background: var(--led);
}
.k.dim {
  background: var(--led-dim);
}
.k.off {
  background: var(--led-off);
}
.key.paper {
  color: var(--ink-2);
  margin-top: 18px;
}
.key.paper .k.lit {
  background: var(--ink);
}
.key.paper .k.dim {
  background: var(--sq-dim);
}
.key.paper .k.sen {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.fine {
  margin: 10px 0 0;
  font: 400 12px/1.4 var(--head);
  color: var(--led-text);
}
.board :focus-visible {
  outline-color: var(--led);
}
@media (min-width: 40em) {
  .board {
    --u: 14px;
    padding: 28px 0 28px;
  }
}
@media (min-width: 64em) {
  .board {
    --u: 19px;
    padding: 24px 0 32px;
  }
  .board .wrap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "readout readout" "chambers ticker" "key key" "fine fine";
    column-gap: 40px;
    align-items: end;
  }
  .readout {
    grid-area: readout;
  }
  .chambers {
    grid-area: chambers;
    flex-wrap: nowrap;
  }
  .ticker {
    grid-area: ticker;
    align-self: start;
    margin: 0;
    padding-top: 0;
    border-top: 0;
  }
  .ticker b {
    font-size: 30px;
  }
  .board .key {
    grid-area: key;
    margin-top: 22px;
  }
  .fine {
    grid-area: fine;
  }
  .front h1 {
    max-width: 20ch;
  }
}

/* Lede and the page's two actions as two blocks side by side; the actions read as a
   ruled sidebar. Phones stack them (side by side would leave ~150px per column). */
.front-intro {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(20px, 4vw, 36px);
}

.front-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

@media (min-width: 40em) {
  .front-intro {
    grid-template-columns: minmax(0, 1.4fr) minmax(11em, 1fr);
    align-items: start;
    column-gap: 28px;
  }
  .front-foot {
    align-items: flex-start;
    gap: 8px;
    padding-left: 20px;
    border-left: 1px solid var(--ink);
  }
  .front-foot .cta {
    align-self: stretch;
    justify-content: space-between;
  }
  .front-intro .lede {
    max-width: 60ch;
  }
  .front-foot {
    justify-content: flex-end;
  }
  .front-foot .prev {
    margin: 0;
    text-align: right;
  }
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  font: 700 16px/1 var(--head);
  text-decoration: none;
}
.cta:hover {
  background: var(--ink-2);
}
/* Secondary action: same shape as the primary, outlined instead of filled. */
.cta.ghost {
  background: none;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.cta.ghost:hover {
  background: var(--paper-2);
}
.link {
  display: inline-flex;
  align-items: center;
  font: 600 15px/1 var(--head);
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.link:hover {
  text-decoration-thickness: 2px;
}
.prev {
  flex-basis: 100%;
  margin: 4px 0 0;
  font: 400 var(--t-small) / 1.45 var(--head);
  color: var(--ink-3);
}
.prev:empty {
  display: none;
}
.prev button {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 12px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ── Sections: each opens under a heavy rule, like a new page of the paper. */
section {
  padding: clamp(32px, 6vw, 64px) 0 0;
}
main > section:last-child {
  padding-bottom: clamp(48px, 10vw, 96px);
}
h2 {
  font: 800 var(--t-h2) / 0.98 var(--head);
  letter-spacing: -0.022em;
  text-wrap: balance;
  margin: 0 0 clamp(22px, 4vw, 40px);
  padding-top: 14px;
  border-top: 4px solid var(--ink);
}
h2#por-que-t {
  border-top: none;
}
.sub {
  color: var(--ink-2);
  margin: 0 0 18px;
  max-width: 62ch;
}
.cols h3,
.sources h3 {
  font: 700 var(--t-label) / 1 var(--head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}

/* Por qué importa: three steps of one argument, read in order. */
.why {
  padding-top: 20px;
}

.why ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 28px;
  counter-reset: why;
}
.why li {
  counter-increment: why;
  display: grid;
  align-content: start;
  grid-template-columns: 52px 1fr;
  column-gap: 14px;
  border-top: 1px solid var(--ink);
  padding-top: 12px;
}
.why li::before {
  content: counter(why);
  grid-row: span 2;
  font: 900 64px/0.8 var(--led-font);
}
.why h3 {
  font: 700 var(--t-h3) / 1.15 var(--head);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.why li p {
  margin: 0;
  color: var(--ink-2);
  max-width: 60ch;
}
@media (min-width: 48em) {
  .why ol {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
  .why li {
    grid-template-columns: 1fr;
  }
  .why li + li {
    border-left: 1px solid var(--rule);
    padding-left: 32px;
    margin-left: -16px;
  }
  .why li::before {
    grid-row: auto;
    font-size: 88px;
    margin-bottom: 14px;
  }
}

/* Party ledger: one square per parliamentarian. */
.cols {
  display: grid;
  gap: 36px;
}
@media (min-width: 48em) {
  .cols {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}
.ledger {
  display: grid;
}
.line {
  display: grid;
  grid-template-columns: minmax(0, 9.5em) 1fr 2em;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding-block: 6px;
  border-bottom: 1px solid var(--rule);
  font: 500 15px/1.25 var(--head);
}
.line .lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sq {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.sq i {
  width: 13px;
  height: 13px;
  background: var(--ink);
}
.sq i.dim {
  background: var(--sq-dim);
}
.line .n {
  font: 900 20px/1 var(--led-font);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.none {
  font: 400 var(--t-small) var(--head);
  color: var(--ink-3);
  margin: 0;
}

/* Timeline: semesters as columns of stacked pixels. */
.timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 4px;
  border-bottom: 2px solid var(--ink);
}
/* Each semester stacks its squares from the baseline up, wrapping like a pile. */
.tcol {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: center;
  align-content: flex-start;
  gap: 3px;
  padding-bottom: 3px;
}
.dot {
  width: 14px;
  height: 14px;
  background: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
@media (min-width: 64em) {
  .dot {
    width: 22px;
    height: 22px;
  }
  .tcol {
    gap: 4px;
  }
}
.dot.sen {
  background: transparent;
  box-shadow: inset 0 0 0 3px var(--ink);
}
.dot.ind {
  background: var(--sq-dim);
}
.dot.on {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.taxis {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  margin-top: 8px;
  font: 900 13px/1 var(--led-font);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.taxis div {
  white-space: nowrap;
}
.tip {
  position: fixed;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  font: 500 var(--t-small) / 1.35 var(--head);
  padding: 7px 10px;
  z-index: 10;
  opacity: 0;
  max-width: min(260px, calc(100vw - 16px));
}

/* ── Other countries */
.scale {
  margin: 0 0 20px;
}
.lvl {
  display: inline-block;
  width: 11px;
  height: 11px;
  flex: none;
}
.lvl.pierde {
  background: var(--ink);
}
.lvl.parcial {
  background: color-mix(in srgb, var(--ink) 68%, var(--paper));
}
.lvl.futuro {
  background: var(--sq-dim);
}
.lvl.libre {
  box-shadow: inset 0 0 0 1.5px var(--ink-2);
}
.world {
  display: grid;
  gap: 16px;
}
.world .fine-print {
  margin-top: 8px;
}
@media (min-width: 64em) {
  .world {
    grid-template-columns: 3fr 2fr;
    gap: 40px;
    align-items: start;
  }
}
.map-box {
  margin: 0;
}
@media (min-width: 64em) {
  .map-box {
    position: sticky;
    top: 80px;
  }
}
.map {
  display: block;
  width: 100%;
  height: auto;
}
.map rect {
  fill: var(--rule);
  shape-rendering: crispEdges;
}
.map .c {
  cursor: pointer;
  touch-action: manipulation;
}
.map .pierde {
  fill: var(--ink);
}
.map .parcial {
  fill: color-mix(in srgb, var(--ink) 68%, var(--paper));
}
.map .futuro {
  fill: var(--sq-dim);
}
.map .libre {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1px;
}
.map .ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5px;
  stroke-dasharray: 3 3;
  pointer-events: none;
}
.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.picker button {
  font: 600 15px/1 var(--head);
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  touch-action: manipulation;
}
.picker button:hover {
  background: var(--paper-2);
}
.picker button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.picker button[aria-pressed="true"] .lvl.pierde {
  background: var(--paper);
}
.picker button[aria-pressed="true"] .lvl.libre {
  box-shadow: inset 0 0 0 1.5px var(--paper);
}
.country {
  border-top: 2px solid var(--ink);
  padding-top: 12px;
}
.country header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 8px;
}
.country h4 {
  font: 800 var(--t-h3) / 1.1 var(--head);
  letter-spacing: -0.025em;
  margin: 0;
}
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 var(--t-label) / 1.2 var(--head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.country p {
  margin: 0 0 8px;
  color: var(--ink-2);
}
.fine-print {
  margin-top: 28px;
  font-size: 15px;
}

/* ── Registry: one case per full-width ruled row. */
.filters {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
@media (min-width: 40em) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters input {
    grid-column: 1 / -1;
  }
}
@media (min-width: 64em) {
  .filters {
    grid-template-columns: 1.6fr 1fr 1.3fr 1.2fr;
  }
  .filters input {
    grid-column: auto;
  }
}
.filters input,
.filters select {
  font: 500 16px/1.2 var(--head); /* <16px makes iOS Safari zoom on focus */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 12px;
  min-height: 48px;
  width: 100%;
  min-width: 0;
}
.filters input::placeholder {
  color: var(--ink-3);
}
.filters input:focus-visible,
.filters select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.count {
  font: 600 var(--t-small) / 1.4 var(--head);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  margin: 0 0 4px;
}
.list {
  border-bottom: 2px solid var(--ink);
}
.case {
  display: grid;
  gap: 8px;
  padding: 18px 0 20px;
  border-top: 1px solid var(--ink);
}
.case:focus {
  outline: none;
}
.case.flash {
  animation: flash 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes flash {
  from {
    background: var(--paper-2);
    box-shadow: 0 0 0 12px var(--paper-2);
  }
}
.case .date {
  font: 900 18px/1 var(--led-font);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.case h4 {
  font: 800 var(--t-h3) / 1.08 var(--head);
  letter-spacing: -0.025em;
  margin: 0;
  overflow-wrap: anywhere;
}
.where {
  display: block;
  margin-top: 4px;
  font: 600 var(--t-label) / 1.3 var(--head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font: 700 15px/1.3 var(--head);
}
.move .from {
  color: var(--ink-3);
}
.case .body p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 64ch;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font: 700 11px/1 var(--head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 5px 7px;
}
.tag.strong {
  background: var(--ink);
  color: var(--paper);
}
.src {
  font: 400 var(--t-small) / 1.5 var(--head);
  color: var(--ink-3);
}
.src a {
  color: var(--ink);
  display: inline-block;
  padding-block: 4px;
}
.empty {
  padding: 40px 0;
  font: 500 16px/1.4 var(--head);
  color: var(--ink-3);
  border-top: 1px solid var(--ink);
}
@media (min-width: 48em) {
  .case {
    grid-template-columns: 7.5em minmax(0, 1fr) minmax(0, 1.5fr);
    grid-template-areas: "date who body" "date move body" "date tags body";
    grid-template-rows: auto auto 1fr;
    column-gap: 24px;
  }
  .case .date {
    grid-area: date;
    padding-top: 3px;
  }
  .case .who {
    grid-area: who;
  }
  .case .move {
    grid-area: move;
    align-self: start;
  }
  .case .tags {
    grid-area: tags;
    align-self: start;
    margin-top: 4px;
  }
  .case .body {
    grid-area: body;
  }
}

/* ── Methodology (inline, after the registry) */
.method-body {
  max-width: 72ch;
}
.method-body .sub {
  max-width: none;
}
.updated {
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.method {
  display: grid;
  gap: 20px;
}
@media (min-width: 48em) {
  .method {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
  .method-body {
    max-width: none;
  }
  .note,
  .sources {
    max-width: 72ch;
  }
}
.method h3 {
  font: 700 19px/1.2 var(--head);
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.method p {
  margin: 0;
  font-size: 16px;
  color: var(--ink-2);
}
.note {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--ink);
  font-size: 16px;
}
.sources {
  margin-top: 24px;
  font-size: 15px;
  color: var(--ink-2);
}
.sources p {
  margin: 0 0 8px;
}
.sources ul {
  margin: 0;
  padding-left: 18px;
}
.sources li {
  margin-bottom: 4px;
}

footer {
  border-top: 3px double var(--ink);
  padding: 16px 0 max(48px, calc(env(safe-area-inset-bottom) + 32px));
  font: 400 var(--t-small) / 1.5 var(--head);
  color: var(--ink-3);
}
footer p {
  margin: 0 0 6px;
  max-width: 70ch;
}
footer .link {
  font-size: inherit;
}
.rev {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.hemi .c.on {
  filter: drop-shadow(0 0 0.35px rgb(255 255 255 / 0.55));
}
@media (prefers-reduced-motion: reduce) {
  .case.flash {
    animation: none;
  }
}

/* ── Print / «Guardar como PDF»: the page as read, without controls. Backgrounds are forced
   on (print-color-adjust) for the board and squares, and cases are not split across pages. */
@media print {
  @page {
    margin: 14mm 12mm;
  }
  body {
    background: #fff;
  }
  header.mast {
    position: static;
    border-bottom-width: 3px;
  }
  /* Squares, dots and the board are drawn with backgrounds, which print drops by default. */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .dateline {
    display: inline;
    margin-left: auto;
    font: 600 var(--t-label) / 1.3 var(--head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .periods,
  .dl,
  .front-foot,
  .ticker,
  .filters,
  .picker,
  .tip,
  footer .link {
    display: none !important;
  }
  .print-only {
    display: block;
  }
  .print-meta {
    max-width: 1120px;
    margin: 8px auto 0;
    padding-inline: var(--gutter) var(--gutter-r);
    font: 400 11px / 1.4 var(--head);
    color: var(--ink-3);
    overflow-wrap: anywhere;
  }
  .print-filters {
    margin: 0 0 4px;
    font: 600 var(--t-small) / 1.4 var(--head);
    color: var(--ink-2);
  }
  h2,
  h3 {
    break-after: avoid;
  }
  .case,
  .country,
  .hemi,
  .why li,
  .method > div,
  .note {
    break-inside: avoid;
  }
  .case.flash {
    animation: none;
  }
}
