@import url("fonts.css");

/* ============================================================
   ZK FIELD MANUAL — "Redesign v2"
   Dark-first console aesthetic: near-black panels, 1px hairlines,
   2px radii, a lime accent, JetBrains Mono for every label and
   figure, the system Helvetica stack for prose. A light theme is
   the same structure with the palette swapped.
   ============================================================ */

:root {
  --bg: #151719; --panel: #1a1d1e; --panel2: #1e2224; --sunk: #121415;
  --line: #2b2f31; --line2: #232729;
  --ink: #eceeed; --ink2: #b9bfbf; --muted: #8d9494;
  --acc: #c9f24d; --acc-t: #c9f24d; --acc-ink: #151719; --acc-soft: rgba(201, 242, 77, 0.08);
  --warn: #ff7a45;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  --side-w: 262px;
  --bar-h: 48px;
  --pad: clamp(16px, 2.4vw, 32px);
  --r: 2px;

  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f3f0; --panel: #ffffff; --panel2: #e9ebe5; --sunk: #e6e8e2;
  --line: #cfd3ca; --line2: #e2e5dd;
  --ink: #14170f; --ink2: #42473e; --muted: #5c6158;
  --acc: #b6e034; --acc-t: #42610a; --acc-ink: #14170f; --acc-soft: rgba(140, 180, 20, 0.14);
  --warn: #a63a06;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance;
}
p { margin: 0; }
a { color: var(--acc-t); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration: underline; }
::selection { background: var(--acc); color: var(--acc-ink); }
input, button { font: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

code { font-family: var(--mono); font-size: .86em; background: var(--panel2); border: 1px solid var(--line); padding: .06em .3em; border-radius: var(--r); }
strong { font-weight: 700; color: var(--ink); }

/* The two label voices of the system: a muted small-caps mono label, and an
   accent "eyebrow" that names what a block is. */
.label {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.label-accent { font-size: 10px; letter-spacing: 0.16em; color: var(--acc-t); }
.label-warn { color: var(--warn); }
h2.label { margin: 0; line-height: 1.4; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; width: 100%; align-items: stretch; background: var(--bg); }

.side {
  width: var(--side-w); flex: 0 0 var(--side-w);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  background: var(--sunk);
}
.side-head { padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.side-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-title { font-size: 15px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.side-title:hover { color: var(--acc-t); text-decoration: none; }
.side-meta { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 7px; }
.side-btns { display: flex; gap: 6px; flex: none; }

.side-search { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.side-search input {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); border-radius: var(--r); font-size: 12.5px;
}
.side-search input::placeholder { color: var(--muted); }
.side-search input:focus { border-color: var(--muted); outline: none; }
.side-hits { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 7px; }

.side-nav { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.nav-empty { padding: 16px 10px; }
.nav-empty p { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.45; }
.nav-empty .btn { margin-top: 10px; }

/* Tree rows: a caret cell and a link cell sharing one hover surface. */
.tn-row { display: flex; align-items: stretch; border-radius: var(--r); }
.tn-row:hover { background: var(--panel2); }
.tn-caret {
  width: 24px; flex: none; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 10px; padding: 0; border-radius: var(--r);
}
.tn-caret::before { content: "\25B8"; }
.is-open > .tn-row > .tn-caret::before { content: "\25BE"; }
.tn-caret.tn-dot { cursor: default; }
.tn-caret.tn-dot::before { content: "\00B7"; }
.tn-link {
  flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center;
  padding: 7px 8px 7px 0; color: var(--ink2); font-size: 13px; min-width: 0;
}
.tn-link:hover { color: var(--ink); text-decoration: none; }
.tn-link .tn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-num { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.tn-sec { margin-top: 2px; }
.tn-sec > .tn-kids { margin: 2px 0 6px 12px; border-left: 1px solid var(--line); padding-left: 6px; }
.tn-group .tn-caret { width: 20px; font-size: 9px; }
.tn-group .tn-link { padding: 5px 8px 5px 0; color: var(--muted); font-size: 12px; }
.tn-group .tn-link:hover { color: var(--ink); }
.tn-group .tn-num { font-size: 9px; }
.tn-group > .tn-kids { margin: 1px 0 4px 10px; border-left: 1px solid var(--line2); padding-left: 6px; }
.tn-kids { display: none; }
.is-open > .tn-kids { display: block; }
.tn-item {
  display: block; padding: 4px 8px; color: var(--muted); font-size: 11.5px; border-radius: var(--r);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tn-item:hover { background: var(--panel2); color: var(--ink); text-decoration: none; }
.tn-leaf {
  display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: center;
  padding: 7px 8px; color: var(--ink2); font-size: 13px; border-radius: var(--r);
}
.tn-leaf.tn-app { padding: 5px 8px; color: var(--muted); font-size: 12px; }
.tn-leaf:hover { background: var(--panel2); color: var(--ink); text-decoration: none; }
.tn-hr { height: 1px; background: var(--line); margin: 12px 8px; border: 0; }
/* the page you are on */
.tn-link[aria-current="page"], .tn-leaf[aria-current="page"], .tn-item[aria-current="page"] { color: var(--acc-t); }
.tn-sec > .tn-row > .tn-link[aria-current="page"] .tn-label { font-weight: 700; }
.tn-item[aria-current="page"] { box-shadow: inset 2px 0 0 var(--acc); }
/* filtering: nothing collapses, non-matches are hidden */
.side-nav.is-filtering .tn-kids { display: block; }
.side-nav [hidden] { display: none !important; }

.side-foot { border-top: 1px solid var(--line); padding: 11px 16px; font-family: var(--mono); font-size: 9.5px; line-height: 1.6; color: var(--muted); }
.side-foot a { color: var(--muted); }
.side-foot a:hover { color: var(--ink); }

.col { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ------------------------------------------------------------------- bar */

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--pad); height: var(--bar-h); flex: 0 0 var(--bar-h);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40; background: var(--bg);
}
.crumbs { min-width: 0; overflow: hidden; }
.crumbs ol {
  list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.crumbs li { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs li + li::before { content: "/"; margin-right: 7px; opacity: .5; }
.crumbs a { color: inherit; }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs li[aria-current] { color: var(--ink); }
.bar-actions { display: flex; align-items: center; gap: 6px; flex: none; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 11px; border: 1px solid var(--line); background: transparent; color: var(--ink2);
  border-radius: var(--r); line-height: 1.2; text-decoration: none; transition: border-color .12s, color .12s, background .12s;
}
.btn:hover { border-color: var(--muted); color: var(--ink); text-decoration: none; }
.btn-primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 700; }
.btn-primary:hover { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); filter: brightness(1.06); }
.btn-ghost { border-color: transparent; color: var(--acc-t); padding-inline: 0; }
.btn-ghost:hover { border-color: transparent; color: var(--ink); }
.btn-sm { font-size: 9.5px; padding: 5px 9px; color: var(--muted); }
.ibtn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; padding: 6px 9px; border: 1px solid var(--line);
  background: transparent; color: var(--ink2); cursor: pointer; border-radius: var(--r); line-height: 1.2;
}
.ibtn:hover { border-color: var(--muted); color: var(--ink); text-decoration: none; }
.ibtn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

.permalink {
  border: 1px solid var(--line); background: transparent; border-radius: var(--r);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding: 2px 5px; cursor: pointer; white-space: nowrap;
}
.permalink:hover { border-color: var(--muted); color: var(--ink); }
table.data tr .permalink { opacity: 0; transition: opacity 120ms; }
table.data tr:hover .permalink, table.data tr:focus-within .permalink { opacity: 1; }

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

.body { display: flex; flex-wrap: wrap; align-items: flex-start; }
main { flex: 1 1 540px; min-width: 0; padding-bottom: 56px; }
.doc { padding: 34px var(--pad) 0; scroll-margin-top: calc(var(--bar-h) + 8px); }
.blk { margin-top: 32px; }
.fact-v { font-size: 13.5px; margin-top: 6px; line-height: 1.35; }
.related + .related, .related-grid + .related { margin-top: 26px; }
.related-grid > .related { margin-top: 0; }
html:not(.js) #theme-btn, html:not(.js) .side-search { display: none; }
[id] { scroll-margin-top: calc(var(--bar-h) + 16px); }

.rail {
  flex: 1 1 172px; max-width: 220px; min-width: 160px;
  position: sticky; top: var(--bar-h); padding: 34px 16px 24px 8px; align-self: flex-start;
}
.rail-h { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.rail a { display: block; padding: 6px 0; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line2); }
.rail a:hover { color: var(--ink); text-decoration: none; }
.rail a.is-here { color: var(--acc-t); }
.rail-meta { margin-top: 16px; font-family: var(--mono); font-size: 9.5px; line-height: 1.6; color: var(--muted); }

/* -------------------------------------------------------------- headings */

.sec-h2 { font-size: clamp(26px, 2.8vw, 34px); margin-top: 12px; letter-spacing: -0.035em; max-width: 24ch; }
.sec-intro { font-size: 15px; line-height: 1.55; margin-top: 14px; max-width: 76ch; color: var(--ink2); text-wrap: pretty; }
.sec-intro + .sec-intro { margin-top: 10px; }
.sec-intro a, .cell-body a, .note a, .guide-section a, .opt-desc a, .index-list a, .steps a, .glossary a, .pit a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--acc-t) 45%, transparent); }
.sec-intro a:hover, .cell-body a:hover, .note a:hover, .guide-section a:hover { text-decoration-color: currentColor; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.head-row .sec-h2 { margin-top: 0; }
.opt-cat { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); margin-top: 8px; }

/* ------------------------------------------------------------------- hero */

.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; align-items: end; }
.hero h1 { font-size: clamp(27px, 3vw, 38px); margin-top: 14px; max-width: 19ch; letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; color: var(--acc-t); }
.hero-lede { font-size: 15px; line-height: 1.55; margin-top: 16px; max-width: 62ch; color: var(--ink2); text-wrap: pretty; }
.hero-lede + .hero-lede { font-size: 13.5px; color: var(--muted); margin-top: 12px; }

/* ---------------------------------------------------------------- figures */

figure.plate { margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
figure.plate .plate-body { padding: 14px 16px; background: var(--panel2); }
figure.plate svg { width: 100%; height: auto; display: block; }
figure.plate figcaption { border-top: 1px solid var(--line); padding: 8px 12px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.plate-wide { margin-top: 22px; }
.plate-wide figure.plate .plate-body { padding: 18px 22px; }

/* --------------------------------------------------------------- xrefs */

.xrefs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.xref {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line); padding: 5px 9px; border-radius: var(--r); color: var(--ink2);
}
.xref::before { content: "\2192\00a0"; }
.xref:hover { border-color: var(--acc); color: var(--ink); text-decoration: none; }

/* -------------------------------------------------------------- callouts */

.note { border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; margin-top: 18px; background: var(--panel); }
.note .label { display: block; }
.note p { font-size: 13px; line-height: 1.55; margin-top: 7px; color: var(--ink2); max-width: 88ch; }
.note.warn { border-left: 3px solid var(--warn); }
.note.warn .label { color: var(--warn); }
.note.recommendation { border-left: 3px solid var(--acc); }
.note.recommendation .label { color: var(--acc-t); }

.answer { margin-top: 20px; border-left: 2px solid var(--acc); padding-left: 15px; max-width: 70ch; }
.answer .label { display: block; margin-bottom: 6px; }
.answer p { font-size: 16px; line-height: 1.5; }

/* ----------------------------------------------------- hairline card grid */

/* The system's grid device: cells on a 1px gap over the line colour, so the
   hairlines never double and the outer border matches the inner ones. */
.gridrule {
  display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r);
  margin-top: 12px; overflow: hidden;
}
.gridrule > * { background: var(--panel); padding: 13px 15px; min-width: 0; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-auto-lg { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g-auto-md { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g-auto-sm { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.g-facts { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
@media (max-width: 720px) { .g-2, .g-4 { grid-template-columns: 1fr; } }

.cell-kicker { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cell-title { font-size: 14px; margin-top: 7px; }
.cell-title a { color: inherit; }
.cell-title a:hover { color: var(--acc-t); text-decoration: none; }
.cell-body { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.cell-stat { font-family: var(--mono); font-size: 9.5px; color: var(--acc-t); margin-top: 10px; }

.criteria { counter-reset: crit; }
.criteria > * { counter-increment: crit; }
.criteria > *::before { content: counter(crit, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--acc-t); }
.crit-how { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line2); font-size: 12px; line-height: 1.5; color: var(--ink2); }
.crit-how b { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 4px; }

/* ------------------------------------------------------------ row lists */

.rows { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.row {
  display: grid; gap: 18px; padding: 11px 15px; border-bottom: 1px solid var(--line2); color: var(--ink); align-items: baseline;
}
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--panel2); text-decoration: none; color: var(--ink); }
.row-opt { grid-template-columns: minmax(160px, 0.9fr) minmax(150px, 0.9fr) 1.5fr; }
.row-name { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.row-cat { font-family: var(--mono); font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.row-fit { font-size: 12.5px; color: var(--ink2); line-height: 1.45; }
@media (max-width: 640px) { .row-opt { grid-template-columns: 1fr; gap: 4px; } }

.pitgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px; margin-top: 12px; }
.pitlink {
  display: block; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 13px;
  color: var(--ink); font-size: 13px; line-height: 1.4; background: var(--panel);
}
.pitlink:hover { border-color: var(--warn); text-decoration: none; color: var(--ink); }

/* q / a rows */
.qa-list { margin-top: 10px; border-top: 1px solid var(--line); }
.qa-row {
  display: grid; grid-template-columns: minmax(210px, 0.85fr) 1.7fr; gap: 22px; padding: 11px 4px;
  border-bottom: 1px solid var(--line2); color: var(--ink); align-items: baseline;
}
.qa-row:hover { background: var(--panel); text-decoration: none; color: var(--ink); }
.qa-q { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.qa-a { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) { .qa-row { grid-template-columns: 1fr; gap: 6px; } }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sec-head .more { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ------------------------------------------------------------- console */

.console { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-top: 28px; overflow: hidden; }
.console-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.console-head h2 { font-size: 19px; margin-top: 6px; }
.console-chips { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; }
.console-count { display: flex; align-items: flex-end; gap: 16px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.console-n { font-family: var(--mono); font-size: 44px; line-height: 0.82; font-weight: 700; color: var(--acc-t); letter-spacing: -0.04em; }
.console-count > div:last-child { padding-bottom: 3px; }
.console-of { font-size: 14px; color: var(--ink); }
.console-sum { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.console-cols, .console-row {
  display: grid; grid-template-columns: minmax(140px, 1fr) minmax(100px, 0.8fr) minmax(135px, 1.25fr) minmax(125px, 1.1fr); gap: 16px;
}
.console-cols { padding: 8px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.console-row { padding: 10px 16px; border-bottom: 1px solid var(--line2); color: var(--ink); align-items: baseline; }
.console-row:hover { background: var(--panel2); text-decoration: none; color: var(--ink); }
.console-row .r-name { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.console-row .r-mat { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.console-row .r-cell { font-family: var(--mono); font-size: 11px; color: var(--ink2); line-height: 1.4; }
.console-out { padding: 12px 16px 15px; background: var(--sunk); }
.console-out .label { display: block; margin-bottom: 8px; }
.out-chips { display: flex; flex-wrap: wrap; gap: 5px 6px; }
.out-chip { font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--line2); padding: 4px 8px; border-radius: var(--r); }
.out-chip span { color: var(--warn); }
@media (max-width: 720px) {
  .console-cols { display: none; }
  .console-row { grid-template-columns: 1fr; gap: 4px; }
  .console-row .r-cell::before { content: attr(data-col) " "; color: var(--muted); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
}

/* ------------------------------------------------------------ deck cards */

.deck { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); margin-top: 12px; overflow: hidden; }
.deck-card { background: var(--panel); color: var(--ink); display: block; }
.deck-card:hover { background: var(--panel2); text-decoration: none; color: var(--ink); }
.deck-art {
  aspect-ratio: 3 / 2; background-color: var(--panel2);
  background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 9px);
  display: flex; align-items: flex-end; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.deck-art .deck-big { position: absolute; right: 8px; top: 2px; font-family: var(--mono); font-size: 72px; font-weight: 700; letter-spacing: -0.06em; color: var(--acc-t); opacity: .28; line-height: 1; }
.deck-art .deck-slot { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.deck-body { padding: 12px 14px 14px; }
.deck-body h3 { font-size: 15px; margin-top: 7px; }

/* --------------------------------------------------------- chips / filter */

.filter { margin-top: 16px; }
.filter-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-count { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--acc-t); margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 10.5px; padding: 6px 11px; border: 1px solid var(--line);
  background: transparent; color: var(--ink2); cursor: pointer; border-radius: var(--r);
  transition: border-color .12s, color .12s, background .12s;
}
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 700; }
.filter-empty { margin: 12px 0 0; border-left: 2px solid var(--warn); padding-left: 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink2); max-width: 64ch; }
.console .filter-empty { margin: 12px 16px 14px; }

/* ----------------------------------------------------------------- tables */

.table-wrap { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 900px; }
table.data caption {
  text-align: left; padding: 9px 15px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
table.data thead th {
  text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; background: var(--panel);
}
table.data tbody tr { border-bottom: 1px solid var(--line2); vertical-align: top; }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: var(--panel2); }
table.data th[scope="row"] { padding: 11px 14px; font-weight: 700; font-size: 14px; letter-spacing: -0.02em; text-align: left; }
table.data th[scope="row"] a { color: var(--ink); }
table.data th[scope="row"] a:hover { color: var(--acc-t); text-decoration: none; }
table.data td { padding: 11px 14px; color: var(--ink2); font-family: var(--mono); font-size: 11px; line-height: 1.45; }
table.data td.t-prose { font-family: var(--sans); font-size: 12.5px; min-width: 22ch; }
.row-name-cell { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
tr.is-out { opacity: .3; }
tr.is-out:hover { opacity: .55; }

/* status pips: accent = yes, warn = no, outlines = partial / unknown */
.pip { display: inline-flex; align-items: center; gap: 6px; }
.pip::before { content: ""; width: 7px; height: 7px; flex: none; margin-top: 1px; border-radius: 1px; background: var(--muted); }
.pip.g::before { background: var(--acc); }
.pip.c::before { background: var(--muted); }
.pip.w::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink2); }
.pip.r::before { background: var(--warn); }
.pip.n::before { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- options */

.opt-desc { font-size: 13.5px; color: var(--ink2); line-height: 1.55; }
.opt { display: flex; flex-direction: column; gap: 10px; }
.opt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.opt-top h3, .opt-top h4 { font-size: 17px; letter-spacing: -0.02em; }
.opt-top h3 a, .opt-top h4 a { color: inherit; }
.opt-top .opt-cat { margin-top: 3px; }
.opt-lists { display: grid; gap: 10px; }
ul.opt-pro, ul.opt-con { list-style: none; margin: 11px 0 0; padding: 0; display: grid; gap: 8px; }
ul.opt-pro li, ul.opt-con li { display: grid; grid-template-columns: 14px 1fr; gap: 5px; font-size: 13.5px; line-height: 1.45; color: var(--ink2); }
ul.opt-pro li::before, ul.opt-con li::before { font-weight: 700; }
ul.opt-pro li::before { content: "+"; color: var(--acc-t); }
ul.opt-con li::before { content: "\2212"; color: var(--warn); }
.opt-fit { margin-top: 18px; border: 1px solid var(--acc); border-radius: var(--r); background: var(--acc-soft); padding: 15px 17px; }
.opt-fit b { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc-t); font-weight: 500; }
.opt-fit span { display: block; font-size: 15px; line-height: 1.5; margin-top: 8px; }
.gridrule .opt-fit { margin-top: auto; padding: 10px 12px; }
.gridrule .opt-fit span { font-size: 13px; margin-top: 5px; }
.opt-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 12px; font-family: var(--mono); font-size: 10px; color: var(--muted); line-height: 1.5; }
.opt-more { margin-left: auto; }
.facts-src { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 7px; }
.badge { border: 1px solid var(--acc); border-radius: var(--r); padding: 8px 12px; background: var(--acc-soft); }
.badge .label { display: block; }
.badge b { display: block; font-size: 14px; margin-top: 4px; }
.badge.is-out { border-color: var(--warn); }
.badge.is-out .label { color: var(--warn); }

.sibs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sib { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--line); padding: 6px 10px; border-radius: var(--r); color: var(--ink2); }
.sib:hover { border-color: var(--acc); color: var(--ink); text-decoration: none; }

/* ------------------------------------------------------------------ steps */

ol.steps { list-style: none; counter-reset: st; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
ol.steps > li { counter-increment: st; display: grid; grid-template-columns: 48px 1fr; gap: 16px; border-bottom: 1px solid var(--line2); padding: 16px 0; }
ol.steps > li::before { content: counter(st, decimal-leading-zero); font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: -0.04em; color: var(--muted); line-height: 1; }
ol.steps h2, ol.steps h3, ol.steps h4 { font-size: 15px; letter-spacing: -0.015em; }
ol.steps p { font-size: 13.5px; color: var(--ink2); margin-top: 7px; line-height: 1.55; max-width: 76ch; }

/* --------------------------------------------------------------- pitfalls */

.pit h3 { font-size: 15px; letter-spacing: -0.01em; }
.pit h3 a { color: inherit; }
.pit h3 a:hover { color: var(--warn); text-decoration: none; }
.pit p { font-size: 13px; color: var(--ink2); margin-top: 8px; line-height: 1.5; }
.pit .fix { margin-top: 12px; border-left: 2px solid var(--acc); padding-left: 12px; }
.pit .fix b { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--acc-t); font-weight: 500; margin-bottom: 4px; }
.pit .fix span { font-size: 13px; line-height: 1.5; color: var(--ink2); }
.pit-more { margin-top: 8px; font-size: 12.5px; }

/* --------------------------------------------------------------- related */

.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px; margin-top: 30px; }
.related .label { display: block; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { border-bottom: 1px solid var(--line2); padding: 9px 0; font-size: 13.5px; line-height: 1.4; }
.related li a { color: var(--ink); }
.related li a:hover { color: var(--acc-t); text-decoration: none; }
.related li span { color: var(--muted); font-size: 11.5px; font-family: var(--mono); margin-left: 6px; }
.related p { font-size: 13px; line-height: 1.5; color: var(--ink2); padding: 9px 0; }
.related p.mono { font-size: 10px; color: var(--muted); padding-top: 0; }
.related:only-child { grid-column: 1 / -1; }
.foot-link { margin-top: 14px; font-size: 12.5px; }

/* ---------------------------------------------------------------- sources */

.sources { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 12px; }
.sources > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sources > summary::-webkit-details-marker { display: none; }
.sources > summary::before { content: "+"; color: var(--acc-t); font-weight: 700; }
.sources[open] > summary::before { content: "\2212"; }
.sources > summary:hover { color: var(--ink); }
.sources > .label { display: block; }
.sources ol { list-style: none; counter-reset: src; margin: 12px 0 0; padding: 0; }
.sources li { counter-increment: src; display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line2); font-size: 12.5px; }
.sources li::before { content: "[" counter(src) "]"; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.sources a { color: var(--ink2); }
.sources a:hover { color: var(--ink); }
.src-kind { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-left: 8px; }

/* -------------------------------------------------------------- glossary */

.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 40px; margin: 22px 0 0; }
.glossary > div { border-top: 1px solid var(--line2); padding: 13px 0; }
.glossary dt { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; display: flex; gap: 8px; align-items: baseline; }
.glossary dd { font-size: 13px; color: var(--ink2); margin: 5px 0 0; line-height: 1.5; }

/* ------------------------------------------------------------------ cite */

.cite-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 22px; max-width: 1040px; }
.cite-box { border: 1px solid var(--line); border-radius: var(--r); padding: 15px 17px; background: var(--panel); }
.cite-box pre { margin: 10px 0 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: var(--ink2); }
.cite-box .btn { margin-top: 14px; }
.cite-this { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 12px; }
.cite-this > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cite-this > summary::-webkit-details-marker { display: none; }
.cite-this > summary::before { content: "+"; color: var(--acc-t); font-weight: 700; }
.cite-this[open] > summary::before { content: "\2212"; }
.cite-this pre { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); font-family: var(--mono); font-size: 11.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink2); }

/* ----------------------------------------------------------- page furniture */

.byline {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin-top: 18px; padding: 10px 0;
  border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--muted);
}
.byline .by-who { color: var(--ink2); }
.byline .by-role { color: var(--muted); }
.byline a { color: var(--muted); }
.byline a:hover { color: var(--ink); }

.prov { display: flex; flex-wrap: wrap; gap: 8px 26px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--muted); }

.index-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.index-list li { font-size: 13px; line-height: 1.55; color: var(--ink2); }
.index-list b { display: block; color: var(--ink); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; }

.guide-section { margin-top: 26px; max-width: 84ch; }
.guide-section h2, .guide-section h3, .guide-section h4 { font-size: 16px; }
.guide-section p, .guide-section li { font-size: 14.5px; line-height: 1.65; color: var(--ink2); }
.guide-section p { margin-top: 10px; }
.guide-section ul { padding-left: 22px; margin: 10px 0 0; }
.guide-section li + li { margin-top: 8px; }

.doc-part { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
.doc-part:first-of-type { border-top: 0; }

/* ------------------------------------------------------------------ pager */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; border-top: 1px solid var(--line); }
.pager-link { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; color: var(--ink); }
.pager-link:hover { text-decoration: none; color: var(--ink); }
.pager-link:hover .pager-title { color: var(--acc-t); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-dir { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pager-prev .pager-dir::before { content: "\2190\00a0 "; }
.pager-next .pager-dir::after { content: " \00a0\2192"; }
.pager-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 9px; transition: color .12s; }
.pager-next .pager-title { flex-direction: row-reverse; }
.pager-num { font-family: var(--mono); font-size: 9.5px; color: var(--muted); font-weight: 400; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; gap: 0; } .pager-next { text-align: left; align-items: flex-start; border-top: 1px solid var(--line2); } .pager-next .pager-title { flex-direction: row; } }

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

footer.site { padding: 40px var(--pad) 0; margin-top: 8px; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.foot-grid .label { display: block; margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.foot-grid a { font-size: 12.5px; color: var(--ink2); }
.foot-grid a:hover { color: var(--ink); text-decoration: none; }
.foot-grid .tn-num { margin-right: 4px; }
.foot-note { margin-top: 24px; font-size: 12.5px; color: var(--muted); max-width: 80ch; line-height: 1.55; }

/* ----------------------------------------------------------------- toast */

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 200%);
  background: var(--acc); color: var(--acc-ink); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 700; padding: 10px 16px; border-radius: var(--r); z-index: 100;
  transition: transform .28s cubic-bezier(.2, .8, .3, 1);
}
#toast.show { transform: translate(-50%, 0); }

/* ------------------------------------------------------------------- a11y */

.skip { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--acc); color: var(--acc-ink); padding: 10px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.skip:focus { left: 8px; top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* -------------------------------------------------------------- responsive */

.side-toggle { display: none; }
@media (max-width: 1100px) { .rail { display: none; } }
@media (max-width: 900px) {
  .shell { display: block; }
  .side { width: auto; flex: none; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-toggle { display: inline-flex; }
  html.js .side:not(.is-open) .side-search,
  html.js .side:not(.is-open) .side-nav,
  html.js .side:not(.is-open) .side-foot { display: none; }
  .side-nav { max-height: 60vh; }
  .crumbs { display: none; }
  .bar-actions { margin-left: auto; }
  .hero-grid { align-items: start; }
}
@media (max-width: 560px) {
  .btn-txt { display: none; }
  .head-row { align-items: flex-start; }
}

/* --------------------------------------------------------------- printing */

@media print {
  :root {
    --bg: #fff; --panel: #fff; --panel2: #f3f3f1; --sunk: #fff; --line: #bbb; --line2: #ddd;
    --ink: #111; --ink2: #333; --muted: #666; --acc: #6a8f00; --acc-t: #3d5a00; --acc-ink: #fff; --acc-soft: #f4f8e6; --warn: #a63a06;
  }
  .side, .bar, .rail, .filter, .skip, #toast, .btn, .permalink, .pager, .cite-this, .foot-link, .console, .badge { display: none !important; }
  .doc-part { break-before: page; }
  .shell, .body { display: block; }
  .doc, footer.site { padding: 18px 0; }
  table.data { min-width: 0; font-size: 8pt; }
  table.data td { font-size: 8pt; }
  .gridrule > *, ol.steps > li, .pit, .opt, figure.plate, .row, .qa-row { break-inside: avoid; }
  h1, h2, h3, h4 { break-after: avoid; }
  a { color: inherit; }
  a[href^="http"]::after { content: " <" attr(href) ">"; font-family: var(--mono); font-size: 7pt; color: #444; word-break: break-all; }
}

/* ------------------------------------------------------------- plates */

/* Deck cards carry a section plate when one exists; the striped slot with a
   numeral is the fallback. */
.deck-art.has-plate { background-image: none; padding: 0; display: block; }
.deck-art.has-plate svg { width: 100%; height: 100%; display: block; }
.why-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; margin-top: 18px; }
.why-grid .note { margin-top: 0; }
.why-grid figure.plate .plate-body { padding: 12px 14px; }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr; } }
