/* The color themes. Light and dark mode each show the theme the user picked
   for it, named by data-palette on the root; palette.js lists them. Studio is
   the light default and Ember the dark one, so an unknown name falls back to
   them. A settings card wears data-palette too, to preview its theme. Later
   blocks win, so the named themes come after the two defaults. */
:root, [data-palette="studio"] {
  --board: #e9eaec;
  --board-raised: #fff;
  --board-line: #c8ccd1;
  --board-text: #1b1d20;
  --board-dim: #5f646b;
  --paper: #fff;
  --paper-raised: #fff;
  --paper-hover: #eceef0;
  --paper-line: #d8dbdf;
  --ink: #16181b;
  --ink-muted: #50555c;
  --ink-faint: #6a6f76;
  --staff: #9a9fa6;
  /* On a light window the stronger accent is the darker one. */
  --brass: #2f6fdb;
  --brass-bright: #1f56b8;
  --on-brass: #fff;
  --warn: #a86200;
  --mute: #c4402c;
  --good: #2a8547;
  --shadow: rgba(0, 0, 0, 0.18);
  --paper-scheme: light;
  color-scheme: light;
}

[data-theme="dark"], [data-palette="ember"] {
  --board: #121316;
  --board-raised: #1e2024;
  --board-line: #2d3036;
  --board-text: #e4e6ea;
  --board-dim: #8a8f98;
  --paper: #1a1c20;
  --paper-raised: #23262b;
  --paper-hover: #262a30;
  --paper-line: #353941;
  --ink: #e2e5ea;
  --ink-muted: #9aa0a9;
  --ink-faint: #6c727c;
  --staff: #4a4f58;
  --brass: #ff7a59;
  --brass-bright: #ff9a7e;
  --on-brass: #121316;
  --warn: #ff9a7e;
  --mute: #e05666;
  --good: #4fc27a;
  --shadow: rgba(0, 0, 0, 0.45);
  --paper-scheme: dark;
  color-scheme: dark;
}

/* The first light mode: a dark window around a light sheet. */
[data-palette="classic"] {
  --board: #1d1f22;
  --board-raised: #2a2d31;
  --board-line: #3a3e44;
  --board-text: #e6e8eb;
  --board-dim: #9399a1;
  --paper: #f5f5f2;
  --paper-raised: #fff;
  --paper-hover: #e8e8e4;
  --paper-line: #d2d3cf;
  --ink: #1a1c1f;
  --ink-muted: #5e636b;
  --ink-faint: #8a8f96;
  --staff: #a3a7ad;
  --brass: #e0a526;
  --brass-bright: #f2bd45;
  --on-brass: #1d1f22;
  --warn: #f2bd45;
  --mute: #d0604c;
  --good: #5fb878;
  --shadow: rgba(0, 0, 0, 0.45);
  --paper-scheme: light;
  color-scheme: dark;
}

/* Warm and printed: a cream sheet, sepia ink and fountain-pen blue. */
[data-palette="manuscript"] {
  --board: #e7e0d2;
  --board-raised: #f3eee4;
  --board-line: #cbbfa9;
  --board-text: #2b241b;
  --board-dim: #6e6353;
  --paper: #fbf7ee;
  --paper-raised: #fffdf8;
  --paper-hover: #f1ebdf;
  --paper-line: #ddd3c0;
  --ink: #2a2219;
  --ink-muted: #5a4f40;
  --ink-faint: #7a6e5c;
  --staff: #a99d88;
  --brass: #3550a8;
  --brass-bright: #263d8a;
  --on-brass: #fff;
  --warn: #9a5a00;
  --mute: #b23a2a;
  --good: #3d7a3a;
  --shadow: rgba(60, 40, 10, 0.2);
  --paper-scheme: light;
  color-scheme: light;
}

/* Studio's dark twin: cool grays and the blue accent. */
[data-palette="studio-dark"] {
  --board: #141619;
  --board-raised: #1f2226;
  --board-line: #30343a;
  --board-text: #e4e7eb;
  --board-dim: #8b919a;
  --paper: #1b1e22;
  --paper-raised: #24282d;
  --paper-hover: #272b31;
  --paper-line: #363b42;
  --ink: #e3e6ea;
  --ink-muted: #9ba1aa;
  --ink-faint: #767c86;
  --staff: #4b5059;
  --brass: #5b93f0;
  --brass-bright: #82adf5;
  --on-brass: #0d1117;
  --warn: #e0a526;
  --mute: #e05666;
  --good: #4fc27a;
  --shadow: rgba(0, 0, 0, 0.45);
  --paper-scheme: dark;
  color-scheme: dark;
}

/* True black, like the highway, for dim rooms and OLED screens. */
[data-palette="black"] {
  --board: #000;
  --board-raised: #121314;
  --board-line: #26282c;
  --board-text: #e8eaed;
  --board-dim: #8a8f98;
  --paper: #0a0a0b;
  --paper-raised: #161718;
  --paper-hover: #1a1b1d;
  --paper-line: #2a2c30;
  --ink: #eceef1;
  --ink-muted: #9aa0a9;
  --ink-faint: #6e747d;
  --staff: #3a3e45;
  --brass: #ff7a59;
  --brass-bright: #ff9a7e;
  --on-brass: #000;
  --warn: #e0a526;
  --mute: #ff4d6a;
  --good: #4fc27a;
  --shadow: rgba(0, 0, 0, 0.6);
  --paper-scheme: dark;
  color-scheme: dark;
}

/* Warm brown-black like amp tolex, cream ink and amber brass. */
[data-palette="amp"] {
  --board: #16130f;
  --board-raised: #221d17;
  --board-line: #362e24;
  --board-text: #efe6d6;
  --board-dim: #a39782;
  --paper: #1c1813;
  --paper-raised: #262019;
  --paper-hover: #2a231b;
  --paper-line: #3b3226;
  --ink: #f0e7d6;
  --ink-muted: #b3a690;
  --ink-faint: #857a68;
  --staff: #544a3c;
  --brass: #f2b33d;
  --brass-bright: #f7c867;
  --on-brass: #16130f;
  --warn: #f08a3c;
  --mute: #e0604f;
  --good: #7fbf6a;
  --shadow: rgba(0, 0, 0, 0.5);
  --paper-scheme: dark;
  color-scheme: dark;
}

:root {
  --wash: color-mix(in srgb, var(--brass) 14%, transparent);
  --font: "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

/* The sidebar width; dialogs and toasts center over the rest of the window.
   --side-pick is the width the player dragged it to, set on <html>; the rules
   below override --side-w where the sidebar is hidden, a rail or forced open. */
:root { --side-w: var(--side-pick, 252px); --rail-w: 44px; --chat-w: 0px; }

body {
  display: grid;
  /* The room chat's log, when open, takes a column right of the stage, so
     the tab lays out narrower instead of under it. */
  grid-template-columns: var(--side-w) 1fr var(--chat-w);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "side strip strip" "side stage chat" "transport transport transport";
  background: var(--board);
  color: var(--board-text);
  font: 14px/1.35 var(--font);
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}

button, input, output { font: inherit; color: inherit; }

button {
  background: var(--board-raised);
  border: 1px solid var(--board-line);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover { border-color: var(--board-dim); }
:focus-visible { outline: 2px solid var(--brass-bright); outline-offset: 2px; }

/* Sidebar: the song and its tracks. */
#side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--board-line);
}

#song { padding: 6px 10px 14px 18px; }
button.icon { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; flex: none; }
button.icon svg { width: 17px; height: 17px; fill: currentColor; }
/* The rows open and as icons: the toggle and Library at the top, Settings and
   Report a problem at the foot. Each icon sits in the middle of the rail's
   width, open or not, so it stays put when the sidebar collapses. */
#side-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px 0; }
.side-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  color: var(--board-dim);
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}
.side-row:hover { color: var(--board-text); background: var(--board-raised); border-color: transparent; }
.side-row svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.side-row svg.line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#side-toggle { width: 34px; }
/* No sidebar until a song is open; then it slides in. The grid snaps to its
   width at once, since the tab lays itself out again on every width. */
body:not(.loaded) { --side-w: 0px; }
body:not(.loaded) #side { display: none; }
body.loaded #side { animation: side-in 160ms ease-out; }
@keyframes side-in { from { transform: translateX(-24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body.loaded #side { animation: none; } }
/* Settings and Report a problem, quiet at the foot of the sidebar. */
#side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding: 8px 4px 10px; }

/* The player can collapse the sidebar to a rail of icons. The rig needs the
   whole sidebar, so it stays open while the rig is open; it has no toggle. */
body.loaded.side-rail:not(.rig) { --side-w: var(--rail-w); }
body.side-rail:not(.rig) :is(#song, #track-list) { display: none; }
body.side-rail:not(.rig) .side-row { justify-content: center; padding: 0; }
body.side-rail:not(.rig) .side-row span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body.rig #side-toggle, body.rig #library-open { display: none; }
/* Collapsing or opening slides the edge; player.js adds side-sliding for the
   length of the slide, so dragging the edge still follows the pointer. */
body.side-sliding { transition: grid-template-columns 180ms ease-out; }

/* The handle on the sidebar's right edge. It sits in the sidebar's cell of
   the grid, not in #side, which scrolls, and reaches over the border. */
#side-grip {
  grid-area: side;
  justify-self: end;
  position: relative;
  z-index: 3;
  width: 10px;
  margin-right: -5px;
  display: none;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
body.loaded:not(.rig) #side-grip { display: block; }
#side-grip::before { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background 120ms; }
#side-grip:hover::before, #side-grip.dragging::before, #side-grip:focus-visible::before { background: var(--brass); }
#side-grip.dragging::before { background: var(--brass-bright); }
/* While it is dragged the cursor keeps its shape over the whole page. */
body:has(#side-grip.dragging) { cursor: col-resize; }
body:has(#side-grip.dragging) * { cursor: inherit; }

#room h2, #update h2, .side-label {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--board-dim);
}

/* The mixer and the room in the transport. Both show with no song open: a
   room starts or is joined without one, and the mixer greys out what only a
   song can change. */
#mixer-open, #room-open { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; color: var(--board-dim); position: relative; white-space: nowrap; }
#mixer-open svg { width: 15px; height: 15px; fill: currentColor; }
#mixer-open:hover, body:has(#mixer[data-show="mixer"]:popover-open) #mixer-open, #room-open:hover, #room-open.in, body:has(#mixer[data-show="room"]:popover-open) #room-open { color: var(--board-text); }
/* The open panel's button wears the accent border, as Setup's does. */
body:has(#mixer[data-show="mixer"]:popover-open) #mixer-open, body:has(#mixer[data-show="room"]:popover-open) #room-open { border-color: var(--brass); }
/* In a room: a green light, the room, then its worst delay. */
#room-open.in::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
#room-open-delay { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
#room-open-delay[hidden] { display: none; }
#mixer-open.on::after, #setup-open.on::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass-bright);
}
:root { --panel-down: 180ms; --panel-up: 260ms; }
/* The mixer: a drawer over the bottom of the tab, on the transport, so
   opening it moves nothing. #drawer slides up out of the bar and back down
   into it. #mixer stays still and clips it at the top of the bar: the slide
   runs off the main thread, so a clip that moved with it fell out of step
   whenever the page was busy. */
#mixer, #setup, #takes {
  position: fixed;
  inset: auto 0 var(--transport-h, 57px) 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  display: none;
  background: none;
  border: none;
  clip-path: inset(-40px -40px 0 -40px);
  transition: display var(--panel-down) allow-discrete, overlay var(--panel-down) allow-discrete;
}
#mixer:popover-open, #setup:popover-open, #takes:popover-open { display: block; }
#drawer, #setup-panel, #takes-panel {
  display: flex;
  height: 330px;
  max-height: calc(100vh - var(--transport-h, 57px) - 40px);
  background: var(--board);
  color: var(--board-text);
  border-top: 1px solid var(--board-line);
  box-shadow: 0 -12px 36px var(--shadow);
  transform: translateY(100%);
  transition: transform var(--panel-down) cubic-bezier(0.4, 0, 1, 1);
}
/* A panel opened while another goes down waits --panel-wait for it to clear
   the bar, so the two never pass each other. */
#mixer:popover-open > #drawer, #setup:popover-open > #setup-panel, #takes:popover-open > #takes-panel {
  transform: none;
  transition: transform var(--panel-up) cubic-bezier(0.2, 0.8, 0.2, 1) var(--panel-wait, 0ms);
}
@starting-style {
  #mixer:popover-open > #drawer, #setup:popover-open > #setup-panel, #takes:popover-open > #takes-panel { transform: translateY(100%); }
}
@media (prefers-reduced-motion: reduce) { #mixer, #drawer, #setup, #setup-panel, #takes, #takes-panel { transition: none; } }
/* Opened from the room button, the drawer is the room panel alone: a card at
   the right to start or join, and the full width while in a room. */
#mixer[data-show="room"]:not(:has(#room-in:not([hidden]))) { left: auto; }
#mixer[data-show="room"] #drawer { height: auto; max-height: min(480px, calc(100vh - var(--transport-h, 57px) - 40px)); }
#mixer[data-show="room"]:not(:has(#room-in:not([hidden]))) #drawer { border-left: 1px solid var(--board-line); }
#mixer[data-show="room"] #room { border-left: none; }
#mixer[data-show="room"] #console, #mixer[data-show="mixer"] #room { display: none; }

/* A downloaded update, in the bottom corner until Later or Restart now. */
#update {
  position: fixed;
  inset: auto 16px 64px auto;
  width: 260px;
  margin: 0;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 10px;
  background: var(--board);
  color: var(--board-text);
  border: 1px solid var(--board-line);
  border-radius: 10px;
  box-shadow: 0 12px 36px var(--shadow);
}
#update:popover-open { display: flex; }
#update h2 { margin: 0; }
#update-version { margin: -4px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
#update-notes { margin: 0; padding-left: 18px; color: var(--board-dim); font-size: 13px; display: grid; gap: 2px; }
#update-notes[hidden], #diagnostics-room[hidden] { display: none; }
#update-on-quit { margin: 0; font-size: 13px; color: var(--board-dim); }
#diagnostics-room { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--board-dim); cursor: pointer; }
#diagnostics-room input { margin: 0; accent-color: var(--brass); }
.update-buttons { display: flex; justify-content: flex-end; gap: 6px; }
.update-buttons button:not(.primary) { background: transparent; border-color: transparent; color: var(--board-dim); }
.update-buttons button:not(.primary):hover { color: var(--board-text); }

/* The first launch after an update: the version it updated to and every
   change since the last one the player saw. The changelog adds each line's
   version. Centred on the window, unlike the dialogs over the song. */
#news { inset: 0; width: min(460px, calc(100vw - 32px)); padding: 0; }
#news-kind { margin: 0; padding: 22px 20px 0; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); }
#news h2 { margin: 4px 20px 2px; font-size: 20px; }
#news-since { margin: 0 20px; font-size: 12px; color: var(--board-dim); }
#news-list { margin: 10px 0 0; padding: 0 20px 12px; list-style: none; max-height: min(360px, calc(100vh - 240px)); overflow-y: auto; }
#news-list li { position: relative; padding: 7px 0 7px 18px; font-size: 13px; line-height: 1.45; }
#news-list li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }
#news-list .version { display: block; font-size: 11px; color: var(--board-dim); font-variant-numeric: tabular-nums; }
#news-list.all li { padding-left: 0; }
#news-list.all li::before { display: none; }
#news .dialog-buttons { margin: 0; padding: 14px 20px; border-top: 1px solid var(--board-line); }
#news-all { padding: 0; border: none; background: transparent; font-size: 12px; color: var(--board-dim); text-decoration: underline; }
#news-all:hover { color: var(--board-text); }

/* Covers the whole window, Settings included, while an update installs. */
#updating {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: var(--board);
  color: var(--board-text);
}
#updating:popover-open { display: flex; }
#updating h2 { margin: 0; font-size: 20px; font-variant-numeric: tabular-nums; }
#updating p { margin: 0; color: var(--board-dim); }

/* The license screen covers the app the same way. */
#license {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--board);
  color: var(--board-text);
}
#license:popover-open { display: flex; }
.license-card { width: min(420px, 100%); }
.license-card h2 { margin: 0 0 6px; font-size: 20px; }
#license-message { margin: 0 0 18px; color: var(--board-dim); font-size: 13px; line-height: 1.45; }
.license-card form[hidden] { display: none; }
.license-card input[type="text"] { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; }
.license-card form > p { margin: 0 0 12px; font-size: 13px; line-height: 1.45; }
#license-device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#license-device-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--board-line); border-radius: 8px; cursor: pointer; }
#license-device-list label:has(:checked) { border-color: var(--brass); background: var(--wash); }
#license-device-list input { margin: 0; accent-color: var(--brass); }
#license-device-list span { display: grid; gap: 2px; min-width: 0; }
#license-device-list b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#license-device-list small { font-size: 12px; color: var(--board-dim); }
#license-name { font-weight: 600; }
#license-key-shown.key { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.04em; }

#strip {
  grid-area: strip;
  display: none;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  height: 30px;
  padding: 3px 6px 0;
  background: var(--board);
  border-bottom: 1px solid var(--board-line);
}
body.loaded #strip { display: flex; }
#strip-tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#strip-tabs::-webkit-scrollbar { display: none; }
#strip .spacer { flex: 1; }
.song-tab {
  flex: 0 1 180px;
  min-width: 52px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 10px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--board-dim);
  cursor: default;
  touch-action: none;
}
.song-tab:hover { color: var(--board-text); background: var(--board-raised); }
.song-tab[aria-selected="true"] { color: var(--ink); background: var(--paper); border-color: var(--board-line); box-shadow: inset 0 2px 0 var(--brass); }
/* The room's songs, at the left after its label: the one on stage in the
   room's green, then the queue with its places, then a rule before yours. */
.strip-room { flex: none; align-self: center; padding: 0 4px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--good); }
.song-tab.stage { box-shadow: inset 0 2px 0 var(--good); }
.song-tab.stage[aria-selected="true"] { box-shadow: inset 0 2px 0 var(--good); }
.song-tab.stage .song-tab-name { padding-right: 6px; }
.song-tab.dragging { position: relative; z-index: 1; opacity: 0.85; }
.song-place { flex: none; min-width: 16px; height: 16px; padding: 0 3px; display: grid; place-items: center; margin-right: 4px; border-radius: 8px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--board); background: var(--board-dim); }
.song-tab[aria-selected="true"] .song-place { background: var(--ink); color: var(--paper); }
.song-tab.queued { padding-left: 6px; }
.strip-sep { flex: none; align-self: center; width: 1px; height: 18px; margin: 0 6px; background: var(--board-line); }
.song-tab-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: clip; font-size: 13px; }
.song-tab-close { flex: none; width: 18px; height: 18px; padding: 0; display: grid; place-items: center; border: none; background: transparent; border-radius: 4px; color: inherit; font-size: 14px; line-height: 1; visibility: hidden; }
.song-tab:hover .song-tab-close, .song-tab[aria-selected="true"] .song-tab-close { visibility: visible; }
.song-tab-close:hover { background: var(--board-line); }
#strip button.icon { width: 26px; height: 26px; align-self: center; color: var(--board-dim); background: transparent; border-color: transparent; }
#strip button.icon:hover { color: var(--board-text); border-color: var(--board-line); }
#strip button.icon svg { width: 14px; height: 14px; }
.tabs-full-list button { display: grid; gap: 1px; text-align: left; padding: 6px 10px; border-color: transparent; background: transparent; border-radius: 5px; min-width: 0; }
.tabs-full-list button:hover, .tabs-full-list button:focus-visible { background: var(--board-line); outline: none; }
.tabs-full-list b, .tabs-full-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs-full-list b { font-weight: 600; }
.tabs-full-list small { font-size: 12px; color: var(--board-dim); }
.tabs-full-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.tabs-full-list button { width: 100%; }

/* Up next: the room's songs in a column at the right of the sheet, opened
   from its button at the strip's end, which lights while songs wait. */
body.in-room #strip { display: flex; }
#up-next { flex: none; align-self: center; display: flex; align-items: center; gap: 6px; margin-left: 4px; padding: 2px 6px 2px 10px; font-size: 12px; color: var(--board-dim); background: transparent; border-color: var(--board-line); white-space: nowrap; }
#up-next[hidden] { display: none; }
#up-next:hover { color: var(--board-text); border-color: var(--board-dim); }
#up-next-count { min-width: 18px; padding: 0 5px; border-radius: 8px; text-align: center; font-weight: 600; color: var(--board); background: var(--board-dim); }
#up-next.some { color: var(--board-text); border-color: var(--brass); }
#up-next.some #up-next-count { background: var(--brass); }
#up-next[aria-pressed="true"] { color: var(--board-text); background: var(--board-raised); }
#up-next-panel { position: absolute; top: 8px; right: 8px; max-height: calc(100% - 16px); z-index: 4; width: min(340px, calc(100% - 16px)); display: flex; flex-direction: column; color: var(--board-text); background: var(--board); border: 1px solid var(--board-line); border-radius: 10px; box-shadow: 0 18px 48px var(--shadow); }
#up-next-panel[hidden] { display: none; }
#up-next-panel header { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 8px 14px; border-bottom: 1px solid var(--board-line); }
#up-next-panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
#up-next-panel button.icon { width: 26px; height: 26px; color: var(--board-dim); background: transparent; border-color: transparent; font-size: 15px; line-height: 1; }
#up-next-panel button.icon:hover { color: var(--board-text); border-color: var(--board-line); }
#up-next-list { list-style: none; margin: 0; padding: 6px; display: grid; align-content: start; gap: 2px; overflow-y: auto; min-height: 0; }
#up-next-list:empty { display: none; }
#up-next-list li { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 6px 6px 8px; border-radius: 6px; }
#up-next-list li:hover { background: var(--board-raised); }
#up-next-list li.stage { margin-bottom: 4px; background: var(--board-raised); box-shadow: inset 3px 0 0 var(--good); }
#up-next-list li.dragging { position: relative; z-index: 1; background: var(--board-raised); box-shadow: 0 4px 12px var(--shadow); }
#up-next-list .song-place { margin-right: 0; }
.up-next-on { flex: none; width: 16px; font-style: normal; font-size: 11px; text-align: center; color: var(--good); }
#up-next-list button.grip { width: 18px; cursor: grab; touch-action: none; font-size: 11px; letter-spacing: -2px; }
.up-next-text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.up-next-title { justify-self: start; max-width: 100%; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-align: left; background: none; border: none; border-radius: 0; }
button.up-next-title:hover { color: var(--brass-bright); text-decoration: underline; }
.up-next-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--board-dim); }
#up-next-empty { margin: 0; padding: 8px 14px 14px; }
#up-next-empty[hidden] { display: none; }
/* The foot: a search of the library that adds to the queue, and the way to
   the whole Library window. The songs it finds list under it. */
#up-next-add { flex: none; padding: 8px; border-top: 1px solid var(--board-line); }
#up-next-add[hidden] { display: none; }
.up-next-find { display: flex; gap: 6px; }
#up-next-search { flex: 1; }
#up-next-library { flex: none; padding: 4px 10px; font-size: 12px; color: var(--board-dim); background: transparent; white-space: nowrap; }
#up-next-library:hover { color: var(--board-text); }
#up-next-hits { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 1px; max-height: 210px; overflow-y: auto; }
#up-next-hits[hidden] { display: none; }
#up-next-hits li[role="option"] { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
#up-next-hits li[role="option"]:hover { background: var(--board-raised); }
#up-next-hits li[aria-selected="true"] { background: var(--board-raised); box-shadow: inset 2px 0 0 var(--brass); }
#up-next-hits li.in-room { cursor: default; }
.up-next-hit-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-next-hit-text b { font-weight: 600; }
.up-next-hit-text small { font-size: 12px; color: var(--board-dim); }
#up-next-hits .room-stage, #up-next-hits .room-queued, .up-next-hit-add { flex: none; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--good); }
.up-next-hit-add { padding: 1px 7px; border: 1px solid var(--good); border-radius: 5px; opacity: 0.55; }
#up-next-hits li[aria-selected="true"] .up-next-hit-add { opacity: 1; }
.up-next-nomatch { padding: 8px; font-size: 12.5px; color: var(--board-dim); }
.up-next-nomatch button.link { padding: 0; border: none; background: none; color: var(--brass); font-size: inherit; }
.up-next-nomatch button.link:hover { text-decoration: underline; }
#up-next-add-hint { margin: 6px 2px 0; font-size: 11px; }
#up-next-add-hint[hidden] { display: none; }

/* The right-click menu over the tab. */
#bar-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 4px;
  min-width: 160px;
  flex-direction: column;
  background: var(--board);
  color: var(--board-text);
  border: 1px solid var(--board-line);
  border-radius: 8px;
  box-shadow: 0 12px 36px var(--shadow);
}
#bar-menu:popover-open { display: flex; }
#bar-menu button { text-align: left; padding: 6px 10px; border-color: transparent; background: transparent; border-radius: 5px; }
#bar-menu button:hover, #bar-menu button:focus-visible { background: var(--board-line); outline: none; }

/* A track's colors, under its swatch. */
#color-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 8px;
  flex-direction: column;
  gap: 6px;
  background: var(--board);
  color: var(--board-text);
  border: 1px solid var(--board-line);
  border-radius: 8px;
  box-shadow: 0 12px 36px var(--shadow);
}
#color-menu:popover-open { display: flex; }

/* A track's options, which slide open under its row and push the rows below
   down. The row and the panel read as one card while it is open. */
.track-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 180ms ease;
}
.track-panel.open { grid-template-rows: 1fr; }
.track-panel .clip { min-height: 0; overflow: hidden; }
.track-panel .body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -2px 0 4px;
  padding: 12px 8px 4px 10px;
  border-radius: 0 0 8px 8px;
  background: color-mix(in srgb, var(--board-text) 4%, transparent);
}
.track.menu-open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.track-panel .toggles { display: flex; gap: 6px; }
.track-panel .toggles button { flex: 1; height: 28px; padding: 0; font-size: 12px; font-weight: 700; border-radius: 6px; }
.track-panel .show[aria-pressed="true"] { color: var(--brass-bright); border-color: var(--brass); }
.track-panel .show[aria-pressed="true"]::before { content: "✓ "; }
.track-panel .show[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.track-panel .mute[aria-pressed="true"] { background: var(--mute); border-color: var(--mute); color: #fff; }
.track-panel .solo[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
.track-panel .volume { display: flex; align-items: center; gap: 10px; padding: 2px 0 2px 2px; }
.track-panel .volume input { flex: 1; min-width: 0; }
.track-panel output { width: 36px; text-align: right; color: var(--board-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.track-panel .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (prefers-reduced-motion: reduce) { .track-panel { transition: none; } }
#color-menu .swatches { display: grid; grid-template-columns: repeat(4, 22px); gap: 8px; padding: 2px; }
#color-menu .swatch { width: 22px; height: 22px; }
#color-menu .swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--board), 0 0 0 4px var(--board-text); }
#color-menu .custom, #color-menu .reset { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border: none; border-radius: 5px; background: transparent; text-align: left; cursor: pointer; }
#color-menu .custom:hover, #color-menu .custom:focus-within, #color-menu .reset:hover:not(:disabled), #color-menu .reset:focus-visible { background: var(--board-line); outline: none; }
#color-menu .reset:disabled { opacity: 0.45; cursor: default; }
#color-menu input[type="color"] { width: 22px; height: 22px; padding: 0; border: 1px solid var(--board-line); border-radius: 50%; background: none; cursor: pointer; }
#color-menu input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
#color-menu input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

/* The room panel at the mixer's right: start or join a room, or the room
   with its code, its people and how to hear them. */
#room {
  flex: none;
  width: 270px;
  padding: 10px 12px 12px;
  border-left: 1px solid var(--board-line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#room [hidden] { display: none !important; }
#room h2 { margin: 0; }
#room .hint { margin: 0; }
body:has(#room-in:not([hidden])) #room-label::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--good);
  vertical-align: 1px;
}
#room-alone { display: flex; flex-direction: column; gap: 10px; }
/* Under Start: where a new room runs and its delay, with Change when there
   is more than one place, and the places in line when it is open. */
#room-where { display: flex; flex-direction: column; gap: 6px; margin-top: -4px; }
#room-where-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 8px; margin: 0; font-size: 12px; color: var(--board-dim); font-variant-numeric: tabular-nums; }
#room-where-line .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; }
#room-where-line:not([data-tone="good"], [data-tone="warn"], [data-tone="mute"]) .dot { display: none; }
#room-where-line[data-tone="good"] .dot { background: var(--good); }
#room-where-line[data-tone="warn"] .dot { background: var(--warn); }
#room-where-line[data-tone="mute"] .dot { background: var(--mute); }
#room button.link { padding: 0; border: none; border-radius: 3px; background: none; color: var(--brass); font-size: 12px; }
#room button.link:hover { text-decoration: underline; }
#room-faster { text-align: center; }
#room-list { border: 1px solid var(--board-line); border-radius: 8px; overflow: hidden; }
#room-places { display: flex; flex-direction: column; }
.room-place { position: relative; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 10px 4px 8px; border-bottom: 1px solid var(--board-line); background: var(--board-raised); font-size: 13px; cursor: pointer; }
.room-place input { position: absolute; opacity: 0; pointer-events: none; margin: 0; }
.room-place:has(input:focus) { outline: 2px solid var(--brass-bright); outline-offset: -2px; }
.room-place:has(input:checked) { background: color-mix(in srgb, var(--brass) 8%, var(--board-raised)); box-shadow: inset 3px 0 var(--brass); }
.room-place:has(input:disabled) { opacity: 0.45; cursor: default; }
.room-place .check { flex: none; width: 12px; color: var(--brass); font-weight: 700; }
.room-place:has(input:checked) .check::before { content: "✓"; }
.room-place .bars { flex: none; display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.room-place .bars i { width: 3px; border-radius: 1px; background: var(--board-line); }
.room-place .bars i:nth-child(1) { height: 4px; }
.room-place .bars i:nth-child(2) { height: 7px; }
.room-place .bars i:nth-child(3) { height: 11px; }
.room-place .bars[data-bars="1"] i:nth-child(-n + 1),
.room-place .bars[data-bars="2"] i:nth-child(-n + 2),
.room-place .bars[data-bars="3"] i { background: var(--good); }
.room-place .place { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-place:has(input:checked) .place { font-weight: 600; }
.room-place .fastest { flex: none; padding: 0 5px; border: 1px solid color-mix(in srgb, var(--good) 45%, transparent); border-radius: 4px; color: var(--good); font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.room-place .num { flex: none; color: var(--board-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.room-list-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: var(--board); color: var(--board-dim); font-size: 11px; }
#room .room-list-foot button.link { flex: none; font-size: 11px; }
/* The line between starting a room and joining one. */
.room-or { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--board-dim); font-size: 11px; }
.room-or::before, .room-or::after { content: ""; flex: 1; height: 1px; background: var(--board-line); }
#room-start { align-self: stretch; }
#room-join, #room-code-row { display: flex; gap: 6px; }
#room-code, #room-code-shown { flex: 1; min-width: 0; }
#room-place { flex: none; align-self: center; font-size: 12px; color: var(--board-dim); }
#room-code-shown { align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; letter-spacing: 0.03em; -webkit-user-select: text; user-select: text; }

/* In a room: the label, any step and the messages and table at the left, the
   room-wide controls in a column at the right. */
#mixer[data-show="room"] #room:has(#room-in:not([hidden])) {
  flex: 1;
  width: auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}
#mixer[data-show="room"] #room:has(#room-in:not([hidden])) > #room-label { grid-area: 1 / 1; padding: 10px 14px 0; }
#mixer[data-show="room"] #room:has(#room-in:not([hidden])) > .room-step { grid-area: 2 / 1; padding: 10px 14px 0; }
#room-in { display: contents; }
#room-main { grid-area: 3 / 1; min-height: 0; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
#room-side { grid-area: 1 / 2 / 4; min-height: 0; padding: 10px 12px 12px; border-left: 1px solid var(--board-line); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
#room-timing { display: flex; flex-direction: column; gap: 6px; }
#room-timing h3 { margin: 0; font-size: 13px; font-weight: 600; }

/* Who is in the room, one row each, in columns that line up across rows. */
#room-people {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  column-gap: 20px;
  row-gap: 3px;
  font-size: 13px;
}
#room-rows { display: contents; }
.people-head, .person { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; }
.people-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0 8px 4px;
  background: var(--board);
  border-bottom: 1px solid var(--board-line);
  font-size: 11px;
  font-weight: 600;
  color: var(--board-dim);
}
.people-head .col-player { grid-column: span 2; }
.people-head .num[title] { cursor: help; }
.person { min-height: 30px; padding: 3px 8px; border-radius: 6px; background: var(--board-raised); }
.person.pending > * { opacity: 0.6; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.person .num { font-size: 12px; }
.person .delay { font-weight: 600; }
.person .avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--board-line);
  font-size: 11px;
  font-weight: 700;
  color: var(--board-dim);
}
.person .who { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.person .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.person .tag { flex: none; padding: 0 5px; border-radius: 4px; background: var(--board-line); font-size: 10px; font-weight: 700; color: var(--board-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.person .role { font-size: 11px; color: var(--board-dim); overflow: hidden; text-overflow: ellipsis; }
.person .segments { min-width: 116px; }
#room .segments { display: flex; padding: 2px; gap: 2px; border-radius: 7px; background: var(--board); }
#room #jam-hear { background: var(--board-raised); }
#room .segments button { flex: 1; border: none; border-radius: 5px; padding: 3px 7px; font-size: 12px; background: transparent; color: var(--board-dim); }
#room .segments button:hover:not(:disabled) { color: var(--board-text); }
#room .segments button[aria-pressed="true"] { background: var(--brass); color: var(--on-brass); font-weight: 700; }
#room .segments button:disabled { opacity: 0.4; }
#room .segments button:focus-visible { outline-offset: -2px; }
#jam-audio { display: flex; flex-direction: column; gap: 6px; }
#jam-audio-label { font-size: 13px; font-weight: 600; }
#room-leave { align-self: flex-start; color: var(--mute); border-color: color-mix(in srgb, var(--mute) 45%, transparent); }

.room-step { --track: var(--board-raised); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.room-step[hidden] { display: none; }
.room-step .step-says { margin: 0; font-size: 13px; }
.step-bar { align-self: stretch; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.step-bar span { display: block; height: 100%; width: 0; background: var(--brass); transition: width 0.2s linear; }
/* Nothing to measure yet: a slice that slides along. */
.step-bar.busy span { width: 30%; transition: none; animation: step-busy 1.2s ease-in-out infinite; }
@keyframes step-busy { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) {
  .step-bar.busy span { width: 100%; animation: none; opacity: 0.4; }
}

/* Live audio: how the connection feels, what to fix, and how to line up. */
.tone-checking { color: var(--board-dim); }
.tone-room { color: var(--good); }
.tone-loose { color: var(--warn); }
.tone-far { color: var(--mute); }
#jam-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#jam-sync button { min-width: 28px; padding: 3px 8px; font-size: 13px; }
#jam-sync output { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
#jam-sync-match { padding: 3px 8px; font-size: 12px; }
#jam-sync-match[aria-pressed="true"] { background: var(--brass); color: var(--on-brass); font-weight: 700; }
#jam-warnings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#jam-warnings li { padding: 7px 9px; border-left: 3px solid var(--warn); border-radius: 4px; background: var(--board-raised); font-size: 12px; overflow-wrap: anywhere; }
#jam-warnings li.blocks { border-left-color: var(--mute); }
.level { height: 6px; border-radius: 3px; background: var(--board-raised); overflow: hidden; }
.level span { display: block; height: 100%; width: 0; background: var(--good); transition: width 0.12s linear; }
.level.clip span { background: var(--mute); }

/* The console: groups side by side, each a row of vertical channels. A
   channel is a column of its name, a detail, a pan knob or a switch, a fader,
   its readout, then its buttons, so the faders of every channel line up. */
#console { flex: 1; min-width: 0; display: flex; overflow-x: auto; overflow-y: hidden; }
.group { flex: none; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--board-line); }
.group[hidden] { display: none; }
.group[data-group="room"] { flex: 1 0 auto; }
.group-label { margin: 0; padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--board-dim); }
.group-head { display: flex; align-items: baseline; }
.group-body, .channels { flex: 1; display: flex; min-height: 0; }
.channel {
  --w: 84px;
  flex: none;
  width: var(--w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 6px 6px 10px;
  border-right: 1px solid color-mix(in srgb, var(--board-line) 45%, transparent);
}
.channel.strip { width: auto; flex-direction: row; align-items: stretch; padding: 0; }
.channel.strip.wide { --w: 136px; }
.channel.strip.split { --w: 168px; }
.channel-main { width: var(--w); display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 0; padding: 6px 6px 10px; }
.cname { max-width: 100%; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Another player's audio is arriving. */
.cname.live::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: var(--good); vertical-align: 1px; }
.cdet { max-width: 100%; height: 18px; margin-top: -6px; font-size: 11px; line-height: 18px; color: var(--board-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdet[hidden] { display: none; }
.cdet.tone-room { color: var(--good); }
.cdet.tone-loose { color: var(--warn); }
.cdet.tone-far { color: var(--mute); }
/* The channel's name. */
.chead { max-width: 100%; display: flex; align-items: center; gap: 6px; }
.channel.silent .cname { opacity: 0.45; }
.channel.silent .fader input { opacity: 0.5; }
.channel :disabled { opacity: 0.45; cursor: default; }

/* What Hear plays, in place of the song's detail while a recording is open. */
.focus { display: flex; height: 18px; margin-top: -6px; padding: 1px; gap: 1px; border-radius: 5px; background: var(--board-raised); }
.focus[hidden] { display: none; }
.focus button { padding: 0 5px; border: none; border-radius: 4px; background: transparent; color: var(--board-dim); font-size: 11px; }
.focus button:hover { color: var(--board-text); }
.focus button[aria-pressed="true"] { background: var(--brass); color: var(--on-brass); font-weight: 700; }

/* The pan knob and the beat's switch take the same row. */
.slot, .knob { flex: none; height: 26px; }
.slot { display: grid; place-items: center; }
.knob { position: relative; width: 26px; border: 1px solid var(--board-line); border-radius: 50%; background: var(--board-raised); cursor: grab; touch-action: none; }
.knob::after { content: ""; position: absolute; left: 11px; top: 3px; width: 2px; height: 9px; border-radius: 1px; background: var(--brass-bright); transform: rotate(var(--a, 0deg)); transform-origin: 1px 9px; }
.knob.held { cursor: grabbing; border-color: var(--brass); }
.knob[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.knob[aria-disabled="true"]::after { background: var(--board-dim); }

/* A fader runs bottom to top and fills from --lo to --hi; a level has a mark
   at 0 dB. The meter beside it is this player's input. */
.fader { flex: 1; min-height: 40px; display: flex; justify-content: center; gap: 6px; }
/* A strip's faders, each over its readout. With both heard the song's own
   fader rests and the recording and the tab each get one, named. */
.faders { flex: 1; min-height: 0; align-self: stretch; display: flex; justify-content: center; gap: 2px; }
.lane { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lane[hidden] { display: none; }
.lname { min-height: 13px; font-size: 10px; line-height: 13px; color: var(--board-dim); white-space: nowrap; }
.channel.strip:not(.split) .lname { display: none; }
.fader input[type="range"] {
  --lo: 0;
  --hi: 0;
  --from: calc(5px + (100% - 10px) * var(--lo));
  --to: calc(5px + (100% - 10px) * var(--hi));
  --fill: var(--brass);
  writing-mode: vertical-lr;
  direction: rtl;
  width: 20px;
  height: 100%;
}
.fader input[type="range"]::-webkit-slider-runnable-track {
  width: 4px;
  height: 100%;
  margin: 0 auto;
  background: linear-gradient(to top, transparent var(--from), var(--fill) var(--from), var(--fill) var(--to), transparent var(--to)), var(--board-line);
}
.fader input[type="range"]::-webkit-slider-thumb { width: 18px; height: 9px; margin: 0 0 0 -7px; border-radius: 2px; background: var(--board-text); box-shadow: 0 1px 3px var(--shadow); }
.fader input.gain {
  --unity: calc(5px + (100% - 10px) * 0.3);
  background: linear-gradient(to bottom, transparent var(--unity), var(--board-dim) var(--unity), var(--board-dim) calc(var(--unity) + 1px), transparent calc(var(--unity) + 1px)) center / 14px 100% no-repeat;
}
.fader input.band { --fill: color-mix(in srgb, var(--brass) 70%, var(--board-line)); }
.meter { position: relative; width: 4px; border-radius: 2px; background: var(--board-raised); overflow: hidden; }
.meter[hidden] { display: none; }
.meter span { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--good); transition: height 0.12s linear; }
.meter.clip span { background: var(--mute); }
.channel .db { min-height: 16px; font-size: 11px; color: var(--board-dim); text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.channel-buttons { display: flex; gap: 4px; min-height: 24px; }
.channel .toggle { width: 28px; color: var(--board-dim); }
.channel .toggle.eq { width: 32px; }
.channel .toggle.mute[aria-pressed="true"] { color: #fff; }
.toggle.eq.on { color: var(--brass-bright); border-color: var(--brass); }
.toggle.eq[aria-expanded="true"] { background: var(--board-line); }

/* A strip's EQ opens beside it: three bands and the presets. */
.eq-panel { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; background: var(--board-raised); }
.eq-panel[hidden] { display: none; }
.bands { flex: 1; min-height: 0; display: flex; gap: 2px; }
.band { width: 44px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.band .name { font-size: 11px; font-weight: 600; }
.band small { margin-top: -4px; font-size: 10px; color: var(--board-dim); }
.presets { width: 136px; display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 2px 7px; border-radius: 999px; font-size: 11px; color: var(--board-dim); background: transparent; }
.chip[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }

.channel.out { --w: 64px; }
.channel.out .meter { width: 8px; }
.channel.setup button { margin: auto 0; padding: 6px; font-size: 12px; color: var(--brass-bright); white-space: normal; }

/* The recording's link, beside the song's channels when it has none. */
.group-body #video-form { width: 230px; padding: 6px 10px 10px; }
#video-form:not(:has(> :not([hidden]))) { display: none; }

#guitar-settings { margin-left: auto; padding: 0 10px; border: none; background: transparent; color: var(--brass-bright); font-size: 11px; white-space: nowrap; }
#guitar-settings:hover { text-decoration: underline; }
/* The song's name, capped at three lines. In the full build it is a button
   that opens the song's settings, with a caret after the last word. */
#title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
#title .last { white-space: nowrap; }
#artist { display: block; margin-top: 2px; color: var(--board-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#song-menu-open {
  display: block;
  width: calc(100% + 8px);
  margin: 0 0 0 -8px;
  padding: 4px 8px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
#song-menu-open:hover, #song-menu-open:focus-visible { background: var(--board-raised); }
#song-menu-open .last::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 5px;
  vertical-align: 1px;
  background: var(--board-dim);
  clip-path: polygon(16% 33%, 84% 33%, 50% 71%);
}

#track-list { flex: 1; min-height: 150px; margin-bottom: 10px; display: none; flex-direction: column; }
body.loaded #track-list { display: flex; }
.side-label { padding: 4px 20px 0; }
#tracks {
  list-style: none;
  margin: 0;
  padding: 0 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* One line per track. A click shows only it; its chevron opens its options; solo and
   mute stay on the row while they are on. */
.track {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  padding: 6px 6px 6px 10px;
  margin-bottom: 2px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.track .label { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; white-space: nowrap; }
.track .detail { min-width: 0; color: var(--board-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.track:hover, .track.menu-open { background: color-mix(in srgb, var(--board-text) 4%, transparent); }
.track[aria-current="true"] {
  background: var(--board-raised);
  border-color: var(--board-line);
  box-shadow: inset 3px 0 0 var(--track, var(--brass));
}
/* A track's color, as on its staff; a click picks another. */
.swatch {
  flex: none;
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--track, var(--board-dim));
}
.track .swatch { position: relative; }
/* A bigger target than the dot. */
.track .swatch::before { content: ""; position: absolute; inset: -6px; }
.swatch:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--track) 40%, transparent); }
.swatch:focus-visible { outline: 2px solid var(--board-text); outline-offset: 2px; }
.track .name { flex: none; max-width: 100%; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.toggle {
  flex: none;
  width: 26px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  border-radius: 5px;
}
/* On the row, solo and mute are small tags that show only while on. */
.track .toggle { display: none; width: auto; height: 18px; padding: 0 5px; font-size: 10px; font-weight: 800; border-radius: 4px; }
.track .toggle[aria-pressed="true"] { display: block; }
.toggle.mute[aria-pressed="true"] { background: var(--mute); border-color: var(--mute); color: #fff; }
.toggle.solo[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
.track .more { flex: none; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; color: var(--board-dim); background: transparent; border-color: transparent; border-radius: 6px; visibility: hidden; }
.track .more svg { width: 15px; height: 15px; fill: currentColor; transition: transform 180ms ease; }
.track.menu-open .more svg { transform: rotate(180deg); }
.track:hover .more, .track:focus-within .more, .track.menu-open .more { visibility: visible; }
.track .more:hover, .track.menu-open .more { color: var(--board-text); background: color-mix(in srgb, var(--board-text) 8%, transparent); }
.track.silent .label { opacity: 0.45; }

/* The link gets the whole row, so its placeholder is never cut off. */
#video-form { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#video-link, #room-code, #room-name, dialog input[type="text"], dialog input[type="number"], dialog select, dialog textarea, .library-search, #up-next-search {
  align-self: stretch;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--board-line);
  border-radius: 6px;
  background: var(--board-raised);
  color: var(--board-text);
  font: inherit;
  font-size: 12px;
  user-select: text;
}
#video-form .hint, #video-form .choices { margin: 0; }
#video-field { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#video-field[hidden], #open-video[hidden] { display: none; }
#open-video { margin-top: 14px; }
#open-have { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
#open-have[hidden] { display: none; }
#open-have p { flex: 1 1 100%; margin: 0; }
body.video #video-form { display: none; }
/* Off screen but rendered: a hidden iframe can stop playing. */
#video-frame { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#video-frame iframe { width: 100%; height: 100%; display: block; }
#play { transition: opacity 0.2s; }
/* The sync dot and Back to start, one segment with a space before Play. The
   dot is green in sync, red out of sync and pulses while it syncs; its word
   shows above it on hover, and stays up while an Alt-drag tells the shift. */
.buttons .seg { display: flex; margin-right: 8px; }
.buttons .seg button { border-radius: 0; }
.buttons .seg button:first-child, .buttons .seg button[hidden] + button { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.buttons .seg button:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; margin-left: -1px; }
.buttons .seg button[hidden] + button { margin-left: 0; }
.buttons #sync-open { position: relative; width: 30px; --dot: var(--good); }
.buttons #sync-open[hidden] { display: none; }
#sync-open[data-state="off"] { --dot: #e5484d; }
#sync-open[data-state="busy"] { --dot: #4c8dff; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 24%, transparent); }
#sync-open[data-state="busy"] .sync-dot { animation: sync-pulse 1.2s ease-in-out infinite; }
@keyframes sync-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { #sync-open[data-state="busy"] .sync-dot { animation: none; } }
#sync-label { position: absolute; bottom: calc(100% + 8px); left: -1px; z-index: 2; display: none; padding: 6px 9px; border: 1px solid var(--board-line); border-radius: 6px; background: var(--board-raised); box-shadow: 0 4px 14px rgb(0 0 0 / 0.25); font-size: 12px; line-height: 1.35; text-align: left; white-space: nowrap; color: var(--board-text); pointer-events: none; }
#sync-open:is(:hover, :focus-visible, .telling) #sync-label { display: block; }
#sync-hint { display: block; color: var(--board-dim); }
#sync-hint[hidden] { display: none; }
/* The Sync dialog. */
#sync-dialog { position: fixed; }
.sync-x { position: absolute; top: 12px; right: 12px; background: transparent; border-color: transparent; color: var(--board-dim); font-size: 18px; }
.sync-x:hover { color: var(--board-text); }
#sync-dialog h2 { margin: 0 36px 10px 0; }
#sync-dialog p { margin: 0; line-height: 1.45; }
#sync-dialog [hidden] { display: none; }
.sync-says { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sync-says::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.sync-says.off::before { background: var(--warn); }
.sync-says.rough::before { background: var(--brass); }
.sync-says:empty { display: none; }
.sync-strip { margin: 12px 0 0; }
.sync-legend { position: relative; display: flex; justify-content: space-between; font-size: 11px; color: var(--board-dim); font-variant-numeric: tabular-nums; }
.sync-lane { position: relative; height: 22px; margin: 4px 0; border-radius: 4px; overflow: hidden; }
.sync-lane > span { position: absolute; top: 0; bottom: 0; box-sizing: border-box; font-size: 11px; line-height: 20px; padding: 0 6px; white-space: nowrap; }
.sync-audio { background: var(--board-raised); border: 1px solid var(--board-line); border-radius: 4px; color: var(--board-dim); }
.sync-bars-in { background: color-mix(in srgb, var(--good) 14%, transparent); border: 1px solid color-mix(in srgb, var(--good) 45%, transparent); border-radius: 4px; }
.sync-bars-out { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 35%, transparent) 0 5px, transparent 5px 10px); border: 1px dashed var(--warn); border-radius: 4px; }
.sync-lane > .sync-tick { width: 0; padding: 0; border-left: 1px solid var(--board-dim); opacity: 0.5; }
.sync-lane > .sync-one { padding: 0 6px; color: var(--board-text); border-left: 1px solid var(--board-text); }
.sync-lane > .sync-view { padding: 0; background: transparent; border: 1.5px solid var(--brass); border-radius: 3px; }
.sync-start { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--board-line); }
#sync-dialog .sync-start h3 { margin: 0; font-size: 11px; }
.sync-zoom { position: relative; margin-top: 8px; user-select: none; touch-action: none; }
.sync-wave { display: block; width: 100%; height: 56px; box-sizing: border-box; background: var(--board-raised); border: 1px solid var(--board-line); border-radius: 4px; }
.sync-guide { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--brass); pointer-events: none; }
.sync-drag { position: relative; height: 30px; margin-top: 4px; border-radius: 4px; overflow: hidden; cursor: grab; }
.sync-drag.dragging { cursor: grabbing; }
.sync-drag.off { cursor: default; opacity: 0.5; }
.sync-tab { position: absolute; top: 0; bottom: 0; right: 0; box-sizing: border-box; background: color-mix(in srgb, var(--brass) 16%, transparent); border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent); border-radius: 4px; }
.sync-drag.dragging .sync-tab { background: color-mix(in srgb, var(--brass) 26%, transparent); }
.sync-bar { position: absolute; top: 0; bottom: 0; padding: 2px 4px; border-left: 1px solid color-mix(in srgb, var(--board-text) 35%, transparent); font-size: 10px; color: var(--board-dim); white-space: nowrap; }
.sync-bar.first { border-left: 2px solid var(--brass); color: var(--board-text); font-weight: 600; font-size: 11px; }
.sync-readout { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.sync-readout b { font-size: 14px; }
#sync-dialog .sync-start .hint { margin-top: 6px; }
#sync-why { margin-top: 10px; }
#sync-why:empty { display: none; }
#sync-why.error { color: var(--warn); }
.sync-tune { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--board-line); display: grid; gap: 8px; }
#sync-dialog .sync-tune h3 { margin: 0; font-size: 11px; }
#sync-dialog .sync-tune .hint { margin: 0; }
.sync-step { display: flex; align-items: center; gap: 6px; }
.sync-step button { width: 32px; padding: 4px 0; font-size: 15px; line-height: 1; }
.sync-step output { flex: 1; text-align: center; font-variant-numeric: tabular-nums; }
#sync-room { margin-top: 10px; }
#sync-dialog button.link { padding: 0; border: none; background: transparent; font-size: 12px; color: var(--board-dim); text-decoration: underline; }
#sync-dialog button.link:hover:not(:disabled) { color: var(--board-text); }
#sync-busy { --track: var(--board-raised); }
#sync-busy .step-bar { display: block; margin: 14px 0 6px; }
.sync-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--board-dim); font-variant-numeric: tabular-nums; }
.sync-auto { margin-top: 10px !important; padding: 8px 10px; border-radius: 6px; background: var(--board-raised); font-size: 12px; color: var(--board-dim); }
#sync-failed .dialog-buttons { margin-top: 18px; }
.hint { font-size: 12px; color: var(--board-dim); }
/* Settings: a sidebar of panes beside the one shown. */
#settings { width: min(720px, calc(100vw - var(--side-w) - 32px)); height: min(560px, calc(100vh - 64px)); padding: 0; overflow: hidden; }
#settings[open] { display: grid; grid-template-columns: 168px 1fr; }
.settings-side { padding: 18px 10px; background: var(--board-raised); border-right: 1px solid var(--board-line); }
.settings-side h2 { margin: 0 10px 14px; font-size: 16px; }
#settings-panes { display: grid; gap: 2px; }
#settings-panes button { border: none; border-radius: 6px; padding: 7px 10px; background: transparent; color: var(--board-dim); font-size: 13px; text-align: left; }
#settings-panes button:hover { color: var(--board-text); }
#settings-panes button[aria-selected="true"] { background: var(--board); color: var(--board-text); font-weight: 600; }
#settings-panes button:focus-visible { outline-offset: -2px; }
.settings-body { position: relative; min-width: 0; overflow-y: auto; padding: 20px 24px; }
.settings-close { position: absolute; top: 12px; right: 20px; z-index: 1; background: transparent; border-color: transparent; color: var(--board-dim); }
.settings-close:hover { color: var(--board-text); }
.settings-body h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: var(--board-text); text-transform: none; letter-spacing: 0; }

/* A row: the label and its description on the left, the control on the right. */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--board-line); font-size: 13px; }
label.setting { cursor: pointer; }
.setting-text { min-width: 0; }
.setting-text small { display: block; margin-top: 2px; font-size: 12px; color: var(--board-dim); }
.setting-text small.form-error { color: var(--mute); }
/* Settings that only matter while the switch above them is on. */
/* What a switch turns on, under it. Turning the switch off folds it shut and
   fades it; visibility waits for the fold, so its controls leave the tab order
   once it is shut. The inner box clips the rows while the height changes, with
   room on the right for the switches' focus ring. */
.dependents { display: grid; grid-template-rows: 1fr; margin-left: 4px; padding-left: 14px; border-left: 2px solid var(--board-line); transition: grid-template-rows 0.22s ease, opacity 0.22s ease, visibility 0.22s; }
.dependents-in { min-height: 0; overflow: hidden; margin-right: -4px; padding-right: 4px; }
.setting:has(> .onoff[aria-pressed="false"]) + .dependents { grid-template-rows: 0fr; opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .dependents { transition: none; } }

.onoff { flex: none; position: relative; width: 34px; height: 20px; padding: 0; border-radius: 10px; background: var(--board-line); border-color: var(--board-line); }
.onoff::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--board-dim); transition: transform 0.15s; }
.onoff[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); }
.onoff[aria-pressed="true"]::after { transform: translateX(14px); background: var(--board); }
#settings .segments { flex: none; display: flex; padding: 2px; gap: 2px; border-radius: 7px; background: var(--board-raised); }
#settings .segments button { border: none; border-radius: 5px; padding: 5px 12px; font-size: 13px; background: transparent; color: var(--board-dim); }
#settings .segments button:hover { color: var(--board-text); }
#settings .segments button[aria-pressed="true"] { background: var(--brass); color: var(--on-brass); font-weight: 700; }
#settings .segments button:focus-visible { outline-offset: -2px; }
#settings .segments button[aria-disabled="true"] { opacity: 0.4; cursor: default; }
#settings .segments button[aria-disabled="true"]:hover { color: var(--board-dim); }
#settings .setting input { flex: none; align-self: center; }
/* About: the app and its version, then updates and the license in cards. */
.about-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 18px; border-bottom: 1px solid var(--board-line); }
.about-mark { flex: none; width: 48px; height: 48px; }
#settings-about .about-head h3 { margin: 0 0 2px; }
.about-version { font-size: 13px; color: var(--board-dim); }
#settings-about button.link { padding: 0; border: none; background: none; font-size: inherit; color: var(--board-dim); text-decoration: underline; }
#settings-about button.link:hover { color: var(--board-text); }
.about-label { margin: 20px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--board-dim); }
#settings-about .about-card { padding: 0 14px; border: 1px solid var(--board-line); border-radius: 8px; background: var(--board-raised); }
#settings-about .about-card .setting:last-child { border-bottom: none; }
#update-line { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
#update-line > i { flex: none; width: 8px; height: 8px; border-radius: 50%; }
#update-line[data-mark="none"] { color: var(--board-dim); }
#update-line[data-mark="none"] > i { display: none; }
#update-line[data-mark="good"] > i { background: var(--good); }
#update-line[data-mark="new"] > i { background: var(--brass); }
#update-line[data-mark="bad"] > i { background: var(--mute); }
#update-line[data-mark="busy"] > i { width: 12px; height: 12px; border: 2px solid var(--board-line); border-top-color: var(--board-text); animation: spin 0.8s linear infinite; }
#update-check { min-width: 96px; }
#update-status { flex: 1; min-width: 0; display: grid; gap: 7px; }
#update-says { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#update-size { margin-left: auto; color: var(--board-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
#update-bar { height: 4px; border-radius: 2px; background: var(--board-line); overflow: hidden; }
#update-bar[hidden] { display: none; }
#update-bar > b { display: block; width: var(--got, 0%); height: 100%; border-radius: 2px; background: var(--brass); transition: width 0.3s; }
#update-bar.wait > b { width: 30%; animation: update-slide 1.2s ease-in-out infinite; }
@keyframes update-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { #update-bar > b { transition: none; } #update-bar.wait > b { animation: none; } }
#license-kind:not([hidden])::after { content: "·"; margin: 0 6px; }
.about-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--board-line); font-size: 13px; text-align: center; }
/* Guitar: devices and the tone, in the order the sound flows. */
#settings-audio .lede { margin: 0 0 8px; }
/* Sounds: a slide-down per setting. Its header shows the pick, and its list
   opens to its height by animating the grid row from 0fr to 1fr. */
.choice { border-bottom: 1px solid var(--board-line); }
.choice-head { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border: none; border-radius: 0; background: none; color: var(--board-text); text-align: left; }
.choice-head .setting-text { flex: 1; }
.choice-head b { font-size: 14px; }
.choice-now { flex: none; font-size: 13px; color: var(--board-text); }
.chev { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--board-dim); stroke-width: 2; transition: transform 0.18s; }
.choice-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.choice-list { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.2s ease; }
.choice-head[aria-expanded="true"] + .choice-list { grid-template-rows: 1fr; }
.choice-list > div { min-height: 0; overflow: hidden; }
.choice-list .setting { padding-left: 12px; border-bottom: none; border-top: 1px solid var(--board-line); }
@media (prefers-reduced-motion: reduce) { .chev, .choice-list { transition: none; } }
.choice-pick { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
#settings .choice-pick input { margin: 0; accent-color: var(--brass); }
.choice-list button.icon[aria-pressed="true"] { color: var(--brass); border-color: var(--brass); }
/* Two cards: where everything is heard, and the guitar. */
#settings-audio .audio-card { margin: 12px 0 0; padding: 0 14px; border: 1px solid var(--board-line); border-radius: 8px; }
#settings-audio .audio-card .setting:last-child { border-bottom: none; }
#settings-audio .audio-card .setting-text b { font-size: 14px; }
#settings-audio .card-hint { margin: 8px 0 12px; }
#settings-audio select { flex: 0 1 260px; width: 260px; align-self: center; }
#settings-audio [hidden] { display: none; }
.setting-pair { justify-content: flex-start; }
.setting-pair > label { flex: 1; min-width: 0; display: grid; gap: 4px; cursor: pointer; }
#settings-audio .setting-pair select { width: 100%; }
#settings-audio .gain { flex: 0 1 260px; display: grid; gap: 6px; }
#grading.no-input { opacity: 0.45; }
#grading-needs { margin: 6px 0 0; }
#grading-setup { padding: 0; border: none; background: transparent; color: var(--brass-bright); font-size: 12px; font-weight: 600; }
#grading-setup:hover { text-decoration: underline; }
#settings-audio .gain input { width: 100%; }
#guitar-boost-says, #rig-boost-says { margin-left: 4px; color: var(--board-dim); font-variant-numeric: tabular-nums; }
.tone-pick { flex: 0 1 260px; display: flex; gap: 6px; min-width: 0; }
#settings-audio .tone-pick select { flex: 1; width: auto; min-width: 0; }
#tone-edit { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
/* Lit while the controller is connected, and flashes with each message. */
#foot-light { flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--board-dim); opacity: 0.4; }
#foot-light.on { background: var(--good); opacity: 0.55; }
#foot-light.flash { animation: foot-flash 300ms ease-out; }
@keyframes foot-flash { from { opacity: 1; box-shadow: 0 0 6px var(--good); } }
#page-ahead { width: 64px; }
#page-glide-speed { width: 160px; }
#page-glide-shown { margin-left: 4px; color: var(--board-dim); font-variant-numeric: tabular-nums; }

/* Shortcuts: the keys of each row, in caps at its right. */
#settings-shortcuts .lede { margin: 0 0 8px; }
.shortcut-keys { flex: none; display: flex; align-items: center; gap: 4px; color: var(--board-dim); }
.shortcut-foot { margin: 14px 0 0; }

/* Appearance: a card per theme, each a small window in its own colors. */
.looks-label { margin: 16px 0 8px; font-size: 13px; font-weight: 600; }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--board-line); }
.look { display: grid; gap: 6px; padding: 6px 6px 8px; text-align: left; font-size: 13px; }
.look[aria-pressed="true"] { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); font-weight: 600; }
.look-art { display: grid; grid-template-columns: 22% 1fr; grid-template-rows: 1fr 10px; height: 64px; border: 1px solid var(--board-line); border-radius: 4px; overflow: hidden; background: var(--board); }
.look-art i { background: var(--board-raised); border-right: 1px solid var(--board-line); }
.look-art b { position: relative; margin: 5px; border-radius: 2px; background: repeating-linear-gradient(to bottom, var(--staff) 0 1px, transparent 1px 5px) 4px 7px / calc(100% - 8px) 26px no-repeat, var(--paper); }
.look-art s { position: absolute; left: 45%; top: 4px; bottom: 4px; width: 2px; background: var(--brass); }
.look-art u { grid-column: 1 / 3; border-top: 1px solid var(--board-line); background: linear-gradient(var(--brass), var(--brass)) 6px 50% / 30% 3px no-repeat, var(--board); }

#about-version { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; user-select: text; }
/* Settings → Storage: a colour per part, the same in the bar and on its row. */
[data-part="tabs"] { --part: #f07a50; }
[data-part="audio"] { --part: #4f8fe8; }
[data-part="sync"] { --part: #3fae6a; }
.storage-total { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 0; font-size: 13px; }
#storage-total { font-size: 20px; font-variant-numeric: tabular-nums; }
#storage-total.none { color: var(--board-dim); }
#storage-bar { display: flex; gap: 2px; height: 10px; margin: 6px 0 4px; border-radius: 5px; overflow: hidden; background: var(--board-line); }
#storage-bar span { flex-basis: 0; min-width: 4px; background: var(--part); }
.storage-part .setting { justify-content: flex-start; gap: 14px; }
.storage-part .setting-text { flex: 1; }
.storage-dot { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--part); }
.storage-size { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; user-select: text; }
.storage-part[data-empty] .storage-dot { opacity: 0.3; }
.storage-part[data-empty] .storage-size { font-weight: 400; color: var(--board-dim); }
.storage-delete { flex: none; }
.storage-part .song-ask { margin: 8px 0; border-radius: 8px; }
.storage-part .form-error { margin: 8px 0 0; font-size: 12px; }
#storage-code { width: 100%; margin-top: 10px; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; letter-spacing: 0.15em; text-transform: uppercase; }
#update-check { flex: none; }

/* Dialogs: the open form, the library and the settings. */
dialog {
  inset: 0 0 0 var(--side-w);
  width: min(440px, calc(100vw - var(--side-w) - 32px));
  max-height: calc(100vh - 64px);
  padding: 20px;
  background: var(--board);
  color: var(--board-text);
  border: 1px solid var(--board-line);
  border-radius: 10px;
  box-shadow: 0 18px 48px var(--shadow);
}
/* The ready check opens over the song, not as a modal, so the sidebar stays
   in reach; player.js makes the rest inert and it dims here. */
#ready-check { position: fixed; z-index: 10; width: min(380px, calc(100vw - var(--side-w) - 32px)); }
body > :is(#strip, #stage, #transport)[inert] { opacity: 0.4; }
#ready-check [hidden] { display: none; }
.ready-players { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.ready-players li { display: flex; justify-content: space-between; gap: 12px; }
.ready-players .says { color: var(--board-dim); }
.ready-players .ready .says { color: var(--good); }
dialog::backdrop { background: color-mix(in srgb, var(--board) 60%, transparent); }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
dialog h3 { margin: 0 0 8px; font-size: 14px; color: var(--board-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
dialog .hint { margin: 6px 0 0; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-buttons .leading { margin-right: auto; }
button.primary { background: var(--brass); border-color: var(--brass); color: var(--on-brass); font-weight: 700; }
button.primary:hover:not(:disabled) { background: var(--brass-bright); }
:disabled { cursor: not-allowed; }
button.primary:disabled, dialog button:disabled { opacity: 0.45; }
button.danger { background: var(--mute); border-color: var(--mute); color: #fff; }

.drop {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 18px 12px 14px;
  margin-bottom: 14px;
  border: 1.5px dashed var(--board-line);
  border-radius: 8px;
  text-align: center;
}
.drop p { margin: 0; }
.drop #open-file-name { font-weight: 600; overflow-wrap: anywhere; }
.drop .hint { margin: 0 0 10px; }
.drop.chosen { border-style: solid; border-color: var(--brass); }
body.dragging .drop { border-color: var(--brass-bright); background: var(--wash); }
.field { display: grid; gap: 6px; }
.field input, .field textarea { width: 100%; }
.field textarea { resize: vertical; }
#diagnostics-form { display: grid; gap: 12px; }
#diagnostics-form h2, #diagnostics-form p.hint { margin: 0; }
#diagnostics-song { margin-top: -8px; }
#diagnostics-form .dialog-buttons { margin-top: 6px; }
.form-error { margin: 10px 0 0; color: var(--mute); font-size: 13px; }
.form-error[hidden] { display: none; }
/* The versions the video lookup offers, each with a button that previews it. */
.choices { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; align-self: stretch; }
.choices[hidden] { display: none; }
.choices li { display: flex; align-items: center; gap: 8px; }
.choice-pick { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-pick[aria-pressed="true"] { border-color: var(--brass); background: var(--wash); }
.choice-out { flex: none; font-size: 12px; }
dialog.video-preview { width: min(720px, calc(100vw - var(--side-w) - 32px)); }
.video-preview h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-preview-screen { aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; }
/* The search runs: the dialog waits. */
dialog.searching { cursor: progress; }
dialog.searching #open-found::before, dialog.searching #song-search-says::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 2px solid var(--board-line);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 4px;
  border: 1px solid var(--board-line);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 600 11px/16px var(--font);
  text-align: center;
  color: var(--board-text);
}

/* The song's details: a line of chips, then groups of rows, each row
   saying what it is with its action on the right. A row's ask or editor
   opens under it, inside the group. */
dialog.song-panel { width: min(520px, calc(100vw - var(--side-w) - 32px)); padding: 14px 18px 18px; }
.song-panel [hidden] { display: none !important; }
.song-row-text b.song-name { font-size: 15px; }
.song-rename-form { display: grid; gap: 6px; }
.song-rename-form label { display: flex; align-items: center; gap: 8px; }
.song-rename-form label span { flex: none; width: 44px; color: var(--board-dim); font-size: 12px; }
.song-rename-form input { flex: 1; min-width: 0; }
.song-rename-form .form-error { margin: 0; }
.song-rename-form .dialog-buttons { margin-top: 2px; }
.song-x { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; font-size: 18px; color: var(--board-dim); background: transparent; border-color: transparent; }
.song-x:hover { color: var(--board-text); }
/* The top line: the chips, with the × at its end. */
.song-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 28px; margin: 0 36px 0 0; }
.song-chips span { padding: 1px 7px; border-radius: 10px; background: var(--board-raised); color: var(--board-dim); font-size: 11.5px; }
.song-group { margin-top: 16px; }
.song-group h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.08em; }
.song-rows { border: 1px solid var(--board-line); border-radius: 8px; }
.song-rows > * + * { border-top: 1px solid var(--board-line); }
.song-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; font-size: 13px; }
.song-row > button { flex: none; white-space: nowrap; }
.song-row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.song-row-text b { font-weight: 600; overflow-wrap: anywhere; }
.song-row-text span { color: var(--board-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-thumb { flex: none; width: 76px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; background: var(--board-raised); }
button.song-red { color: var(--mute); background: transparent; }
button.song-red:hover:not(:disabled) { border-color: var(--mute); }
.song-row-more { margin: 0; padding: 10px 12px; }
#song-source-edit { display: grid; gap: 8px; justify-items: start; }
#song-source-edit .hint, #song-source-edit .form-error { margin: 0; }
.song-link-row { display: flex; gap: 6px; justify-self: stretch; }
.song-link-row input { flex: 1; min-width: 0; }
.song-hits { justify-self: stretch; margin: 0; max-height: 34vh; overflow-y: auto; }
.song-hits li { gap: 10px; padding: 4px 0; }
.hit-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.hit-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit-meta { font-size: 12px; color: var(--board-dim); }
.hit-same { margin-left: 8px; padding: 0 6px; border-radius: 4px; background: var(--wash); color: var(--brass-bright); }
.song-ask { justify-self: stretch; padding: 10px 12px; background: var(--wash); }
#song-source-edit .song-ask { border: 1px solid var(--board-line); border-radius: 8px; }
.song-rows > .song-ask:last-child { border-radius: 0 0 7px 7px; }
.song-ask p { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.song-ask .dialog-buttons { margin-top: 10px; }

/* The library: one card with a head that holds the search, then the filters
   down the side and the songs in sortable columns. It sits on the home
   screen, and the Library window over a song holds the same card. It follows
   the theme's paper in both. */
.library { --lib-dim: var(--ink-muted); --lib-line: var(--paper-line); --lib-hover: var(--paper-hover); --lib-side: var(--paper); color: var(--ink); color-scheme: var(--paper-scheme); }
/* The window is only a frame for the card, centred on the whole window,
   over the song's sidebar too. */
#library-dialog {
  inset: 0;
  width: min(80vw, 1400px);
  height: 80vh;
  max-height: none;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
}
#library-dialog[open] { display: flex; flex-direction: column; }
#library-dialog > .library { flex: 1; height: auto; }
.library-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--lib-line); }
.library-head button { white-space: nowrap; }
/* An import running: how far it has got, the file it is on, and Stop. */
.import-strip { flex: none; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; padding: 10px 18px; border-bottom: 1px solid var(--lib-line); font-size: 13px; }
.import-strip[hidden], .import-result[hidden] { display: none; }
.import-now { min-width: 0; display: flex; gap: 10px; }
#import-count { flex: none; font-weight: 600; }
.import-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--lib-dim); }
.import-bar { grid-column: 1; height: 3px; border-radius: 2px; background: var(--lib-line); overflow: hidden; }
#import-fill { height: 100%; width: 0; background: var(--brass); transition: width 0.2s; }
#import-stop { grid-column: 2; grid-row: 1 / span 2; }
/* What the last import did, when some files could not be read. */
.import-result { flex: none; position: relative; max-height: 30vh; overflow-y: auto; padding: 10px 44px 10px 18px; border-bottom: 1px solid var(--lib-line); font-size: 13px; }
.import-result p { margin: 0; }
#import-which { padding: 0; border: none; background: transparent; color: var(--brass-bright); font-weight: 600; }
#import-which:hover { text-decoration: underline; }
#import-bad { margin: 6px 0 0; padding-left: 18px; color: var(--lib-dim); font-size: 12px; }
#import-bad:empty { display: none; }
#import-bad code { color: inherit; overflow-wrap: anywhere; }
#import-done { position: absolute; top: 6px; right: 10px; font-size: 18px; line-height: 1; color: var(--lib-dim); background: transparent; border-color: transparent; }
.library .library-search { flex: 1; width: auto; background: var(--paper); border-color: var(--paper-line); color: var(--ink); }
/* The × is a small glyph in a 32px button, so the button reaches into the
   padding and the × sits as far from the edge as the title. */
#recent .library-close { display: none; }
.library-close { margin-right: -13px; font-size: 20px; line-height: 1; color: var(--lib-dim); background: transparent; border-color: transparent; }
.library-close:hover { color: inherit; }
.library-body { flex: 1; min-height: 0; display: flex; container-type: inline-size; }
.library-side { flex: none; width: 210px; overflow-y: auto; padding: 14px 10px; border-right: 1px solid var(--lib-line); background: var(--lib-side); }
.library-side[hidden] { display: none; }
.side-group { display: grid; grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; }
.side-head { margin: 0 0 4px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lib-dim); }
.side-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 14px;
}
.side-item:hover { background: var(--lib-hover); }
.side-item.none { color: var(--lib-dim); }
.side-item[aria-pressed="true"] { background: var(--lib-hover); color: var(--brass); font-weight: 600; }
.side-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { flex: none; color: var(--lib-dim); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.side-more { justify-self: start; padding: 4px 8px; border: 0; background: transparent; color: var(--lib-dim); font-size: 12px; }
.side-more:hover { color: inherit; }
/* Folders: a + to make one, a ••• in place of a folder's count on a hover,
   the tuning a renamed tuning folder files under its name, and New on a
   folder an import made until it is opened. */
.side-folders .side-head { display: flex; align-items: center; justify-content: space-between; }
.side-add { padding: 0 6px; border: 0; border-radius: 4px; background: transparent; color: var(--lib-dim); font-size: 16px; font-weight: 400; line-height: 20px; }
.side-add:hover { background: var(--lib-hover); color: inherit; }
.side-folders .side-item { align-items: center; }
.side-item.unfiled { color: var(--lib-dim); }
.side-folder { position: relative; display: grid; }
.side-dots { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); height: 22px; padding: 0 5px; border: 0; border-radius: 4px; background: transparent; color: var(--lib-dim); font-size: 11px; letter-spacing: 1px; opacity: 0; }
.side-folder:hover .side-dots, .side-dots:focus-visible, .side-dots[aria-expanded="true"] { opacity: 1; }
.side-dots:hover { background: var(--lib-line); color: inherit; }
.side-folder:hover .side-count, .side-folder:has(.side-dots:focus-visible) .side-count { visibility: hidden; }
.side-sub { display: block; color: var(--lib-dim); font-size: 11px; font-weight: 400; }
.side-new { margin-left: 6px; padding: 0 5px; border-radius: 99px; background: var(--brass); color: var(--on-brass); font-size: 10px; font-weight: 700; vertical-align: 1px; }
.side-rename { padding: 1px 2px; }
.side-rename input { width: 100%; padding: 3px 6px; border: 1.5px solid var(--brass); border-radius: 5px; background: var(--board); color: var(--board-text); font: inherit; font-size: 14px; outline: none; }
.library .side-rename input { background: var(--paper); color: var(--ink); }
.library-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 10px 18px 0; }
.library-status { flex: none; margin: 0 0 6px; color: var(--lib-dim); font-size: 13px; }
.library-status[hidden], .library-cols[hidden] { display: none; }
.library-status .filter-clear { margin: 0; padding: 0; }
.library-folder { margin-right: 4px; font-size: 14px; }
/* The songs picked to move: how many, Move to… and Clear, over the list. */
.library-picked { flex: none; display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 4px 8px; border: 1px solid var(--lib-line); border-radius: 8px; background: var(--lib-hover); font-size: 13px; }
.library-picked[hidden] { display: none; }
.library-picked b { margin-right: auto; }
.library-picked button { padding: 2px 10px; font-size: 12px; }
.library-room { color: var(--good); font-weight: 600; }
/* The headers and every row share one set of columns: title, artist, album,
   tuning, parts, played, the audio dot, and room for the row's •••, after a
   box to pick the song while the sidebar shows. */
.library-main { --lib-cols: 16px minmax(0, 2.6fr) minmax(0, 1.8fr) minmax(0, 2fr) 8.5em 42px 6.5em 10px 22px; }
/* In a room the Library window gains a Room column before the dot. */
.library.in-room .library-main { --lib-cols: 16px minmax(0, 2.6fr) minmax(0, 1.8fr) minmax(0, 2fr) 8.5em 42px 6.5em var(--lib-room) 10px 22px; }
.library { --lib-room: 104px; --lib-gap: 14px; }
.library-cols, .song-open { display: grid; grid-template-columns: var(--lib-cols); gap: 0 14px; align-items: center; padding: 0 10px; }
.library-cols { flex: none; border-bottom: 1px solid var(--lib-line); }
.col {
  padding: 8px 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lib-dim);
  white-space: nowrap;
}
.col:hover { color: inherit; }
.col:not([aria-sort="none"]) { color: var(--brass); }
.col-arrow { font-size: 9px; }
/* Parts does not sort, so it never lights up. */
.col.col-parts, .col.col-room { color: var(--lib-dim); cursor: default; }
.library-list { flex: 1; min-height: 0; list-style: none; margin: 0; padding: 0 0 10px; overflow-y: auto; }
.library-nomatch { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 8px; color: var(--lib-dim); }
/* Filter chips: shown instead of the sidebar when the library is narrow.
   Each is a native select laid over a pill face, so it opens the system menu
   and takes the keyboard. A set filter wears the accent and an x. */
.library-bar { display: none; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
@container (max-width: 720px) {
  .library-side { display: none; }
  .library-bar { display: flex; }
  .library-bar[hidden] { display: none; }
  .library-main { --lib-cols: minmax(0, 2.6fr) minmax(0, 1.6fr) minmax(0, 1.4fr) 7.5em 42px 5.5em 10px 22px; }
  .library.in-room .library-main { --lib-cols: minmax(0, 2.6fr) minmax(0, 1.6fr) minmax(0, 1.4fr) 7.5em 42px 5.5em var(--lib-room) 10px 22px; }
  .library-cols, .song-open { column-gap: 10px; }
  .library-main { --lib-gap: 10px; }
  .col-check, .song-check-cell, .song-check { display: none; }
}
@container (max-width: 520px) {
  /* Too narrow for parts too: the Parts chip and each row's tooltip still
     give them. */
  .library-main { --lib-cols: minmax(0, 2.6fr) minmax(0, 1.8fr) 7.5em 5.5em 10px 22px; }
  /* In a room, Played gives way to the Room column. */
  .library.in-room .library-main { --lib-cols: minmax(0, 2.6fr) minmax(0, 1.8fr) 7.5em var(--lib-room) 10px 22px; }
  .library.in-room :is(.col-played, .song-when) { display: none; }
  .col-album, .song-album, .col-parts, .library-main .song-open > .song-parts { display: none; }
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--board-line);
  border-radius: 999px;
  background: var(--board-raised);
  color: var(--board-text);
  font-size: 12px;
}
.filter-chip:hover { border-color: var(--board-dim); }
.filter-chip.on { border-color: var(--brass); color: var(--brass-bright); }
.filter-pick { position: relative; display: inline-flex; min-width: 0; }
.filter-face { display: inline-flex; gap: 5px; min-width: 0; padding: 3px 10px; white-space: nowrap; }
.filter-chip.on .filter-face { padding-right: 4px; }
.filter-key { color: var(--board-dim); }
.filter-chip.on .filter-key { color: inherit; }
.filter-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.filter-value::after { content: " \25BE"; color: var(--board-dim); }
.filter-chip.on .filter-value::after { color: inherit; opacity: 0.7; }
.filter-chip select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  appearance: none;
}
.filter-chip:has(select:focus-visible) { outline: 2px solid var(--brass-bright); outline-offset: 2px; }
.filter-x { flex: none; padding: 0 8px 0 2px; border: 0; background: transparent; color: inherit; font-size: 14px; line-height: 1; border-radius: 0 999px 999px 0; }
.filter-x:hover { border: 0; opacity: 0.75; }
.filter-clear { margin-left: auto; padding: 3px 4px; border: 0; background: transparent; color: var(--brass-bright); font-size: 12px; }
.filter-clear:hover { border: 0; text-decoration: underline; }
.library-nomatch .filter-clear { margin-left: 0; }
/* A song a row, with a faint ••• at its end that opens the row menu. */
.song { position: relative; border-bottom: 1px solid color-mix(in srgb, var(--lib-line) 50%, transparent); }
.song:hover, .song:focus-within, .song.menu-open { background: var(--lib-hover); }
.song.picked { background: color-mix(in srgb, var(--brass) 16%, transparent); }
.song-check { position: absolute; top: 50%; left: 10px; width: 14px; height: 14px; margin: -7px 0 0; accent-color: var(--brass); cursor: pointer; }
.song-open { width: 100%; height: 38px; text-align: left; background: transparent; border: 0; border-radius: 0; font-size: 14px; }
.song-open > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-title { font-weight: 600; font-size: 15px; }
.song-album, .song-when { color: var(--lib-dim); }
.song-when { font-size: 13px; font-variant-numeric: tabular-nums; }
.song-open > .song-tunings { display: flex; gap: 4px; }
.song-tuning { flex: none; padding: 1px 6px; border: 1px solid var(--lib-line); border-radius: 4px; color: var(--lib-dim); font-size: 12px; }
.song-tuning:first-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.song-tuning.more { padding: 1px 4px; cursor: default; }
/* G and B: lit for a part the song has, hollow for one it lacks. */
.song-open > .song-parts { display: flex; gap: 3px; }
.part { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--lib-line); color: var(--lib-line); font-size: 10.5px; font-weight: 700; line-height: 1; }
.part.on { background: color-mix(in srgb, var(--brass) 22%, transparent); box-shadow: none; color: var(--brass); }
/* Every tuning of a song, under its tuning cell while the pointer is on it. */
.tunings-list {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 5px 0;
  max-width: 340px;
  background: var(--board);
  color: var(--board-text);
  border: 1px solid var(--board-line);
  border-radius: 8px;
  box-shadow: 0 12px 36px var(--shadow);
  font-size: 13px;
  pointer-events: none;
}
.tunings-line { display: flex; gap: 16px; justify-content: space-between; padding: 3px 12px; }
.tunings-line:first-child .tunings-name { color: var(--brass-bright); }
.tunings-name { flex: none; font-weight: 600; }
.tunings-tracks { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--board-dim); }
.song-audio { justify-self: end; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--lib-line); }
.song-audio.on { background: var(--brass); border-color: var(--brass); }
.song.missing .song-album { color: var(--mute); }
.song-more {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: color-mix(in srgb, var(--lib-dim) 55%, transparent);
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 26px;
}
.song:hover .song-more, .song:focus-within .song-more { color: var(--lib-dim); }
.song-more:hover, .song-more:focus-visible, .song.menu-open .song-more { color: inherit; background: var(--lib-line); }
/* The Room cell: where the room has the song, or + Queue, which shows on
   the row under the pointer or the keyboard. It sits over the cell, as the
   ••• does over the last column, since the row is one button. */
.song-room { font-size: 12.5px; font-weight: 600; color: var(--good); }
.room-queued { padding: 2px 8px; border-radius: 10px; background: color-mix(in srgb, var(--good) 18%, transparent); }
.song-queue {
  position: absolute;
  top: 7px;
  right: calc(10px + 22px + 10px + 2 * var(--lib-gap) + var(--lib-room));
  transform: translateX(100%);
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--good);
  border-radius: 5px;
  background: transparent;
  color: var(--good);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
}
.song:hover .song-queue, .song:focus-within .song-queue { opacity: 1; }
.song-queue:hover:not(:disabled) { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.song .song-queue:disabled { opacity: 0.5; }
/* The row menu: what a ••• or a right-click on a row opens. */
.song-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 4px;
  min-width: 180px;
  flex-direction: column;
  overflow: visible;
  background: var(--board);
  color: var(--board-text);
  border: 1px solid var(--board-line);
  border-radius: 8px;
  box-shadow: 0 12px 36px var(--shadow);
}
.song-menu:popover-open { display: flex; }
/* Move to folder opens its folders beside the menu. */
.song-menu-sub { display: grid; }
.song-menu .song-menu-more { display: flex; justify-content: space-between; gap: 12px; }
.song-menu-arrow { color: var(--lib-dim); }
.song-submenu { position: absolute; left: calc(100% + 2px); min-width: 150px; max-height: 60vh; display: flex; flex-direction: column; padding: 4px; background: var(--board); border: 1px solid var(--board-line); border-radius: 8px; box-shadow: 0 12px 36px var(--shadow); }
.song-submenu.left { left: auto; right: calc(100% + 2px); }
.song-submenu[hidden] { display: none; }
.song-menu .folder-list { display: flex; flex-direction: column; min-height: 0; max-height: 50vh; overflow-y: auto; }
.song-menu .current::before { content: "\2713  "; }
.song-menu .dim { color: var(--lib-dim); }
.song-menu button { text-align: left; padding: 6px 10px; border-color: transparent; background: transparent; border-radius: 5px; font-size: 13px; }
.song-menu button:hover, .song-menu button:focus-visible { background: var(--board-line); outline: none; }
.song-menu hr { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--board-line); }
.song-menu .song-menu-remove { color: var(--mute); }
.song-menu .song-menu-remove.danger, .song-menu .song-menu-remove.danger:hover, .song-menu .song-menu-remove.danger:focus-visible { background: var(--mute); color: #fff; }
.library :is(.song-menu, .song-submenu) { background: var(--paper-raised); color: var(--ink); border-color: var(--paper-line); }
.library .song-menu button:not(.danger):hover, .library .song-menu button:not(.danger):focus-visible { background: var(--paper-hover); }
.library .song-menu hr { border-color: var(--paper-line); }

/* The tab sheet. The canvases sit over the scroll area, sized to the
   viewport; the spacer gives the scrollbar the song's full height. */
#stage {
  grid-area: stage;
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
}
/* While you read a song of your own, the room's keeps playing: this says
   which, and takes you back to it. */
#stage-bar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 5px 6px 5px 12px; font-size: 13px; color: var(--board-text); background: var(--board); border: 1px solid var(--good); border-radius: 8px; box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); }
#stage-bar[hidden] { display: none; }
#stage-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#stage-back { flex: none; padding: 3px 10px; font-size: 12px; }
/* Only Play, Pause and Stop reach the room's song from your own. */
body.offstage #seek, body.offstage #speed, body.offstage #speed-range { opacity: 0.45; pointer-events: none; }
/* Windows draws the system I-beam by inverting what is under it, which the
   webview cannot do, so it shows white on the light sheet. This one is black
   with a white halo and reads on either theme. */
#sheet {
  position: absolute; inset: 0; overflow-y: auto; outline: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='24'%3E%3Cpath d='M5 3h6M8 3v18M5 21h6' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M5 3h6M8 3v18M5 21h6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 8 12, text;
}
/* The sheet can differ from the window, as in Classic, so its native
   scrollbars follow the sheet. */
#sheet, #empty { color-scheme: var(--paper-scheme); }
#spacer { width: 1px; }
#tab, #cursor { position: absolute; left: 0; top: 0; pointer-events: none; }
#highway-view { position: absolute; inset: 0; background: #000; }
#highway-view[hidden] { display: none; }
#highway { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Placed by showStartsIn(): its bottom middle on the point it is given. */
#starts-in {
  position: absolute;
  transform: translate(-50%, calc(-100% - 6px));
  pointer-events: none;
  padding: 3px 12px;
  border: 1px solid var(--brass);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(0 0 0 / 45%);
}
#starts-in[hidden] { display: none; }
/* visibility, not display: none, because relayout() reads the sheet's width
   while the highway covers it. */
body.highway #sheet, body.highway #tab, body.highway #cursor { visibility: hidden; }
/* --strip is set by relayout(): one tab system tall. On one line the sheet is
   a strip that tall, centered, that scrolls sideways without a scrollbar;
   "both" moves the strip to the bottom. A system taller than the stage, as
   with many parts shown, fills the stage and scrolls up and down too. */
body.line #sheet { top: max(0px, 50% - var(--strip) / 2); height: min(var(--strip), 100%); overflow: auto; scrollbar-width: none; }
body.line #sheet::-webkit-scrollbar { display: none; }
body.line #tab, body.line #cursor { top: max(0px, 50% - var(--strip) / 2); }
body.both #highway-view { bottom: min(var(--split, var(--strip)), 100%); }
body.both #sheet { top: auto; height: min(var(--split, var(--strip)), 100%); }
body.both #tab, body.both #cursor { top: auto; bottom: 0; }
/* The handle on the line between the highway and the tab in "both". --split,
   the tab's height, is set while it is dragged; without it the tab is one
   system tall. */
#split {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(min(var(--split, var(--strip)), 100%) - 5px);
  height: 10px;
  display: none;
  cursor: row-resize;
  touch-action: none;
  outline: none;
}
body.both #split { display: block; }
#split::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--board-line); }
#split::after {
  content: "";
  position: absolute;
  left: calc(50% - 20px);
  top: 2px;
  width: 40px;
  height: 6px;
  border-radius: 3px;
  background: var(--board-dim);
}
#split:hover::before, #split.dragging::before, #split:focus-visible::before { background: var(--brass); }
#split:hover::after, #split.dragging::after, #split:focus-visible::after { background: var(--brass-bright); }

#empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  color: var(--ink);
  text-align: center;
  padding: 24px;
}
#empty h2 { margin: 0; font-size: 26px; font-weight: 700; }
#empty p { margin: 0 0 14px; color: var(--ink-muted); }
#open-empty, #import-empty { padding: 9px 18px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; }
/* The library on the home screen: a wordmark over one large card that holds
   the search, the filters and the songs. It follows the theme, paper in light
   and dark. */
#empty.has-songs { background: radial-gradient(ellipse 60% 55% at 50% 45%, var(--paper-raised), var(--paper) 70%); }
#recent { width: min(1400px, calc(100vw - var(--side-w) - 48px)); margin-top: 28px; text-align: left; }
#recent[hidden] { display: none; }
.home-mark { margin-bottom: 16px; text-align: center; font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: 0.02em; }
.home-mark span { color: var(--brass); }
.home-mark::after {
  content: "";
  display: block;
  width: 120px;
  height: 13px;
  margin: 8px auto 0;
  background: repeating-linear-gradient(to bottom, var(--staff) 0 1px, transparent 1px 2.5px);
  opacity: 0.6;
}
.home-card {
  display: flex;
  flex-direction: column;
  height: min(70vh, calc(100vh - 200px));
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--paper-line);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
}
.library .filter-chip { background: var(--paper); border-color: var(--paper-line); color: var(--ink); }
.library .filter-chip:hover { border-color: var(--ink-faint); }
.library .filter-chip.on { border-color: var(--brass); color: var(--brass-bright); }
.library .filter-key, .library .filter-value::after { color: var(--ink-muted); }
.library .filter-chip.on .filter-key, .library .filter-chip.on .filter-value::after { color: inherit; }
#recent .library-drop { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--ink-faint); }
/* With songs in the library, the search and its open button replace the
   big heading. */
#empty.has-songs > h2, #empty.has-songs > p, #empty.has-songs > .empty-actions { display: none; }
#empty.has-songs #recent { margin-top: 0; }
#options-home { position: absolute; top: 10px; right: 12px; color: var(--ink-faint); background: transparent; border-color: transparent; }
#options-home:hover { color: var(--ink); border-color: var(--paper-line); }
body.loaded #empty { display: none; }
body.joining #empty > :not(#home-step, #options-home) { display: none; }
#home-step { --track: var(--paper-line); align-items: stretch; width: min(360px, calc(100vw - var(--side-w) - 48px)); text-align: center; }
#home-step .step-says { margin: 0; color: var(--ink-muted); font-size: 14px; }
#home-step .step-cancel { align-self: center; }
body.listening :is(#sync-open, #stop, #play, #library-open, #speed, #video-form, #jam-hear [data-hear="play"]) { display: none; }
body.listening #seek { pointer-events: none; }
#listening-says { margin: 0; color: var(--board-dim); font-size: 12px; }
#listening-says[hidden] { display: none; }
body.dragging #stage { box-shadow: inset 0 0 0 3px var(--brass); }

/* A popover, so the toast shows above an open dialog too. */
#error {
  position: fixed;
  inset: 16px auto auto calc(var(--side-w) + (100% - var(--side-w)) / 2);
  margin: 0;
  border: 0;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 10px 10px 16px;
  background: var(--board);
  color: var(--board-text);
  border-left: 4px solid var(--mute);
  border-radius: 6px;
  box-shadow: 0 6px 24px var(--shadow);
}
#error:not(:popover-open) { display: none; }
#notice {
  position: fixed;
  inset: 16px auto auto calc(var(--side-w) + (100% - var(--side-w)) / 2);
  margin: 0;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 0;
  border-left: 4px solid var(--brass);
  border-radius: 6px;
  background: var(--board);
  color: var(--board-text);
  font-weight: 600;
  box-shadow: 0 6px 24px var(--shadow);
}
#notice:not(:popover-open) { display: none; }
#notice.good { border-left-color: var(--good); }
#notice button { margin-left: 12px; }
#notice b { color: var(--brass-bright); }
/* Under a notice when one shows, so the two never cover each other. */
/* Centred on the window, not the stage, just under the tab strip. */
#room-count {
  position: fixed;
  inset: 44px auto auto 50%;
  margin: 0;
  transform: translateX(-50%);
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 8px;
  border: 1px solid var(--board-line);
  border-radius: 999px;
  background: var(--board-raised);
  color: var(--board-text);
  box-shadow: 0 6px 20px var(--shadow);
  font-weight: 600;
}
#room-count:popover-open { display: flex; }
#room-count:not(:popover-open) { display: none; }
#room-count .ring { position: relative; display: grid; place-items: center; width: 34px; height: 34px; }
#room-count svg { position: absolute; inset: 0; transform: rotate(-90deg); }
#room-count circle { fill: none; stroke: var(--board-line); stroke-width: 3; }
#room-count circle.left { stroke: var(--brass-bright); stroke-dasharray: 100; transition: stroke-dashoffset 200ms linear; }
#room-count b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
#room-count button { border-radius: 999px; }
#room-count [hidden] { display: none; }
#room-count > span:not(.ring):last-child { padding-right: 8px; }
#room-count:has(button[hidden]) > span:not(.ring) { padding-right: 8px; }

#room-transfer,
#audio-progress,
#reading-files,
#opening {
  --track: var(--board-line);
  position: fixed;
  inset: 16px auto auto calc(var(--side-w) + (100% - var(--side-w)) / 2);
  margin: 0;
  transform: translateX(-50%);
  width: 280px;
  padding: 10px 16px;
  border: 0;
  border-left: 4px solid var(--brass);
  border-radius: 6px;
  background: var(--board);
  color: var(--board-text);
  box-shadow: 0 6px 24px var(--shadow);
}
#notice:popover-open ~ #room-transfer,
#notice:popover-open ~ #audio-progress,
#notice:popover-open ~ #reading-files,
#notice:popover-open ~ #opening { top: 68px; }
#room-transfer:not(:popover-open),
#audio-progress:not(:popover-open),
#reading-files:not(:popover-open),
#opening:not(:popover-open) { display: none; }
#audio-progress p,
#reading-files p,
#opening p { margin: 0 0 6px; font-weight: 600; }
#audio-progress .step-bar,
#reading-files .step-bar,
#opening .step-bar { display: block; }
#opening .name { display: block; margin-top: 6px; color: var(--board-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#audio-progress .amount { display: block; margin-top: 6px; color: var(--board-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
#audio-progress .amount:empty { display: none; }
#room-transfer p { margin: 0 0 6px; font-weight: 600; }
#room-transfer ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#room-transfer li { display: grid; grid-template-columns: minmax(0, 1fr) 96px 56px; align-items: center; gap: 8px; font-size: 13px; }
#room-transfer .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#room-transfer .step-bar { display: block; }
#room-transfer .pct { color: var(--board-dim); font-variant-numeric: tabular-nums; text-align: right; }
#room-transfer .missed { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
#room-transfer .missed[hidden] { display: none; }
#room-transfer .missed button { flex: none; margin-left: auto; }
#error p { margin: 0; }
#error button { flex: none; }

/* Transport. */
#transport {
  grid-area: transport;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--board-line);
  flex-wrap: wrap;
  /* WebKit takes a closing popover out of the top layer at once, so the
     mixer slides back down under the bar, which has to cover it. */
  position: relative;
  z-index: 1;
  background: var(--board);
}
.buttons { display: flex; gap: 6px; }
.buttons button {
  width: 40px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
}
.buttons svg { width: 18px; height: 18px; fill: currentColor; }
#play { width: 52px; background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
#play:hover:not(:disabled) { background: var(--brass-bright); }
#play:disabled { background: var(--board-line); border-color: var(--board-line); color: var(--board-dim); }
#play .when-playing, body.playing #play .when-paused { display: none; }
body.playing #play .when-playing { display: block; }
/* Play was pressed before the audio lined up: it spins until it plays. */
#play .when-waiting, body.waiting #play svg { display: none; }
body.waiting #play .when-waiting {
  display: block;
  width: 16px;
  height: 16px;
  border: 2.5px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
/* During a count-in the button shows the beat being counted. */
#play .when-counting, body.counting #play :is(.when-paused, .when-playing) { display: none; }
body.counting #play .when-counting { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

#where { display: grid; min-width: 96px; font-variant-numeric: tabular-nums; }
#bar-now { font-weight: 600; }
#time { color: var(--board-dim); font-size: 12px; }

#seek {
  position: relative;
  flex: 1;
  min-width: 160px;
  height: 28px;
  cursor: pointer;
  touch-action: none;
}
#seek::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 4px;
  border-radius: 2px;
  background: var(--board-line);
}
#seek-fill { position: absolute; left: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--board-dim); }
#seek-loop { position: absolute; top: 7px; height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--brass) 35%, transparent); display: none; }
#seek-thumb {
  position: absolute;
  top: 6px;
  width: 4px;
  height: 16px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--brass-bright);
}
/* The audio is still loading: the bar says what it is doing, and a slice
   slides along it in place of the playhead. */
#seek-busy, #seek-says, #seek-amount { display: none; }
body.audio-loading #seek-thumb { display: none; }
body.audio-loading #seek-busy { display: block; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; overflow: hidden; }
#seek-busy::before { content: ""; display: block; width: 30%; height: 100%; border-radius: 2px; background: var(--brass); animation: step-busy 1.2s ease-in-out infinite; }
body.audio-loading #seek-says { display: block; position: absolute; left: 0; top: -6px; font-size: 11px; line-height: 14px; color: var(--board-dim); white-space: nowrap; }
/* Once the size is known, the slice becomes a fill that grows with the download. */
#seek-busy.known::before { width: calc(var(--got, 0) * 100%); animation: none; opacity: 1; }
body.audio-loading #seek-amount { display: block; position: absolute; right: 0; top: -6px; font-size: 11px; line-height: 14px; color: var(--board-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
#seek-amount b { color: var(--board-text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  #seek-busy:not(.known)::before { width: 100%; animation: none; opacity: 0.4; }
}

/* Setup, at the right of the bar: tabs for the view, the tab's spacing and
   practice, the speed, the beat and in the app the count-in and the grades. It slides
   up out of the bar like the mixer, as a card at the right like the room's. */
#setup-open { display: none; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; color: var(--board-dim); white-space: nowrap; }
body.loaded #setup-open { display: flex; }
#setup-open span { font-size: 9px; }
#setup-open:hover, body:has(#setup:popover-open) #setup-open { color: var(--board-text); }
body:has(#setup:popover-open) #setup-open { border-color: var(--brass); }
#setup { left: auto; }
/* Its tabs share one grid cell, so the panel keeps the taller one's height
   and its top stays put when the tab changes. */
#setup-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  width: 280px;
  height: auto;
  padding: 10px 14px 10px;
  border-left: 1px solid var(--board-line);
}
#setup-tabs { display: flex; margin-bottom: 10px; padding: 2px; gap: 2px; border-radius: 7px; background: var(--board-raised); }
#setup-tabs button { flex: 1; border: none; border-radius: 5px; padding: 6px 10px; font-size: 13px; background: transparent; color: var(--board-dim); }
#setup-tabs button:hover { color: var(--board-text); }
#setup-tabs button[aria-selected="true"] { background: var(--brass); color: var(--on-brass); font-weight: 700; }
#setup-tabs button:focus-visible { outline-offset: -2px; }
.setup-pane { grid-area: 2 / 1; display: flex; flex-direction: column; min-width: 0; }
.setup-pane[hidden] { display: flex; visibility: hidden; }
/* The speed's slider, and its readout that takes a typed speed. */
#speed input[type="range"] { flex: 1; min-width: 0; }
#speed { gap: 10px; }
#speed-value, #speed-input { text-align: center; }
/* Click and Count: the name, the level and the switch on one line. */
#setup .beat { gap: 12px; }
.beat .setting-text { flex: 1; }
.beat input[type="range"] { flex: 0 0 90px; min-width: 0; }
.beat.silent input[type="range"] { opacity: 0.5; }
.beat :disabled { opacity: 0.45; cursor: default; }
.setup-label { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--board-dim); }
.setup-label span { font-weight: 400; letter-spacing: 0; text-transform: none; }
#setup .setup-label:not(:first-child) { margin-top: 14px; }
#setup .setting { min-height: 0; padding: 8px 0; border-bottom: none; border-top: 1px solid var(--board-line); }
#setup .setup-pane > .setting:first-child { border-top: none; }
#grades-clear { padding: 4px 10px; font-size: 12px; }
#views, #layouts, #note-gap, #tab-spacing, #line-scroll { display: flex; padding: 2px; gap: 2px; border-radius: 7px; background: var(--board-raised); }
#views button, #layouts button, #note-gap button, #tab-spacing button, #line-scroll button { flex: 1; border: none; border-radius: 5px; padding: 6px 10px; font-size: 13px; background: transparent; color: var(--board-dim); }
#views button:hover, #layouts button:hover:not(:disabled), #note-gap button:hover:not(:disabled), #tab-spacing button:hover:not(:disabled), #line-scroll button:hover:not(:disabled) { color: var(--board-text); }
#views button[aria-pressed="true"], #layouts button[aria-pressed="true"], #note-gap button[aria-pressed="true"], #tab-spacing button[aria-pressed="true"], #line-scroll button[aria-pressed="true"] { background: var(--brass); color: var(--on-brass); font-weight: 700; }
#views button:focus-visible, #layouts button:focus-visible, #note-gap button:focus-visible, #tab-spacing button:focus-visible, #line-scroll button:focus-visible { outline-offset: -2px; }
#layouts { margin-bottom: 6px; }
#setup .choice-row { flex-direction: column; align-items: stretch; gap: 8px; padding-bottom: 12px; }
#note-gap button, #tab-spacing button, #line-scroll button { padding: 6px 4px; white-space: nowrap; }
#text-size { flex: none; display: flex; padding: 2px; gap: 2px; border-radius: 7px; background: var(--board-raised); }
#text-size button { width: 30px; height: 26px; padding: 0; border: none; border-radius: 5px; line-height: 1; background: transparent; color: var(--board-dim); }
#text-size button[data-value="14"] { font-size: 11px; }
#text-size button[data-value="16"] { font-size: 14px; }
#text-size button[data-value="18"] { font-size: 17px; }
#text-size button:hover:not(:disabled) { color: var(--board-text); }
#text-size button[aria-pressed="true"] { background: var(--brass); color: var(--on-brass); font-weight: 700; }
#text-size button:disabled { opacity: 0.4; cursor: not-allowed; }
#text-size button:focus-visible { outline-offset: -2px; }
#layouts button:disabled, #note-gap button:disabled, #tab-spacing button:disabled, #line-scroll button:disabled { opacity: 0.4; cursor: not-allowed; }
/* Off, the layout and Scrolling buttons let the mouse through to their group,
   which opens #tab-off-help. */
#layouts button:disabled, #line-scroll button:disabled { pointer-events: none; }
#layouts:has(:disabled), #line-scroll-row:has(:disabled) { cursor: not-allowed; }
#layouts button[aria-pressed="true"]:disabled, #note-gap button[aria-pressed="true"]:disabled, #tab-spacing button[aria-pressed="true"]:disabled, #line-scroll button[aria-pressed="true"]:disabled { background: var(--board-line); color: var(--board-text); }
/* The ? on the Tab heading, and what it opens: a card beside Setup. */
.setup-label span:has(.help-open) { display: flex; align-items: center; gap: 8px; }
.help-open { position: relative; width: 18px; height: 18px; padding: 0; border: 1px solid var(--board-line); border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; background: var(--board-raised); color: var(--board-dim); }
.help-open:hover, .help-open:focus-visible, body:has(#tab-help:popover-open) #tab-help-open, body:has(#grade-help:popover-open) #grade-help-open { color: var(--board-text); border-color: var(--brass); }
#tab-help, #tab-off-help, #grade-help, #show-off-help {
  inset: auto calc(280px + 12px) calc(var(--transport-h, 57px) + 12px) auto;
  width: 300px;
  max-width: calc(100vw - 280px - 24px);
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--board-line);
  border-radius: 8px;
  background: var(--board);
  color: var(--board-text);
  box-shadow: 0 12px 36px var(--shadow);
  font-size: 12px;
  line-height: 1.45;
}
/* Placed under All guitars when it opens. */
#show-off-help { inset: auto; width: 280px; max-width: calc(100vw - 24px); }
#tab-help p, #tab-off-help p, #grade-help p, #show-off-help p { margin: 0 0 10px; color: var(--board-dim); }
#tab-help p:last-child, #tab-off-help p:last-child, #grade-help p:last-child, #show-off-help p:last-child { margin-bottom: 0; }
#tab-help b, #tab-off-help b, #grade-help b, #show-off-help b { font-weight: 700; color: var(--board-text); }
.tab-help-item { display: flex; gap: 12px; align-items: flex-start; }
.tab-help-item svg { flex: none; width: 76px; height: 55px; margin-top: 2px; color: var(--brass); }
/* Opened by resting on a row, it fades the other row's part. */
#tab-help[data-on="room"] .tab-help-item:not([data-for="room"]), #tab-help[data-on="speed"] .tab-help-item:not([data-for="speed"]) { opacity: 0.5; }
/* A dot on Setup and its ? until the player has seen what these do. */
.new-dot { display: none; position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); }
#setup-open { position: relative; }
body.tab-help-new .new-dot { display: block; }
.buttons #record { width: 36px; border-radius: 50%; }
#record span { width: 12px; height: 12px; border-radius: 50%; background: var(--mute); }
#record:disabled { cursor: not-allowed; background: var(--board); }
#record:disabled:hover { border-color: var(--board-line); }
#record:disabled span { background: var(--board-line); }
#record[aria-pressed="true"] { background: var(--mute); border-color: var(--mute); }
#record[aria-pressed="true"] span { width: 10px; height: 10px; border-radius: 2px; background: var(--on-brass); }
#record-time { align-self: center; min-width: 34px; margin-right: 4px; font-size: 13px; font-weight: 700; color: var(--mute); font-variant-numeric: tabular-nums; }
#record-time[hidden], #record[hidden], #takes-open[hidden] { display: none; }

#takes-open { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; color: var(--board-dim); white-space: nowrap; }
#takes-open .caret { font-size: 9px; }
#takes-open:hover, body:has(#takes:popover-open) #takes-open { color: var(--board-text); }
body:has(#takes:popover-open) #takes-open { border-color: var(--brass); }
/* How many takes were saved since the drawer was last open. */
#takes-new { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--brass); color: var(--on-brass); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
#takes-new[hidden] { display: none; }
/* While a take records, Takes wears its light: that is where it will be. */
#takes-open.recording, #takes-open.recording:hover { color: var(--mute); border-color: var(--mute); }
#takes-open.recording::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mute); animation: takes-pulse 1.2s ease-in-out infinite; }
@keyframes takes-pulse { 50% { opacity: 0.35; } }
/* The drawer: every take on the left, the picked one on the right. */
#takes-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  height: 240px;
  padding: 12px 16px;
}
#takes-panel:has(> #take-picked[hidden]) { grid-template-columns: minmax(0, 1fr); }
#takes-all { display: flex; flex-direction: column; min-height: 0; }
#takes-none { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 13px; color: var(--board-dim); }
#takes-none[hidden], #take-picked[hidden] { display: none; }
.takes-dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--mute); }
/* With no takes, the empty drawer points at Record. */
body:has(#takes:popover-open #takes-none:not([hidden])) #record:not(:disabled) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--mute) 35%, transparent); animation: takes-pulse 1.2s ease-in-out infinite; }
#takes-list { list-style: none; margin: 0 -6px; padding: 0; min-height: 0; overflow-y: auto; }
#takes-list li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 5px; font-size: 13px; cursor: pointer; }
#takes-list li:hover, #takes-list li[aria-selected="true"] { background: var(--board-raised); }
#takes-list .take-play { width: 24px; height: 24px; padding: 0; flex: none; display: grid; place-items: center; border-radius: 50%; }
#takes-list .take-play svg { width: 10px; height: 10px; fill: currentColor; }
#takes-list .take-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#takes-list .take-secs { color: var(--board-dim); font-variant-numeric: tabular-nums; }
#take-picked { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding-left: 16px; border-left: 1px solid var(--board-line); }
#take-name { width: 100%; padding: 5px 8px; margin-left: -8px; border: 1px solid transparent; border-radius: 5px; background: transparent; font-size: 13px; font-weight: 700; text-overflow: ellipsis; }
#take-name:not([readonly]) { border-color: var(--brass); background: var(--board-raised); }
#take-wave { --played: var(--brass); --unplayed: color-mix(in srgb, var(--brass) 45%, transparent); height: 64px; border-radius: 4px; cursor: pointer; }
#take-wave canvas { display: block; width: 100%; height: 100%; }
.take-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.take-actions button { padding: 4px 10px; font-size: 12px; }
#take-delete { color: var(--mute); }
@media (prefers-reduced-motion: reduce) {
  #takes-open.recording::before, body:has(#takes:popover-open #takes-none:not([hidden])) #record { animation: none; }
}
@media (max-width: 640px) {
  #takes-panel { grid-template-columns: minmax(0, 1fr); height: auto; max-height: 70vh; }
  #take-picked { padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--board-line); }
}

#zoom { display: flex; align-items: center; gap: 4px; }
#zoom button.icon { width: 28px; height: 28px; }
#zoom button.icon:disabled { opacity: 0.4; cursor: not-allowed; }
#zoom svg { width: 14px; height: 14px; }
#zoom-now { min-width: 42px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--board-text); }
#zoom-row.off #zoom-now { color: var(--board-dim); }
#zoom-row:not(.off) #tab-off { display: none; }
/* Off while several tracks are shown; aria-disabled, not disabled, so hover
   still reaches the button and its reason shows. */
#views button[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
#views button[aria-disabled="true"]:hover { color: var(--board-dim); }
#view-why {
  position: fixed;
  inset: auto auto 64px 0;
  margin: 0;
  max-width: 240px;
  padding: 8px 12px;
  border: 1px solid var(--board-line);
  border-radius: 6px;
  background: var(--board);
  color: var(--board-text);
  font-size: 12px;
  box-shadow: 0 6px 24px var(--shadow);
  pointer-events: none;
}
#view-why:not(:popover-open) { display: none; }
#view-notice { margin: 0; color: var(--board-dim); font-size: 12px; }
#view-notice[hidden] { display: none; }


input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]:disabled { cursor: not-allowed; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--board-line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--board-text);
}
input[type="range"]:hover::-webkit-slider-thumb { background: var(--brass-bright); }
#speed-value, #speed-input {
  box-sizing: border-box;
  width: 48px;
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--board-text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
#speed-value { cursor: text; }
#speed-value:hover { border-color: var(--board-line); }
#speed-input { border-color: var(--board-line); outline: none; }
#speed-input:focus { border-color: var(--brass-bright); }
#speed-value[hidden], #speed-input[hidden] { display: none; }

#audio { flex-basis: 100%; margin: 0; color: var(--mute); font-size: 12px; }
#audio[hidden] { display: none; }


@media (max-width: 760px) {
  :root { --side-w: 0px; }
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "side" "stage" "transport"; }
  #side { border-right: none; border-bottom: 1px solid var(--board-line); max-height: 34vh; }
  body.loaded.side-rail:not(.rig) { --side-w: 0px; }
  /* On a narrow window the rail is one row of icons across the top. */
  body.side-rail:not(.rig) #side { flex-direction: row; align-items: center; padding: 0 4px; }
  body.side-rail:not(.rig) :is(#side-nav, #side-foot) { flex-direction: row; padding: 4px 0; margin: 0; }
  body.side-rail:not(.rig) #side-foot { margin-left: auto; }
  body.side-rail:not(.rig) .side-row { width: 34px; }
  #side-grip, body.loaded:not(.rig) #side-grip { display: none; }
}
body:not(.line) #line-scroll-row { display: none; }

/* Room chat. The corner floats over the tab, out of the way of clicks but
   for its own controls; its lines fade on their own, and the page starts
   each one partway through as old as it is. */
#chat-corner { position: absolute; right: 14px; bottom: 14px; z-index: 5; width: min(270px, calc(100% - 28px)); display: flex; flex-direction: column; align-items: flex-end; gap: 5px; pointer-events: none; }
#chat-corner[hidden] { display: none; }
#stage:has(#up-next-panel:not([hidden])) :is(#chat-corner, #chat-bursts) { right: calc(min(340px, 100% - 16px) + 20px); }
#chat-float { display: contents; list-style: none; }
#chat-float .chat-line { max-width: 100%; padding: 5px 10px; border-radius: 12px; animation: chat-fade 8s linear forwards; }
#chat-float .chat-line, #chat-open { color: var(--board-text); background: color-mix(in srgb, var(--board) 84%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 1px 4px var(--shadow); }
@keyframes chat-fade {
  0% { opacity: 0; transform: translateY(6px); }
  3% { opacity: 1; transform: none; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  @keyframes chat-fade { 0% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
}
.chat-line { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.chat-name { font-weight: 650; margin-right: 5px; }
.chat-link { pointer-events: auto; color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 2px; cursor: pointer; }
.chat-link:hover { color: var(--brass); text-decoration-color: currentColor; }
.chat-name.player { color: var(--brass); }
.chat-name.listener { color: color-mix(in oklab, var(--good) 80%, var(--board-text)); }
.chat-gtr { display: inline-block; margin-right: 4px; padding: 0 4px; border-radius: 4px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; vertical-align: 1px; color: var(--brass); background: color-mix(in srgb, var(--brass) 18%, transparent); }
#chat-open { pointer-events: auto; position: relative; width: 34px; height: 34px; padding: 0; border: 1px solid var(--board-line); border-radius: 50%; display: grid; place-items: center; }
#chat-open[hidden] { display: none; }
#chat-open:hover { border-color: var(--brass); }
#chat-open svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.chat-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; color: var(--on-brass); background: var(--brass); }
.chat-badge[hidden] { display: none; }
.chat-form { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border: 1px solid var(--board-line); border-radius: 18px; background: var(--board-raised); }
.chat-form[hidden] { display: none; }
#chat-form { align-self: stretch; border-color: var(--brass); box-shadow: 0 2px 10px var(--shadow); }
.chat-form:focus-within { border-color: var(--brass); }
.chat-input { flex: 1; min-width: 0; padding: 3px 0; border: 0; outline: none; background: transparent; font-size: 13px; color: var(--board-text); user-select: text; -webkit-user-select: text; }
.chat-input::placeholder { color: var(--board-dim); }
.chat-send { flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--on-brass); background: var(--brass); }
.chat-send svg { width: 12px; height: 12px; fill: currentColor; }
.chat-hint { margin: 0; padding: 0 6px; font-size: 11px; color: var(--board-dim); }
#chat-hint { pointer-events: auto; align-self: stretch; text-align: right; text-shadow: 0 0 4px var(--paper); }
.chat-hint.error { color: var(--mute); }
.chat-hint[hidden] { display: none; }

/* An emote pops in above the chat button, floats up over the tab with its
   sender's name and fades; the same one coming in a row shows its count. */
#chat-bursts { position: absolute; right: 14px; bottom: 56px; z-index: 5; width: 0; height: 0; pointer-events: none; }
.chat-burst { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; animation: chat-burst 2.4s cubic-bezier(.2, .8, .2, 1) forwards; }
.chat-burst-emote { font-size: 30px; line-height: 1.1; filter: drop-shadow(0 2px 4px var(--shadow)); }
.chat-burst-name { max-width: 120px; margin-top: 2px; padding: 1px 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; color: var(--board-dim); background: color-mix(in srgb, var(--board) 80%, transparent); }
@keyframes chat-burst {
  0% { opacity: 0; transform: translate(0, 10px) scale(.4); }
  12% { opacity: 1; transform: translate(0, 0) scale(1.15); }
  20% { transform: translate(0, -10px) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0px), -220px) scale(.9); }
}
.chat-combo { position: absolute; right: 140px; bottom: 40px; white-space: nowrap; font-size: 18px; font-weight: 800; line-height: 1; color: var(--brass); text-shadow: 0 1px 4px var(--shadow); animation: chat-pop .5s cubic-bezier(.34, 1.4, .5, 1); }
@keyframes chat-pop { from { opacity: 0; transform: scale(.3); } }
@media (prefers-reduced-motion: reduce) {
  .chat-burst { animation: chat-burst-fade 1.2s linear forwards; }
  .chat-combo { animation: none; }
}
@keyframes chat-burst-fade { 0% { opacity: 0; } 10% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; } }
.chat-line.emote .chat-text { font-size: 22px; line-height: 1; vertical-align: -3px; }

/* The whole log, beside the stage. */
#chat-panel { grid-area: chat; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--board-line); background: var(--board-raised); color: var(--board-text); }
#chat-panel[hidden] { display: none; }
body:has(#chat-panel:not([hidden])) { --chat-w: min(300px, 40vw); }
/* It slides in as it shows and its newest lines rise into place; closing
   plays the slide back before the page hides it. The column itself never
   animates, as the tab lays out again at every width. */
#chat-panel { animation: chat-panel-in .22s cubic-bezier(.2, .8, .2, 1); }
#chat-panel.leaving { animation: chat-panel-out .18s ease-in forwards; pointer-events: none; }
#chat-log > .rise { animation: chat-rise .32s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes chat-panel-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes chat-panel-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes chat-rise { from { opacity: 0; transform: translateY(10px); } }
/* The chat button shrinks away while the log is open and pops back. */
#chat-open { animation: chat-button-in .2s cubic-bezier(.34, 1.4, .5, 1); }
body:has(#chat-panel:not([hidden]):not(.leaving)) #chat-open { animation: chat-button-out .16s ease-in forwards; }
@keyframes chat-button-in { from { opacity: 0; transform: scale(.6); } }
@keyframes chat-button-out { to { opacity: 0; transform: scale(.6); visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  @keyframes chat-panel-in { from { opacity: 0; } }
  @keyframes chat-panel-out { to { opacity: 0; } }
  @keyframes chat-rise { from { opacity: 0; } }
  @keyframes chat-button-in { from { opacity: 0; } }
  @keyframes chat-button-out { to { opacity: 0; visibility: hidden; } }
}
#chat-panel header { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 14px; border-bottom: 1px solid var(--board-line); }
#chat-panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
#chat-since { margin-left: auto; font-size: 11px; color: var(--board-dim); }
#chat-close { width: 26px; height: 26px; color: var(--board-dim); background: transparent; border-color: transparent; font-size: 15px; line-height: 1; }
#chat-close:hover { color: var(--board-text); border-color: var(--board-line); }
.chat-scroll { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
#chat-log { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 8px 14px; list-style: none; display: flex; flex-direction: column; gap: 6px; user-select: text; -webkit-user-select: text; }
/* Few lines sit at the bottom, by the field, as new ones come in. */
#chat-log > :first-child { margin-top: auto; }
#chat-log .chat-time { float: right; margin-left: 8px; font: 10.5px/1.6 ui-monospace, Menlo, Consolas, monospace; color: var(--board-dim); }
.chat-mark { display: flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--board-dim); }
.chat-mark::before, .chat-mark::after { content: ""; flex: 1; height: 1px; background: var(--board-line); }
#chat-new { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 3px 10px; border: 0; border-radius: 10px; font-size: 11px; font-weight: 700; color: var(--on-brass); background: var(--brass); box-shadow: 0 2px 8px var(--shadow); }
#chat-new[hidden] { display: none; }
#chat-emotes { display: flex; gap: 2px; padding: 6px 10px 0; }
#chat-emotes button { flex: 1; height: 30px; padding: 0; border-color: transparent; border-radius: 8px; background: none; font-size: 17px; line-height: 1; transition: transform .15s cubic-bezier(.34, 1.4, .5, 1), background-color .15s; }
#chat-emotes button:hover { background: color-mix(in srgb, var(--board-text) 8%, transparent); transform: translateY(-2px) scale(1.12); }
#chat-emotes button:active { transform: scale(.9); }
#chat-panel-form { margin: 6px 10px 10px; }
#chat-panel-error { margin-top: -4px; padding: 0 14px 8px; }
@media (max-width: 760px) {
  #chat-panel { grid-area: stage; z-index: 6; }
}
