/* ═══════════════════════════════════════════
   DAW UI  —  flat dark design
   ═══════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #0a0d10; overflow: hidden; }
body { font-family: var(--font-sans); color: var(--fg); }
button { font-family: inherit; }
input, textarea { font-family: inherit; }

/* ── Root ── */
.daw {
  /* The rail's width, as a variable: the topbar's logo cell is sized from the
     same number, so the divider under the logo is the one the rail already
     draws, and the bar proper starts where the library does. */
  --rail-w: 66px;
  /* The library sidebar's open width (rail included), as a variable:
     Performance reads it to tell whether its two windows fit beside an open
     library (streamer/libraryFold.js). */
  --sidebar-w: 390px;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* reset any old .app grid */
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}

/* ── Utilities ── */
.daw .uplabel {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.daw .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.daw .hidden { display: none !important; }

/* ═══════════════════════════════════
   TOPBAR
   ═══════════════════════════════════ */
.daw-topbar {
  /* Was a flat 77px. The panel-toggle row under the composer needs a second
     line, and auto height means a translation that wraps grows the bar rather
     than being clipped. */
  min-height: 77px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  /* One shorthand, not a shorthand after two longhands. padding-top and
     padding-bottom were set above and then reset to zero by `padding: 0 16px`
     a few lines later, so the bar had no vertical padding at all whatever the
     comment above claimed. Invisible while the composer was a fixed 50px
     inside a 77px bar, because align-items: center hid the gap; give the
     composer a second row and the box fills the bar edge to edge and touches
     the top of the window. */
  /* No left padding and no vertical padding of its own any more: the brand
     cell owns the left edge and runs the full height of the bar, so the
     vertical padding moved onto the composer stack beside it. */
  padding: 0 16px 0 0;
  gap: 14px;
}
.daw-topbar > .daw-composer-stack { padding: 10px 0; }

/* Logo cell.
 *
 * The top-left corner, exactly as wide as the rail below it and closed by the
 * same border, so the bar proper begins where the library does. It was the
 * full 390px of the library at first, which put 330px of empty bar beside the
 * logo and cost the composer the width it was short of. The rail's width is
 * the part that has something in it, and it does not move when the library
 * collapses, so the cell needs no transition of its own. */
.daw-brand {
  align-self: stretch;
  box-sizing: border-box;
  width: var(--rail-w);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
/* Lined up with the rail buttons below it, which means lined up by the bars,
   not by the file. The symbol's artboard is not centred on its own artwork:
   the bars run x110-x452 of a 512 box, so their middle sits 25 units right of
   the middle of the image. Centring the image would therefore push the bars
   2.5px right of the rail's centre line, which is exactly what it looked like.
   4px is what puts the bars' middle on 32.5px, the centre of the 65px cell.
   52px, not the 40px of a rail button: that same padding means the bars
   themselves land at about 35px. */
/* The logo is the link, so the anchor has to be the flex item the cell
   centres, not an inline box that would add a line box's worth of height
   around a 52px image. */
.daw-brand a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.daw-brand img {
  width: 52px;
  height: 52px;
  margin-left: 4px;
  margin-right: auto;
  display: block;
  flex-shrink: 0;
}

/* ── Composer pill ── */
.daw-composer {
  flex: 1;
  min-width: 0;
  height: 50px;
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02), 0 1px 8px rgba(0,0,0,0.3);
  overflow: hidden;
}

/* URL zone */
.daw-url-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  flex: 1;
  min-width: 0;
  cursor: text;
}
/* Hide decorative SVG icons in the topbar */
.daw-url-zone > svg { display: none; }
.daw-process-btn > svg { display: none; }
.daw-url-zone svg { flex-shrink: 0; }

/* Keyed off the id, not the type. This input is type="text" so a search
   query is not marked invalid; an attribute selector here silently drops
   every rule the moment that changes. */
.daw-url-zone #url {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--fg-2);
  font-size: 14px;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.daw-url-zone #url::placeholder { color: var(--muted); }

/* Upload button inside URL zone */
.daw-upload-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.daw-upload-btn:hover { background: var(--panel-2); color: var(--fg-2); border-color: var(--border-strong); }

/* File pill (shown when file selected) */
.file-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--fg-2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
.file-pill.hidden { display: none !important; }
/* The loaded-track pill reports state rather than staging input, so it reads a
   step quieter than the file pill it borrows its shape from. */
.track-pill { opacity: 0.82; }
/* A staged file is what the button will act on next, so it speaks for itself
   and the loaded track stands down. Keyed off the same has-file class the file
   pill uses, so clearing the file brings this back without any JS agreeing to
   it. */
.url-wrap.has-file .track-pill { display: none !important; }
.track-pill .file-name { max-width: 220px; }
.file-name { overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.file-size { color: var(--muted); flex-shrink: 0; }
.file-clear {
  width: 16px; height: 16px;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px; flex-shrink: 0; padding: 0;
}
.file-clear:hover { color: var(--fg); background: var(--panel-3); }

/* url-wrap alias (JS uses .url-wrap for drag events) */
.daw-url-zone { position: relative; }
.daw-url-zone.drag-over {
  background: rgba(244,183,64,0.06);
  box-shadow: inset 0 0 0 1px rgba(244,183,64,0.3);
}
.daw-url-zone.has-file #url { display: none; }

/* Why a dropped file was refused, said in the box it was aimed at.
   The full error panel is for a job that failed: it takes a region and carries
   a retry button, and a file declined before anything started has nothing to
   retry. Sits where the input text does, and hides it, so the box says one
   thing at a time (#584). */
.url-drop-error {
  flex: 1;
  min-width: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A plain class, toggled from JS alongside the message.
   `:has()` reads better here, and a sibling combinator cannot work at all
   because the message follows the input in the markup. But this ships in three
   webviews, and the oldest of them is the one that matters: WebKitGTK only
   grew :has() in 2.38, and Linux is where this bug was reported from. A class
   costs one line in the handler and works in every engine. */
.daw-url-zone.has-drop-error #url { display: none; }

/* Composer vertical divider */
.daw-composer-sep {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 6px 0;
  flex-shrink: 0;
}

/* Stem section */
.daw-stem-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  flex-shrink: 0;
}
.daw-extract-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.daw-stem-chips { display: flex; gap: 4px; }

/* Stem choice buttons */
.stem-choice {
  height: 30px;
  padding: 0 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.stem-choice[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--color) 60%, transparent);
  background: color-mix(in srgb, var(--color) 14%, transparent);
  color: var(--color);
}
/* Automatic song-structure detection. It sits at the end of the composer next
   to Extract stems and matches its footprint, so the pair reads as two segments
   of one bar rather than a chip loose beside a button. Colour still separates
   them: the timeline blue, never the amber the primary action owns. */
.structure-toggle {
  --color: #4a7fff;
  min-width: var(--composer-action-w);
  height: auto;
  align-self: stretch;
  margin-left: 0;
  justify-content: center;
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--border-strong);
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}
.structure-toggle-main { display: inline-flex; align-items: center; gap: 6px; }

/* "All" toggle */
.stem-choice-all {
  border-color: var(--border-strong);
  color: var(--fg-2);
  font-size: 12px;
}
.stem-choice-all[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(244,183,64,0.12);
  color: var(--accent);
}

/* Vocals: Combined / Lead + Backing (on-demand split, #275) */
.vocal-mode-toggle {
  display: inline-flex;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.vocal-mode-btn {
  height: 100%;
  padding: 0 10px;
  border: none;
  background: none;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.vocal-mode-btn + .vocal-mode-btn { border-left: 1px solid var(--border); }
.vocal-mode-btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--vocals) 16%, transparent);
  color: var(--vocals);
}
/* Lead + Backing on an install that cannot make it (#832): still shown, so
   the choice is not a mystery, but off, with its reason as the title. */
.vocal-mode-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }

/* Process button */
.daw-process-btn {
  height: auto;
  /* Shared with .structure-toggle so the two end segments are the same width.
     A min rather than a fixed width, because a longer translation must be
     allowed to grow instead of being clipped. */
  min-width: var(--composer-action-w);
  justify-content: center;
  padding: 0 20px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border: none;
  border-left: 1px solid #b97f1c;
  color: #1a1206;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.daw-process-btn:hover { background: linear-gradient(180deg, #f8c054, #e0a032); }
.daw-process-btn:active { transform: translateY(1px); }
.daw-process-btn:disabled {
  opacity: 0.8;
  cursor: progress;
  filter: saturate(0.85);
}

/* Loading spinner on process btn */
.daw-process-btn.loading > svg { display: none; }
.daw-process-btn.loading { filter: saturate(0.85); }
.daw-process-btn.loading::before {
  content: "";
  width: 14px; height: 14px; flex: 0 0 14px;
  border-radius: 50%;
  background: conic-gradient(currentColor 0deg 270deg, transparent 270deg 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 0);
  animation: daw-spin 0.85s linear infinite;
}
@keyframes daw-spin { to { transform: rotate(360deg); } }

/* Icon button */
.daw-iconbtn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-2);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.daw-iconbtn:hover { background: var(--panel-2); border-color: var(--border); color: var(--fg); }
.daw-iconbtn:active { transform: scale(0.96); }

/* Notification panel */
/* The wrapper is still the badge's anchor; the panel is not anchored to it.
   .sidebar is overflow:hidden and narrows to the rail's 66px when the library
   is collapsed, so an absolutely positioned panel would be clipped to nothing
   in that state. Fixed escapes the clip, and placeNotifPanel in ui-chrome.js
   sets left/top from the bell's rect, the same way the search dropdown and the
   metronome popover are placed. No coordinates here on purpose: the only code
   that shows this panel is the code that positions it. */
.daw-notif-wrap { position: relative; }
.daw-notif-panel {
  display: none;
  position: fixed;
  width: 280px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
}
.daw-notif-wrap.open .daw-notif-panel { display: block; }
.daw-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}
.daw-notif-close {
  width: 22px; height: 22px;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
}
.daw-notif-close:hover { background: var(--panel-3); color: var(--fg); }
/* Sits between the label and the close button; the header is space-between, so
   push it right and leave a gap before the X. */
.daw-notif-clear {
  margin-left: auto; margin-right: 8px;
  background: none; border: none; padding: 0;
  color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 11px;
}
.daw-notif-clear:hover { color: var(--fg); text-decoration: underline; }
.daw-notif-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.daw-notif-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.daw-notif-release { border-color: rgba(244,183,64,0.25); }
.daw-notif-card-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(244,183,64,0.12);
  border-radius: 6px;
  color: var(--accent);
}
/* A failure, not an announcement. The amber tint lives in the base icon rule
   rather than in .daw-notif-release, so both properties need overriding. */
.daw-notif-error { border-color: rgba(214,90,74,0.35); cursor: pointer; }
.daw-notif-error:hover { background: var(--panel-2); }
.daw-notif-error .daw-notif-card-icon {
  background: rgba(214,90,74,0.14);
  color: var(--danger);
}
.daw-notif-error:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.daw-notif-card-body { flex: 1; min-width: 0; }
.daw-notif-card-title { font-size: 12px; font-weight: 600; color: var(--fg); }
.daw-notif-card-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.daw-notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px;
  background: #f4b740; border-radius: 50%;
  pointer-events: none;
}
.daw-notif-dismiss {
  flex-shrink: 0; align-self: flex-start;
  width: 18px; height: 18px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  border-radius: 4px; padding: 0;
}
.daw-notif-dismiss:hover { background: var(--panel-3); color: var(--fg); }
.daw-notif-empty {
  font-size: 12px; color: var(--muted);
  text-align: center; padding: 16px 0; margin: 0;
}

/* ═══════════════════════════════════
   BODY LAYOUT
   ═══════════════════════════════════ */
.daw-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ═══════════════════════════════════
   SIDEBAR / CATALOG
   ═══════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rail */
.sidebar-rail {
  width: var(--rail-w);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
  flex-shrink: 0;
}

.rail-btn {
  width: 40px; height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 9px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  border: none;
  background: none;
  /* remove old pseudo-element strip */
}
.rail-btn::before { display: none !important; }
.rail-btn:hover { background: var(--panel); color: var(--fg-2); }
.rail-btn.active { color: var(--accent); background: var(--panel); }
.rail-btn svg { flex-shrink: 0; }
/* max-width + ellipsis: a translated label (e.g. Polish "Ustawienia") can run
   longer than English at this 9px size inside the fixed 40px button. The
   full text is still reachable via the button's title/aria-label; this just
   guarantees the label itself can never visually overflow the rail column. */
.rail-btn > span { white-space: nowrap; max-width: 56px; overflow: hidden; text-overflow: ellipsis; }

/* Queue rail button. Only present while something is importing, so the rail
   stays as it is today for anyone not using the queue. The Trash button wears
   the same badge, with how many songs are in it (#749). */
.rail-queue, .rail-trash { position: relative; }
.rail-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px;
  background: var(--accent); color: #1a1a1a;
  font-size: 9px; font-weight: 700; line-height: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
/* "We Recommend" is wider than the other one-word rail labels, so it stacks onto
   two centered lines; let the button grow so the second line + icon aren't clipped. */
.rail-btn.rail-recommend { height: auto; min-height: 40px; padding: 3px 0; }
.rail-btn.rail-recommend span { white-space: normal; text-align: center; line-height: 1.1; }

/* Sidebar body */
.sidebar-body {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.15s ease;
}

/* Search */
.daw-search {
  height: 32px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
  position: relative;
}
.daw-search svg { flex-shrink: 0; }
.daw-search input {
  flex: 1; min-width: 0;
  border: none; outline: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
}
.daw-search input::placeholder { color: var(--muted); }
.search-kbd {
  font-size: 10px;
  color: var(--muted-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  flex-shrink: 0;
}

.new-folder-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.new-folder-btn:hover {
  background: var(--panel);
  color: var(--fg-2);
  border-color: var(--border-2, rgba(255,255,255,0.15));
}

/* Lib list (JS populates with .lib-item, .folder, .cat-item) */
.daw-lib-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Thin auto-hide scrollbar shared by the library list, the mixer column, the
   footer's control row and the waveform panel (both axes) — hidden until the
   area is hovered/focused, reserves no visible gutter. `.daw .wave-scroll`
   overrides the gold bar from waves.css. */
.daw-lib-list,
.mixer-column,
.footer-row-controls,
.daw .wave-scroll {
  /* Firefox: thin overlay-style bar, fades to transparent track */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.daw-lib-list:hover,
.daw-lib-list:focus-within,
.mixer-column:hover,
.mixer-column:focus-within,
.footer-row-controls:hover,
.footer-row-controls:focus-within,
.daw .wave-scroll:hover,
.daw .wave-scroll:focus-within {
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}
/* WebKit (Chrome/Safari/WKWebView): thin thumb, hidden until hover/scroll */
.daw-lib-list::-webkit-scrollbar,
.mixer-column::-webkit-scrollbar,
.footer-row-controls::-webkit-scrollbar,
.daw .wave-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.daw-lib-list::-webkit-scrollbar-track,
.mixer-column::-webkit-scrollbar-track,
.footer-row-controls::-webkit-scrollbar-track,
.daw .wave-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.daw-lib-list::-webkit-scrollbar-thumb,
.mixer-column::-webkit-scrollbar-thumb,
.footer-row-controls::-webkit-scrollbar-thumb,
.daw .wave-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
.daw-lib-list:hover::-webkit-scrollbar-thumb,
.daw-lib-list:focus-within::-webkit-scrollbar-thumb,
.mixer-column:hover::-webkit-scrollbar-thumb,
.mixer-column:focus-within::-webkit-scrollbar-thumb,
.footer-row-controls:hover::-webkit-scrollbar-thumb,
.footer-row-controls:focus-within::-webkit-scrollbar-thumb,
.daw .wave-scroll:hover::-webkit-scrollbar-thumb,
.daw .wave-scroll:focus-within::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  background-clip: padding-box;
}
.daw-lib-list::-webkit-scrollbar-thumb:hover,
.mixer-column::-webkit-scrollbar-thumb:hover,
.footer-row-controls::-webkit-scrollbar-thumb:hover,
.daw .wave-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
  background-clip: padding-box;
}

/* cat-item (legacy catalog items JS creates) */
.cat-item {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.cat-item:hover { background: var(--panel-2); border-color: var(--border); }
.cat-item.active { background: var(--panel-2); border-color: rgba(244,183,64,0.3); }
.cat-thumb {
  width: 36px; height: 36px;
  border-radius: 6px; flex-shrink: 0;
  overflow: hidden; border: 1px solid var(--border);
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.cat-thumb svg, .cat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cat-title { color: var(--fg); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-sub { color: var(--muted); font-size: 10.5px; display: flex; gap: 5px; white-space: nowrap; overflow: hidden; }
/* A version of the song above it (#804): indented under its row, its name
   and the stems it shows. */
.cat-version {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin: 1px 0 1px 30px;
  padding: 4px 8px 4px 10px;
  border: 1px solid transparent;
  border-left: 2px solid var(--border-strong);
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.cat-version:hover { background: var(--panel-2); }
.cat-version:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.cat-version.active { background: var(--panel-2); border-left-color: var(--accent); }
.cat-version-name {
  flex-shrink: 0;
  max-width: 55%;
  color: var(--fg-2);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-version.active .cat-version-name { color: var(--fg); }
/* Delete a version: shown on hover, focus and for the open one, so the rows
   stay quiet. Armed, it turns into its own confirmation text. */
.cat-version-del {
  flex-shrink: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.cat-version-del svg { width: 13px; height: 13px; }
.cat-version:hover .cat-version-del,
.cat-version.active .cat-version-del,
.cat-version-del:focus-visible,
.cat-version-del.armed { opacity: 1; }
.cat-version-del:hover { color: var(--danger); background: var(--panel-3); }
.cat-version-del:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.cat-version-del.armed { color: var(--danger); }
.cat-version-stems {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Shown only when it has something to say (#636). A finished import is the
   resting state of every row in the library, so a green dot on all of them
   marked nothing out: it was one more thing to read past on the way to the
   title. The states that still carry information keep the dot, which is also
   what makes them visible now that they are the only rows wearing one. */
.cat-status { display: none; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cat-status.processing { display: block; background: var(--accent); animation: cat-pulse 1.4s infinite; }
.cat-status.unavailable { display: block; background: #666; }
.cat-item.unavailable { cursor: pointer; }
.cat-item.unavailable .cat-title { opacity: 0.55; }
.cat-unavailable-warning { color: var(--accent); font-weight: 600; opacity: 1; }
@keyframes cat-pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

/* Import queue: a waiting row and a running row must be told apart at a
   glance, so they differ in three ways -- wording, the presence of a progress
   bar, and a hollow versus filled status dot. */
.cat-queue-label { color: var(--accent); font-variant-numeric: tabular-nums; }
.cat-item.queue-waiting .cat-queue-label { color: var(--muted); }
/* Waiting rows are not loadable yet, so they read as pending rather than
   inviting a click. */
.cat-item.queue-waiting { cursor: default; }
.cat-item.queue-waiting .cat-thumb { opacity: 0.55; }
.cat-item.queue-waiting .cat-title { color: var(--muted); }
.cat-item.queue-waiting .cat-status {
  /* Explicit, not inherited from .processing: a waiting row is only styled
     through its parent, so it must turn the dot on for itself. */
  display: block;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--muted);
  animation: none;
}
.cat-progress {
  height: 3px; border-radius: 2px; margin-top: 4px;
  background: rgba(255, 255, 255, 0.09); overflow: hidden;
}
.cat-progress-fill {
  height: 100%; width: 0; border-radius: 2px;
  background: var(--accent);
  transition: width 260ms linear;
}

/* Queue view rows. Unlike a library row these are not loadable -- there is
   nothing to load yet -- so they get no hover affordance, just a cancel. */
.queue-row { cursor: default; }
.queue-row:hover { background: var(--panel); }
.queue-row .cat-meta { gap: 3px; }
.queue-cancel {
  width: 22px; height: 22px; border: 0; border-radius: 5px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0; opacity: 0.65;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.queue-row:hover .queue-cancel { opacity: 1; }
.queue-cancel:hover { background: rgba(217, 83, 79, 0.16); color: #e06c68; }
.queue-cancel:disabled { opacity: 0.3; cursor: default; }
.queue-section .lib-section-head { margin-bottom: 6px; }

/* Restored-from-last-session banner. Opening the app never starts separating
   on its own, so this is the only way that queue moves. */
.queue-paused-banner {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px; padding: 8px 10px;
  border: 1px solid rgba(232, 168, 56, 0.28);
  border-radius: 8px;
  background: rgba(232, 168, 56, 0.08);
}
.queue-paused-text { flex: 1; font-size: 11px; color: var(--fg-2); line-height: 1.4; }
.queue-start-btn {
  flex-shrink: 0; min-height: 26px; padding: 0 12px;
  border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(232, 168, 56, 0.45);
  background: rgba(232, 168, 56, 0.18);
  color: var(--accent);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
.queue-start-btn:hover { background: rgba(232, 168, 56, 0.28); }
.queue-start-btn:disabled { opacity: 0.5; cursor: default; }

/* Reordering. Position in a serial queue is the difference between "ready now"
   and "ready in half an hour", so waiting rows drag. */
.queue-row.queue-waiting { cursor: grab; }
.queue-row.dragging { opacity: 0.4; cursor: grabbing; }
.queue-row.drop-below { box-shadow: 0 2px 0 0 var(--accent); }
.queue-grip {
  display: flex; align-items: center; flex-shrink: 0;
  margin-right: -2px; color: var(--muted); opacity: 0;
  transition: opacity var(--t-fast);
}
.queue-row:hover .queue-grip { opacity: 0.7; }
.queue-top {
  width: 22px; height: 22px; border: 0; border-radius: 5px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0; opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.queue-row:hover .queue-top { opacity: 0.65; }
.queue-top:hover { background: rgba(232, 168, 56, 0.16); color: var(--accent); opacity: 1; }
.queue-top:disabled { opacity: 0.3; cursor: default; }
/* A row's actions float over its bottom-right corner and show on hover or
   keyboard focus (#724). In the flow they cost the title their width on every
   row at rest, which is where titles were being cut short. In the corner they
   sit beside the second line (the duration, short) rather than over the
   title, and the fade lets a long line run under them. */
.cat-actions {
  position: absolute; bottom: 4px; right: 6px;
  display: flex; gap: 2px; padding-left: 16px;
  background: linear-gradient(to right, transparent, var(--panel-2) 14px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast);
}
.cat-item:hover .cat-actions,
.cat-item:focus-within .cat-actions { opacity: 1; pointer-events: auto; }
.cat-del {
  width: 20px; height: 20px; border: 0; border-radius: 5px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0; transition: background var(--t-fast), color var(--t-fast);
}
.cat-del:hover { background: rgba(21,31,39,0.8); color: var(--danger); }
/* A stopped song (#748) offers Extract at rest: it is the row's only way on. */
.cat-item.is-stopped .cat-actions,
.cat-item.can-retry .cat-actions { opacity: 1; pointer-events: auto; }

/* Trash rows look like library rows. On hover the second line becomes the
   hint, and a hold fills the row from the left over --hold-ms (set from
   TRASH_HOLD_MS in catalog.js), then restores. */
.cat-item.in-trash { user-select: none; -webkit-user-select: none; overflow: hidden; }
.cat-item.in-trash .trash-hint { display: none; color: var(--fg-2); }
.cat-item.in-trash:hover .trash-hint,
.cat-item.in-trash:focus-visible .trash-hint,
.cat-item.in-trash.holding .trash-hint { display: block; overflow: hidden; text-overflow: ellipsis; }
.cat-item.in-trash:hover .cat-sub:not(.trash-hint),
.cat-item.in-trash:focus-visible .cat-sub:not(.trash-hint),
.cat-item.in-trash.holding .cat-sub:not(.trash-hint) { display: none; }
.trash-hold { position: absolute; inset: 0; pointer-events: none; }
.trash-hold::before {
  content: ""; position: absolute; inset: 0;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  transform: scaleX(0); transform-origin: left center;
}
.cat-item.in-trash.holding .trash-hold::before {
  transform: scaleX(1);
  transition: transform var(--hold-ms, 1000ms) linear;
}
.cat-item.in-trash.selected {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.cat-extract {
  height: 20px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 5px;
  background: transparent; color: var(--accent); cursor: pointer;
  font: inherit; font-size: 11px; white-space: nowrap; flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.cat-extract:hover, .cat-extract:focus-visible { background: var(--accent); color: var(--panel-2); }
.cat-extract:disabled { opacity: 0.5; cursor: default; }
/* A favourite says so at rest, in the subline, where it takes no title room. */
.cat-item.is-fav .cat-sub::before {
  content: ""; flex-shrink: 0; align-self: center;
  width: 9px; height: 9px; background: #e54e4e;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Folder items (legacy catalog) */
.folder { display: flex; flex-direction: column; }
.folder-head {
  --folder-color: var(--accent);
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 7px;
  cursor: pointer; color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
  user-select: none;
}
/* Unsorted (.system) has no controls to reveal, so hovering it does not light it up (#695). */
.folder-head:not(.system):hover { background: var(--panel); color: var(--fg); }
.folder-head .f-chevron { width: 11px; height: 11px; transition: transform 180ms ease; flex-shrink: 0; color: var(--muted); }
.folder.collapsed .folder-head .f-chevron { transform: rotate(-90deg); }
.folder-head .f-icon { width: 13px; height: 13px; flex-shrink: 0; color: var(--folder-color); }
.folder-head .f-name {
  font-size: 12px; font-weight: 500; color: inherit;
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: transparent; border: none; padding: 0; font-family: inherit; outline: none; cursor: inherit;
}
.folder-head .f-count { font-size: 10.5px; color: var(--muted); }
.folder-color-dot {
  width: 13px; height: 13px; border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px; background: var(--folder-color); cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.22);
}
.folder-head .f-del,
.folder-head .f-subfolder {
  width: 18px; height: 18px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; opacity: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; padding: 0; transition: opacity var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.folder-head:hover .f-del,
.folder-head:hover .f-subfolder { opacity: 1; }
.folder-head .f-del:hover { background: rgba(21,31,39,0.8); color: var(--danger); }
.folder-head .f-subfolder:hover { background: rgba(21,31,39,0.8); color: var(--fg-2); }
/* Drag grip */
.f-grip {
  display: none; align-items: center; justify-content: center;
  cursor: grab; color: var(--muted); flex-shrink: 0;
  padding: 2px; border-radius: 3px;
  transition: color var(--t-fast);
}
.f-grip:active { cursor: grabbing; }
.folder-head:hover .f-grip { display: flex; }
/* Drop indicators for folder reorder / nest */
.folder.drop-before > .folder-head { box-shadow: 0 -2px 0 var(--accent); border-radius: 7px 7px 0 0; }
.folder.drop-after > .folder-head { box-shadow: 0 2px 0 var(--accent); border-radius: 0 0 7px 7px; }
.folder.drop-into > .folder-head { box-shadow: 0 0 0 1px var(--accent); background: var(--panel); }
/* Folder being dragged */
.folder.folder-dragging { opacity: 0.35; pointer-events: none; }
/* Subfolder indentation */
.folder.subfolder { margin-left: 12px; }
.folder-body { display: flex; flex-direction: column; gap: 3px; padding: 3px 0 3px 14px; margin-left: 7px; border-left: 1px solid rgba(157,170,182,0.1); }
.folder.collapsed .folder-body { display: none; }
.folder-empty { color: var(--muted); font-size: 11px; padding: 5px 8px; font-style: italic; }

/* Folder editor modal */
.folder-editor-backdrop {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(3,8,13,0.42); backdrop-filter: blur(2px);
}
.folder-editor {
  width: min(300px, calc(100vw - 32px));
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(28,39,48,0.98), rgba(13,21,29,0.98));
  box-shadow: var(--shadow-panel);
  padding: 12px; color: var(--fg); font-family: var(--font-mono);
}
.folder-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.folder-editor-close { width: 24px; height: 24px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.folder-editor-close:hover { background: rgba(21,31,39,0.8); color: var(--fg); }
.folder-editor-field { display: grid; gap: 7px; margin-bottom: 12px; color: var(--muted); font-size: 10.5px; }
.folder-editor-name { width: 100%; min-height: 34px; border: 1px solid var(--border); border-radius: 7px; background: rgba(10,17,24,0.78); color: var(--fg); font: inherit; font-size: 12px; padding: 0 10px; outline: none; }
.folder-editor-name:focus { border-color: rgba(244,183,64,0.5); box-shadow: 0 0 0 2px rgba(244,183,64,0.12); }
.folder-editor-colors { display: flex; align-items: center; gap: 9px; }
.folder-editor-colors .folder-color-dot { width: 22px; height: 22px; }
.folder-editor-msg { color: var(--danger); font-size: 11px; margin-top: 8px; }
.folder-editor-msg:empty { display: none; }
.folder-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.folder-editor-actions button { min-height: 30px; border-radius: 7px; font-family: var(--font-mono); font-size: 11px; cursor: pointer; padding: 0 11px; }
.folder-editor-cancel { border: 1px solid var(--border); background: rgba(21,31,39,0.52); color: var(--muted); }
.folder-editor-save { border: 1px solid rgba(244,183,64,0.3); background: rgba(244,183,64,0.16); color: var(--accent); }

/* Reset app data — confirm dialog (nested above the Settings dialog) */
.reset-confirm-backdrop {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center;
  background: rgba(3,8,13,0.55); backdrop-filter: blur(2px);
}
.reset-confirm-card {
  width: min(340px, calc(100vw - 32px));
  border: 1px solid rgba(214,90,74,0.4);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(28,39,48,0.98), rgba(13,21,29,0.98));
  box-shadow: var(--shadow-panel);
  padding: 16px; color: var(--fg); font-family: var(--font-mono);
}
.reset-confirm-title { font-size: 13px; font-weight: 700; color: var(--danger); margin-bottom: 8px; }
.reset-confirm-body { font-size: 11.5px; color: var(--fg-2); line-height: 1.5; margin: 0 0 10px; }
.reset-confirm-hint { font-size: 10.5px; color: var(--muted); margin: 0 0 7px; }
.reset-confirm-hint strong { color: var(--fg); letter-spacing: 0.04em; }
.reset-confirm-input {
  width: 100%; min-height: 34px; border: 1px solid var(--border-strong); border-radius: 7px;
  background: rgba(10,17,24,0.78); color: var(--fg); font: inherit; font-size: 12px;
  padding: 0 10px; outline: none; box-sizing: border-box;
}
.reset-confirm-input:focus { border-color: rgba(214,90,74,0.5); box-shadow: 0 0 0 2px rgba(214,90,74,0.14); }
.reset-confirm-msg { color: var(--danger); font-size: 11px; margin-top: 8px; min-height: 1em; }
.reset-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.reset-confirm-actions button { min-height: 30px; border-radius: 7px; font-family: var(--font-mono); font-size: 11px; cursor: pointer; padding: 0 12px; }
.reset-confirm-cancel { border: 1px solid var(--border); background: rgba(21,31,39,0.52); color: var(--muted); }
.reset-confirm-go { border: 1px solid rgba(214,90,74,0.4); background: rgba(214,90,74,0.18); color: var(--danger); font-weight: 600; }
.reset-confirm-go:disabled { opacity: 0.4; cursor: not-allowed; }
/* Playlist import reuses the confirm shell, but it is a normal action rather
   than a destructive one, so it drops the danger colouring. */
.playlist-confirm-title { color: var(--fg); }
.playlist-confirm .playlist-name { color: var(--accent); }
.playlist-confirm-go {
  min-height: 30px; border-radius: 7px; padding: 0 12px; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  border: 1px solid rgba(232, 168, 56, 0.45);
  background: rgba(232, 168, 56, 0.16);
  color: var(--accent);
}
.playlist-confirm-go:disabled { opacity: 0.4; cursor: not-allowed; }

/* Collapsed sidebar strip */
.cat-collapsed-strip { display: none; }
.daw.cat-collapsed .sidebar { width: var(--rail-w); }
.daw.cat-collapsed .sidebar-body { opacity: 0; pointer-events: none; visibility: hidden; }
.daw.cat-collapsed .cat-collapsed-strip { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 8px 0; overflow-y: auto; }

/* ═══════════════════════════════════
   MAIN AREA (#lanes)
   ═══════════════════════════════════ */
.daw-main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.daw-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* ── Job progress overlay ── */
.job {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgb(7, 13, 19);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
}
/* Gold ambient glow -- matches the wave-loading-overlay aesthetic */
.job::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 44%, rgba(216, 168, 74, 0.13), transparent 55%);
  pointer-events: none;
}
.job > * { position: relative; z-index: 1; }
.job.hidden { display: none !important; }
.job .title { font-size: 15px; font-weight: 600; color: var(--fg); text-align: center; }
.job .stage { font-size: 12px; color: var(--muted); text-align: center; }
.job progress {
  width: 280px; max-width: 100%;
  height: 4px;
  border-radius: 2px;
  appearance: none; border: none;
  background: var(--panel-3);
  overflow: hidden;
}
.job progress::-webkit-progress-bar { background: var(--panel-3); border-radius: 2px; }
.job progress::-webkit-progress-value { background: var(--accent); border-radius: 2px; }
.job progress::-moz-progress-bar { background: var(--accent); border-radius: 2px; }
.job .job-detail { font-size: 11px; color: var(--muted-2); text-align: center; }
.cancel-btn {
  height: 30px; padding: 0 16px;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  color: var(--fg-2); border-radius: 8px; font-size: 12px;
  font-family: inherit; cursor: pointer;
  transition: background var(--t-fast);
}
.cancel-btn:hover { background: var(--panel-3); color: var(--fg); }
.cancel-btn.hidden { display: none !important; }

/* Error banner: the studio's one alert box. By its id, never the class:
   "error" is also the modifier every small status line takes (lyrics, the
   artist box, settings), and the banner's rules on the class floated those
   over the top bar as unreadable strips. A solid card, top right, above
   everything, with its own close button (showError in job.js). */
#error {
  position: fixed;
  top: 16px; right: 16px;
  width: min(440px, calc(100vw - 32px));
  z-index: 1000;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 10px 12px 14px;
  background: var(--panel-2);
  border: 1px solid rgba(214,90,74,0.45);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  color: var(--fg);
  font-size: 13px; line-height: 1.45;
  animation: error-in 160ms ease-out;
}
#error.hidden { display: none !important; }
#error .error-icon {
  flex-shrink: 0;
  width: 18px; height: 18px; margin-top: 1px;
  color: var(--danger);
}
#error .error-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#error .error-detail {
  margin-top: 4px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted);
  white-space: pre-line; /* a Resync lists one failed track per line */
}
#error .error-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
#error .retry-btn {
  height: 26px; padding: 0 10px;
  background: transparent;
  border: 1px solid rgba(214,90,74,0.6); border-radius: var(--radius-sm);
  color: var(--fg); font: inherit; font-size: 12px;
  cursor: pointer;
  transition: background var(--t-fast);
}
#error .retry-btn:hover { background: rgba(214,90,74,0.18); }
#error .error-close {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: transparent; border: none; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 18px; line-height: 1;
  cursor: pointer;
}
#error .error-close:hover { background: var(--panel-3); color: var(--fg); }
#error :is(.retry-btn, .error-close):focus-visible { outline: 2px solid var(--danger); outline-offset: 1px; }
@keyframes error-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { #error { animation: none; } }

/* ── Track header ── */
.daw-track-header {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
}

/* Row 1. A grid rather than a flex row so its column edges land on exactly
   the same pixels as the presence grid below it -- flex and grid round
   fractional track widths differently, which left the two rows a pixel out of
   step at most window widths. */
.daw-info-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
/* Key takes the column the Scale card had (#736). "F# harmonisches Moll" has to
   fit, and two columns keep the seven edges the presence row lines up with. */
.daw-meta-card[data-meta="key"] { grid-column: span 2; }
/* Even two columns are 115 px of text at a 950 px window, and "F# harmonisches
   Moll" needs 155. Clipping it would hide the mode, which is the part the
   label exists to say, so the key wraps instead: a short key still sits on
   one line at any width, a long one takes two. */
.daw-meta-card[data-meta="key"] .meta-card-main { align-items: center; }
.daw-meta-card[data-meta="key"] .meta-card-value {
  /* Shrinks, unlike the other values: it wraps instead of clipping, and the
     confidence ring beside it has to keep its place on the line. */
  flex-shrink: 1;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.15;
  text-wrap: balance;
}

/* Metadata cards.
   Two lines, not three: the qualifier (Natural Minor, Peak 3.5 dB, High) sits
   on the value's own line rather than under it. Six stems only fit on a
   1366x768 laptop if the panels above the mixer stop taking a third of the
   window (#480), and a third text row here cost more height than it carried
   information. */
.daw-meta-card {
  /* Horizontal padding shrinks with the window. Seven columns at 950px are
     ~135px each, and a fixed 16px a side spent a quarter of that on nothing. */
  padding: 4px clamp(8px, 1vw, 16px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.daw-meta-card:last-child { border-right: none; }
.meta-card-label {
  /* Never two lines. The card centres its content, so a wrapped "DYNAMIC
     RANGE" did not push the value down, it painted over it. Ellipsis is the
     floor here; the fluid size is what keeps it from being reached. */
  font-size: clamp(9px, 0.72vw, 10px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta-card-main {
  display: flex;
  align-items: baseline;
  gap: clamp(4px, 0.5vw, 8px);
  min-width: 0;
}
.meta-card-value {
  /* "Natural Minor" at a fixed 17px is 133px of mono, wider than the card it
     sits in below ~1250px, and flex-shrink:0 let it paint straight over the
     next card's value. It shrinks now, and clips as a last resort. */
  font-size: clamp(13px, 1.15vw, 17px);
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  font-family: var(--font-mono);
  min-width: 0;
  /* The qualifier beside it gives up all of its width before the number
     loses a character. flex-shrink alone does not do that: it is weighted by
     each item's size, so at 1280 "-25.2" still lost its last digit to
     "Peak -21.4 dB" beside it. The max-width keeps a value wider than the
     whole card from painting over the next one; that is the case the
     ellipsis below is still for. */
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta-card-value.accent { color: var(--accent); }
.meta-card-value.stability-high { color: #4caf7d; }
.meta-card-sub {
  font-size: clamp(9px, 0.75vw, 11px);
  line-height: 1;
  color: var(--muted);
  /* Shrinks four times as fast as the value beside it: the qualifier is the
     part worth losing first, the number is the reason the card exists. */
  flex-shrink: 4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Why the loudness cards changed for a song from before 0.21.0 (#923). A row
   of its own under the cards, not inside the LUFS card: the card is about
   135 px wide at a 950 px window, and the sentence is the point. Shown once
   per song, so the height it takes is not kept. */
.loudness-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px clamp(8px, 1vw, 16px);
  border-bottom: 1px solid var(--border);
  font-size: clamp(10px, 0.8vw, 12px);
  line-height: 1.3;
  color: var(--muted);
}
.loudness-note[hidden] { display: none; }
.loudness-note-text { flex: 1; min-width: 0; }
.loudness-note-dismiss {
  flex-shrink: 0;
  /* 24 px: the smallest pointer target WCAG 2.2 (2.5.8) allows. */
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: transparent; border: none; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 16px; line-height: 1;
  cursor: pointer;
}
.loudness-note-dismiss:hover { background: var(--panel-3); color: var(--fg); }
.loudness-note-dismiss:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.daw-cover {
  width: 64px; height: 64px;
  border-radius: 8px;
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--muted);
  position: relative; overflow: hidden;
}
.np-art-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.np-art-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: none;
}
.np-art-img[src]:not([src=""]) { display: block; }

.daw-track-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* One compact line -- duration · stems · source · quality · extracted date --
   instead of a duration/stems row plus three further label:value rows below
   it. The four-line version was still the pre-redesign layout; this row was
   the one part of the footer rebuild (#269 follow-up) I'd described matching
   the reference but never actually rebuilt. */
.daw-track-meta-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted);
  min-width: 0; overflow: hidden;
}
.daw-track-meta-line .num { color: var(--fg-2); }
.daw-track-sep { color: var(--border); font-size: 12px; flex-shrink: 0; }
#t-stems-chip {
  display: inline-flex; align-items: center; gap: 4px;
}
#t-stems-chip::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4caf7d;
  flex-shrink: 0;
}
.daw-fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 150ms;
}
.daw-fav-btn:hover { color: var(--fg); }
.daw-fav-btn.active { color: #e54e4e; }
.daw-fav-btn.active svg { fill: #e54e4e; stroke: #e54e4e; }

/* Energy rows (JS-driven) */
.energy-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.energy-row span {
  font-size: 11px;
  font-weight: 500;
  width: 44px;
  flex-shrink: 0;
}
.energy-row.vocals span { color: var(--vocals); }
.energy-row.drums  span { color: var(--drums); }
.energy-row.bass   span { color: var(--bass); }
.energy-row.guitar span { color: var(--guitar); }
.energy-row.piano  span { color: var(--piano); }
.energy-row.other  span { color: var(--other); }
.energy-row.original span { color: var(--fg-2); }

.energy-row b {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg);
  overflow: hidden;
  position: relative;
  display: block;
}
.energy-row b::after {
  content: '';
  position: absolute; inset: 0;
  width: var(--v, 0%);
  border-radius: 3px;
  transition: width 160ms;
}
.energy-row.vocals b::after { background: var(--vocals); }
.energy-row.drums  b::after { background: var(--drums); }
.energy-row.bass   b::after { background: var(--bass); }
.energy-row.guitar b::after { background: var(--guitar); }
.energy-row.piano  b::after { background: var(--piano); }
.energy-row.other  b::after { background: var(--other); opacity: 0.5; }
.energy-row.original b::after { background: var(--fg-2); }

.energy-row em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* Stem presence cards — row 2. One line each: the label and its percentage
   read as a pair, and stacking them doubled the row's height for no gain
   (#480). */
.stem-presence-panel {
  display: grid;
  /* Seven, matching the seven metadata cards above, so the two rows share
     their dividers instead of interleaving them. Six presence stems fill
     seven columns because Vocals takes two; a completed lead/backing split
     replaces that one card with two and the row becomes a plain 7x1. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.stem-card[data-stem="vocals"] { grid-column: span 2; }
.stem-card {
  padding: 8px clamp(6px, 0.8vw, 12px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(4px, 0.5vw, 8px);
  min-width: 0;
}
.stem-card:last-child { border-right: none; }
.stem-card-label {
  /* Fluid for the same reason as the labels above: at 950px these truncated to
     "LE..." and "BA...", which name nothing. */
  font-size: clamp(8px, 0.66vw, 10px);
  line-height: 1;
  font-weight: 600;
  /* Tighter than the metadata labels above: on a side-by-side row these
     compete with the percentage for width, and 0.07em truncated
     "VOCAL PRESENCE" at 1366px. */
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stem-card-pct {
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--fg);
  transition: color 200ms;
  flex-shrink: 0;
}
.stem-card:not(.inactive)[data-stem="vocals"] .stem-card-pct { color: var(--vocals); }
.stem-card:not(.inactive)[data-stem="drums"]  .stem-card-pct { color: var(--drums); }
.stem-card:not(.inactive)[data-stem="bass"]   .stem-card-pct { color: var(--bass); }
.stem-card:not(.inactive)[data-stem="guitar"] .stem-card-pct { color: var(--guitar); }
.stem-card:not(.inactive)[data-stem="piano"]  .stem-card-pct { color: var(--piano); }
.stem-card:not(.inactive)[data-stem="other"]  .stem-card-pct { color: var(--other); }
.stem-card.inactive .stem-card-pct { color: var(--muted); }

/* Analysis panel */
.daw-camelot-ring {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  align-self: center;
  flex-shrink: 0;
  font-size: 9px; font-weight: 700; color: var(--accent);
  background: rgba(244,183,64,0.08);
  font-family: var(--font-mono);
}

/* ── Section ribbon ── */
.daw-section-ribbon {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.daw-mixer-label {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.daw-label-title { font-size: 12px; font-weight: 600; }
.daw-label-sub { font-size: 9px; }
.daw-sections-header { justify-content: space-between; gap: 8px; }
.daw-sections-title-group { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; }
/* Clear, Add and Hide belong together. The header is space-between, so without
   this group each control drifts to its own corner and Clear ends up marooned.
   It may shrink, and only the save indicator inside it gives way: the column
   is a fixed 300px, and in German the buttons alone nearly fill it. */
.sections-header-actions { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.daw-sections-area {
  flex: 1;
  position: relative;
  height: 36px;
  background: var(--bg-2);
  /* clip, not hidden. `hidden` is a scroll container, and the inner track now
     overflows it, so anything that focuses an element off to the right -- the
     rename input on a block past the viewport is the easy one -- makes the
     browser scroll this box to reveal it. The ribbon is positioned by
     transform, nothing ever resets scrollLeft, and the strip is then offset
     from the waveform for good. `clip` clips identically and cannot scroll.
     .daw-ruler-area is clip for the same reason. */
  overflow: clip;
  user-select: none;
}
/* Carries the section blocks at the zoomed timeline's width, so a block placed
   at a percentage of it lines up with the same moment on the waveform below.
   Without this the ribbon stayed the width of the window while the waveform
   grew, and every boundary drifted: at 2.7x the first one sat 775px from the
   audio it marked, and the drag maths, which measures this element, moved a
   block 2.7x too far for the same gesture (#573).

   Left-anchored so width drives the size, exactly like .lanes-ruler-time.
   transport.js translates both by the same scrollLeft; .daw-sections-area
   already clips the spill. */
.daw-sections-track {
  position: absolute;
  inset: 0;
  right: auto;
  width: calc(100% * var(--zoom, 1));
}

/* Section blocks (sections.js populates) */
.section-block {
  position: absolute;
  top: 4px; bottom: 4px;
  box-sizing: border-box;
  border: 1px solid var(--sc, #4a7fff);
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: grab;
  transition: filter 80ms;
}
.section-block:hover { filter: brightness(1.15); }
.section-block.sec-dragging { cursor: grabbing; filter: brightness(1.2); z-index: 10; }
.section-block.sec-resizing { filter: brightness(1.2); z-index: 10; }

.section-label {
  flex: 1;
  padding: 0 6px 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sc, #4a7fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}

.section-del {
  display: none;
  flex-shrink: 0;
  width: 16px; height: 16px;
  margin-right: 4px;
  border: none; background: none;
  color: var(--sc, #4a7fff);
  font-size: 13px; line-height: 1;
  cursor: pointer; border-radius: 3px;
  align-items: center; justify-content: center;
  opacity: 0.7;
}
.section-del:hover { opacity: 1; background: rgba(0,0,0,0.3); }
.section-block:hover .section-del { display: flex; }

.section-lock {
  display: none;
  flex-shrink: 0;
  width: 16px; height: 16px;
  margin-right: 2px;
  border: none; background: none;
  color: var(--sc, #4a7fff);
  cursor: pointer; border-radius: 3px;
  align-items: center; justify-content: center;
  opacity: 0.7;
  padding: 0;
}
.section-lock:hover { opacity: 1; background: rgba(0,0,0,0.3); }
.section-block:hover .section-lock { display: flex; }
/* A locked section shows its padlock without being hovered, and in red. Hiding
   it would make locked and unlocked look identical at rest, and the only way to
   find a locked one would be to try to drag it. Red because the padlock is the
   one control that is saying no to the others. */
.section-block.sec-locked .section-lock {
  display: flex;
  opacity: 1;
  color: var(--danger);
}
.section-block.sec-locked .section-lock:hover { opacity: 1; }

/* The grab and col-resize cursors promise a drag that cannot happen. */
.section-block.sec-locked,
.section-block.sec-locked .section-handle { cursor: default; }
.section-block.sec-locked .section-handle:hover { background: none; }

.section-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 2;
  flex-shrink: 0;
}
.section-handle-l { left: 0; }
.section-handle-r { right: 0; }
.section-handle:hover { background: rgba(255,255,255,0.12); }

.section-rename-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sc, #4a7fff);
  padding: 0 6px 0 10px;
  caret-color: var(--sc, #4a7fff);
}

/* Sections save indicator. It takes only the room the buttons leave, so in a
   long language its words are cut short instead of running over the title or
   pushing the buttons out of the column. aria-live still reads them whole. */
.sections-save-indicator {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  transition: opacity 400ms;
}
.sections-save-indicator.hidden { display: none; }
.sections-save-indicator.saved { color: #4caf7d; }
/* A refusal, not a failure of something already in flight. It borrows this
   element because it belongs beside the button that was pressed. Two lines
   are what the 36px bar holds without growing. */
.sections-save-indicator.notice {
  color: var(--warn, #e6a23c);
  white-space: normal;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.sections-save-indicator::before {
  content: "";
  display: inline-block;
  vertical-align: -1px;
  margin-right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  animation: sections-spin 600ms linear infinite;
}
.sections-save-indicator.notice::before {
  animation: none;
  border: none;
  width: auto; height: auto;
  content: "!";
  font-weight: 700;
  font-size: 11px;
}
.sections-save-indicator.saved::before {
  animation: none;
  border: none;
  width: auto; height: auto;
  content: "✓";
  font-size: 11px;
}
@keyframes sections-spin {
  to { transform: rotate(360deg); }
}

/* ── Tags bar (#1075, timelineTags.js) ──
   The Sections bar's header and track, one row lower and shorter: a tag is a
   point, not a span, so it needs one line of text, not a block. Each mark is
   a line at its moment with its key number and name to the right of it, in
   the neutral text colours, so it never reads as a coloured section. */
.daw-tags-ribbon {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.daw-tags-header { padding-top: 3px; padding-bottom: 3px; }
.daw-sections-area.daw-tags-area { height: 26px; }
.tag-mark {
  position: absolute;
  top: 3px; bottom: 3px;
  display: flex;
  align-items: center;
  max-width: 160px;
  border-left: 2px solid var(--fg-2);
}
.tag-mark:hover, .tag-mark:focus-within, .tag-mark.tag-renaming { z-index: 3; }
.tag-seek {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 6px 0 5px;
  border: 0;
  border-radius: 0 4px 4px 0;
  background: var(--bg-2);
  color: var(--fg-2);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}
.tag-mark:hover .tag-seek { background: var(--panel-3); color: var(--fg); }
.tag-mark:hover { border-left-color: var(--fg); }
.tag-num {
  flex-shrink: 0;
  min-width: 13px;
  padding: 0 3px;
  border-radius: 3px;
  background: var(--panel-3);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.tag-mark:hover .tag-num { background: var(--border-strong); }
.tag-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Folded to nothing until the mark is hovered, focused or looping, but never
   display: none, which would take it out of the Tab order: a keyboard user
   must be able to land on it, and focus-within then opens it. */
.tag-loop {
  display: flex;
  flex-shrink: 0;
  width: 0; height: 16px;
  margin-left: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  border: none;
  border-radius: 3px;
  background: var(--panel-3);
  color: var(--fg-2);
  font-size: 12px; line-height: 1;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.tag-mark:hover .tag-loop,
.tag-mark:focus-within .tag-loop,
.tag-loop.active {
  width: 16px;
  margin-left: -2px;
  opacity: 1;
}
.tag-loop:hover { color: var(--fg); background: var(--border-strong); }
.tag-loop[aria-disabled="true"] { cursor: not-allowed; }
.tag-mark:hover .tag-loop[aria-disabled="true"],
.tag-mark:focus-within .tag-loop[aria-disabled="true"] { opacity: 0.4; }
.tag-loop.active { background: var(--accent); color: var(--bg); }
.tag-loop:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tag-mark.tag-renaming .tag-loop { display: none; }
.tag-del {
  display: none;
  flex-shrink: 0;
  width: 16px; height: 16px;
  margin-left: -2px;
  border: none;
  border-radius: 3px;
  background: var(--panel-3);
  color: var(--fg-2);
  font-size: 13px; line-height: 1;
  cursor: pointer;
  align-items: center; justify-content: center;
  padding: 0;
}
.tag-del:hover { color: var(--fg); background: var(--border-strong); }
.tag-mark:hover .tag-del { display: flex; }
.tag-mark.tag-renaming .tag-del { display: none; }
.tag-rename-input {
  width: 140px;
  height: 100%;
  box-sizing: border-box;
  padding: 0 6px;
  border: 1px solid var(--accent);
  border-radius: 0 4px 4px 0;
  outline: none;
  background: var(--panel-2);
  color: var(--fg);
  font: inherit;
  font-size: 10.5px;
  caret-color: var(--accent);
}

/* Add section button — lives in the Sections label column */
.sections-add-btn-label {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.sections-add-btn-label:hover {
  background: var(--panel-2);
  color: var(--fg);
  border-color: rgba(255,255,255,0.18);
}

.sections-add-btn-label[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}
.sections-add-btn-label[aria-disabled="true"]:hover {
  background: none;
  color: var(--muted);
  border-color: var(--border);
}

/* Hide carries no word, so the padding the label side needs goes. */
.sections-hide-btn { padding: 3px 6px; }

/* Clear-all sections. Neutral until it is armed, then it states plainly that
   the next click destroys something, because nothing here can be undone. */
.sections-clear-btn[data-armed="1"] {
  border-color: color-mix(in srgb, var(--vocals) 55%, transparent);
  background: color-mix(in srgb, var(--vocals) 14%, transparent);
  color: var(--vocals);
}

/* Wave label (left column in wave header — Mixer label) */
.daw-wave-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

/* ── Panel toggles (#480) ── */
/* A second row under the composer, aligned to its right-hand end so it reads as
   belonging to the two controls above it. Collapse to nothing, not to a stub:
   the whole point is the height back, and a stub tall enough to hold a control
   is most of what the smaller panels are worth. That is only possible because
   the controls live up here, where the way back is always in the same place.

   This row costs the topbar about 19px, against up to 202px it can return. */
.daw-composer-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.daw-composer-stack > .daw-composer { flex: none; }
/* Exactly as wide as the two controls above it, and sharing their right edge:
   the same --composer-action-w they are each sized from, so a longer
   translation widens all three together instead of leaving this one ragged.
   margin-left:auto does the alignment, since the stack is the composer's width. */
.daw-panel-toggles {
  width: calc(var(--composer-action-w) * 2);
  margin-left: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 2px 7px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  min-width: 0;
}
/* The rule separates the row's label from its controls. It sits after the
   label, so "All" reads as the first of four buttons rather than as part of
   the words describing them. */
.daw-panel-toggles-label {
  margin-right: 2px;
  padding-right: 6px;
  border-right: 1px solid var(--border-strong);
}
.daw-panel-toggles-label,
.daw-panel-toggles-sep {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}
.daw-panel-toggle {
  padding: 2px 3px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--fg-2);
  font-family: inherit;
  font-size: 8.5px; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast), opacity var(--t-fast);
}
.daw-panel-toggle:hover { background: var(--panel-2); }
/* Legible means the panel is there, struck through means it is put away. The
   other way round -- highlighting the hidden ones -- inverts what a pressed
   toggle normally looks like, and makes the default state the loud one. */
.daw-panel-toggle[aria-pressed="true"] { color: var(--fg-2); }
.daw-panel-toggle[aria-pressed="false"] {
  color: var(--muted);
  opacity: 0.6;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.app.panel-analysis-off .daw-track-header { display: none; }
.app.panel-sections-off .daw-section-ribbon { display: none; }
/* The Tags bar is the Sections bar's second row (#1075), so the same switch
   puts it away. A fourth Collapse toggle does not fit: the column holds three
   (see .daw-composer-stack .daw-panel-toggle). */
.app.panel-sections-off .daw-tags-ribbon { display: none; }

/* ── Waveform header ── */
.daw-wave-header {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.daw-wave-label {
  width: var(--daw-col-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  min-height: 32px;
}
.daw-ruler-area {
  flex: 1;
  background: var(--bg-2);
  min-height: 32px;
  /* Clip the horizontally-scrolled ruler spill. overflow-x: clip (not hidden)
     keeps overflow-y visible so the vertical playhead line still extends down
     over the waveform lanes. */
  overflow-x: clip;
}

/* Ruler */
.lanes-ruler { position: relative; height: 18px; }
.lanes-ruler-time {
  position: absolute; inset: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}
/* Match the zoomed waveform width so ticks/playhead stay aligned; JS translates
   it by scrollLeft. Left-anchored (right: auto) so width drives the size. */
.daw .lanes-ruler-time {
  right: auto;
  width: calc(100% * var(--zoom, 1));
}
.playhead-marker {
  position: absolute;
  top: -1px;
  transform: translateX(-50%);
  pointer-events: none;
}

/* ── Content area (mixer + waveform) ── */
.daw-content {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* ── Stems panel (the studio's left column) ── */
.daw-stems-panel {
  width: var(--daw-col-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-2);
}

/* Stem list rows — kept in DOM for JS hook (.stem-mute/.stem-solo toggling, hidden visually) */
.stem-list {
  position: absolute;
  width: 0; height: 0; overflow: hidden;
  visibility: hidden; pointer-events: none;
  opacity: 0;
}
/* Also update the --lane-h var to match waveform lane height */
:root { --lane-h: 72px; } /* 70px wave + 2px separator */
.stem-icon { width: 14px; height: 14px; flex-shrink: 0; }
.stem-mute, .stem-solo { display: none; }
.stem-monitor { display: none; }
.drag-handle { display: none; }
.mini-meter { display: none; }

/* ── Mixer column (JS-built horizontal lanes) ── */
.mixer-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Each mixer row height is driven by --lane-h (set dynamically in JS to fill available space) */
.lane-header.mx-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: var(--lane-h, 72px);
  min-height: 72px;
  max-height: none;
  border-bottom: 2px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
  position: relative;
  transition: opacity var(--t-base);
  box-sizing: border-box;
}
.lane-header.mx-row.muted { opacity: 0.45; }
.lane-header.mx-row.hidden { display: none !important; }

.lane-stripe { display: none; }

/* Name + VU stacked vertically */
/* The name and its meter share a fixed column, and the fader takes whatever is
   left of the row. So this width is the fader's length: every pixel taken off
   here is a pixel the fader gains. 76px left the fader badly compressed once
   the key stepper joined the row. The controls now sit on two lines beside
   it (.mx-strip), so the name has the room to be read from across a room. */
.lane-name-vu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--lane-name-vu-gap, 5px);
  width: var(--mx-name-w);
  min-width: 0;
  flex-shrink: 0;
  /* Centres the NAME on the row, not the name-and-meter pair. The row centres
     its children, so a stacked pair puts the name above the centre line by half
     the meter plus the gap -- and the waveform beside it is centred on that
     line, so the label reads as sitting too high. A top margin is centred with
     the item, so this offsets the pair by exactly half of it and the name comes
     level with its own waveform. Cheap and reversible: the meter simply moves
     down with it. */
  margin-top: calc(var(--lane-vu-h, 10px) + var(--lane-name-vu-gap, 5px));
}

/* Stem icon — hidden per user preference */
.mx-icon { display: none; }

/* Stem name */
.mx-name {
  font-size: var(--mx-name-font); font-weight: 600;
  line-height: 1.2;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* In a lane's header a long name ("Backing-Gesang", "Voix principale") takes
   a second line rather than an ellipsis; the name stays centred on the row
   either way (.lane-name-vu's margin). */
.lane-name-vu .mx-name {
  white-space: normal;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
/* Rows are taller than the controls need whenever the window has the
   height (the lanes share it): the name grows into the room. A size
   container: the row's height is set (--lane-h), never its content's. */
.lane-header.mx-row[data-stem] { container: mxrow / size; }
@container mxrow (min-height: 108px) {
  .lane-name-vu .mx-name { font-size: calc(var(--mx-name-font) + 2px); }
}

/* Fader (horizontal, native range input) */
.lane-knob.mx-fader {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}
.mx-fader-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--mx-ctl-h);
  background: transparent;
  cursor: ew-resize;
  outline: none;
  margin: 0;
}
.mx-fader-input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--fader-color, #888) 0%,
    var(--fader-color, #888) calc(var(--lane-pos, 0.5) * 100%),
    rgba(255,255,255,0.08) calc(var(--lane-pos, 0.5) * 100%)
  );
}
.mx-fader-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--fader-color, #888);
  margin-top: -6px;
  border: 2px solid rgba(0,0,0,0.35);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
  cursor: ew-resize;
}
.mx-fader-input::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.08);
}
.mx-fader-input::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--fader-color, #888);
  border: 2px solid rgba(0,0,0,0.35);
  cursor: ew-resize;
}

/* VU meter — sits below stem name in .lane-left-col, spans full column width */
/* 5px read as a hairline rather than a meter: at that height the gradient had
   nowhere to show and a moving level was hard to see at a glance. */
/* Height shared with .lane-name-vu's centring offset, so the two cannot drift. */
:root { --lane-vu-h: 10px; }
.lane-vu.mx-meter {
  position: relative;
  height: var(--lane-vu-h, 10px);
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  --vu-level: 0%;
  --vu-peak: 0%;
}
.lane-vu-bar {
  display: none;
}
.lane-vu-bar.mx-meter-fill {
  display: block;
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--vu-level, 0%);
  background: linear-gradient(90deg, #22c55e 0%, #86efac 80%, #f97316 95%, #ef4444 100%);
  border-radius: 2px;
  transition: width 40ms linear;
}

/* dB value */
.mx-val {
  font-family: var(--font-mono);
  font-size: var(--mx-ctl-font);
  font-weight: 700;
  color: var(--fg);
  width: 46px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* M/S buttons (JS-built) */
.lane-icon-toggle.mx-btn,
.ms-btn.mx-btn,
.track-arm.mx-btn,
.lane-dl.mx-btn {
  width: var(--mx-ctl-w); height: var(--mx-ctl-h);
  box-sizing: border-box;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--fg-2);
  font-size: var(--mx-ctl-font); font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  flex-shrink: 0;
  text-decoration: none;
  padding: 0;
  opacity: 1;
}
.lane-icon-toggle.mx-btn:hover,
.ms-btn.mx-btn:hover,
.track-arm.mx-btn:hover { color: var(--fg); border-color: #3a4550; }

/* Mute button: "active" = NOT muted (normal). Engaged (muted) lights up blue,
   mirroring the solo button's own lit-up treatment below. */
.lane-icon-toggle.mx-btn.mute.active { color: var(--fg-2); border-color: var(--border-strong); }
.lane-icon-toggle.mx-btn.mute:not(.active) {
  background: rgba(59,130,246,0.18);
  color: #60a5fa;
  border-color: rgba(59,130,246,0.4);
}

/* Solo button: "active" = soloed */
.ms-btn.mx-btn.active { background: rgba(244,183,64,0.18); color: var(--accent); border-color: rgba(244,183,64,0.4); }

/* Arm (record-enable) on a recording track, the M/S button's twin: a red
   dot, hollow when idle, filled and glowing when armed. Red is --danger, the
   Record button's colour, so the two read as one control. */
.track-arm.mx-btn { color: var(--danger); }
.track-arm.mx-btn::before {
  content: "";
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  box-sizing: border-box;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.track-arm.mx-btn:hover { color: var(--danger); }
.track-arm.mx-btn.on { background: rgba(214,90,74,0.14); border-color: rgba(214,90,74,0.35); }
.track-arm.mx-btn.on::before { background: currentColor; box-shadow: 0 0 6px currentColor; }

/* Download button: the same box as M and S, so it reads as one of them
   from a distance; it was a borderless 13px glyph. */
.lane-dl.mx-btn { color: var(--fg-2); }
.lane-dl.mx-btn:hover { color: var(--fg); border-color: var(--muted-2); }
.lane-dl.mx-btn svg { width: 17px; height: 17px; }

/* Holds the EQ tab (eq/eqRows.js). The same width with or without it, so
   the fader does not move when the audio engine comes up and the tab
   appears. */
.mx-eq-slot {
  width: 52px;
  flex-shrink: 0;
  display: flex;
}

.mx-fader-input { touch-action: pan-y; }

/* ── The side-rail header (mixer.js renderMixerRow) ──
   A card on the left and a rail on the right edge. The card: the lane's
   swatch and name, the fader with its level, two thin meter bars under the
   fader, then the key. The rail: mute, solo, the EQ tab and download
   stacked, the full height of the row, so they sit in the same place on every
   row. Colours are the app's own: the lane's colour (--lane-color, set by
   mixer.js from STEM_COLORS) and the existing M/S/EQ state colours. */
.lane-header.mx-row.mx-row-rail {
  position: relative;
  align-items: stretch;
  gap: 10px;
  padding: 0 0 0 12px;
}
.mx-card {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head head"
    "fader fader"
    "meter meter"
    "actions actions";
  align-content: center;
  row-gap: 7px;
  padding: 8px 0;
}
.mx-head {
  grid-area: head;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mx-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--lane-color, var(--muted));
  flex-shrink: 0;
}
.mx-card .mx-name {
  font-size: calc(var(--mx-name-font) + 3px);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mx-faderline {
  grid-area: fader;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: var(--mx-ctl-h);
}
/* The fader and its meter are short, enough travel to set a level, and the
   level reads right beside the fader. */
.mx-faderline .lane-knob { flex: 0 0 84px; width: 84px; }
.mx-faderline .mx-val {
  width: auto;
  min-width: 58px;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 3px;
}
.mx-val-unit {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
/* The meter: one thin line under the fader, as long as the fader's track.
   The level and its peak hold share it, the hold fainter behind the level. */
.mx-card .lane-vu.mx-meter {
  grid-area: meter;
  height: auto;
  width: 84px;
  display: grid;
  background: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.mx-meter-track {
  grid-area: 1 / 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.mx-card .lane-vu-bar.mx-meter-fill,
.mx-card .lane-vu-bar.mx-meter-hold {
  display: block;
  position: static;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #22c55e 0%, #86efac 80%, #f97316 95%, #ef4444 100%);
  transition: width 40ms linear;
}
.mx-card .lane-vu-bar.mx-meter-fill { width: var(--vu-level, 0%); }
.mx-card .lane-vu-bar.mx-meter-hold { width: var(--vu-peak, 0%); opacity: 0.55; }
.mx-meter-track:has(.mx-meter-fill) { background: transparent; position: relative; z-index: 1; }

.mx-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
/* The key: a column of its own beside the rail, in four equal cells level
   with the rail's M, S, EQ and download: plus, KEY, the offset, minus. The
   reading's wrapper steps aside (display: contents) so its label and number
   are cells of their own; `order` sets the top-to-bottom sequence, since the
   DOM keeps minus, reading, plus for the horizontal stepper. */
.mx-keyrail {
  display: flex;
  width: 34px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}
.mx-keyrail .lane-key {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: auto;
}
.mx-keyrail .lane-key-value { display: contents; }
.mx-keyrail .lane-key-step,
.mx-keyrail .lane-key-label,
.mx-keyrail .lane-key-num {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.mx-keyrail .lane-key-step.up { order: 1; }
.mx-keyrail .lane-key-label { order: 2; }
.mx-keyrail .lane-key-num { order: 3; }
.mx-keyrail .lane-key-step.down { order: 4; }
.mx-keyrail .lane-key-step {
  height: auto;
  padding: 0;
  border-radius: 0;
  font-size: var(--mx-ctl-font);
  color: var(--fg-2);
}
.mx-keyrail .lane-key-step:hover { background: var(--panel-2); color: var(--fg); }
.mx-keyrail .lane-key-label { font-size: 8px; letter-spacing: 0.06em; text-indent: 0.06em; }
.mx-keyrail .lane-key-num {
  font-family: var(--font-mono);
  font-size: var(--mx-ctl-font);
  font-weight: 700;
}
.lane-key-label {
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}
.lane-key-num { color: var(--fg-2); }
.mx-keyrail .lane-key.active .lane-key-value { background: transparent; border: 0; }
.mx-keyrail .lane-key.active .lane-key-num { color: var(--lane-color, var(--accent)); }
/* Drums: the control stays whole, dimmed, explaining itself on hover. */
.mx-keyrail .lane-key.locked { opacity: 0.45; }

/* The rail: four equal cells the full height of the row. */
.mx-rail {
  display: flex;
  flex-direction: column;
  width: 46px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}
.mx-rail > .mx-btn {
  flex: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
}
.mx-rail > .mx-btn:hover { background: var(--panel-2); }
/* The EQ tab as a rail cell: the M/S face, its dot after the label, no
   chevron. The slot keeps its cell while the tab is not there yet. */
.mx-rail > .mx-eq-slot {
  flex: 1;
  width: 100%;
  min-height: 0;
}
.mx-rail .eq-tab {
  height: 100%;
  padding: 0;
  gap: 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.mx-rail .eq-tab:hover { background: var(--panel-2); }
.mx-rail .eq-tab::after { display: none; }
.mx-rail .eq-tab:not(.active):not(.bypassed) .eq-tab-dot { display: none; }
.mx-rail .eq-tab-dot { width: 6px; height: 6px; }

/* What the ear hears, on both columns (mixer.js paintLaneSilence): a muted
   lane fades; while any lane is soloed, every other lane goes dark and
   blurred. The row's contents fade, never the row itself: each row draws the
   separator under it, and fading the row took the line between it and the
   next lane with it. Hovering a dimmed mixer row, or reaching it with the
   keyboard, brings it back into focus so its M and S stay easy to find. Not
   :focus-within: a clicked S keeps focus, so the row it just un-soloed stayed
   lit after the pointer left. */
.mx-row-rail > *,
.stem-waveform-row > * {
  transition: opacity var(--t-base) var(--easing), filter var(--t-base) var(--easing);
}
.lane-header.mx-row.mx-row-rail.muted { opacity: 1; }
.mx-row-rail.muted > * { opacity: 0.45; }
.stem-waveform-row.lane-muted > * { opacity: 0.3; }
.mx-row-rail.solo-dimmed > *,
.stem-waveform-row.solo-dimmed > * {
  opacity: 0.35;
  filter: blur(1.5px) brightness(0.6);
}
.mx-row-rail.solo-dimmed:hover > *,
.mx-row-rail.solo-dimmed:has(:focus-visible) > * {
  opacity: 0.8;
  filter: none;
}

/* Short rows (when many lanes share the height): the same parts on fewer
   lines. The EQ tab and the key go beside the name, the fader and its meter
   under them. */
@container mxrow (max-height: 107px) {
  .mx-card {
    row-gap: 3px;
    padding: 4px 0;
  }
  .mx-card .mx-name { font-size: var(--mx-name-font); }
  .mx-faderline { height: 22px; }
  .mx-meter-track { height: 2px; }
  .mx-actions { gap: 5px; }
}
/* A stem has nothing on the actions line; it takes no room. */
.mx-actions:empty { display: none; }

/* A recording track's take folder arrow sits in the row's left gutter, so
   the track's name lines up with every stem's. */
.lane-header.mx-row.mx-row-rail > .take-folder-toggle {
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  margin: 0;
  transform: translateY(-50%);
}

/* A recording track in the same card (capture/takeLanes.js): the arm button
   and the input picker where a stem has its key, the track menu at the end of
   the name's line. */
.mx-head .take-menu-btn { margin-left: auto; flex-shrink: 0; }
.mx-actions .track-input-wrap { flex: 1 1 auto; min-width: 0; }
@container mxrow (max-height: 107px) {
  /* A track's arm and picker on the card's bottom line, low enough that the
     four lines fit the row. */
  .track-lane .mx-card { row-gap: 2px; padding: 1px 0; }
  .track-lane .mx-faderline { height: 18px; }
  /* The fader's box as tall as its line (its 18 px thumb still fits), not
     reaching into the name's line above. */
  .track-lane .mx-faderline .mx-fader-input { height: 18px; }
  .track-lane .mx-actions { height: 22px; }
  .track-lane .mx-actions > * { max-height: 22px; }
  /* The picker and the menu at the arm button's 22 px: at their own 28 px
     the four lines were taller than a 72 px row and spilled out of it
     (the menu above the row, the picker below it). */
  .track-lane .mx-actions .track-input { height: 22px; }
  .lane-header.mx-row.track-lane .mx-head .take-menu-btn.mx-btn { height: 22px; }
}

/* ── Waveform panel (right) ── */
/* Layout only — waves.css handles all visual styling inside (.wave-scroll bg,
   golden scrollbar, .loop-region, .waves-grid, .stem-waveform-layer etc.) */
.daw-wave-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* waves.css gives .wave-editor padding + border-radius for the old rounded panel
   style. In the flat DAW layout those are unwanted — strip them. */
.daw .wave-editor,
.app:not(.is-import) .daw-wave-panel.wave-editor {
  padding: 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
}

/* Our zoom toolbar sits outside .wave-editor (in .daw-wave-header), so
   the wave-scroll should fill the full panel height instead of calc(100% - 32px).
   Also remove the rounded corners waves.css adds in active state. */
.daw .wave-scroll {
  flex: 1 !important;
  height: auto !important;
  border-radius: 0 !important;
  border: none !important;
  overflow-y: auto;
  /* waves.css sets scroll-behavior: smooth. In the studio the mixer column and
     the wave lanes mirror each other's scrollTop (wireLaneScrollSync), and a
     smooth programmatic scroll turns that mirror into a feedback loop: each
     echo re-targets the in-flight animation, so a vertical wheel-scroll to the
     middle oscillates instead of settling, i.e. the lanes shake (#182). Instant
     scrolling makes the mirror a no-op once both panes match. */
  scroll-behavior: auto;
}

/* Canvas fills the panel when lanes fit, but grows with the track stack when
   they overflow (#159) so .wave-scroll can scroll the extra lanes vertically. */
.daw .wave-canvas { min-height: 100%; height: auto; }

/* In the original layout a 48px stem-icon strip lived INSIDE the wave panel,
   offsetting waves-column/multitrack/waveform-layer by 48px. In our layout the
   mixer is a separate 300px panel, so all those 48px offsets must be zero. */
.daw .waves-column,
.app:not(.is-import) .daw-wave-panel .waves-column {
  padding-left: 0 !important;
  --wave-gutter: 0px !important;
}
/* Show WaveSurfer native bar rendering; hide the SVG overlay layer */
.daw #multitrack-container {
  opacity: 1 !important;
  pointer-events: all !important;
  position: relative !important;  /* in flow → waves-column height driven by WaveSurfer */
  inset: 0 !important;             /* waves.css sets inset: 0 0 0 48px; zero left offset */
}
/* The wavesurfer-multitrack bundle wraps its tracks in its own
   `<div style="overflow-x: scroll">`, which renders a permanently visible
   horizontal scrollbar — an empty light bar when the content fits (the "white
   bar" bug). We fit the bundle to its container and let the outer .wave-scroll
   own horizontal scrolling, so suppress the bundle's wrapper scrollbar. */
.daw #multitrack-container > div {
  overflow-x: hidden !important;
}
/* Zero waves.css 48px left offsets that assumed an icon strip inside the wave panel */
.daw .waves-grid { left: 0 !important; }
.daw .lanes-ruler { margin-left: 0 !important; }
.daw .stem-waveform-layer {
  display: none !important;
  /* waves.css offsets this layer by left:48px for the legacy icon-strip layout.
     The DAW layout has no in-panel strip, so it must start at 0 like .waves-grid
     and #multitrack-container above; otherwise the overview waveform is shifted
     48px right of the ruler/playhead, so t=0 in the audio lands ~48px before the
     drawn waveform begins (a constant gap that scales with track length, #189). */
  left: 0 !important;
  right: 0 !important;
}
/* When the Web Audio engine owns playback, the multitrack is mounted with null
   URLs and never decodes audio, so the WaveSurfer canvas is empty. Show the SVG
   overview layer (rendered from peaks.json) as the visual source instead. */
.daw.engine-waveforms .stem-waveform-layer {
  display: flex !important;
}
/* The column is exactly the stack _applyLaneHeight computed, never whatever the
   multitrack happens to be. Letting the multitrack size it looks reasonable and
   is where the misalignment came from: its lane height is fixed when the tracks
   are created, so after a resize the column keeps the old size while the mixer
   rows beside it follow the new one, and the two walk apart down the stack.
   Measured at 1600x768 after a resize from 900: the column stayed 498px against
   a 432px stack, so waveform rows sat 83px apart against the mixer's 72 and the
   last pair was 55px out of line.

   The mixer stack is count * --lane-h and this is count * --lane-h, so they
   agree by construction rather than by coincidence. */
.daw .waves-column {
  height: var(--wave-widget-track-stack-h, auto) !important;
  min-height: var(--wave-widget-track-stack-h, 0) !important;
}

.loop-region.hidden { display: none !important; }


/* Wave loading overlay */
.wave-loading-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  background: rgb(11, 15, 18);
}
.wave-loading-overlay.hidden { display: none !important; }
.wave-loading-lines {
  display: flex; gap: 3px; align-items: center;
}
.wave-loading-lines i {
  display: block; width: 3px; height: 20px;
  background: var(--accent); border-radius: 2px;
  animation: daw-bar 1.2s ease-in-out infinite;
}
.wave-loading-lines i:nth-child(2) { animation-delay: 0.1s; }
.wave-loading-lines i:nth-child(3) { animation-delay: 0.2s; }
.wave-loading-lines i:nth-child(4) { animation-delay: 0.3s; }
.wave-loading-lines i:nth-child(5) { animation-delay: 0.4s; }
.wave-loading-lines i:nth-child(6) { animation-delay: 0.5s; }
@keyframes daw-bar { 0%,100%{transform:scaleY(0.4);opacity:0.5;} 50%{transform:scaleY(1.4);opacity:1;} }
.wave-loading-msg { font-size: 12px; color: var(--muted); }

/* Presence panel (hidden, JS compat) */
.presence-panel { display: none; }

/* ── Transport footer ── */

.daw-footer {
  /* No height of its own: the two tiers inside decide it, and every pixel not
     spent here goes to the mixer, which is the panel actually short of room
     (#480). This used to carry min-height: 200px, from when the click-track
     cluster could wrap onto a second line and a rigid height would have
     clipped it. The controls row no longer wraps, so the floor only padded the
     footer past its content -- 30px of it, which pooled as a gap wherever the
     tiers were not pushed. */
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  /* Two columns on the studio's own grid: the track identity sits under the
     stems/mixer panel and carries its width, everything time-related sits
     under the lanes and starts exactly where the lane waveforms start, so a
     position reads at the same x in both. The top border still spans the full
     width -- that edge belongs to the footer/lanes boundary, not the grid. */
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
}

.daw-play-btn {
  background: var(--accent);
  color: #1a1206;
  width: 56px; height: 56px;
  border-radius: 50%; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(244,183,64,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}
.daw-play-btn:hover { box-shadow: 0 2px 16px rgba(244,183,64,0.5), inset 0 1px 0 rgba(255,255,255,0.22); }
.daw-play-btn:active { transform: scale(0.96); }
/* Playing = green (go); idle/ready stays gold. */
.daw-play-btn.playing {
  background: #4caf7d;
  box-shadow: 0 2px 12px rgba(76,175,125,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}
.daw-play-btn.playing:hover { box-shadow: 0 2px 18px rgba(76,175,125,0.6), inset 0 1px 0 rgba(255,255,255,0.24); }

/* JS toggles these to show play vs pause icon */
.btn-transport.playing .pause-icon { display: block !important; }
.btn-transport.playing > svg:first-child { display: none; }

/* Stop/loop buttons inside the footer transport row */
.daw-footer .daw-iconbtn.btn-transport {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Loop active state */
.daw-iconbtn.loop.active,
.btn-transport.loop.active { color: var(--accent); }

/* ── Footer redesign ── */

/* ── Footer layout: three tiers (design 1b) ── */
/* Tier 1 -- what is loaded and what leaves the app (track identity, favourite,
   Export Mix). Tier 2 -- every playback and click control, in labelled clusters
   separated by hairline dividers. Tier 3 -- the timeline those clusters act on.
   Each tier owns its own full-width budget instead of everything competing for
   room in one line. */

.footer-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}

/* ── Track identity, in the footer's timeline gutter ── */
.track-panel-head {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
}
/* Favourite belongs with what it marks, so it rides the title line rather than
   sitting with Export Mix. Boxed, because a bare icon beside the cover art
   reads as decoration. */
.track-panel-head .daw-fav-btn {
  flex: none; margin-left: auto;
  width: 28px; height: 28px; padding: 0;
  justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: background var(--t-fast), color var(--t-fast);
}
.track-panel-head .daw-fav-btn:hover { background: var(--panel-3); }
/* Hairline cluster separator: fades out at both ends so it reads as a seam
   between groups rather than a hard rule across the footer. On one line every
   one of these separates something; when the clusters do wrap
   (.collapse-rows), all of them are hidden rather than working out which one
   was stranded at the end of a line. */
.footer-divider {
  width: 1px; flex: none;
  background: linear-gradient(
    180deg, transparent, var(--border-strong) 22%, var(--border-strong) 78%, transparent
  );
}
.footer-row-controls .footer-divider { height: 44px; }
/* Starts at the footer's own left edge. The track identity that used to sit in
   front of it now lives in the library sidebar, and leaving its 300px gutter
   behind pushed every control into the right of the window with a void beside
   it.

   One line, always. Wrapping rearranged the band into a different shape at
   every window width -- clusters piling onto a second row, the click track
   splitting its own options in half -- so the footer never looked like itself
   twice. Nothing here shrinks either (.footer-group is flex: none). One line
   until footerFit.js has run out of every narrower one-line shape; only then
   do whole clusters wrap to a second line (.collapse-rows below), because
   the alternative was a row scrolling sideways with controls out of sight. */
.footer-row-controls {
  display: flex; align-items: flex-start; flex-wrap: nowrap;
  gap: 16px;
  padding: 12px 18px 14px;
}
/* The clusters, and only the clusters, scroll. Favourite and Export Mix sit
   outside this box so a window too narrow for the row cannot carry them off
   the right-hand edge.

   Sideways only. overflow-x: auto alone computes overflow-y to auto too, and
   the strip is sized to its content, so a vertical scrollbar has nothing to
   scroll. It can still appear: at a fractional device pixel ratio (250%
   Windows scaling) content and box heights round differently, and a sub-pixel
   of phantom overflow puts a classic scrollbar down the strip's right edge.
   That takes its width out of the row, space-between at the "click" level
   spreads the loss across every gap, and footerFit's observer re-measures.
   That matches the breathing row of #633 exactly: every gap moving, Export
   Mix not. hidden clips exactly what auto already clipped, and never takes
   width from the row. */
.footer-clusters {
  flex: 1; min-width: 0;
  display: flex; align-items: flex-start; flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 16px;
}
/* Acts on the track, not on playback, so it is pinned opposite the clusters
   rather than filed among them. Nudged down to sit on the controls' own line
   instead of the labels above them. */
.footer-track-actions {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  margin-top: 18px;
}
.footer-track-actions .track-chip { height: 32px; }
/* Opens toward the middle of the window: anchored left, a 260px menu on the
   footer's right edge would hang off it. */
.footer-track-actions .track-chip-panel { left: auto; right: 0; }
/* Natural width, never squeezed: a cluster that shrinks re-wraps its own
   controls, which is the pile-up the row-level nowrap exists to prevent. */
.footer-group {
  display: flex; flex-direction: column; gap: 6px;
  flex: none;
}
.footer-group-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--muted);
}
/* One control height across every cluster, so the row reads as a single band
   of controls rather than a ragged stack. */
.footer-group-body {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 8px;
  min-height: 34px;
}
/* Bottom tier: the click track's note, under the controls. */
.footer-wave-region {
  display: flex; align-items: stretch;
  padding: 0 18px 14px 0; flex-shrink: 0;
}
/* The loaded track's card. Built for the footer gutter, which was the mixer
   column's width; it sits in the composer now, where rule 6 lets the column
   decide its width. */
.footer-track-slot {
  width: var(--daw-col-w); flex: none;
  box-sizing: border-box;
  padding: 0 18px 0 18px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.footer-wave-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}

.track-panel-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
/* Two lines, then clipped: a column this narrow would otherwise cut most
   titles after three or four words. */
.track-panel-title {
  min-width: 0;
  font-size: 13px; font-weight: 600; line-height: 1.35;
  /* Overrides the nowrap/ellipsis on .daw-track-title, which is written for
     single-line contexts. */
  white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
  color: var(--fg);
}
.track-panel-cover {
  width: 40px !important; height: 40px !important;
  border-radius: 7px;
  flex-shrink: 0;
}
/* Wraps freely here -- the gutter is narrow and the block is stacked, so the
   meta reads as a short paragraph rather than a clipped line. */
.footer-track-slot .daw-track-meta-line { row-gap: 2px; line-height: 1.35; }

/* Position group: elapsed / total time, then the loop controls that act on
   that position (design 1b groups them together, not with the transport). */
/* The loop column is three rows tall while the rest of this group is one, so
   centring it left the two bounds hanging below the elapsed/total readout they
   belong to. Aligning to the bottom puts the fields on the readout's line and
   lets the button and its hint stack up out of the way. */
.footer-group-position .footer-group-body { gap: 4px; align-items: flex-end; }
.footer-group-position .footer-elapsed,
.footer-group-position .footer-total,
.footer-group-position .footer-time-sep {
  /* Match the fields' box height so the baselines land together, rather than
     the text bottom meeting the border bottom. */
  line-height: 22px;
}
/* Both readouts hold the width of mm:ss whatever they are showing.
 *
 * They start at 0:00 and become 05:09 the moment a track loads, which is one
 * character wider. The Position cluster grew 17px with it and every cluster to
 * its right, Speed, Global key and Click track, slid across by the same
 * amount. Clicking a track should not move the buttons beside it.
 *
 * Reserved rather than zero-padded, because the format is the readout's own
 * business: a track under ten minutes reads 5:09 and should keep doing so. A
 * track over an hour still grows, and should. */
.footer-elapsed {
  font-size: 18px; font-weight: 500; letter-spacing: -0.02em; color: var(--fg);
  display: inline-block;
  min-width: 5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.footer-total {
  font-size: 12px; font-weight: 400; color: var(--muted-2);
  display: inline-block;
  min-width: 5ch;
  font-variant-numeric: tabular-nums;
}
.footer-time-sep { font-size: 12px; color: var(--muted-2); }

/* Exact loop start/end inputs (inline, right of the loop button) */
/* The hint stacks over the two fields rather than beside them: the footer row
   is already full, and a note about the fields belongs with the fields. Sized
   to sit inside the width the two boxes already take, so it does not widen the
   Position group. */
.footer-loop-times-wrap {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  margin-left: 6px;
}
.footer-loop-hint {
  font-size: 7.5px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--muted);
  line-height: 1; white-space: nowrap; text-align: center; user-select: none;
}
.footer-loop-times {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  cursor: default; user-select: none;
}
.loop-times-sep { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.loop-time-input {
  /* 7ch holds "105.100" -- the widest value a track under 1000 s produces now
     that the minutes field is gone. */
  width: 7ch; box-sizing: content-box;
  padding: 2px 6px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 5px; outline: none;
  color: var(--fg); font-family: inherit; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; text-align: center;
}
.loop-time-input { cursor: ns-resize; }
.loop-time-input:focus { cursor: text; border-color: var(--accent); }
.loop-time-input:disabled { opacity: 0.45; cursor: not-allowed; }

/* Transport group: stop square + a play key wide enough to be the obvious
   primary, both on the shared 34px control height. */
.footer-group-transport .daw-iconbtn.btn-transport {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--panel-2);
  border-color: var(--border-strong);
  color: var(--fg-2);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
/* Record keeps its own colours inside the transport group, whose rule above
   (three classes) outranked .rec-btn.recording in recording.css: the button
   showed neither its red dot nor the solid red of a take being recorded. */
.footer-group-transport .daw-iconbtn.btn-transport.rec-btn { color: var(--danger); }
.footer-group-transport .daw-iconbtn.btn-transport.rec-btn.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--fg);
}
.footer-group-transport .daw-iconbtn.btn-transport:hover {
  background: var(--panel-3);
  color: var(--fg);
}
.footer-group-transport .daw-play-btn {
  width: 44px; height: 34px; border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
.footer-group-transport .daw-play-btn:hover {
  box-shadow: 0 2px 12px rgba(244,183,64,0.35), inset 0 1px 0 rgba(255,255,255,0.22);
}
.footer-group-transport .daw-play-btn.playing:hover {
  box-shadow: 0 2px 12px rgba(76,175,125,0.45), inset 0 1px 0 rgba(255,255,255,0.24);
}
/* Active transport states: stop = red while stopped, loop = blue while looping. */
.footer-group-transport .btn-transport.stopped,
.footer-group-transport .btn-transport.stopped:hover {
  background: rgba(214,90,74,0.16);
  border-color: rgba(214,90,74,0.55);
  color: var(--danger);
}
/* Loop sits in the Position group and reads as a modifier on the readout next
   to it, so it is a short labelled pill rather than a full-height control. */
.footer-group-position .daw-iconbtn.btn-transport.loop {
  /* A tall narrow pill beside the fields, not a bar over them. align-self
     overrides the group's flex-end so it fills the two rows the hint and the
     bounds take, which is what keeps the footer one line high. */
  flex-direction: column; justify-content: center;
  width: 46px; height: auto; align-self: stretch;
  padding: 3px 4px; gap: 1px; margin-left: 4px;
  border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  color: var(--fg-2);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.footer-group-position .btn-transport.loop:hover {
  background: var(--panel-3); color: var(--fg);
}
.loop-btn-label { font-size: 9.5px; font-weight: 500; white-space: nowrap; line-height: 1; }
.footer-group-position .btn-transport.loop.active,
.footer-group-position .btn-transport.loop.active:hover {
  background: rgba(74,140,255,0.16);
  border-color: rgba(74,140,255,0.55);
  color: #4a8cff;
}

/* ── Segmented controls (Speed, click rate) ── */
/* One joined track rather than separate pills: the options are exclusive, and
   butting them together says so (design 1b). */
.footer-seg {
  display: flex; height: 34px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 8px;
}
.footer-seg > button {
  border: 0; background: transparent;
  padding: 0 11px; cursor: pointer;
  color: var(--muted);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; line-height: 1;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.footer-seg > button:hover { background: var(--panel-3); color: var(--fg); }
.footer-seg > button + button { border-left: 1px solid var(--border); }
.speed-btn.active,
.speed-btn.active:hover {
  background: rgba(232,200,64,0.16); color: var(--accent);
}
/* Transpose stepper (#245). Sits in a .footer-seg so it inherits the frame and
   hover behaviour of the speed and click controls beside it; only the readout
   between the two buttons is new. */
.pitch-value {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; padding: 0 6px;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;  /* so +10 and -6 do not shift the buttons */
  transition: color var(--t-fast), background var(--t-fast);
}
/* Lit only when transposed, so "this track is not in its original key" is
   visible at a glance rather than needing the number to be read. */
.pitch-value.active {
  background: rgba(232,200,64,0.16); color: var(--accent);
}
.pitch-btn:disabled {
  opacity: 0.35; cursor: default;
}
.pitch-btn:disabled:hover { background: transparent; color: var(--muted); }

/* Reset. Outside the stepper's frame, because it does something to the whole
   mix rather than one more step: it returns every mixer lane to the key the
   recording is in, which the stepper alone cannot do once lanes have been moved
   individually. */
.pitch-reset {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px; line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.pitch-reset:hover:not(:disabled) {
  background: var(--panel-3); color: var(--fg); border-color: var(--border);
}
.pitch-reset:disabled { opacity: 0.35; cursor: default; }

.metro-mult-btn.active,
.metro-mult-btn.active:hover {
  background: rgba(74,140,255,0.16); color: #4a8cff;
}

/* Click track on/off toggle. Lit gold while the click is running, so its
   state is visible without any other affordance. */
.click-toggle-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 10px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--fg-2); cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.click-toggle-btn:hover:not(:disabled) { background: var(--panel-3); color: var(--fg); }
.click-toggle-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.click-toggle-btn.active,
.click-toggle-btn.active:hover {
  background: rgba(232,200,64,0.18); border-color: rgba(232,200,64,0.55); color: var(--accent);
}
.click-metro-icon { flex-shrink: 0; }
/* The on/off toggle is the icon alone (#681), square like the volume button
   beside it. The Grid button shares the class above and keeps its label. */
.click-toggle-btn.click-toggle-icon {
  width: 34px;
  padding: 0;
  justify-content: center;
}

/* Beat grid editor: canvas overlay + toolbar */
.beatgrid-canvas {
  position: absolute; inset: 0; z-index: 12;
  pointer-events: none; /* enabled only while editing */
}
.beatgrid-canvas.hidden { display: none; }

.beatgrid-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px; margin: 0 0 6px;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  border-radius: 7px;
}
.beatgrid-toolbar.hidden { display: none; }
.bg-tool-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted);
}
.bg-tools { display: flex; gap: 3px; }
.bg-btn {
  padding: 3px 9px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 5px; color: var(--fg-2); cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 600;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.bg-btn:hover:not(:disabled) { background: var(--panel-3); color: var(--fg); }
.bg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bg-btn.active {
  background: rgba(74,140,255,0.16); border-color: rgba(74,140,255,0.55); color: #4a8cff;
}
.bg-btn.bg-primary {
  background: rgba(232,200,64,0.16); border-color: rgba(232,200,64,0.5); color: var(--accent);
}
.bg-btn.bg-danger:hover { border-color: rgba(214,90,74,0.55); color: var(--danger); }
.bg-check {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--fg-2); cursor: pointer; user-select: none;
}
.bg-check input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.bg-meter input[type="number"] {
  /* Wide enough for two digits (1-32) beside the native spin button, which
     keeps ~15px of the box even while it is not hovered (#803). */
  width: 44px; padding: 2px 2px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 4px; color: var(--fg);
  font-family: inherit; font-size: 11px; font-weight: 600; text-align: center;
}
.bg-spacer { flex: 1; min-width: 8px; }
.bg-hint { font-size: 10.5px; color: var(--muted); flex-basis: 100%; }

/* Click track options: inline in the Click track cluster, always visible once
   a track has a beat grid (#269 follow-up -- no popover, no click to reveal
   them). Everything shares the 34px control height of the clusters beside it;
   .daw-footer is min-height (not a fixed height) so a wrap never clips. */
.footer-metro-panel {
  /* display:contents removes this element's own box and promotes its
     children (the count-in switch, accent select, grid button, rate segment,
     volume) to be direct flex items of .footer-group-body, as peers of the
     on/off pill -- one flat wrap group the browser can line-break wherever
     the available width actually allows, instead of the pill being forced
     alone onto its own row and everything else confined to a second,
     artificially narrow one (#269 follow-up). .hidden below still works: it
     carries !important, which overrides this when the panel has no grid to
     show options for. */
  display: contents;
}
.footer-metro-panel.hidden { display: none; }

/* First answer to a row that has run out of width: the options stay exactly
   where #269 put them and stay visible, they just stop being one long line.

   The width is set by footerFit.js, not written here, and that is the point.
   A constant cannot be right: the row is short by a different number of pixels
   at every window size and with the library open or shut, so a fixed cap
   either leaves the options in a tall column when a shallow wrap would have
   done, or frees far more width than the row needed and leaves the surplus
   standing as a hole between the last cluster and Export Mix. The fallback
   here is only for the frame before the first measurement lands.

   `display: contents` above promotes the options to be peers of the on/off
   pill, which is what makes them one wide line. Giving the panel its own box
   back is the whole mechanism: it becomes a single flex item of the measured
   width, and its contents wrap inside it.

   .daw-footer is min-height rather than a fixed height precisely so a taller
   row is accommodated instead of clipped. */
.footer-clusters.collapse-wrap .footer-metro-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  width: var(--metro-wrap-w, 380px);
}
/* Nothing to wrap when the track has no beat grid. `.hidden` carries
   !important, so it already wins; this is belt and braces against that
   changing. */
.footer-clusters.collapse-wrap .footer-metro-panel.hidden { display: none !important; }

/* Narrow windows only, and only once wrapping to half the panel's inline width
   is still too wide. See footerFit.js for why the threshold is measured rather
   than written as a breakpoint.

   This used to cap the panel at 190px and let it wrap in place. That kept
   every option on screen without a click, which is what #269 asked for, but on
   a 15" laptop with the library open it wrapped into a five-row column: six
   controls stacked under a one-line footer, roughly 150px tall, with the rest
   of the row sitting beside a wall of them. Wrapping is the right answer for a
   couple of controls and the wrong one for six.

   So at this size only, the options move into a popover, opened from a
   disclosure beside the on/off pill.
   Nothing is removed and nothing changes behaviour -- the same panel, one
   click away, and back inline the moment the row has room for it again.

   Fixed, not absolute: .footer-clusters scrolls sideways and clips
   vertically (overflow-y: hidden), so an absolutely positioned panel would be
   clipped by the strip it belongs to. Fixed escapes that (no ancestor here
   creates a containing block), and transport.js sets left/top from the
   trigger's rect -- the same shape as .search-panel below. */
.footer-clusters.collapse-click .footer-metro-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  position: fixed;
  z-index: 300;
  /* 260px keeps the popover to a few short rows: count-in with its hint, then
     the meter selects side by side, rather than one control per line. */
  width: 260px;
  padding: 10px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.42);
}
/* Shut until the trigger opens it. `.hidden` (no beat grid at all) carries
   !important and still wins over both. */
.footer-clusters.collapse-click .footer-metro-panel:not(.open) { display: none; }
.footer-clusters.collapse-click .footer-metro-panel.hidden { display: none !important; }

/* The count-in plays with the click off too (#696), so in the popover it sits
   apart: its own row, a caption saying so, and a rule between it and the
   click-only settings below. A full-width item is what breaks the row, so the
   meter select moves down beside Grid. Popover only: inline it would be one
   more flex item on a row footerFit is already measuring to the pixel. */
.metro-countin-hint { display: none; }
.footer-clusters.collapse-click .metro-countin-hint {
  display: block;
  flex-basis: 100%;
  margin-top: -4px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; line-height: 1.35; color: var(--muted);
}

/* The popover frees more width than the row was short -- the click cluster
   goes from about 450px to about 140px in one step, and there is no smaller
   step to take. Left-aligned, the surplus pools as a hole between the last
   cluster and Export Mix. Spread, it reads as a band of controls across the
   footer instead. Only at this level: with the options inline the clusters
   already fill the row, and an overflowing flex row falls back to flex-start
   on its own, so the scrolling case is untouched. */
.footer-clusters.collapse-click { justify-content: space-between; }

/* The trigger itself only exists at this size: inline, the options are already
   on screen and a disclosure for them would be a button that does nothing. */
.click-more-btn { display: none; }
.footer-clusters.collapse-click .click-more-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 34px; padding: 0;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--fg-2); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.footer-clusters.collapse-click .click-more-btn:hover { background: var(--panel-3); color: var(--fg); }
.footer-clusters.collapse-click .click-more-btn[aria-expanded="true"] {
  border-color: var(--accent); color: var(--accent);
}
.footer-clusters.collapse-click .click-more-btn svg { transition: transform var(--t-fast); }
.footer-clusters.collapse-click .click-more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
/* No grid, no options, nothing to disclose. */
.footer-clusters.collapse-click .footer-metro-panel.hidden + .click-more-btn { display: none; }

/* Last resort before the strip would scroll: close up the spacing. Nothing is
   hidden or moved, so it costs the user nothing but density. */
/* Only the gaps between clusters. Reaching into .footer-group-body as well was
   worth a few pixels and cost more than it saved: at (0,3,0) it outranked
   `.footer-group-position .footer-group-body { gap: 4px }` at (0,2,0), so the
   widest cluster on the row got 2px roomier at the exact moment this is trying
   to reclaim width. Eight gaps at 8px instead of 16px is the win here. */
.footer-clusters.collapse-tight { gap: 8px; }

/* After the spacing, the only width left to find is a second line. Whole
   clusters wrap, never the controls inside one (.footer-group stays flex:
   none), so each cluster keeps its own shape and its label above it. Without
   this the tight row scrolled sideways with no scrollbar showing, cutting
   Global key mid-label and hiding the click track at the desktop app's default
   1280x820 window. The footer has no height of its own, so the lanes give up
   one control row for it.

   Packed left rather than spread: space-between on a wrapped row stretches a
   lone cluster on the second line across to Export Mix. The dividers go too, a
   divider at the end of a line separates nothing, and the gap still parts the
   clusters. Later in the file than .collapse-click, at the same specificity,
   so it wins. */
.footer-clusters.collapse-rows {
  flex-wrap: wrap;
  justify-content: flex-start;
  row-gap: 10px;
  column-gap: 20px;
}
.footer-clusters.collapse-rows .footer-divider { display: none; }
/* Set by footerFit.js only when it makes the controls row shorter: the strip
   takes the whole width and Master and Export Mix move to a line of their own
   under it, right-aligned where they were. */
.footer-row-controls.collapse-stack { flex-wrap: wrap; row-gap: 10px; }
.footer-row-controls.collapse-stack .footer-clusters { flex-basis: 100%; }
.footer-row-controls.collapse-stack .footer-track-actions { margin-top: 0; margin-left: auto; }

/* Click volume: a pill like everything else on the row, opening a vertical
   fader. It was a 116px slider with a percentage after it -- the only control
   on a row of 34px pills that was neither, so nothing lined up with it, and
   the widest single item in the cluster that runs out of room first. A fader
   is also the shape a level actually has.

   It sits beside the on/off pill rather than among the options, so it stays on
   the row at the widths where the rest goes behind the disclosure. */
.metro-vol-wrap { display: inline-flex; flex: none; }
.metro-vol-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--fg-2); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.metro-vol-btn:hover { background: var(--panel-3); color: var(--fg); }
.metro-vol-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.metro-vol-icon { flex-shrink: 0; }

/* Fixed rather than absolute for the same reason the options popover is:
   .footer-clusters scrolls sideways and clips vertically (overflow-y: hidden),
   so an absolutely positioned panel would be clipped by the strip its
   button sits in. transport.js sets left/top from that button's rect. */
.metro-vol-panel {
  position: fixed; z-index: 320;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 8px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.42);
}
.metro-vol-panel.hidden { display: none !important; }
.metro-vol-slider {
  /* The standard vertical range (Chrome 121, Safari 17.4, Firefox 129) with
     the older WebKit/Blink keyword behind it. On a browser that honours
     neither, the input stays a horizontal slider inside the popover: smaller
     than it should be, but still a working volume control. */
  -webkit-appearance: slider-vertical;
  writing-mode: vertical-rl;
  direction: rtl;
  width: 20px; height: 92px;
  accent-color: var(--accent);
  cursor: pointer;
}
.metro-val {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  width: 4ch; text-align: right;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
/* Native select, restyled to the same pill as the buttons around it: the
   caret is drawn by the wrapper so no appearance-dependent arrow shows. */
.metro-select-wrap { position: relative; display: inline-flex; }
.metro-select-wrap::after {
  content: ""; position: absolute; right: 10px; top: 50%;
  margin-top: -2px; pointer-events: none;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}
.metro-select {
  appearance: none; -webkit-appearance: none;
  height: 34px; padding: 0 26px 0 10px; max-width: 168px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--fg); cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 500; outline: none;
}
.metro-select:hover { background: var(--panel-3); }
.metro-select:focus { border-color: var(--accent); }

/* An armed count-in tints its select the way the toggle button it replaced
   used to tint itself (#587), so the panel still reads at a glance. */
.metro-select-wrap.active .metro-select {
  border-color: var(--accent);
  color: var(--accent);
}

/* Free-entry meter, revealed by the "Custom..." option. Sized to three digits
   so it sits next to the select rather than stretching the footer row. */
.metro-custom-beats {
  width: 58px; height: 34px; padding: 0 6px 0 8px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--fg);
  font-family: inherit; font-size: 12px; font-weight: 500; outline: none;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.metro-custom-beats:hover { background: var(--panel-3); }
.metro-custom-beats:focus { border-color: var(--accent); }

/* Beat grouping for the current meter, e.g. 3+2+2 (#595). Shown only when the
   meter has more than one sensible reading. */
.metro-group {
  width: 74px; height: 34px; padding: 0 8px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--fg);
  font-family: inherit; font-size: 12px; font-weight: 500; outline: none;
  font-variant-numeric: tabular-nums; flex-shrink: 0; text-align: center;
}
.metro-group:hover { background: var(--panel-3); }
.metro-group:focus { border-color: var(--accent); }
.metro-group::placeholder { color: var(--muted); }
/* A refused grouping: the box snapping back on its own reads as a bug unless
   something says the numbers did not add up. */
.metro-group.invalid { border-color: var(--danger); color: var(--danger); }
/* Detection confidence / unavailability note: its own line under the footer
   controls. Hidden until it has text, clipped to one line with the full text
   as a native tooltip. */
.metro-note {
  /* Starts where the controls it describes start.
     It used to inherit its left edge from .footer-wave-region, which insets
     the gutter the now-playing block filled. That block is in the composer now
     and the gutter with it, so the note was left against the bare edge of the
     footer, 18px to the left of Transport and lined up with nothing. */
  margin-top: 8px;
  margin-left: 18px;
  font-size: 11px; line-height: 1.3; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Holds its line even while it has nothing to say.
 *
 * This text arrives with the beat analysis, a second or so after a track opens,
 * and it used to arrive as a layout change: `display: none` while empty, then
 * 14px of text plus its margin, which took 22px off the wave panel underneath.
 *
 * That matters because the lane heights are decided from the panel's height
 * and then baked into the multitrack when its tracks are built. On the first
 * track of a session the lanes are built before this line appears, so they
 * keep the taller row while the mixer, sized in CSS from --lane-h, follows the
 * shorter one. The two columns then drift by 3px a row, all the way down the
 * stack, and a stem's name ends up on a different line from its own waveform.
 * Every later track is built after this line already exists, which is exactly
 * why the fault only ever showed on the first one.
 *
 * Reserving the line removes the change rather than reacting to it. The
 * alternative was re-measuring after the fact, and that does not work: a
 * lane's height reaches the DOM through the multitrack's own render, and
 * setOptions on the wavesurfer afterwards does not move the row it built.
 */
.metro-note:empty {
  display: block;
  visibility: hidden;
}
.metro-note:empty::before { content: "\00a0"; }
.metro-note.warn { color: var(--danger); }

/* Export chip button */
.track-chip-wrap {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center;
}
.track-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  color: var(--fg); border-radius: 8px; font-size: 12px; font-weight: 500;
  font-family: inherit; cursor: pointer; padding: 0 12px; height: 36px;
  white-space: nowrap;
  transition: background var(--t-fast);
}
.track-chip:hover { background: var(--panel-3); }
.track-chip-primary {
  background: var(--accent); color: #1a1206;
  border-color: transparent;
}
.track-chip-primary:hover { background: color-mix(in srgb, var(--accent) 85%, white); }
.track-chip-primary:disabled {
  background: var(--panel-2); color: var(--fg-muted);
  border-color: var(--border-strong); cursor: not-allowed; opacity: 0.5;
}

.track-chip-panel {
  /* Opens up and to the right: the button now lives in the left column, and a
     right-aligned panel would hang past the footer's left edge over the
     sidebar. */
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 4px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.track-chip-panel.hidden { display: none !important; }

.chip-panel-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 12px;
  background: none; border: none; border-radius: 7px;
  color: var(--fg); font-size: 13px; font-family: inherit;
  cursor: pointer; text-align: left; white-space: nowrap;
}
.chip-panel-item:hover { background: var(--panel-3); }
.chip-panel-item.active { color: var(--accent); font-weight: 600; }

/* ── Export split-button dropdown ── */
/* The whole button toggles the menu, so the caret is purely a decorative
   open/close indicator (no separate hit area). */
.export-caret { opacity: 0.8; }
/* Primary button busy state: swap the download icon for a spinner. */
.export-spinner { display: none; }
.track-chip.is-busy .export-dl-icon { display: none; }
.track-chip.is-busy .export-spinner { display: inline-block; animation: sections-spin 700ms linear infinite; }

.chip-panel-export { min-width: 260px; padding: 6px; }

/* WAV / MP3 segmented toggle in the panel header */
.export-format-toggle {
  display: flex; gap: 3px; padding: 3px;
  margin-bottom: 4px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px;
}
.export-fmt {
  flex: 1; padding: 5px 0; border: none; border-radius: 6px;
  background: transparent; color: var(--muted);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.export-fmt:hover { color: var(--fg-2); }
.export-fmt.active { background: var(--panel-3); color: var(--accent); }
/* OGG without libvorbis in the FFmpeg StemDeck uses (#824): still shown, so
   the format is not a mystery, but disabled with its reason below. */
.export-fmt[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.export-fmt[aria-disabled="true"]:hover { color: var(--muted); }
.export-ogg-unavailable { display: none; }
#t-export-panel.ogg-unavailable .export-ogg-unavailable {
  display: block;
  margin: 2px 4px 4px; padding: 5px 6px;
  font-size: 11px; line-height: 1.4; color: var(--muted);
}
/* A transposed mix on an FFmpeg without rubberband (#858): Mix and Region
   are disabled, and this says why. */
.export-transpose-unavailable { display: none; }
#t-export-panel.transpose-unavailable .export-transpose-unavailable {
  display: block;
  margin: 2px 4px 4px; padding: 5px 6px;
  font-size: 11px; line-height: 1.4; color: var(--muted);
}

/* Action rows — two-line: icon + (title/desc) + trailing check/count */
.export-item {
  align-items: center; gap: 11px;
  padding: 9px 10px; white-space: normal;
}
.export-item .chip-item-icon {
  flex-shrink: 0; width: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.export-item .chip-item-text {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.chip-item-title { font-size: 13px; font-weight: 500; color: var(--fg); }
.chip-item-desc { font-size: 11px; color: var(--muted); }
.chip-item-check { color: var(--accent); flex-shrink: 0; }
.export-item:hover:not([aria-disabled="true"]) { background: var(--panel-3); }
.export-item[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* MP4 is offered as an export format only when the job has a preserved video
   track (mp4 upload or YouTube). player.js toggles .has-video on the wrap. */
/* Opt-in rather than automatic: baking a permanent click into a bounce you
   meant to be clean is not obvious until you play it back. Applies to every
   format, audio and video alike. */
.export-click-opt {
  display: flex; align-items: center; gap: 7px;
  margin: 2px 4px 4px; padding: 5px 6px;
  border-radius: 6px; cursor: pointer; user-select: none;
  font-size: 11.5px; font-weight: 600; color: var(--fg-2);
}
.export-click-opt:hover { background: var(--panel-3); color: var(--fg); }
.export-click-opt input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.export-click-opt.disabled { opacity: 0.4; cursor: not-allowed; }
.export-click-opt.disabled:hover { background: none; color: var(--fg-2); }

/* ── Live search dropdown (topbar) ────────────────────────────────
   Anchored to .url-wrap, which is position:relative already for the drag
   overlay. contain:layout paint keeps a long result list from forcing the
   composer above it to re-layout while rows stream in. */
/* Lives on <body>, not in .url-wrap: the composer clips its children
   (overflow:hidden for the rounded pill), which made an absolutely positioned
   panel invisible. JS sets left/top/width from the composer's rect. */
.search-panel {
  position: fixed; z-index: 300;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.42);
  overflow: hidden; contain: layout paint;
}
.search-panel.hidden { display: none; }
.search-tabs { display: flex; gap: 2px; padding: 5px; border-bottom: 1px solid var(--border); }
.search-tab {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  padding: 5px 8px; border-radius: 6px; color: var(--muted);
  font-size: 11px; font-weight: 600; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.search-tab:hover { background: var(--panel-3); color: var(--fg); }
.search-tab.active { background: var(--panel-3); color: var(--accent); }
.search-status { padding: 12px 12px; font-size: 11.5px; color: var(--muted); }
.search-status.hidden { display: none; }
.search-list {
  list-style: none; margin: 0; padding: 4px;
  max-height: 340px; overflow-y: auto; overscroll-behavior: contain;
}
.search-row {
  display: flex; flex-direction: column;
  padding: 6px; border-radius: 7px; cursor: pointer;
}
.search-row-main { display: flex; align-items: center; gap: 9px; }
.search-row:hover, .search-row.active { background: var(--panel-3); }
.search-thumb {
  flex-shrink: 0; width: 64px; height: 36px; object-fit: cover;
  border-radius: 4px; background: var(--panel-2);
}
.search-thumb-empty { display: block; }
.search-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.search-title {
  font-size: 12px; font-weight: 600; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-meta {
  font-size: 10.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Over the duration limit the pipeline refuses the job, so the row is not
   selectable at all rather than merely warning about it. */
.search-row.too-long { cursor: not-allowed; opacity: 0.55; }
.search-row.too-long:hover { background: none; }
.search-warn {
  flex-shrink: 0; font-size: 10px; font-weight: 600; color: var(--danger);
  white-space: nowrap;
}

/* Audition controls. Hidden until the row is hovered or playing, so a list of
   eight results is not eight competing buttons. */
/* A labelled pill, not a bare glyph. An unlabelled circle on a search result
   reads as "play this result", which is the one thing it does not do: it
   auditions, it does not select. Always visible for the same reason -- a
   control you have to hover to discover is not a control most people find. */
.search-preview-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px 0 8px;
  border: 1px solid var(--border-strong); border-radius: 13px;
  background: var(--panel-2); color: var(--fg-2); cursor: pointer;
  font-family: inherit; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.01em; white-space: nowrap;
  opacity: 0.75;
  transition: opacity var(--t-fast), color var(--t-fast),
              background var(--t-fast), border-color var(--t-fast);
}
.search-row:hover .search-preview-btn,
.search-row.active .search-preview-btn,
.search-preview-btn:focus-visible { opacity: 1; }
.search-preview-btn:hover { background: var(--panel-3); color: var(--fg); border-color: var(--fg-2); }
.search-preview-btn.playing {
  opacity: 1; color: var(--accent); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.search-player {
  display: flex; align-items: center; gap: 9px;
  margin: 7px 2px 1px; padding-left: 73px; cursor: default;
}
.search-player.loading .search-seek { opacity: 0.4; }
.search-player.failed .search-clock { color: var(--danger); }
.search-play {
  flex-shrink: 0; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: var(--accent); color: #0b1118; cursor: pointer;
}
.search-seek {
  flex: 1; min-width: 0; height: 4px; accent-color: var(--accent);
  cursor: pointer;
}
.search-clock {
  flex-shrink: 0; font-family: var(--font-mono); font-size: 10px;
  color: var(--muted); font-variant-numeric: tabular-nums;
}

.export-fmt-video { display: none; }
#footer-export-wrap.has-video .export-fmt-video { display: block; flex: 1; }

/* Shown only when the video fetch actually failed, never when the source
   simply has no video stream. An absent MP4 button is normal; a broken one
   the user was never told about is not (#436). */
.export-video-failed { display: none; }
#footer-export-wrap.video-failed .export-video-failed {
  display: block;
  margin: 2px 4px 4px; padding: 5px 6px;
  font-size: 11px; line-height: 1.4; color: var(--muted);
}

/* In MP4 mode only "Export Mix" applies — the audio-only Stems/Region rows
   are hidden. main.js toggles .fmt-mp4 on the panel. */
/* Open in REAPER is desktop-only: main.js unhides it inside the app. */
#t-export-open-reaper[hidden],
#t-export-panel.fmt-mp4 #t-export-stems,
#t-export-panel.fmt-mp4 #t-export-reaper,
#t-export-panel.fmt-mp4 #t-export-open-reaper,
#t-export-panel.fmt-mp4 #t-export-region { display: none; }

/* ── About dialog ── */
.about-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgba(3,8,13,0.6); backdrop-filter: blur(6px);
}
.about-backdrop.hidden { display: none !important; }
.about-card {
  width: min(300px, calc(100vw - 32px));
  background: var(--panel-2); border: 1px solid var(--border-strong);
  border-radius: 18px; box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  padding: 28px 24px 24px; text-align: center;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0;
}
.about-close {
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.about-close:hover { background: var(--panel-3); color: var(--fg); }
.about-logo {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(244,183,64,0.15));
  border: 1px solid rgba(139,92,246,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: 14px;
}
.about-card h2 { margin: 0 0 4px; font-size: 18px; font-family: var(--font-mono); font-weight: 700; }
.about-tagline { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.about-version-badge {
  display: inline-block; font-size: 11px; font-family: var(--font-mono);
  color: var(--muted); background: var(--panel); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 10px; margin-bottom: 20px;
}
.about-primary-links {
  display: flex; gap: 8px; width: 100%; margin-bottom: 16px;
}
.about-link {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; border-radius: 8px; font-size: 12px;
  text-decoration: none; transition: background 0.15s;
}
.about-link-primary {
  background: var(--panel); border: 1px solid var(--border);
  color: var(--fg-2); font-weight: 600;
}
.about-link-primary:hover {
  background: var(--accent); border-color: var(--accent); color: #000;
}
.about-link-secondary {
  background: var(--panel); border: 1px solid var(--border);
  color: var(--fg-2);
}
.about-link-secondary:hover { background: var(--accent); border-color: var(--accent); color: #000; }
/* The in-app update pill: sits beside the plain Download link and is the
   recommended action, so it carries the accent fill by default rather than
   only on hover. */
.about-link-accent {
  background: var(--accent); border: 1px solid var(--accent);
  color: #000; font-weight: 600; cursor: pointer;
}
.about-link-accent:hover { filter: brightness(1.08); }
.about-link-accent:disabled { opacity: 0.55; cursor: default; filter: none; }
.about-divider {
  width: 100%; height: 1px; background: var(--border); margin-bottom: 16px;
}
.about-socials {
  display: flex; gap: 10px; align-items: center; justify-content: center;
}
.about-social-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; transition: all 0.15s;
}
.about-social-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; }
/* Where song details, lyrics and transcription come from, and their
   licences: small print under the socials. */
.about-credits { margin: 16px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--muted); }
/* StemDeck's own license and a link to its source: the AGPL asks a network
   service to offer its users the source, and the server version is one. */
.about-license { margin: 6px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--muted); }
.about-license a { color: inherit; text-decoration: underline; }
.about-license a:hover { color: var(--fg-2); }

/* ── Donate (donate.js) ──
   Laid out like a donate page: a wide hero card on top, the ways to give and
   their amounts on the left, sharing StemDeck on the right. The look is the
   app's own: the About card's frame, panel surfaces, the accent for what is
   chosen and for the action, and the rail's line icons. */
.rail-donate[hidden] { display: none; }
.rail-donate svg { color: var(--danger); }
.rail-donate:hover svg { color: var(--danger); filter: brightness(1.15); }
.donate-card {
  width: min(940px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow-y: auto; overflow-x: hidden;
  padding: 16px; gap: 12px; align-items: stretch; text-align: left;
}
.donate-card [hidden] { display: none !important; }
/* The About card is a flex column; here nothing may shrink, the card scrolls. */
.donate-card > * { flex-shrink: 0; }
.donate-card .about-close { z-index: 2; }

/* Hero: the words on the left, over a faint tile of hearts (the Donate
   button's heart) that runs evenly across the whole box. */
.donate-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr);
  align-items: center; padding: 32px 36px 32px 40px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
}
.donate-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--border);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='40' viewBox='0 0 44 40'%3E%3Cpath d='M22 31 13.4 22.6a5 5 0 0 1 7.1-7.1L22 17l1.5-1.5a5 5 0 0 1 7.1 7.1Z' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") 0 0 / 44px 40px repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='40' viewBox='0 0 44 40'%3E%3Cpath d='M22 31 13.4 22.6a5 5 0 0 1 7.1-7.1L22 17l1.5-1.5a5 5 0 0 1 7.1 7.1Z' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") 0 0 / 44px 40px repeat;
  opacity: 0.7;
}
/* As wide as the words were beside the drawing, so the title breaks the same way. */
.donate-hero-text { min-width: 0; max-width: 440px; }
.donate-mark { display: inline-flex; color: var(--accent); margin-bottom: 14px; }
.donate-card .donate-hero h2 {
  margin: 0 0 12px; font-family: var(--font-sans); font-size: 34px; line-height: 1.12;
  font-weight: 700; letter-spacing: -0.015em; color: var(--fg); text-wrap: balance; word-break: auto-phrase;
}
.donate-sub {
  margin: 0; max-width: 40ch; font-size: 13.5px; line-height: 1.6; color: var(--muted);
}

/* The two cards below the hero. */
.donate-grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 12px; align-items: stretch;
}
.donate-panel {
  min-width: 0; padding: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
}

/* Ways to give: two tiles side by side; the chosen one is lighter with an
   accent border. */
.donate-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Only one way has its link set: its tile takes the whole row. */
.donate-ways:has(> [hidden]) { grid-template-columns: 1fr; }
.donate-way {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0;
  padding: 14px 14px 13px; text-align: left; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted); font: inherit;
  transition: background var(--t-fast) var(--easing), border-color var(--t-fast) var(--easing);
}
.donate-way svg { margin-bottom: 10px; color: var(--muted); }
.donate-way:hover { background: var(--panel-3); }
.donate-way[aria-pressed="true"] { background: var(--panel-3); border-color: var(--accent); }
.donate-way[aria-pressed="true"] svg { color: var(--accent); }
.donate-way-name { font-size: 14px; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.donate-way-via { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
/* A way whose page takes no amount: the tile is a link that opens that page
   (donate.js). It is never "chosen"; the box-with-arrow mark in its corner says
   it leaves the app. The mark sits in the row of the way's own icon, above the
   words, so the words keep the whole width. */
.donate-way.is-link { position: relative; text-decoration: none; }
.donate-way.is-link .donate-way-out { position: absolute; top: 14px; right: 14px; margin: 0; }
.donate-way.is-link:hover { border-color: var(--border-strong); }
/* No way takes an amount, so no amounts show: the tiles fill the card, as tall
   as the sharing card beside it, with the words at the bottom. Stacked (one
   column), the card has no extra height and nothing changes. */
.donate-give:has(> .donate-presets[hidden]) { display: flex; flex-direction: column; }
.donate-give:has(> .donate-presets[hidden]) .donate-ways { flex: 1; }
.donate-give:has(> .donate-presets[hidden]) .donate-way > svg:first-child { margin-bottom: auto; padding-bottom: 10px; box-sizing: content-box; }
.donate-way.is-link:hover .donate-way-out { color: var(--accent); }
/* A QR code in a link tile (donate.js, DONATE_QR): a white card with a soft
   ring so it scans on either theme, with a small caption. The three cards in
   the row (two tiles, Share) have the same structure and the same fixed
   heights above the code: icon, title (room for two lines), then the code, so
   the codes and captions line up exactly. The words after the code ("via ...")
   sit at the bottom of the tile. The code's size is set in the markup, so
   nothing moves when it loads. A click on it is a click on the tile's link. */
.donate-way-scan { display: flex; flex-direction: column; align-items: center; gap: 8px; align-self: center; }
.donate-way-scan[hidden] { display: none; }
.donate-way-qr, .donate-qr {
  display: block; box-sizing: border-box; width: 128px; height: 128px; padding: 10px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-panel);
}
.donate-way-scan-caption { font-size: 11px; line-height: 1.3; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
/* In the markup the code comes after the words (so the Guide titles the tile
   from its name, see donate.js); it is drawn between the title and "via". */
.donate-way.has-qr > svg:first-child { order: -3; width: 22px; height: 22px; margin: 0 0 8px; padding: 0; box-sizing: border-box; }
.donate-way.has-qr .donate-way-name { order: -2; margin: 0 0 16px; line-height: 20px; }
.donate-way.has-qr .donate-way-scan { order: -1; }
.donate-way.has-qr .donate-way-via { margin-top: auto; padding-top: 16px; }
.donate-give:has(> .donate-presets[hidden]) .donate-way.has-qr > svg:first-child { margin-bottom: 8px; padding-bottom: 0; }
.donate-ways:has(.has-qr) .donate-way.is-link:not(.has-qr) > svg:first-child { margin-bottom: auto; }
.donate-way.is-link { transition: background var(--t-fast) var(--easing), border-color var(--t-fast) var(--easing), transform var(--t-fast) var(--easing); }
.donate-way.is-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.donate-way.is-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.donate-way.is-link:hover .donate-way-out { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .donate-way.is-link:hover { transform: none; } }
@media (min-width: 761px) {
  /* Room for a two-line title, so a long name never pushes the code down. */
  .donate-way.has-qr .donate-way-name, .donate-share-title { min-height: 40px; }
}

/* Amounts: four equal columns that fill the row. */
.donate-presets {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0;
}
.donate-preset {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 6px; cursor: pointer; white-space: nowrap;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg); font: inherit;
  transition: background var(--t-fast) var(--easing), border-color var(--t-fast) var(--easing);
}
.donate-preset:hover { background: var(--panel-3); }
.donate-preset[aria-pressed="true"] { background: var(--panel-3); border-color: var(--accent); }
.donate-preset-top { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.donate-preset-top svg { color: var(--muted); }
.donate-preset[aria-pressed="true"] .donate-preset-top svg { color: var(--accent); }
.donate-preset-top b { font-size: 15px; font-weight: 700; }

/* Custom amount, then the square arrow that continues to the chosen way. */
.donate-custom-row { display: flex; gap: 8px; margin-top: 10px; }
.donate-custom {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--fg); font: inherit; font-size: 13px;
}
.donate-custom::placeholder { color: var(--muted); }
.donate-custom:focus { outline: none; border-color: var(--accent); }
.donate-go {
  flex: 0 0 auto; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--bg); text-decoration: none; cursor: pointer;
  transition: filter var(--t-fast) var(--easing);
}
.donate-go:hover { filter: brightness(1.08); }
.donate-go:focus-visible, .donate-way:focus-visible, .donate-preset:focus-visible, .donate-sq:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.donate-hint { margin: 8px 2px 0; font-size: 11.5px; line-height: 1.4; color: var(--accent); }

/* Share: the same structure as a link tile with a code: icon, title, QR card
   and caption, then the address and the buttons at the bottom. The icon row
   starts where a tile's does (the tile's own border and padding, 15px), and the
   2px gaps a tile's flex column puts between its rows are in the margins. */
.donate-share { display: flex; flex-direction: column; }
.donate-share-icon { color: var(--fg-2); width: 22px; height: 22px; margin: 15px 0 10px 15px; flex: none; }
.donate-share-title { margin: 0 0 18px 15px; font-size: 14px; font-weight: 600; line-height: 20px; color: var(--fg); }
.donate-share-body { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.donate-share-scan { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.donate-addr {
  margin: 0; max-width: 100%; text-align: center; user-select: text;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.4; color: var(--muted);
  overflow-wrap: anywhere;
}
/* One row: Share (where there is one) and Star share the width, and the two
   follow buttons are icon-only squares at the end, so the row stays one line
   tall. With no Share, Star simply takes the room. */
.donate-share-btns { align-self: stretch; margin-top: auto; display: flex; gap: 8px; }
.donate-share-btns > .donate-sq { flex: 1 1 0; }
.donate-share-btns > .donate-social { flex: 0 0 48px; }
.donate-share-btns > [hidden] { display: none; }
.donate-sq {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 0; height: 62px; padding: 6px 4px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg-2); font: inherit; font-size: 11.5px; font-weight: 600; text-decoration: none;
  transition: background var(--t-fast) var(--easing), border-color var(--t-fast) var(--easing), color var(--t-fast) var(--easing);
}
.donate-sq:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.donate-sq-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* One column below 760 px; the drawing goes under the words, smaller. */
@media (max-width: 760px) {
  .donate-card { padding: 12px; }
  .donate-hero { padding: 24px 20px 20px; }
  .donate-card .donate-hero h2 { font-size: 26px; margin-right: 24px; }
  .donate-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .donate-ways { gap: 8px; }
  .donate-way { padding: 12px 11px; }
  .donate-way-name { font-size: 13px; }
  .donate-way-qr, .donate-qr { width: 104px; height: 104px; padding: 8px; }
  .donate-way-scan-caption { font-size: 10.5px; }
  .donate-sq { height: 52px; padding: 6px 2px; }
  .donate-share-btns { gap: 6px; }
  .donate-share-btns > .donate-social { flex-basis: 38px; }
}

/* ── Release notes dialog ── */
.release-card {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.release-notes {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  text-align: left;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.5;
}
.release-notes h4 {
  margin: 12px 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--fg);
}
.release-notes h4:first-child { margin-top: 0; }
.release-notes p { margin: 0 0 8px; }
.release-notes ul { margin: 0 0 8px; padding-left: 18px; }
.release-notes li { margin: 2px 0; }
.release-notes a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.release-notes a:hover { text-decoration: underline; }
.release-notes code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
}
.release-notes pre {
  margin: 0 0 8px;
  padding: 8px 10px;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.release-notes pre code { border: 0; background: none; padding: 0; }
.release-notes blockquote {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: rgba(139, 92, 246, 0.08);
}
.release-notes blockquote > :last-child { margin-bottom: 0; }
.release-callout {
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  margin: 0 0 6px !important;
}
/* Server/Docker mode: image-pull guidance in place of a desktop download. */
.release-docker {
  width: 100%;
  text-align: left;
  margin: 0 0 16px;
}
.release-docker-label {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.release-docker-text { margin: 0 0 8px; font-size: 12px; color: var(--fg-2); }
.release-docker-cmd {
  margin: 0 0 8px;
  padding: 8px 10px;
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg);
}
.release-docker-note { margin: 0; font-size: 11px; color: var(--muted); }

/* Windows desktop: in-app download + apply, in place of a browser download. */
.release-inapp { width: 100%; text-align: left; margin: 0 0 16px; }
.release-inapp-progress-bar {
  height: 3px; border-radius: 2px; margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.09); overflow: hidden;
}
.release-inapp-progress-fill {
  height: 100%; width: 0; border-radius: 2px;
  background: var(--accent);
  transition: width 260ms linear;
}
/* Indeterminate: the updater cannot listen to the Rust progress event from this
   origin (see catalog.js), so the bar shows activity rather than a percentage. */
.release-inapp-progress.indeterminate .release-inapp-progress-fill {
  width: 40%;
  animation: release-inapp-slide 1.1s ease-in-out infinite;
}
@keyframes release-inapp-slide {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}
.release-inapp-progress-text { margin: 0; font-size: 11px; color: var(--muted); }
.release-inapp-error { margin: 0; font-size: 12px; color: #e54e4e; }
.release-full-download { margin: 0 0 12px; font-size: 13px; line-height: 1.45; text-align: left; color: var(--fg); }

/* The release dialog lives outside `.daw`, so the scoped `.daw .hidden` rule
   does not reach its inner elements and there is no global `.hidden` rule.
   Hide the mode-specific parts explicitly (same approach
   as `.about-backdrop.hidden`) so desktop hides the docker block and server
   hides the download button. */
.release-docker.hidden,
.release-inapp.hidden,
.release-inapp-progress.hidden,
.release-inapp-error.hidden,
.release-full-download.hidden,
.release-card .about-link.hidden {
  display: none !important;
}

/* The "New release available" card opens the dialog on click. */
.daw-notif-release { cursor: pointer; }

/* ── Failure dialog ── */
/* Same shell as the release dialog, in the danger colour, with the technical
   block the report will carry shown verbatim -- nothing is sent that the user
   has not been able to read first. */
.failure-card {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.failure-logo { color: var(--danger); }
.failure-when { color: var(--muted); }
.failure-message {
  margin: 12px 0 0;
  font-size: 13px; line-height: 1.5; color: var(--fg-2);
  white-space: pre-line; text-align: center;
}
.failure-hint {
  margin: 10px 0 0;
  font-size: 11px; line-height: 1.5; color: var(--muted);
  text-align: center;
}
.failure-tech {
  width: 100%; flex: 1 1 auto; min-height: 0;
  margin: 12px 0 0; padding: 10px 12px;
  overflow: auto; text-align: left;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.failure-tech code {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.55;
  color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
/* Opt-in, not automatic: this pulls extra log content into what's about to be
   copied into a public report, so it gets its own deliberate click rather
   than firing every time the dialog opens (matches .library-editor-sync's
   amber "extra action" treatment). */
.failure-logs-btn {
  align-self: flex-start;
  min-height: 28px; margin-top: 8px; padding: 0 12px;
  border-radius: 7px; border: 1px solid rgba(244, 183, 64, 0.3);
  background: rgba(244, 183, 64, 0.16); color: var(--accent);
  font-family: var(--font-mono); font-size: 11px; cursor: pointer;
}
.failure-logs-btn:disabled { opacity: 0.55; cursor: default; }
/* Reporting is the reason this dialog exists, so it gets the app's primary
   button treatment (as Export Mix does) rather than the muted link style the
   About/release dialogs use for their several equal-weight links. */
.failure-card .about-link-primary {
  background: var(--accent); border-color: transparent; color: #1a1206;
}
.failure-card .about-link-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, white);
  color: #1a1206;
}

/* ── Library sections (Recent · Stem Collections · Tags) ── */
.lib-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 14px;
}
.lib-section + .lib-section {
  border-top: 1px solid var(--border);
}
.lib-section-head {
  padding: 0 4px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Tag chips */
/* ── Tag autocomplete dropdown ── */
.tag-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 50;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 4px;
  list-style: none;
  margin: 0;
  box-shadow: var(--shadow-panel);
}
.tag-suggest:empty { display: none; }
.tag-suggest-item {
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--fg-2);
  cursor: pointer;
}
.tag-suggest-item:hover,
.tag-suggest-item.focused {
  background: var(--panel-3);
  color: var(--fg);
}

/* Supporters ("We Recommend" dialog): category sections, each a small uppercase
   accent label with a rule, over a responsive grid of partner cards. */
/* Wide enough for two columns of three cards. The single column it replaced
   was 420px and always scrolled: five sections stacked is taller than any
   normal window, so half the people on the list were never seen. */
/* Wide enough that a four-person category is one row rather than two, which is
   what was pushing the list past the dialog and putting a scrollbar on it. */
.friends-card { width: min(1020px, calc(100vw - 32px)); }
.friends-card .lib-friends-grid { width: 100%; margin-top: 4px; }

/* ── Lyrics tab (#699) ──
   A view of the sidebar, like Favorites and Trash, but not a list: while it is
   on, the search box and the library list step aside and the panel takes the
   whole height, so the lyrics get the room and scroll on their own. */
.lyrics-panel { display: none; }
.sidebar.lyrics-view .daw-search,
.sidebar.lyrics-view .clear-bin-bar,
.sidebar.lyrics-view .daw-lib-list { display: none !important; }
.sidebar.lyrics-view .lyrics-panel {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto; min-height: 0;
}
/* The EXTRACT label's type, like every other section head in the app. */
.lyrics-title {
  margin: 0; font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.lyrics-note { margin: 0; font-size: 10.5px; line-height: 1.4; color: var(--muted); }
.lyrics-status { margin: 0; font-size: 12px; color: var(--fg-2); }
.lyrics-status:empty { display: none; }
.lyrics-status.muted { color: var(--muted); }
.lyrics-status.error { color: var(--danger); }

.lyrics-versions:empty { display: none; }
.lyrics-versions { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.lyrics-match { display: flex; flex-direction: column; min-width: 0; }
.lyrics-match-title { font-size: 13px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lyrics-match-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lyrics-tools { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.lyrics-link {
  padding: 0; background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 11px; font-weight: 600;
}
.lyrics-link:hover { text-decoration: underline; }
/* Align, for lyrics with no timing to move: still focusable, so its tooltip
   says why (lyrics.js). */
.lyrics-link[aria-disabled="true"] { color: var(--muted); cursor: default; }
.lyrics-link[aria-disabled="true"]:hover { text-decoration: none; }

/* The Align panel: under the tools row, the sidebar's width, every control a
   button so the keys reach them all. The nudges sit either side of the
   offset they change. */
.lyrics-align {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
}
.lyrics-align-hint { margin: 0; font-size: 10.5px; line-height: 1.4; color: var(--muted); }
.lyrics-align-target {
  margin: 0; font-size: 11px; color: var(--fg-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lyrics-align-target:empty { display: none; }
.lyrics-align-btn {
  min-height: 26px; padding: 0 8px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--border-strong);
  color: var(--fg-2); font-family: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.lyrics-align-btn:hover { background: var(--panel-3); color: var(--fg); }
.lyrics-align-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lyrics-align-btn[aria-busy="true"] { cursor: progress; opacity: 0.6; }
.lyrics-align-start { width: 100%; color: var(--accent); border-color: var(--accent); }
.lyrics-align-nudges { display: flex; align-items: center; gap: 4px; }
.lyrics-align-nudge { flex: 0 0 auto; padding: 0 6px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lyrics-align-offset {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--fg);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lyrics-align-actions { display: flex; gap: 6px; }
.lyrics-align-actions .lyrics-align-btn { flex: 1 1 0; min-width: 0; }
/* Done closes the panel: filled, so it reads as the way out. */
.lyrics-align-done { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.lyrics-align-done:hover { background: var(--accent); color: var(--bg); filter: brightness(1.08); }
.lyrics-align-message { margin: 0; font-size: 11px; line-height: 1.4; color: var(--fg-2); }
.lyrics-align-message:empty { display: none; }
.lyrics-align-message.muted, .lyrics-align-message.loading { color: var(--muted); }
.lyrics-align-message.error { color: var(--danger); }
/* display: flex would otherwise outrank the hidden attribute that folds it. */
.lyrics-version-list[hidden] { display: none; }
.lyrics-version-list { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow-y: auto; }
.lyrics-version {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  padding: 5px 7px; border-radius: 6px; border: 1px solid transparent;
  background: none; color: var(--fg-2); text-align: left; cursor: pointer;
}
.lyrics-version:hover { background: var(--panel); border-color: var(--border); }
.lyrics-version-title { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lyrics-version-meta { font-size: 10.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The lyrics scroll inside the panel. The bottom padding lets the last lines
   reach the middle, where the line being sung is kept. position: relative
   makes this the lines' offsetParent, which lyrics.js measures from. */
.lyrics-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 2px 40%; }
.lyrics-body:empty { display: none; }
/* Synced lines are buttons, since clicking one moves the playhead there. */
.lyrics-line {
  display: block; width: 100%; margin: 0; padding: 4px 8px;
  background: none; border: none; border-radius: 6px;
  color: var(--muted); font: inherit; font-size: 14px; line-height: 1.45; text-align: left;
  cursor: pointer; transition: color var(--t-fast), background var(--t-fast);
}
.lyrics-line:hover { color: var(--fg-2); background: var(--panel); }
/* Korean is spaced into words and wraps between them, never inside one; a
   word too long for the line still breaks. lang is set per line by lyrics.js. */
.lyrics-line:lang(ko), .lyrics-text:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
/* A ring for keyboard focus only: a clicked line lets go of focus (lyrics.js). */
.lyrics-line:focus { outline: none; }
.lyrics-line:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lyrics-line.current { color: var(--fg); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
/* The line after it, a step brighter than the rest, so the next words can be
   read before they are due. */
.lyrics-line.next { color: var(--fg-2); }
/* While the Align panel is open, the line last clicked, which Start lyrics
   here moves instead of the first. */
.lyrics-body.aligning .lyrics-line.picked { outline: 1px dashed var(--border-strong); outline-offset: -1px; }
/* The karaoke wipe, one word at a time: sung words take the accent, and the
   word being sung is filled left to right up to --fill, set every frame by
   lyrics.js. Per word rather than across the whole line, so a line that wraps
   fills its first row before its second instead of both at once. */
.lyrics-line.current .lw.sung { color: var(--accent); }
.lyrics-line.current .lw.singing {
  color: transparent;
  background: linear-gradient(90deg, var(--accent) var(--fill, 0%), var(--fg) var(--fill, 0%));
  -webkit-background-clip: text;
  background-clip: text;
}
.lyrics-text { margin: 0; padding: 1px 8px; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }

/* The Align panel's note when the lines are timed one by one, so the offset
   is not what is in effect. */
.lyrics-align-note { margin: 0; font-size: 11px; line-height: 1.4; color: var(--fg-2); }
.lyrics-align-note:empty { display: none; }
.lyrics-align-btn:disabled { opacity: 0.45; cursor: default; }
.lyrics-align-btn:disabled:hover { background: var(--panel-2); color: var(--fg-2); }

/* ── Sync lines (lyrics.js) ──
   The panel under the tools row while the mode is on: which line is next,
   one big Tap, the options, the resets. Built for a glance mid-song. */
.lyrics-sync {
  display: flex; flex-direction: column; gap: 7px;
  padding: 8px; border: 1px solid var(--accent); border-radius: 8px; background: var(--panel);
}
.lyrics-sync-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lyrics-sync-title { margin: 0; font-size: 12px; font-weight: 700; color: var(--fg); }
.lyrics-sync-kind { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lyrics-sync-next {
  margin: 0; padding: 6px 8px; border-radius: 6px; background: var(--bg-2);
  font-size: 13px; line-height: 1.35; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lyrics-sync-next-label { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lyrics-sync-tap {
  min-height: 44px; font-size: 15px; letter-spacing: 0.04em;
  background: var(--accent); border-color: var(--accent); color: var(--bg);
}
.lyrics-sync-tap:hover { background: var(--accent); color: var(--bg); filter: brightness(1.08); }
.lyrics-sync-tap:disabled, .lyrics-sync-tap:disabled:hover { background: var(--panel-2); border-color: var(--border-strong); color: var(--muted); filter: none; }
.lyrics-sync-tap kbd { font-family: var(--font-mono); font-size: 10px; font-weight: 600; opacity: 0.75; margin-left: 6px; }
/* A tap lands: the button flashes, so a tap can be seen as well as heard. */
.lyrics-sync-tap.tapped { animation: lyrics-tap 180ms ease-out; }
@keyframes lyrics-tap { from { filter: brightness(1.6); } to { filter: none; } }
@media (prefers-reduced-motion: reduce) { .lyrics-sync-tap.tapped { animation: none; } }
.lyrics-sync-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lyrics-sync-row .lyrics-align-btn { flex: 1 1 auto; }
.lyrics-sync-opts { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.lyrics-sync-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--fg-2); cursor: pointer; }
.lyrics-sync-opt input { margin: 0; accent-color: var(--accent); }
.lyrics-sync-keys { margin: 0; font-size: 10.5px; line-height: 1.5; color: var(--muted); }
.lyrics-sync-keys kbd {
  font-family: var(--font-mono); font-size: 10px; padding: 0 4px; border-radius: 3px;
  border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--fg-2);
}
/* In the mode each line shows when it starts, and the line in hand is framed
   and carries its own nudges. The time is drawn by CSS from data-time, so it
   is not part of the line's text. */
.lyrics-body.syncing .lyrics-line::before {
  content: attr(data-time);
  display: inline-block; min-width: 4.6em; margin-right: 6px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lyrics-body.syncing .lyrics-line.selected { background: var(--panel); outline: 1px solid var(--accent); outline-offset: -1px; }
.lyrics-line-tools { display: flex; align-items: center; gap: 4px; padding: 2px 8px 6px; }
.lyrics-line-tools .lyrics-align-btn { min-height: 22px; padding: 0 6px; font-size: 10.5px; }
.lyrics-line-tools .lyrics-align-nudge { font-family: var(--font-mono); }
.lyrics-line-tools .lyrics-line-here { margin-left: auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent); border-color: var(--accent); }

/* The lyrics lane over the waveform (lyricsLane.js), shaped like the
   Sections ribbon above it: markers at percentages of a track that is the
   zoomed waveform's width. */
.daw-lyrics-ribbon { display: flex; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.daw-lyrics-ribbon.hidden { display: none; }
.daw-lyrics-header { justify-content: space-between; gap: 8px; }
.daw-lyrics-title-group { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; }
.daw-lyrics-title-group .daw-label-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lyrics-lane-done {
  flex-shrink: 0; min-height: 22px; padding: 0 10px; border-radius: 5px;
  background: var(--accent); border: 1px solid var(--accent); color: var(--bg);
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.lyrics-lane-done:hover { filter: brightness(1.08); }
.daw-lyrics-area { flex: 1; position: relative; height: 34px; background: var(--bg-2); overflow: clip; user-select: none; }
.daw-lyrics-track { position: absolute; inset: 0; right: auto; width: calc(100% * var(--zoom, 1)); }
.lyr-mark {
  position: absolute; top: 4px; bottom: 4px; min-width: 6px;
  display: flex; align-items: center; padding: 0 6px 0 7px; margin: 0;
  background: none; border: none; border-left: 2px solid var(--fg-2); border-radius: 0;
  color: var(--fg-2); font: inherit; font-size: 10.5px; text-align: left;
  cursor: grab; overflow: hidden;
}
.lyr-mark:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
.lyr-mark-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.lyr-mark.current { color: var(--fg); border-left-color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.lyr-mark.selected { color: var(--accent); border-left-color: var(--accent); background: rgba(244, 183, 64, 0.12); z-index: 2; }
.lyr-mark.dragging { cursor: grabbing; z-index: 3; background: rgba(244, 183, 64, 0.2); }
.lyr-lane-playhead { position: absolute; inset: 0; pointer-events: none; will-change: transform; z-index: 4; }
.lyr-lane-playhead i { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--accent); opacity: 0.8; }

/* ── Artist box (#699) ──
   The About dialog's frame, left-aligned and wider, because it holds prose
   and lists rather than a logo and two buttons. The body scrolls on its own
   so the search field stays put above a long history. */
.artist-card {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 22px 22px 18px;
  text-align: left;
  align-items: stretch;
}
/* Room on the right for the close button, which sits in the same corner. */
.artist-search { display: flex; gap: 8px; margin-right: 34px; }
.artist-search input {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 8px;
  color: var(--fg); font: inherit; font-size: 13px;
}
.artist-search input:focus { outline: none; border-color: var(--accent); }
.artist-search-btn {
  height: 34px; padding: 0 14px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--fg-2); font-weight: 600; cursor: pointer;
}
.artist-search-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; }
.artist-search { margin-bottom: 14px; }
/* A band or a song already known opens without the search row; the body's
   first line then sits in the close button's corner and leaves it room. */
.artist-search.hidden { display: none; }
.artist-search.hidden + .artist-body > :first-child { margin-right: 34px; }
/* What is sent where: the box's foot, under the scrolling body, in the
   credit line's small muted type. */
.artist-card-foot { flex-shrink: 0; padding-top: 8px; }
.artist-privacy { margin: 0; font-size: 10.5px; line-height: 1.45; color: var(--muted); }
.artist-other { margin: -6px 0 10px; font-size: 12px; }
.artist-status + .artist-other { margin-top: -14px; text-align: center; }
.artist-other-btn {
  padding: 0; background: none; border: 0;
  color: var(--accent); font: inherit; cursor: pointer;
}
.artist-other-btn:hover { text-decoration: underline; }
.artist-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
.artist-status { margin: 24px 0; text-align: center; font-size: 13px; color: var(--fg-2); }
.artist-status.muted { color: var(--muted); }
.artist-status.error { color: var(--danger); }

.artist-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.artist-photo {
  width: 72px; height: 72px; flex-shrink: 0;
  object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel);
}
/* Two classes deep so it outranks .about-card h2, which is the About box's
   monospace wordmark and not a band name. */
.artist-card .artist-name {
  margin: 0; font-family: inherit; font-size: 22px; font-weight: 700; line-height: 1.2;
}
.artist-desc { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.artist-titles { flex: 1 1 auto; min-width: 0; }
/* A long name, or one in a script with no spaces to break at, wraps inside
   the box rather than pushing the save button out of it. */
.artist-card .artist-name, .artist-card .artist-work-name { overflow-wrap: anywhere; }
/* The name in the artist's own language after the one in the reader's
   (Jay Chou 周杰倫): lighter, and kept whole on the next line when the two do
   not fit on one. */
.artist-native {
  display: inline-block; max-width: 100%;
  font-size: 0.72em; font-weight: 500; color: var(--muted);
}
.artist-names .artist-native { margin-left: 2px; font-size: 1em; }
/* Which Wikipedia the text below was read from, when not the reader's own. */
.artist-edition { margin: -4px 0 6px; font-size: 11px; color: var(--muted); }
/* Korean breaks between words, as it is written, not inside them; Japanese
   keeps small kana and closing marks off the start of a line. */
.artist-card :lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
.artist-history:lang(ja) { line-break: strict; }
/* The section titles' wide tracking is for Latin capitals; between Chinese,
   Japanese or Korean characters it reads as a gap inside the word. */
.artist-section-title:lang(ja), .artist-section-title:lang(ko), .artist-section-title:lang(zh) {
  letter-spacing: 0.02em;
}
/* Save for this track: the accent until it is done, then a quiet
   label that says so. It sits by the name because the name is what is saved. */
.artist-save {
  flex-shrink: 0; align-self: center;
  height: 30px; padding: 0 12px; border-radius: 8px;
  background: var(--accent); border: 1px solid var(--accent);
  color: #000; font-size: 12px; font-weight: 600; cursor: pointer;
}
.artist-save:hover { filter: brightness(1.08); }
.artist-save.saved {
  background: var(--panel); border-color: var(--border);
  color: var(--muted); cursor: default; filter: none;
}

.artist-section { padding: 12px 0; border-top: 1px solid var(--border); }
/* The EXTRACT label's type, as the card's NOW PLAYING legend uses. */
.artist-section-title {
  margin: 0 0 8px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.artist-history p { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--fg-2); }
.artist-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.artist-names li {
  padding: 3px 10px; font-size: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
}
.artist-subtitle { margin: 10px 0 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
/* Two columns: a band with twenty albums is a short box, not a long one. */
.artist-albums { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.artist-albums li { display: flex; gap: 10px; padding: 3px 0; font-size: 12.5px; break-inside: avoid; }
.artist-album-year { min-width: 4ch; color: var(--muted); font-variant-numeric: tabular-nums; }
.artist-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
}
.artist-more { color: var(--accent); font-weight: 600; text-decoration: none; }
.artist-more:hover { text-decoration: underline; }
/* A band filled from Discogs credits it beside Wikipedia: three items can
   share the row, so it wraps rather than squeezing them. */
.artist-foot { flex-wrap: wrap; }
.artist-discogs-credit { font-weight: 500; }
/* "Only Wikipedia was searched": a quiet aside, not a warning, with the way
   to the setting as a small secondary button. */
.artist-discogs-note {
  margin: 0 0 12px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; line-height: 1.5; color: var(--fg-2);
}
.artist-discogs-note p { margin: 0 0 8px; }
.artist-discogs-open {
  height: 28px; padding: 0 12px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--border-strong);
  color: var(--fg); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.artist-discogs-open:hover { border-color: var(--accent); color: var(--accent); }
.artist-status + .artist-discogs-note { margin-top: -8px; }
/* The artists Discogs has for a name Wikipedia does not know, to pick from:
   each its name, with Discogs' number, and the start of its profile. */
.artist-candidates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.artist-candidate {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 8px 10px; text-align: start;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  color: var(--fg); font: inherit; cursor: pointer;
}
.artist-candidate:hover, .artist-candidate:focus-visible { border-color: var(--accent); }
.artist-candidate-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.artist-candidate-profile { font-size: 12px; line-height: 1.45; color: var(--muted); }
.artist-discogs-pick + .artist-foot { justify-content: flex-end; }
@media (max-width: 560px) { .artist-albums { columns: 1; } }

/* The musical or film a song is from: a section below the band, or the whole
   box when there is no band, where it leads without the rule above it. */
.artist-work.lead { padding-top: 0; border-top: 0; }
.artist-work-head { margin-bottom: 10px; }
.artist-work:not(.lead) .artist-work-photo { width: 56px; height: 56px; }
/* Two classes deep, as .artist-name, to outrank .about-card h2. */
.artist-card .artist-work-name {
  margin: 0; font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1.25;
}
.artist-card .artist-work.lead .artist-work-name { font-size: 22px; line-height: 1.2; }
.artist-work-year { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.artist-work-credits {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px;
  margin: 4px 0 8px; font-size: 12.5px;
}
.artist-work-credits dt { color: var(--muted); }
.artist-work-credits dd { margin: 0; color: var(--fg-2); }
.artist-work-more { margin: 0; font-size: 12px; }

/* The song, heading the box whenever the track is known as one. What follows
   it (the show, or a band) then starts below a rule, as any section does. */
.artist-song { margin-bottom: 14px; }
/* Two classes deep, as .artist-name, to outrank .about-card h2. */
.artist-card .artist-song-title {
  margin: 0; font-family: inherit; font-size: 22px; font-weight: 700; line-height: 1.2;
}
.artist-song-from { font-size: 13px; color: var(--fg-2); }
.artist-song-facts { margin: 10px 0 0; }
.artist-head.artist-band-head { padding-top: 14px; border-top: 1px solid var(--border); }
/* The performer under a show: the work section's smaller photo and name, and
   the rest behind "More about ...". */
.artist-performer-head { margin-bottom: 8px; }
.artist-performer .artist-photo { width: 56px; height: 56px; }
.artist-card .artist-performer .artist-name { font-size: 16px; line-height: 1.25; }
.artist-performer .artist-other { margin: 0 0 6px; }
.artist-performer-more:focus { outline: none; }
/* Official links under a band's or a show's heading: the member chips' pill
   shape, an icon and a short label each, wrapping on a narrow box. */
.artist-links {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px;
  margin: -6px 0 12px; padding: 0;
}
.artist-performer .artist-links, .artist-work .artist-links { margin: 0 0 10px; }
.artist-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; font-size: 12px; font-weight: 500; line-height: 1.4;
  color: var(--fg-2); text-decoration: none; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
}
.artist-link svg { flex-shrink: 0; color: var(--muted); }
.artist-link:hover { color: var(--fg); border-color: var(--accent); }
.artist-link:hover svg { color: var(--accent); }
.artist-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The info button that opens the box: the heart's mirror image, a full-height
   segment on the card's right edge, where the heart used to be. A button of
   its own rather than the whole card being clickable, which competed with the
   heart inside it and gave the keyboard nothing real to press. */
#nowPlayingPanel .track-panel-head .daw-details-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: var(--np-fav);
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0 7px 7px 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
#nowPlayingPanel .track-panel-head .daw-details-btn:hover { background: var(--panel-3); color: var(--fg); }
#nowPlayingPanel .track-panel-head .daw-details-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Nothing to look up before a track is open. */
.app.no-track #nowPlayingPanel .daw-details-btn { opacity: 0.4; pointer-events: none; }
/* The text stops short of the segment. */
#nowPlayingPanel .track-panel-info,
#nowPlayingPanel .daw-track-meta-line { padding-right: calc(var(--np-fav) + 10px); }
.lib-friends-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 18px;
  align-items: start;
  text-align: left;
  padding: 2px 2px 0 0;
  /* Nothing here is meant to be selected or dragged: these are link tiles, and
     a stray drag across two of them selects half the dialog and leaves it
     highlighted. */
  user-select: none;
  -webkit-user-select: none;
  /* Kept as a floor, not as the normal case: the list is meant to fit, but a
     very short window still has to reach the bottom of it somehow. */
  max-height: min(88vh, 900px);
  overflow-y: auto;
}
.lib-friends-grid img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.lib-friends-col { min-width: 0; }
.lib-friends-split { align-self: stretch; background: var(--border); }
/* One column again once two would squeeze the cards below three per row. */
@media (max-width: 860px) {
  .lib-friends-grid { grid-template-columns: 1fr; }
  .lib-friends-split { display: none; }
}
.lib-friends-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}
.lib-friends-col > .lib-friends-cat:first-child { margin-top: 2px; }
/* Thin rule filling the width left over by the label. */
.lib-friends-cat::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}
.lib-friends-row {
  display: grid;
  /* ~3 per row in the card's default width, dropping to 2 as it narrows. */
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 6px;
}
.lib-friend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 10px 6px 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg-2);
  text-decoration: none;
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.lib-friend:hover {
  background: var(--panel-2);
  color: var(--fg);
  border-color: rgba(255,255,255,0.15);
}
/* Fixed-height slot so names line up across a row whichever of the three
   shapes an entry ends up with: round avatar, wordmark, or monogram. */
.lib-friend-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
}
/* Wordmark logos are transparent and not square: letterbox them into the slot. */
.lib-friend-logo {
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
}
/* Profile photos are square: crop to a circle. */
.lib-friend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
/* Monogram fallback when a card has no image (or it fails to load): matches the
   round avatar size, in the accent colour, so the grid stays on-brand. */
.lib-friend-monogram {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  background: var(--panel-3);
  border: 1px solid var(--border);
}
/* Small link glyph at the foot of the card. margin-top:auto pins it to the
   bottom so it lines up across cards with different role lengths. */
.lib-friend-ig,
.lib-friend-link {
  /* block + no-shrink avoids the WebKit baseline clip on small inline SVGs */
  display: block;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: auto;
  padding-top: 3px;
  opacity: 0.6;
}
.lib-friend-ig { fill: currentColor; }
.lib-friend-link {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lib-friend:hover .lib-friend-ig,
.lib-friend:hover .lib-friend-link { opacity: 1; }
/* A card with several links: the card itself is not a link, each pill is. */
.lib-friend-multi:hover { background: var(--panel); border-color: var(--border); color: var(--fg-2); }
.lib-friend-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: auto; padding-top: 3px; }
.lib-friend-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--panel-2);
  color: var(--fg-2); font-size: 9.5px; font-weight: 600; text-decoration: none;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.lib-friend-pill:hover { color: var(--fg); border-color: var(--accent); }
.lib-friend-pill .lib-friend-link,
.lib-friend-pill .lib-friend-ig { width: 10px; height: 10px; margin-top: 0; padding-top: 0; opacity: 1; }
.lib-friend-name {
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg);
  /* full name across up to 2 lines, then ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lib-friend-role {
  width: 100%;
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--muted);
  /* show the full role; the card grows to fit it */
}

/* ── Clear bin bar (trash view only) ── */
.clear-bin-bar { display: none; padding: 6px 10px 4px; }
.sidebar.trash-view .clear-bin-bar { display: block; }
.sidebar.trash-view .lib-section-head .new-folder-btn { display: none; }
.sidebar.favorites-view .lib-section-head .new-folder-btn { display: none; }
.clear-bin-btn {
  display: flex; align-items: center; gap: 5px;
  width: 100%; padding: 6px 10px; border-radius: 6px;
  background: rgba(229, 78, 78, 0.12); border: 1px solid rgba(229, 78, 78, 0.28);
  color: #e54e4e; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.clear-bin-btn:hover { background: rgba(229, 78, 78, 0.22); border-color: rgba(229, 78, 78, 0.5); }
.clear-bin-btn:active { background: rgba(229, 78, 78, 0.32); }

/* ── App state classes (set by JS) ── */
/* No track loaded: hide main waveform content */
.daw.is-import .daw-track-header,
.daw.is-import .daw-section-ribbon,
.daw.is-import .daw-tags-ribbon,
.daw.is-import .daw-wave-header,
.daw.is-import .daw-content { opacity: 0.3; pointer-events: none; }
.daw.is-import .daw-content .mixer-column { opacity: 1; pointer-events: auto; }

.daw.no-track .daw-track-header,
.daw.no-track .daw-section-ribbon,
.daw.no-track .daw-tags-ribbon,
.daw.no-track .daw-wave-header,
.daw.no-track .daw-content { opacity: 0.3; pointer-events: none; }
/* Overlay and job progress live inside .daw-content but must stay fully visible while processing */
.daw.no-track .daw-content .wave-loading-overlay,
.daw.no-track .daw-content .job { opacity: 1; pointer-events: auto; }

.app.no-track #t-export-btn,
.app.is-import #t-export-btn {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* When track is playing */
.daw-play-btn .pause-icon { display: none; }

/* ── Responsive: hide zoom in small windows ── */
@media (max-width: 900px) {
  .daw-info-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stem-presence-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stem-card[data-stem="vocals"] { grid-column: span 1; }
}

/* ── Per-lane transpose (the K stepper) ────────────────────────────────────
   On the second line of the header, just left of M: minus, the reading,
   plus. The reading is the button, the same box as M and S (same border,
   radius, mono face and size), so it reads as one more control in that
   cluster. The arrows around it are the stepper, not two more buttons: no
   border, so they stay quiet beside the boxes, and the row's full height
   to hit. They used to stack 11px high above and below a 20px box. */
.lane-key {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
}
.lane-key-value {
  min-width: calc(var(--mx-ctl-w) + 4px);
  height: var(--mx-ctl-h);
  padding: 0 2px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: var(--mx-ctl-font);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
/* Lit while the lane is off its own key, the way S lights when soloed. */
.lane-key.active .lane-key-value {
  background: rgba(244, 183, 64, 0.18);
  color: var(--accent);
  border-color: rgba(244, 183, 64, 0.4);
}

.lane-key-step {
  width: 20px;
  height: var(--mx-ctl-h);
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--fg-2);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast), background var(--t-fast);
}
.lane-key-step:hover:not(:disabled) {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.07);
}
.lane-key-step:disabled { opacity: 0.3; cursor: default; }
/* Drums, and anything else that must never be resampled. */
.lane-key.locked,
.lane-key.unsupported { opacity: 0.35; }
.lane-key.locked .lane-key-step,
.lane-key.unsupported .lane-key-step { cursor: not-allowed; }

/* ─────────────────────────────────────────────────────────────────────────
   The composer, in two rows.

   It was one row: the search, the Extract chips and the two actions all
   competing for the same horizontal space, with the Collapse row on a line of
   its own underneath. Three lines of bar for two lines of content, and on a
   narrow window the search and the chips squeezed each other.

   It is a grid now. Row one is the import gesture, left to right: upload, the
   search field, the loaded track, then the two things that act on it. Row two
   is Extract and its chips, with the Collapse row sharing that line at the
   right-hand end.

   The search and the chips share column one, which is what makes them exactly
   the same width. As a flex row the search grew into whatever was left over
   and ran past the last chip; sharing a track means the chips size the column
   and the search follows, in any language.
   ───────────────────────────────────────────────────────────────────────── */

/* 1. Two rows, arranged as in the mockup.

   Row one is the whole import gesture, left to right: upload, the search
   field, then the two things that act on it, Detect structure and Split
   stems. Row two is Extract and its chips, on their own full-width line.

   Done with order and flex-basis rather than by moving markup. The stem
   section is the only child pushed to a second line, so it is the only one
   that needs a basis of 100%, and everything else stays on line one in DOM
   order. Nothing here restyles a control: same pills, same buttons, same
   colours, only where they sit.

   The style in the mockup that is deliberately NOT copied: Detect structure
   as a switch with a help icon, and the search field boxed separately from
   upload. Those are a restyle, and you asked for the organisation only. */
.daw-composer {
  /* A grid, not a wrapping row, so the search and the chips share one column
     and are therefore exactly the same width. As a flex row the search grew to
     whatever was left over, which is why it ran past the last chip.

     Columns: content | actions | panel toggles | rule | card. Row one is the
     import gesture, row two is what to extract. The two actions stack in one
     column, Detect structure over Extract stems, so Extract sits on the chips'
     row, straight after the options it acts on, and the Collapse toggles stack
     beside them (#725). Stacked rather than side by side, the right-hand end
     is about 50px narrower, which is room the card keeps. The loaded track
     comes after the rule, at the end: in the middle of the row it read as
     Extract's input, when it is only what is playing (#699). */
  height: auto;
  display: grid;
  /* minmax(0, 1fr), not 1fr: a grid track's automatic minimum is its
     min-content, so a plain 1fr refuses to shrink below the widest thing in
     it. The card sat at its natural width and pushed Extract stems off the right
     edge of its own container. Zero as the floor lets the column give way, and
     the card's own text clips with an ellipsis rather than forcing the row. */
  /* The card's floor is its compact form, the heart and the About this song
     button and nothing else (#735). Below what the whole card needs, the
     chips fold into their overflow button first (fitStemChips), so the card
     is never squeezed out of the row the way display: none once took it. */
  --np-min: 72px;
  grid-template-columns: minmax(0, max-content) auto auto auto minmax(var(--np-min), 1fr);
  align-items: center;
  row-gap: 8px;
  column-gap: 10px;
  padding: 8px 10px;
  overflow: visible;
}

/* Row one, column one. Starts on the EXTRACT label rather than on the All
   chip, so the row has no indent to pay for, and stretches to end where the
   chips end. 14px is the stem section's own left padding, not a measured
   English width, so this alignment holds in every language. */
.daw-composer > .daw-url-zone {
  --row1-indent: 14px;
  grid-column: 1;
  grid-row: 1;
  /* Both sides, not just the left. The column is sized by the stem section,
     which carries 14px of padding at each end, so a margin only on the left
     left the search running 14px past the Other chip. Matching it on the right
     puts the two edges on the same pixel. */
  margin-left: var(--row1-indent);
  margin-right: var(--row1-indent);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  height: 36px;
  min-height: 36px;
  padding: 0 10px 0 6px;
  gap: 6px;
}
/* Inside the box, flat against it, not a box of its own. order rather than
   markup: the button keeps its place in the DOM, so tab order and the drop
   handlers bound to .url-wrap are untouched. */
.daw-url-zone > .daw-upload-btn {
  order: -1;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
}
.daw-url-zone #url {
  background: none;
  border: none;
  padding: 0;
  height: auto;
}

/* Row two, column one. This is what sizes the column, and therefore the search
   box above it. min-width: 0 is what lets it be narrower than the chips inside
   it: at max-content they are 655px, which on their own overflow a 1100px
   window once the two actions have been paid for.

   The chips used to be allowed to wrap here, which is how that overflow was
   absorbed before the row could fold. It cannot be allowed now: the rule was
   three classes deep and quietly outranked the two-class `flex-wrap: nowrap`
   the folding row declares for itself, so the row kept wrapping to a second
   line in any language whose words are longer than English (#673). */
.daw-composer > .daw-stem-section {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

/* The rule divides the extraction, search through Split, from the track that
   is playing (#699). Nothing crosses it: what is left of it is one sentence,
   what is right of it is not an input to that sentence. */
/* One rule, down both rows.
 *
 * There were two: this one beside the actions, and the Collapse label's own
 * left border under it. Two rules drawn by different elements have to be kept
 * level by hand, and they were a pixel apart, which is exactly the kind of gap
 * that reads as broken without being nameable. Spanning the rows makes it one
 * line that cannot drift from itself. */
.daw-composer > .daw-composer-sep {
  grid-column: 4;
  grid-row: 1 / 3;
  display: block;
  justify-self: center;
  align-self: stretch;
  width: 1px;
  height: auto;
  margin: 6px 4px;
  background: var(--border-strong);
}

/* Detect structure and Detect lyrics read as switches rather than words you
   press, stacked in the one segment above Extract stems. Each button keeps
   its aria-pressed, so nothing about how it works changes; the pill and its
   knob are drawn from the two pseudo elements, the label beside them. */
.daw-composer > .detect-toggles {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: var(--composer-action-w);
}
.detect-toggles > .structure-toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
  min-width: 0;
  width: 100%;
  height: 18px;
  min-height: 0;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  text-align: left;
  font-size: 11.5px;
}
.detect-toggles > .structure-toggle::before {
  content: "";
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--border-strong);
  box-sizing: border-box;
  transition: background var(--t-fast);
}
.detect-toggles > .structure-toggle::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--fg-2);
  transition: transform var(--t-fast), background var(--t-fast);
}
.detect-toggles > .structure-toggle[aria-pressed="true"]::before {
  background: var(--accent);
  border-color: var(--accent);
}
.detect-toggles > .structure-toggle[aria-pressed="true"]::after {
  transform: translateX(12px);
  background: #1a1a1a;
}
.detect-toggles > .structure-toggle .structure-toggle-main { grid-column: 2; }

/* Row two, and the only thing on it. A 100% basis is what forces the wrap. */
.daw-composer > .daw-stem-section {
  order: 1;
  flex: 1 0 100%;
  min-width: 0;
}

/* The action keeps the toggles' width and stops being full-bleed. */
.daw-composer > .daw-process-btn {
  align-self: center;
  min-height: 40px;
  border-radius: 8px;
  border-left: none;
}
.daw-composer > .daw-process-btn {
  grid-column: 2;
  grid-row: 2;
  /* As wide as Detect structure above it, and as tall as the chips beside
     it, so the bar keeps its height. */
  justify-self: stretch;
  min-height: 30px;
  height: 30px;
}

/* 2. Ten percent off the waveform: REMOVED.

   It did what was asked, 910px down to 819px, and it read as a fault rather
   than as breathing room: the lanes stopped short while the analysis strip
   above and the footer below still ran to the window edge, so the waveform
   looked truncated rather than inset.

   To put it back, the rule was:

     .daw-wave-panel {
       flex: 1 1 0;
       max-width: calc((100% - 300px) * 0.9);
     }

   and it would need the strip and the footer inset to match, or something
   given the freed space. */

/* The Collapse toggles, a column of their own beside the two actions (#725):
   the label on top, then one toggle per panel, spanning both rows. Beside the
   actions rather than under them, which is what lets Extract stems take the
   chips' row.

   A grid item rather than absolutely positioned: out of flow it would land on
   top of the Extract chips the moment a window was narrow enough for the two
   to meet. */
.daw-composer > .daw-panel-toggles {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: auto;
  min-width: 0;
  margin: 0;
  /* The wrapper stops being a box of its own: each toggle is a chip, so a
     frame around the group would be a box inside a box. */
  padding: 0;
  background: none;
  border: none;
  gap: 4px;
}

/* 4. The toggles become chips, the same size as the Extract ones.
   Everything below is the .stem-choice geometry, nothing else: same height,
   padding, radius, border and type size, so the two rows read as one family.
   The colours stay theirs, including the strike-through that means a panel is
   put away. */
.daw-composer-stack .daw-panel-toggle {
  /* 26, not the chips' 30: three to a column have to fit in the height of
     the two rows beside them. */
  height: 26px;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: -0.005em;
  text-transform: none;
  display: inline-flex;
  align-items: center;
}
/* The label and the separators were sized for an 8px row; at chip size the
   dots between them are noise, so only the label survives. */
/* No border of its own any more: the rule beside it spans both rows now, so a
   second one drawn here would be the thing it used to be kept level with. */
.daw-composer-stack .daw-panel-toggles-label {
  font-size: 12px;
  letter-spacing: -0.005em;
  text-transform: none;
  text-align: center;
  margin: 0;
  padding: 0;
  border: none;
}
.daw-composer-stack .daw-panel-toggles-sep { display: none; }

/* 5. The dashed rectangles on empty lanes.

   Not ours. The vendored multitrack plugin draws one on any track with no
   audio: an absolutely positioned div at z-index 10 with dragover and drop
   handlers, so a file can be dragged onto an empty lane. In StemDeck an empty
   lane is a stem that was not extracted, and dropping audio onto one is not a
   thing the app does, so it is an affordance for a feature that does not
   exist.

   Hidden rather than patched out of the vendor file: that file is refreshed
   from upstream, and an edit to it would be lost on the next update. The
   selector matches on the inline style because the plugin gives these divs no
   class of their own. */
.daw .wave-scroll div[style*="2px dashed"] {
  display: none !important;
}

/* 6. The loaded track, named in the composer.

   It was in the footer, filling the gutter beside the timeline, which existed
   because that timeline's left edge had to line up with the lane waveforms.
   The timeline is gone, and this row had empty space in the middle of it, so
   the block moved in the markup rather than being pinned here: it is a cell in
   the grid, spanning both rows. It was column two, between the chips and the
   actions, where the row read as "file, options, this track, Split" and made
   the track look like what Split would act on (#699). Now it is the last
   column, after the rule, and labelled as what is playing. */
#nowPlayingPanel {
  position: relative;
  grid-column: 5;
  grid-row: 1 / 3;
  /* Fills its column up to the cap below. It once sized to its content, so a
     spare 400px of bar would not become 400px of card; the cap does that job
     now, and filling the column is what lets the card be a size container for
     the artwork's container query (see .track-panel-cover below). A long
     title clips with an ellipsis at the cap rather than dragging the card out
     to meet it. */
  justify-self: stretch;
  /* A real ceiling, not a percentage of the column: 100% just meant "as wide
     as the bar allows", so the card was 422px at 1600 and 460 at 1920 with the
     same text in it. 460 was what the meta line needed at its longest,
     duration through to the extracted date; 536 is that plus the 76px the
     full-height artwork now takes from the text column (#699). So the card is
     the same size at every window width and a long title clips rather than
     pushing it wider. */
  max-width: min(100%, 536px);
  align-self: stretch;
  /* .footer-track-slot is `width: var(--daw-col-w)`, which is the gutter width
     it was built to fill in the footer. Here the column decides the width, so
     the fixed one has to go or the card never shrinks and pushes Extract stems
     out of the composer on a narrow window. */
  width: auto;
  min-width: 0;
  /* No side margins. In the middle of the row it needed air on both sides;
     at the end, the rule and the grid gap already set it off on the left and
     the bar's padding on the right, and 28px of margin was 28px taken from
     the meta line, enough to clip the date in German at 1600 (#698). */
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 4px, not 6: with the meta line on two rows (#698) that is what keeps the
     card inside the bar's height rather than growing it by 2px. */
  gap: 4px;
  padding: 0 14px;
  background: var(--panel-2, var(--panel));
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* "Now playing", set into the card's top border like a fieldset legend.
   On the border rather than as a line of its own: the card's height is already
   spent on the title and a two-row meta line (#698). The background is the
   bar's, so the label cuts the border instead of sitting on top of it. The type
   is the EXTRACT label's, so the two labels on this row read as a pair. */
#nowPlayingPanel .np-legend {
  position: absolute;
  top: 0;
  /* Over the text column, not the artwork: on the art it would put a band of
     bar colour across the top of the picture. */
  left: calc(var(--np-fav) + var(--np-art) + 8px);
  transform: translateY(-50%);
  padding: 0 5px;
  background: var(--panel);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}
/* .footer-track-slot clips the card, a leftover from the footer gutter it was
   built for, and that clip cut the legend's top half off. The lines inside
   already clip themselves (title ellipsis, meta line overflow), so this keeps
   the same clip on the sides and bottom and opens only the 8px above, which
   is the composer's own padding and where the legend sits. */
#nowPlayingPanel {
  overflow: visible;
  clip-path: inset(-8px 0 0 0);
}

/* The footer clamps the title to two lines, because its gutter is narrow and
   a long name would otherwise be cut after three or four words. This card is
   wide and short, so two lines is what makes it look cramped: the title grows
   downwards and shoves the meta line onto the bottom edge. One line with an
   ellipsis instead, which is what .daw-track-title does everywhere else. */
#nowPlayingPanel .track-panel-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

/* A quieter frame. At --border-strong on --bg-2 the card was the loudest box
   in the bar, competing with the search field beside it for a thing you read
   rather than use. */
#nowPlayingPanel {
  background: var(--panel-2, var(--panel));
  border-color: var(--border);
}

/* The footer's own 40px cover, untouched. */
#nowPlayingPanel .track-panel-head {
  gap: 11px;
  align-items: center;
  justify-content: flex-start;
}
#nowPlayingPanel .track-panel-info { flex: 1 1 auto; min-width: 0; }
/* The artist (#699), after the title on the title's own line, in the meta
   line's quieter voice. A line of its own would make the card taller than the
   bar, and in the meta line it would push the extracted date off the end.
   The artist keeps its whole width up to 45% of the line, clipping past that,
   and the title takes the rest, clipping as it always has. Same size and line
   height as the title, so sharing a baseline adds nothing to the line. */
#nowPlayingPanel .track-panel-info {
  flex-direction: row;
  align-items: baseline;
  gap: 0;
}
#nowPlayingPanel .track-panel-title { flex: 0 1 auto; min-width: 0; }
#nowPlayingPanel .np-artist {
  flex: 0 0 auto;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--muted);
}
#nowPlayingPanel .np-artist::before {
  content: "\00b7";
  padding: 0 6px;
}
/* A flex item's automatic minimum is its content, all the way down, so one
   missing min-width anywhere in this chain gives the card a floor it will not
   go below and the row overflows instead. The title and the meta line both
   clip with an ellipsis, so there is nothing to protect by refusing. */
#nowPlayingPanel .track-panel-head,
#nowPlayingPanel .daw-track-meta-line { min-width: 0; }
/* Part of the card's structure rather than a button placed on top of it.
 *
 * It has been tried two ways and both read as dropped in: on the title's line
 * it sat at the right edge with a gap in front of it, and centred on the card
 * it lined up with neither row. The trouble was never the height, it was that
 * a bordered button inside a bordered card is a box in a box, floating in
 * whatever space is left over.
 *
 * So it gets a segment of its own, full height, separated by the same hairline
 * the composer uses between its clusters. The icon then has a place rather than
 * a position, and the card reads as two parts: what the track is, and the one
 * thing you can do to it from here.
 *
 * On the left edge, before the artwork (#699): heart, picture, then the words.
 * On the right it sat at the far end of the bar, away from the track it acts
 * on, and the text had to stop 56px short to leave room for it. */
#nowPlayingPanel .track-panel-head .daw-fav-btn {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  transform: none;
  margin: 0;
  width: var(--np-fav);
  height: auto;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 7px 0 0 7px;
  background: none;
  color: var(--muted);
}
#nowPlayingPanel .track-panel-head .daw-fav-btn:hover {
  background: var(--panel-3);
  color: var(--fg);
}
#nowPlayingPanel .track-panel-head .daw-fav-btn svg {
  width: 17px;
  height: 17px;
}
/* The artwork, as a segment like the heart's and right after it: full height,
   with a hairline beside it, rather than a 40px square squeezed between
   the label and the meta line. It was the smallest thing in the card while
   being the quickest way to tell which song is open (#699).

   76px is the card's inside height (78 less its borders), so the picture is
   square and edge to edge. Title and meta line both start after it, which
   also puts them on one left edge. That costs the text 76px, so the card's
   width cap went up by the same amount; the bar has room to the right.

   Only while the card is wide enough to pay for it. A narrow card, which is a
   long language in a window just above the breakpoint that hides the card,
   needs those 76px for the extracted date (#698), so below 380px the art goes
   back inline at 40px. A container query, not a media query: how wide the
   card is depends on the language as much as on the window.

   Container queries style descendants only, which is why the room for the art
   is padding on the two text rows rather than on the card itself. And a size
   container ignores its content when sizing, so the card fills its column (up
   to the cap) instead of shrinking to fit its text. */
#nowPlayingPanel {
  --np-fav: 34px;
  --np-art: 76px;
  container-type: inline-size;
}
#nowPlayingPanel .track-panel-cover {
  position: absolute;
  left: var(--np-fav);
  top: 0;
  bottom: 0;
  width: var(--np-art) !important;
  height: auto !important;
  border-radius: 0;
  border-right: 1px solid var(--border);
}
#nowPlayingPanel .track-panel-head,
#nowPlayingPanel .daw-track-meta-line { padding-left: calc(var(--np-fav) + var(--np-art)); }
@container (max-width: 379px) {
  #nowPlayingPanel .track-panel-cover {
    /* relative, not static: the thumbnail inside is absolutely positioned,
       and against a static cover it would fill the whole card. */
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 40px !important;
    height: 40px !important;
    border-radius: 7px;
    border-right: none;
  }
  #nowPlayingPanel .track-panel-head,
  #nowPlayingPanel .daw-track-meta-line { padding-left: var(--np-fav); }
  /* Over the title, clear of the heart and the 40px art:
     heart + card padding 14 + art 40 + 6. */
  #nowPlayingPanel .np-legend { left: calc(var(--np-fav) + 60px); }
}

/* Source and quality keep their footer colours, which up here is four accents
   in one short line. Muted to one voice; the stems dot keeps its colour,
   because that one means ready rather than merely saying a word. */
#nowPlayingPanel .daw-track-meta-line #track-source,
#nowPlayingPanel .daw-track-meta-line #track-quality,
#nowPlayingPanel .daw-track-meta-line #t-stems-chip {
  color: var(--muted);
}
#nowPlayingPanel .daw-track-meta-line {
  /* Not indented under the title: the 51px that would cost is the difference
     between the line fitting on one row and needing two.

     It was kept to one row with nowrap and an ellipsis, but the ellipsis never
     fired: every child is a flex item, so the last one, the extracted date,
     was simply cut off at the card's edge (#698). It wraps instead, a whole
     item at a time, so the date moves to a second row when the first is full.
     The 40px cover already makes the card tall enough for two rows, with the
     tighter gap on the card above. Never more than two: just above the
     breakpoint that hides the card, a long language leaves it under 250px
     wide, and a third row would make the whole bar taller. */
  margin: 0;
  flex-wrap: wrap;
  row-gap: 0;
  line-height: 1.35;
  /* Two rows at 1.35, plus 2px: at exactly 2.7em the second row's line box
     rounded a pixel past the cap and was measured as clipped. A third row
     would need another 1.35em, so the headroom never lets one through. */
  max-height: calc(2.7em + 2px);
  white-space: nowrap;
  overflow: hidden;
}

/* 9. An upload's format where it has no artwork (#690).

   Drawn by formatIcon.js: a file on the note icon's grid, with the format on
   a band. One colour per format, so a library of uploads can be read at a
   glance. Chosen clear of the stem colours, so a band never reads as a stem. */
.format-icon-page {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.format-icon-band { fill: var(--format-colour, currentColor); }
.format-icon-label {
  fill: var(--panel);
  font-family: inherit;
  font-size: 5.6px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.format-icon[data-format="wav"]  { --format-colour: var(--accent); }
.format-icon[data-format="flac"] { --format-colour: #f28c6b; }
.format-icon[data-format="mp3"]  { --format-colour: #5b9cf5; }
.format-icon[data-format="m4a"]  { --format-colour: #2ec4b6; }
.format-icon[data-format="ogg"]  { --format-colour: #a78bfa; }
.format-icon[data-format="opus"] { --format-colour: #67d4ef; }
.format-icon[data-format="mp4"]  { --format-colour: #f472b6; }
/* The square beside the title: the size the note there is drawn at. */
.np-art-placeholder .format-icon { width: 24px; height: 24px; }

/* 10. The empty state's lanes, lined up with the mixer beside them.

   Two things were out. The placeholder lane is a hard 48px in waves.css while
   every mixer row is sized from --lane-h, which is 77px on an empty studio, so
   the two columns ran at different pitches from the first row. And there are
   seven placeholders, one per stem plus "original", against six visible mixer
   rows, because the original row is hidden until a job is actually loaded.

   So: take the height from the same variable the mixer uses, minus the 2px
   separator that makes up the rest of the row, and drop the original
   placeholder while its mixer row is hidden. */
.lane-placeholder {
  height: calc(var(--lane-h, 72px) - 2px);
  margin-bottom: 2px;
}
.app.no-track .lane-placeholder[data-stem="original"] {
  display: none;
}

/* A narrow card keeps what can be done from it (#735).

   It used to leave the bar entirely below a 1460px window, and with it the
   only way to open About this song. Now it gives way in steps as its column
   narrows, which happens after the Extract chips have folded what they can:
   first the artwork and the meta line, then the title, until only the heart
   and the About button are left, each still a full-height segment at its
   edge. Container queries, because how wide the card ends up depends on the
   language as much as on the window. */
@container (max-width: 239px) {
  #nowPlayingPanel .track-panel-cover,
  #nowPlayingPanel .daw-track-meta-line,
  #nowPlayingPanel .np-artist { display: none; }
  #nowPlayingPanel .track-panel-head { padding-left: calc(var(--np-fav) + 2px); }
  #nowPlayingPanel .np-legend { left: calc(var(--np-fav) + 8px); }
}
@container (max-width: 129px) {
  #nowPlayingPanel .track-panel-info,
  #nowPlayingPanel .np-legend { display: none; }
}

/* The click-track options with nothing to act on.
 *
 * They stay on the row and go quiet rather than leaving it, which is how the
 * metronome button beside them and the empty studio's placeholder lanes
 * already behave. Half a control strip appearing and vanishing reads as a fault. */
.footer-metro-panel.unavailable {
  opacity: 0.4;
  pointer-events: none;
}
/* Except when the panel is the popover (#697). There it has a box of its own,
 * and fading that box with its contents left a 40% ghost of a panel floating
 * over the lanes, their lines showing through it and no edge to tie it to the
 * button, which read as a popover in the wrong place. It also let a click
 * inside fall through to whatever was under it. So the box stays solid and
 * takes its clicks, and only the controls in it go quiet. */
.footer-clusters.collapse-click .footer-metro-panel.unavailable {
  opacity: 1;
  pointer-events: auto;
}
.footer-clusters.collapse-click .footer-metro-panel.unavailable > * {
  opacity: 0.4;
  pointer-events: none;
}

/* Vocals and its two mode buttons, as one thing.
 *
 * Grouped by proximity, not by a box. A frame around them needed padding and
 * borders of its own, which made the group 38px tall in a row of 30px chips:
 * it hung 8px below everything beside it. Joining them instead costs no height
 * at all, and a segmented control is what this is.
 *
 * So the chip and the toggle touch, their facing corners square off, and the
 * gap that used to sit between them moves to the outside of the pair. */
.stem-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-right: 5px;
}
/* Facing edges square, and only one border between them. */
.stem-group .stem-choice[data-stem="vocals"] {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.stem-group .vocal-mode-toggle {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
}
/* The mode buttons take the Vocals chip's border, and only its border, so one
   outline runs round the three of them.
 *
 * The outline is the grouping cue; the fill is not available for it. Tinting
 * the whole toggle made "Lead + Backing" look selected when it is not, and
 * left the active mode barely distinguishable from the inactive one, because
 * that mode's own 16% was sitting on top of the group's 14%. Inside the
 * outline the three states stay readable: Vocals is tinted because the stem is
 * selected, the active mode is tinted because it is the mode, and the other
 * one is plain.
 *
 * Keyed off the chip's pressed state rather than on the toggle being present,
 * because it is always present: with Vocals off, the group drops back to the
 * plain border and the toggle dims beside it. */
.stem-group:has(.stem-choice[data-stem="vocals"][aria-pressed="true"]) .vocal-mode-toggle {
  --color: var(--vocals);
  border-color: color-mix(in srgb, var(--color) 60%, transparent);
}
/* The divider between All and Lead + Backing comes from the same colour, so it
   reads as an internal seam rather than a second frame. */
.stem-group:has(.stem-choice[data-stem="vocals"][aria-pressed="true"]) .vocal-mode-btn + .vocal-mode-btn {
  border-left: 1px solid color-mix(in srgb, var(--color) 60%, transparent);
}

/* ── The Extract chips, and what happens when they stop fitting ───────────
   The row never wraps and the bar never gets taller. As the window narrows,
   whichever chips no longer fit move into a panel behind a three-dot button,
   one at a time, from the end of the row. The button sits after the row, on the
   side the chips are leaving from, and is hidden entirely while everything
   fits.

   Wrapping was the alternative and it is the wrong one here: the composer went
   from 96px tall to 168 and then 236 as the chips spilled onto further lines,
   so the bar grew exactly as the window shrank, and the controls on the right
   were left stranded at the top of a column stretched by chips they have
   nothing to do with.

   The measuring is in fitStemChips in main.js; this is only what it looks
   like.
   ───────────────────────────────────────────────────────────────────────── */
.stem-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 30px;
  margin-left: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--muted-2);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.stem-more-btn[hidden] { display: none; }
.stem-more-btn:hover { background: var(--panel-2); color: var(--fg); }
.stem-more-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

/* One line, always. Overflow hidden so a chip mid-move is never half drawn,
   and so this element's clientWidth is the honest budget fitStemChips
   measures against. */
.daw-composer .daw-stem-chips {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* A chip's label never breaks inside the chip, in the row or in the panel.
   A flex item may shrink down to its min-content width, and for a label with
   a space in it ("Lead + Backing", the Korean "기타 소리") or any CJK label,
   min-content is one word or one character wide. So when the row ran short
   the chips shrank and their text wrapped onto a second line and out of the
   30px box, the row stopped overflowing, and fitStemChips, which only folds a
   row that overflows, saw nothing to fold. With nowrap, min-content is the
   whole label: the chip keeps its width, the row overflows, and the chip
   that no longer fits goes into the panel whole.
   The boxes do not shrink either. The mode toggle is overflow: hidden, which
   drops a flex item's automatic minimum width to 0, so nowrap alone would
   have clipped "Lead + Backing" where it used to wrap it. */
.daw-stem-chips .stem-choice,
.stem-overflow .stem-choice,
.vocal-mode-btn {
  white-space: nowrap;
}
.daw-stem-chips > *,
.stem-overflow > *,
.stem-group > * {
  flex-shrink: 0;
}

/* Fixed rather than absolute, for the same reason the footer's options panel
   is: it has to escape the bar it is anchored in. JS sets left/top from the
   button's own rect. */
.stem-overflow {
  position: fixed;
  z-index: 320;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
}
.stem-overflow.open { display: flex; }

/* Help mode. The Guide button in the rail, below Trash; while it is pressed,
   a ring is drawn around what can be seen of the control being explained,
   and its box sits beside it. The ring is a layer of its own, so nothing in
   the page moves and no panel clips it. */
.rail-guide[aria-pressed="true"] { color: var(--accent); background: var(--panel); }
/* Only the control being explained is marked, so the screen stays calm; the
   pill at the bottom says help mode is on. */
/* With no song open, the studio turns several controls off for the pointer
   (Export Mix, the song facts, the presence cards). Help mode still has to hear
   the pointer over them to explain them, and it takes every click itself, so
   nothing can be pressed by accident. */
.help-mode .help-target { cursor: help; pointer-events: auto !important; }
.help-ring {
  position: fixed; z-index: 9998; pointer-events: none;
  border: 2px solid var(--accent); border-radius: var(--radius-sm);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
/* The glow when Guide turns on: every explainable control at once, fading in
   and out over --intro-ms (set from INTRO_MS in helpMode.js). With reduced
   motion it simply shows, still, for the same time. */
.help-intro { position: fixed; inset: 0; z-index: 9997; pointer-events: none; }
.help-intro-ring {
  position: absolute;
  border: 2px solid var(--accent); border-radius: var(--radius-sm);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--accent) 35%, transparent);
  opacity: 0;
  animation: help-intro-glow var(--intro-ms, 1600ms) ease-in-out forwards;
}
@keyframes help-intro-glow {
  0% { opacity: 0; }
  25% { opacity: 1; }
  65% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .help-intro-ring { animation: none; opacity: 0.8; }
}
.help-pill {
  position: fixed; z-index: 9999; left: 50%; bottom: 18px; transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--accent); border-radius: 999px;
  padding: 7px 16px; box-shadow: var(--shadow-panel);
  color: var(--fg); font: 500 12.5px/1.4 var(--font-sans); text-align: center;
  pointer-events: none;
}
.help-tip {
  position: fixed; z-index: 10000;
  width: max-content; max-width: min(300px, calc(100vw - 16px));
  background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow-panel);
  color: var(--fg-2); font: 400 13px/1.45 var(--font-sans);
  pointer-events: none;
}
.help-tip b { display: block; margin-bottom: 2px; color: var(--fg); font-size: 13.5px; font-weight: 700; }
.help-tip.long { max-width: min(560px, calc(100vw - 16px)); columns: 2 230px; column-gap: 20px; font-size: 12px; line-height: 1.4; }
.help-tip.long b { column-span: all; margin-bottom: 6px; }
.help-tip-h { break-after: avoid; margin-top: 8px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.help-tip-row { break-inside: avoid; margin-top: 3px; }
.help-tip-row span { color: var(--fg); font-weight: 600; }

/* ── Modes (static/js/mode.js) ──
   The DAW controls show only with mode-daw on <html>: hidden by default, so a
   page in Practice never shows them while it loads. Practice is the simple
   practice studio: no Record, no adding tracks (a song's existing tracks
   still play, without their arm and input controls), no EQ, no master. */
html:not(.mode-daw) #t-rec,
html:not(.mode-daw) #t-rec-opts,
html:not(.mode-daw) #recPanel,
html:not(.mode-daw) .add-track-row,
html:not(.mode-daw) .add-track-spacer,
html:not(.mode-daw) .mx-rail > .mx-eq-slot,
html:not(.mode-daw) .track-lane .mx-actions,
html:not(.mode-daw) #t-master-btn,
html:not(.mode-daw) #t-export-master,
html:not(.mode-daw) #master-drawer {
  display: none !important;
}

.rail-mode[aria-expanded="true"] { background: var(--panel); color: var(--fg-2); }

.mode-menu {
  position: fixed;
  z-index: 70;
  width: 250px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.mode-menu[hidden] { display: none; }
.mode-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-2);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
}
.mode-item:hover,
.mode-item:focus-visible { background: var(--panel-2); color: var(--fg); outline: none; }
.mode-item-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.mode-item-check { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted-2); box-sizing: border-box; }
.mode-item[aria-checked="true"] .mode-item-check { background: var(--accent); border-color: var(--accent); }
.mode-item[aria-checked="true"] .mode-item-name { color: var(--accent); }
.mode-item-tag {
  padding: 1px 6px;
  border: 1px solid var(--muted-2);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}
.mode-item-desc { padding-left: 15px; font-size: 11px; line-height: 1.35; color: var(--muted); }
.mode-note { margin: 4px 6px 2px; font-size: 11px; color: var(--accent); }
.mode-note[hidden] { display: none; }

/* ── Stems per mode (static/js/stemsControl.js) ──
   A small button beside the Mixer title, and a popover in the Mode menu's
   style. The button takes the space the title leaves and never pushes the
   hint out of the 300px column: it shrinks first (label hidden under 250px
   of label width by the container query below). */
.daw-wave-label { container-type: inline-size; gap: 8px; }
.daw-wave-label .daw-label-sub { margin-left: auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-stems-btn {
  flex: 0 1 auto;
  min-width: 0;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.lane-stems-btn[hidden] { display: none; }
.lane-stems-btn:hover,
.lane-stems-btn[aria-expanded="true"] { background: var(--panel-2); color: var(--fg); border-color: var(--muted-2); }
.lane-stems-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
/* A choice of its own in this mode: the accent says it differs from the song's. */
.lane-stems-btn.chosen { color: var(--accent); border-color: var(--accent-2); }
.lane-stems-btn svg { flex-shrink: 0; }
@container (max-width: 210px) {
  .lane-stems-btn > span { display: none; }
}

.stems-pop {
  position: fixed;
  z-index: 70;
  width: 270px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: var(--fg-2);
  font-family: var(--font-sans);
}
.stems-pop[hidden] { display: none; }
.stems-pop-title { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.stems-pop-hint { margin: 0; font-size: 11px; line-height: 1.35; color: var(--muted); }
.stems-pop-list { display: flex; flex-direction: column; gap: 1px; margin: 2px 0; }
.stems-pop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.stems-pop-row:hover:not(.missing) { background: var(--panel-2); color: var(--fg); }
.stems-pop-row.missing { cursor: default; opacity: 0.5; }
.stems-pop-row input { margin: 0; accent-color: var(--accent); cursor: inherit; }
.stems-pop-row input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.stems-pop-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--stem-c); }
.stems-pop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stems-pop-missing { font-size: 10px; color: var(--muted); }
.stems-pop-voice {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 6px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stems-pop-voice[hidden] { display: none; }
.stems-pop-voice-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stems-pop-seg { display: flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.stems-pop-seg[hidden] { display: none; }
.stems-pop-seg-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 5px 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
}
.stems-pop-seg-btn + .stems-pop-seg-btn { border-left: 1px solid var(--border-strong); }
.stems-pop-seg-btn[aria-checked="true"] { background: var(--panel-2); color: var(--accent); font-weight: 600; }
.stems-pop-seg-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.stems-pop-split,
.stems-pop-reset,
.stems-pop-apply {
  padding: 5px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
}
.stems-pop-split[hidden], .stems-pop-reset[hidden] { display: none; }
.stems-pop-split:hover:not(:disabled),
.stems-pop-reset:hover:not(:disabled) { background: var(--panel-2); color: var(--fg); }
.stems-pop-split:focus-visible,
.stems-pop-reset:focus-visible,
.stems-pop-apply:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.stems-pop-split:disabled,
.stems-pop-reset:disabled,
.stems-pop-apply:disabled { opacity: 0.45; cursor: default; }
.stems-pop-split-note { margin: 0; font-size: 10.5px; line-height: 1.35; color: var(--muted); }
.stems-pop-split-note[hidden] { display: none; }
.stems-pop-holds { margin: 0; font-size: 11px; line-height: 1.35; color: var(--fg-2); }
.stems-pop-status { margin: 0; font-size: 11px; line-height: 1.35; color: var(--accent); }
.stems-pop-status:empty { display: none; }
.stems-pop-actions { display: flex; justify-content: flex-end; gap: 6px; }
.stems-pop-apply { border-color: var(--accent-2); color: var(--accent); font-weight: 600; }
.stems-pop-apply:hover:not(:disabled) { background: var(--panel-2); }
/* The song's versions (#804), under the stem choice. */
.stems-pop-versions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.stems-pop-versions[hidden] { display: none; }
.stems-pop-vrow { display: flex; gap: 6px; }
.stems-pop-vselect,
.stems-pop-vname {
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 11.5px;
}
.stems-pop-vselect { width: 100%; text-overflow: ellipsis; }
.stems-pop-vname { flex: 1; }
.stems-pop-vname::placeholder { color: var(--muted); }
.stems-pop-vselect:focus-visible,
.stems-pop-vname:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.stems-pop-vselect:disabled { opacity: 0.6; cursor: default; }
.stems-pop-vrename,
.stems-pop-vdelete,
.stems-pop-vnew {
  padding: 5px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.stems-pop-vrename:hover:not(:disabled),
.stems-pop-vdelete:hover:not(:disabled),
.stems-pop-vnew:hover:not(:disabled) { background: var(--panel-2); color: var(--fg); }
.stems-pop-vrename:focus-visible,
.stems-pop-vdelete:focus-visible,
.stems-pop-vnew:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.stems-pop-vrename:disabled,
.stems-pop-vdelete:disabled,
.stems-pop-vnew:disabled { opacity: 0.45; cursor: default; }
.stems-pop-vdelete.armed { border-color: var(--danger); color: var(--danger); }
.stems-pop-vnew { border-color: var(--accent-2); color: var(--accent); font-weight: 600; }
