/* JoyPanel — shared UI foundation (tokens, base, reusable atoms).
 *
 * Split from style.css: this file holds everything reusable across pages
 * (shelf, about, admin). Page/console-shell layout lives in console.css,
 * admin page layout in admin.css. Load ui.css FIRST, then the page file.
 *
 * Rule (same as before): edit ONLY :root tokens — never raw px/hex/colors
 * out in the rules.
 */

/* Press Start 2P (pixel) — self-hosted (OFL), was jsDelivr google/fonts */
/* IBM Plex Mono (body) — self-hosted (OFL), was jsDelivr fontsource.
   NB: .kb/.pd-* still ask for "JetBrainsMono Nerd Font" (not shipped),
   so they fall back to ui-monospace/monospace until the font is added. */
@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Plus Jakarta Sans (body, TEST) — self-hosted (OFL), latin 400/500/600/700.
   IBM Plex Mono kept below, commented out — uncomment to revert. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Geist Mono (mono, unused yet) — self-hosted (OFL), latin 400. */
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-400.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* IBM Plex Mono (body, pre-test) — self-hosted (OFL), was jsDelivr fontsource.
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
} */

/* ============================================================
   LET'S PLAY PICO8 — production theme
   Edit everything in :root below. Use ONLY vars from there
   out in the rules — no loose px on type, colors or borders.
   ============================================================ */
:root {
  /* palette (raw PICO-8 — never use hex out in the rules) */
  /* PICO-8 — Standard palette */
  --pico-black:       #000000; /* 0 */
  --pico-dark-blue:   #1d2b53; /* 1 */
  --pico-dark-purple: #7e2553; /* 2 */
  --pico-dark-green:  #008751; /* 3 */
  --pico-brown:       #ab5236; /* 4 */
  --pico-dark-grey:   #5f574f; /* 5 */
  --pico-light-grey:  #c2c3c7; /* 6 */
  --pico-white:       #fff1e8; /* 7 */
  --pico-red:         #ff004d; /* 8 */
  --pico-orange:      #ffa300; /* 9 */
  --pico-yellow:      #ffec27; /* 10 */
  --pico-green:       #00e436; /* 11 */
  --pico-blue:        #29adff; /* 12 */
  --pico-indigo:      #83769c; /* 13 */
  --pico-pink:        #ff77a8; /* 14 */
  --pico-peach:       #ffccaa; /* 15 */
  /* PICO-8 — Extended palette */
  --pico-onyx:        #291814; /* 128 / -16 */
  --pico-midnight:    #111d35; /* 129 / -15 */
  --pico-plum:        #422136; /* 130 / -14 */
  --pico-forest:      #125359; /* 131 / -13 */
  --pico-chocolate:   #742f29; /* 132 / -12 */
  --pico-eggplant:    #49333b; /* 133 / -11 */
  --pico-beige:       #a28879; /* 134 / -10 */
  --pico-lemon:       #f3ef7d; /* 135 / -9 */
  --pico-burgundy:    #be1250; /* 136 / -8 */
  --pico-pumpkin:     #ff6c24; /* 137 / -7 */
  --pico-lime:        #a8e72e; /* 138 / -6 */
  --pico-jade:        #00b543; /* 139 / -5 */
  --pico-royal:       #065ab5; /* 140 / -4 */
  --pico-mauve:       #754665; /* 141 / -3 */
  --pico-coral:       #ff6e59; /* 142 / -2 */
  --pico-salmon:      #ff9d81; /* 143 / -1 */

  /* roles (1 level max — switch themes here) */
  /* bg folds the admin export's near-black into a pico blend
     (owner-approved 2026-10-12 — no new hex; matches the old value
     to within 2/255 on every channel). */
  --bg: color-mix(in srgb, var(--pico-black) 86%, var(--pico-indigo));
  --panel: var(--pico-black);
  /* ink folds the admin export's warm off-white into pico-white
     (owner-approved, 2026-10-11 — no new hex; same fold as the
     chip/purple/amber decisions).
     NB: this was briefly an invalid var() of a raw value, which killed
     every accent-fill button — var() needs a custom property, never
     a raw value. */
  --ink: var(--pico-white);
  --sub: var(--pico-light-grey);
  --faint: var(--pico-dark-grey);
  /* accent = active genre color (JS sets it from GENRE_COLORS).
     --line is a STATIC neutral hairline (pico-white at 15% — the old
     8-digit off-white value folded here, same alpha), never
     accent-based: it draws every border in the app, genre-colouring
     it would restyle the shelf. */
  --accent: var(--ink);
  --on-accent: var(--pico-black);
  --accent-ink: color-mix(in srgb, var(--accent) 70%, white);
  --line: color-mix(in srgb, var(--pico-white) 15%, transparent);
  /* input outlines run one step stronger than hairlines (admin spec) */
  --input-line: color-mix(in srgb, var(--pico-white) 30%, transparent);
  --focus: var(--pico-white);
  --action: var(--pico-white);
  --link: var(--pico-blue);

  /* fonts */
  --font-pixel: "Press Start 2P", ui-monospace, monospace;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif; /* TEST (was IBM Plex Mono) */
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --fs-xs: 12px;
  --fs-s: 14px;
  --fs-m: 16px;
  --fs-l: 24px;
  --fs-xl: 32px;

  --fspx-1x: 8px;
  --fspx-2x: 16px;
  --fspx-3x: 24px;
  --fspx-4x: 32px;

  /* line heights — only these 3 */
  --lh-tight: 1.5;
  --lh-body: 1.6;
  --lh-loose: 2;

  /* borders + focus — only these 2 */
  --border: 1px solid var(--line);
  --focus-ring: 3px solid var(--ink);

  /* layout (edit only here) */
  --gutter: 40px;
  --card-gap: var(--gutter);
  --card: 256px;
  --preview-w: clamp(384px, 33%, 592px);

  /* icons (all 2x for crisp pixels) */
  --ico: 24px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); overflow-x: clip; }
/* body type (same document everywhere). The console shell's fixed
   viewport layout (height/flex/overflow) lives in console.css. */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-m);
  line-height: var(--lh-body);
}
::selection { background: var(--focus); color: var(--bg); }

/* crisp pixels: only the pixel font disables smoothing */
.pixel-font {
  -webkit-font-smoothing: none;
  font-smooth: never;
}

/* all pixel graphics stay crisp — one place (the glow copy is soft on purpose) */
.brand-logo, .card-thumb .thumb-main, .preview-media img, .ico, .ga-cover {
  image-rendering: pixelated;
}

/* all keyboard focus looks the same — one place */
.shoulder:focus-visible,
.preview-splitter:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

/* .pd-round/.pd-pill/.pd-shoulder (the gamepad face atoms) live in
   css/hints.css with the rest of the hints system — not here. */

/* cards show selection via the .focused frame around the image — never a DOM outline,
   otherwise the white box sticks to the clicked card
   while navigating on with keys. */
.card:focus, .card:focus-visible { outline: none; }
.shelf-layout:focus, .shelf-wrap:focus, .grid:focus, .preview:focus { outline: none; }
.preview-splitter:focus-visible { outline-offset: -3px; }

/* generic hide — one place */
.hidden { display: none !important; }

/* ---------- elements: the standard, by default (web 101) ----------
   Headings, body copy and lists look right with zero classes — that is
   the point. Pixel voice is opt-in via .pixel-font (buttons, values,
   titles in custom markup). Component classes (.btn, .stat-value, …)
   stay self-sufficient and never depend on these. */
h1 {
  font-family: var(--font-body);
  font-size: var(--fs-xl);
  line-height: var(--lh-tight);
  margin: 0 0 16px;
}
h2 {
  font-family: var(--font-body);
  font-size: var(--fs-l);
  line-height: var(--lh-tight);
  margin: 0 0 12px;
}
h3 {
  font-family: var(--font-body);
  font-size: var(--fs-m);
  font-weight: 700;
  line-height: var(--lh-tight);
  margin: 0 0 8px;
}
h1.pixel-font {
    font-size: var(--fspx-4x);
}
h2.pixel-font {
    font-size: var(--fspx-3x);
}
h3.pixel-font {
    font-size: var(--fspx-2x);
}
h4.pixel-font {
    font-size: var(--fspx-1x);
}
p, ul, ol { margin: 0 0 16px; }
ul, ol { padding-left: 24px; }
li::marker { color: var(--sub); }
.pixel-font { font-family: var(--font-pixel); }
code {
    font-family: var(--font-mono);
    color: var(--pico-lime);
}

section { border: var(--border); margin: 0; padding: 40px; }
section + section { border-top: 0; }

/* ---------- scrollbars: chunky square natives, theme colors ----------
   Global shared atom (moved from console.css — 1:1 same design as
   the shelf, applies on all pages). Firefox gets width + colors;
   WebKit gets the full square treatment. Gutter is auto so the track
   only exists when there is something to scroll (no empty channel). */
* {
  scrollbar-width: auto;
  scrollbar-color: var(--line) var(--bg);
  scrollbar-gutter: auto;
}
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track {
  background: var(--pico-black);
  border-left: 1px solid var(--line);
  border-radius: 0;
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border: 2px solid var(--pico-black);
  border-radius: 0;
}
::-webkit-scrollbar-corner { background: var(--pico-black); border-radius: 99px; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-ink); }

/* tags/pills: genre color as background, no frame, round corners.
   Text color follows automatically (on-accent from JS). */
.pill {
  font-family: var(--font-body);
  /* body font with normal smoothing: pixel parents (e.g. .brand) disable
     smoothing, and it inherits down — same pattern as .genre-count. */
  -webkit-font-smoothing: antialiased;
  font-smooth: auto;
  font-size: var(--fs-xs);
  line-height: 1.4;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  opacity: .5;
}

/* ---------- header: same topbar everywhere (shelf, about, admin) ---------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--fs-s);
  padding: var(--fs-m) calc(var(--gutter) / 2);
  border-bottom: var(--border);
  background: var(--bg);
}
.brand {
  font-family: var(--font-pixel);
  font-size: var(--fs-m);
  white-space: nowrap;
}
.brand-logo {
  width: 160px;
  height: 30px;
  margin-right: 12px;
  vertical-align: -6px;
}
/* topbar menu links never underline (body text links do) */
.nav-link { text-decoration: none; }
/* the active page's nav link is underlined (general — every topbar marks
   its current link with aria-current="page", styled here once) */
.nav-link[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-color: var(--accent);
}

/* ============================================================
   SHARED ATOMS (reused across pages — shelf, about, admin).
   Everything here is the site's own idiom: tokens + 1px --border + --fs-*.
   None of the rules hit the shelf unless the classes are used there.
   ============================================================ */

/* dark UI for the browser's own controls (scrollbars, dropdowns) */
:root { color-scheme: dark; }

/* ---------- buttons: amber-idiom as the standard everywhere ----------
   Square, outlined, tinted — same button on shelf, login, admin form,
   permission page and dashboard. Tokens only from here. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: var(--fs-s);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.2); }
/* small variant for dense menus (e.g. the dashboard scraper menu) */
.btn.small { font-size: var(--fs-xs); padding: 4px 10px; }
.btn:disabled {
  background: transparent;
  color: var(--faint);
  border: var(--border);
  cursor: default;
  filter: none;
}
.btn:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* ---------- form: labels + inputs in the site type ---------- */
.label {
  display: block;
  color: var(--sub);
  font-size: var(--fs-xs);
  margin-bottom: 4px;
}
.lab-check { font-size: var(--fs-s); }
.input {
  font-family: var(--font-body);
  font-size: var(--fs-s);
  line-height: var(--lh-body);
  background: color-mix(in srgb, var(--pico-white) 10%, var(--bg));
  color: var(--ink);
  /* single 30% ring (admin spec) — no border + outline double-up */
  border: 0;
  outline: 1px solid var(--input-line);
  outline-offset: -1px;
  border-radius: 23px;
  padding: 10px 18px;
  min-height: 41px;
}
select.input, textarea.input { line-height: var(--lh-body); }
textarea.input {
    field-sizing: content;
    min-height: 2lh;
    max-height: 12lh;
    resize: none;
}
/* select: custom dropdown arrow pointing down (appearance:none + data URI) */
select.input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 24px;
  background: color-mix(in srgb, var(--pico-white) 10%, var(--bg))
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M5 6L0 1h10z' fill='%23fff1e8'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  background-size: 8px 6px;
}
.input:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.input::placeholder { color: var(--faint); }
/* native checkbox/radio in the accent color (no sprite needed) —
   4px larger than the browser default so they read at a glance. */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin-right: 7px;
}

/* ---------- pills: status variants in the palette's own colors ---------- */
.pill.is-alert { background: var(--pico-red); color: var(--pico-white); }
.pill.is-dim {
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--line);
}

/* ---------- toaster: passive messages (e.g. "SAVED").
   JS builds .toast nodes in .toasts and fades them via WAAPI —
   no transition classes here (same pattern as the preview gif).
   Same idiom as the buttons: 1px --border, square, --fs-s. ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: var(--gutter);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--fs-m);
  max-width: min(90vw, 480px);
  pointer-events: none;
  background: red;
}
.toast {
  font-family: var(--font-body);
  font-size: var(--fs-m);
  line-height: 1.4;
  padding: 10px 12px;
  background: var(--ink);
  color: var(--bg);
  border: var(--border);
  border-radius: 0;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-alert { background: var(--pico-red); color: var(--pico-white); }

/* ---------- table: 1px rows, sub-headers, sticky thead ---------- */
.table {
    width: 100%;
    border-collapse:
    collapse; font-size: var(--fs-s);
    margin: 12px 0 32px;
}
.table th {
  color: var(--sub);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: normal;
  padding: 6px 8px;
  border-bottom: var(--border);
}
.table thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.table td {
  padding: 6px 8px;
  border-bottom: var(--border);
  vertical-align: top;
}
.table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
/* table numbers in a row (versions, counts) */
.tnum { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- combobox dropdown (e.g. genre autocomplete): same idiom
   as the buttons — 1px frame, inversion on the active suggestion ---------- */
.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  background: var(--bg);
  border: var(--border);
  border-top: 0;
  max-height: 240px;
  overflow-y: auto;
}
.combo-item {
  padding: 6px 8px;
  cursor: pointer;
}
.combo-item.is-active { background: var(--ink); color: var(--bg); }

/* ---------- admin atoms (approved game-admin design, 2026-10-11 —
   exact values read out of assets/artwork/game-admin-stat-dev-page.html;
   amber folds to --pico-orange, micro-accents to roles, see guide §5).
   Shelf/genre surfaces keep --accent; these fixed-color atoms are for
   admin/utility pages only. ---------- */

/* status card: tinted panel holding a heading + toggle (e.g. publish state) */
.status-card {
  background: color-mix(in srgb, var(--pico-green) 14%, var(--pico-black));
  border-radius: 4px;
  outline: 1px solid color-mix(in srgb, var(--pico-green) 50%, transparent);
  outline-offset: -1px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
/* OFF/destructive voice: the WHOLE card flips via :has() — one mechanism,
   no JS, no extra class. The toggle below is a standalone atom (works with
   any label, no card required); the card is a composition that reacts to
   its switch. */
.status-card:has(.toggle-input:not(:checked)) {
  background: color-mix(in srgb, var(--pico-red) 12%, var(--pico-black));
  outline-color: color-mix(in srgb, var(--pico-red) 55%, transparent);
}
.status-title { font-size: var(--fs-s); font-weight: 700; color: var(--ink); margin: 0 0 5px; }
.status-text { font-size: var(--fs-s); color: var(--sub); margin: 0; }
/* the card's own switch docks right — part of the composition */
.status-card > .toggle { margin-left: auto; }
/* stacked cards share one divider line — part of the composition */
.status-card + .status-card { margin-top: -1px; }

/* toggle switch: NATIVE checkbox with role="switch" (W3C APG pattern —
   research 2026-10-11). One real input + one real label: Space toggles,
   the checked value travels with forms, AT announces "switch on/off"
   with zero JS. The visible ON/OFF is a CSS-only indicator (aria-hidden
   in the markup); the accessible name MUST stay constant — never bake
   state into it. JS is only needed to ACT on change, never to operate. */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
}
/* visible name of the control — lives INSIDE the label, after the switch,
   so the whole row toggles. Grays (--sub) while off, brightens (--ink)
   when checked. The card composition omits it (the card has its own
   heading) and names the switch via aria-label instead. */
.toggle-label { font-size: var(--fs-s); color: var(--sub); }
.toggle-input:checked ~ .toggle-label { color: var(--ink); }
/* visually hidden but focusable — Tab lands here, Space flips it */
.toggle-input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  opacity: 0 !important;
  appearance: none !important;
}
.toggle-track {
  flex: none;
  width: 32px;
  height: 20px;
  padding: 2px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--pico-white) 10%, var(--bg));
  border: var(--border);
}
/* .toggle-input:checked + .toggle-track {background: transparent;} */
.toggle-knob {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  margin-right: auto;
}
.toggle-input:checked + .toggle-track .toggle-knob {
  background: var(--ink);
  margin-right: 0;
  margin-left: auto;
  animation: 1s all ease;
}
/* state indicator: pure CSS, markup keeps it aria-hidden (APG).
   OFF is the red voice, ON resolves to ink (white) on accent. */
.toggle-state { font-size: var(--fs-xs); }
.toggle-state::after { content: "OFF"; }
.toggle-input:checked ~ .toggle-state { color: var(--ink); }
.toggle-input:checked ~ .toggle-state::after { content: "ON"; }
.toggle-input:focus-visible + .toggle-track { outline: var(--focus-ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .toggle-track, .toggle-knob { transition: none; }
}

/* stat band: divider-separated SQUARE cells (aspect-ratio 1/1, admin spec),
   pixel value + label + colored note */
.stats { display: flex; }
.stat {
  flex: 1 1 0;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  border: var(--border);
  border-left: 0;
}
.stat:first-child { border-left: var(--border); }
.stat-value {
  font-family: var(--font-pixel);
  font-size: var(--fs-l);
  line-height: var(--lh-tight);
  color: var(--ink);
}
.stat-label { font-size: var(--fs-s); color: var(--sub); }
.stat-note { font-size: var(--fs-xs); color: var(--sub); }
.stat-note.is-info { color: var(--link); }
.stat-note.is-ok { color: var(--pico-green); }
.stat-note.is-faint { color: var(--faint); }

/* chips: an EXTENSION of .pill (same size/shape/ring — always compose as
   class="pill chip"). The chip only lifts opacity, re-inks the text and
   lays out remove × / + Add inline. Behavior (§7 script or app.js) travels
   with the markup — see §5. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 1;
  color: var(--ink);
  border-color: var(--line);
}
.chip-remove {
  background: none;
  border: 0;
  padding: 0;
  color: var(--sub);
  font: inherit;
  font-size: var(--fs-s);
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}
.chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 20px;
  outline: 1px solid var(--input-line);
  outline-offset: -1px;
}
.chip-add {
  border-color: color-mix(in srgb, var(--pico-orange) 50%, transparent);
  background: color-mix(in srgb, var(--pico-brown) 15%, transparent);
  color: var(--pico-orange);
  font-weight: 700;
  cursor: pointer;
}
.chip-add:hover { filter: brightness(1.2); }

/* amber action button: fixed pico-orange utility voice (NOT --accent) */
.btn-amber {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--pico-orange) 50%, transparent);
  background: color-mix(in srgb, var(--pico-brown) 15%, transparent);
  color: var(--pico-orange);
  font-family: var(--font-body);
  font-size: var(--fs-s);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn-amber:hover { filter: brightness(1.2); }
.btn-amber:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* danger: fixed pico-red destructive voice */
.btn-danger {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--pico-red) 50%, transparent);
  background: color-mix(in srgb, var(--pico-red) 10%, transparent);
  color: var(--pico-red);
  font-family: var(--font-body); font-size: var(--fs-s); font-weight: 700;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn-danger:hover { filter: brightness(1.2); }
.btn-danger:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* ok: fixed pico-green positive voice */
.btn-ok {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--pico-green) 50%, transparent);
  background: color-mix(in srgb, var(--pico-green) 10%, transparent);
  color: var(--pico-green);
  font-family: var(--font-body); font-size: var(--fs-s); font-weight: 700;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn-ok:hover { filter: brightness(1.2); }
.btn-ok:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* danger: fixed pico-red destructive voice */
.btn-danger {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--pico-red) 50%, transparent);
  background: color-mix(in srgb, var(--pico-red) 10%, transparent);
  color: var(--pico-red);
  font-family: var(--font-body); font-size: var(--fs-s); font-weight: 700;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn-danger:hover { filter: brightness(1.2); }
.btn-danger:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* ok: fixed pico-green positive voice */
.btn-ok {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--pico-green) 50%, transparent);
  background: color-mix(in srgb, var(--pico-green) 10%, transparent);
  color: var(--pico-green);
  font-family: var(--font-body); font-size: var(--fs-s); font-weight: 700;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn-ok:hover { filter: brightness(1.2); }
.btn-ok:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* notice banner: amber-framed panel with title + body + optional action */
.notice {
  background: color-mix(in srgb, var(--pico-brown) 15%, transparent);
  border-radius: 4px;
  outline: 1px solid var(--pico-orange);
  outline-offset: -1px;
  padding: 16px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.notice-title { font-size: var(--fs-m); font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.notice-text { font-size: var(--fs-s); color: var(--sub); margin: 0; }
/* notice actions dock right — part of the composition */
.notice .btn-amber { margin-left: auto; flex: none; }
/* result voices — same green/red as .status-card: is-ok = completed,
   is-alert = failed; the base stays amber (warning) */
.notice.is-ok {
  background: color-mix(in srgb, var(--pico-green) 14%, transparent);
  outline-color: color-mix(in srgb, var(--pico-green) 50%, transparent);
}
.notice.is-alert {
  background: color-mix(in srgb, var(--pico-red) 12%, transparent);
  outline-color: color-mix(in srgb, var(--pico-red) 55%, transparent);
}

/* media card: thumb + title + spec lines + action, top-ruled */
.media-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  border-top: var(--border);
  padding-top: 16px;
}
.media-thumb { width: 128px; height: 128px; flex: none; object-fit: cover; display: block; }
.media-title { font-size: var(--fs-m); font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.media-specs { font-size: var(--fs-xs); color: var(--sub); margin: 0 0 8px; }

/* PLAY — the ONE play voice (frosted white-ring pill over media).
   Markup is class="btn play-btn" from Hints::playButton() (single source);
   .btn lends the pixel font + base layout, this block lends the voice,
   console.css lends preview placement, hints.css lends icon colors.
   No other PLAY button exists: white/accent-fill PLAY is gone. */
.play-btn {
  font-family: var(--font-pixel);
  font-size: var(--fspx-2x);
  -webkit-font-smoothing: none;
  font-smooth: never;
  gap: 13px;
  padding: 15px 30px;
  border-radius: 999px;
  border: 2px solid var(--pico-white);
  background: color-mix(in srgb, var(--pico-black) 15%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--pico-white);
  text-decoration: none;
}
.play-btn:hover { filter: brightness(1.1); }
.play-btn:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
/* disabled keeps the ring width (no layout shift), only the voice quiets */
.play-btn:disabled {
  background: transparent;
  color: var(--faint);
  border-color: var(--line);
  cursor: default;
  filter: none;
}

/* revert icon-button: amber ↻ that restores a field to its source value */
.revert-btn {
  flex: none;
  background: none;
  border: 0;
  padding: 4px;
  color: var(--pico-orange);
  font-size: var(--fspx-2x);
  line-height: 1;
  cursor: pointer;
}
.revert-btn:hover { filter: brightness(1.2); }
.revert-btn:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* field row: label above, input (or chip box) + revert ↻ in one line.
   Markup: UI::revertField() in lib/ui.php (guide §10 specimen). */
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row .input, .field-row .chip-input { flex: 1 1 auto; min-width: 0; }

/* topbar cell: full-height divided segment for the admin shell pattern.
   (Needs a flex bar parent; the shelf topbar is untouched.) */
.topbar-cell {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-left: var(--border);
  font-size: var(--fs-s);
  white-space: nowrap;
}

/* ---------- doc sub-pages (guide/about, ...): sticky topbar + left
   section menu. Scoped .doc-* only — the shelf front page (lib/shell.php)
   never matches these selectors.
   NOTE: html overflow-x:clip (base rule above) breaks position:sticky in
   Chrome, so doc pages opt back out to visible; .doc-body keeps its own
   horizontal scroll so wide tables never spill the page. ---------- */
html:has(body.doc) { overflow-x: visible; }
body.doc { display: block; height: auto; min-height: 100dvh; overflow-y: auto; }
.doc-top { position: sticky; top: 0; z-index: 40; }
.doc-layout { display: flex; align-items: flex-start; gap: 32px; max-width: 1280px; margin: 0 auto; padding: 32px 24px 80px; }
.doc-menu { position: sticky; top: 84px; flex: none; width: 200px; max-height: calc(100dvh - 108px); overflow-y: auto; }
.doc-menu ul { list-style: none; margin: 0; padding: 0; }
.doc-menu a { display: block; padding: 4px 0; color: var(--sub); text-decoration: none; }
.doc-menu a:hover { color: var(--ink); }
.doc-body { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
@media (max-width: 760px) {
  .doc-layout { flex-direction: column; }
  .doc-menu { position: static; width: auto; max-height: none; }
}


/* ---------- tabs: shared atom (curate + prep strips) ----------
   Equal-width tab strip. Page stylesheets may override flex/width per
   page; the voice (padding, text, active state) lives here. */
.tabs, .find-tabs {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border-top: var(--border);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
}
.tab, .find-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 12px;
  color: var(--ink);
  font-size: var(--fs-s);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab + .tab, .find-tab + .find-tab {
  border-left: var(--border);
}
.tab:hover, .find-tab:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tab.is-on, .find-tab.is-on {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.tab .tnum, .find-tab .tnum, .find-mini .tnum {
  color: var(--sub);
  font-size: var(--fs-xs);
}
