/* Cube World Omega wiki: the game's own UI (P5, docs/LOOK.md, docs/THEME_BRIEF.md).
   The 2026 game draws its UI in code: dark panels with a black / white / black rim, white pixel text with a
   one-pixel black outline, cyan values, tan panel titles, purple selected rows, over the voxel world.
   Every colour below the token block is a var(); the token block is generated by
   pipeline/look/make_tokens.py from pipeline/look/ui_colors.json (measured on game frames and read from
   the game binary). The @font-face block is generated by pipeline/look/build_fonts.py from sprites/*.tga.
   Phone first: base rules are the 390 px layout; wider screens add columns.
   No animation and no transition anywhere (owner rules P2, P3). */

/* FONTS:BEGIN generated by pipeline/look/build_fonts.py, do not edit by hand */
@font-face { font-family: "CWO Cube"; src: url("/assets/fonts/cwo-cube10.woff2?v=a2104759b6") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: "CWO Cube Fallback"; src: local("Arial"), local("Helvetica"), local("ArialMT"); size-adjust: 75.70%; ascent-override: 88.06%; descent-override: 44.03%; line-gap-override: 0%; }
@font-face { font-family: "CWO Small"; src: url("/assets/fonts/cwo-small8.woff2?v=ccd95cd74a") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: "CWO Small Fallback"; src: local("Arial"), local("Helvetica"), local("ArialMT"); size-adjust: 53.94%; ascent-override: 123.60%; descent-override: 61.80%; line-gap-override: 0%; }
/* FONTS:END */

/* TOKENS:BEGIN generated by pipeline/look/make_tokens.py, do not edit by hand */
:root {
  --c-bg: #0c2082; /* sky-night: page backdrop: the night sky behind the HUD */
  --c-panel: #081a2e; /* tip-fill: window fill: item tooltip over the world */
  --c-panel-deep: #0c0c10; /* panel-fill-night: header bar, buttons, fields, table head: NPC tooltip fill */
  --c-rim: #ffffff; /* rim-white: white rim of every window and button */
  --c-line: #000000; /* outline-black: black line around rims and glyphs */
  --c-ink: #ffffff; /* rim-white: text: the game's white labels */
  --c-ink-soft: #30dad8; /* desc-cyan: secondary text: tooltip description lines */
  --c-title: #facc88; /* title-tan: window titles (ALCHEMY, ARMOR, AVAILABLE) */
  --c-value: #60f8f4; /* value-cyan: values (character sheet DWARF, MALE) */
  --c-link: #60f8f4; /* value-cyan: links: the cyan of values, underlined */
  --c-select: #3c107c; /* select-purple: chosen row, pressed tab, hover row */
  --c-focus: #fcf4b0; /* chat-yellow: keyboard focus ring: chat line yellow */
  --c-gold: #d8c478; /* gold: coins */
  --c-good: #58e894; /* stat-green: stat gains */
  --c-stat: #9470d4; /* stat-purple: stat names (DEF, HP) */
  --c-muted: #80648a; /* empty-mauve: EMPTY SLOT text (pixel text 24 px only) */
  --c-zone: #b2f89c; /* zone-green: zone names */
  --c-hp: #aa2e50; /* hp-red: HP bar */
  --c-mp: #0c3ca4; /* mp-blue: MP bar */
  --c-xp: #562088; /* xp-purple: XP bar */
  --c-rar-normal: #ffffff; /* rarity:normal: rarity Normal */
  --c-rar-magic: #46fa32; /* rarity:magic: rarity Magic */
  --c-rar-rare: #5a64fa; /* rarity:rare: rarity Rare */
  --c-rar-epic: #643cfa; /* rarity:epic: rarity Epic */
  --c-rar-legendary: #e6c832; /* rarity:legendary: rarity Legendary */
  --c-surface: var(--c-panel);
  --c-surface-2: var(--c-panel-deep);
  --c-accent: var(--c-select);
  --c-accent-ink: var(--c-ink);
  --c-hl: var(--c-select);
  --c-mute: var(--c-ink-soft);
  --c-shadow: var(--c-line);
  --c-scrim: var(--c-line);
  --c-conf-ok: var(--c-good);
  --c-conf-ok-bg: var(--c-panel-deep);
  --c-conf-unsure: var(--c-gold);
  --c-conf-unsure-bg: var(--c-panel-deep);
  --c-conf-code: var(--c-value);
  --c-conf-code-bg: var(--c-panel-deep);
  --c-conf-none: var(--c-title);
  --c-conf-none-bg: var(--c-panel-deep);
}
/* TOKENS:END */

:root {
  color-scheme: dark;
  /* one game UI pixel. The game draws its UI pixel at 3 screen px on 1080p; the wiki uses 2 CSS px so the
     pixel font sits at N = 2 (24 px) for labels and N = 3 (36 px) for page titles. */
  --u: 2px;
  --rim: 2px;                   /* white rim of a tooltip (1 game px) */
  --rim-panel: 3px;             /* white rim of a panel (1.5 game px, measured 4-5 screen px at 1080p) */
  /* the glyph outline: the TGA outline is the 8-neighbour ring of the white pixels, so 8 shadows of one
     font pixel (1/12 em) redraw it exactly at every integer size */
  --outline: 0.0834em 0 0 var(--c-line), -0.0834em 0 0 var(--c-line), 0 0.0834em 0 var(--c-line),
    0 -0.0834em 0 var(--c-line), 0.0834em 0.0834em 0 var(--c-line), -0.0834em 0.0834em 0 var(--c-line),
    0.0834em -0.0834em 0 var(--c-line), -0.0834em -0.0834em 0 var(--c-line);

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Hiragino Sans", "Noto Sans CJK JP", sans-serif;
  --font-pixel: "CWO Cube", "CWO Cube Fallback", var(--font-body);
  --font-pixel-small: "CWO Small", "CWO Small Fallback", var(--font-body);
  --font-head: var(--font-pixel);
  /* pixel sizes: only 12 x N (the font cell is 12 px), so every glyph pixel lands on whole CSS pixels */
  --px-2: 24px;
  --px-3: 36px;
  --fs-s: 0.875rem;
  --fs-0: 1rem;
  --fs-1: 1.125rem;
  --fs-2: 1.375rem;
  --fs-3: 1.75rem;
  --lh: 1.5;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2.5rem;
  --gutter: 16px;
  --radius: 0;                  /* the game's rims are square */
  --page-max: 80rem;
  --icon: 1.5em;
  --tip-w: 20rem;
  --tap: 44px;
  /* kit frame variables, kept so older page CSS (skillcalc.css) still resolves: the game frame is drawn by the
     .panel / .card rule (border + inset rims), not by a border-image */
  --frame-panel: none; --frame-panel-slice: 0; --frame-panel-bw: var(--u); --frame-panel-repeat: stretch;
  --frame-btn: none; --frame-btn-slice: 0; --frame-btn-bw: var(--u); --frame-btn-on: none;
  --frame-input: none; --frame-input-slice: 0; --frame-input-bw: var(--u);
  --frame-tip: none; --frame-tip-slice: 0; --frame-tip-bw: var(--u);
  --frame-bar: none; --frame-bar-slice: 0; --frame-bar-bw: 0;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--c-bg); }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font: var(--fs-0) / var(--lh) var(--font-body);
  overflow-wrap: break-word;
}
/* the pixel face: game labels are white capitals with a black outline (tooltip, panel titles, menus) */
h1, h2, h3, .site-head .brand, .site-nav a, .th-sort, table.data thead th, table.drops thead th,
.tool strong, .tip-name, .kicker, details.fold > summary, fieldset.facet legend, .langs a, .sr-mark {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: var(--px-2);
  line-height: calc(28 / 24);
  text-transform: uppercase;
  letter-spacing: 0;
  text-shadow: var(--outline);
  -webkit-font-smoothing: none;
  font-smooth: never;
}
h1, h2, h3, h4 { margin: var(--sp-5) 0 var(--sp-3); }
h1 { font-size: var(--px-3); line-height: calc(42 / 36); margin-top: var(--sp-3); color: var(--c-ink); }
h2 { color: var(--c-title); }
h3 { color: var(--c-ink); }
h4 { font-family: var(--font-body); font-size: var(--fs-1); line-height: 1.2; }
p, ul, ol, dl, table { margin: 0 0 var(--sp-4); }
[hidden] { display: none !important; }
img, svg, video { max-width: 100%; height: auto; }
/* every icon keeps the sprite's own ratio and its hard pixels (check_icon_ratio.py) */
img.ico, img.art { object-fit: contain; image-rendering: pixelated; }
/* icon from a kind's sheet (pipeline/gen/sprites.py): the page sets the cell, the size comes from --sz or .ent */
.spr { display: inline-block; width: var(--sz, var(--icon)); height: var(--sz, var(--icon)); background-repeat: no-repeat; image-rendering: pixelated; vertical-align: middle; }
.tool strong img.ico, .hub-list a img.ico { vertical-align: middle; margin-right: var(--sp-2); }
a { color: var(--c-link); text-underline-offset: 0.15em; }
a:hover { color: var(--c-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: var(--u) solid var(--c-focus); outline-offset: var(--u); }
.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: var(--gutter); top: -10rem; z-index: 50; background: var(--c-panel); color: var(--c-ink); padding: var(--sp-2) var(--sp-3); }
.skip:focus { top: var(--sp-2); }

/* ---------------------------------------------------------------- panels (the game window)
   Measured rim, outside to inside: black 1 game px, white 1 to 1.5 game px, black 1 game px, then the
   fill (tooltip X9yNEtoIZ3E t528, character sheet Q_zENhMmkFM t5). The outer black is the border, the
   white and inner black are inset rings, so the rim costs no image and no request. */

.card, .panel, .group, .tool a, .sr-pop, .tip, .sp-ask, .filter-empty, .site-foot {
  background: var(--c-panel);
  color: var(--c-ink);
  border: var(--u) solid var(--c-line);
  box-shadow: inset 0 0 0 var(--rim-panel) var(--c-rim), inset 0 0 0 calc(var(--rim-panel) + var(--u)) var(--c-line);
  border-radius: 0;
}
.tip, .sr-pop { box-shadow: inset 0 0 0 var(--rim) var(--c-rim), inset 0 0 0 calc(var(--rim) + var(--u)) var(--c-line); }
.card, .panel {
  padding: calc(var(--sp-3) + var(--rim-panel) + var(--u)) calc(var(--sp-4) + var(--rim-panel) + var(--u));
  margin: 0 0 var(--sp-4);
  min-width: 0;
}
.card > h2:first-child, .panel > h2:first-child, .group > h2:first-child { margin-top: 0; }
/* a title that is a link keeps the title colour (the game's window titles are never underlined) */
h1 a, h2 a, h3 a { color: inherit; text-decoration: none; }
h1 a:hover, h2 a:hover, h3 a:hover { color: var(--c-ink); }

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

/* the header is the HUD strip: a dark bar with the white rim on its lower edge */
.site-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-2) var(--gutter);
  background: var(--c-panel-deep);
  border-bottom: var(--u) solid var(--c-line);
  box-shadow: inset 0 calc(-1 * var(--rim-panel)) 0 var(--c-rim), inset 0 calc(-1 * (var(--rim-panel) + var(--u))) 0 var(--c-line);
  padding-bottom: calc(var(--sp-2) + var(--rim-panel) + var(--u));
}
/* brand = the character-name box of the character screen (GARLOK, KALRAN): black capitals on a white box
   with a black line around it. Phone: ONE row = brand + search at the same height (--tap). */
.site-head .brand {
  display: inline-flex; align-items: center; flex: none; height: var(--tap); white-space: nowrap;
  padding: 0 calc(var(--sp-2) + var(--u));
  background: var(--c-rim); color: var(--c-line); text-decoration: none;
  border: var(--u) solid var(--c-line);
  text-shadow: none;
}
.site-head .brand:hover { color: var(--c-line); }
.site-head .brand img { display: block; height: 100%; width: auto; }
@media (max-width: 559px) {
  /* phone: the full name in the narrow game face, so brand and search share one row */
  .site-head .brand { font-family: var(--font-pixel-small); }
}
.site-head .search { flex: 1 1 0; min-width: 0; order: 1; }
.site-head .search input { display: block; height: var(--tap); box-sizing: border-box; }
.site-head .site-nav { order: 3; flex: 1 1 100%; }
.site-head .langs { order: 4; }
@media (max-width: 719px) {
  /* phone row 2: the menu is ONE row that scrolls sideways (the page itself never does), its right edge fades
     out so a cut entry reads as "more"; the language links stay at the end of the row */
  .site-head .site-nav { flex: 1 1 0; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); }
  .site-head .site-nav::-webkit-scrollbar { display: none; }
  .site-head .site-nav ul { flex-wrap: nowrap; padding-right: 2rem; }
  .site-head .site-nav a { white-space: nowrap; }
  .site-head .langs { flex: none; flex-wrap: nowrap; }
}
.site-nav, .site-nav ul { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); padding: 0; margin: 0; list-style: none; }
/* menu entries: white capitals; the current or pointed entry gets the game's selection brackets (the four
   white corner marks around the chosen tab or list row, e.g. the craft tabs in X9yNEtoIZ3E t528) */
.site-nav a, .langs a { font-family: var(--font-pixel-small); }
.site-nav a {
  display: inline-block; position: relative; padding: var(--sp-2) var(--sp-1); min-height: var(--tap);
  line-height: calc(var(--tap) - 2 * var(--sp-2)); color: var(--c-ink); text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--c-title); }
.site-nav a:hover::before, .site-nav a[aria-current]::before,
.sr-opt[aria-selected="true"]::before, .chip[aria-pressed="true"]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  --b: calc(3 * var(--u));
  background:
    linear-gradient(var(--c-rim), var(--c-rim)) left top / var(--b) var(--u) no-repeat,
    linear-gradient(var(--c-rim), var(--c-rim)) left top / var(--u) var(--b) no-repeat,
    linear-gradient(var(--c-rim), var(--c-rim)) right top / var(--b) var(--u) no-repeat,
    linear-gradient(var(--c-rim), var(--c-rim)) right top / var(--u) var(--b) no-repeat,
    linear-gradient(var(--c-rim), var(--c-rim)) left bottom / var(--b) var(--u) no-repeat,
    linear-gradient(var(--c-rim), var(--c-rim)) left bottom / var(--u) var(--b) no-repeat,
    linear-gradient(var(--c-rim), var(--c-rim)) right bottom / var(--b) var(--u) no-repeat,
    linear-gradient(var(--c-rim), var(--c-rim)) right bottom / var(--u) var(--b) no-repeat;
}
main, .page { display: block; max-width: var(--page-max); margin: 0 auto; padding: var(--sp-3) var(--gutter) var(--sp-6); min-width: 0; }
.page > * { min-width: 0; }
.rail { font-size: var(--fs-s); }
.crumbs, .crumbs ol { font-size: var(--fs-s); color: var(--c-ink-soft); margin: 0 0 var(--sp-2); padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.crumbs li + li::before { content: "/"; margin-right: var(--sp-1); color: var(--c-ink-soft); }
.lead { font-size: var(--fs-1); }
.site-foot {
  width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--page-max) - 2 * var(--gutter)); margin: 0 auto var(--sp-5);
  padding: calc(var(--sp-4) + var(--rim-panel) + var(--u)) calc(var(--gutter) + var(--rim-panel) + var(--u));
  font-size: var(--fs-s); color: var(--c-ink-soft);
}
.site-foot a { color: var(--c-link); }
.stamp { font-size: var(--fs-s); color: var(--c-ink-soft); }

@media (min-width: 720px) {
  .site-head .search { flex: 0 1 26rem; order: 0; margin-left: auto; }
  .site-head .site-nav, .site-head .langs { order: 0; flex: initial; }
}
/* desktop: ONE header row (brand, menu, search) inside the same max-width as the content (owner 2026-09-27) */
@media (min-width: 1280px) {
  /* one row when brand + menu + search fit in the page width; a menu too long for it drops to a second row
     instead of crushing the search box (the gen lane keeps the menu short: see docs/LOOK.md "Header") */
  .site-head .search { flex: 1 1 10rem; max-width: 20rem; min-width: 10rem; }
  .site-head { padding-left: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter)));
    padding-right: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter))); }
  .site-head .site-nav ul { flex-wrap: nowrap; }
  .site-head .site-nav a, .site-head .langs a { white-space: nowrap; }
  .site-head .langs { flex-wrap: nowrap; }
}
/* home: no title box and no "What do you need?" box; the tool cards start right under the menu (owner
   2026-09-27). The h1 is visually hidden (.vh). */
.k-home main > .tools:first-of-type { margin-top: 0; }
@media (min-width: 1024px) {
  .page.has-rail { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: var(--sp-5); }
}

/* ---------------------------------------------------------------- tiles and lists */

/* entity page: the cards stack in their fixed order (03_pages_tools.md s3) */
.cards { display: block; }
.grid, .tool-grid, .hub-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); padding: 0; margin: 0 0 var(--sp-4); list-style: none; }
.grid > li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); margin: 0; }
@media (min-width: 640px) { .grid, .tool-grid, .hub-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* a tool tile = a small game window: tan title (like ALCHEMY / ARMOR), cyan line under it */
.tool a {
  display: block; height: 100%;
  padding: calc(var(--sp-3) + var(--rim-panel) + var(--u)) calc(var(--sp-4) + var(--rim-panel) + var(--u));
  text-decoration: none;
}
.tool strong { display: block; color: var(--c-title); }
.tool a:hover { background: var(--c-select); }
.tool a:hover strong { color: var(--c-ink); }
.job, .sub, .note, .count, .kicker, .conf-note, .unofficial { color: var(--c-ink-soft); font-size: var(--fs-s); }
.tool .job { color: var(--c-ink-soft); }
.kicker { font-size: var(--px-2); color: var(--c-value); }
.job { display: block; margin: var(--sp-1) 0 0; }
.kicker { margin: 0; }
.n { font-variant-numeric: tabular-nums; }
.hub-list > li { padding: var(--sp-2) 0; }
/* home and hub groups are game windows too: tan title, list rows inside */
.group { margin: 0 0 var(--sp-4); padding: calc(var(--sp-3) + var(--rim-panel) + var(--u)) calc(var(--sp-4) + var(--rim-panel) + var(--u)); }
.group .hub-list { margin-bottom: 0; }
.ent-head { display: flex; gap: var(--sp-3); align-items: flex-start; margin: 0 0 var(--sp-4); }
.ent-head .art { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; flex: none; }
.ent-head h1 { margin: 0 0 var(--sp-2); }
.quick { padding-left: 1.2em; margin: var(--sp-2) 0 0; }
.toc ol { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); padding: 0; margin: 0 0 var(--sp-4); list-style: none; font-size: var(--fs-s); }
.refs { padding-left: 1.2em; }
.refs > li { margin: 0 0 var(--sp-1); }
.refs.steps { list-style: none; padding: 0; }
.how { font-size: var(--fs-s); color: var(--c-ink-soft); margin: var(--sp-1) 0 0 calc(var(--icon) + 0.3em); }
.lab { color: var(--c-ink-soft); }
.qty { font-variant-numeric: tabular-nums; }
.empty { color: var(--c-ink-soft); }
details.fold > summary { cursor: pointer; min-height: var(--tap); line-height: var(--tap); color: var(--c-link); }
.explain { font-size: var(--fs-s); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
@media (min-width: 1024px) { .two-col { grid-template-columns: minmax(0, 1fr) 18rem; } }
.langs { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-s); }
.langs a { color: var(--c-ink); text-decoration: none; }
.langs a[aria-current] { color: var(--c-title); }
.foot-nav { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
/* label / value pairs = the character sheet (RACE  DWARF): white label, cyan value */
.kv { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: var(--sp-1) var(--sp-4); }
.kv dt { color: var(--c-ink); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--c-value); }
.route { padding-left: 1.5em; }
.route li { margin-bottom: var(--sp-2); }

/* game value colours (tooltip lines): use on spans the gen lane marks */
.v-gold { color: var(--c-gold); }
.v-good { color: var(--c-good); }
.v-stat { color: var(--c-stat); }
.v-lv { color: var(--c-value); }
.rar-normal { color: var(--c-rar-normal); }
.rar-magic { color: var(--c-rar-magic); }
.rar-rare { color: var(--c-rar-rare); }
.rar-epic { color: var(--c-rar-epic); }
.rar-legendary { color: var(--c-rar-legendary); }

/* ---------------------------------------------------------------- tables (the craft and vendor list rows) */

.table-wrap, .droptable { overflow-x: auto; max-width: 100%; margin: 0 0 var(--sp-4); }
table.data, table.numbers, table.drops { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; margin: 0 0 var(--sp-3); }
table.data th, table.data td, table.numbers th, table.numbers td, table.drops th, table.drops td {
  text-align: left; vertical-align: top; padding: var(--sp-2) var(--sp-3); border-bottom: var(--u) solid var(--c-panel-deep);
}
table.data thead th, table.drops thead th { background: var(--c-panel-deep); color: var(--c-ink); font-size: var(--px-2); vertical-align: bottom; }
table.data tbody tr:hover, table.drops tbody tr:hover { background: var(--c-select); }
table.data td.num, table.data th.num { text-align: right; }
.th-sort { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; text-align: inherit; }
th[aria-sort="ascending"] .th-sort::after { content: " \2191"; }
th[aria-sort="descending"] .th-sort::after { content: " \2193"; }

/* ---------------------------------------------------------------- controls */

/* button = the PLAY / APPLY button: dark fill, white rim, black line */
.btn {
  font-family: var(--font-pixel); font-size: var(--px-2); line-height: calc(28 / 24);
  font-weight: 400; text-transform: uppercase; letter-spacing: 0; text-shadow: var(--outline);
  -webkit-font-smoothing: none; font-smooth: never;
  display: inline-flex; align-items: center; gap: var(--sp-1);
  min-height: var(--tap); padding: var(--sp-1) calc(var(--sp-3) + var(--rim) + var(--u));
  background: var(--c-panel-deep); color: var(--c-ink);
  border: var(--u) solid var(--c-line);
  box-shadow: inset 0 0 0 var(--rim) var(--c-rim), inset 0 0 0 calc(var(--rim) + var(--u)) var(--c-line);
  border-radius: 0;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--c-select); color: var(--c-ink); }
.btn-primary { background: var(--c-select); }
/* chip = a craft tab: no frame until chosen, then the selection brackets on the purple row colour */
.chip {
  font-family: var(--font-pixel-small); font-size: var(--px-2); line-height: calc(28 / 24);
  font-weight: 400; text-transform: uppercase; letter-spacing: 0; text-shadow: var(--outline);
  -webkit-font-smoothing: none; font-smooth: never;
  display: inline-flex; align-items: center; gap: var(--sp-1); position: relative;
  min-height: 36px; padding: var(--sp-1) var(--sp-3);
  background: var(--c-panel-deep); color: var(--c-ink);
  border: var(--u) solid var(--c-line);
  border-radius: 0; cursor: pointer;
}
.chip:hover { color: var(--c-title); }
.chip[aria-pressed="true"] { background: var(--c-select); color: var(--c-ink); }
.chip-n { font-variant-numeric: tabular-nums; color: var(--c-value); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-3); padding: 0; border: 0; min-width: 0; }
/* fields: the options panel slider well, a black field with the white rim */
.field, input[type="search"], input[type="text"], select {
  min-height: var(--tap); padding: var(--sp-2) calc(var(--sp-3) + var(--rim)); max-width: 100%;
  background: var(--c-panel-deep); color: var(--c-ink);
  border: var(--u) solid var(--c-line);
  box-shadow: inset 0 0 0 var(--rim) var(--c-rim);
  border-radius: 0;
}
input::placeholder { color: var(--c-ink-soft); opacity: 1; }
input[type="search"] { width: 100%; -webkit-appearance: none; appearance: none; }
.status { font-size: var(--fs-s); color: var(--c-ink-soft); }

/* ---------------------------------------------------------------- entity links and labels */

.ent { display: inline-flex; align-items: center; gap: 0.3em; vertical-align: bottom; max-width: 100%; }
.ent img, .ent .spr, .ent-icon { width: var(--icon); height: var(--icon); object-fit: contain; image-rendering: pixelated; flex: none; }
.conf { display: inline-block; font-size: var(--fs-s); padding: 0 var(--sp-2); border-radius: 0; white-space: nowrap; }
.conf[data-conf="confirmed"] { color: var(--c-conf-ok); background: var(--c-conf-ok-bg); }
.conf[data-conf="unconfirmed"] { color: var(--c-conf-unsure); background: var(--c-conf-unsure-bg); }
.conf[data-conf="code"] { color: var(--c-conf-code); background: var(--c-conf-code-bg); }
.conf[data-conf="cannot-verify"] { color: var(--c-conf-none); background: var(--c-conf-none-bg); }

/* ---------------------------------------------------------------- search (search.js) */

.sr-host { position: relative; min-width: 0; }
.sr-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  max-height: min(70vh, 32rem); overflow-y: auto;
  padding: calc(var(--sp-2) + var(--rim) + var(--u));
}
.sr-pop[hidden] { display: none; }
.sr-inline { position: static; max-height: none; margin-top: var(--sp-3); }
.sr-chips { margin-bottom: var(--sp-2); }
.sr-list { list-style: none; margin: 0; padding: 0; }
.sr-opt { display: flex; position: relative; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: var(--sp-1) var(--sp-2); color: var(--c-ink); text-decoration: none; }
.sr-opt[aria-selected="true"], .sr-opt:hover { background: var(--c-select); color: var(--c-ink); }
.sr-opt img, .sr-mark { width: 28px; height: 28px; flex: none; object-fit: contain; image-rendering: pixelated; }
.sr-mark { display: inline-grid; place-items: center; background: var(--c-panel-deep); color: var(--c-ink); font-size: var(--px-2); }
.sr-name { flex: 1 1 auto; min-width: 0; }
.sr-kind { color: var(--c-ink-soft); font-size: var(--fs-s); white-space: nowrap; }
.sr-empty { margin: var(--sp-2); }
.sr-empty button { font: inherit; color: var(--c-link); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- hover card (tips.js) = the item tooltip */

.tip {
  position: fixed; left: 0; top: 0; z-index: 60;
  width: var(--tip-w); max-width: calc(100vw - 2 * var(--gutter));
  padding: calc(var(--sp-3) + var(--rim) + var(--u));
  font-size: var(--fs-s);
}
.tip[hidden] { display: none; }
.tip-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-1); }
.tip-head img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; flex: none; }
.tip-name { color: var(--c-ink); text-decoration: none; }
.tip-sub { color: var(--c-ink-soft); margin: 0 0 var(--sp-2); }
.tip p { margin: 0 0 var(--sp-1); }
.tip-go { display: none; }
.tip.tip-touch .tip-go { display: inline-flex; margin-top: var(--sp-2); }

/* ---------------------------------------------------------------- list filters (urlstate.js) */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-4); }
.filters > * { min-width: 0; }
.filters input[type="search"] { flex: 1 1 14rem; width: auto; }
.filters .chips { flex: 1 1 100%; margin: 0; }
.facets { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-3); }
.facets > * { min-width: 0; }
fieldset.facet { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.facet legend { float: left; width: 100%; padding: 0; margin: 0 0 var(--sp-1); color: var(--c-title); }
.namebox { flex: 1 1 14rem; }
.filter-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); flex: 1 1 100%; }
.filter-empty { padding: calc(var(--sp-4) + var(--rim-panel) + var(--u)); }

/* ---------------------------------------------------------------- drop table (droptable.js) */

.dt { margin: 0 0 var(--sp-4); max-width: 100%; overflow-x: auto; }
.dt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-3); }
.dt-bar > * { min-width: 0; }
.dt-bar input[type="search"] { flex: 1 1 14rem; width: auto; }
.dt-pill { display: inline-flex; align-items: center; gap: var(--sp-1); }
.dt table.data td { overflow-wrap: anywhere; }
.dt-find { font-size: var(--fs-s); white-space: nowrap; }
.dt-cond { margin: 0; padding-left: 1.1em; font-size: var(--fs-s); }
.dt-odds { display: block; color: var(--c-ink-soft); font-size: var(--fs-s); }
.dt-more { margin-top: var(--sp-2); }
.dt-note { font-size: var(--fs-s); color: var(--c-ink-soft); }
.dt-switch { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); cursor: pointer; }
.dt-switch input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--c-select); }
@media (max-width: 640px) {
  /* phone: each drop row becomes a small card with labelled fields */
  .dt table.data, .dt table.data tbody, .dt table.data tr, .dt table.data td { display: block; width: 100%; }
  .dt table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dt table.data tr { border: var(--u) solid var(--c-line); box-shadow: inset 0 0 0 var(--rim) var(--c-rim); background: var(--c-panel); margin: 0 0 var(--sp-2); padding: var(--sp-2) calc(var(--sp-3) + var(--rim)); }
  .dt table.data td { border: 0; padding: var(--sp-1) 0; text-align: left; }
  .dt table.data td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-s); color: var(--c-ink-soft); }
}

/* ---------------------------------------------------------------- spoilers (spoiler.js) */

.sp-hidden, .sp-wait [data-spoiler] { filter: blur(0.45em); cursor: pointer; user-select: none; -webkit-user-select: none; }
.sp-hidden > * { pointer-events: none; }
.sp-controls { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.sp-controls label { display: inline-flex; align-items: flex-start; gap: var(--sp-2); min-height: var(--tap); padding: var(--sp-1) 0; cursor: pointer; }
.sp-controls input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--c-select); }
.sp-hint { display: block; font-size: var(--fs-s); color: var(--c-ink-soft); }
.sp-ask {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); z-index: 70;
  max-width: 36rem; margin: 0 auto;
  padding: calc(var(--sp-3) + var(--rim-panel) + var(--u)) calc(var(--sp-4) + var(--rim-panel) + var(--u));
}
.sp-ask p { margin: 0 0 var(--sp-2); }
.sp-ask-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
