/*
 * buggs.io, the chrome of every page but the landing (site-src/layout.html):
 * the game pages (bugs, power-ups, how to play, about, press) and the legal
 * and help pages.
 *
 * Flat, like the game's UI (godot/scripts/game/theme_kit.gd): solid fills,
 * 1px hairlines, no glows, shadows, blurs or gradients. The tokens are the
 * game's ThemeKit colours. System fonts only: the site CSP allows no external
 * hosts. Copied verbatim to site/css/doc.css by `npm run site`.
 */

:root {
  --clear: #0b0d0a;
  --glass: rgba(16, 22, 19, .74);
  --inset: rgba(0, 0, 0, .24);
  --stroke: rgba(255, 255, 255, .08);
  --stroke-hi: rgba(255, 255, 255, .16);
  --text: #eef3ee;
  --muted: #98a59c;
  --faint: #5f6c64; /* decorative separators only: below 4.5:1, never for text */
  --accent: #a3e635;
  --accent-hover: #b0ea51;
  --accent-press: #8fca2f;
  --on-accent: #0b1605;
  --info: #38bdf8;
  /* rarity colours: src/core/species.js RARITY_COLORS (the game's UI contract;
     tests/site.test.mjs holds the two together) */
  --rarity-common: #9aa7b4;
  --rarity-uncommon: #5ad18a;
  --rarity-rare: #4aa8ff;
  --rarity-epic: #c07aff;
  --rarity-legendary: #ffb43a;
  --font-display: Helvetica, "Helvetica Neue", Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-text: Helvetica, "Helvetica Neue", Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.25, .46, .45, .94);
  color-scheme: dark;
}

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

html {
  background: var(--clear);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--clear);
  color: var(--text);
  font: 400 17px/1.65 var(--font-text);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(163, 230, 53, .3); color: var(--text); }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

a { color: var(--info); text-decoration: underline; text-decoration-color: rgba(56, 189, 248, .4); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

/* ---- skip link ---------------------------------------------------------- */

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- top bar: wordmark + Play ------------------------------------------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px;
}

.wordmark {
  font: 800 30px/1 var(--font-display);
  letter-spacing: 0;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 700 16px/1.2 var(--font-text);
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: none; fill: currentColor; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: rgba(34, 44, 39, .96); border-color: var(--stroke-hi); color: var(--text); font-weight: 600; }
.btn-secondary:hover { background: rgba(52, 61, 56, .96); border-color: rgba(163, 230, 53, .45); }
.btn-secondary:active { background: rgba(29, 37, 33, .96); border-color: rgba(163, 230, 53, .6); }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color .14s var(--ease), border-color .14s var(--ease), transform .14s var(--ease); }
  .btn:hover { transform: scale(1.02); }
  .btn:active { transform: scale(.97); }
}

/* ---- the reading column --------------------------------------------------- */

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 808px;          /* 760px panel + 2 × 24px gutters */
  margin: 0 auto;
  padding: 8px 24px 48px;
}
.page:focus { outline: none; }

/* Breadcrumbs above the panel (page.crumbs): quiet, the current page last */
.crumbs { margin: 0 0 12px; padding: 0 4px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.crumbs li { min-width: 0; }
.crumbs li + li::before { content: "›"; padding: 0 8px; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs a[aria-current="page"] { color: var(--text); }

.doc {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 44px 52px 48px;
}

.doc h1 {
  margin: 0;
  font: 800 36px/1.15 var(--font-display);
  letter-spacing: -.01em;
  color: var(--text);
}

.dates {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dates .sep { color: var(--faint); padding: 0 6px; }

.doc-body { margin-top: 28px; }
.doc-body > :first-child { margin-top: 0; }

.doc-body h2 {
  margin: 48px 0 14px;
  padding-top: 32px;
  border-top: 1px solid var(--stroke);
  font: 800 22px/1.3 var(--font-display);
  color: var(--text);
  scroll-margin-top: 16px;
}
.doc-body h3 {
  margin: 30px 0 8px;
  font: 700 18px/1.4 var(--font-display);
  color: var(--text);
  scroll-margin-top: 16px;
}
.doc-body h4 { margin: 24px 0 6px; font: 700 16px/1.4 var(--font-text); }

.doc-body p, .doc-body ul, .doc-body ol, .doc-body dl, .doc-body pre { margin: 0 0 16px; }
.doc-body ul, .doc-body ol { padding-left: 24px; }
.doc-body li { margin: 6px 0; }
.doc-body li::marker { color: var(--muted); }
.doc-body li > ul, .doc-body li > ol { margin: 6px 0 0; }
.doc-body strong, .doc-body b { font-weight: 700; color: #fff; }
.doc-body em { font-style: italic; }
.doc-body hr { border: 0; border-top: 1px solid var(--stroke); margin: 32px 0; }

.doc-body code, .doc-body kbd {
  font: 500 .88em/1.4 var(--font-mono);
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--stroke-hi);
  white-space: nowrap;
}

/* Definition lists: contact blocks ("Email", "Post") */
.doc-body dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  padding: 14px 18px;
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.doc-body dt {
  font: 600 12px/1.9 var(--font-text);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-body dd { margin: 0; min-width: 0; }

/* "In short": an inset card with a lime edge, like the game's passive callout */
.doc-body .summary {
  margin: 28px 0 0;
  padding: 18px 22px 6px;
  background: rgba(163, 230, 53, .08);
  border: 1px solid rgba(163, 230, 53, .22);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
}
.doc-body .summary h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font: 600 12px/1.5 var(--font-text);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(163, 230, 53, .85);
}
.doc-body .summary ul { padding-left: 20px; }
.doc-body .summary li { margin: 8px 0; }

/* Table of contents (built from the page's h2s by tools/build-site.mjs) */
.toc {
  margin: 24px 0 0;
  padding: 16px 22px 12px;
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.toc-title {
  margin: 0 0 8px;
  font: 600 12px/1.5 var(--font-text);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol {
  margin: 0;
  padding: 0 0 0 26px;
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
  line-height: 1.45;
}
.toc li { margin: 0 0 7px; break-inside: avoid; }
.toc li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: currentColor; }

/* Tables scroll inside their own box on narrow screens */
.table-scroll {
  margin: 0 0 18px;
  overflow-x: auto;
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.table-scroll th, .table-scroll td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--stroke);
}
.table-scroll th {
  font: 600 12px/1.5 var(--font-text);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--stroke-hi);
}
.table-scroll tr:last-child td { border-bottom: 0; }
.table-scroll td { overflow-wrap: break-word; }
.table-scroll td:first-child { color: #fff; font-weight: 600; }

/* Collapsible blocks (licence texts) */
.doc-body details {
  margin: 0 0 10px;
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.doc-body details[open] { border-color: var(--stroke-hi); }
.doc-body summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  list-style-position: inside;
}
.doc-body summary::marker { color: var(--accent); }
.doc-body summary:hover { color: #fff; }
.doc-body details > :not(summary) { margin-left: 16px; margin-right: 16px; }
.doc-body details > :last-child { margin-bottom: 16px; }
.doc-body pre {
  padding: 14px 16px;
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font: 400 13px/1.55 var(--font-mono);
  color: #d6ded8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Licenses page */
.muted { color: var(--muted); }
.doc-body .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.doc-body .chips li { margin: 0; }
.chips a {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--stroke-hi);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}
.chips a:hover { border-color: rgba(163, 230, 53, .45); }
.count { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.doc-body ul.components { list-style: none; padding: 0; }
.doc-body ul.components li { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--stroke); }
.doc-body ul.components li:last-child { border-bottom: 0; }
.components .name { display: block; font-weight: 700; color: #fff; }
.components .meta { display: block; font-size: 14px; line-height: 1.5; color: var(--muted); }
.components .tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke-hi);
  font: 600 11px/1.7 var(--font-text);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: 2px;
}
.lic-links { font-size: 14px; color: var(--muted); margin-top: -6px; }

/* Generated lists (tools/build-site.mjs MARKERS): the roster on /bugs, the
   power-ups, the skin gallery, the screenshots. One card per bug or power-up, flat inset boxes
   like the tables; a portrait sits in a fixed square (object-fit: contain),
   so bugs of every shape line up and no image is ever wider than its box. */
.doc-body img { max-width: 100%; height: auto; }
.doc-body .unlock-note { color: var(--muted); font-size: 15px; }
.cards { display: grid; gap: 12px; margin: 0 0 16px; }
.card {
  min-width: 0;
  padding: 16px 18px;
  background: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.doc-body .card h3 { margin: 0 0 6px; }
.doc-body .card p { margin: 0 0 8px; }
.doc-body .card > :last-child, .doc-body .card-text > :last-child { margin-bottom: 0; }
.bug {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  column-gap: 20px;
  align-items: start;
}
.bug .card-text { grid-column: 2; grid-row: 1; min-width: 0; }
.doc-body .bug .portrait { grid-column: 1; grid-row: 1; display: block; width: 112px; height: 112px; object-fit: contain; }
.binomial { margin-left: 4px; font: italic 400 15px/1.4 var(--font-text); color: var(--muted); }
.card-meta { line-height: 1; }
.rarity {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 600 11px/1.7 var(--font-text);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.rarity-common { color: var(--rarity-common); }
.rarity-uncommon { color: var(--rarity-uncommon); }
.rarity-rare { color: var(--rarity-rare); }
.rarity-epic { color: var(--rarity-epic); }
.rarity-legendary { color: var(--rarity-legendary); }
.doc-body .stats { font-size: 14px; line-height: 1.5; color: var(--muted); font-variant-numeric: tabular-nums; }
/* one stat per span (build-site statSpans): a line breaks only between stats,
   never between "Boost drain" and its value */
.doc-body .stats .stat { white-space: nowrap; }
.doc-body .carries { font-size: 15px; }
/* the skin gallery (/skins): small cards, the still on top in a fixed-height
   box (object-fit: contain), so bugs of every shape line up; a trail's still
   is a long strip, so its cards are wider and it keeps its own height */
.skins { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.skins.trails { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card.skin { padding: 12px 14px 14px; }
.doc-body .skin .skin-art { display: block; width: 100%; height: 104px; object-fit: contain; margin: 0 0 10px; }
.doc-body .skins.trails .skin-art { height: auto; }
.doc-body .skin h3 { margin: 0 0 6px; font-size: 16px; }
.doc-body .skin p { font-size: 14px; line-height: 1.5; }
.doc-body .skin .card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-body h2.skin-bug a { color: var(--text); text-decoration-color: var(--faint); text-underline-offset: 5px; }
.doc-body h2.skin-bug a:hover { color: var(--accent); text-decoration-color: currentColor; }
/* a bug's name on its /bugs card and a power-up's on a bug page link to their
   own pages: the heading's colour, underlined quietly until hovered */
.doc-body .bug h3 a, .doc-body .pup h3 a { color: var(--text); text-decoration-color: var(--faint); text-underline-offset: 4px; }
.doc-body .bug h3 a:hover, .doc-body .pup h3 a:hover { color: var(--accent); text-decoration-color: currentColor; }
/* a bug's own page (/bugs/<slug>, build-site renderBugPage): the portrait
   beside its rarity, blurb and Play button; the pager closes the page */
.bug-hero { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: center; margin: 0 0 8px; }
.doc-body .bug-hero .portrait { display: block; width: 160px; height: 160px; object-fit: contain; }
.doc-body .bug-hero p { margin: 0 0 12px; }
.doc-body .bug-hero > :last-child > :last-child { margin-bottom: 0; }
.doc-body .bug-hero .binomial { margin-left: 8px; }
.doc-body .lede { font-size: 18px; color: var(--text); }
.pups { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.bug-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; margin: 36px 0 0; padding-top: 18px; border-top: 1px solid var(--stroke); }
/* a skin's tag ("Unlocks with online XP", a season): sentence case, so a
   long one wraps inside a narrow card instead of running out of it */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: 8px;
  font: 600 12px/1.5 var(--font-text);
}
.tag-xp { color: var(--info); }
.tag-season { color: var(--rarity-legendary); }
.shots { display: grid; gap: 20px; margin: 0 0 16px; }
.shot { margin: 0; min-width: 0; }
.doc-body .shot img { display: block; width: 100%; height: auto; background: var(--inset); border: 1px solid var(--stroke); border-radius: 12px; }
.shot figcaption { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* 404 */
.page-404 .doc { text-align: center; padding-top: 40px; }
.page-404 .doc-body { margin-top: 12px; }
.page-404 .lost { display: block; width: 168px; height: 84px; margin: 0 auto 20px; }
.page-404 .lead { font-size: 18px; color: var(--muted); max-width: 30em; margin: 0 auto 28px; }
.page-404 .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

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

.foot {
  padding: 8px 24px 40px;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.foot nav ul { display: flex; flex-wrap: wrap; justify-content: center; margin: 0 0 8px; padding: 0; list-style: none; }
.foot nav li + li::before { content: "·"; padding: 0 9px; color: var(--faint); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.foot a[aria-current="page"] { color: var(--text); }
.foot p { margin: 0; }
.foot .sep { padding: 0 8px; color: var(--faint); }

/* the social row above the links: brand marks in the footer's muted colour,
   one tap target each (36 px, 40 px on phones) */
.foot .social { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 0 0 4px; }
.foot .social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--muted);
}
.foot .social a:hover { color: var(--text); background: var(--stroke); text-decoration: none; }
.foot .social a:focus-visible { outline: 1px solid var(--accent); outline-offset: 0; }
.foot .social svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- phones ---------------------------------------------------------------- */

@media (max-width: 640px) {
  .bar { padding: 14px 16px; }
  .wordmark { font-size: 28px; }
  .page { padding: 4px 16px 36px; }
  .doc { padding: 28px 20px 32px; border-radius: 16px; }
  .doc h1 { font-size: 30px; }
  .dates { font-size: 15px; }
  .dates .sep { display: none; }
  .dates span { display: block; }
  .doc-body h2 { font-size: 22px; margin-top: 40px; padding-top: 28px; }
  .doc-body ul, .doc-body ol { padding-left: 22px; }
  .doc-body dl { grid-template-columns: 1fr; gap: 0 0; }
  .doc-body dd + dt { margin-top: 10px; }
  .doc-body .summary { padding: 16px 16px 4px 18px; }
  .toc { padding: 14px 16px 10px; }
  /* Tables: a wide table scrolls inside its box; one with column headers
     (class "stack", data-label on each cell) becomes one card per row. */
  .table-scroll table { min-width: 520px; }
  .table-scroll.cols-2 table { min-width: 0; }
  .table-scroll.stack { overflow: visible; }
  .table-scroll.stack table { min-width: 0; }
  .stack table, .stack tbody, .stack tr, .stack td { display: block; width: 100%; }
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .stack tr { padding: 14px 16px; border-bottom: 1px solid var(--stroke); }
  .stack tr:last-child { border-bottom: 0; }
  .stack td { padding: 3px 0; border: 0; font-size: 16px; }
  .stack td::before {
    content: attr(data-label);
    display: block;
    margin-top: 6px;
    font: 600 12px/1.5 var(--font-text);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
  }
  .stack td:first-child { font-size: 17px; }
  .stack td:first-child::before { display: none; }
  .toc ol { columns: 1; font-size: 16px; }
  .toc li { margin-bottom: 9px; }
  .foot { padding: 4px 16px 32px; font-size: 15px; }
  .chips a, .components .meta, .lic-links { font-size: 15px; }
  .foot nav ul { gap: 4px 18px; }
  .foot nav li + li::before { content: none; }
  .foot .social a { width: 40px; height: 40px; }
  .foot .social svg { width: 20px; height: 20px; }
  .crumbs { padding: 0 2px; font-size: 15px; }
  /* a bug card: the portrait beside the name only, the rest full width
     (.card-text steps aside, its children become the card's rows) */
  .card { padding: 14px; }
  .bug { grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; }
  .bug .card-text { display: contents; }
  .bug .card-text > * { grid-column: 1 / -1; }
  .bug .card-text > h3, .bug .card-text > .card-meta { grid-column: 2; }
  .doc-body .bug .portrait { grid-row: 1 / span 2; align-self: center; width: 64px; height: 64px; margin-bottom: 8px; }
  .binomial { display: block; margin: 2px 0 0; }
  /* the skin gallery: two cards a row on a 360 px phone */
  .skins { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
  .card.skin { padding: 10px 10px 12px; }
  .doc-body .skin .skin-art { height: 88px; }
  .bug-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
  .doc-body .bug-hero .portrait { width: 96px; height: 96px; }
  .doc-body .bug-hero .binomial { margin-left: 0; }
  .doc-body .lede { font-size: 17px; }
}

/* ---- print: legal pages get printed --------------------------------------- */

@media print {
  @page { margin: 18mm 16mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body { display: block; font-size: 11pt; line-height: 1.5; }
  .skip, .bar .btn, .foot nav, .toc, .crumbs { display: none !important; }
  .bar { padding: 0 0 12pt; }
  .wordmark, .wordmark span { color: #000 !important; font-size: 18pt; }
  .page { max-width: none; padding: 0; }
  .doc { background: none; border: 0; padding: 0; }
  .doc h1, .doc-body h2, .doc-body h3, .doc-body strong, .doc-body b,
  .table-scroll td:first-child, .components .name { color: #000 !important; }
  .dates, .muted, .components .meta, .foot { color: #333 !important; }
  .doc-body h2 { border-top-color: #bbb; break-after: avoid; }
  .doc-body h3 { break-after: avoid; }
  a { color: #000 !important; text-decoration: underline; }
  .doc-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; overflow-wrap: anywhere; }
  .doc-body .summary { background: none; border: 1px solid #999; border-left: 3px solid #000; }
  .doc-body .summary h2 { color: #000; }
  .doc-body dl, .doc-body details, .doc-body pre, .table-scroll, .card { background: none; border-color: #999; }
  .card, .shot { break-inside: avoid; }
  .rarity, .tag, .binomial, .doc-body .stats, .doc-body .unlock-note, .shot figcaption { color: #333 !important; }
  .doc-body pre { color: #000; }
  .table-scroll { overflow: visible; }
  .table-scroll table { min-width: 0 !important; }
  .table-scroll th { color: #000; border-bottom-color: #000; }
  .table-scroll td { border-bottom-color: #bbb; }
  .doc-body li::marker, .doc-body dt { color: #000; }
  tr, li, dd { break-inside: avoid; }
}

/* Privacy ▸ Analytics: js/analytics.js fills this with the status and an on/off button. */
#analytics-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
/* Empty until the script fills it: it keeps the row of its button (44 px) so
   nothing below moves, /privacy#choices included. */
#analytics-choice:empty { min-height: 44px; }
