:root {
  /* Light theme */
  --desk: #d9dde2;
  --sheet: #ffffff;
  --ink: #111317;
  --grey: #555b63;
  --hair: #d3d7dc;
  --line: #9aa0a8;
  --red: #b0101f;
  --red-hover: #8c0c18;
  --tint: #f3f4f6;
  --on-red: #ffffff;
  --bar-bg: #111317;
  --bar-fg: #ffffff;
  --bar-muted: #b9bec4;
  --field-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08);
  /* Playing cards stay light in both themes, like real cards */
  --card-bg: #ffffff;
  --card-ink: #111317;
  --card-red: #c8102e;
  --card-edge: #9aa0a8;
  --pad: 64px;
  color-scheme: light;
}
/* Dark theme is the default; [data-theme="light"] opts out. */
:root:not([data-theme="light"]) {
  --desk: #0c0e11;
  --sheet: #16181c;
  --ink: #e9eaec;
  --grey: #a3a9b1;
  --hair: #2b2f35;
  --line: #5c636c;
  --red: #ff5c63;
  --red-hover: #ff7a80;
  --tint: #1e2126;
  --on-red: #111317;
  --bar-bg: #000000;
  --bar-fg: #ffffff;
  --bar-muted: #8f959d;
  --field-bg: #0f1114;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4);
  --card-edge: #3a3f46;
  color-scheme: dark;
}
@media (max-width: 760px) { :root { --pad: 22px; } }

* { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--desk);
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 100;
  font-size: 17px;
  line-height: 1.55;
  padding: 0 16px 48px;
}
a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--red); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--sheet); padding: 8px 12px; z-index: 10; }

/* ---------- site header ---------- */
header.site {
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  padding: 18px 0 14px;
}
.brand {
  font-weight: 900; font-variation-settings: "wdth" 125; text-transform: uppercase;
  font-size: 15px; letter-spacing: .02em; text-decoration: none;
}
header.site ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
header.site nav a { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--grey); }
header.site nav a:hover, header.site nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); }

.crumbs { max-width: 1000px; margin: 0 auto 10px; font-size: 13px; color: var(--grey); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--line); }
.crumbs a { color: var(--grey); }

/* ---------- document sheet ---------- */
.sheet {
  display: block;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--sheet);
  box-shadow: var(--shadow);
}
.docbar {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px;
  background: var(--bar-bg); color: var(--bar-fg);
  padding: 12px var(--pad);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.docbar span:last-child { font-weight: 500; color: var(--bar-muted); }
.inner { padding: 52px var(--pad) 56px; }
@media (max-width: 760px) { .inner { padding-top: 32px; padding-bottom: 44px; } }

.kicker {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--red); margin: 0 0 16px;
}
h1 {
  margin: 0;
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  text-transform: uppercase;
  font-size: clamp(27px, 7vw, 76px);
  line-height: .92;
  letter-spacing: -.01em;
  overflow-wrap: break-word;
}
.lede { max-width: 680px; margin: 24px 0 0; font-size: 19px; color: var(--grey); }

.meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 40px 0 0; border-top: 6px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.meta { overflow: hidden; }
.meta div { padding: 12px 16px 14px; border-left: 1px solid var(--hair); margin-left: -1px; }
.meta div:first-child { padding-left: 0; border-left: 0; margin-left: 0; }
.meta dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--grey); }
.meta dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; }

/* ---------- contents ---------- */
.contents { margin: 40px 0 0; }
.contents h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.contents ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.contents li { break-inside: avoid; border-top: 1px solid var(--hair); }
.contents a { display: flex; gap: 12px; padding: 7px 0; text-decoration: none; font-size: 15px; }
.contents a span { color: var(--red); font-weight: 700; min-width: 72px; font-size: 13px; padding-top: 1px; }
.contents a:hover { text-decoration: underline; }
@media (max-width: 600px) { .contents ol { columns: 1; } }

/* ---------- articles ---------- */
.article > h2 {
  margin: 64px 0 8px;
  font-size: 28px; font-weight: 800; text-transform: uppercase;
  font-variation-settings: "wdth" 112;
  line-height: 1.08;
}
h2 .n {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 700; color: var(--red); letter-spacing: .1em;
  font-variation-settings: "wdth" 100;
}
.article h3 { margin: 32px 0 8px; font-size: 18px; font-weight: 800; font-variation-settings: "wdth" 108; }
.intro { margin: 0 0 18px; color: var(--grey); font-size: 16px; max-width: 700px; }
.prose { margin: 0 0 16px; max-width: 720px; }

.rule {
  display: grid; grid-template-columns: 56px minmax(0, 1fr);
  padding: 12px 0; border-top: 1px solid var(--hair);
}
.rule > b { font-weight: 700; font-size: 14px; color: var(--red); font-variant-numeric: tabular-nums; padding-top: 2px; }
.rule p { margin: 0; max-width: 720px; }
.rule .sub { margin-top: 6px; font-size: 15px; color: var(--grey); }
.rule dfn, .prose dfn { font-style: normal; font-weight: 700; }

.list, .steps { margin: 0 0 18px; padding-left: 22px; max-width: 720px; }
.list li, .steps li { margin: 4px 0; }
.steps li::marker { color: var(--red); font-weight: 700; }

/* ---------- provisions ---------- */
.provision {
  display: grid; grid-template-columns: 56px minmax(0, 1fr);
  margin: 22px 0; padding: 16px 20px 16px 0;
  background: var(--tint);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.provision > b { font-size: 14px; font-weight: 800; color: var(--red); padding: 2px 0 0 14px; }
.provision .label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--grey); }
.provision p { margin: 4px 0 0; font-weight: 700; font-size: 18px; }
.provision.final { margin-top: 56px; }

/* ---------- examples ---------- */
.example { margin: 20px 0; border: 1px solid var(--ink); max-width: 760px; }
.example-head {
  padding: 6px 14px; border-bottom: 1px solid var(--ink);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.example-body { padding: 14px; }
.example-body > :last-child { margin-bottom: 0; }
.example-title { margin: 0 0 8px; font-weight: 700; }
.example-body p { margin: 0 0 10px; }

/* ---------- tables ---------- */
.table-wrap { margin: 18px 0 22px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption { text-align: left; font-size: 13px; color: var(--grey); padding-bottom: 8px; }
thead th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--grey);
  border-bottom: 2px solid var(--ink); padding: 8px 12px 8px 0;
}
tbody th, tbody td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hair); }
tbody th { font-weight: 700; }

/* ---------- cards ---------- */
.cards { display: inline-flex; flex-wrap: wrap; gap: 3px; max-width: 100%; vertical-align: middle; margin: 2px 0; }
.card {
  width: 29px; height: 40px;
  background: var(--card-bg); border: 1px solid var(--card-edge); border-radius: 3px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; line-height: 1; font-variation-settings: "wdth" 80; color: var(--card-ink);
}
.card i { font-style: normal; font-size: 13px; margin-top: 2px; }
.card.red { color: var(--card-red); }
.card.down { background: repeating-linear-gradient(45deg, #1d2a44 0 3px, #2c3d61 3px 6px); border-color: #1d2a44; }

.hands { list-style: none; margin: 0 0 18px; padding: 0; }
.hands li {
  display: grid; grid-template-columns: 56px 176px minmax(0, 1fr); align-items: center;
  padding: 12px 0; border-top: 1px solid var(--hair);
}
.hands .rk { font-weight: 700; font-size: 14px; color: var(--red); font-variant-numeric: tabular-nums; }
.hands .name { display: block; font-weight: 800; text-transform: uppercase; font-size: 15px; font-variation-settings: "wdth" 112; }
.hands .say { display: block; color: var(--grey); font-size: 15px; }
@media (max-width: 600px) {
  .hands li { grid-template-columns: 44px minmax(0, 1fr); row-gap: 8px; }
  .hands li > span:last-child { grid-column: 2; grid-row: 1; }
  .hands .cards { grid-column: 2; grid-row: 2; }
}

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--hair); }
.faq:last-child { border-bottom: 1px solid var(--hair); }
.faq summary {
  cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--red); font-weight: 800; }
.faq[open] summary::after { content: "–"; }
.faq > div { padding: 0 0 16px; max-width: 720px; }
.faq > div p { margin: 0 0 10px; }

/* ---------- directory (home, 404) ---------- */
.dir { margin-top: 56px; }
.dir-title { margin: 0 0 4px; font-size: 28px; font-weight: 800; text-transform: uppercase; font-variation-settings: "wdth" 112; }
.dir-blurb { margin: 0 0 14px; color: var(--grey); font-size: 16px; max-width: 700px; }
.dir-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--hair); }
.dir-list a {
  display: grid; grid-template-columns: 96px 220px minmax(0, 1fr); gap: 4px 16px; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--hair); text-decoration: none;
}
.dir-list a:hover .dir-name { text-decoration: underline; text-decoration-color: var(--red); }
.dir-id { font-size: 12px; font-weight: 700; color: var(--red); letter-spacing: .06em; }
.dir-name { font-weight: 800; text-transform: uppercase; font-variation-settings: "wdth" 112; }
.dir-sum { color: var(--grey); font-size: 15px; }
@media (max-width: 700px) {
  .dir-list a { grid-template-columns: 80px minmax(0, 1fr); }
  .dir-sum { grid-column: 2; }
}

/* ---------- related ---------- */
.related { margin-top: 48px; }
.related h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.related ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.related li { break-inside: avoid; border-top: 1px solid var(--hair); }
.related a { display: flex; gap: 12px; padding: 8px 0; font-weight: 600; text-decoration: none; }
.related a:hover { text-decoration: underline; }
.related .dir-id { min-width: 72px; padding-top: 2px; }
@media (max-width: 600px) { .related ul { columns: 1; } }

/* ---------- Form 7-A ---------- */
.form { margin: 20px 0 8px; border: 2px solid var(--ink); }
.form .form-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--bar-bg); color: var(--bar-fg);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.form .form-body { padding: 18px 16px 20px; }
.form label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.form select {
  flex: 1 1 220px; min-width: 0; font: inherit; font-size: 16px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 0; background: var(--field-bg); color: var(--ink);
}
.form button {
  flex: 0 0 auto; font: inherit; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 20px; border: 0; border-radius: 0; cursor: pointer; background: var(--red); color: var(--on-red);
}
.form button:hover { background: var(--red-hover); }
.ruling-out { margin-top: 18px; border-top: 1px solid var(--hair); padding-top: 14px; }
.ruling-out[hidden] { display: none; }
.ruling-out .ref { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--grey); }
.ruling-out p { margin: 6px 0 0; font-size: 20px; font-weight: 800; font-variation-settings: "wdth" 108; }
.ruling-out .decided { margin-top: 10px; font-size: 13px; color: var(--grey); }

/* ---------- footers ---------- */
.docfoot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px;
  padding: 14px var(--pad) 16px; border-top: 1px solid var(--hair);
  font-size: 12px; color: var(--grey); text-transform: uppercase; letter-spacing: .08em;
}
.site-foot { max-width: 1000px; margin: 40px auto 0; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 24px; }
.site-foot h2 { margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--grey); }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin: 4px 0; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.fine { margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--hair); color: var(--grey); font-size: 13px; max-width: 760px; }

@media print {
  /* Always print in light colours, whatever theme is on screen. */
  :root, :root:not([data-theme="light"]) {
    --desk: #fff; --sheet: #fff; --ink: #111317; --grey: #555b63; --hair: #d3d7dc; --line: #9aa0a8;
    --tint: #f3f4f6; --red: #b0101f; --on-red: #fff; --bar-bg: #111317; --bar-fg: #fff; --bar-muted: #b9bec4;
    --card-edge: #9aa0a8; color-scheme: light;
  }
  body { background: #fff; padding: 0; }
  header.site, .crumbs, .site-foot, .form, .contents, .print-sheet, .tool, [data-demo], [data-checker] { display: none !important; }
  .sheet { box-shadow: none; max-width: none; }
  .cheat-extra { display: none; }
}
.cheat-extra { display: none; }

/* ---------- print cheat sheet (body.cheat, set by the Print cheat sheet button) ---------- */
.print-sheet {
  margin-top: 18px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 7px 12px; border-radius: 0;
}
.print-sheet:hover { border-color: var(--ink); }
@media print {
  @page { margin: 11mm 12mm; }
  body.cheat { font-size: 8.6pt; line-height: 1.32; }
  body.cheat .docbar, body.cheat .docfoot { padding: 3px 0; font-size: 7pt; background: none; color: #111317; border-bottom: 1.5pt solid #111317; }
  body.cheat .docbar span:last-child { color: #555b63; }
  body.cheat .inner { padding: 6px 0 0; }
  body.cheat .kicker { font-size: 7pt; margin: 0 0 3px; }
  body.cheat h1 { font-size: 17pt; line-height: 1; }
  body.cheat .lede { font-size: 8.8pt; margin: 5px 0 0; max-width: none; color: #111317; }
  body.cheat .aka { display: none; }
  body.cheat .meta { margin: 6px 0 0; border-top-width: 2pt; }
  body.cheat .meta div { padding: 3px 8px 4px; }
  body.cheat .meta div:first-child { padding-left: 0; }
  body.cheat .meta dt { font-size: 6.5pt; }
  body.cheat .meta dd { font-size: 8pt; }
  body.cheat .provision.final { margin-top: 6px; }
  body.cheat .cheat-body { columns: 2; column-gap: 7mm; margin-top: 8px; }
  body.cheat .example, body.cheat .fig, body.cheat #faq, body.cheat .related, body.cheat .sources,
  body.cheat .intro, body.cheat .prose, body.cheat .demo, body.cheat .article:not(.has-rules) { display: none !important; }
  body.cheat .list, body.cheat .steps { margin: 2px 0 4px; padding-left: 16px; }
  body.cheat .list li, body.cheat .steps li { margin: 0; }
  body.cheat .article > h2 { margin: 6px 0 2px; font-size: 9pt; break-after: avoid; }
  body.cheat h2 .n { display: inline; font-size: 7pt; margin: 0 5px 0 0; }
  body.cheat .rule { grid-template-columns: 26px minmax(0, 1fr); padding: 2px 0; break-inside: avoid; }
  body.cheat .rule > b { font-size: 7pt; padding-top: 1px; }
  body.cheat .rule .sub { font-size: 7.8pt; margin-top: 1px; }
  body.cheat .provision { margin: 4px 0; padding: 3px 6px 3px 0; grid-template-columns: 26px minmax(0, 1fr); break-inside: avoid; }
  body.cheat .provision p { font-size: 8.4pt; }
  body.cheat .provision > b { padding-left: 4px; font-size: 7pt; }
  body.cheat .table-wrap { margin: 4px 0; break-inside: avoid; }
  body.cheat table { font-size: 7.6pt; }
  body.cheat thead th { padding: 2px 6px 2px 0; font-size: 6.5pt; }
  body.cheat tbody th, body.cheat tbody td { padding: 2px 6px 2px 0; }
  body.cheat .hands li { grid-template-columns: 26px 110px minmax(0, 1fr); padding: 2px 0; }
  body.cheat .card { width: 17px; height: 23px; font-size: 7pt; }
  body.cheat .card i { font-size: 7pt; margin-top: 0; }
  body.cheat .cheat-extra { display: block; margin-top: 8px; border-top: 1.5pt solid #111317; padding-top: 4px; font-size: 7.6pt; break-inside: avoid; }
  body.cheat .cheat-extra b { text-transform: uppercase; letter-spacing: .06em; font-size: 6.8pt; }
  body.cheat .docfoot { border-bottom: 0; border-top: 1pt solid #111317; margin-top: 6px; }
}
}

/* ---------- aliases, hubs, A–Z, sources ---------- */
.aka { margin: 14px 0 0; font-size: 15px; color: var(--grey); max-width: 680px; }
.aka span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin-right: 6px; }
.dir-title a { text-decoration: none; }
.dir-title a:hover { text-decoration: underline; text-decoration-color: var(--red); }
.dir-more { margin: 12px 0 0; font-weight: 700; font-size: 15px; }
.dir-more a { text-decoration-color: var(--red); }

.az-jump { display: flex; flex-wrap: wrap; gap: 4px; margin: 36px 0 0; }
.az-jump a {
  min-width: 34px; text-align: center; padding: 6px 0; border: 1px solid var(--hair);
  font-weight: 700; font-size: 14px; text-decoration: none;
}
.az-jump a:hover { border-color: var(--ink); }
.az { margin-top: 40px; }
.az-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; border-top: 1px solid var(--hair); }
.az-list li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 15px; }
.az-list a { font-weight: 700; }
.az-cat { display: block; font-size: 12px; color: var(--grey); }
.az-alias { color: var(--grey); }
@media (max-width: 600px) { .az-list { columns: 1; } }

.sources { margin-top: 36px; font-size: 14px; }
.sources h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.sources ul { margin: 0; padding-left: 18px; color: var(--grey); }
.sources a { color: var(--grey); overflow-wrap: anywhere; }

/* ---------- header: search + theme toggle ---------- */
header.site { position: relative; }
.site-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.theme-toggle {
  font: inherit; font-size: 13px; font-weight: 700; color: var(--grey); background: none;
  border: 1px solid var(--hair); padding: 6px 10px; cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line); }
.search { position: relative; }
.search input {
  font: inherit; font-size: 14px; width: 220px; padding: 7px 10px;
  background: var(--field-bg); color: var(--ink); border: 1px solid var(--hair); border-radius: 0;
}
.search input:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.search-results {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: min(420px, calc(100vw - 32px));
  background: var(--sheet); border: 1px solid var(--line); box-shadow: var(--shadow);
  list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto;
}
.search-results[hidden] { display: none; }
.search-results li a { display: block; padding: 9px 12px; text-decoration: none; border-bottom: 1px solid var(--hair); }
.search-results li a[aria-selected="true"], .search-results li a:hover { background: var(--tint); }
.search-results .sr-name { font-weight: 700; }
.search-results .sr-meta { display: block; font-size: 12px; color: var(--grey); }
.search-results .sr-empty { padding: 10px 12px; color: var(--grey); font-size: 14px; }
@media (max-width: 700px) {
  .site-tools { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
}
.search-page-form { display: flex; gap: 8px; margin: 32px 0 8px; }
.search-page-form input { flex: 1; font: inherit; font-size: 17px; padding: 10px 12px; background: var(--field-bg); color: var(--ink); border: 1px solid var(--line); border-radius: 0; }

/* ---------- interactive tools (hand checker, deal demos) ---------- */
.tool { margin: 24px 0; border: 2px solid var(--ink); }
.tool-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--bar-bg); color: var(--bar-fg);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.tool-head span:last-child { color: var(--bar-muted); }
.tool-body { padding: 16px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tool-row select {
  flex: 1 1 260px; min-width: 0; font: inherit; font-size: 15px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 0; background: var(--field-bg); color: var(--ink);
}
.btn {
  font: inherit; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 9px 16px; border: 2px solid var(--red); background: var(--red); color: var(--on-red); cursor: pointer; border-radius: 0;
}
.btn:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.tool-hint { margin: 0 0 10px; font-size: 14px; color: var(--grey); }
.slots { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.slot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; text-align: left;
  font: inherit; padding: 8px 10px; background: transparent; color: var(--ink);
  border: 1px solid var(--hair); cursor: pointer; border-radius: 0; min-width: 0;
}
.slot.on { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
.slot-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; min-width: 72px; }
.slot-undo {
  font: inherit; font-size: 12px; font-weight: 700; padding: 0 12px; cursor: pointer; border-radius: 0;
  background: transparent; color: var(--grey); border: 1px solid var(--hair);
}
.slot-undo:hover { color: var(--ink); border-color: var(--line); }
.card.empty { background: transparent; border: 1px dashed var(--line); }
.picker { display: grid; gap: 4px; margin: 6px 0 16px; }
.pick-row { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; }
.pick {
  font: inherit; font-weight: 800; font-size: 13px; line-height: 1; padding: 6px 0 4px;
  background: var(--card-bg); color: var(--card-ink); border: 1px solid var(--card-edge); border-radius: 3px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-variation-settings: "wdth" 80; min-width: 0;
}
.pick i { font-style: normal; }
.pick.red { color: var(--card-red); }
.pick:hover:not(:disabled) { outline: 2px solid var(--red); outline-offset: -2px; }
.pick:disabled { opacity: .18; cursor: default; }
@media (max-width: 520px) { .pick { font-size: 11px; padding: 5px 0 3px; } .pick-row { gap: 2px; } .picker { gap: 2px; } }
.tool-result { border-top: 1px solid var(--hair); padding-top: 12px; }
.res-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; }
.res-row b { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; min-width: 72px; }
.res-row span:not(.cards):not(.card) { font-weight: 700; min-width: 220px; }
.verdict { margin: 10px 0 0; padding: 10px 12px; background: var(--tint); font-weight: 700; border-left: 3px solid var(--red); }

.demo-step { margin: 0 0 12px; font-weight: 700; min-height: 1.55em; }
.demo-table { border-top: 1px solid var(--hair); margin-bottom: 14px; }
.demo-board, .demo-player { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.demo-board { background: var(--tint); padding-left: 8px; }
.demo-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; min-width: 76px; }
.demo-player.win { box-shadow: inset 3px 0 0 var(--red); padding-left: 8px; }
.demo-player.win .demo-hand { color: var(--red); }
.demo-hand { font-weight: 700; font-size: 15px; }
.demo-discards { font-size: 12px; color: var(--grey); display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.card.hole { opacity: .62; }
.card.gone { opacity: .45; text-decoration: line-through; }

/* ---------- figures (diagrams) ---------- */
.fig { margin: 24px 0; max-width: 760px; }
.fig svg { display: block; width: 100%; height: auto; max-height: 520px; }
.fig figcaption { margin-top: 8px; font-size: 14px; color: var(--grey); }
.fig figcaption b { color: var(--ink); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; margin-right: 6px; }
.fig .d-card { fill: var(--card-bg); stroke: var(--card-edge); }
.fig .d-down { fill: #22314f; stroke: #6c80a8; stroke-width: 1.5; }
.fig .d-special { stroke: var(--red); stroke-width: 3; }
.fig .d-text { fill: var(--card-ink); font: 700 13px Archivo, system-ui, sans-serif; }
.fig .d-down-text { fill: #ffffff; font: 700 12px Archivo, system-ui, sans-serif; }
.fig .d-label { fill: var(--grey); font: 600 12px Archivo, system-ui, sans-serif; }
.fig .d-tag { fill: var(--red); }
.fig .d-tag-text { fill: var(--on-red); font: 800 11px Archivo, system-ui, sans-serif; }
.fig .d-table { fill: var(--tint); stroke: var(--line); stroke-width: 2; }
.fig .d-seat { fill: var(--sheet); stroke: var(--line); }
.fig .d-seat-text { fill: var(--ink); font: 700 12px Archivo, system-ui, sans-serif; }
.fig .d-chip { fill: var(--ink); }
.fig .d-chip-text { fill: var(--sheet); font: 800 12px Archivo, system-ui, sans-serif; }
.fig .d-row-label { fill: var(--ink); font: 800 12px Archivo, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
