/* India's 100 Grandmasters - design tokens and layout.
   Stone paper, ink, a black-and-bone chessboard. One accent (Tamil Nadu), light + dark. Mobile first.
   Type: Rozha One (Indian Type Foundry) for display, Mukta (Ek Type) for everything else. Both SIL OFL, self-hosted. */

@font-face { font-family: "Rozha One"; src: url("../fonts/rozha-one-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mukta"; src: url("../fonts/mukta-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mukta"; src: url("../fonts/mukta-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Mukta"; src: url("../fonts/mukta-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --page: #f2f2ee;
  --surface: #fafaf7;
  --surface-2: #e6e6e0;
  --ink: #181816;
  --ink-2: #45453f;
  --muted: #5f5f58;       /* 5.8:1 on page */
  --grid: #deded7;
  --axis: #b8b8ae;
  --border: rgba(24, 24, 22, 0.12);
  --sq-light: #e6e4db;    /* the board is black and bone in both themes */
  --sq-dark: #23221f;
  --on-sq-light: #181816;
  --on-sq-dark: #e6e4db;
  --accent: #eb6834;      /* Tamil Nadu (categorical slot 2) */
  --series: #2671cc;      /* other states (categorical slot 1, one step darker so white text passes 4.5:1) */
  --on-accent: #181816;   /* text on an accent fill */
  --on-series: #ffffff;   /* text on a series fill */
  --accent-ink: #ad3f15;  /* accent used as text: passes 4.5:1 on page */
  --link: #1c5cab;
  --ok: #006300;
  --warn-bg: #fff1c7;
  --warn-ink: #5c4300;
  --display: "Rozha One", Georgia, serif;
  --text: "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-sm: 15px;
  --t-body: 18px;
  --t-lg: 24px;
  --t-xl: clamp(34px, 4.2vw, 48px);
  --t-2xl: clamp(44px, 6.4vw, 84px);
  --gutter: 16px;
  --prose: 66ch;
  --wide: 1280px;
  --radius: 0;
  /* Pawns carry an ink edge so they read on bone squares. Same fills as --accent and --series. */
  --pawn-tn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23eb6834' stroke='%23181816' stroke-width='.8' stroke-linejoin='round' d='M12 2.5a4.2 4.2 0 0 0-2.8 7.3H7.9v2h1.9c-.2 2.5-1 4.3-2.6 5.8v1.3H5.6v2.6h12.8v-2.6h-1.6v-1.3c-1.600-1.500-2.400-3.300-2.600-5.800h1.900v-2h-1.300A4.200 4.200 0 0 0 12 2.500z'/%3E%3C/svg%3E");
  --pawn-other: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232f7ad6' stroke='%23181816' stroke-width='.8' stroke-linejoin='round' d='M12 2.5a4.2 4.2 0 0 0-2.8 7.3H7.9v2h1.9c-.2 2.5-1 4.3-2.6 5.8v1.3H5.6v2.6h12.8v-2.6h-1.6v-1.3c-1.600-1.500-2.400-3.300-2.600-5.800h1.900v-2h-1.300A4.200 4.200 0 0 0 12 2.500z'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #121211;
    --surface: #1b1b1a;
    --surface-2: #272725;
    --ink: #f0f0ec;
    --ink-2: #c6c6bd;
    --muted: #a3a39a;
    --grid: #2d2d2b;
    --axis: #4a4a45;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #d95926;
    --series: #3987e5;
    --on-accent: #121211;
    --on-series: #121211;
    --accent-ink: #f08a5d;
    --link: #86b6ef;
    --ok: #0ca30c;
    --warn-bg: #3a2f10;
    --warn-ink: #f5d98a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121211;
  --surface: #1b1b1a;
  --surface-2: #272725;
  --ink: #f0f0ec;
  --ink-2: #c6c6bd;
  --muted: #a3a39a;
  --grid: #2d2d2b;
  --axis: #4a4a45;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #d95926;
  --series: #3987e5;
  --on-accent: #121211;
  --on-series: #121211;
  --accent-ink: #f08a5d;
  --link: #86b6ef;
  --ok: #0ca30c;
  --warn-bg: #3a2f10;
  --warn-ink: #f5d98a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--axis) transparent; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
::selection { background: var(--accent); color: var(--on-accent); }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--text);
  overflow-x: clip;
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; letter-spacing: -0.005em; text-wrap: balance; }
em { font-style: normal; font-weight: 600; }
strong { font-weight: 700; }
img { max-width: 100%; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--prose); margin: 0 auto; padding: 0 var(--gutter); }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: var(--t-xl); margin: 48px 0 12px; }
.prose h3 { font-size: var(--t-lg); margin: 32px 0 8px; }
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* ---------- header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--page); }
.nav { display: flex; align-items: center; gap: 4px 20px; min-height: 56px; font-size: var(--t-sm); }
@media (max-width: 420px) { .nav { gap: 4px 11px; font-size: 14.5px; } .nav .brand .txt { display: none; } }
.nav .brand { font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto; display: flex; align-items: center; gap: 10px; }
.nav .brand .logo { width: 22px; height: 22px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.nav .brand .logo i:nth-child(1), .nav .brand .logo i:nth-child(4) { background: var(--ink); }
.nav .brand .logo i:nth-child(2) { background: var(--accent); }
.nav .brand .logo i:nth-child(3) { background: var(--axis); }
.nav a.link { color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s; }
.nav a.link:hover { color: var(--ink); }
.nav a.link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.theme-toggle {
  border: 0; background: var(--surface-2); color: var(--ink); padding: 0;
  width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; flex: none;
}
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.draft-banner {
  background: var(--warn-bg); color: var(--warn-ink); font: 400 14px/1.4 var(--text);
  padding: 7px var(--gutter); text-align: center;
}
.draft-banner a { color: inherit; }

/* ---------- the story: text column + the board that stays on screen ---------- */
.story { display: block; }
.flow { min-width: 0; }
.rail { display: none; }
@media (min-width: 960px) {
  .story { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 37vw, 470px); column-gap: clamp(40px, 5vw, 80px); align-items: start; }
  .rail { display: block; position: sticky; top: 72px; }
  #hero-board, .hero-caption { display: none; }
}
.flow .prose { max-width: var(--prose); margin: 0; padding: 0; }
.flow .figure-row { padding: 0; margin: 0; max-width: none; }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0 0 12px; }
.rail-era { font: 400 var(--t-lg)/1.1 var(--display); }
.rail-count { font-size: var(--t-sm); color: var(--ink-2); text-align: right; }
.rail-count b { font: 400 var(--t-xl)/1 var(--display); color: var(--ink); font-variant-numeric: lining-nums; }
.rail .board-frame, .rail .overflow { width: min(100%, calc(100vh - 330px)); min-width: 280px; margin-left: auto; margin-right: auto; }
.rail-legend { font-size: 14px; line-height: 1.4; color: var(--ink-2); margin: 12px 0 0; text-align: center; }
.rail.only-tn .sq.on:not(.tn)::before { opacity: 0.22; }
.key-tn { color: var(--accent-ink); font-weight: 700; }
.key-other { color: var(--link); font-weight: 700; }

/* phones: the same board, small, pinned under the header */
.mini {
  position: sticky; top: 56px; z-index: 10; background: var(--page);
  display: flex; align-items: center; gap: 12px; padding: 8px 0; margin-bottom: 8px;
}
.mini-board { display: grid; grid-template-columns: repeat(8, 7px); flex: none; }
.mini-over { display: grid; grid-template-columns: repeat(12, 7px); flex: none; margin-left: auto; align-self: end; }
.mini i { display: block; width: 7px; height: 7px; background: var(--sq-light); transition: background-color .2s; }
.mini i.dk { background: var(--sq-dark); }
.mini-over i { background: var(--surface-2); }
.mini i.on { background: var(--series); }
.mini i.on.tn { background: var(--accent); }
.mini-text { min-width: 0; line-height: 1.15; }
.mini-era { display: block; font: 400 20px/1.15 var(--display); }
.mini-count { display: block; font-size: 14px; color: var(--ink-2); }
@media (max-width: 359px) { .mini-over { display: none; } }
@media (min-width: 960px) { .mini { display: none; } }

/* ---------- hero ---------- */
.hero { padding: 32px 0 24px; }
.hero > * { min-width: 0; }
.hero h1 { font-size: clamp(38px, 5.2vw, 72px); line-height: 1.04; margin: 0 0 20px; text-wrap: wrap; }
.hero h1 span { display: block; white-space: nowrap; }
.hero .dek { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.4; color: var(--ink); max-width: 30em; margin: 0 0 16px; }
.count-note { font-size: var(--t-sm); color: var(--ink-2); margin: 0; }
.hero-caption { font-size: 14px; line-height: 1.4; color: var(--ink-2); margin: 12px 0 0; }
#hero-board { margin-top: 24px; }
.primer { padding-bottom: 8px; }
@media (min-width: 960px) { .hero { padding-top: 56px; } }

/* ---------- chapters ---------- */
.chapter { padding: 72px 0 8px; scroll-margin-top: 140px; }
.chapter h2 { font-size: var(--t-xl); margin: 0 0 18px; max-width: 18em; }
.chapter > .prose + .figure-row, .chapter > .figure-row + .prose { margin-top: 32px; }
.statement { font: 400 clamp(22px, 2.2vw, 26px)/1.25 var(--display); margin: 32px 0; color: var(--ink); max-width: 25em; }
.statement sup { font-size: 13px; }
@media (min-width: 960px) { .chapter { padding-top: 112px; scroll-margin-top: 80px; } }

/* ---------- figures ---------- */
.figure { background: var(--surface); padding: 20px; margin: 32px 0 0; }
.figure .takeaway { font: 700 20px/1.3 var(--text); margin: 0 0 4px; color: var(--ink); }
.figure .sub { font-size: var(--t-sm); line-height: 1.4; color: var(--ink-2); margin: 0 0 14px; }
.figure .source, .source { font-size: 14px; line-height: 1.45; color: var(--muted); margin: 14px 0 0; }
.figure .source a, .source a { color: var(--muted); }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--text); fill: var(--muted); font-size: 13px; }
.chart .label-strong { fill: var(--ink); font-weight: 600; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; display: inline-block; }
.legend .sw.ring { background: transparent; border: 2px solid var(--ink); border-radius: 50%; width: 11px; height: 11px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; font-size: var(--t-sm); }
.btn {
  font: 600 var(--t-sm)/1 var(--text); border: 0; background: var(--surface-2); color: var(--ink);
  padding: 11px 16px; cursor: pointer; transition: background-color .15s, color .15s, transform .1s;
}
.btn:hover { background: var(--axis); }
.btn:active { transform: scale(0.97); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--page); }
input[type="range"] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.year-readout { font: 400 var(--t-lg)/1 var(--display); min-width: 3em; text-align: right; }
.arrivals { font-size: var(--t-sm); margin: 0; min-height: 3.2em; }
.arrivals .chips { margin-top: 8px; }
details.table-view { margin-top: 12px; font-size: var(--t-sm); }
details.table-view summary { cursor: pointer; color: var(--ink-2); padding: 4px 0; }
details.table-view .table-wrap { margin-top: 8px; max-height: 420px; overflow: auto; }
details.table-view table.data th, details.table-view table.data td { padding: 6px 10px; }

/* ---------- pictures ---------- */
.plate { margin: 32px 0 0; }
.plate img { display: block; width: 100%; height: auto; }
.plate.crop img { aspect-ratio: 5 / 4; object-fit: cover; object-position: 50% 76%; }
.plate.crop-face img { object-position: 50% 30%; }
.plate figcaption { font-size: 14px; line-height: 1.45; color: var(--muted); margin-top: 8px; }
.plate figcaption a { color: var(--muted); }
.anand { display: grid; gap: 20px; margin-top: 32px; }
.anand .plate { margin: 0; }
.anand .statement { margin: 0; align-self: center; }
@media (min-width: 620px) { .anand { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; } }
.faces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 620px) { .faces { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.faces a { display: block; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); }
.faces img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
.faces a:hover img { transform: scale(1.05); }
.credits { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* ---------- tooltip ---------- */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 260px;
  background: var(--ink); color: var(--page); font: 400 14px/1.4 var(--text);
  padding: 8px 10px; box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tip.show { opacity: 1; transform: none; }
.tip b { font-weight: 700; }
.tip .dim { opacity: 0.75; }

/* ---------- the board ---------- */
.board-wrap { display: grid; gap: 10px; }
.board-frame { display: grid; grid-template-columns: 16px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 18px; width: 100%; max-width: 560px; margin: 0 auto; }
.ranks { display: grid; grid-template-rows: repeat(8, minmax(0, 1fr)); }
.files { grid-column: 2; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.ranks span, .files span { display: grid; place-items: center; font-size: 13px; line-height: 1; color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); width: 100%; margin: 0; }
.overflow { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; width: 100%; max-width: 560px; margin: 0 auto; padding-left: 16px; }
.sq {
  position: relative; display: flex; align-items: center; justify-content: center;
  font: 400 clamp(14px, 2.4vw, 20px)/1 var(--display); color: var(--on-sq-light);
  background: var(--sq-light); text-decoration: none; aspect-ratio: 1;
}
.sq.dk { background: var(--sq-dark); color: var(--on-sq-dark); }
.overflow .sq { background: var(--surface-2); color: var(--ink); }
.sq::before {
  content: ""; position: absolute; inset: 7%; background: var(--pawn-other) center / contain no-repeat;
  opacity: 0; transform: scale(0.7) translateY(8%);
  transition: opacity .28s cubic-bezier(.16, 1, .3, 1), transform .28s cubic-bezier(.16, 1, .3, 1);
}
.sq.tn::before { background-image: var(--pawn-tn); }
.sq.on::before { opacity: 1; transform: none; }
.sq.on.f::after { content: ""; position: absolute; inset: 3%; border: 2px solid currentColor; border-radius: 50%; }
.sq.on:hover::before, .sq.on:focus-visible::before { transform: translateY(-5%) scale(1.1); }
.sq.on:focus-visible { outline-offset: -2px; z-index: 2; }
.sq.next { background: transparent; outline: 2px dashed var(--accent); outline-offset: -2px; color: var(--accent-ink); }
.sq.hl { background: #fff; outline: 3px solid var(--link); outline-offset: -3px; z-index: 3; color: #181816; }
.board-caption { font-size: 14px; line-height: 1.4; color: var(--ink-2); text-align: center; margin: 0; }

/* ---------- route (Chapter 1) ---------- */
.route { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 20px; }
.route b { display: block; font: 400 var(--t-lg)/1.15 var(--display); }
.route span { display: block; font-size: var(--t-sm); line-height: 1.4; color: var(--ink-2); }
@media (min-width: 620px) { .route { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

/* ---------- years set large (Chapter 2) ---------- */
.years { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
.years b { display: block; font: 400 var(--t-xl)/1 var(--display); font-variant-numeric: lining-nums; }
.years span { display: block; font-size: var(--t-sm); line-height: 1.4; color: var(--ink-2); margin-top: 4px; }
@media (min-width: 620px) { .years { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

/* ---------- to-scale timeline (Chapter 3): the gap is the point ---------- */
.span-line { list-style: none; margin: 24px 0 0; padding: 0 0 0 20px; position: relative; }
.span-line::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: var(--axis); }
.span-line li { position: relative; padding-top: calc(var(--gap, 0) * 7px); line-height: 1.4; }
.span-line li > span { position: relative; display: block; }
.span-line li > span::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; background: var(--ink); }
.span-line li.end > span::before { background: var(--accent); }
.span-line .yr { font-weight: 700; margin-right: 8px; font-variant-numeric: tabular-nums; }

/* ---------- what was in the room (Chapter 4) ---------- */
.inventory { display: grid; gap: 14px 32px; margin: 16px 0 0; }
@media (min-width: 620px) { .inventory { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.inventory dt { font: 400 var(--t-lg)/1.15 var(--display); }
.inventory dd { margin: 2px 0 0; font-size: var(--t-sm); line-height: 1.4; color: var(--ink-2); }

/* ---------- citations ---------- */
sup.cite { font: 600 12px/0 var(--text); }
sup.cite a { text-decoration: none; padding: 0 1px; color: var(--link); }
sup.cite a::before { content: "["; } sup.cite a::after { content: "]"; }
.status { font: 600 13px/1 var(--text); padding: 3px 7px; white-space: nowrap; }
.status.draft { background: var(--surface-2); color: var(--ink-2); }
.status.verified { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.status.disputed { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- your move: the ending is a field of ink in both themes ---------- */
.ending {
  --page: #181816; --surface: #242422; --surface-2: #33332f; --ink: #f2f2ee; --ink-2: #cfcfc6; --muted: #aeaea4;
  --border: rgba(255, 255, 255, 0.14); --accent-ink: #f08a5d; --link: #93bff2;
  background: var(--page); color: var(--ink); margin-top: 96px; padding: 72px 0 80px; scroll-margin-top: 56px;
}
.ending h2 { font-size: var(--t-2xl); line-height: 1.02; margin: 0 0 20px; }
.ending .prose { margin: 0; padding: 0; }
.ending-grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .ending-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; } }
.ending .note { font-size: var(--t-sm); color: var(--ink-2); }
.yourmove { display: grid; gap: 16px; background: var(--surface); padding: 20px; }
@media (min-width: 520px) { .yourmove { grid-template-columns: 170px minmax(0, 1fr); } }
.field { display: grid; gap: 4px; font-size: var(--t-sm); color: var(--ink-2); }
.field input, .field select, .search {
  font: 400 16px var(--text); padding: 10px 12px; border-radius: 0; border: 1px solid var(--axis);
  background: var(--surface); color: var(--ink); width: 100%;
}
.ending .field input, .ending .field select { background: var(--surface-2); border-color: transparent; }
.answer { font-size: var(--t-body); line-height: 1.45; min-width: 0; }
.answer .big { font: 400 var(--t-2xl)/1 var(--display); display: block; font-variant-numeric: lining-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: var(--t-sm); line-height: 1.3; padding: 5px 10px; background: var(--surface-2); color: var(--ink); text-decoration: none; transition: background-color .15s; }
a.chip:hover { background: var(--axis); }
.ending a.chip:hover { background: #4a4a45; }

/* ---------- roster: a wall of squares, like the board ---------- */
.page-head { padding-top: 40px; padding-bottom: 8px; }
.page-head h1 { font-size: var(--t-2xl); line-height: 1.02; margin: 0 0 10px; }
.page-head p { color: var(--ink-2); margin: 0; }
.toolbar { display: grid; gap: 10px; margin: 24px 0; }
@media (min-width: 760px) { .toolbar { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; } }
.result-count { font-size: var(--t-sm); color: var(--ink-2); margin: 0 0 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 168px), 1fr)); gap: 2px; }
.tile { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--ink); background: var(--surface); min-width: 0; }
.tile-pic { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: var(--sq-light); color: var(--on-sq-light); font: 400 clamp(36px, 4vw, 48px)/1 var(--display); }
.tile.dk .tile-pic { background: var(--sq-dark); color: var(--on-sq-dark); }
.tile-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
.tile:hover .tile-pic img { transform: scale(1.04); }
.tile-pawn { position: absolute; right: 4px; bottom: 4px; width: 30px; height: 30px; background: var(--pawn-other) center / contain no-repeat; }
.tile.tn .tile-pawn { background-image: var(--pawn-tn); }
.tile-pic img + .tile-pawn { background-color: var(--sq-light); }
.tile-text { padding: 9px 10px 12px; }
.tile .name { display: block; font-weight: 700; font-size: 16px; line-height: 1.2; }
.tile .meta { display: block; font-size: 14px; line-height: 1.3; color: var(--ink-2); margin-top: 3px; }
.tile:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.tag-woman { font-weight: 400; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.table-wrap { overflow-x: auto; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.data th { font-weight: 600; color: var(--ink-2); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
table.data th button { all: unset; cursor: pointer; }
table.data th button:focus-visible { outline: 2px solid var(--link); }
table.data td.num, table.data th.num { text-align: right; }
table.data tr:target { background: var(--warn-bg); }

/* ---------- records ---------- */
.records { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.records > * { min-width: 0; }
.records > nav.chips { margin: 8px 0 12px; }
.record { padding: 40px 0 8px; scroll-margin-top: 72px; }
.record h2 { font-size: var(--t-xl); margin: 0 0 8px; }
.record .lede { font-size: var(--t-body); line-height: 1.5; color: var(--ink-2); margin: 0 0 12px; max-width: var(--prose); }

/* ---------- profile ---------- */
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: end; padding: 36px 0 10px; }
.profile-no { margin: 0 0 4px; color: var(--ink-2); font-size: var(--t-body); }
.profile-place { margin: 6px 0 0; color: var(--ink-2); font-size: var(--t-sm); }
.avatar {
  width: 120px; height: 120px; display: grid; place-items: center; position: relative; overflow: hidden;
  font: 400 40px var(--display); color: var(--on-sq-dark); background: var(--sq-dark);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
@media (min-width: 720px) { .avatar { width: 168px; height: 168px; font-size: 56px; } }
.photo-credit { font-size: 14px; line-height: 1.4; color: var(--muted); margin: 6px 0 0; }
.photo-credit a { color: var(--muted); }
.profile-head h1 { margin: 0; font-size: var(--t-xl); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 2px; margin: 20px 0; }
.fact { background: var(--surface); padding: 12px 14px; min-width: 0; overflow-wrap: anywhere; }
.fact .k { font-size: 14px; color: var(--muted); }
.fact .v { font: 400 var(--t-lg)/1.2 var(--display); font-variant-numeric: lining-nums; }
.fact .v a { font: 600 18px/1.3 var(--text); }
.profile-grid { display: grid; gap: 32px; }
.profile-grid .figure { margin: 0; align-self: start; }
.profile-grid h2 { font-size: var(--t-lg); margin: 28px 0 8px; }
.profile-grid h2:first-child { margin-top: 0; }
.profile-grid ul { font-size: var(--t-sm); padding-left: 18px; }
@media (min-width: 860px) { .profile-grid { grid-template-columns: 1.4fr 1fr; } }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 32px 0; }

/* ---------- footer ---------- */
.support-strip { padding: 20px 0; background: var(--surface-2); font-size: var(--t-sm); line-height: 1.6; color: var(--ink); }
.support-strip p { margin: 0; }
.support-strip a { color: var(--ink); font-weight: 600; }
.support-strip + .site-footer { margin-top: 0; }
main + .support-strip { margin-top: 64px; }
.page-body { max-width: var(--prose); }
.page-body h2 { font-size: var(--t-lg); margin: 32px 0 8px; }
.page-body p, .page-body li { color: var(--ink-2); }
.btn-support { display: inline-block; text-decoration: none; background: var(--accent); color: var(--on-accent); }
.btn-support:hover { background: var(--accent); }
.site-footer { padding: 28px 0 48px; font-size: var(--t-sm); line-height: 1.6; color: var(--ink-2); }
.site-footer a { color: var(--ink-2); }

@media (forced-colors: active) {
  .sq.on { forced-color-adjust: none; }
}
@media print {
  .site-header, .draft-banner, .controls, .theme-toggle, .mini { display: none; }
  body { background: #fff; }
}
