/* OASIS client UI: one design system for every space (notes/reports/ui.md, docs/design/zone-style.md
   "The HUD"). A friendly console-menu look: soft white panels with rounded corners and a gentle
   vertical gradient, glossy pill buttons, light bevels and soft drop shadows, a clean rounded
   sans-serif. The space lends one accent colour, --space (js/theme.js; orange by default), used
   as a glossy fill on what the space says (the banner, the centre card, the active button).
   The client's own developer voice (the F3 overlay, the log) stays monospace. */

@font-face { font-family: 'Share Tech Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('vendor/fonts/share-tech-mono@5.3.0/share-tech-mono-latin-400-normal.woff2') format('woff2'); }
/* kept for the debug labels' canvases (labels.js, ?labels=1) */
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url('vendor/fonts/barlow-condensed@5.3.0/barlow-condensed-latin-700-normal.woff2') format('woff2'); }

:root {
  /* colour: panels (light, glossy) */
  --ink: #2c333d;                     /* text on panels */
  --ink-dim: #6a7380;
  --glass-top: rgba(255, 255, 255, 0.96);
  --glass-bot: rgba(222, 228, 235, 0.94);
  --panel: linear-gradient(var(--glass-top), var(--glass-bot));
  --rim: rgba(255, 255, 255, 0.9);    /* the light border round every panel */
  --line: rgba(110, 122, 138, 0.28);  /* hairlines inside panels */
  --well: rgba(40, 50, 62, 0.12);     /* recessed tracks and fields */
  /* colour: the world side (text straight on the 3D view, the start screen) */
  --void: #e9edf1;
  --paper: #ffffff;
  --paper-dim: rgba(255, 255, 255, 0.82);
  --plate: rgba(20, 26, 34, 0.55);    /* small dark capsules (the log) */
  --plate-hi: rgba(20, 26, 34, 0.82); /* the F3 overlay */
  --rule: rgba(110, 122, 138, 0.28);
  --phosphor: #8fe39a;                /* the developer voice (F3, log) */
  --phosphor-dim: rgba(143, 227, 154, 0.6);
  --signal: #f2a33a;                  /* orange: the default accent */
  --ok: #3fb25a;
  --err: #e5483c;
  /* colour: the space (js/theme.js sets these on the HUD root) */
  --space: var(--signal);
  --space-ink: #2a1a05;
  --gloss: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18) 48%, rgba(255, 255, 255, 0) 52%);
  /* depth */
  --bevel: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -2px 0 rgba(30, 45, 60, 0.08);
  --lift: 0 4px 12px rgba(16, 26, 40, 0.28), 0 1px 2px rgba(16, 26, 40, 0.22);
  --press: inset 0 2px 5px rgba(16, 26, 40, 0.3);
  /* shape */
  --r-s: 8px; --r-m: 14px; --r-l: 22px; --pill: 999px;
  /* type */
  --font-ui: 'Nunito', 'Varela Round', 'Quicksand', ui-rounded, 'SF Pro Rounded', 'Segoe UI', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-display: var(--font-ui);
  --font-mono: 'Share Tech Mono', ui-monospace, monospace;
  --t-xs: 11px; --t-s: 13px; --t-m: 16px; --t-l: 22px; --t-xl: 32px; --t-xxl: 56px;
  /* space (4 px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 40px;
  --edge: 14px;                       /* inset of everything from the screen edge */
  --bar: 3px;
  /* motion: soft */
  --fast: 120ms; --med: 260ms; --slow: 600ms;
  --snap: cubic-bezier(0.34, 1.4, 0.64, 1); /* in: a small, springy overshoot */
  --fade: cubic-bezier(0.4, 0, 1, 1);       /* out */
}

/* the accent as a glossy fill: lighter at the top, a soft highlight on the upper half. Declared
   where theme.js sets --space (the HUD roots), so each picks up its own space's colour */
:root, .hud, .pb-hud { --accent-fill: linear-gradient(color-mix(in srgb, var(--space) 62%, white), var(--space) 58%, color-mix(in srgb, var(--space) 82%, black)); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--void); color: var(--ink); font: var(--t-s)/1.35 var(--font-ui); }
#view { position: fixed; inset: 0; }
#view canvas { display: block; }
::selection { background: var(--space); color: var(--space-ink); }

/* ---------------------------------------------------------------- shared atoms */
/* a panel: soft white gradient, a light rim, a bevel and a soft shadow */
.panel { background: var(--panel); border: 1px solid var(--rim); border-radius: var(--r-m); box-shadow: var(--bevel), var(--lift); color: var(--ink); }

/* buttons: glossy pills that press in */
button { position: relative; font: 700 var(--t-m)/1 var(--font-ui); letter-spacing: 0.01em;
  padding: var(--s2) var(--s5); border: 1px solid rgba(150, 160, 172, 0.55); border-radius: var(--pill);
  background: var(--gloss), linear-gradient(#ffffff, #e3e8ee); color: var(--ink); cursor: pointer;
  box-shadow: var(--bevel), 0 2px 0 rgba(120, 132, 146, 0.45), var(--lift);
  transition: background var(--fast) linear, color var(--fast) linear, border-color var(--fast) linear, transform 60ms linear, box-shadow 60ms linear; }
button:hover, button:focus-visible { background: var(--gloss), var(--accent-fill); color: var(--space-ink); border-color: color-mix(in srgb, var(--space) 70%, black); outline: none; }
button:active { transform: translateY(2px); box-shadow: var(--press); }
button.secondary { color: var(--ink-dim); }

/* ---------------------------------------------------------------- start screen (a menu) */
#start { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: var(--s4);
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0 2px, transparent 2px 6px), linear-gradient(#f6f8fa, #d9e0e7); }
#start form { position: relative; width: min(440px, 100%); display: grid; gap: var(--s4); padding: var(--s5); border-radius: var(--r-l);
  background: var(--panel); border: 1px solid var(--rim); box-shadow: var(--bevel), 0 10px 30px rgba(16, 26, 40, 0.18), 0 1px 3px rgba(16, 26, 40, 0.2);
  animation: boot var(--slow) var(--snap) both; }
#start h1 { justify-self: start; margin: 0; padding: var(--s1) var(--s5); border-radius: var(--pill); background: var(--gloss), var(--accent-fill); color: var(--space-ink);
  font: 800 var(--t-xl)/1.2 var(--font-ui); letter-spacing: 0.04em; box-shadow: var(--bevel), var(--lift); }
#start .sub { margin: calc(-1 * var(--s2)) 0 var(--s1); color: var(--ink-dim); font-size: var(--t-s); }
#start label { display: grid; gap: var(--s1); color: var(--ink-dim); font-size: var(--t-s); font-weight: 700; }
#start input { font: var(--t-m) var(--font-ui); padding: var(--s2) var(--s3); border: 1px solid rgba(150, 160, 172, 0.55); border-radius: var(--r-s);
  background: linear-gradient(#eef2f5, #ffffff); box-shadow: inset 0 2px 3px rgba(16, 26, 40, 0.12); color: var(--ink); caret-color: var(--space); }
#start input:focus { outline: none; border-color: var(--space); box-shadow: inset 0 2px 3px rgba(16, 26, 40, 0.12), 0 0 0 3px color-mix(in srgb, var(--space) 35%, transparent); }
.buttons { display: flex; gap: var(--s2); margin-top: var(--s2); }
.buttons button { flex: 1; padding: var(--s3) var(--s4); }
#start button[type=submit] { background: var(--gloss), var(--accent-fill); border-color: color-mix(in srgb, var(--space) 70%, black); color: var(--space-ink); }
#start button[type=submit]:hover { filter: brightness(1.06); }
#start-error { color: var(--err); min-height: 1em; margin: 0; font-size: var(--t-s); font-weight: 700; }
.hint { font-size: var(--t-xs); color: var(--ink-dim); margin: 0; }
.hint code { font: inherit; font-family: var(--font-mono); color: var(--ink); }

/* ---------------------------------------------------------------- client log (the dock, bottom left) */
#log { position: fixed; left: var(--edge); bottom: calc(var(--edge) + 28px); z-index: 5; pointer-events: none; max-width: min(640px, calc(100vw - 2 * var(--edge)));
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font: var(--t-xs)/1.5 var(--font-mono); color: var(--phosphor); }
#log:empty { display: none; }
#log div { padding: 0 var(--s2); border-radius: var(--r-s); background: var(--plate); overflow-wrap: anywhere; opacity: 0.85; }

/* ---------------------------------------------------------------- HUD */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
/* §14 origin: a small pill with the space's colour as a glossy dot */
.origin { position: absolute; top: var(--edge); left: var(--edge); display: flex; align-items: center; gap: var(--s2); max-width: calc(50vw - var(--edge));
  padding: 3px var(--s3) 3px 5px; border-radius: var(--pill); background: var(--panel); border: 1px solid var(--rim); box-shadow: var(--bevel), var(--lift);
  font: 600 var(--t-xs)/1.3 var(--font-ui); color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.origin::before { content: ''; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--gloss), var(--accent-fill); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }

.anchor { position: absolute; display: flex; flex-direction: column; gap: var(--s2); align-items: center; font-size: var(--t-m); }
/* a ui.text's `size` is an em multiplier of its anchor's base size */
.anchor-top { top: var(--edge); left: 50%; transform: translateX(-50%); }
.anchor-center { top: 40%; left: 50%; transform: translate(-50%, -50%); font-size: var(--t-l); }
.anchor-bottom { bottom: var(--s6); left: 50%; transform: translateX(-50%); }
.anchor-top-left { top: calc(var(--edge) + 34px); left: var(--edge); align-items: flex-start; }
.anchor-top-right { top: var(--edge); right: var(--edge); align-items: flex-end; }
.anchor-bottom-left { bottom: var(--s6); left: var(--edge); align-items: flex-start; }
.anchor-bottom-right { bottom: calc(var(--s6) + 26px); right: var(--edge); align-items: flex-end; }

/* bound text: a soft white panel */
.ui-text { padding: var(--s1) var(--s4); border-radius: var(--r-m); background: var(--panel); border: 1px solid var(--rim); box-shadow: var(--bevel), var(--lift); color: var(--ink);
  font: 700 1em/1.3 var(--font-ui); white-space: pre; } /* authored text keeps its case: "s", "g" are units */
/* the top banner: a glossy pill in the space's colour, and its sub-lines as plain panels */
.anchor-top .ui-text:first-child { padding: var(--s1) var(--s5); border-radius: var(--pill); background: var(--gloss), var(--accent-fill); color: var(--space-ink);
  border-color: color-mix(in srgb, var(--space) 70%, black); font-weight: 800; }
.anchor-top .ui-text + .ui-text { padding: 2px var(--s3); border-radius: var(--pill); font: 600 0.8em/1.4 var(--font-ui); color: var(--ink-dim); }
/* side panels (scores): an accent stripe down the left, inside the rounded panel */
.anchor-top-left .ui-text, .anchor-bottom-left .ui-text, .anchor-top-right .ui-text { padding-left: calc(var(--s3) + 6px);
  background: linear-gradient(90deg, var(--space) 0 5px, transparent 5px), var(--panel); font-weight: 700; }
.ui-panel-title { font-weight: 800; color: var(--ink); }
.ui-list > div + div { border-top: 1px solid var(--line); }
/* the centre: a big glossy card in the space's colour */
.anchor-center .ui-text { padding: var(--s2) var(--s5); border-radius: var(--r-l); background: var(--gloss), var(--accent-fill); color: var(--space-ink);
  border: 2px solid rgba(255, 255, 255, 0.85); font: 800 1em/1.1 var(--font-ui); animation: card var(--med) var(--snap) both; }
.ui-button { pointer-events: auto; min-width: 180px; }
.ui-image { border-radius: var(--r-m); box-shadow: var(--lift); }

/* bars and boost: a recessed rounded track with a glossy fill */
.ui-bar-track { border-radius: var(--pill); background: var(--well); box-shadow: inset 0 1px 3px rgba(16, 26, 40, 0.3); overflow: hidden; }
.ui-bar-label { font-weight: 700; }
.boost { position: absolute; right: var(--edge); bottom: var(--edge); width: 220px; height: 22px; border-radius: var(--pill);
  background: var(--panel); border: 1px solid var(--rim); box-shadow: var(--lift); }
.boost::before { content: ''; position: absolute; inset: 3px; border-radius: var(--pill); background: var(--well); box-shadow: inset 0 1px 3px rgba(16, 26, 40, 0.3); }
.boost-fill { position: absolute; inset: 3px auto 3px 3px; max-width: calc(100% - 6px); border-radius: var(--pill); background: var(--gloss), var(--accent-fill); }
.boost span { position: absolute; right: calc(100% + var(--s2)); top: 0; font: 800 var(--t-xs)/22px var(--font-ui); letter-spacing: 0.06em; white-space: nowrap; color: var(--paper); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }

/* toasts: white pills with a coloured dot that pop in */
.toasts { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--s2); align-items: center; }
.toast { --tone: var(--space); display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s4) var(--s1) var(--s3); border-radius: var(--pill);
  background: var(--panel); border: 1px solid var(--rim); box-shadow: var(--bevel), var(--lift); color: var(--ink);
  font: 700 var(--t-s)/1.5 var(--font-ui); white-space: nowrap; animation: pop var(--med) var(--snap) both, out var(--med) var(--fade) 2.7s forwards; }
.toast::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--gloss), var(--tone); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.toast.err { --tone: var(--err); color: #9b2219; }
.toast.ok { --tone: var(--ok); }
.toast.team { padding: var(--s1) var(--s5); background: var(--gloss), linear-gradient(color-mix(in srgb, var(--tone) 62%, white), var(--tone) 58%, color-mix(in srgb, var(--tone) 82%, black));
  color: var(--space-ink); font: 800 var(--t-l)/1.3 var(--font-ui); }
.toast.team::before { display: none; }

/* F3: the debug overlay (the developer's voice: monospace, dark glass) */
.debug { position: absolute; top: calc(var(--edge) + 34px); left: var(--edge); margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r-m);
  background: var(--plate-hi); color: var(--phosphor); box-shadow: var(--lift); font: var(--t-xs)/1.5 var(--font-mono); white-space: pre; }

/* the bottom-left dock (ui.js): the client log, bottom-left widgets, the systems line and the
   key help in one column, bottom up, so none of them can overlap another */
.dock { position: absolute; left: var(--edge); bottom: var(--edge); display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1);
  max-width: min(640px, calc(100vw - 2 * var(--edge))); }
.dock > .anchor, .dock > #log { position: static; }
.sys-hud { padding: 2px var(--s2); border-radius: var(--r-s); background: var(--plate); color: var(--paper); font: var(--t-xs)/1.45 var(--font-mono); white-space: pre; }
/* key help (the dock's last line): a small translucent pill */
.help { padding: 3px var(--s3); border-radius: var(--r-m); background: rgba(255, 255, 255, 0.78); border: 1px solid var(--rim); box-shadow: var(--lift);
  font: 600 var(--t-xs)/1.3 var(--font-ui); color: var(--ink); }
.help:empty { display: none; }

/* first-person crosshair (fpcam.js): a soft white ring round an accent dot */
.fp-crosshair { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; z-index: 5; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92); background: radial-gradient(circle, var(--signal) 0 2.5px, rgba(255, 255, 255, 0.95) 3px 3.5px, transparent 4px);
  box-shadow: 0 0 0 1px rgba(16, 26, 40, 0.35), inset 0 0 0 1px rgba(16, 26, 40, 0.25), 0 1px 3px rgba(0, 0, 0, 0.35); }

/* full-screen state (main.js: disconnected) */
.disconnected { position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%); z-index: 1000; padding: var(--s3) var(--s5); border-radius: var(--r-l);
  background: var(--gloss), linear-gradient(#f0776c, var(--err) 58%, #b8342a); border: 2px solid rgba(255, 255, 255, 0.85); color: #fff; box-shadow: var(--lift);
  font: 800 var(--t-xl)/1.15 var(--font-ui); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); text-align: center;
  max-width: calc(100vw - 2 * var(--s4)); animation: card var(--med) var(--snap) both; }
.disconnected small { display: block; padding-top: var(--s1); font: 600 var(--t-s)/1.4 var(--font-ui); }

/* ---------------------------------------------------------------- controls (remap.js, touchpad.js) */
/* the remap panel: a big rounded menu panel */
.remap { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 8; width: min(560px, calc(100vw - 2 * var(--edge)));
  max-height: calc(100vh - 2 * var(--s6)); overflow: auto; display: grid; gap: var(--s3); padding: var(--s4) var(--s5) var(--s5); border-radius: var(--r-l);
  background: var(--panel); border: 2px solid var(--rim); color: var(--ink); box-shadow: var(--bevel), 0 10px 30px rgba(16, 26, 40, 0.3), 0 1px 3px rgba(16, 26, 40, 0.25);
  animation: boot-c var(--med) var(--snap) both; }
.remap-head { display: flex; align-items: center; gap: var(--s3); }
.remap-title { padding: var(--s1) var(--s4); border-radius: var(--pill); background: var(--gloss), var(--accent-fill); color: var(--space-ink); font: 800 var(--t-l)/1.2 var(--font-ui);
  box-shadow: var(--bevel), var(--lift); }
.remap-space { color: var(--ink-dim); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remap-tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--pill); background: var(--well); box-shadow: inset 0 1px 3px rgba(16, 26, 40, 0.2); }
.remap-tabs button { flex: 1; padding: var(--s1) var(--s2); font-size: var(--t-s); box-shadow: none; border-color: transparent; background: transparent; }
.remap-tabs button.on { background: var(--gloss), var(--accent-fill); color: var(--space-ink); box-shadow: var(--bevel), 0 1px 3px rgba(16, 26, 40, 0.3); }
.remap-rows { display: grid; gap: 0; }
.remap-row { display: grid; grid-template-columns: minmax(8em, 1fr) 2fr; align-items: center; gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.remap-name { font: 800 var(--t-m)/1.15 var(--font-ui); }
.remap-kind { margin-left: var(--s2); font: 600 var(--t-xs) var(--font-ui); color: var(--ink-dim); }
.remap-chips { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.remap-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px var(--s3); border-radius: var(--pill); border: 1px solid rgba(150, 160, 172, 0.5);
  background: linear-gradient(#ffffff, #e9edf2); box-shadow: var(--bevel), 0 1px 2px rgba(16, 26, 40, 0.18); color: var(--ink); font: 700 var(--t-s) var(--font-ui); }
.remap-chips button { padding: 3px var(--s2); font: 700 var(--t-s)/1 var(--font-ui); box-shadow: none; border-color: transparent; background: transparent; color: var(--ink-dim); }
.remap-chips button:hover, .remap-chips button:focus-visible { background: var(--gloss), var(--accent-fill); color: var(--space-ink); }
.remap-add { border: 1px dashed rgba(150, 160, 172, 0.8) !important; }
.remap-default { color: color-mix(in srgb, var(--signal) 70%, black) !important; }
.remap-status { min-height: 1.4em; color: var(--ink-dim); font-size: var(--t-s); }
.remap .buttons { margin-top: 0; }
.remap-done { background: var(--gloss), var(--accent-fill); border-color: color-mix(in srgb, var(--space) 70%, black); color: var(--space-ink); }

/* touch: a recessed ring with a domed knob, glossy round buttons (under the HUD) */
.touchpad { position: fixed; inset: 0; z-index: 3; touch-action: none; user-select: none; -webkit-user-select: none; }
.touch-stick { position: absolute; width: 116px; height: 116px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.75); background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 3px 8px rgba(16, 26, 40, 0.35), 0 1px 3px rgba(16, 26, 40, 0.3); }
.touch-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.85) 0 12%, transparent 45%), var(--accent-fill);
  border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: var(--lift); }
.touch-buttons { position: absolute; right: var(--edge); bottom: 22%; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: var(--s2); }
.touch-button { min-width: 76px; padding: var(--s3) var(--s4); border-radius: var(--pill); background: var(--gloss), linear-gradient(#ffffff, #dfe5ec);
  border: 2px solid var(--rim); color: var(--ink); box-shadow: var(--bevel), 0 2px 0 rgba(120, 132, 146, 0.45), var(--lift);
  font: 800 var(--t-m)/1 var(--font-ui); text-align: center; }
.touch-button.local { padding: var(--s2) var(--s3); color: var(--ink-dim); font-size: var(--t-s); }
.touch-button.on { background: var(--gloss), var(--accent-fill); color: var(--space-ink); transform: translateY(2px); box-shadow: var(--press); }

@keyframes boot { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } }
@keyframes card { from { opacity: 0; transform: scale(0.8); } }
@keyframes out { to { opacity: 0; } }
.anchor-center .ui-text { transform-origin: center; }
@keyframes boot-c { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } } /* (the remap panel is centred by its transform) */

@media (max-width: 600px) {
  :root { --edge: 8px; --t-xxl: 40px; }
  .help { display: none; }
  .boost { width: 140px; }
  .anchor-top { top: calc(var(--edge) + 30px); }
  .anchor-top-left { top: calc(var(--edge) + 30px + var(--s6)); }
  #log { display: none; } /* developer chatter; F3 still has the state */
  .origin { max-width: calc(100vw - 2 * var(--edge)); }
}
/* UI entities (§19.2, js/uient.js): screen panels in the HUD's anchors; surface panels'
   accessible trees in the visually hidden mirror (focusable, read by screen readers) */
.ui-panel { pointer-events: auto; display: flex; flex-direction: column; gap: 0.3em; max-height: 60vh; overflow: auto; }
.ui-panel .ui-button { min-width: 0; padding: 0.3em 0.9em; border-radius: var(--r-m); border: 1px solid var(--rim); background: var(--accent-fill); color: var(--space-ink); font: 600 1em/1.3 var(--font-ui); cursor: pointer; display: inline-flex; gap: 0.3em; align-items: center; }
.ui-panel .ui-button.hover, .ui-panel .ui-button:hover { filter: brightness(1.15); }
.ui-panel .ui-button.pressed { transform: translateY(1px); filter: brightness(0.85); }
.ui-panel .ui-button.pending { opacity: 0.7; outline: 2px dashed var(--ink-dim); outline-offset: 1px; cursor: progress; }
.ui-panel .ui-button.err { outline: 2px solid #e05a5a; }
.ui-panel .ui-button:focus-visible, .ui-panel .ui-slider:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.ui-panel .ui-bar { position: relative; min-width: 8em; height: 1.1em; border-radius: 4px; background: var(--rim); overflow: hidden; }
.ui-panel .ui-bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-fill); }
.ui-panel .ui-bar-text { position: relative; padding: 0 0.4em; font-size: 0.85em; }
.ui-panel .ui-image { max-width: 8em; }
.ui-mirror, .ui-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ui-mirror .ui-panel { max-height: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .toast { animation: out 1ms linear 2.9s forwards !important; }
}
