/* AzurKit's page: design A, the dense tool (D900), with the owner's changes (D897-D903). Like a pro editor: a
   toolbar with the tabs, the image band, the open tab (the Patches tab: the packs in their categories' groups on the
   left, the open pack's settings in a column on the right; tight 22 px rows, small type), and Build and Save in a
   bar along the window's bottom, always in view. Dark by default whatever the system's setting, light by the
   toolbar's toggle (app.mjs remembers it). Colours: the app icon's azure tile for the accent and its four element
   bands for meaning (water blue the accent's family, earth green Save, fire red errors, air gold the ● marks).
   theme.js sets the remembered theme on the root before the first paint. */
:root {
  color-scheme: dark;
  --air: #c49a3c; --water: #2f6aae; --fire: #b23a24; --earth: #3f7c36;
  --bg: #0d1117; --pane: #141920; --bar: #1a2029; --zebra: #171c24; --hover: #1b2736; --sel: #16314f;
  --line: #2b3440; --soft: #1f2630;
  --text: #e1e6ed; --muted: #8f9aaa; --faint: #8d99aa;   /* faint: at least 4.5:1 on every dark ground */
  --accent: #3b8cf0; --ring: #4aa3ff; --on: #ffffff; --field: #0e1218;
  --go: #3a8a33; --mark: #e2b552; --error: #ff7a66;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --row: 22px; --list: min(40rem, 48%);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8ecf1; --pane: #ffffff; --bar: #dde3ea; --zebra: #f4f6f9; --hover: #e8f0fb; --sel: #d6e5fb;
  --line: #c6ced8; --soft: #e2e7ed;
  --text: #151a21; --muted: #586272; --faint: #5a6472;   /* faint: at least 4.5:1 on every light ground */
  --accent: #0b4fc4; --ring: #4aa3ff; --on: #ffffff; --field: #ffffff;
  --go: #2f6b29; --mark: #8f6200; --error: #b23a24;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 12px/1.35 system-ui, -apple-system, sans-serif;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
}
main { min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
main > section { min-height: 0; overflow: auto; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }

/* The toolbar: the name with a four-element disc (the icon's colours, drawn in CSS), the tabs, the line under the
   name, the version and the theme's toggle. */
header {
  display: flex; align-items: center; gap: 12px; padding: 0 10px; min-height: 30px;
  background: var(--bar); border-bottom: 1px solid var(--line);
}
h1 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: .02em; }
h1::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--ring);
  background: conic-gradient(from -45deg, var(--air) 0 25%, var(--fire) 0 50%, var(--earth) 0 75%, var(--water) 0);
}
#tabs { display: flex; align-self: stretch; }
#tabs button {
  height: auto; padding: 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--muted);
  box-shadow: inset 0 -2px transparent;
}
#tabs button:hover { color: var(--text); }
#tabs button[aria-selected="true"] { color: var(--text); background: var(--pane); box-shadow: inset 0 -2px var(--accent); }
.tagline {
  flex: 1; min-width: 0; margin: 0; color: var(--muted); font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#version { margin: 0 0 0 auto; font: 11px var(--mono); color: var(--faint); white-space: nowrap; }
/* A phone or a tablet (D1000: v1 is for computers): one plain line atop the toolbar, no layout of its own. */
#computers { display: none; }
@media (hover: none) and (pointer: coarse) {
  header { flex-wrap: wrap; }
  #computers { display: block; flex-basis: 100%; order: -1; margin: 4px 0; font-size: 13px; font-weight: 600; }
}

/* Panel captions. */
h2 {
  margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.note { color: var(--muted); font-size: 11.5px; }

/* The image band, and the build bar along the window's bottom. */
.image, .build {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; padding: 6px 10px; min-width: 0;
  background: var(--pane);
}
.image { border-bottom: 1px solid var(--line); }
.build { border-top: 1px solid var(--line); background: var(--bar); }
.image p, .build p { margin: 0; }
.build > .note { flex-basis: 100%; font-size: 11px; }
.actions { display: flex; align-items: center; gap: 4px; }
#build-line { margin-left: 4px; white-space: nowrap; }
.actions .on { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; white-space: nowrap; }
.actions .on input { margin: 0; accent-color: var(--accent); }
.actions .on:has(input:disabled) { color: var(--faint); }
#packs .vanilla-note { margin: 0; padding: 3px 10px; font-size: 11px; }
#packs .moved { margin: 0; padding: 3px 10px; font-size: 11px; }
#packs .moved:empty { display: none; }
.actions:not(:has(button:not([hidden]))) { display: none; }
input[type="file"] { font-size: 11.5px; color: var(--muted); max-width: 15rem; }
button, input[type="file"]::file-selector-button {
  height: 22px; padding: 0 12px; font: 600 12px/1 system-ui, -apple-system, sans-serif; color: var(--text);
  background: var(--pane); border: 1px solid var(--line); border-radius: 3px;
}
input[type="file"]::file-selector-button { margin-right: 6px; }
button:hover:not(:disabled) { border-color: var(--ring); }
button:disabled { color: var(--faint); background: transparent; }
#build:not(:disabled) { color: var(--on); background: var(--accent); border-color: var(--accent); }
#save:not(:disabled) { color: var(--on); background: var(--go); border-color: var(--go); }
#cancel { color: var(--error); }
.path { flex: 1 1 100%; display: flex; gap: 6px; align-items: center; }
.image .path { flex-basis: 30rem; }
.path label { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.path input, #packs .slider input[type="text"] {
  min-width: 0; height: 22px; padding: 0 6px; font: 11.5px var(--mono); color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: 3px;
}
.path input { flex: 1; }
/* The status readout, like a transport's display: the build's line, red when it is an error; at most three lines
   tall, so a long refusal scrolls in it rather than growing the bar. */
#status {
  flex: 1 1 24rem; min-width: 0; min-height: 22px; max-height: calc(3 * 16px + 8px); overflow-y: auto; padding: 3px 8px;
  font: 600 11.5px/16px var(--mono); overflow-wrap: anywhere;
  background: var(--field); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 3px;
}
#status:empty::before { content: "—"; color: var(--faint); }
#status.error { color: var(--error); border-left-color: var(--error); }
/* A long call's bar (D980): its stage and percent, or a moving stripe while it has no count. The stripe is a transform
   the browser's compositor moves, over a plain track: a bar with no value drawn in its own look is drawn again every
   frame (WebKit's 60 a second, each a round trip to its GPU process, which a busy computer starves: Step 4.4ci21). */
.progress { flex: 0 1 20rem; min-width: 0; display: flex; align-items: center; gap: 6px; }
.progress .bar { flex: 0 0 8rem; position: relative; display: flex; }
.progress progress { width: 100%; height: 8px; accent-color: var(--accent); }
.progress progress:indeterminate {
  -webkit-appearance: none; appearance: none; border: 1px solid var(--line); border-radius: 4px; background: var(--field);
}
.progress progress:indeterminate::-webkit-progress-bar { background: transparent; }
.progress progress:indeterminate::-moz-progress-bar { background: transparent; }
.progress .stripe { display: none; position: absolute; inset: 0; overflow: hidden; border-radius: 4px; pointer-events: none; }
.progress .bar:has(progress:indeterminate) .stripe { display: block; }
.progress .stripe::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 4px; background: var(--accent);
  animation: stripe 1.2s linear infinite;
}
@keyframes stripe { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .progress .stripe::before { animation: none; transform: translateX(75%); } }
#progress-line {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px var(--mono); color: var(--muted);
}

/* The Patches tab: the packs in their categories' groups on the left; the open pack's settings beside them. */
.packs {
  background: linear-gradient(to right, transparent calc(var(--list) - 1px), var(--line) 0 var(--list),
                              transparent 0) local, var(--pane);
}
.packs > h2 {
  position: sticky; top: 0; z-index: 2; padding: 4px 10px; background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.packs > .note { margin: 0; padding: 4px 10px; width: var(--list); }
.packs > .note:empty { display: none; }
#packs { position: relative; }
#packs > .note { margin: 0; padding: 4px 10px; }
/* A category's group, which folds: its title, its line and how many of its packs are ticked. */
#packs .group { width: calc(var(--list) - 1px); }
#packs .group > summary {
  display: block; height: var(--row); padding: 0 10px; line-height: var(--row); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; background: var(--bar); border-bottom: 1px solid var(--line); cursor: default;
  list-style: none;
}
#packs .group > summary::-webkit-details-marker { display: none; }
#packs .group > summary::before { content: "▾"; display: inline-block; width: 12px; color: var(--muted); }
#packs .group:not([open]) > summary::before { content: "▸"; }
#packs .group > summary b { font-size: 11.5px; }
#packs .group > summary .tally { margin-left: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
#packs .group > summary .line { margin-left: 10px; color: var(--faint); font-size: 11px; }
#packs .group:has(.mark:not(:empty)) > summary b::after { content: " ●"; color: var(--mark); }
#packs .pack { display: flex; align-items: flex-start; border-bottom: 1px solid var(--soft); }
#packs .pack:nth-of-type(even) { background: var(--zebra); }
#packs .pack:hover { background: var(--hover); }
#packs .pack.open { background: var(--sel); box-shadow: inset 3px 0 var(--accent); }
/* A pack's row: its tick and name, the releases at the right; its description under the name. */
#packs .pack > label {
  position: relative; flex: 1; min-width: 0; display: grid; grid-template-columns: 13px minmax(0, 1fr);
  gap: 0 8px; padding: 3px 4px 3px 10px; line-height: 14px;
}
#packs .pack > label input { grid-row: span 2; margin: 1px 0 0; width: 13px; height: 13px; accent-color: var(--accent); }
#packs .name { font: 600 11.5px/14px var(--mono); overflow-wrap: anywhere; padding-right: 6rem; }
#packs .pack > label > span:last-child { font-size: 11.5px; color: var(--muted); }
#packs .releases { position: absolute; top: 3px; right: 4px; font-size: 10px; color: var(--faint); white-space: nowrap; }
#packs .pack:has(> label input:not(:checked)) > label { color: var(--muted); }
/* An unticked pack's settings are locked (D907): greyed and still readable; its settings' header says why. */
#packs .pack:has(> label input:not(:checked)) .slider { color: var(--muted); }
#packs .pack:has(> label input:not(:checked)) > .sliders::before { content: attr(aria-label) " · locked: tick it to change these"; }
#packs .mark { color: var(--mark); margin-right: 3px; }
#packs .pack.owned > label { color: var(--muted); }
#packs .owned-line { display: block; font-size: 11px; color: var(--mark); }
#packs .cpack { padding: 3px 10px; border-bottom: 1px solid var(--soft); font-size: 11.5px; }
#packs .cpack:nth-of-type(even) { background: var(--zebra); }
#packs .cpack > label { display: inline-flex; gap: 6px; align-items: baseline; }
#packs .cpack .name { padding-right: 0; }
#packs .cpack .by { color: var(--faint); font-size: 10.5px; margin-left: 6px; }
#packs .cpack .what { margin: 1px 0 0 19px; color: var(--muted); }
#packs .cpack button { margin-left: 8px; font-size: 11px; }
#packs .cpack ul { margin: 2px 0 0 19px; padding: 0 0 0 12px; color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
#packs .community-from { margin: 0; padding: 3px 10px; }
#packs .community-note { margin: 0; padding: 3px 10px; }
#packs .community-note:empty { display: none; }
#packs .mark:empty { display: none; }
/* The Settings opener, with the pack's count of settings, one width for every pack; gold when a value in it is
   changed or marked. */
#packs .toggle {
  flex: none; min-width: 9em; height: 20px; margin: 3px 8px 0 0; padding: 0 8px; text-align: center;
  font: 600 11px/18px system-ui, -apple-system, sans-serif;
  color: var(--accent); background: var(--field); border-color: var(--line); border-radius: 10px; white-space: nowrap;
}
/* A pack without settings keeps the opener's slot (unseen and out of the tab order), so the releases line up. */
#packs .toggle[hidden] { display: block !important; visibility: hidden; }
/* Every opener as wide as the longest it can say, in the font in use (an unseen line of no height): a wide sans
   (Linux's DejaVu, Verdana) puts a two-digit count past 9em, which moved the releases on its rows (Step 4.4ci2). */
#packs .toggle::before { content: "Settings · 00 ›"; display: block; height: 0; visibility: hidden; }
#packs .toggle::after { content: " ›"; }
#packs .pack:not(.open):has(input.changed, .slider .mark:not(:empty)) .toggle { color: var(--mark); border-color: var(--mark); }
#packs .pack.open:has(input.changed, .slider .mark:not(:empty)) .toggle { box-shadow: 0 0 0 1.5px var(--mark); }
#packs .pack.open .toggle { color: var(--on); background: var(--accent); border-color: var(--accent); }
#packs .sliders { display: none; }
/* The open pack's settings: beside the list, from its row down (app.mjs place()). */
#packs .pack.open > .sliders { display: block; position: absolute; top: 0; left: var(--list); right: 0; }
#packs .sliders::before {
  content: attr(aria-label); display: block; height: var(--row); padding: 0 10px; font: 600 11.5px/var(--row) var(--mono);
  background: var(--bar); border-bottom: 1px solid var(--line); box-shadow: inset 3px 0 var(--accent);
}
#packs .slider {
  display: grid; grid-template-columns: minmax(7rem, 14rem) minmax(3rem, 1fr) 4.5rem minmax(4.5rem, 8.5rem) auto;
  gap: 0 8px; align-items: center; min-height: var(--row); padding: 1px 10px; border-bottom: 1px solid var(--soft);
}
#packs .slider:nth-child(even) { background: var(--zebra); }
#packs .slider:hover { background: var(--hover); }
#packs .slider input[type="text"] { width: 100%; height: 18px; text-align: right; font-variant-numeric: tabular-nums; }
#packs .slider input.changed { font-weight: 700; color: var(--accent); border-color: var(--ring); }
#packs .unit { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#packs .pack > label input:disabled { opacity: .6; }
#packs .slider input[type="text"]:disabled { color: var(--muted); background: transparent; border-style: dashed; }
#packs input[type="range"]:disabled::-webkit-slider-thumb { background: var(--muted); }
#packs input[type="range"]:disabled::-moz-range-thumb { background: var(--muted); }
/* An L3 toggle (D909), at the end of its setting's row: lit when a left-stick click flips that setting in game. */
#packs .l3 {
  position: relative; display: inline-flex; align-items: center; height: 16px; padding: 0 5px;
  font: 700 10px/14px var(--mono); color: var(--muted); background: var(--field); border: 1px solid var(--line);
  border-radius: 3px; cursor: default; user-select: none; -webkit-user-select: none;
}
#packs .l3 input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; }
/* Its ● sits just left of the pill, on the row's ground: the pill keeps one width, so a marked row's columns line up. */
#packs .l3 .mark { position: absolute; right: 100%; margin-right: 2px; }
#packs .l3:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 1px; }
#packs .l3:has(input:checked) { color: var(--on); background: var(--accent); border-color: var(--accent); }
#packs .l3:has(input:disabled) { border-style: dashed; }
#packs .l3:has(input:disabled:checked) { color: var(--accent); background: transparent; border-color: var(--accent); }
#packs input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; margin: 0; background: none; }
#packs input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line); }
#packs input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 9px; height: 13px; margin-top: -5px; border-radius: 2px; background: var(--accent);
}
#packs input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line); }
#packs input[type="range"]::-moz-range-thumb { width: 9px; height: 13px; border: 0; border-radius: 2px; background: var(--accent); }

/* The Randomizer tab (RANDOMIZER_PLAN §5.5): Randomize, the seed and the options in one band, the share string, a
   ⚠ line while a build would leave the logic unverified, then the item rows beside the skips, the facts and the
   spoiler. Its settings are locked until Randomize is ticked (D907). */
.rando { background: var(--pane); }
.rando > h2 {
  position: sticky; top: 0; z-index: 2; padding: 4px 10px; background: var(--bar); border-bottom: 1px solid var(--line);
}
.rando-top, .rando-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; padding: 4px 10px; }
.rando-top { border-bottom: 1px solid var(--soft); }
#rando-difficulty-line { flex-basis: 100%; margin: 0; }
.rando .field { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; }
.rando .on { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.rando .on input { accent-color: var(--accent); }
.rando .mark { color: var(--mark); }
.rando .mark:empty { display: none; }
.rando input[type="text"], .rando input[type="search"], .rando select {
  height: 22px; padding: 0 6px; font: 11.5px var(--mono); color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: 3px;
}
#rando-seed { width: 9rem; }
#rando-cost { width: 4.5rem; text-align: right; }
#rando-share { width: 18rem; }
#rando-filter { width: 14rem; }
.rando :is(input, select):disabled { color: var(--muted); background: transparent; border-style: dashed; }
.rando .unit { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rando:has(#rando-on:checked) #rando-locked { display: none; }
.rando .warn { margin: 0; padding: 4px 10px; color: var(--mark); font-size: 11.5px; white-space: pre-line;
  overflow-wrap: anywhere; }
.rando .warn.error { color: var(--error); }
.rando-cols { display: grid; grid-template-columns: minmax(0, 27.6rem) minmax(0, 1fr); gap: 0 16px; padding: 0 10px; }
.rando h3 { margin: 6px 0 2px; font-size: 11.5px; }
.rando h3 .note { font-weight: 400; margin-left: 6px; }
.rando .item, .rando .skip {
  display: grid; align-items: center; gap: 0 8px; min-height: var(--row); padding: 0 4px; border-bottom: 1px solid var(--soft);
}
.rando .item { grid-template-columns: 13px 6.2rem 8.5rem 3rem minmax(0, 1fr); }
.rando .item .icons { display: inline-flex; gap: 2px; }
.rando .item .count { font: 11px var(--mono); text-align: right; color: var(--text); }
.rando .item:has(input:disabled) .icons { opacity: .55; }
.rando .groups { gap: 2px 12px; padding-top: 0; }
.rando .groups .group { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rando .groups .group input { margin: 0; accent-color: var(--accent); }
/* The folds inside a list (the specific skips; the Characters tab's Species, Community and Yours): a muted summary,
   its title bold and its tally beside it, a wrapped line hung under the title, shut until opened (D1061). */
.fold > summary { display: block; padding: 2px 0 2px 12px; text-indent: -12px; font-size: 11.5px; color: var(--muted);
  cursor: default; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▾"; display: inline-block; width: 12px; text-indent: 0; }
.fold:not([open]) > summary::before { content: "▸"; }
.fold > summary b { font-weight: 700; color: var(--text); }
.fold > summary .chosen { color: var(--text); }   /* the chosen model, named while its group is shut */
#rando-skips h4 { margin: 3px 0 0; padding: 0 4px; font-size: 10.5px; font-weight: 400; color: var(--muted); }
.rando .file { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 3px; background: var(--pane); }
.rando .file input { display: none; }
.rando .file:has(input:disabled) { color: var(--faint); background: transparent; }
.rando .skip { grid-template-columns: 13px minmax(0, 1fr) 7rem 3.5rem; }
.rando .item:nth-child(even), .rando .skip:nth-child(even) { background: var(--zebra); }
.rando .item input, .rando .skip input { margin: 0; accent-color: var(--accent); }
.rando .item:has(input:disabled) span:first-of-type { color: var(--muted); }
.rando .item span:last-child, .rando .skip .rating, .rando .skip .by { color: var(--muted); font-size: 11px; }
.rando .skip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rando .skip.toggled .by { color: var(--mark); }
#rando-facts { margin: 4px 10px 0; }
#spoiler {
  margin: 4px 10px 10px; padding: 8px 10px; max-height: 24rem; overflow: auto; font: 11px/1.45 var(--mono);
  white-space: pre-wrap; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 3px;
}

/* The Randomizer tab's views (its settings, the tracker), as small tabs in its caption. */
.rando > h2 { display: flex; align-items: center; gap: 12px; }
.views { display: inline-flex; gap: 2px; text-transform: none; letter-spacing: 0; }
.views button { height: 18px; padding: 0 10px; font-size: 11px; color: var(--muted); background: transparent; }
.views button[aria-selected="true"] { color: var(--on); background: var(--accent); border-color: var(--accent); }
p.views { margin: 0; padding: 2px 10px; }

/* The tracker (Step 4.2c2): its bar, the head line, the counter row and the levels reached now, then the world map
   (each level a cell in the grid, its spots reachable now in a badge), a level's spots as chips ringed by their
   state, or the Table. The states' colours are Modkit's tracker's: green reachable now, amber only with a skip
   (R1.41), grey not yet, blue a live mark and the player. */
.tracker {
  --near: #3fb950; --skip: #ff8800; --far: #6e7681; --live: #58a6ff;
}
:root[data-theme="light"] .tracker { --near: #1a7f37; --skip: #b35900; --far: #57606a; --live: #0969da; }
.tracker > p, #track-body > p { margin: 0; }
#track-head, #track-requires, #track-levels { padding: 2px 10px; }
#track-levels.other { color: var(--error); }
.tracker .count { padding: 2px 10px; font-weight: 700; font-size: 12.5px; }
/* Live's bar keeps its size from poll to poll (its dot, line and the ask's "…"), so the map under it never moves */
#track-status { font-family: var(--mono); display: inline-block; width: 1.5em; height: 1.2em; vertical-align: top;
                overflow: hidden; }
#track-endpoints { flex: 1 1 10rem; width: 10rem; max-width: 18rem; }
#track-dot { font-size: 11px; display: inline-block; width: 1.2em; text-align: center; }
#track-dot.live { color: var(--near); } #track-dot.warn, #track-dot.lost { color: var(--air); }
#track-dot.other { color: var(--error); }
/* Live's bar (the app's) is one item of the tracker's row, the room left its own: Live's line (its whole text its
   tip) and the endpoints' box take what its controls leave, the line up to 32rem, so at 1100 px with Attach… shown
   the row is one line; the bar wraps whole only where its controls and the box at 10rem don't fit (Step 4.64b). The
   line and the box count nothing of their words to that, so a poll's new text never moves the map. */
#track-live-bar { display: inline-flex; flex: 1 1 0; align-items: center; gap: 4px; white-space: nowrap; }
#track-line { flex: 2 1 0; width: 0; max-width: 32rem; overflow: hidden; text-overflow: ellipsis; }
/* A Live pickup (Step 4.3 live tracker): its spot flashes on the map (mapview.mjs), its rows and the Got count
   flash, and "Got: <item> · <level>" shows a few seconds, over the bar (it moves nothing); reduced motion: a plain
   highlight, no animation */
#track-body { position: relative; }
.got-line { position: absolute; z-index: 3; top: 2px; right: 10px; margin: 0; padding: 3px 10px; border-radius: 4px;
            font-weight: 700; color: var(--on); background: var(--live); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
            animation: track-got 4s ease-out both; pointer-events: none; }
@keyframes track-got { 0% { opacity: 0; transform: translateY(-4px); } 8%, 80% { opacity: 1; transform: none; }
                       100% { opacity: 0; } }
@keyframes track-fresh { 0%, 55% { background-color: rgba(88, 166, 255, 0.45); } 100% { background-color: transparent; } }
.tracker .fresh { animation: track-fresh 2.6s ease-out both; }
#track-count .got { display: inline-block; }
@keyframes track-bump { 0% { transform: none; } 25% { transform: scale(1.3); color: var(--live); } 100% { transform: none; } }
#track-count .got.fresh { animation: track-bump 0.9s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .got-line { animation: none; }
  .tracker .fresh { animation: none; background-color: rgba(88, 166, 255, 0.35); }
  #track-count .got.fresh { animation: none; background-color: transparent; color: var(--live); }
}
.world {
  display: grid; grid-template-columns: repeat(6, minmax(5.5rem, 9rem)); grid-auto-rows: 3.4rem; gap: 6px;
  padding: 6px 10px 10px;
}
.world .cell {
  position: relative; height: auto; display: grid; align-content: center; justify-items: start; gap: 2px;
  padding: 4px 8px; text-align: left; background: var(--field); border-radius: 4px; color: var(--muted);
}
.world .cell.reached { color: var(--text); border-color: var(--far); }
.world .cell.here { box-shadow: 0 0 0 2px var(--live); }
.world .cell b { font: 700 12px var(--mono); }
.world .cell .tally { font: 10.5px var(--mono); color: var(--muted); }
.world .badge {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  font: 700 10.5px/18px var(--mono); text-align: center; color: var(--text); background: var(--soft);
}
.world .badge:empty { display: none; }
.world .badge.near { color: #fff; background: var(--near); } .world .badge.skip { color: #fff; background: var(--skip); }
.level { padding: 0 10px 10px; }
.level .rando-row { padding: 4px 0; }
.level .you { color: var(--live); font-weight: 700; }
.level h4 { margin: 6px 0 3px; font-size: 11px; color: var(--muted); font-weight: 600; }
.level .spots { display: flex; flex-wrap: wrap; gap: 4px; }
.level .spots h4 { flex-basis: 100%; }
.tracker .spot {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 3px; font: 11px var(--mono);
  color: var(--muted); background: var(--field); border: 1.5px solid var(--far); border-radius: 12px;
}
.tracker .spot.near { color: var(--text); border: 2.5px solid var(--near); }
.tracker .spot.skip { color: var(--text); border: 2.5px solid var(--skip); }
.tracker .spot.got, .tracker .spot.live { color: var(--text); border-color: var(--near); background: var(--sel); }
.tracker .spot .check { font-weight: 700; color: var(--near); }
.tracker .spot.live .check { color: var(--live); }
/* An item's icon: its tile of the icon sheet (art/icons.css, the game's own art, drawn by art/icons.py), in steps of --g;
   a spot not shown is a dot, so an icon never spoils a seed; the fire barrier, particles in the game, is our drawing. */
.glyph { --g: 18px; display: inline-block; width: var(--g); height: var(--g); flex: none; }
.glyph.dot { width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--far); }
.spot.near .glyph.dot { background: var(--near); } .spot.skip .glyph.dot { background: var(--skip); }
.glyph.fire_barrier { background: linear-gradient(to top, #b23a24, #f0883e); clip-path: polygon(50% 0, 85% 45%, 100% 100%, 0 100%, 15% 45%); }
/* The maps (Step 4.2c3): Modkit's map view, a column of its switches and key beside the map, which fills the rest of
   the window (web/mapview.mjs draws it on the canvas, over the pictures drawn from the player's image). */
.maps { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px; padding: 4px 10px 10px; }
.map-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.map-side > p { margin: 0; }
.map-switches, .map-floors { display: flex; flex-wrap: wrap; gap: 0 8px; }
.map-switches label { flex-basis: 100%; }
.map-floors > .note { flex-basis: 100%; }
.map-floors label { flex-basis: calc(25% - 8px); white-space: nowrap; }   /* a gem count never wraps its button */
.map-floors input { margin: 0; }   /* Chromium's radio margin: the button's text on its radio's middle */
.map-floors.gems label { flex-basis: calc(33% - 8px); }
.map-floors .left { display: inline-block; min-width: 14px; margin-left: 3px; padding: 0 3px; border-radius: 7px;
                    font-size: 10px; line-height: 14px; text-align: center; color: var(--on); background: var(--far); }
.map-key { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; color: var(--muted); font-size: 11px; }
.map-key span { display: flex; align-items: center; gap: 4px; min-width: 0; }
.map-key i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #1b1f24; position: relative; }
.map-key i.dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--c); }
.map-key i.ring::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; border: 2px solid var(--c); }
.map-room { position: relative; height: 480px; min-width: 0; overflow: hidden;
            background: #1b1f24; border: 1px solid var(--line); }
.map-room canvas { display: block; touch-action: none; }
.map-tip { position: absolute; z-index: 2; max-width: 260px; padding: 3px 4px; white-space: pre-wrap; pointer-events: none;
           font-size: 11.5px; color: #fff; background: #1b1f24; border: 1px solid #9aa0a6; }
#track-art.error { color: var(--error); }
.tables { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 6px 10px 10px; }
.tables table { border-collapse: collapse; font: 11px var(--mono); }
.tables th, .tables td { height: 20px; padding: 0 6px; border-bottom: 1px solid var(--soft); white-space: nowrap; }
/* the column heads stay in view under the tab's caption (27 px) as the Table scrolls */
.tables thead th { position: sticky; top: 27px; color: var(--muted); background: var(--bar); font-weight: 600; text-align: right; }
.tables thead th:first-child, .tables thead th.where, .tables tbody th { text-align: left; }
.tables tbody th { font-weight: 400; }
.tables tr.group th, .tables tr.sum th, .tables tr.sum td { font-weight: 700; }
.tables td { text-align: right; font-variant-numeric: tabular-nums; }
.tables td.where { text-align: left; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
#track-places tbody tr:hover { background: var(--hover); cursor: default; }

/* The Tools tab (tools.mjs): your image, its files (a filtered list), recipes and files, and AzurKit's storage, as
   dense rows; a text it shows (a spoiler, a report) in a box of its own. */
.tools { padding: 4px 10px 12px; background: var(--pane); }
.tools h2 { margin: 8px 0 2px; font-size: 12px; }
.tools p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 2px 0; }
.tools p.note { display: block; }
.tools input[type="text"], .tools input[type="search"] {
  height: 22px; padding: 0 6px; font: 11.5px var(--mono); color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: 3px;
}
#tools-open-path { width: 26rem; }
#tools-saves td input { width: 8rem; margin-right: 4px; }
#tools-filter { width: 16rem; }
.tools :is(input, button):disabled { color: var(--faint); background: transparent; border-style: dashed; }
.tools table { border-collapse: collapse; font: 11px var(--mono); }
.tools th, .tools td { height: 20px; padding: 0 8px 0 0; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--soft); }
.tools th { color: var(--muted); font-weight: 600; }
.tools td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
.tools td button { height: 18px; padding: 0 8px; font-size: 11px; }
#tools-files { max-height: 22rem; overflow: auto; }
.tools pre {
  margin: 4px 0; padding: 8px 10px; max-height: 24rem; overflow: auto; font: 11px/1.45 var(--mono); white-space: pre-wrap;
  color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 3px;
}

/* The Data tab (data.mjs): its views and edit buttons in one bar, the shared picker (picker.mjs) on the left and the
   chosen entity's blocks or a table's grid on the right, in dense mono rows: a changed cell tinted and marked ●, one
   a ticked pack's slider also writes ⚠, an empty one's default greyed, a refusal one red line, a cell's note under
   the view. */
.data { padding: 0 0 12px; background: var(--pane); }
.data-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; padding: 2px 10px;
  background: var(--bar); border-bottom: 1px solid var(--soft); }
.data-bar p.views { padding: 0; }
.data-bar button { height: 20px; padding: 0 8px; font-size: 11px; }
.data-bar button:disabled { color: var(--faint); background: transparent; border-style: dashed; }
.data-builds { margin: 0; padding: 2px 10px; }
.data-body { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); gap: 0 12px; padding: 0 10px; }
.data-body > .picker[hidden] + div { grid-column: 1 / -1; }
.data-view { overflow-x: auto; }
.data h3 { margin: 6px 0 2px; font-size: 11.5px; }
.data summary { color: var(--muted); font-size: 11.5px; cursor: default; }
.data table { border-collapse: collapse; margin: 2px 0 6px; font: 11px var(--mono); }
.data th, .data td { height: 20px; padding: 0 8px 0 0; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--soft); }
.data th { color: var(--muted); font-weight: 400; }
.data-grid tr:first-child th { position: sticky; top: 0; z-index: 1; background: var(--bar); font-weight: 600; }
.data td.cell { text-align: right; font-variant-numeric: tabular-nums; cursor: text; }
.data td.cell:hover { background: var(--hover); }
.data td.empty { color: var(--faint); font-style: italic; }
.data td.changed { color: var(--mark); font-weight: 600; }
.data td.read { color: var(--muted); }
.data td :is(input, select) { height: 18px; width: 8rem; font: 11px var(--mono); color: var(--text); background: var(--field);
  border: 1px solid var(--ring); border-radius: 2px; }
.data td button { height: 18px; margin-left: 4px; padding: 0 6px; font-size: 10.5px; }
.data td option:disabled { color: var(--faint); }
/* A word list's checklist (Step 4.24b, Modkit's Step 2.100): four words a row under the cell's text box, a word whose
   toggle needs a new string greyed, and the line saying so. */
.data td .data-words { display: grid; grid-template-columns: repeat(4, max-content); gap: 0 10px; margin: 2px 0;
  text-align: left; }
.data td .data-words input { width: auto; height: auto; margin: 0 3px 0 0; vertical-align: middle; }
.data td .data-words label.needs { color: var(--faint); font-style: italic; }
.data td .data-words .note { grid-column: 1 / -1; font-size: 10.5px; }
.data p.refused { margin: 0 0 6px; color: var(--error); font-size: 11.5px; }
.data-note { margin: 4px 0 0; white-space: pre-line; min-height: 2.7em; }
/* All files… (Step 4.6h): under the tables' list, every .xbr of the image, each row opening to its keyed tables; greyed
   with its line until an image is picked (D979). */
.data-files { margin: 4px 0 0; }
.data-files.waits > summary { color: var(--faint); }
.data-files > p.note { margin: 2px 0; }
.data-file-list .data-file { display: block; width: 100%; height: var(--row); padding: 0 6px; overflow: hidden;
  text-align: left; text-overflow: ellipsis; white-space: nowrap; border: 0; border-bottom: 1px solid var(--soft);
  border-radius: 0; background: transparent; font: 11.5px var(--mono); }
.picker .data-file-list .picker-entry { padding-left: 20px; }
.data-file-list p { margin: 0; padding: 1px 20px; font-size: 11px; }
/* The shared picker (picker.mjs): its search box and count, and its entries in their groups, the chosen one marked. */
.picker { min-width: 0; }
.picker-search { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; }
.picker-search input { flex: 1 1 0; min-width: 0; height: 22px; padding: 0 6px; font: 11.5px var(--mono); color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: 3px; }
.picker-list { max-height: 30rem; overflow: auto; border: 1px solid var(--soft); }
.picker-group { position: sticky; top: 0; margin: 0; padding: 3px 6px 1px; font-size: 10.5px; font-weight: 600;
  color: var(--muted); background: var(--bar); }
.picker .picker-entry { display: block; width: 100%; height: var(--row); padding: 0 6px; overflow: hidden; text-align: left;
  text-overflow: ellipsis; white-space: nowrap; border: 0; border-bottom: 1px solid var(--soft); border-radius: 0;
  background: transparent; font: 11.5px var(--mono); }
.picker .picker-entry[aria-selected="true"] { background: var(--sel); box-shadow: inset 3px 0 var(--accent); }
.picker .picker-entry img { width: 20px; height: 20px; margin-right: 6px; vertical-align: middle; }

/* The About tab: a readable column. */
.about { padding: 10px 16px 24px; background: var(--pane); font-size: 12.5px; line-height: 1.5; }
.about > * { max-width: 46rem; }
.about h2 { margin-bottom: 8px; }
.about h3 { margin: 16px 0 4px; font-size: 12px; }
.about p, .about ul { margin: 0 0 8px; }
.about ul { padding-left: 18px; }
.about li { margin-bottom: 6px; }
.about a { color: var(--accent); }
.about summary { color: var(--accent); cursor: default; }
.about details { margin-bottom: 4px; }
.about details ul { margin-top: 6px; }
.about pre {
  margin: 6px 0 0; padding: 8px 10px; font: 11px/1.45 var(--mono); white-space: pre-wrap; color: var(--muted);
  background: var(--field); border: 1px solid var(--line); border-radius: 3px;
}
#about-version { font: 11.5px var(--mono); color: var(--muted); }

/* A narrow window: one column, the page scrolls with the build bar kept at its foot, and an open pack's settings
   sit under its row. */
@media (max-width: 760px) {
  body { display: block; height: auto; }
  header { flex-wrap: wrap; padding: 4px 10px; }
  .tagline { flex-basis: 100%; order: 9; white-space: normal; }
  main > section { overflow: visible; }
  .build { position: sticky; bottom: 0; z-index: 3; }
  .packs { background: var(--pane); }
  .packs > .note, #packs .group { width: auto; }
  #packs .pack { flex-wrap: wrap; }
  #packs .pack.open > .sliders { position: static; flex-basis: 100%; }
  #packs .sliders::before { display: none; }
  .rando-cols { grid-template-columns: minmax(0, 1fr); }
  .world { grid-template-columns: repeat(3, minmax(5rem, 1fr)); }
  .world .cell { grid-column: auto !important; grid-row: auto !important; }
}

/* The Characters tab (Step 4.3d): the models' list (every species in its grade's colour, the untested greyed, then the
   community group under it beside Content from, D1035, then yours; each group a fold, Step 4.21), the chosen one's
   pictures and info, and its options with a G4 button beside each number. */
/* The list gives way first: the pictures keep their 2 x 160 px and the options a number row with its G4 button;
   narrower, the options go under the list and the pictures, then all three in one column. */
.chars-cols { display: grid; grid-template-columns: minmax(0, 20rem) minmax(20.5rem, 22rem) minmax(22rem, 1fr);
  gap: 0 16px; padding: 0 10px; }
@media (max-width: 980px) {
  .chars-cols { grid-template-columns: minmax(0, 20rem) minmax(20.5rem, 1fr); }
  .chars-options { grid-column: 1 / -1; }
}
@media (max-width: 760px) { .chars-cols { grid-template-columns: minmax(0, 1fr); } }
.chars h3 { margin: 6px 0 2px; font-size: 11.5px; }
.chars h3 .note { font-weight: 400; margin-left: 6px; }
/* The search box, one place and size in the Models and Variants views: the list's width, at its left edge. */
#char-filter, #var-filter { flex: 1 1 100%; min-width: 0; }
.chars-list > .rando-row:first-child { padding: 3px 0; }
.chars-list .field, #char-source { flex: 1 1 0; min-width: 0; }   /* Content from fills its row, Reset beside it */
#char-species { max-height: 24rem; overflow: auto; border: 1px solid var(--soft); }
.chars-list > .fold { margin-top: 4px; }
.chars .model { display: block; width: 100%; height: var(--row); padding: 0 6px; text-align: left; border: 0;
  border-bottom: 1px solid var(--soft); border-radius: 0; background: transparent; font: 11.5px var(--mono); }
.chars .model:nth-child(even) { background: var(--zebra); }
.chars .model[aria-selected="true"] { background: var(--sel); box-shadow: inset 3px 0 var(--accent); }
/* Each grade read without colour too: a mark of its own after the model's name (index.html's legend names each), in
   the Variants view's New dialog too (outside the tab: asked from any). */
.chars .model[data-grade="green"]::after, #var-ask .picker-entry[data-grade="green"]::after { content: " \2713"; }
.chars .model[data-grade="yellow"]::after, #var-ask .picker-entry[data-grade="yellow"]::after { content: " ~"; }
.chars .model[data-grade="red"]::after, #var-ask .picker-entry[data-grade="red"]::after { content: " \2715"; }
.chars .model[data-grade="unseen"]::after, #var-ask .picker-entry[data-grade="unseen"]::after { content: " ?"; }
/* The grades' colours (the engine's, picker.STATUS_COLOURS) as drawn, at least 4.5:1 on every row's ground, the chosen
   row's too: the light theme's Modkit's (AZ-545) a shade darker, the dark theme's red and grey a shade lighter. */
.chars, #var-ask { --grade-red: #f47067; --grade-unseen: #999999; }
:root[data-theme="light"] .chars, :root[data-theme="light"] #var-ask { --grade-green: #2a722e; --grade-yellow: #895b00;
  --grade-red: #c02727; --grade-unseen: #646464; }
.chars .entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px;
  padding: 2px 4px; border-bottom: 1px solid var(--soft); }
.chars .entry .community { font-size: 10px; color: var(--mark); text-transform: uppercase; letter-spacing: .05em; }
.chars .entry .what { font-size: 11px; color: var(--muted); grid-column: 1 / -1; }
.chars .entry .model { grid-column: 1 / -1; }
.chars .previews { display: flex; gap: 4px; margin: 6px 0 0; position: relative; width: max-content; }
.chars .previews[data-preview]::after { content: "Preview"; position: absolute; top: 2px; left: 2px; padding: 0 4px;
  font-size: 11px; border-radius: 3px; color: #fff; background: rgb(0 0 0 / 0.65); }
.chars canvas, .weapon-popup img { width: 160px; height: 160px; background: var(--field); border: 1px solid var(--soft); }
.weapon-popup { inset: auto; z-index: 5; width: 340px; margin: 0 10px; padding: 0 0 4px; color: inherit;
  background: var(--pane); border: 1px solid var(--ring); }
.weapon-popup .rando-row { justify-content: space-between; padding: 2px 6px; }
.weapon-popup .previews { margin: 0; padding: 0 6px; }
.weapon-popup .note { margin: 4px 6px 0; }
/* Play's one question (the app's: web/play.mjs): attach to the xemu running, which xemu, or where it is */
.xemu-ask { max-width: 480px; padding: 8px 12px; color: inherit; background: var(--pane); border: 1px solid var(--ring); }
.xemu-ask p { margin: 4px 0; }
.xemu-ask #xemu-ask-path { width: 100%; }
#char-info { border-collapse: collapse; font-size: 11.5px; }
#char-info th { padding: 1px 8px 1px 0; text-align: left; color: var(--muted); font-weight: 400; vertical-align: top;
  white-space: nowrap; }
#char-info td { padding: 1px 0; }
.chars .number { display: grid; grid-template-columns: 8rem minmax(6rem, 12rem) 4.5rem auto auto; align-items: center;
  justify-content: start; gap: 0 6px; min-height: var(--row); }
.chars .number input[type="text"] { width: 100%; text-align: right; }
.chars .number input.changed { font-weight: 700; color: var(--accent); border-color: var(--ring); }
.chars .number .g4 { height: 18px; padding: 0 5px; font: 700 10px var(--mono); }
.chars input[type="range"] { width: 100%; accent-color: var(--accent); }


/* The Characters tab's Variants view (Step 4.6c): the list, the pictures with the status line, and the editor's rows. */
.var-cols .chars-list .picker-list { max-height: 26rem; }
.chars .model.refused { color: var(--muted); font-style: italic; }
#var-legend { margin: 0 0 3px; }
#var-as { width: 7rem; }   /* the file's row (New… to Delete, Save among them) on one line at 1280 px */
#var-import-path { flex: 1 1 0; min-width: 0; }
.var-cols #var-name { margin: 6px 0 2px; }
#var-status, #var-check-note, #var-picture-note { margin: 2px 0; }
#var-status.warn { padding: 0; }
.var-cols .rando-row { padding: 3px 0; }
.var-cols p.views { padding: 4px 0 2px; }
.var-notes .field { flex: 1 1 auto; align-items: flex-start; }
#var-notes, #var-text { width: 100%; box-sizing: border-box; padding: 4px 6px; font: 11.5px var(--mono); color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: 3px; resize: vertical; }
#var-notes { min-width: 18rem; }
#var-text { min-height: 16rem; white-space: pre; }
#var-json-note.warn { padding: 0; color: var(--mark); }
/* Its Moves and Attacks tabs (Step 4.6f): a picker per slot or column, as many columns of rows as the width holds. */
.var-picks { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: flex-start; }
.var-pick-group h4 { margin: 4px 0 2px; font-size: 11.5px; }
.var-pick-row { display: flex; align-items: center; gap: 6px; margin: 1px 0; }
.var-pick-label { min-width: 6.5rem; }
.var-pick { width: 11rem; height: 20px; padding: 0 6px; overflow: hidden; text-align: left; white-space: nowrap;
  text-overflow: ellipsis; }
#var-weapon { width: auto; min-width: 11rem; }   /* its pick shown whole, as Modkit's fit_shown widens the box */
.var-columns { columns: 3 17rem; column-gap: 18px; }
.var-columns .var-pick-row { break-inside: avoid; }
.var-columns .var-pick-label { min-width: 5.5rem; }
#var-kit .field, .var-made .field { gap: 4px; }
#var-moves-entry, #var-kit-note, #var-made-note { margin: 2px 0; color: var(--mark); }
#var-menu { position: fixed; top: 12%; left: 50%; width: 22rem; margin: 0; transform: translateX(-50%); }
#var-menu .var-menu-list { max-height: 60vh; overflow: auto; padding: 0 6px; }
#var-menu .var-menu-entry { display: block; width: 100%; height: 20px; padding: 0 6px; text-align: left; border: 0;
  background: transparent; }
#var-menu .var-menu-entry:hover { background: var(--sel); }
#var-menu details > :not(summary) { margin-left: 12px; }
#var-menu summary { cursor: pointer; padding: 1px 0; }
#var-menu hr { border: 0; border-top: 1px solid var(--soft); margin: 2px 0; }
#var-menu .var-menu-check { display: block; padding: 1px 0; }
/* Its Sounds and Effects tabs (Step 4.6g): the roles' rows two across where they fit, the effects rows with their
   params, the menus (a summary that opens a list) and the swatches. */
#var-sounds .note, #var-effects .note { margin: 3px 0; }
#var-sounds .warn, #var-effects .warn { padding: 0; }
.var-wavs { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1px 18px; }
.var-wav { display: flex; align-items: center; gap: 6px; min-height: var(--row); }
.var-wav-role { min-width: 5.5rem; }
.var-wav-files { min-width: 9rem; }
.var-wav-files.none { color: var(--muted); }
.var-cols .drop { height: 18px; padding: 0 5px; }
#var-sfx-line input[type="text"], .var-fx-param input[type="text"] { width: 3.5rem; text-align: right; }
#var-sfx-line input:read-only { color: var(--muted); background: transparent; border-style: dashed; }
.var-fx-row { padding: 4px 0 2px; border-top: 1px solid var(--line); }
.var-fx-row .var-fx-bytes { margin: 0 0 0 auto; }
.var-fx-params { display: flex; flex-wrap: wrap; gap: 1px 18px; padding: 0 0 0 12px; }
.var-fx-param { display: inline-flex; align-items: center; gap: 4px; }
.var-fx-label { min-width: 5.5rem; }
.var-fx-param input[type="range"] { width: 70px; accent-color: var(--accent); }
.var-menu { position: relative; display: inline-block; }
.var-menu > summary { padding: 0 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--pane);
  cursor: default; list-style: none; white-space: nowrap; }
.var-menu > summary::-webkit-details-marker { display: none; }
.var-menu > summary::after { content: " \25BE"; }
.var-menu > .var-menu-list { position: absolute; z-index: 5; display: flex; flex-direction: column; align-items: stretch;
  min-width: 10rem; max-height: 18rem; overflow-y: auto; padding: 3px; background: var(--pane);
  border: 1px solid var(--line); border-radius: 3px; }
.var-menu > .var-menu-list button { text-align: left; white-space: nowrap; }
.var-menu > .var-menu-list hr { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--line); }
.var-cols .swatch { width: 22px; height: 16px; padding: 0; border: 1px solid var(--text); }
.var-picker { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.var-fx-edits { border-collapse: collapse; font-size: 11.5px; }
.var-fx-edits th { padding: 1px 12px 1px 0; text-align: left; color: var(--muted); font-weight: 400; }
.var-fx-edits td { padding: 1px 12px 1px 0; }
#var-ask { position: fixed; top: 18%; left: 50%; width: 22rem; margin: 0; transform: translateX(-50%); }
#var-ask .picker-list { max-height: 18rem; }
#var-ask .note { margin: 6px; }
/* Its Shape and Jiggle tabs (Step 4.6d): a slider a shape, its mesh's ops; a row a spring, each number a box. */
#var-shape-note, #var-jiggle-note, #var-ops-title { margin: 4px 0; }
#var-shapes .number { padding: 1px 0; }
.var-ops, .var-springs { max-height: 12rem; overflow: auto; border: 1px solid var(--soft); width: max-content;
  max-width: 100%; }
.var-springs { max-height: 20rem; }
#var-ops, #var-springs-table { border-collapse: collapse; font: 11px var(--mono); }
#var-ops th, #var-springs-table th { position: sticky; top: 0; padding: 1px 8px 1px 4px; color: var(--muted);
  background: var(--bar); font-weight: 600; text-align: left; }
#var-ops td, #var-springs-table td { padding: 1px 8px 1px 4px; border-bottom: 1px solid var(--soft); white-space: nowrap; }
#var-springs-table input { width: 4.5rem; text-align: right; }
#var-springs-table button { height: 18px; padding: 0 5px; }
#var-spring-line .field { display: inline-flex; align-items: center; gap: 4px; }
#var-jiggle-entry { margin: 2px 0; color: var(--mark); }
#var-jiggle-entry:empty { display: none; }
/* Its Colours tab (Step 4.6e): the controls, the wheel beside its boxes, then the views, under them where narrow. */
.var-colours { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: flex-start; }
.var-colours canvas { width: auto; height: auto; }
.var-colours .views { padding: 0; }
.var-colours .views button[aria-pressed="true"] { color: var(--on); background: var(--accent); border-color: var(--accent); }
.var-wheel { display: flex; gap: 10px; align-items: flex-start; padding: 3px 0; }
.var-wheel input[type="range"] { display: block; width: 131px; accent-color: var(--accent); }
.var-colours canvas.wheel, #var-pick canvas.wheel { border: 0; background: transparent; cursor: crosshair; touch-action: none; }
canvas.wheel.off { cursor: default; opacity: .35; }
.var-boxes { display: grid; grid-template-columns: auto 5.5rem auto; gap: 3px 6px; align-items: center; }
.var-boxes input[type="text"] { width: 100%; }
.var-boxes .note { grid-column: 1 / -1; margin: 0; max-width: 12rem; }
.var-colours .warn, #var-pick .warn { color: var(--mark); }
#var-window input { width: 3.5rem; }
.var-swatch { display: inline-block; width: 18px; height: 18px; padding: 0; vertical-align: middle;
  border: 1px solid var(--line); border-radius: 2px; }
.var-swatch.small { width: 12px; height: 12px; }
#var-palette { display: inline-flex; gap: 3px; }
.var-swap { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; }
.var-drop { height: 16px; padding: 0 4px; font-size: 10px; }
.var-tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.var-tile { display: inline-flex; flex-direction: column; align-items: center; height: auto; padding: 1px;
  font: 11px var(--mono); border: 2px solid transparent; background: transparent; }
.var-tile[aria-pressed="true"] { border-color: var(--ring); }
.var-colour-views .previews canvas { background: var(--field); border: 1px solid var(--soft); }
#var-colour-caption { margin: 2px 0; max-width: 20rem; }
#var-pick { position: fixed; top: 18%; left: 50%; width: 20rem; margin: 0; padding: 6px; transform: translateX(-50%); }
#var-pick .note { margin: 0 0 4px; }
#var-pick .rando-row { padding: 2px 0; }
#var-pick .var-pick-side .rando-row { justify-content: flex-start; gap: 4px 8px; }
#var-pick .var-pick-side input[type="range"] { width: 7rem; accent-color: var(--accent); }
#var-pick-hex { width: 6rem; }
