/* ==========================================================================
   theme.css - the site's design system (v1).
   Colors, spacing and shared components. New pages build on these; older pages
   are moved over one at a time. Keep page-specific styles in the page's own CSS.
   ========================================================================== */

:root {
  /* surfaces (the site's teal palette) */
  /* (Oct 2026 aesthetic pass: a darker page so cards stand apart; was #1f4249 / #285963 / #31707c / #1a373d) */
  --bg:            #17343b;   /* page background */
  --surface:       #245561;   /* cards, nav bar */
  --surface-2:     #2f6b78;   /* raised / hover, secondary buttons */
  --surface-sunken:#152e35;   /* inputs, wells */
  /* the page background: a soft cyan glow from the top over a gentle light-to-dark fall (fixed to the window) */
  --bg-gradient:   radial-gradient(1200px 520px at 50% -120px, rgba(0, 191, 255, .09), transparent 70%),
                   linear-gradient(180deg, #1c3d45 0%, #17343b 45%, #12292f 100%);
  --border:        rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.24);

  /* text */
  --text:          #ffffff;
  --text-muted:    rgba(255, 255, 255, 0.68);
  --text-faint:    rgba(255, 255, 255, 0.45);

  /* accents */
  --accent:        #00bfff;
  --accent-hover:  #40d0ff;
  --accent-text:   #062a33;
  --ok:            #6fdc8c;
  --warn:          #ffc857;
  --danger:        #ff6b6b;

  /* platforms */
  --twitch:        #9146ff;
  --kick:          #53fc18;
  --youtube:       #ff0000;
  --joystick:      #0affff;

  /* shape + type */
  --radius:        10px;
  --radius-sm:     6px;
  --radius-pill:   999px;
  --shadow:        0 4px 16px rgba(0, 0, 0, 0.3);
  --font:          "Noto Sans", system-ui, sans-serif;
  --font-mono:     "Fira Code", "Cascadia Code", ui-monospace, monospace;

  /* layout */
  --content-width: 1400px;
  --gutter:        16px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
}

/* ---------- layout ---------- */
[hidden] { display: none !important; }   /* the hidden attribute always wins over display rules */
.container {
  width: min(var(--content-width), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  box-sizing: border-box;
}
.stack   { display: flex; flex-direction: column; gap: var(--space-3); }
.row     { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.spacer  { flex: 1; }
.muted   { color: var(--text-muted); }
.faint   { color: var(--text-faint); }
.small   { font-size: 13px; }

/* ---------- card ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--border);   /* a hairline edge, so cards stand apart from the page */
  color: var(--text);
  font-family: var(--font);
  box-sizing: border-box;
}
.card-pad   { padding: var(--space-4); }
.card h2, .card h3 { margin: 0 0 var(--space-3); font-weight: 600; }
.card h3 { font-size: 15px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.divider { border: 0; border-top: 1px solid var(--border); margin: var(--space-4) 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 8px 14px;
  border: 0; border-radius: var(--radius-sm); box-sizing: border-box;   /* a full-width link button fits its box too */
  background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);   /* secondary buttons stay visible on cards */
  font: 600 14px/1.2 var(--font);
  cursor: pointer; text-decoration: none;
  transition: background .12s, filter .12s;
}
.btn:hover    { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-primary  { background: var(--accent); color: var(--accent-text); box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); filter: none; }
.btn-ghost    { background: transparent; color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--border); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); color: var(--text); filter: none; }
.btn-danger   { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.btn-sm       { padding: 5px 10px; font-size: 13px; }
.btn-twitch   { background: var(--twitch); color: #fff; box-shadow: none; }
.btn-kick     { background: var(--kick); color: #0b2a00; box-shadow: none; }
.btn img      { width: 18px; height: 18px; object-fit: contain; }
/* a platform's logo on its own colour: drawn in the button's text colour so it shows */
.btn-twitch img { filter: brightness(0) invert(1); }
.btn-kick img   { filter: brightness(0); }
.btn-youtube    { background: var(--youtube); color: #fff; box-shadow: none; }
.btn-youtube img { filter: brightness(0) invert(1); }
.btn-joystick   { background: #1d2b30; color: var(--joystick); border: 1px solid var(--joystick); box-shadow: none; }

/* ---------- form fields ---------- */
.field        { display: flex; flex-direction: column; gap: 6px; font: 14px var(--font); }
.field > span { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.input, .select {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px;
  background: var(--surface-sunken); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: 14px var(--font);
}
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* a box that doesn't apply right now: greyed, its field's name too */
.input:disabled, .select:disabled { opacity: .45; cursor: not-allowed; }
.field:has(> .input:disabled, > .select:disabled) > span { opacity: .5; }
.input-with-icon { position: relative; }
.input-with-icon > img { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); }
.input-with-icon > .input { padding-left: 34px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 40px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; }

/* toggle switch: <label class="switch"><input type="checkbox"><span></span> Text</label> */
/* position: relative keeps the hidden checkbox inside the switch; otherwise it is placed against
   the page, and clicking a switch in a scrolled panel scrolls the whole page to that spot */
.switch { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; font: 14px var(--font); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span {
  position: relative; width: 36px; height: 20px; flex-shrink: 0;
  background: var(--surface-sunken); border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  transition: background .15s;
}
.switch > span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  background: var(--text-muted); border-radius: 50%; transition: transform .15s, background .15s;
}
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:has(input:disabled) { opacity: .5; cursor: not-allowed; }

/* segmented radio: <div class="segmented"><label><input type="radio" name=x><span>A</span></label>…</div> */
.segmented { display: inline-flex; background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
/* inside a column .field it would stretch to the full width; keep it as wide as its options */
.field > .segmented { align-self: flex-start; }
.segmented label { position: relative; }   /* same reason as .switch */
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 5px 10px; border-radius: 4px; font: 600 13px var(--font); color: var(--text-muted); cursor: pointer; }
.segmented input:checked + span { background: var(--surface-2); color: var(--text); }
.segmented input:disabled + span { opacity: .4; cursor: not-allowed; }

/* ---------- status pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .08); color: var(--text-muted);
  font: 600 12px var(--font); white-space: nowrap;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.pill img     { width: 14px; height: 14px; }
.pill-ok::before   { background: var(--ok); }
.pill-warn::before { background: var(--warn); }
.pill-bad::before  { background: var(--danger); }
.pill-bad          { color: var(--danger); }

/* ---------- secret links (overlay / dock / contestant links): blurred until revealed, never shown on stream ---------- */
.secret-link {
  display: flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px;
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.secret-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 12px var(--font-mono); color: var(--text-muted);
  filter: blur(5px); user-select: none; transition: filter .15s;
}
.secret-text.shown { filter: none; user-select: all; color: var(--text); }
.secret-warn { margin: 0; font: 12px/1.45 var(--font); color: var(--warn); }
.secret-warn::before { content: "⚠ "; }
/* ---------- suggestions under a text box (UI.suggest) ---------- */
.ui-suggest-wrap { position: relative; display: flex; flex: 1; min-width: 0; }
.ui-suggest-wrap > .input { flex: 1; min-width: 0; }
.ui-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 320px; overflow-y: auto; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.ui-suggest-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.ui-suggest-item:hover, .ui-suggest-item.on { background: rgba(255, 255, 255, .08); }

/* ---------- the connect prompt (js/connect.js): which services, and what that asks the platform for ---------- */
.cp-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: var(--space-4) var(--space-5); color: var(--text); font-family: var(--font); }
.cp-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.cp-dialog h2 { margin: 0 0 4px; font: 700 20px var(--font); }
.cp-services { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) 0; }
.cp-service { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunken); }
.cp-service.on { border-color: var(--accent); }
.cp-head { display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
.cp-head input { align-self: center; }
.cp-what { margin: 4px 0 0 26px; padding-left: 16px; font-size: 13px; color: var(--text-muted); }
.cp-sub { margin: 6px 0 0 26px; font-size: 13px; }
.cp-asks { padding: 10px 12px; border-radius: var(--radius); background: rgba(0, 191, 255, .08); border: 1px solid rgba(0, 191, 255, .3); font-size: 14px; }
.cp-asks ul { margin: 6px 0 0; padding-left: 20px; }
.cp-agree { margin: var(--space-3) 0 0; font-size: 12px; color: var(--text-faint); }   /* agreeing to the terms (YouTube asks for it) */
.cp-agree a { color: var(--text-muted); }
.cp-btns { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-3); }

/* ---------- stepper ---------- */
/* a number with − / + either side (the counter's counts, game scores): .stepper > .btn.stepper-btn, .input.stepper-val, .btn.stepper-btn */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper-btn { width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; flex-shrink: 0; }
.stepper-val { width: 62px; text-align: center; font: 700 17px var(--font); -moz-appearance: textfield; }
.stepper-val::-webkit-inner-spin-button, .stepper-val::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* UI.stepper(attrs, { small: true }): the compact one for lists and grids */
.stepper.sm { gap: 3px; }

/* ---------- chips ---------- */
/* a name in a list you can take off: <button class="chip" ...>name<span class="chip-x">×</span></button>; the whole chip is the button */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 10px; border: 0; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text); font: 13px var(--font); cursor: pointer; }
.chip-x { color: var(--text-muted); font-size: 15px; line-height: 1; }
.chip:hover, .chip:focus-visible { background: rgba(255, 107, 107, .2); }
.chip:hover .chip-x, .chip:focus-visible .chip-x { color: var(--danger); }
.stepper.sm .stepper-btn { width: 28px; height: 28px; font-size: 17px; }
.stepper.sm .stepper-val { width: 58px; height: 28px; padding: 2px 4px; font-size: 14px; }

/* ---------- toast ---------- */
.ds-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); box-shadow: var(--shadow);
  font: 14px var(--font); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1000;
}
.ds-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ds-toast.bad  { background: #5a2530; }
.ds-toast.show.has-action { pointer-events: auto; }   /* a toast with a button (e.g. Undo) */
.toast-action { margin-left: 10px; padding: 2px 8px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: transparent; color: var(--accent); font: 600 13px var(--font); cursor: pointer; }
.toast-action:hover, .toast-action:focus-visible { background: var(--accent); color: var(--on-accent, #001018); outline: none; }

/* not on an OBS overlay (body.overlay-page) or an overlay's preview inside a page (.overlay-preview): that motion is
   for the stream's viewers, chosen by the streamer */
@media (prefers-reduced-motion: reduce) {
  body:not(.overlay-page) :not(.overlay-preview, .overlay-preview *),
  body:not(.overlay-page) :not(.overlay-preview *)::before, body:not(.overlay-page) :not(.overlay-preview *)::after { transition: none !important; animation: none !important; }
}

/* "My sounds" / "My pictures" (js/library.js): a dialog over the page */
.library-btn:hover, .library-btn:focus-visible { color: var(--accent); background: none; }
.lib-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0, 0, 0, .55); }
.lib-dialog { width: min(640px, 100%); max-height: min(720px, calc(100vh - 32px)); display: flex; flex-direction: column; box-sizing: border-box;
  padding: var(--space-4); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--border-strong);
  font: 14px/1.4 var(--font); color: var(--text); }
.lib-head { display: flex; align-items: center; gap: 10px; }
.lib-head h3 { margin: 0; font: 700 18px var(--font); }
.lib-spacer { flex: 1; }
.lib-upload[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.lib-note { margin: 6px 0 var(--space-3); }
.lib-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.lib-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-sunken); }
.lib-row.on, .lib-card.on { box-shadow: inset 0 0 0 1px var(--accent); }
.lib-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px var(--font); }
.lib-rename { flex: 1; min-width: 0; padding: 4px 8px; }
.lib-size { flex: none; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.lib-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-sunken); min-width: 0; }
.lib-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 4px; background: repeating-conic-gradient(#2a2d36 0 25%, #1d2027 0 50%) 0 0 / 14px 14px; }
.lib-card-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.lib-empty { margin: var(--space-4) 0; text-align: center; }

/* Expandable sections: a ">" on the left that turns to point down when open, the same everywhere.
   <details><summary> get it on their own; a custom toggle puts <span class="chev" aria-hidden="true"></span> first
   inside the element that has aria-expanded. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before, .chev {
  content: ''; display: inline-block; flex: none; box-sizing: border-box; width: .5em; height: .5em; margin: 0 .55em 0 .15em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: .7;
  vertical-align: .12em; transform: rotate(-45deg); transition: transform .15s ease;
}
details[open] > summary::before, [aria-expanded="true"] > .chev { transform: translateY(-.12em) rotate(45deg); }

/* drag to reorder (js/sortable.js): the same in every tool */
.sort-row { cursor: grab; }
body.sorting, body.sorting * { cursor: grabbing !important; user-select: none; }
.dragging { opacity: .45; }
.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.drop-after { box-shadow: 0 3px 0 var(--accent); }
.sort-x > .drop-before { box-shadow: -3px 0 0 var(--accent); }   /* side by side (Sortable axis 'x') */
.sort-x > .drop-after { box-shadow: 3px 0 0 var(--accent); }
.drop-swap { box-shadow: 0 0 0 2px var(--accent); }   /* trading places (Sortable swap) */
.drag-grip { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 26px; border-radius: 4px; color: var(--text-faint); cursor: grab; }
.drag-grip:hover, .drag-grip:focus-visible { color: var(--text); background: var(--surface-2); outline: none; }

/* ---- tool pages (Counter, Wheel, Brackets, and the next ones): one layout, one list ---- */
.tool-gate { text-align: center; padding: var(--space-6) var(--space-4); }
.tool-gate p { color: var(--text-muted); margin: 0 0 var(--space-4); }
/* ---------- a page with a live preview: it fits the window ---------- */
/* On a wide screen the page itself doesn't scroll: its header and the preview stay put, and the settings scroll on
   their own. <body class="fit-page">, then: .fit-fill a box that fills the height left (its children in a column),
   .fit-grid the columns (one row: the height left), .fit-scroll a column that scrolls, .fit-static one that stays.
   Narrower, where the columns stack: an ordinary page. (The wheel page does the same its own way: wheel.css.) */
@media (min-width: 1101px) {
  body.fit-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; margin-block: 0; padding-block: 8px; }
  body.fit-page > main:not([hidden]) { flex: 1 1 auto; min-height: 0; margin-bottom: 0; padding-bottom: var(--space-4); }
  body.fit-page .fit-fill:not([hidden]) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  body.fit-page .fit-fill > * { flex-shrink: 0; }
  body.fit-page .fit-fill > .segmented { align-self: flex-start; }
  body.fit-page .fit-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  body.fit-page .fit-scroll { align-self: start; min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
  body.fit-page .fit-static { align-self: start; position: static; max-height: 100%; overflow-y: auto; }
}

.tool-page { display: grid; grid-template-columns: 230px 1fr; gap: var(--space-4); align-items: start; margin-bottom: var(--space-5); }
@media (max-width: 820px) { .tool-page { grid-template-columns: 1fr; } }
.tool-side { padding: var(--space-3); }
.tool-side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.tool-side-head .btn { white-space: nowrap; flex-shrink: 0; }
.tool-side h3 { margin: 0; }
.tool-list { display: flex; flex-direction: column; gap: 4px; }
.tool-off-note { width: 100%; box-sizing: border-box; margin: 0 0 var(--space-2); padding: 6px 10px; border-radius: var(--radius-sm);
  background: rgba(255, 154, 60, .12); color: #ffb36b; font-size: 13px; }
/* a row in the list: [on/off switch] the item [lock] */
.li-row { position: relative; display: flex; align-items: center; border-radius: var(--radius-sm); }
.li-item {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 8px 34px 8px 10px; text-align: left; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text); font: 14px var(--font);
}
.li-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-item span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-item:hover { background: var(--surface-sunken); }
.li-item.on { background: var(--surface-sunken); border-color: var(--accent); }
.li-on { position: absolute; left: 8px; top: 50%; transform: translateY(-50%) scale(.8); transform-origin: left center; z-index: 1; }
.li-on ~ .li-item { padding-left: 50px; }
.li-row.off .li-item b { color: var(--text-muted); }
/* the lock: grey = mods can change it, green = locked (mods can only view it); the eye beside it (the streamer
   only): grey = mods can see it, green = hidden from mods */
.li-lock { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-faint); opacity: .55; }
.li-hide { position: absolute; right: 32px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-faint); opacity: .55; cursor: pointer; }
.li-hide:hover, .li-hide:focus-visible { opacity: 1; background: var(--surface-2); color: var(--text); }
.li-hide.on, .li-hide.on:hover { color: var(--ok); opacity: 1; }
.li-row:has(.li-hide) .li-item { padding-right: 60px; }   /* room for the eye and the lock */
button.li-lock { cursor: pointer; }
button.li-lock:hover, button.li-lock:focus-visible { opacity: 1; background: var(--surface-2); color: var(--text); }
.li-lock.on, button.li-lock.on:hover { color: var(--ok); opacity: 1; }

/* small square icon buttons, and the "Remove?" they turn into (UI.askFirst) */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-muted); cursor: pointer; flex-shrink: 0; font-size: 14px; }
.icon-btn:hover, .icon-btn:focus-visible { background: var(--surface-sunken); color: var(--text); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover, .icon-btn.danger:focus-visible { background: rgba(255, 107, 107, .14); }
label.icon-btn { cursor: pointer; }   /* e.g. the upload button (UI.uploadButton) */
/* the upload button looks the same on every page: just the icon, cyan on hover (no background block) */
.icon-btn.upload-btn, .icon-btn.upload-btn:hover, .icon-btn.upload-btn:focus-visible { background: none; }
.icon-btn.upload-btn:hover, .icon-btn.upload-btn:focus-visible { color: var(--accent); }
/* a picture / sound field (UI.mediaField): [preview] [link box] [upload] [Remove] on one line, centred */
.media-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.media-field .media-link { flex: 1; min-width: 120px; }
.media-field .media-link.lib-named::placeholder { color: var(--text); opacity: 1; }   /* a library file's name (library.js) */
.media-thumb { flex: none; width: 34px; height: 34px; border-radius: 6px; overflow: hidden; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border); }
.media-thumb.wide { width: 60px; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-field .media-remove { flex: none; }
.icon-btn.confirm { width: auto; padding: 0 8px; font: 600 12px var(--font); background: rgba(255, 107, 107, .16); }
/* a button that looks like a link */
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: 12px var(--font); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
