/* DDSound: utilitarian catalog style. One stylesheet, system fonts, no animations.
 * The system (docs/DESIGN-REFERENCE.md §6, checked by qa/layout_check.py):
 *   spacing   --s1..--s5 = 4 / 8 / 12 / 16 / 24 px: every padding and gap is 0 or one of these
 *   controls  --h-sm 22 px (tables, side columns, small buttons), --h 28 px (header, main buttons, the share field);
 *             touch (pointer: coarse) raises every tap target to 32 px
 *   type      11 / 12 / 14 / 18 px; bold only for section headings (legend, h2, table header, group rows) and the H1
 *   colour    one green (--acc: state and brand; --acc-fill for the primary button), one blue (--link, also focus),
 *             --line for control borders and header rules (>= 3:1), --line2 for hairline dividers
 *   buttons   primary (filled), default (bordered), quiet (text only); one hover (--hl), one disabled style
 *   icons     12 px (14 in the header and the menu), 1.25 px strokes, --fg2 at rest, --acc only when active */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --h-sm: 22px; --h: 28px;
  --toph: 40px;   /* the sticky header's height (two rows on phones, 76 px) */
  --bg: #fff; --bg2: #eee; --bg3: #e4e4e4; --fg: #333; --fg2: #666; --line: #888; --line2: #ddd; --card: #c4c4c4;
  --link: #069; --link-hover: #000; --hl: #ffffb5; --yellow: #fed700;
  --acc: #336633; --acc-fill: #336633; --on-acc: #fff; --acc-bg: #e6f0e6; --err: #a32020; --err-bg: #fbeaea; --warn: #8a5a00; --sel: #fff8d6;
  --rule-brand: var(--acc); --focus: var(--link);
  color-scheme: light;
  /* converter Details canvases (names read by the original converter's renderers, js/converter-viz.js) */
  --wave-mid: var(--line); --wave-in: var(--fg2); --wave-out: var(--acc); --wave-clip: var(--err);
  --muted: var(--fg2); --border-strong: var(--line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161716; --bg2: #202120; --bg3: #2b2c2b; --fg: #e2e2df; --fg2: #9d9d99; --line: #707170; --line2: #333431; --card: #454641;
    --link: #6cb4dc; --link-hover: #fff; --hl: #33331a; --yellow: #8a7600;
    --acc: #8cc79a; --acc-fill: #3a7348; --on-acc: #fff; --acc-bg: #223428; --err: #f08c8c; --err-bg: #3a2020; --warn: #e0b350; --sel: #34321f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161716; --bg2: #202120; --bg3: #2b2c2b; --fg: #e2e2df; --fg2: #9d9d99; --line: #707170; --line2: #333431; --card: #454641;
  --link: #6cb4dc; --link-hover: #fff; --hl: #33331a; --yellow: #8a7600;
  --acc: #8cc79a; --acc-fill: #3a7348; --on-acc: #fff; --acc-bg: #223428; --err: #f08c8c; --err-bg: #3a2020; --warn: #e0b350; --sel: #34321f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); font: 12px/1.3 Arial, Helvetica, "Liberation Sans", "Nimbus Sans", sans-serif; }
/* links: McMaster blue, no underline in lists and tables (position says "link"); underlined inside prose (WCAG 1.4.1) */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
.desc a, .sidenote a, .foot a, .notice a, .covnote a, .install a, .dn a, .lic a { text-decoration: underline; }
code, .mono { font-family: Consolas, "Liberation Mono", Menlo, monospace; font-size: 12px; }
h1 { font-size: 18px; line-height: 22px; margin: 8px 0 4px; color: var(--rule-brand); }
h2 { font-size: 12px; line-height: 16px; font-weight: bold; margin: 0 0 8px; color: var(--fg); }
b, strong, th { font-weight: normal; }   /* bold is a heading's: see the rules that set it back */
::placeholder { color: var(--fg2); opacity: 1; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.vh, .sprite { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--bg); padding: var(--s1) var(--s2); z-index: 5; }
.skip:focus { left: 8px; }
svg { flex: none; }
/* icons: neutral at rest, the accent only for an active state (.on, pressed, expanded); 12 px, 14 px in the header */
.btn svg, .dt svg, .rm svg { width: 12px; height: 12px; }

/* header */
.top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: var(--s3); height: 40px; padding: 0 var(--s3);
  background: var(--bg); border-bottom: 2px solid var(--yellow); }
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: bold; font-size: 14px; color: var(--fg); text-decoration: none; width: 86px; flex: none; }
/* two-tool nav: brand + nav together are as wide as the left column, so the search lines up with the main area */
/* the tabs sit inside the 38 px above the yellow rule: the current one thickens the rule (no second colour on it) and a
   focus ring is never cut by the bar's edge */
.nav { display: flex; align-items: stretch; align-self: flex-start; height: 38px; width: 212px; min-width: max-content; flex: none; }   /* four tools: Generate, Convert, Test, Packs; never narrower than their names (RU / FR are longer) */
.nav a { display: flex; align-items: center; padding: 0 var(--s2); color: var(--fg); text-decoration: none; font-size: 12px; border-bottom: 2px solid transparent; }
.nav a:hover { background: var(--hl); text-decoration: none; }
.nav a:focus-visible { outline-offset: -2px; }
.nav a[aria-current="page"] { border-bottom-color: var(--yellow); }
.search { display: flex; align-items: center; gap: var(--s2); flex: 1; min-width: 0; max-width: 700px; height: var(--h); padding: 0 var(--s2);
  border: 1px solid var(--line); background: var(--bg); color: var(--fg2); }
.search input { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; height: 100%; outline: none; font-size: 12px; color: var(--fg); }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 0; }
.search svg { width: 14px; height: 14px; }
/* language and light/dark (the same group, sizes and order on ipi.hu, DDSound and Skins/Assets): two segmented
   groups, [EN][FR][RU] then [Light][Dark], --h (28 px) buttons sharing their borders, the current one pressed (the
   one pressed look: --acc on --acc-bg). The pressed state is drawn from <html data-lang / data-mode>
   (js/theme-init.js, before the first paint), so nothing changes when the scripts mark aria-pressed. Shown only with
   JavaScript (html[data-js]): both groups need it here. */
.prefs { display: none; align-items: center; gap: var(--s2); flex: none; margin-left: auto; }
html[data-js] .prefs { display: flex; }
.prefs-lang, .prefs-mode { display: flex; }
.prefs button { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: var(--h); margin: 0; padding: 0 4px;
  border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); font: inherit; font-size: 12px; line-height: 1;
  white-space: nowrap; cursor: pointer; }
.prefs-lang > button { width: 32px; padding: 0; }
.prefs-mode > button { min-width: 44px; }
.prefs button + button { margin-left: -1px; }
.prefs button:hover { background: var(--hl); color: var(--fg); }
.prefs button:focus-visible { position: relative; z-index: 2; }
.prefs .prefs-lang > [aria-pressed="true"], .prefs .prefs-mode > [aria-pressed="true"],
:root[data-lang="en"] .prefs-lang > [data-lang="en"], :root[data-lang="fr"] .prefs-lang > [data-lang="fr"], :root[data-lang="ru"] .prefs-lang > [data-lang="ru"],
:root[data-mode="light"] .prefs-mode > [data-mode="light"], :root[data-mode="dark"] .prefs-mode > [data-mode="dark"] {
  position: relative; z-index: 1; border-color: var(--acc); background: var(--acc-bg); color: var(--acc); cursor: default; }

/* layout: left column = facets that shape the result; main = the result */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: var(--toph); height: calc(100vh - var(--toph)); overflow-y: auto; overscroll-behavior: contain;
  border-right: 0; background: var(--bg2); padding: var(--s2) var(--s3) var(--s3) var(--s2); }
/* a facet = heading + values + a 1px rule (McMaster's "Filter by" column: no boxes, no title bars) */
.facet { margin: 0 0 var(--s2); padding: 0 0 var(--s2); border: 0; border-bottom: 1px solid var(--line2); background: transparent; min-width: 0; }
.facet legend { float: left; width: 100%; margin: 0; padding: var(--s1) 0 0; font-weight: bold; font-size: 12px; background: none; border: 0; }
.facet legend + * { clear: both; }
.facet legend.vh { float: none; width: 1px; padding: 0; }   /* a visually hidden legend stays 1 px (100 % wide it pushed /test 8 px past a 600-700 px window) */
/* Generate's theme box: one select-like control (the Pack name field's border and height) that opens the theme
   table; under it one 11 px line: the current theme's montage ▸, "9 s montage" or the sound playing now (no layout
   shift), and "all 26 themes" at the right */
.thbox { display: flex; align-items: center; gap: var(--s2); width: 100%; min-width: 0; height: var(--h-sm); margin: 0; padding: 0 var(--s1);
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.thbox:hover { background: var(--hl); }
.thbox[aria-expanded="true"] { border-color: var(--acc); }
.thbox .tb-v { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thbox #tb-feel { color: var(--fg2); }
.thbox .tb-c { flex: none; color: var(--fg2); font-size: 11px; }
.tline { display: flex; align-items: center; gap: var(--s1); min-height: var(--h-sm); margin-top: 2px; font-size: 11px; line-height: 14px; white-space: nowrap; }
.tline .tl-l { color: var(--fg2); }
.tline .tl-l[hidden] { display: none; }
.tline #theme-change { flex: none; min-width: 96px; margin-left: auto; font-size: 11px; text-align: right; }   /* its left edge fixed before the count arrives (no shift) */
.tline .hear { border-color: var(--line2); background: transparent; }
.tline .hear:hover { border-color: var(--line); background: var(--hl); }
.tline .hear.on { border-color: var(--acc); background: var(--acc-bg); }
#montage-now { flex: 1 1 0; display: flex; min-width: 0; font-weight: normal; font-size: 11px; line-height: 1; color: var(--acc); white-space: nowrap; }
#montage-now[hidden] { display: none; }
#montage-now > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#montage-now > span:first-child { flex-shrink: 1000; margin-right: 4px; }   /* too long: the theme name gives way first, the sound stays */
.opts { list-style: none; margin: 0; padding: 0 0 0 var(--s1); }
.opts li { display: flex; align-items: center; gap: var(--s1); min-height: var(--h-sm); }
.opts label { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s1); cursor: pointer; overflow-wrap: anywhere; line-height: 15px; }
.opts input { margin: 0; accent-color: var(--acc); flex: none; }
.opts .n { color: var(--fg2); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }
.opts li.sk::before { content: ""; display: block; width: 70%; height: 11px; background: var(--bg3); }  /* same 22 px row as the real one */
.opts li.dim label { color: var(--fg2); }
/* a search: the matching themes are marked, the others dimmed */
.filtering li:not(.dim):not(.sk) label { background: var(--hl); }
.hear { display: inline-flex; align-items: center; justify-content: center; width: var(--h-sm); height: var(--h-sm); padding: 0; border: 1px solid var(--line);
  background: var(--bg); cursor: pointer; color: var(--fg2); flex: none; }
.hear:hover { background: var(--hl); color: var(--fg); }
.hear svg { width: 8px; height: 8px; }
.hear.on { background: var(--acc-bg); border-color: var(--acc); color: var(--acc); }
/* spec-style knobs */
/* knob rows: a 64 px label, the control, a value; .msg lines start under the control (4 + 64 + 8 = 76 px) */
.kn, .kr, .kt { display: grid; align-items: center; gap: 0 var(--s2); padding: 0 0 0 var(--s1); min-height: 26px; }
.kn { grid-template-columns: 64px minmax(0, 1fr) 48px; }
.kr { grid-template-columns: 64px minmax(0, 1fr); }
.kt { grid-template-columns: 64px minmax(0, 1fr) auto; }
.kn label, .kl, .kt label { font-size: 12px; }
.kn input[type="range"] { width: 100%; min-width: 0; margin: 0; }
/* sliders: a 1 px track and an outlined square thumb, the same in both themes (no accent: a value, not a state) */
input[type="range"] { -webkit-appearance: none; appearance: none; height: var(--h-sm); background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 10px; height: 10px; margin-top: -5px;
  border: 1px solid var(--fg2); border-radius: 0; background: var(--bg); }
input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 10px; height: 10px; border: 1px solid var(--fg2); border-radius: 0; background: var(--bg); }
input[type="range"]:hover::-webkit-slider-thumb { border-color: var(--fg); background: var(--hl); }
input[type="range"]:hover::-moz-range-thumb { border-color: var(--fg); background: var(--hl); }
input[type="range"]:active::-webkit-slider-thumb { border-color: var(--fg); background: var(--fg2); }
input[type="range"]:active::-moz-range-thumb { border-color: var(--fg); background: var(--fg2); }
input[type="range"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
input[type="range"]:focus-visible::-webkit-slider-thumb { border-color: var(--fg); }
input[type="range"]:disabled { cursor: default; }
input[type="range"]:disabled::-webkit-slider-thumb { border-color: var(--line2); background: var(--bg2); }
input[type="range"]:disabled::-moz-range-thumb { border-color: var(--line2); background: var(--bg2); }
input[type="range"]:disabled::-webkit-slider-runnable-track { background: var(--line2); }
.rs { display: flex; flex-wrap: wrap; gap: 0 var(--s2); font-size: 12px; }
.rs label { display: inline-flex; align-items: center; gap: var(--s1); white-space: nowrap; cursor: pointer; line-height: 20px; }
.rs input { margin: 0; accent-color: var(--acc); }
.rs .some { line-height: 20px; white-space: nowrap; font-weight: bold; }   /* Variants: some sounds only ("Some: 3") */
.rs label:has(input:disabled) { color: var(--fg2); cursor: default; }
.num { width: 48px; height: var(--h-sm); padding: 0 var(--s1); border: 1px solid var(--line); background: var(--bg); text-align: right; }
.text, .seed { width: 100%; min-width: 0; height: var(--h-sm); padding: 0 var(--s1); border: 1px solid var(--line); background: var(--bg); }
:is(.num, .text, .seed, .sel, input.gain):disabled { color: var(--fg2); border-color: var(--line2); background: var(--bg); opacity: 1; }
.kt .text { grid-column: 2 / 4; }
.msg { margin: 0 0 4px 76px; font-size: 11px; color: var(--fg2); min-height: 15px; line-height: 15px; overflow-wrap: anywhere; }
.msg.err { color: var(--err); }
input[aria-invalid="true"] { border-color: var(--err); background: var(--err-bg); }
.sidenote { margin: 4px 4px 0; font-size: 12px; color: var(--fg2); }

/* main */
main { padding: var(--s2) var(--s4) var(--s5); min-width: 0; }
section { margin-top: 12px; }
.crumbs + h1 { margin-top: 8px; }
.crumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; font-size: 12px; color: var(--fg2); height: 22px; line-height: 21px;
  overflow: hidden; border-bottom: 1px solid var(--rule-brand); }
.crumbs li + li::before { content: ">"; padding: 0 var(--s2); color: var(--fg2); }
.crumbs li:last-child { color: var(--fg); }
.crumbs a { color: var(--link); }
.desc { margin: 4px 0 0; min-height: 20px; line-height: 17px; padding: 0; color: var(--fg2); }
.desc b { color: var(--fg); font-weight: bold; }   /* the run-in head of the theme line (McMaster's "Black-Oxide Alloy Steel—") */
.count { font-weight: normal; color: var(--fg2); font-size: 12px; }
.status { color: var(--fg); font-weight: normal; font-size: 12px; margin-left: 8px; }
h2 .count, h2 .status, legend .count, summary .count { font-weight: normal; }
#h-events { position: sticky; top: var(--toph); z-index: 2; background: var(--bg); margin: 0; padding: var(--s1) 0; min-height: 24px; box-shadow: 0 1px 0 var(--line2); }
#set-hits { margin: 0 0 var(--s1); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#set-hits .hl-t { color: var(--fg2); }
#h-events .status { display: inline-block; max-width: 100%; vertical-align: top; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status.err, .err { color: var(--err); }
.notice { margin-top: 8px; padding: var(--s1) var(--s2); border: 1px solid var(--err); background: var(--err-bg); color: var(--fg); }
.notice.info { border-color: var(--acc); background: var(--acc-bg); }

/* pack strip: fixed rows, controls always present (enabled when ready) so nothing moves */
.strip { margin-top: 8px; border: 1px solid var(--line2); background: var(--bg); }
.sr { display: flex; align-items: center; gap: var(--s2); min-height: 36px; padding: var(--s1) var(--s2); border-bottom: 1px solid var(--line2); min-width: 0; }
.sr:last-child { border-bottom: 0; }
.r1 { flex-wrap: wrap; row-gap: var(--s1); }
.r1 .files { width: 150px; flex: none; color: var(--fg2); white-space: nowrap; }
.r1 .stat { flex: 1 1 200px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.r1 .prog { flex: 0 1 290px; min-width: 150px; display: inline-flex; contain: layout; align-items: center; gap: var(--s2); overflow: hidden; white-space: nowrap; }
.r1 .prog progress { flex: 1 1 auto; min-width: 60px; }
.r2 label { font-size: 12px; white-space: nowrap; }
.r2:has(#share-play:not([hidden])) { flex-wrap: wrap; row-gap: var(--s1); }   /* the Preview button and the Discord note: wrap, never overflow */
#share-now { color: var(--acc); }
.r2 label:has(#share-now:not([hidden])) { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }   /* a long name: ellipsis, never wider */
#share-play.on { background: var(--acc-bg); border-color: var(--acc); color: var(--acc); }
#share-play.busy svg { color: var(--fg2); }
.r2 input { flex: 1 1 120px; min-width: 0; height: var(--h); padding: 0 var(--s1); border: 1px solid var(--line); background: var(--bg); font-size: 12px; text-overflow: ellipsis; }
.r2 input:not(:placeholder-shown) { font-family: Consolas, "Liberation Mono", monospace; }
.ready .r1 .stat { color: var(--acc); }
details.more { display: block; padding: 0; min-height: 0; }
details.more > summary { height: 28px; line-height: 28px; padding: 0 var(--s2); cursor: pointer; font-size: 12px; font-weight: bold; list-style-position: inside; }
details.more[open] > summary { border-bottom: 1px solid var(--line2); }
#snd-disc { display: none; }   /* Generate's sound table: a disclosure row on phones only (the ≤ 700 px block) */
.inner { margin: 0; border: 0; max-height: 260px; overflow-y: auto; }
/* the label column is as wide as its longest label ("Folder", "Undo", "Remarque"; the steps are one digit), right-aligned */
.grid.install { table-layout: auto; }
.install th { width: 1%; background: transparent; font-size: 12px; white-space: nowrap; vertical-align: top; color: var(--fg2); text-align: right; }
.grid.install th { padding: 0 var(--s2) 0 0; text-align: right; }
.install td { height: auto; line-height: 1.5; overflow-wrap: anywhere; }
.install code { overflow-wrap: anywhere; }
.install tr.osh td { color: var(--fg2); font-size: 12px; }
.install tr.osr .here { font-size: 11px; color: var(--acc); }
.install tr.osr .osp { display: inline-flex; align-items: baseline; gap: 0 var(--s2); flex-wrap: wrap; max-width: 100%; }
.install tr.osr .osp code { font-size: 12px; }
.install tr.osr .osn { display: block; font-size: 11px; line-height: 1.4; color: var(--fg2); }
.install tr.osr .osn code { font-size: 11px; }
.install tr.osr .copy { flex: none; }
@media (pointer: coarse) { .install tr.osr .copy, #slead-inst { display: inline-flex; align-items: center; min-height: 32px; } }
progress { width: 140px; height: 12px; accent-color: var(--acc); }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line2); }
.tablewrap.loading { min-height: 100vh; }  /* only until the catalogue arrives: nothing below can jump into view */
.tablewrap.inner { border: 0; }
table { border-collapse: collapse; width: 100%; }
.grid { table-layout: fixed; }
/* McMaster tables: white header bottom-aligned over a #999 rule, tiny left / generous right padding, yellow row hover */
.grid th, .grid td { padding: 0 var(--s4) 0 var(--s1); border-bottom: 1px solid var(--line2); text-align: left; vertical-align: middle; }
.grid thead th { background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: bold; vertical-align: bottom;
  white-space: normal; height: auto; line-height: 14px; padding: var(--s1) var(--s4) var(--s1) var(--s1); overflow-wrap: break-word; }
.grid tbody tr:hover > * { background: var(--hl); }
.grid .r { text-align: right; }
.grid td.r, .grid th.r { padding: 0 var(--s1) 0 var(--s4); }
.grid td { height: 26px; }
.grid tr.group th { background: var(--bg2); font-size: 12px; font-weight: bold; text-transform: none; letter-spacing: 0; height: var(--h-sm); padding-top: 0; padding-bottom: 0; }
.grid tr.group:hover > * { background: var(--bg2); }
.grid tr.group th .n { font-weight: normal; color: var(--fg2); }
.grid tr.empty td { color: var(--fg2); text-align: center; height: 40px; }
.grid tr.empty td a { text-decoration: underline; }   /* a link inside grey text: not by colour alone (axe link-in-text-block) */
.grid tr.sk td span { display: block; height: 10px; background: var(--bg3); width: 70%; }
.grid tr.sk.group td { height: var(--h-sm); background: var(--bg2); }
.grid tr.sk.tall td { height: 52px; }
.small { font-size: 12px; color: var(--fg2); }
.ell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* events: one 26 px line per sound in table form: the name, then its file pattern (11 px mono, --fg2); the explaining
   columns in 11 px --fg2 two-line cells. A long name wraps (never cut), which only makes that row taller. */
.events .c-ev { width: auto; } .events .c-when { width: 22%; } .events .c-len { width: 84px; } .events .c-lvl { width: 76px; }
.events .c-src { width: 248px; } .events .c-gain { width: 72px; } .events .c-var { width: 104px; } .events .c-play { width: 136px; }
.events td { padding-top: 0; padding-bottom: 0; height: 26px; }
.events td.when, .events td.lvl { font-size: 11px; line-height: 13px; color: var(--fg2); }
.events td:first-child { line-height: 15px; }
.events .lbl.ell { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.events td:first-child { padding-right: var(--s2); }
.events td:first-child .lbl { margin-right: 8px; }
.events td:first-child .small { display: inline-block; font-size: 11px; white-space: nowrap; overflow: visible; vertical-align: top; }
.events tr[data-event] td:last-child { padding-left: var(--s1); padding-right: var(--s1); }
.events .unused { color: var(--fg2); font-size: 11px; border: 1px solid var(--line2); padding: 0 var(--s1); margin-left: 4px; }
.events tr.stock td { color: var(--fg2); }
.plays { display: flex; flex-wrap: wrap; gap: var(--s1); margin: 2px 0; }   /* 22 + 2 + 2 = the 26 px row; wrapped lines keep air */
.plays.many:not(.all) .pb.x { display: none; }   /* 5, 8 or 12 variants: the first 3 and a "+n" toggle (one line) */
.plays.all .vmore { order: 99; }
.pb.vmore { color: var(--link); }
.contents .c-file { width: auto; } .contents .c-dur { width: 80px; } .contents .c-size { width: 80px; }
.contents { font-variant-numeric: tabular-nums; }
.contents .cn { margin-right: var(--s2); } .contents .cf { color: var(--fg2); }
/* Your packs (js/history.js): name link · theme · when · forget */
.hist { table-layout: fixed; width: 100%; font-variant-numeric: tabular-nums; }
.hist .c-hn { width: auto; } .hist .c-ht { width: 34%; } .hist .c-hw { width: 64px; } .hist .c-hx { width: 30px; padding-left: 0; padding-right: 0; }
.hist td.c-ht { color: var(--fg2); }
.hist tr.cur td { background: var(--hl); }
.hist tr.empty td { height: auto; padding: var(--s1) var(--s2); text-align: left; white-space: normal; line-height: 1.4; }
@media (pointer: coarse) { .hist .c-hx { width: 40px; } .hist .rm { width: 32px; height: 32px; } }
#pack.ready .prog { visibility: hidden; }   /* a ready pack: one status line ("Ready · 116 files · 4.3 MB"), no full bar (kept in flow: no shift) */

/* buttons: three styles.
   default  bordered --line on --bg, --fg text; every boxed control (.btn, .pb, .hear, .srcb, .fb, .pt, .au, .bind,
            the segmented .seg / .prefs)
   primary  .btn.primary: --acc-fill with --on-acc text; one per screen region (Generate, Download, Start)
   quiet    no box, link-coloured text (.lnk, .dt Details, .rm): actions inside rows of data
   One hover (--hl fill), one pressed/selected look (--acc-bg fill, --acc border), one disabled look (--fg2 text on --bg,
   --line2 border, never opacity), square corners like the fields. */
.btn { display: inline-flex; align-items: center; gap: var(--s1); height: var(--h); padding: 0 var(--s2); border: 1px solid var(--line); background: var(--bg);
  border-radius: 0; color: var(--fg); cursor: pointer; text-decoration: none; white-space: nowrap; flex: none; }
.btn svg { color: var(--fg2); }
a.btn:hover { color: var(--fg); text-decoration: none; }
.btn:hover { background: var(--hl); }
.btn.sm, .btn.xs { height: var(--h-sm); padding: 0 var(--s2); font-size: 12px; }
.btn.primary { background: var(--acc-fill); border-color: var(--acc-fill); color: var(--on-acc); width: 124px; justify-content: center; }
.btn.primary svg { color: inherit; }
.btn.primary:hover { background: var(--acc-fill); color: var(--on-acc); text-decoration: underline; }
:is(.btn, .pb, .hear, .srcb, .fb, .pt, .au, .bind, .tb):is(:disabled, [aria-disabled="true"]),
.btn.primary:is(:disabled, [aria-disabled="true"]) {
  opacity: 1; cursor: default; color: var(--fg2); border-color: var(--line2); background: var(--bg); text-decoration: none; }
a.btn[aria-disabled="true"] { pointer-events: none; }
:is(.btn, .pb, .hear, .srcb, .fb, .pt, .au, .bind):is(:disabled, [aria-disabled="true"]):hover { background: var(--bg); color: var(--fg2); text-decoration: none; }   /* a link has no disabled state: no navigation (buttons keep their tooltips) */
:is(.btn, .pb, .hear):is(:disabled, [aria-disabled="true"]) svg { color: var(--line); }
a.btn.primary:hover { color: var(--on-acc); }   /* Download (a link) once the pack is ready: the strip's one accent button */
.page-conv #download { width: 124px; justify-content: center; }   /* accent only once there is something to download: same width */
#share-play { min-width: 80px; justify-content: center; }   /* "Preview" and "Stop" (while it plays): one width */
/* Generate and Download swap the accent when a pack gets ready: same widths in both states, nothing moves */
.page-gen #generate { width: 124px; justify-content: center; }
.page-gen #download { min-width: 124px; justify-content: center; }
.page-gen #download.primary { width: auto; }
/* the H1 is one line (a share link's pack name replaces "Generate a sound pack" after load: no re-wrap) */
.page-gen main > h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); width: 28px; height: var(--h-sm); padding: 0; border: 1px solid var(--line);
  border-radius: 0; background: var(--bg); cursor: pointer; font-size: 11px; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; }
.pb:hover { background: var(--hl); }
.pb svg { width: 7px; height: 7px; color: var(--fg2); }
.pb:hover svg { color: var(--fg); }
.pb.on { background: var(--acc-bg); border-color: var(--acc); }
.pb.on svg { color: var(--acc); }
.pb.busy svg, .hear.busy svg { color: var(--fg2); }
@media (prefers-reduced-motion: no-preference) { .pb.busy svg, .hear.busy svg { animation: spin 0.8s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { margin-top: 24px; padding-top: var(--s2); border-top: 1px solid var(--line2); color: var(--fg2); font-size: 11px; }

/* medium: narrower table columns. Container queries on the events section (its own width, not the window's: on
 * desktop the table sits between the inputs and the outcomes column). The columns that only explain (More detail:
 * When it plays, Rec. length, Priority) go first as the table narrows; a list <= 640 px (SPEC 12.4: the Source cell
 * is then the row's second line). Collapsed to zero width (not display: none): the colspan category rows would
 * otherwise get phantom columns. */
#events { container: ev / inline-size; }
#files { container: cv / inline-size; }
@container ev (max-width: 1160px) { .events :is(td, th).c-len { width: 0; padding: 0; border-left: 0; border-right: 0; visibility: hidden; overflow: hidden; white-space: nowrap; font-size: 0; } }
@container ev (max-width: 1040px) { .events :is(td, th).c-when { width: 0; padding: 0; border-left: 0; border-right: 0; visibility: hidden; overflow: hidden; white-space: nowrap; font-size: 0; } }
@container ev (max-width: 900px) { .events :is(td, th).c-lvl { width: 0; padding: 0; border-left: 0; border-right: 0; visibility: hidden; overflow: hidden; white-space: nowrap; font-size: 0; } }
/* <= 640 px of table: a list, three lines per sound: its name by the play buttons, the Source (full width), then
   Level and Files */
@container ev (max-width: 640px) {
  .events, .events > tbody { display: block; }
  /* the list keeps one header line: Files · all varied · all one (the other headers name nothing a row doesn't) */
  .events > thead { display: block; position: static; }
  .events > thead tr { display: flex; justify-content: flex-end; }
  .events > thead th { display: none; }
  .events > thead th.c-var { display: flex; align-items: center; gap: var(--s2); width: auto; height: 36px; padding: 0 var(--s2); border: 0; }
  .events > thead th.c-var .th-l, .events > thead th.c-var .thx { display: inline-flex; align-items: center; gap: var(--s1); }
  .events > thead th.c-var .lnk { min-height: 32px; display: inline-flex; align-items: center; font-size: 13px; }
  .events.nosingle > thead { display: none; }
  .events tr[data-event] { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; grid-template-areas: "name name play" "src src src" "gain files files";
    gap: var(--s1) var(--s2); align-items: center; padding: var(--s1) var(--s2) var(--s1) var(--s1); border-bottom: 1px solid var(--line2); }
  .events tr[data-event][hidden] { display: none; }
  .events tr[data-event] > td { display: none; }
  /* a grid row: the row itself takes the hover / open colour (its cells leave gaps between them) */
  .grid tbody tr[data-event]:hover { background: var(--hl); }
  .events tr[data-event].open { background: var(--bg2); }
  .grid tbody tr[data-event]:hover > td, .events tr[data-event].open > td { background: transparent; }
  .events tr[data-event] > td:is(.c-ev, .c-src, .c-gain, .c-var, .c-play) { display: block; border: 0; padding: 0; height: auto; width: auto; min-width: 0; }
  .events tr[data-event] > td.c-ev { grid-area: name; }
  .events tr[data-event] > td.c-src { grid-area: src; }
  .events tr[data-event] > td.c-gain { grid-area: gain; }
  .events tr[data-event] > td.c-var { grid-area: files; justify-self: start; }   /* the play buttons take the name line's right end: no fixed column under them */
  .events tr[data-event] > td.c-play { grid-area: play; justify-self: end; }
  /* ▸1 ▸2 ▸3 +n on one line beside the name at 360 px: 32 px square buttons (the touch size), 2 px apart */
  .events tr[data-event] .plays { gap: 2px; }
  .events tr[data-event] .plays .pb { width: 32px; }
  .events tr[data-event] td.c-ev .small { display: block; margin-left: 0; }
  .events tr.group { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "gl gl" "mix glv"; gap: var(--s1) var(--s2); align-items: center;
    padding: var(--s1) var(--s2) var(--s1) var(--s1); background: var(--bg2); border-bottom: 1px solid var(--line2); }
  .events tr.group > * { display: block; border: 0; padding: 0; height: auto; width: auto; min-width: 0; background: transparent; }
  .events tr.group > th { grid-area: gl; }
  .events tr.group > td.c-src { grid-area: mix; }
  .events tr.group > td.c-glv { grid-area: glv; }
  .events tr.group > td.c-play { display: none; }
  .events tr.catrow { display: block; }
  .events tr.catrow > td { display: block; padding: var(--s2); }
  .events tr.sk { display: none; }
  .events tr.empty, .events tr.empty td { display: block; }
}

/* narrow: facets stack above the table as plain groups (no hamburger) */
@media (max-width: 700px) {
  /* the header in two rows: the brand and the language / light-dark group, then the tools and the search (the tabs
     stay on the yellow rule) */
  :root { --toph: 76px; }
  .top { flex-wrap: wrap; height: var(--toph); padding: 0 var(--s2); gap: 0 var(--s2); align-content: flex-start; }
  .top::after { content: ""; order: 3; flex: 0 0 100%; height: 0; }
  .brand { width: auto; order: 1; height: 36px; }
  .prefs { order: 2; }
  .nav { width: auto; order: 4; }
  .search { order: 5; }
  .nav a { padding: 0 var(--s2); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line2); padding: var(--s2) var(--s2) var(--s1); }
  .opts.cats { display: flex; flex-wrap: wrap; gap: 0 var(--s2); }
  .page-gen #theme-desc { min-height: 54px; }  /* three lines reserved: the theme line arrives with the catalogue */
  .opts.cats li { flex: 0 0 auto; }
  .opts.cats label { overflow: visible; }
  .opts.cats .n { min-width: 22px; text-align: left; }  /* room for the count before it arrives: no re-wrap */
  main { padding: var(--s2) var(--s2) var(--s4); }
  /* generator: one column in task order: title, theme line, the theme box, the optional controls, then the category filter right above the table it filters. CSS order only (the
     facet column and main are display: contents), so nothing moves after load. */
  .page-gen .layout { display: flex; flex-direction: column; align-items: stretch; padding: var(--s2) var(--s2) var(--s4); }
  .page-gen .side, .page-gen #controls, .page-gen main, .page-gen .gout { display: contents; }
  .page-gen .layout > * , .page-gen #controls > *, .page-gen main > *, .page-gen .gout > * { min-width: 0; }
  .page-gen .crumbs { order: 1; } .page-gen main > h1 { order: 2; } .page-gen #theme-desc { order: 3; } .page-gen #notice { order: 4; }
  .page-gen #controls > #f-theme { order: 6; } .page-gen #controls > #f-style { order: 7; }
  .page-gen #controls > #f-pack, .page-gen #controls > #advanced { order: 9; }
  /* the pack table and Install above the sound table, so Download is within two screens of the top; the sound table
     folds into one disclosure row ("All sounds · 116 files"), closed unless html[data-sounds=open] (js/theme-init.js
     sets it before paint from localStorage "ddsound.sounds"; js/app.js when it is opened) */
  .page-gen .gout > #pack { order: 10; margin: 8px 0 0; } .page-gen .gout > #pack-more { order: 10; margin: 0 0 8px; }
  .page-gen #events { order: 11; margin-top: 0; }
  /* the theme table opens right under the theme box (UX audit U4: it was under the pack table, ~1100 px down) */
  .page-gen #tpick { order: 6; margin: 0 0 var(--s2); }
  .page-gen #snd-disc { display: block; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); margin: 0 0 var(--s2); }
  .page-gen #snd-disc > summary { padding: 0; border-bottom: 0; }
  :root[data-sounds="open"] .page-gen #snd-disc > summary { list-style-type: disclosure-open; }
  :root:not([data-sounds="open"]) .page-gen #events > :not(#snd-disc) { display: none; }
  :root[data-first] .page-gen #f-theme { margin-bottom: 100vh; }   /* a first visit: the theme table's room under the box, until it opens */
  .page-gen #events-title { display: none; }   /* the row above says it: the heading keeps the counts and the status */
  .page-gen .sidenote { order: 14; } .page-gen .foot { order: 15; }
  /* HTML arriving in pieces (a slow network): the sidebar is parsed and painted before main's title block, which is
     laid out above it, so until the title is in the controls stay unpainted (else they jump 114 px down on first paint) */
  .page-gen .layout:not(:has(main > h1)) #controls > *, .page-gen .layout:not(:has(main > h1)) .side > .sidenote { visibility: hidden; }
  .page-gen .facet { padding-bottom: var(--s2); margin-bottom: 6px; }
  /* converter: the strip, the drop zone and the files table first, the conversion settings after them */
  .page-conv .layout main { order: -1; }
  .page-conv .side { border-bottom: 0; border-top: 1px solid var(--line2); }
  .page-conv.conv-empty #outcomes { display: none; }
  .sr { flex-wrap: wrap; gap: var(--s2) var(--s2); }
  .r1 .files { width: auto; flex: 1 1 100%; order: 2; overflow: hidden; text-overflow: ellipsis; }   /* own line: no reflow when the count text grows */
  .r1 .stat { flex: 1 1 100%; order: 3; }
  .r1 .prog { width: 100%; order: 4; min-height: 16px; }   /* the count text appears later: reserve its line */
  .r1 .prog progress { flex: 1; }
  .r2 #share-url { flex: 1 1 100%; order: 4; }
  /* its own line, always (the sound ▸ Preview plays shows up in it): nothing moves when it appears */
  .r2 label { flex: 1 1 100%; order: 3; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .r2:has(#share-play:not([hidden])) { row-gap: var(--s2); }   /* the phone row gap: the Preview button moves nothing */
  .sr.r3 { min-height: 40px; }   /* a two-line publish note (another browser's pack) arrives late: its height reserved */
}
/* phones: Generate within reach after choosing (F6): a bottom bar while the pack strip is off screen (js/app.js) */
.genbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: var(--s2);
  padding: var(--s2); background: var(--bg); border-top: 1px solid var(--line); }
.genbar[hidden] { display: none; }
.genbar .btn { height: 40px; width: auto; flex: none; padding: 0 var(--s4); }
.genbar .stat { flex: 1 1 auto; min-width: 0; color: var(--fg2); font-size: 12px; }
body.has-genbar { padding-bottom: 57px; }
/* small phones (the Russian and French nav is longer): narrower tabs, so "Générer Convertir Tester Packs" leaves the
   search box room at 360 px */
@media (max-width: 420px) {
  .nav a { padding: 0 var(--s1); }
}

/* ================================================================ landing menu (/): left-anchored like every page, the
   tool name is the row's one link */
.menu-main { max-width: 1040px; margin: 0; padding: var(--s2) var(--s4) var(--s5) var(--s3); }
.menu-main .desc { margin-bottom: 12px; }
.grid.menu { border: 0; }
/* /contact: a two-column facts table (label | value), McMaster's spec table; values wrap, nothing is cut */
.grid.facts { border: 0; max-width: 760px; table-layout: fixed; }
.facts .c-k { width: 132px; } .facts .c-v { width: auto; }
.grid.facts th { color: var(--fg2); font-weight: normal; text-align: left; vertical-align: top; white-space: normal; }
.facts th, .facts td { height: auto; padding: var(--s1) var(--s4) var(--s1) var(--s1); line-height: 18px; vertical-align: top; }
.facts td { white-space: normal; overflow-wrap: anywhere; }
.facts p { margin: 0; }
.facts #c-mail { display: inline-block; min-height: 18px; }
.facts .none { color: var(--fg2); }
.facts td a { text-decoration: underline; }   /* links in prose: a non-colour cue (DESIGN-REFERENCE §4 rule 10) */
.facts .status { color: var(--fg2); margin-left: var(--s1); }
.facts .lnk::before { content: "·"; content: "·" / ""; display: inline-block; margin: 0 6px; color: var(--fg2); }
@media (max-width: 700px) { .facts .c-k { width: 96px; } }
@media (max-width: 700px), (pointer: coarse) { .facts #c-mail, .facts #c-mail a, .facts .lnk { display: inline-block; min-height: 32px; line-height: 32px; } .facts p a { display: inline-block; min-height: 24px; line-height: 24px; } }
.menu .c-tool { width: 290px; } .menu .c-what { width: auto; } .menu .c-spec { width: 240px; }
.menu tr.tool th, .menu tr.tool td { height: auto; padding-top: var(--s2); padding-bottom: var(--s2); vertical-align: top; }
.menu tr.tool th { font-size: 14px; line-height: 16px; }
.menu tr.tool td.small { padding-top: var(--s2); }
.menu tr.tool th a { display: inline-flex; align-items: center; gap: var(--s2); color: var(--link); text-decoration: none; }
.menu tr.tool th a:hover { color: var(--link-hover); text-decoration: underline; }
.menu tr.tool th a svg { width: 14px; height: 14px; color: var(--fg2); }
.menu tr.tool:not(.minor) th a svg { display: none; }   /* the tool names need no icons (AI-tells P3); the download keeps its arrow */
.menu tr.tool.minor th { font-size: 12px; }
.menu tr.tool.minor th a svg { width: 12px; height: 12px; margin: 0 1px; }

/* ================================================================ converter (/converter) */
.fixed { font-size: 12px; }
.kn.ku { grid-template-columns: 64px minmax(0, 1fr) 48px; }
.kn.ku .unit { font-size: 11px; color: var(--fg2); text-align: right; white-space: nowrap; }
.chk { display: inline-flex; align-items: center; gap: var(--s1); font-size: 12px; cursor: pointer; }
.chk input { margin: 0; accent-color: var(--acc); }
.keys { margin: 0 4px 4px; font-size: 11px; color: var(--fg2); line-height: 18px; }
kbd { display: inline-block; min-width: 16px; padding: 0 var(--s1); border: 1px solid var(--line); background: var(--bg); font: 11px/14px Consolas, "Liberation Mono", monospace; text-align: center; color: var(--fg); }
.page-conv #download { width: auto; min-width: 176px; }
.stat.done { color: var(--acc); }
details#warnings.has > summary { color: var(--err); }
.warn .c-wf { width: 260px; }
.warn td { height: auto; line-height: 1.4; font-size: 12px; }
.warn td.warn { color: var(--fg); }
.conv { font-variant-numeric: tabular-nums; }
/* the files table (owner sketch 2026-11-14): one 26 px line per file, File · In · DDNet sound · Length · Peak in · Out ·
   Status · Play (A, B) · ×; Details opens as a strip under the row */
.conv { table-layout: fixed; width: 100%; }
.conv .c-file { width: auto; } .conv .c-fmt { width: 106px; } .conv .c-snd { width: 180px; } .conv .c-len { width: 56px; }
.conv .c-tp { width: 56px; } .conv .c-out { width: 42px; } .conv .c-st { width: 74px; } .conv .c-ab { width: 72px; } .conv .c-rm { width: 26px; }
.conv.grid thead th, .conv.grid tbody tr[data-id] td { padding-left: var(--s1); padding-right: var(--s1); }
.conv thead th { font-size: 11px; }
.conv thead th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.conv tbody tr[data-id] td { height: 26px; padding-top: 0; padding-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv tbody tr[data-id] td.c-ab, .conv tbody tr[data-id] td.c-rm { padding-left: var(--s1); padding-right: 0; }
.conv td.c-file .fl { display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.conv td.c-file .lbl { flex: 1 1 auto; min-width: 0; line-height: 16px; }
.conv td.c-file .dt { width: 14px; height: 22px; justify-content: center; }
.conv td.c-snd .sndw { display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.conv td.c-snd select.snd { flex: 1 1 auto; min-width: 0; }
.conv .gtag { flex: none; color: var(--warn); font-size: 11px; }
.conv td.c-snd .gok { flex: none; height: var(--h-sm); padding: 0 6px; font-size: 11px; }
.conv td.c-fmt { font-size: 11px; color: var(--fg2); }
.conv td.mono { font-family: inherit; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv td.hot { color: var(--err); }
.conv select.snd { width: 100%; height: var(--h-sm); border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 12px; padding: 0 var(--s1); }
.conv tr.out td.c-file .lbl { color: var(--fg2); }
.st { display: block; font-size: 12px; }
.st.ok { color: var(--acc); }
.st.warn { color: var(--warn); }
.st.err { color: var(--err); }
.conv .plays { flex-wrap: nowrap; align-items: center; }
.pb.ab { width: 32px; gap: 2px; padding: 0; justify-content: center; }
/* quiet: the remove icon of a file row */
.rm { display: inline-flex; align-items: center; justify-content: center; width: var(--h-sm); height: var(--h-sm); margin-left: 0; padding: 0; border: 0; background: transparent; color: var(--fg2); cursor: pointer; }
.rm:hover { background: var(--hl); color: var(--err); }
.conv tfoot td { border-bottom: 0; }
.dropzone td { height: 64px; background: var(--bg); }
.dz { display: flex; align-items: center; gap: var(--s2); height: 48px; padding: 0 var(--s2); border: 1px dashed var(--line); background: var(--bg); }
.dz > svg { width: 12px; height: 12px; color: var(--fg2); }
.dz-text { flex: 1; min-width: 0; color: var(--fg2); line-height: 15px; }
.dragging .dz { border: 2px dashed var(--acc); background: var(--acc-bg); }
.dragging { outline: 2px solid var(--acc); outline-offset: -1px; }
.names { margin: 6px 0 0; line-height: 1.5; }

@media (max-width: 1180px) {
  .page-conv #download { min-width: 160px; }
}
@media (max-width: 960px) {
  .menu .c-spec, .menu td:nth-child(3) { display: none; }
}
@media (max-width: 700px) {
  .menu-main { padding: var(--s2) var(--s2) var(--s4); }
  .menu, .menu tbody, .menu tr.tool { display: block; }
  .menu thead { display: none; }
  /* one block per tool: the name, what it does, the notes (11 px, --fg2), each on its own line */
  .menu tr.tool { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 0; padding: var(--s2); border-bottom: 1px solid var(--line2); }
  .menu tr.tool th, .menu tr.tool td, .menu td:nth-child(3) { display: block; height: auto; border: 0; padding: 0; }
  .menu tr.tool.minor th, .menu tr.tool.minor td { height: auto; }
  .menu tr.tool td:nth-child(2) { color: var(--fg); }
  .menu tr.tool td.small { padding-top: 0; font-size: 11px; line-height: 14px; }
  .page-conv #download { min-width: 0; }
  .dz { flex-wrap: wrap; height: auto; padding: var(--s2) var(--s2); gap: var(--s2); }
  .dropzone td { height: auto; }
  .dz-text { flex: 1 1 100%; order: -1; white-space: normal; }
}
/* narrow (a table under 600 px): the row keeps File, DDNet sound and Status; In, the numbers, Play and × move into the
   strip's first line (.dnum), which shows without the graphs when Details is closed only on wide tables */
.conv tr.det .dnum { display: none; }
@container cv (max-width: 600px) {
  .conv th:is(.c-fmt, .c-len, .c-tp, .c-out, .c-ab, .c-rm), .conv td:is(.c-fmt, .c-len, .c-tp, .c-out, .c-ab, .c-rm) { width: 0; padding: 0 !important; border-left: 0; border-right: 0; visibility: hidden; overflow: hidden; }
  .conv :is(th, td).c-snd { width: 42%; } .conv .c-st { width: 76px; }   /* over the 160 px of the 760 px rule below: File keeps >= 120 px at 360 */
  .conv tr.det .dnum { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); padding: var(--s1) 0; }
  .conv tr.det .dnum .nums { flex: 1 1 100%; font-size: 11px; white-space: normal; }
  .conv .gtag { display: none; }
  .dz { flex-wrap: wrap; height: auto; padding: var(--s2) var(--s2); gap: var(--s2); }
  .dropzone td { height: auto; }
  .dz-text { flex: 1 1 100%; order: -1; white-space: normal; }
}
@media (max-width: 1200px) {
  .page-conv .r1 { flex-wrap: wrap; gap: var(--s2) var(--s2); }
  .page-conv .r1 .stat { flex: 1 1 100%; order: 3; }
  .page-conv .r1 .prog { order: 4; }
}
@media (pointer: coarse) {
  .pb.ab { width: 40px; }
  .conv .c-ab { width: 90px; } .conv .c-rm { width: 36px; }
}

/* ru / fr: hidden until js/i18n.js has translated the page (no English flash, nothing moves); shown after 1.5 s anyway */
html[data-i18n="wait"] body { visibility: hidden; animation: i18n-show 0s linear 1.5s forwards; }
@keyframes i18n-show { to { visibility: visible; } }

/* ---------------------------------------------------------------- converter: settings rows, details */
.offline-tag { align-items: center; font-size: 12px; color: var(--fg2); white-space: nowrap; }
.msg.wide { margin-left: 4px; }
.kp { display: grid; grid-template-columns: 64px auto minmax(0, 48px) auto minmax(0, 48px); align-items: center; gap: 0 var(--s2); padding: 0 0 0 var(--s1); min-height: 26px; }
.kp label { font-size: 12px; color: var(--fg2); text-align: right; }
.rs label { white-space: nowrap; }
.drop-note { color: var(--fg); }
/* the naming hint: one highlighted full-width row under the first file without a sound */
.conv tr.namehint td { height: 26px; padding: 0 var(--s2); border-left: 3px solid var(--acc); background: var(--bg2); color: var(--fg); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line2); }
@container cv (max-width: 600px) { .conv tr.namehint td { white-space: normal; height: auto; padding: var(--s1) var(--s2); line-height: 16px; } }   /* a narrow table: the hint wraps (RU / FR are longer than one line) */
/* quiet: the Details toggle of a file row (text action, its height is the line's) */
.dt { display: inline-flex; align-items: center; gap: var(--s1); flex: none; height: 16px; padding: 0; border: 0; background: transparent;
  color: var(--link); font: inherit; font-size: 11px; line-height: 14px; cursor: pointer; }
.dt:disabled { color: var(--fg2); cursor: default; }
.dt svg { flex: none; width: 8px; height: 8px; color: var(--fg2); }
.dt[aria-expanded="true"] svg { transform: rotate(90deg); color: var(--acc); }
.dt:not(:disabled):hover { color: var(--link-hover); text-decoration: underline; }
.conv tr.open td { border-bottom-color: transparent; }
.conv tr.det:hover > * { background: transparent; }
.conv tr.det > td { padding: 0 var(--s2) var(--s2); height: auto; border-bottom: 1px solid var(--line2); }
.conv tr.det.filtered { display: none; }
.dpanel { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); padding: var(--s2); border: 1px solid var(--line2); background: var(--bg2); }
.dviz { flex: 0 0 auto; width: 652px; max-width: 100%; }
.dviews { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.dview { margin: 0; width: 320px; flex: none; }
.dview figcaption { min-height: 18px; line-height: 16px; font-size: 12px; padding: 0 0; }
.vbox { position: relative; width: 320px; height: 198px; background: var(--bg); border: 1px solid var(--line2); }
.vbox canvas { position: absolute; display: block; }
.vbox .wave { left: 40px; top: 2px; width: 274px; height: 44px; }
.vbox .spec { left: 0; top: 47px; width: 318px; height: 150px; }
.vplot { position: absolute; left: 40px; top: 0; width: 274px; height: 181px; pointer-events: none; overflow: visible; }
.ph { stroke: var(--focus); stroke-width: 2px; display: none; }
.ph.on { display: inline; }
.dlegend { display: flex; align-items: center; gap: var(--s2); height: 18px; margin-top: 6px; font-size: 11px; white-space: nowrap; }
.lg-bar { flex: 0 0 180px; width: 180px; height: 10px; border: 1px solid var(--line); }
.dn { margin: 4px 0 0; font-size: 11px; line-height: 15px; max-width: 652px; }
.dspec { flex: 1 1 300px; min-width: 0; max-width: 560px; }
.dtab { width: 100%; background: var(--bg); border: 1px solid var(--line2); }
.dtab th { width: 136px; background: var(--bg2); font-size: 12px; line-height: 15px; }
.conv .dtab td, .conv .dtab th { height: 22px; padding: var(--s1) var(--s2) 0; vertical-align: top; }
.dtab td .v { font-size: 12px; font-family: inherit; font-variant-numeric: tabular-nums; }
.dtab td .x { font-size: 11px; }
.grid.dtab tbody tr:hover > * { background: transparent; }
.dnh { margin: 8px 0 2px; font-size: 12px; }
.dnotes { margin: 0; padding: 0 0 0 var(--s4); font-size: 12px; }
.dnotes li { margin: 2px 0; }
.dnotes li.warn b, .dnotes li.err b { color: var(--err); }
.dnotes li.small { color: var(--fg2); font-size: 11px; }
.dnotes .btn.xs { margin-left: 8px; vertical-align: middle; }
.covnote { margin: 4px 8px; }
.covwrap { max-height: 360px; overflow-y: auto; border-top: 1px solid var(--line2); }
.cov .c-cs { width: 200px; } .cov .c-cst { width: 45%; }
.cov td.ok { color: var(--acc); }
.lic { margin-top: 6px; }
.lic summary { cursor: pointer; width: max-content; }
.lic pre { max-height: 240px; overflow: auto; padding: var(--s2); border: 1px solid var(--line2); background: var(--bg2); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
/* the File column (name + Details toggle) keeps at least ~150 px: columns drop out first, then the table scrolls
   inside its frame instead of squeezing the name to nothing.
   Columns are collapsed to zero width (not display: none) so the colspan="9" rows don't add phantom columns. */
.conv { min-width: 0; }
@container cv (max-width: 760px) {
  .conv th.c-fmt, .conv td.c-fmt { width: 0; padding: 0 !important; visibility: hidden; overflow: hidden; }
  .conv .c-snd { width: 160px; } .conv .c-len, .conv .c-tp { width: 50px; } .conv .c-st { width: 70px; }
}
@container cv (max-width: 898px) {
  .dviz { width: 320px; }
  .lg-bar { flex-basis: 110px; width: 110px; }
}

@media (max-width: 700px) {
  .dpanel { padding: var(--s2); }
  .dviz, .dspec { width: 100%; max-width: 100%; flex: 1 1 100%; }
  .dtab th { width: 112px; white-space: normal; }
}
@media (max-width: 400px) {
  .offline-tag { display: none; }
}

/* "Install as" (generator + converter): the label above, one option per line, a two-line help */
.kr.stack { grid-template-columns: minmax(0, 1fr); }
.rs.col { flex-direction: column; gap: 0; }
.rs.col label { white-space: normal; line-height: 18px; align-items: flex-start; }
.rs.col label input { margin-top: 3px; }
.msg.help { margin-left: 4px; min-height: 30px; }

/* ================================================================ generator v2 (SPEC 7.3) */
/* Hook voice: one line per voicing (name + one-line description), fixed 6 rows; voicings the hook theme lacks are greyed */
.opts.voices .vn { flex: none; width: 64px; line-height: 14px; }   /* "Signature" fits */
.opts.voices li { padding: 0 0; align-items: flex-start; }
.opts.voices label { align-items: flex-start; }
.opts.voices label input { margin-top: 1px; }
.opts.voices .vd { min-width: 0; color: var(--fg2); font-size: 11px; line-height: 14px; }
.opts.voices label:has(input:checked) .vd { color: var(--fg); }
.opts.voices li.off label { color: var(--fg2); cursor: default; }
.msg.wide { margin-left: 4px; }
/* Mix / Balance: collapsed disclosures inside the facet */
details.disc > summary { min-height: 24px; line-height: 16px; padding: var(--s1) var(--s1); cursor: pointer; font-size: 12px; }
details.disc[open] > summary { border-bottom: 1px solid var(--line2); margin-bottom: 4px; }
.km { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 0 var(--s2); padding: 0 0 0 var(--s1); min-height: 26px; }
.km label { font-size: 12px; }
.sel { width: 100%; min-width: 0; height: var(--h-sm); border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 12px; padding: 0 var(--s1); }
.kb { display: grid; grid-template-columns: 64px 48px 16px 48px 16px; justify-content: start; align-items: center; gap: 0 var(--s2); padding: 0 0 0 var(--s1); min-height: 26px; }
.kb .kl { font-size: 12px; }
.kb .unit { font-size: 11px; color: var(--fg2); }
.kb.head { min-height: 16px; font-size: 11px; color: var(--fg2); }
.kb.head .r { text-align: right; }
/* pack strip: the customisation summary, one fixed line */
.sr.rc { min-height: 30px; height: 30px; gap: var(--s2); }
.sr.rc .kl { font-size: 12px; flex: none; }
#custom-sum { flex: 1; min-width: 0; color: var(--fg2); font-size: 12px; }
#custom-sum.on { color: var(--fg); }
@media (max-width: 700px) {
  .events tr[data-event] td:first-child .small { display: none; }
  .sr.rc { height: auto; min-height: 30px; flex-wrap: nowrap; }
  .sr.rc #custom-sum { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; min-height: 2.6em; line-height: 1.3; align-self: center; }   /* two lines reserved: no shift when it fills */
}

/* ================================================================ sound test (/test) */
/* Denser catalog type for the tables (McMaster-Carr: 12 px Arial, ~1.3 line height, rules only where they carry
   meaning; docs/DESIGN-REFERENCE.md "Sound test"). The canvas uses the same tokens: see js/test-draw.js. */
.page-test .note { margin: 4px 8px; font-size: 11px; line-height: 15px; color: var(--fg2); min-height: 30px; }
.page-test .note.err, .page-test #files-msg.err { color: var(--err); }
.page-test .val { font-size: 12px; line-height: 16px; padding: var(--s1) 0; }
.page-test .kt .sel { grid-column: 2 / 4; }
.page-test .chk { align-items: flex-start; gap: var(--s1); line-height: 16px; padding: var(--s1) 0; }
.page-test .chk input { margin-top: 2px; }
.page-test #f-pack.off .kt, .page-test #f-pack.off .kr { color: var(--fg2); }
.page-test .opts.srcs li { height: var(--h-sm); }
.small-dz { margin: 4px 8px; min-height: 34px; height: auto; padding: var(--s1) var(--s2); }
.small-dz .dz-text { white-space: normal; font-size: 12px; line-height: 15px; }
#f-files.dragging { outline: 2px solid var(--acc); outline-offset: -1px; }
#f-files.dragging .dz { border: 2px dashed var(--acc); background: var(--acc-bg); }
.kb2 { display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s2) 0; }
.page-test .r1 .stat { white-space: normal; line-height: 16px; overflow: visible; text-overflow: clip; flex: 1 1 220px; }
.page-test .desc { white-space: normal; height: auto; min-height: 20px; }
.stage { position: relative; width: 100%; box-sizing: border-box; margin-top: 8px; border: 1px solid var(--line2); background: var(--bg); aspect-ratio: 16 / 9; min-height: 260px;
  max-height: calc(100vh - 150px); contain: strict; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage canvas:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
.stage.live canvas { cursor: none; }
/* /test layout (owner sketch 2026-11-14): heading row (name, Back link) · subtitle · one toolbar ruled top and bottom ·
   the map (nothing on it but the map, the canvas HUD and a grey "click the map to play") · one status row */
.page-test .hrow { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; }
.page-test .hrow h1 { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-test .backlink { flex: none; font-size: 12px; line-height: 22px; }
.page-test .sub { margin: 0; min-height: 16px; height: auto; line-height: 16px; color: var(--fg2); white-space: normal; }
.page-test .sub.err { color: var(--err); }
.linkbtn { display: inline; height: auto; padding: 0; border: 0; background: transparent; color: var(--link); font: inherit; cursor: pointer; }
.linkbtn:hover { color: var(--link-hover); text-decoration: underline; }
.ttool { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin-top: var(--s2); padding: var(--s1) 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ttool .btn { height: var(--h-sm); font-size: 12px; }
@media (max-width: 700px) { .ttool .btn { height: var(--h); } }
@media (pointer: coarse) { .ttool .btn { height: 32px; } }
.ttool #start { width: 80px; justify-content: center; }
.ttool .btn[aria-pressed="true"] { background: var(--acc-bg); border-color: var(--acc); }
.ttool .btn[aria-pressed="true"] svg { color: var(--acc); }
.ttool .vr { flex: none; width: 1px; height: var(--h-sm); background: var(--line2); }
.ttool .tl { flex: none; color: var(--fg2); }
.ttool .tiles { display: flex; flex-wrap: wrap; gap: var(--s1); }
.ttool .tile { padding: 0 var(--s1); }
.ttool .esc { margin-left: auto; color: var(--fg2); font-size: 11px; white-space: nowrap; }
.ttool .kbar { position: absolute; left: 0; right: 0; bottom: -1px; }
.ttool.done .kbar { visibility: hidden; }
.stage .maphint { position: absolute; left: 0; right: 0; top: 30%; margin: -8px 0 0; line-height: 16px; text-align: center; color: var(--fg2); font-size: 12px; pointer-events: none; }
.playing { display: flex; align-items: center; gap: var(--s2); height: 26px; overflow: hidden; margin-top: 0; padding: 0 var(--s1);
  border-bottom: 1px solid var(--line2); background: var(--bg); font-size: 12px; line-height: 16px; white-space: nowrap; }
.playing .pl { flex: none; font-weight: bold; }
.playing .pn { flex: none; color: var(--acc); }
.playing .pm { flex: none; font-variant-numeric: tabular-nums; }
.playing .last { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; color: var(--fg2); }
/* the Keys table folds behind one line: "Keys: DDNet defaults · change" */
.page-test .keysum { margin: var(--s1) var(--s2); line-height: 16px; }
.page-test .keysum #keys-sum-l { font-weight: bold; }
/* the Sounds list: one 26 px line per sound (Name · Files · Played · ▸), when it plays in the row's title */
.page-test .grid.kit td { height: 26px; padding-top: 0; padding-bottom: 0; line-height: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-test .grid.kit .c-ev { width: auto; }
.touch { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s1); margin-top: 8px; }
.tb { height: 46px; padding: 0 var(--s1); border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 14px;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.tb.on { background: var(--acc-bg); border-color: var(--acc); }
.touch .tnote { grid-column: 1 / -1; min-height: 0; margin: 0; }
.page-test section h2 { font-size: 12px; margin: 0 0 4px; }
.page-test .grid td, .page-test .grid th { font-size: 12px; }
.page-test .grid td { height: auto; line-height: 16px; padding: var(--s1) var(--s2); }
.page-test .grid code { font-size: 11px; }
.page-test .grid thead th { white-space: normal; height: auto; min-height: 24px; text-overflow: clip; vertical-align: bottom;
  background: var(--bg); border-bottom-color: var(--line); }
.page-test .grid td, .page-test .grid tbody th { padding: var(--s1) var(--s4) var(--s1) var(--s1); }
.page-test .grid thead th { padding: var(--s1) var(--s4) var(--s1) var(--s1); }
.page-test .grid .r { padding-left: var(--s3); padding-right: var(--s1); }
.page-test .grid .try, .page-test .grid .c-try { padding: 0 var(--s1); }
.page-test .r1 { flex-wrap: wrap; row-gap: var(--s1); }
.page-test .r1 .files { width: auto; min-width: 60px; }
.page-test .r1 .prog { width: 180px; }
.kit .c-ev { width: 170px; } .kit .c-when { width: auto; } .kit .c-from { width: 150px; } .kit .c-n { width: 56px; } .kit .c-pl { width: 58px; } .kit .c-try { width: 56px; }
.kit td { font-variant-numeric: tabular-nums; }
.kit tr.never td { color: var(--fg2); }
.kit tr.yours td.from { color: var(--fg); }
.kit td.try .pb { width: 28px; }
.kit .wh { display: none; }
/* touch only (no keyboard to rebind): the Keys table goes (usability F15) */
@media (pointer: coarse) and (hover: none) { .page-test #f-keys { display: none; } #keys-hint { display: none; } }   /* no key caps on touch (I20) */
/* a row scrolled to sits below the sticky events heading (F27) */
.events tr[data-event] { scroll-margin-top: calc(var(--toph) + 36px); }   /* the header + the heading (up to 32 px) + air */
.kit td.ev code { font-size: 11px; color: var(--fg2); }
@media (max-width: 960px) {
  .kit .c-when, .kit td.when { display: none; }
  .kit .c-ev { width: auto; } .kit .c-from { width: 110px; }
}
@media (max-width: 700px) {
  .test-layout main { order: -1; }
  .test-layout .side { border-bottom: 0; border-top: 1px solid var(--line); }
  .stage { min-height: 0; max-height: none; aspect-ratio: 16 / 9; }
  /* phones: two toolbar lines, Start first (the rule breaks the line); no Esc note */
  .ttool .vr { flex-basis: 100%; width: auto; height: 0; background: none; }
  .ttool .esc { display: none; }
  .page-test .hrow h1 { white-space: normal; }
  .page-test .r1 .stat { min-height: 16px; order: 3; flex: 1 1 100%; }
  .page-test .r1 .prog { order: 2; flex: 1 1 0; width: auto; min-width: 0; }
  .page-test .r1 .prog progress { flex: 1 1 auto; min-width: 40px; width: auto; }
  .kit .c-from { width: 96px; } .kit .c-ev { width: auto; }
  .page-test .desc:not(.sub) { min-height: 40px; }
}
@media (max-width: 480px) {
  .kit .c-n, .kit td.n { display: none; }
  .tb { font-size: 12px; }
  .page-test .r1 .files { display: none; }   /* "68/68" next to the bar says it */
}
/* the generator: "Test in a map" next to Generate; the first strip row wraps instead of pushing the progress out */
#test-link { flex: none; }
@media (max-width: 1180px) { .r1:has(#test-link) { flex-wrap: wrap; row-gap: var(--s1); } }
.notice.resume:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s2); }

/* sound test: key bindings table (sidebar) and the paused overlay */
.page-test .grid.keys { width: 100%; table-layout: fixed; margin: 4px 0; }
.page-test .grid.keys thead th { background: transparent; }
.page-test .grid.keys .c-act { width: 48%; }   /* "Weapon 1: hammer" on one line; "Mouse 2", "Wheel ↓" fit the key cells */
.page-test .grid.keys td, .page-test .grid.keys tbody th { height: 24px; padding: 0 var(--s1) 0 var(--s1); }
/* the 250 px sidebar: action names and keys wrap instead of being cut ("Previous weapon", "Right mouse") */
.page-test .grid.keys tbody th { font-weight: normal; white-space: normal; overflow-wrap: anywhere; line-height: 14px; }
.page-test button.bind { display: block; width: 100%; min-height: var(--h-sm); padding: 0 var(--s1); border: 1px solid var(--line); background: var(--bg);
  color: var(--fg); font: inherit; font-size: 11px; line-height: 14px; text-align: left; cursor: pointer; white-space: nowrap; }
.page-test button.bind:hover { background: var(--hl); }
.page-test button.bind:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.page-test button.bind.on { border-color: var(--acc); color: var(--acc); }
.page-test .stage.locked canvas { cursor: none; }
/* converter: hidden for the few ms the saved session takes to come back (js: offerResume), never longer than 1 s */
html.restoring #main { visibility: hidden; animation: ddsound-reveal 0s 1s forwards; }
@keyframes ddsound-reveal { to { visibility: visible; } }

/* ================================================================ the Source column and its catalogue strip (SPEC 12.4)
   Source: a select-like box with the row's source by name ("seed's water plink · bottle"); a chosen row's box has the
   accent border. It opens the catalogue strip under the row: a head line, a filter, then two tables side by side
   (the effective theme's 9 lines and the hook voices | other themes, Original, Off), each line ▸ · words · Use.
   Every line, box and button has a fixed height, so words arriving later move nothing. */
.events td.c-src { padding-left: var(--s1); padding-right: var(--s1); }
.srcb { display: flex; align-items: center; gap: var(--s1); width: 100%; min-width: 0; height: var(--h-sm); margin: 0; padding: 0 var(--s1); border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.srcb:hover { background: var(--hl); }
.srcb .sw { flex: none; color: var(--fg2); }
.srcb .sw:empty { display: none; }
.srcb .sn { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.srcb .sc { flex: none; color: var(--fg2); font-size: 11px; }
.srcb.ch { border-color: var(--acc); box-shadow: inset 2px 0 0 var(--acc); }
.srcb[aria-expanded="true"] { border-color: var(--acc); background: var(--acc-bg); }
.srcb:disabled .sc { visibility: hidden; }
.events tr.open > td { background: var(--bg2); }
.events tr.muted .lbl { text-decoration: line-through; text-decoration-color: var(--fg2); }
/* Level and Files */
.events td.c-gain, .events td.c-var { padding-left: var(--s1); padding-right: var(--s1); }
span.gain { display: inline-flex; align-items: center; gap: var(--s1); flex: none; }
.events input.gain { width: 40px; height: var(--h-sm); padding: 0 var(--s1); text-align: right; }
.gain .unit, .gbox .unit { font-size: 11px; line-height: var(--h-sm); color: var(--fg2); }
.events.nogain .c-gain span.gain { visibility: hidden; }
.fb { width: 76px; height: var(--h-sm); padding: 0 var(--s1); border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 11px; cursor: pointer; white-space: nowrap; }
.fb:hover { background: var(--hl); }
.fb[aria-pressed="true"] { background: var(--acc-bg); border-color: var(--acc); }
.events.nosingle .fb { pointer-events: none; }
.f1 { display: inline-block; width: 76px; font-size: 11px; color: var(--fg2); text-align: center; }
.events th.c-var .th-l { display: block; }
.events th.c-var .thx { display: block; font-weight: normal; font-size: 11px; white-space: nowrap; }
.events th.c-var .thx .lnk { font-size: 11px; }
.events.nosingle th.c-var .thx { display: none; }
/* one file for all: one play button (the files are one sound) */
.events tr.single .plays > :not(:first-child) { display: none; }
/* the category rows: material (mix), level dB and pitch st */
.events tr.group > td { height: 26px; background: var(--bg2); padding: 0 var(--s1); border-bottom: 1px solid var(--line2); }
.grid tr.group:hover > td { background: var(--bg2); }
.grid tr.group th .gl { display: inline-block; line-height: 18px; }
.sel.gmix { width: 100%; font-weight: normal; }
.sel.gmix.ch { border-color: var(--acc); box-shadow: inset 2px 0 0 var(--acc); }
.gbox { display: inline-flex; align-items: center; gap: var(--s1); white-space: nowrap; font-weight: normal; }
.gbox .num { width: 44px; }
.events.nomix .sel.gmix { visibility: hidden; }
/* Shuffle over the table */
.shuf { display: flex; align-items: center; gap: var(--s2); min-width: 0; height: var(--h); margin: 0 0 var(--s1); font-size: 12px; color: var(--fg2); white-space: nowrap; }
.shuf .btn { flex: none; }
#shuf-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* the strip */
.events tr.catrow > td { height: auto; padding: var(--s2) var(--s2) var(--s2) var(--s3); background: var(--bg2); border-bottom: 1px solid var(--line); box-shadow: inset 2px 0 0 var(--acc); }
.grid tbody tr.catrow:hover > * { background: var(--bg2); }
.cat-h { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; height: 18px; margin: 0 0 var(--s1); font-size: 12px; white-space: nowrap; }
.cat-h b { flex: none; font-weight: bold; }
.cat-use { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg2); }
@container ev (max-width: 1100px) { .cat-k { display: none; } }   /* a narrow table: the key hints go (the keys still work) */
.cat-h .lnk { flex: none; }
.cat-k { flex: none; margin-left: auto; color: var(--fg2); font-size: 11px; }
.cat-f { display: flex; align-items: center; gap: var(--s2); min-width: 0; margin: 0 0 var(--s2); }
.cat-f .cat-q { width: 220px; flex: none; }
.cat-f .msg { margin: 0; }
.cat-l { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s2) var(--s3); }
table.cl { flex: 1 1 300px; min-width: 0; width: auto; border-collapse: collapse; background: var(--bg); border: 1px solid var(--line2); }
table.cl th { height: 22px; padding: 2px var(--s1); text-align: left; font-size: 12px; line-height: 16px; font-weight: bold; background: var(--bg); border-bottom: 1px solid var(--line); }   /* a heading wraps on a phone rather than widen its table */
table.cl th .n { font-weight: normal; color: var(--fg2); }
table.cl tr.cg th { background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line2); }
table.cl td { height: 24px; padding: 0 var(--s1); border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.cl td.c-h { width: 30px; }
table.cl td.c-n { position: relative; width: 100%; max-width: 0; }
table.cl td.c-u { width: 56px; text-align: right; }
.ln-w { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 16px; }
tr.fam .ln-w { margin-right: 48px; }   /* More / Less sits in this margin: the words' box (and its clip) ends before it */
tr.fam .ln-t { font-weight: bold; }
.ln-m { color: var(--fg2); }
tr.ln.opt .ln-w { padding-left: var(--s4); }
tr.ln.na .ln-w { color: var(--fg2); }
tr.ln { cursor: default; }
tr.ln:hover > td { background: var(--hl); }
tr.ln.cur > td { background: var(--sel); }
tr.ln:focus { outline: none; }
tr.ln:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
table.cl .more { position: absolute; right: var(--s1); top: 0; bottom: 0; width: 44px; text-align: right; font-size: 11px; }
.chip { display: inline-block; margin-left: 6px; padding: 0 var(--s1); border: 1px solid var(--line2); font-size: 11px; line-height: 14px; color: var(--fg2); vertical-align: 1px; }
.chip.fav { border-color: var(--acc); color: var(--acc); }
.pb.ap { width: 22px; }
.au { width: 48px; height: var(--h-sm); padding: 0; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 11px; cursor: pointer; }
.au:hover { background: var(--hl); }
span.au.on { display: inline-flex; align-items: center; justify-content: center; border-color: transparent; background: transparent; color: var(--fg2); cursor: default; }
.cat-ft { display: flex; align-items: center; gap: var(--s3); min-height: var(--h-sm); margin: var(--s2) 0 0; font-size: 12px; }
.cat-ft .cat-one { display: inline-flex; align-items: center; gap: var(--s1); cursor: pointer; }
.cat-ft .cat-one input { margin: 0; accent-color: var(--acc); }
.cat-ft #cat-close { margin-left: auto; }
/* the Sound group: presets over the Fine sliders */
.kpre { grid-template-columns: minmax(0, 1fr); }
.pre { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); }
.pt { height: var(--h-sm); padding: 0 var(--s2); border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.pt:hover { background: var(--hl); }
.pt[aria-pressed="true"] { background: var(--acc-bg); border-color: var(--acc); }
.pre .custom { visibility: hidden; margin-left: var(--s1); font-size: 12px; font-weight: bold; }
.pre .custom.on { visibility: visible; }
details.fine > summary { list-style: none; cursor: pointer; padding: var(--s1) 0 var(--s1) var(--s1); font-size: 12px; color: var(--link); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.fine > summary::-webkit-details-marker { display: none; }
details.fine > summary::before { content: "\25B8"; display: inline-block; width: 12px; color: var(--fg2); }
details.fine[open] > summary::before { content: "\25BE"; }
details.fine > summary:hover { text-decoration: underline; }
details.fine > summary .count { color: var(--fg2); }
/* the right panel's Recipe */
.kv pre.recipe { margin: 0 0 var(--s2); max-height: 220px; overflow: auto; padding: var(--s1) var(--s2); border: 1px solid var(--line2); background: var(--bg2);
  font: 11px/15px Consolas, "Liberation Mono", Menlo, monospace; white-space: pre; }
/* phones and touch: 32 px targets; the strip's tables stack, its key hints go */
@media (max-width: 700px), (pointer: coarse) {
  .srcb, .fb, .pt, .au { height: 32px; }
  .events input.gain, .gbox .num { width: 56px; height: 32px; }
  .sel.gmix { height: 32px; }
  .f1 { line-height: 32px; }
  .pb.ap { width: 32px; height: 32px; }
  table.cl td { height: 34px; }
  table.cl td.c-h { width: 40px; } table.cl td.c-u { width: 60px; }
  .au { width: 56px; }
  .cat-k { display: none; }
  .cat-h { height: auto; min-height: 18px; flex-wrap: wrap; white-space: normal; }
  .cat-f .cat-q { flex: 1 1 auto; width: auto; min-width: 0; height: 32px; }
  .cat-ft { min-height: 32px; }
  .cat-ft .cat-one { min-height: 32px; }
  .cat-ft .lnk, .cat-h .lnk { display: inline-flex; align-items: center; min-height: 32px; }
  table.cl .more { display: flex; align-items: center; justify-content: flex-end; width: 56px; }
  tr.fam .ln-w { margin-right: 60px; }
  .shuf { height: 36px; }
  .shuf .btn { height: 32px; }
  details.fine > summary { min-height: 40px; line-height: 32px; }
}
@container ev (max-width: 640px) {
  .cat-l > table.cl { flex-basis: 100%; }
  .srcb { width: 100%; }
}


/* ================================================================ phones and touch (DESIGN-REFERENCE 4: 9, 13, 28, 29) */
@media (max-width: 700px) {
  body { font-size: 13px; line-height: 1.35; }
}
/* 16 px fields: iOS Safari zooms the page on focus below that (and never zooms back) */
@media (max-width: 700px), (pointer: coarse) {
  input, select, textarea, .search input, .sel, .conv select.snd, .r2 input { font-size: 16px; }
  .num { width: 56px; }
  .kn, .kn.ku { grid-template-columns: 64px minmax(0, 1fr) 56px; }
  .kb { grid-template-columns: 64px 56px 16px 56px 16px; }
  .kp { grid-template-columns: 64px auto 56px auto 56px; }
}

/* ================================================================ touch: tap targets >= 32 px (UX-AUDIT D8, DESIGN-REFERENCE 4.28) */
@media (pointer: coarse) {
  .brand { min-height: 32px; min-width: 32px; }
  .search { height: 32px; } .search input { height: 30px; }
  /* the header's language and light/dark buttons: 32 px as on the other ipi.hu sites' touch screens, taking taps
     over the header's full height (40 px) */
  .prefs button { position: relative; height: 32px; }
  .prefs button::after { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
  .opts li { min-height: 32px; }
  .opts li.sk { height: 32px; }
  .hear { width: 32px; height: 32px; }
  .pb { width: 40px; height: 32px; }
  .pb.ab { width: 52px; }
  .rs { gap: 0 var(--s3); }
  .rs label { min-height: 32px; line-height: 16px; }
  .chk { min-height: 32px; }
  .btn, .btn.sm, .btn.xs { height: 32px; }
  .num, .text, .seed, .sel, .conv select.snd, .r2 input, .page-test .kt .sel, .thbox { height: 32px; }
  .tline { min-height: 32px; } .tline #theme-change { min-height: 32px; }
  #desc-change { display: inline-block; padding: 10px 0; margin: -10px 0; }   /* a 32 px target in a 17 px line */
  details.more > summary, details.disc > summary, .lic summary { min-height: 40px; line-height: 40px; padding-top: 0; padding-bottom: 0; }
  .dt { height: 32px; padding: 0 var(--s2); }
  .conv td.c-snd .gok { height: 32px; padding: 0 var(--s2); font-size: 12px; }
  .rm { width: 32px; height: 32px; }
  .menu tr.tool th a { min-height: 32px; }
  .crumbs { height: 32px; line-height: 31px; }
  .kn, .kr, .kt, .km, .kb, .kp { min-height: 36px; }
  .page-test .opts.srcs li { height: auto; min-height: 32px; }
  .dz .btn { height: 32px; }
}
@media (pointer: coarse) {
  .search { height: 34px; } .search input { height: 32px; }
  .opts label { min-height: 32px; }
}

/* ================================================================ install: client picker (one zip; the picker changes only the steps) */
.seg { display: flex; flex-wrap: wrap; align-items: center; row-gap: var(--s1); padding: var(--s2) var(--s2); border-bottom: 1px solid var(--line2); }
.seg-l { font-size: 12px; margin-right: 8px; white-space: nowrap; }
.seg label { position: relative; display: inline-flex; align-items: center; height: var(--h-sm); padding: 0 var(--s2); margin-left: -1px; border: 1px solid var(--line);
  background: var(--bg); font-size: 12px; cursor: pointer; white-space: nowrap; }
.seg label:hover { background: var(--hl); }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg label:has(input:checked) { z-index: 1; border-color: var(--acc); background: var(--acc-bg); }
.seg label:has(input:focus-visible) { z-index: 2; outline: 2px solid var(--focus); outline-offset: 1px; }
@media (pointer: coarse) { .seg label { height: 32px; } }

/* ================================================================ Advanced (Shape) and Fine (the six Sound sliders): disclosures */
details.adv > summary { list-style: none; cursor: pointer; padding: var(--s1) 0 0; font-weight: bold; font-size: 12px; color: var(--link); }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: "\25B8"; display: inline-block; width: 12px; color: var(--fg2); }
details.adv[open] > summary::before { content: "\25BE"; }
details.adv > summary:hover { text-decoration: underline; }
details.adv > summary .count { font-weight: normal; color: var(--fg2); }
details.adv > .facet.sub { margin: 0 0 4px 12px; padding-bottom: var(--s1); }
details.adv > .facet.sub:last-child { border-bottom: 0; margin-bottom: 0; }
details.adv > .facet.sub legend { font-size: 12px; color: var(--fg); }
@media (max-width: 700px), (pointer: coarse) { details.adv > summary { min-height: 40px; line-height: 40px; padding: 0; } }

/* phones and touch: the /test key bindings are 32 px tap targets too (UX-AUDIT P1) */
@media (max-width: 700px), (pointer: coarse) {
  .page-test button.bind { min-height: 32px; }
}

/* sound test, desktop (owner 2026-11-10: nothing important below the fold). From 1280 px the main column is exactly
   one screen: the map takes the height that is left (any aspect: the camera centres the tee, the backing store
   follows the box), the status line and the footer sit under it, and the controls and the kit table are a right-hand
   column of two boxes that scroll on their own. 1024-1279 px: stacked, with the map short enough that the Controls
   box starts inside the first screen. Narrower: the stacked order as before. */
@media (min-width: 1280px) and (min-height: 600px) {
  .page-test #main { display: grid; box-sizing: border-box; height: calc(100vh - 40px); padding-bottom: var(--s2); column-gap: var(--s3);
    grid-template-columns: minmax(0, 1fr) clamp(360px, 32%, 560px);
    grid-template-rows: auto auto auto auto auto minmax(240px, 1fr) auto auto auto;
    grid-template-areas: "crumbs info" "hrow info" "desc info" "notice info" "strip info" "stage info" "playing info" "touch info" "foot info"; }
  .page-test #main > .hrow { grid-area: hrow; }
  .page-test #main > .crumbs { grid-area: crumbs; }
  .page-test #main > .desc { grid-area: desc; }
  .page-test #main > .notice { grid-area: notice; }
  .page-test #main > .strip { grid-area: strip; }
  .page-test #main > .stage { grid-area: stage; aspect-ratio: auto; min-height: 0; max-height: none; height: auto; }
  .page-test #main > .playing { grid-area: playing; }
  .page-test #main > .touch { grid-area: touch; }
  .page-test #main > .foot { grid-area: foot; margin-top: 8px; padding-top: var(--s1); }
  .page-test .tinfo { grid-area: info; display: flex; flex-direction: column; gap: var(--s2); min-height: 0; margin-top: 8px; }
  .page-test .tbox { margin: 0; border: 0; background: var(--bg); padding: var(--s1) 0 0; min-height: 0;   /* no box: a header rule (AI-tells P3) */
    display: flex; flex-direction: column; }
  .page-test .tbox h2 { margin: 0 0 4px; }
  .page-test #box-kit { flex: 1 1 0; }
  .page-test .tbox .tablewrap { flex: 1 1 auto; min-height: 60px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; border-top: 1px solid var(--line2); }
  .page-test .tbox thead th { position: sticky; top: 0; background: var(--bg); box-shadow: 0 1px 0 var(--line); z-index: 1; }
  .page-test .tbox .grid { border: 0; }
  .page-test .tinfo .grid td, .page-test .tinfo .grid tbody th, .page-test .tinfo .grid thead th { padding: 0 var(--s2) 0 var(--s2); }
  .page-test .tinfo .grid td { font-size: 11px; line-height: 15px; }
  .page-test .tinfo .kit .c-ev { width: auto; }
  .page-test .tinfo .kit .c-n { width: 40px; } .page-test .tinfo .kit .c-try { width: 46px; }
  .page-test .grid.kit td.try { text-overflow: clip; }
  .page-test .tinfo .grid code { overflow-wrap: anywhere; }
  .page-test .tinfo .grid thead th { overflow-wrap: normal; word-break: normal; }
  .page-test .tinfo .kit .c-pl { width: 46px; }
  .page-test #main > .crumbs + .hrow h1 { margin: 4px 0 0; }
  .page-test #main > .ttool, .page-test #main > .stage { margin-top: 4px; }   /* the map keeps >= 400 px at 1280 x 720 */
  .page-test .tinfo .grid.kit td { height: 26px; line-height: 25px; font-size: 12px; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .page-test .stage { aspect-ratio: auto; height: calc(100vh - 290px); min-height: 300px; max-height: none; }
}

/* ================================================================ generator + converter, desktop: one screen, three columns
   (owner 2026-11-10: "the side tabs shouldn't need scrolling ... move things to the right side to another panel").
   One left column = inputs, the middle = the main table, one right column = outcomes; the three always add up to the
   window (the middle is minmax(0, 1fr) and its table scrolls inside its own frame, sticky header). From 1024 x 600 the
   page is exactly one screen. Generate: the theme list is a two-column grid of chips and the knobs are dense rows, so
   the left column fits a 1280 x 720 screen with Advanced closed (opened, only the left column scrolls). Convert: the
   settings are collapsible sections (Output and rate, Level and ceiling open at first); Listen sits with the results.
   Narrower than 1024 px (or shorter than 600 px): the stacked layouts. */
.dhost { display: none; }
.catbar { margin: 0; padding: 0 0 var(--s1); border: 0; }
.catbar legend, .page-gen #f-cats legend { float: left; width: auto; padding: 0 var(--s2) 0 0; line-height: 21px; }
.catbar legend + * { clear: none; }
.catbar .opts.cats { display: flex; flex-wrap: wrap; gap: 0 var(--s3); padding: 0; }
.catbar .opts.cats li { flex: 0 0 auto; }
.catbar .opts.cats .n { min-width: 22px; text-align: left; }
.catbar .opts.cats li.detail { margin-left: auto; }
/* without More detail (the default): no file stems, no Rec. length / Priority columns (collapsed to zero width like
   the container queries, so the colspan group rows keep their columns), no sets DDNet never plays (js/tables.js) */
.events.basic td:first-child .small { display: none; }
.events.basic :is(td, th):is(.c-when, .c-len, .c-lvl) {
  width: 0; padding: 0; border-left: 0; border-right: 0; visibility: hidden; overflow: hidden; white-space: nowrap; font-size: 0; }
/* the outcomes column when it is not a column (701-1023 px): the strip, its contents + install under it, then Takes */
.gout { display: flex; flex-direction: column; }
.gout #pack { order: 1; }
.gout #pack-more { order: 2; margin-top: -1px; }
.cout #f-ab legend { padding: var(--s1) var(--s2) 0; }
.cout #f-ab { margin: 8px 0 0; border: 1px solid var(--line2); background: var(--bg); padding: 0 0 var(--s1); }
/* converter settings sections */
details.sec { border-top: 1px solid var(--line2); }
details.sec > summary { font-weight: bold; }
details.sec[open] > summary { border-bottom: 0; margin-bottom: 0; }
#name-sum { display: inline-block; max-width: 140px; vertical-align: bottom; }
@media (min-width: 1024px) and (min-height: 600px) {
  .page-gen { --inw: 300px; --outw: clamp(290px, 20vw, 380px); }
  .page-conv { --inw: 260px; --outw: clamp(344px, 24vw, 400px); }
  .page-gen .layout, .page-conv .layout { grid-template-columns: var(--inw) minmax(0, 1fr); height: calc(100vh - 40px); }
  .page-gen .side, .page-conv .side { padding: var(--s1) var(--s2) var(--s2) var(--s2); }
  .page-gen main, .page-conv main { display: grid; box-sizing: border-box; height: calc(100vh - 40px); min-height: 0; padding: var(--s2) var(--s3) var(--s2) var(--s4);
    column-gap: var(--s3); grid-template-columns: minmax(0, 1fr) var(--outw); }
  .page-gen main { grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    grid-template-areas: "crumbs out" "h1 out" "desc out" "notice out" "table out" "foot out"; }
  .page-conv main { grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
    grid-template-areas: "crumbs out" "h1 out" "desc out" "notice out" "resume out" "table out" "foot out"; }
  :is(.page-gen, .page-conv) main > .crumbs { grid-area: crumbs; } :is(.page-gen, .page-conv) main > h1 { grid-area: h1; margin-top: 6px; } :is(.page-gen, .page-conv) main > .desc { grid-area: desc; }
  .page-gen #theme-desc { min-height: 54px; }   /* the theme line arrives with the catalogue: its lines are reserved (3 here, 2 from 1280) */
  :is(.page-gen, .page-conv) main > #notice { grid-area: notice; } :is(.page-gen, .page-conv) main > #resume { grid-area: resume; } :is(.page-gen, .page-conv) main > .foot { grid-area: foot; margin-top: 6px; padding-top: var(--s1); }
  :is(.page-gen, .page-conv) main > * { min-width: 0; }
  /* the middle: header (title, description, category filter) always in sight, the table in a frame of its own */
  .page-gen #events, .page-conv #files { grid-area: table; display: flex; flex-direction: column; min-height: 0; min-width: 0; margin-top: 6px; }
  .page-gen #h-events, .page-conv #h-files { position: static; padding: 0 0 var(--s1); margin: 0; min-height: 22px; }
  .page-gen #events-wrap, .page-conv #drop-target { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }   /* relative: the hidden file inputs stay inside the frame */
  .page-conv #drop-target { flex: 0 1 auto; }   /* as tall as its rows (no empty box under a short list), scrolls past the column */
  .page-gen .tablewrap.loading { min-height: 0; }
  .page-gen .events > thead th, .page-conv .conv thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
  .page-conv .names { flex: none; margin-top: 4px; font-size: 11px; line-height: 14px; }
  /* the right-hand column: outcomes; it scrolls on its own only when what is open in it is taller than the screen */
  /* flat like the left column: blocks separated by 1 px rules, no frames, no filled rows */
  .gout, .cout { grid-area: out; display: flex; flex-direction: column; gap: 0; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain; margin-top: 0; padding: 0 0 0 var(--s3); border-left: 1px solid var(--line2); }
  .gout > *, .cout > * { flex: none; margin: 0; border: 0; border-bottom: 1px solid var(--line2); background: transparent; }
  .gout > #pack { order: 1; } .gout > #pack-more { order: 3; }
  .cout > #f-ab { margin: 0; padding: 0 0 var(--s2); border: 0; border-bottom: 1px solid var(--line2); background: transparent; }
  .gout > :last-child, .cout > :last-child { border-bottom: 0; }
  .gout .sr, .cout .sr { flex-wrap: wrap; gap: var(--s2) var(--s2); padding: var(--s2) 0; }
  .gout details.more > summary, .cout details.more > summary { padding: 0; }
  .gout .seg, .cout .seg { padding: var(--s2) 0; }
  .cout #f-ab legend { padding: var(--s2) 0 0; }
  .gout .tsum { margin: 0 0 4px; } .gout .tbtn { padding: 0; }
  .cout #f-ab .kr, .cout #f-ab .keys { padding-left: 0; margin-left: 0; }
  .gout .r1 .files, .cout .r1 .files { flex: 1 1 100%; width: auto; order: 2; overflow: hidden; text-overflow: ellipsis; }
  .gout .r1 .stat, .cout .r1 .stat { flex: 1 1 100%; order: 3; }
  .gout .r1 .prog, .cout .r1 .prog { flex: 1 1 100%; order: 4; min-width: 0; min-height: 16px; }
  .gout .sr.rc { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "kl reset over" "sum sum sum"; height: auto; gap: var(--s1) var(--s2); }
  .gout .sr.rc .kl { grid-area: kl; } .gout #custom-reset { grid-area: reset; } .gout #gen-reset { grid-area: over; }
  .gout #custom-sum { grid-area: sum; line-height: 16px; }   /* one line (the full text is its title): no reserved band */
  .gout .r2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "dl play" "lab lab" "url copy"; gap: var(--s1) var(--s2); }
  .gout #download { grid-area: dl; justify-self: start; } .gout #share-play { grid-area: play; justify-self: end; align-self: center; } .gout .r2 label { grid-area: lab; margin-top: 4px; } .gout #share-url { grid-area: url; } .gout #copy { grid-area: copy; }
  .gout .inner { max-height: none; }
  /* Convert: the Details graphs (one panel per open file, in file order) */
  .page-conv .dhost { display: block; background: var(--bg); }
  .dhost > h2 { margin: 0; padding: var(--s2) 0 var(--s1); border-bottom: 1px solid var(--line2); background: transparent; }
  .dhost .dempty { margin: 8px 0; line-height: 15px; }
  .dhost .det { border-bottom: 1px solid var(--line2); padding: var(--s2) 0; }
  .dhost .det:last-child { border-bottom: 0; }
  .dhost .det.filtered { display: none; }
  .dhost .dhead { display: flex; align-items: center; gap: var(--s2); height: 22px; margin-bottom: 4px; }
  .dhost .dname { flex: 1; min-width: 0; font-size: 12px; }
  .dhost .dpanel { padding: 0; border: 0; background: transparent; gap: var(--s2); }
  .dhost .dviz { width: 320px; max-width: 100%; }
  .dhost .dviews { flex-direction: column; }
  .dhost .dspec { flex: 1 1 100%; max-width: none; }
  .dhost .lg-bar { flex-basis: 110px; width: 110px; }
  /* Generate, the left column: the theme box, dense knob rows */
  .page-gen .facet { margin: 0 0 4px; padding: 0 0 var(--s1); }
  .page-gen .facet legend { padding: var(--s1) 0 0; }
  .page-gen #f-theme legend { padding-bottom: var(--s1); }
  .page-gen #f-style .kn, .page-gen #f-style .kr, .page-gen #f-pack .kt { min-height: var(--h-sm); padding: 0 0 0 var(--s1); }
  .page-gen #f-style .rs label { line-height: 18px; }
  .page-gen #scope-note { display: none; }   /* the same words are the tooltip of "Main sounds only" */
  .page-gen #f-pack .msg { min-height: 14px; line-height: 14px; margin-bottom: 0; }
  .page-gen #f-pack .msg:not(.err):not(.back) { display: none; }   /* the rule shows when it is broken (the Volume row took its room), "was … · back" after New seed */
  .page-gen details.adv > summary { padding: var(--s1) 0 0; }
  .page-gen .sidenote { margin: 4px 4px 0; }
  /* short screens (1280x720): the left column has no room for the Convert cross-link (the nav has it), so the
     Sound group's Takes line still fits without a scrollbar */
  @media (max-height: 760px) { .page-gen .side .sidenote { display: none; } }
  /* Advanced open: the left column scrolls, its section headers stay in sight */
  .page-gen .side details.adv[open] > summary { position: sticky; top: -4px; z-index: 1; background: var(--bg2); }
  /* Convert, the left column: dense rows */
  .page-conv .facet legend { padding: var(--s1) 0 0; }
  .page-conv details.sec > summary { min-height: 22px; padding: var(--s1) var(--s1); }
  .page-conv #settings-note { min-height: 60px; } .page-conv #rate-msg { min-height: 30px; }   /* filled once the engine is up: lines reserved */
}
@media (min-width: 1280px) and (min-height: 600px) {
  .page-gen { --inw: 340px; }
  .page-gen #theme-desc { min-height: 37px; }
  .page-conv { --inw: 280px; }
  .page-conv #settings-note { min-height: 45px; }
  .page-gen .nav { width: calc(var(--inw) - 110px); } .page-conv .nav { width: calc(var(--inw) - 110px); }   /* the search starts over the table */
}

/* sound test: the kit loading line under the strip and its bar (owner 2026-11-11: loading must be obvious) */
.page-test .kitline { display: flex; align-items: center; gap: 8px; min-height: 22px; padding: 0 8px; border-top: 1px solid var(--line2); font-size: 12px; line-height: 16px; }
.page-test .kitline.err { color: var(--err); font-weight: bold; }
.page-test .kitline .btn { font-weight: normal; }
.page-test progress.kbar { display: block; width: 100%; height: 2px; border: 0; appearance: none; background: var(--line2); }
.page-test progress.kbar::-webkit-progress-bar { background: var(--line2); }
.page-test progress.kbar::-webkit-progress-value { background: var(--acc); }
.page-test progress.kbar::-moz-progress-bar { background: var(--acc); }

/* ================================================================ pass 2 (docs/AESTHETIC-CRITIQUE-2026-11-11-pass2.md, USABILITY-AUDIT pass 2) */
/* converter: the empty files frame says so */
@media (min-width: 1024px) and (min-height: 600px) {   /* there the frame fills the column (stacked layouts end with the drop zone) */
  .page-conv.conv-empty #drop-target::after { content: attr(data-empty); display: block; padding: var(--s2) var(--s1); color: var(--fg2); }
}
/* the category filter stays one line at 1440: tighter values, and "More detail" (a view control of the table) moves up
   to the right end of the table's heading line (CSS only: it stays after the categories in the tab order) */
.catbar .opts.cats { gap: 0 var(--s2); }
@media (min-width: 1024px) and (min-height: 600px) {
  .page-gen #events { position: relative; }
  .page-gen #h-events { margin-right: 96px; }   /* room for More detail */
  .page-gen .catbar .opts.cats li.detail { position: absolute; z-index: 2; top: 0; right: 0; min-height: 0; height: 22px; margin: 0; }
  /* "Show events" stays the radios' accessible name; on screen the "All events" heading above already says it */
  .page-gen #f-cats legend { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 700px) {
  /* phones: the Customised value on the label's line */
  .sr.rc { align-items: baseline; }
  .sr.rc #custom-reset, .sr.rc #gen-reset { align-self: center; }
  /* /test: the progress text has a line of its own: "68/68 · 3.3 MB" is never cut */
  .page-test .r1 .prog { flex: 1 1 100%; }
}
/* touch: no tap target under 24 px (usability F20): sliders, the crumbs and the links inside text lines */
@media (pointer: coarse) {
  input[type="range"] { height: 32px; }
  .crumbs a { display: inline-block; line-height: 31px; }
  .sidenote a, .foot a, .desc a, .notice a, .covnote a { display: inline-block; min-height: 24px; line-height: 24px; }
}
@media (pointer: coarse) { .kit td.try .pb { width: 32px; } }   /* the kit table's play buttons: 32 px targets too */

/* ================================================================ /packs (docs/DESIGN-REFERENCE.md §5 "/packs"): the published packs.
   Left: Downloads in (range) and Theme as plain facets; middle: a caption line (range, count) and one table, a 26 px
   line per pack: Name (link) · Theme (made_of in its title) · Settings (11 px --fg2: the Sound settings off their
   default, +n other changes, the seed) · Files · Size · Downloads · Published (right-aligned, tabular; the last two
   headers sort) · Download · Generate · Test · Report (one line of text links; Unpublish on the visitor's own packs).
   Columns leave as the table narrows (container queries on #packs): Settings, then Files and Size, then the words of
   the actions (icons and ⚑ / ×), then Theme and Published (the theme moves under the name). Desktop from 1024 x 600:
   one screen, the frame ends after the last row and scrolls inside when the rows outgrow it. */
#packs { container: pk / inline-size; }
.page-packs .plist { table-layout: fixed; font-variant-numeric: tabular-nums; }
.plist .c-pname { width: 22%; } .plist .c-ptheme { width: 132px; } .plist .c-pset { width: auto; }
.plist .c-pfiles { width: 76px; } .plist .c-psize { width: 70px; }
.plist .c-pdl { width: 88px; } .plist .c-pdate { width: 80px; } .plist .c-pget { width: 324px; }
.plist td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist td.pname .pn { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.plist .pnw { display: flex; align-items: center; gap: var(--s1); min-width: 0; }   /* ▸ hear + the name */
.plist .pnw .hear { flex: none; }
.plist tr.mark td { background: var(--acc-bg); }   /* the visitor's own pack, after View on Packs */
.plist td .tn2 { display: none; }
.plist td.pset .st { color: var(--fg2); font-size: 11px; }
.plist td.pfiles, .plist td.psize, .plist td.pdl, .plist td.pdate { overflow: visible; }
.plist td.pget { overflow: visible; padding-right: var(--s1); }
.plist .acts { display: flex; flex-wrap: nowrap; align-items: center; gap: 0; }
.plist .pa { display: inline-flex; align-items: center; gap: var(--s1); height: var(--h-sm); padding: 0 var(--s1); white-space: nowrap; }
.plist .pa svg { display: none; width: 12px; height: 12px; color: var(--fg2); }
.plist .pa:hover svg { color: var(--fg); }
.plist .acts > * + *::before { content: "·"; content: "·" / ""; margin: 0 var(--s1) 0 calc(-1 * var(--s1)); color: var(--fg2); text-decoration: none; display: inline-block; width: var(--s1); }
.plist .pa[aria-disabled="true"] { color: var(--fg2); pointer-events: none; }
.plist .pa[aria-disabled="true"] svg { color: var(--line); }
/* the sortable headers: a link-coloured word; the current order is plain text with a ▾ */
.grid.plist thead th.r { padding: var(--s1) var(--s1) var(--s1) var(--s4); }
.plist th .sort { padding: 0; border: 0; background: none; font: inherit; font-weight: bold; line-height: inherit; display: block; width: 100%; text-align: inherit; color: var(--link); cursor: pointer; white-space: nowrap; }
.plist th .sort:hover { color: var(--link-hover); text-decoration: underline; }
.plist th .sort[aria-pressed="true"] { color: var(--fg); cursor: default; text-decoration: none; }
.plist th .sort[aria-pressed="true"]::after { content: " ▾"; content: " ▾" / ""; font-weight: normal; }
/* the last action: Report (Unpublish on one's own pack), a --fg2 word; the glyph (⚑ / ×) when the words go */
.flag { display: inline-flex; align-items: center; justify-content: center; height: var(--h-sm); padding: 0 var(--s1); border: 0; background: none;
  color: var(--fg2); font: inherit; cursor: pointer; white-space: nowrap; }
.flag .g { display: none; }
.flag.rep { font-size: 11px; }   /* Report: lighter than the actions before it (intuitiveness audit I16) */
.flag:hover { color: var(--err); text-decoration: underline; }
.flag.done, .flag:disabled { color: var(--line); cursor: default; text-decoration: none; }
.flag.arm { background: var(--err-bg); color: var(--err); outline: 1px solid var(--err); outline-offset: -1px; }
.pmore-row { padding: var(--s2) var(--s1); border-top: 1px solid var(--line2); }
.page-packs h1.cap { font-size: 12px; line-height: 16px; color: var(--fg); margin: 0 0 var(--s1); min-height: 16px; }
.page-packs h1.cap .count { margin-left: var(--s1); }
.page-packs #packs-status { overflow-wrap: anywhere; }   /* "Playing <a 40-letter name with no space>" wraps instead of running off a phone screen */
.page-packs .side .opts .n { min-width: 2.5em; }
@container pk (max-width: 1000px) {
  .plist .c-pset, .plist td.pset { display: none; }
  .plist .c-pname { width: auto; }
}
@container pk (max-width: 820px) {
  .plist .c-pfiles, .plist td.pfiles, .plist .c-psize, .plist td.psize { display: none; }
}
@container pk (max-width: 720px) {
  .plist .pa .w, .flag .w { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .plist .pa svg, .flag .g { display: inline; }
  .plist .acts > * + *::before { content: none; }
  .plist .pa, .flag { width: var(--h-sm); justify-content: center; padding: 0; }
  .flag { font-size: 12px; } .flag.rep { font-size: 10px; }
  .flag:hover { text-decoration: none; background: var(--hl); }
  .plist .acts { gap: var(--s1); }
  .plist .c-pget { width: 112px; }
  .plist .c-ptheme { width: 120px; }
}
@container pk (max-width: 500px) {
  .plist .c-ptheme, .plist td.ptheme, .plist .c-pdate, .plist td.pdate { display: none; }
  .plist td .tn2 { display: block; font-size: 11px; line-height: 13px; color: var(--fg2); overflow: hidden; text-overflow: ellipsis; }
  .plist td.pname { line-height: 15px; padding-top: var(--s1); padding-bottom: var(--s1); }
  .plist tr.empty a { display: inline-block; line-height: 24px; }   /* the empty row's one link, a tap target */
  .plist .c-pdl { width: 64px; }
}
@media (pointer: coarse) {
  .plist .pa, .flag, .plist .pnw .hear { min-width: 32px; height: 32px; }
  .plist td.pname .pn { line-height: 32px; }
  .plist th .sort { min-height: 32px; display: flex; align-items: flex-end; justify-content: flex-end; }
}
@container pk (max-width: 720px) {
  @media (pointer: coarse) { .plist .c-pget { width: 152px; } }
}
/* Generate: Publish to Packs, an inline form in the pack block (js/publish.js) */
.sr.r3 { flex-wrap: wrap; row-gap: var(--s1); }
.r3 .stat { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; line-height: 16px; }
.pubform { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "lab lab lab" "name go cancel" "prog prog prog" "msg msg msg";
  gap: var(--s1) var(--s2); flex: 1 1 100%; margin: 0; }
.pubform label { grid-area: lab; font-size: 12px; }
.pubform .text { grid-area: name; }
.pubform #pub-go { grid-area: go; } .pubform #pub-cancel { grid-area: cancel; }
.pubform progress { grid-area: prog; display: block; width: 100%; height: 4px; border: 0; appearance: none; -webkit-appearance: none; background: var(--line2); }
.pubform progress::-webkit-progress-bar { background: var(--line2); }
.pubform progress::-webkit-progress-value { background: var(--acc); }
.pubform progress::-moz-progress-bar { background: var(--acc); }
.pubform .msg { grid-area: msg; margin: 0; }
@media (min-width: 1024px) and (min-height: 600px) {
  .page-packs .layout { height: calc(100vh - 40px); }
  .page-packs main { display: grid; box-sizing: border-box; height: calc(100vh - 40px); min-height: 0; padding: var(--s2) var(--s4) var(--s2) var(--s4);
    grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "crumbs" "notice" "table" "foot"; }
  .page-packs main > .crumbs { grid-area: crumbs; }
  .page-packs main > #notice { grid-area: notice; } .page-packs main > .foot { grid-area: foot; margin-top: 6px; padding-top: var(--s1); }
  .page-packs main > * { min-width: 0; }
  .page-packs #packs { grid-area: table; display: flex; flex-direction: column; min-height: 0; margin-top: 8px; }
  .page-packs #packs-wrap { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .page-packs .plist thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
}
@media (max-width: 700px) {
  /* one column: crumbs, the filters (short: only themes with packs are listed), the table, the footer */
  .page-packs .layout { display: flex; flex-direction: column; align-items: stretch; padding: var(--s2) var(--s2) var(--s4); }
  .page-packs .side, .page-packs main { display: contents; }
  .page-packs .crumbs { order: 1; } .page-packs #notice { order: 4; }
  .page-packs #filters { order: 5; margin-top: 8px; } .page-packs #packs { order: 6; margin-top: 4px; } .page-packs .foot { order: 8; }
  .page-packs .opts { display: flex; flex-wrap: wrap; gap: 0 var(--s3); }
  .page-packs .opts li { flex: 0 0 auto; }
  .page-packs .opts .n { min-width: 0; text-align: left; }
  .pmore-row { padding: var(--s2) 0; }
}

/* ================================================================ sound viewer (js/viewer.js): what the sound playing is
   in the game. A 232 px box bottom right; phones: an 84 px strip above the bottom bar (the page's bottom padding grows
   by 84 px only while it shows, so nothing is covered and nothing moves). Scene colours are tokens (dark mode). */
:root { --viz-bg: #fff; --viz-sky: #fafafa; --viz-border: #999; --viz-tee: #9a9a9a; --viz-tee2: #c8c8c8; --viz-ink: #555; --viz-hatch: #ccc; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --viz-bg: #161716; --viz-sky: #1d1e1d; --viz-border: #707170; --viz-tee: #8a8a87; --viz-tee2: #555653; --viz-ink: #c8c8c4; --viz-hatch: #3a3b39; }
}
:root[data-theme="dark"] { --viz-bg: #161716; --viz-sky: #1d1e1d; --viz-border: #707170; --viz-tee: #8a8a87; --viz-tee2: #555653; --viz-ink: #c8c8c4; --viz-hatch: #3a3b39; }
.viz { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 19; width: 232px; background: var(--viz-bg); border: 1px solid var(--viz-border); }
.viz-h { display: flex; align-items: flex-start; min-height: 20px; padding: 0 0 0 var(--s1); font-size: 11px; line-height: 20px; white-space: nowrap; min-width: 0; }
.viz-t { display: flex; flex: 1 1 auto; gap: var(--s1); min-width: 0; }
/* the name wins the space: it never shrinks before the source; the source shows only whole (js/viewer.js fit) */
.viz-src { font-weight: bold; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.viz-src::after { content: " ·"; content: " ·" / ""; font-weight: normal; color: var(--fg2); }
.viz-name { color: var(--acc); flex: 0 0 auto; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.viz.nosrc .viz-src { display: none; }
.viz.wrap .viz-name { white-space: normal; }
.viz.wrap .viz-n1, .viz.wrap .viz-n2 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz.wrap .viz-n2 { font-size: 11px; line-height: 14px; padding-bottom: 2px; }
.viz-x { flex: none; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: var(--fg2); font-size: 14px; line-height: 20px; cursor: pointer; }
.viz-x:hover { color: var(--fg); background: var(--hl); }
.viz svg { display: block; width: 230px; height: 96px; }
.viz-sky { fill: var(--viz-sky); }
.viz-hatch line { stroke: var(--viz-hatch); stroke-width: 1; }
.viz-gl { stroke: var(--viz-ink); stroke-width: 1.25; }
.viz-wall { fill: var(--viz-tee2); stroke: var(--viz-ink); stroke-width: 1; }
.viz-wall.unhook { fill: none; stroke: var(--viz-tee); stroke-dasharray: 3 3; }
.viz-tee circle, .viz-tee ellipse { fill: var(--viz-tee); }
.viz-tee2 circle, .viz-tee2 ellipse { fill: var(--viz-tee2); }
.viz-hooked > circle:not(.viz-eye) { stroke: var(--acc); stroke-width: 1.5; }
.viz-tee .viz-eye, .viz-tee2 .viz-eye { fill: var(--viz-ink); }
.viz-ln { stroke: var(--viz-ink); stroke-width: 1.25; }
.viz-head { fill: var(--viz-ink); }
.viz-acc { fill: var(--acc); }
.viz-accl { stroke: var(--acc); stroke-width: 1.5; }
.viz-ring { fill: none; stroke: var(--acc); stroke-width: 1.5; }
.viz-beam { fill: none; stroke: var(--acc); stroke-width: 2; }
.viz-piece { fill: var(--viz-tee); }
@media (max-width: 719px) {
  .viz { left: 0; right: 0; bottom: 0; width: auto; height: 84px; display: flex; align-items: center; gap: var(--s2);
    padding: 0 0 0 var(--s1); border-width: 1px 0 0; }
  body.has-genbar .viz { bottom: 57px; }
  .viz svg { order: -1; width: 150px; height: 76px; border: 1px solid var(--line2); }
  .viz-h { flex: 1 1 auto; height: 76px; padding: 0; align-items: center; white-space: normal; }
  /* the name on the first line (13 px); the source beside it, or on a second 11 px line when it does not fit */
  .viz-t { flex-wrap: wrap; align-content: flex-start; align-self: stretch; padding-top: var(--s3); column-gap: var(--s2); row-gap: 0; }   /* top-aligned: the name stays put while names of 1-3 lines follow each other (UX audit: CLS 0.011 at 390 px) */
  .viz-name { order: -1; flex: 0 0 auto; max-width: 100%; font-size: 13px; line-height: 18px; white-space: nowrap; }
  .viz-src { flex: 0 1 auto; max-width: 100%; font-size: 11px; line-height: 16px; white-space: nowrap; }
  .viz-src::after { content: none; }
  .viz.wrap .viz-n1 { font-size: 13px; line-height: 18px; }
  .viz-x { width: 40px; height: 40px; font-size: 18px; }
  body.viz-on { padding-bottom: 84px; }
  body.viz-on.has-genbar { padding-bottom: 141px; }
}
}
/* ------------------------------------------------------------------ Generate: the right panel as one table
   Two buttons (the accent one: Generate pack, then Download .zip; Test in a map), then label · value rows of 26 px,
   grey 72 px labels; every other action is a text link in its row ("· Reset · Start over"). Install and Pack
   contents fold under it. */
.page-gen .pk { margin-top: 8px; }
.page-gen .pk .acts { display: flex; gap: var(--s2); align-items: center; padding: 0 0 var(--s2); }
.page-gen .pk .acts .btn { flex: 1 1 0; min-width: 0; width: auto; justify-content: center; }
.page-gen #generate, .page-gen #download, .page-gen #download.primary { width: auto; min-width: 0; }
.kv { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 12px; }
.kv th { width: 72px; padding: 0 var(--s2) 0 0; color: var(--fg2); font-weight: normal; text-align: left; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv th label { font-size: inherit; color: inherit; }
.kv td { height: 26px; padding: 0; min-width: 0; vertical-align: middle; }
.kv tr { border-bottom: 1px solid var(--line2); }
.kv tr:last-child { border-bottom: 0; }
.kv td > .ell { display: block; line-height: 25px; }
.kv .stat { color: var(--fg); }
.kv .stat.err { color: var(--err); }
.ready .kv #pack-status { color: var(--acc); }
.kv #custom-sum.on { color: var(--fg); }
.kv #custom-sum:not(.on), .kv #share-note { color: var(--fg2); }
#share-now { color: var(--acc); }
#share-now:not([hidden])::before { content: "·"; content: "·" / ""; margin: 0 6px; color: var(--fg2); }
.kv .pb { width: 22px; margin-right: 6px; vertical-align: middle; }
.kv .shr { display: flex; align-items: center; min-width: 0; }
.kv #share-url { flex: 1 1 auto; min-width: 0; height: var(--h-sm); padding: 0 var(--s1); border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font-size: 11px; text-overflow: ellipsis; }
.kv #share-url:not(:placeholder-shown) { font-family: Consolas, "Liberation Mono", monospace; }
.kv #share-url:disabled { border-color: var(--line2); color: var(--fg2); }
.kv #pub-row td { height: auto; padding: var(--s1) 0 var(--s2); }
.kv .pubform { margin: 0; }
/* text links inside the rows: "· Reset" (the dot is not underlined; a disabled link is grey text) */
.lnk { display: inline; height: auto; padding: 0; border: 0; background: none; color: var(--link); font: inherit; cursor: pointer; white-space: nowrap; }
.lnk:hover { color: var(--link-hover); text-decoration: underline; }
.lnk:disabled { color: var(--fg2); cursor: default; text-decoration: none; }
.kv .lnk::before { content: "·"; content: "·" / ""; display: inline-block; margin: 0 6px; color: var(--fg2); text-decoration: none; }
.kv .shr .lnk::before { content: none; }
.kv .shr .lnk { margin-left: var(--s2); }
.pmore details.more { border-top: 1px solid var(--line2); }
.pmore details.more > summary { padding: 0; }
@media (min-width: 1024px) and (min-height: 600px) {
  .gout > .pk { order: 1; padding: var(--s2) 0 var(--s1); } .gout > #pack-more { order: 2; border-bottom: 0; }
  .gout > #pack-more > details.more:first-child { border-top: 0; }
}

/* ------------------------------------------------------------------ Generate: the theme table
   Replaces the sound table in the main column (first visit, the theme box, "all 26 themes", "Change theme"):
   radio · Theme · Hook · Jump · Shot · Feel · Hear; sortable by Theme and Feel; the current theme's row tinted. A
   switch resets every setting, so with any change it asks first in a strip row under the clicked row (.tp-ask,
   the converter's naming-hint look). */
#desc-change { line-height: 1; vertical-align: baseline; }   /* a button: never taller than the text line (no shift when it appears) */
#h-tpick > .count { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#h-tpick { display: flex; align-items: baseline; gap: var(--s2); min-height: 22px; margin: 0; padding: 0 0 var(--s1); }
#h-tpick .status { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#tp-close { flex: none; margin-left: auto; font-size: 12px; font-weight: normal; }
.tpick { table-layout: fixed; }
.tpick td { height: 26px; font-size: 12px; }
.tpick .c-pick { width: 28px; padding-right: 0; } .tpick .c-name { width: 24%; } .tpick .c-feel { width: 76px; } .tpick .c-hear { width: 84px; }
.tpick td.c-name { font-weight: bold; }
.tpick td.c-hk, .tpick td.c-jp, .tpick td.c-sh { color: var(--fg2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tpick .c-hjs { display: none; }
.tpick tbody tr { cursor: pointer; }
.tpick tbody tr.cur > td { background: var(--sel); }
.tpick tbody tr.mplay > td:first-child { box-shadow: inset 2px 0 0 var(--acc); }
.tpick .c-hear .lnk { margin-left: var(--s2); }
.tpick thead .sort { padding: 0; border: 0; background: none; font: inherit; font-weight: bold; color: var(--link); cursor: pointer; }
.tpick thead .sort:hover { text-decoration: underline; }
.tpick thead th[aria-sort="ascending"] .sort::after { content: " ▲"; content: " ▲" / ""; font-size: 9px; }
.tpick thead th[aria-sort="descending"] .sort::after { content: " ▼"; content: " ▼" / ""; font-size: 9px; }
.tpick tbody tr.dim > td { color: var(--fg2); }
.tpick tbody.filtering tr[data-search]:not(.dim) td.c-name { background: var(--hl); }
.tpick tbody tr.asking > td { background: var(--hl); }
.tpick tr.tp-ask { cursor: default; }
.tpick tr.tp-ask > td { height: auto; min-height: 26px; padding: 2px var(--s2); border-left: 2px solid var(--acc); background: var(--bg2); color: var(--fg); font-size: 12px; }
.tpick .ask { display: flex; align-items: center; gap: var(--s1) var(--s3); min-height: 22px; }
.tpick .ask-t { flex: 1 1 auto; min-width: 0; line-height: 16px; }
.tpick .ask-t b { font-weight: bold; }
.tpick .ask-b { flex: none; display: flex; gap: var(--s2); }
.tpick .ask .btn.primary { width: auto; }
@media (min-width: 1024px) and (min-height: 600px) {
  .page-gen #tpick { grid-area: table; display: flex; flex-direction: column; min-height: 0; min-width: 0; margin-top: 6px; }
  .page-gen #tpick[hidden] { display: none; }
  .page-gen #tp-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .page-gen .tpick thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
}
@media (max-width: 700px) {
  .tpick .c-hk, .tpick .c-jp, .tpick .c-sh { display: none; }
  .tpick .c-hjs { display: table-cell; width: auto; }
  .tpick td.c-hjs { padding-top: 3px; padding-bottom: 3px; color: var(--fg2); font-size: 11px; line-height: 14px; }
  .tpick td.c-hjs span { display: block; overflow-wrap: anywhere; }
  .tpick .c-name { width: 30%; } .tpick .c-feel { width: 58px; } .tpick .c-hear { width: 40px; }
  .tpick td.c-name { overflow-wrap: anywhere; }
  .tpick .c-hear .lnk { display: block; margin: 2px 0 0; }
  .tpick td { padding-right: var(--s2); }
  .tpick .ask { flex-wrap: wrap; padding: var(--s1) 0; }
  .tpick .ask-t { flex-basis: 100%; }
  .tpick .ask-b .btn { min-height: 24px; }
}
.kv #share-play { min-width: 0; width: 22px; }
/* Changes and Takes: a long summary ends in "…" (the full text in its tooltip); the links after it never shrink */
.kv td > .ell.lr { display: flex; align-items: baseline; min-width: 0; }
.kv .lr > #custom-sum, .kv .lr > #recipe-sum { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kv .lr > .lnk { flex: none; }
.kv td > .ell { height: 25px; }


/* the right panel on touch: every row action a 32 px target, the share field 16 px text (no iOS zoom on focus) */
@media (pointer: coarse) {
  .kv td { height: 33px; }
  .kv td > .ell { height: 32px; line-height: 32px; }
  .kv .lnk { line-height: 32px; }
  .kv .shr .lnk { height: 32px; }
  .kv #share-url { height: 32px; font-size: 16px; }
  .kv #share-play { width: 32px; }
}
/* /test's Back to Generate / Back to Packs link: a 32 px target on touch */
@media (pointer: coarse) { .backlink:not([hidden]) { display: inline-flex; align-items: center; min-height: 32px; } }
/* /converter on touch: the row's Details toggle is a 32 px target too (td.c-file .dt is 22 px tall on a mouse) */
@media (pointer: coarse) { .conv td.c-file .dt { width: 24px; height: 32px; } }
/* the Peak in header is wider than its 50-56 px column in French and Russian ("Crête entrée", "Пик вход"): two short
   lines instead of a cut; Russian "Выход" needs a few px more than the 42 px Out column (hidden under 600 px anyway) */
.conv thead th.c-tp { white-space: normal; line-height: 12px; }
@container cv (min-width: 601px) { :lang(ru) .conv .c-out { width: 48px; } }

/* Generate: the steps line under the title (UX audit U2, 2026-11-16): "1 Pick a theme › 2 Listen › 3 Build ›
   4 Download", one line, fixed height; the current step's number filled with the accent, earlier ones outlined in it.
   On a share link of someone else's pack the share lead takes its place (html[data-shared], js/theme-init.js). */
.steps { list-style: none; display: flex; align-items: center; flex-wrap: nowrap; height: 22px; margin: 6px 0 0; padding: 0; overflow: hidden; font-size: 12px; white-space: nowrap; }
.steps li { display: flex; align-items: center; flex: none; }
.steps li + li::before { content: "›"; padding: 0 var(--s2); color: var(--fg2); }
.stp { display: inline-flex; align-items: center; gap: var(--s1); height: 22px; padding: 0; border: 0; background: none; color: var(--link); font: inherit; cursor: pointer; }
.stp:hover { color: var(--link-hover); text-decoration: underline; }
.stp .stn { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid var(--line); color: var(--fg2); font-size: 11px; text-decoration: none; }
.steps li.done .stn { border-color: var(--acc); color: var(--acc); }
.stp[aria-current] { color: var(--fg); }
.stp[aria-current] .stn { background: var(--acc-fill); border-color: var(--acc-fill); color: var(--on-acc); }
.stp[aria-disabled="true"]:not([aria-current]) { color: var(--fg2); cursor: default; text-decoration: none; }
:root[data-shared] .page-gen .steps { display: none; }
/* the share lead: the pack's player and its download before the editor (UX audit U3) */
.slead { display: none; }
:root[data-shared] .page-gen .slead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 8px 0 0; min-height: 52px; }
.slead .btn { height: var(--h); }
#slead-play { min-width: 168px; justify-content: center; }
#slead-play.on { background: var(--acc-bg); border-color: var(--acc); color: var(--acc); }
#slead-play.busy svg { color: var(--fg2); }
.slead .btn.primary { width: auto; min-width: 168px; justify-content: center; }
.slead .sl-t { flex: 1 1 100%; min-height: 16px; line-height: 16px; color: var(--fg2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* the Status row's progress: a 3 px bar along the row's bottom edge while the pack builds (it was never shown) */
.kv td:has(> .ell > #pack-progress) { position: relative; }
.kv #pack-progress { position: absolute; left: 0; right: 0; bottom: -1px; width: auto; height: 3px; border: 0; appearance: none; -webkit-appearance: none; background: var(--line2); }
.kv #pack-progress::-webkit-progress-bar { background: var(--line2); }
.kv #pack-progress::-webkit-progress-value { background: var(--acc); }
.kv #pack-progress::-moz-progress-bar { background: var(--acc); }
.page-gen .pk .acts #download { flex-grow: 2; }   /* "Download zip · 4.5 MB" next to Test in a map */
@media (max-width: 700px) {
  .page-gen #steps, .page-gen #slead { order: 3; }
  .steps li + li::before { padding: 0 var(--s1); }
  :root[data-shared] .page-gen .slead { min-height: 64px; margin-bottom: var(--s3); }
  .slead .btn { height: 40px; flex: 1 1 140px; min-width: 0; }
}
@media (pointer: coarse) { .stp { height: 32px; } .steps { height: 32px; } }
@media (min-width: 1024px) and (min-height: 600px) {
  .page-gen main { grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
    grid-template-areas: "crumbs out" "h1 out" "desc out" "steps out" "notice out" "table out" "foot out"; }
  .page-gen main > #steps, .page-gen main > #slead { grid-area: steps; }
  .page-gen main > #steps { margin-top: 2px; }
  .page-gen #slead-dl { display: none; }   /* the right column's Download is in sight */
  :root[data-shared] .page-gen .slead { min-height: 0; }
}
/* the menu: the one way in for a first visit (UX audit U2) */
.menu-main .start { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); margin: 0 0 12px; }
.menu-main .start .btn.primary { width: auto; padding: 0 var(--s4); }
.menu-main .start .small { color: var(--fg2); }
@media (pointer: coarse), (max-width: 700px) { .menu-main .start .btn.primary { height: 40px; } }
.tpick thead th.c-hear { white-space: nowrap; overflow: hidden; padding-right: 0; }   /* "Hear" on one line in the narrow phone column */
@media (max-width: 700px) {   /* a share link: the lead's Download is the accent; the pack table's one is plain (one accent per screen) */
  :root[data-shared] .page-gen .pk .acts #download { background: var(--bg); border-color: var(--line); color: var(--fg); }
}

/* a link to a part of the page lands under the sticky header, not behind it (UX pass b: on phones the Build in the
   steps line scrolled the pack's Download button under the two-row header) */
#pack, #install, #contents, #events, #history { scroll-margin-top: 48px; }
@media (max-width: 700px) { #pack, #install, #contents, #events, #history { scroll-margin-top: 96px; } }
/* JavaScript off (no html[data-js] from js/theme-init.js): the <noscript> notice, and Generate's controls, which would do
   nothing, are not shown */
.notice.nojs { margin: var(--s2) 0; }
html:not([data-js]) .page-gen :is(.side, #steps, #slead, #outcomes, #tpick, #events, .genbar) { display: none; }
html:not([data-js]) .page-gen :is(.layout, main) { display: block; height: auto; }
html:not([data-js]) .page-gen main { padding: var(--s2) var(--s4); max-width: 960px; }
html:not([data-js]) :is(.page-gen, .page-packs, .page-conv, .page-test) .top .search, html:not([data-js]) .page-gen #theme-desc { display: none; }
/* very wide screens at 100 % scaling (a 4K monitor without OS scaling): the same page, larger, instead of 12 px text
   across 3840 px (UX pass b, the 4K visitor). CSS zoom keeps every px rule and the one-screen layout; media queries
   still read the real width, so this cannot loop. */
@media (min-width: 2400px) { html { zoom: 1.25; } }
@media (min-width: 3000px) { html { zoom: 1.5; } }
/* /packs: Your packs (js/history.js) at the end of the sidebar; on phones after the list */
.facet .flg { margin: 0; padding: var(--s1) 0 0; font-weight: bold; font-size: 12px; }
.opts.mine li { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 0; min-width: 0; padding: 2px 0; }
.opts.mine li a { display: block; min-width: 0; }
.opts.mine li .n, .page-packs .side .opts.mine .n { font-size: 11px; color: var(--fg2); text-align: left; min-width: 0; }
#f-mine .sidenote { margin: var(--s1) 0 0; font-size: 11px; color: var(--fg2); }
#f-mine .sidenote a { text-decoration: underline; }
@media (max-width: 700px) { .page-packs #f-mine { order: 7; margin-top: var(--s3); } .page-packs #f-mine .opts { display: block; } }
@media (pointer: coarse) { .opts.mine li a { min-height: 32px; line-height: 32px; } }
/* an error in the Status row wraps instead of hiding Retry behind an ellipsis (the 503 countdown, a failed render) */
.kv td > .ell:has(> #pack-status.err) { height: auto; min-height: 25px; white-space: normal; line-height: 18px; padding: 3px 0; }
@media (pointer: coarse) { .kv td > .ell:has(> #pack-status.err) { min-height: 32px; } }
/* JavaScript off: nothing restores the converter's state, so its page is shown at once (with the notice) */
html.restoring:not([data-js]) #main { visibility: visible; animation: none; }
