/* RiffDrop — dense DAW styling. The default look ("studio") is light and editorial: a cream
   canvas, ink type, red for recording and primary actions, gold and stone for what is lit or
   selected. The other themes are dark (appearance.css); how the two share these rules is
   explained under "Theming" in docs/ARCHITECTURE.md. */

/* Inter (fonts/, SIL OFL): one variable file, weights 100–900, Latin and Latin Extended-A. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-var.woff") format("woff");
}

/* Theme tokens: every theme has a value for each of these. The values here are studio's. */
:root {
  --brand-canvas: #f8f5ec;
  --brand-ink: #191919;
  --brand-primary: #d64032;
  --brand-accent: #ddaa48;
  --brand-secondary: #a8a99d;

  --bg: var(--brand-canvas); /* the page */
  --panel: #f1eee3; /* bars, cards and side panels on the page */
  --panel-2: #e9e5d9; /* a step further from the page: toolbars */
  --panel-3: #ddd9cb; /* hover, pressed, chips */
  --lane: #e6e2d5; /* track lanes */
  --line: #c6c2b3; /* hairlines between panels, rows and controls */
  --line-soft: #d8d4c6; /* outlines of cards on the page */
  --grid-bar: rgba(25, 25, 25, 0.17);
  --grid-beat: rgba(25, 25, 25, 0.06);
  --text: var(--brand-ink);
  --text-dim: #5e5c54; /* softened ink, still 4.5:1 on every panel */
  --accent: var(--brand-ink); /* links, focus, selection outlines, value arcs: reads as text on --bg */
  --accent-two: var(--brand-accent);
  --on-accent: var(--brand-canvas); /* text on an --accent fill */
  --lamp: #bf3b2f; /* the brand's highlight for small type and marks: --primary shaded to 4.5:1 on the canvas */
  --primary: var(--brand-primary); /* primary actions */
  --on-primary: #fff;
  --rec: var(--brand-primary);
  --play: var(--brand-ink);
  --mute: var(--brand-ink);
  --solo: var(--brand-accent);
  --header-w: 224px; /* keep in sync with HEADER_W in daw.js */
  --track-h: 68px;
  --ruler-h: 36px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; /* the UI font */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; /* where columns must line up: notes, links, keys */
  color-scheme: light;
}

/* Studio's finish. Only studio defines these: a rule uses one as var(--ui-name, value), and in
   every other theme the value written beside it applies, which is what that rule has always had. */
:root[data-theme="studio"] {
  accent-color: var(--brand-ink); /* checkboxes, sliders */

  /* Type */
  --ui-ink: var(--text); /* names, readouts, and text on a gold, stone or tinted fill */
  --ui-ink-soft: #45433d; /* long copy, labels on controls */
  --ui-ink-dim: var(--text-dim); /* units, ruler numbers, captions */
  --ui-ink-ghost: #6b6961; /* empty slots */
  --ui-on-ink: var(--brand-canvas); /* text on an ink fill */
  --ui-on-ink-soft: #d9d5c7; /* the quieter text on one */
  --ui-on-red: #fff; /* text on --rec and --primary */
  --ui-danger-text: var(--lamp); /* errors, Delete */
  --ui-danger: var(--brand-primary); /* an invalid field's edge, the slicing line */
  --ui-ok-text: #7a5c14; /* in tune */
  --ui-headline: var(--brand-primary); /* the turned half of a headline */
  --ui-dot: var(--brand-primary); /* the brand's dot: the wordmark's period, a kicker's bullet, the sticker */
  --ui-wordmark-drop: var(--text); /* the wordmark is one color */

  /* Lines */
  --ui-hair: var(--line); /* between regions */
  --ui-sep: var(--line-soft); /* inside a surface: table rows, menu separators */
  --ui-edge: #b8b4a5; /* around buttons, flags, fields, strips, pads */
  --ui-well-edge: var(--line); /* around displays, graphs and inset boxes */
  --ui-ink-rule: var(--brand-ink); /* the ink rules: under the top bars, over the footer and the dock */
  --ui-frame: var(--brand-ink); /* around tables and pictures on the page */
  --ui-pop-edge: var(--brand-ink); /* around menus, popovers, windows, toasts */
  --ui-focus: var(--brand-ink); /* the keyboard's focus ring (red would read as an error) */

  /* Surfaces */
  --ui-page: var(--bg); /* the home page */
  --ui-topbar: var(--bg); /* the studio's top bar */
  --ui-ruler: var(--panel);
  --ui-header: #ede9dd; /* track headers */
  --ui-header-on: #ebdfc3; /* the selected track's header: a wash of gold */
  --ui-lane-on: #e6dfcb; /* and its lane */
  --ui-daw-footer: var(--panel);
  --ui-transport: var(--lane); /* the well around the transport buttons */
  --ui-dock: #f4f1e7; /* the editor dock */
  --ui-toolbar: #eeeade; /* toolbars inside the dock, the mixer's rack */
  --ui-tray: #e0dcce; /* behind the mixer's strips */
  --ui-strip: #f4f1e7; /* a mixer strip */
  --ui-strip-master: #efe6cf;
  --ui-strip-on: #fefcf7; /* the selected one */
  --ui-slot: var(--panel-2); /* an insert slot */
  --ui-slot-filled: #fefcf7;
  --ui-window: #f6f3ea; /* effect windows */
  --ui-titlebar: var(--panel-2);
  --ui-section: rgba(25, 25, 25, 0.035); /* a device's group of knobs */
  --ui-synth-section: #f6f3ea;
  --ui-box: var(--panel); /* inset boxes in popovers and effect windows */
  --ui-cmp: #f6f3ea; /* the compressor's monitor */
  --ui-pop: #fefcf7; /* menus, popovers, toasts, sheets */
  --ui-card: #fefcf7; /* the Drops table */
  --ui-card-head: var(--panel);
  --ui-card-hover: #f6f0dd;
  --ui-video: var(--brand-ink); /* behind the film before it loads */
  --ui-scrim: rgba(25, 25, 25, 0.5); /* behind a sheet */
  --ui-shadow: rgba(25, 25, 25, 0.18); /* under what floats */
  --ui-shadow-soft: rgba(25, 25, 25, 0.09); /* under clips, cards, the dock */
  --ui-glow: transparent; /* bevels and glows: none on paper */
  --ui-veil: rgba(255, 255, 255, 0.16); /* hover on an ink fill */
  --ui-hover-veil: rgba(25, 25, 25, 0.08); /* hover on a panel */

  /* Controls */
  --ui-btn: #ece8dc; /* buttons, pads */
  --ui-btn-hover: #dfdbcd;
  --ui-btn-primary: var(--primary); /* the studio's primary buttons: Export, Quantize, Comment */
  --ui-btn-primary-edge: #b5332a;
  --ui-cta: var(--primary); /* Share, New Drop, Continue with Google */
  --ui-cta-edge: var(--primary);
  --ui-cta-hover: #c1362a;
  --ui-flag: #dedacc; /* R, M, S, FX on a track */
  --ui-flag-hover: #d1cdbe;
  --ui-lit: var(--brand-accent); /* gold: a toggle that is on, the tool in hand, the hovered menu item, a pad being hit, the loop */
  --ui-lit-edge: #b98a2b;
  --ui-ink-fill: var(--brand-ink); /* ink: playing, the chosen segment */
  --ui-stone: var(--brand-secondary); /* stone: effects on a track, the loop when off, what came in */
  --ui-field: #fefcf7; /* text fields, selects, the active tab */
  --ui-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235e5c54' stroke-width='1.4'/%3E%3C/svg%3E");
  --ui-lcd: #fefcf7; /* position, tempo, the master meter */
  --ui-well: #e2ded0; /* groups of tools */
  --ui-trough: #d0ccbd; /* the unlit part of meters, knobs and faders */
  --ui-trough-edge: #b8b4a5;
  --ui-knob-cap: #fefcf7;
  --ui-knob-cap-hover: #f1eee3;
  --ui-knob-edge: var(--brand-ink);
  --ui-knob-pointer: var(--brand-ink);
  --ui-fader-slot: #9d9a8c;
  --ui-fader-cap: #2a2a28;
  --ui-fader-cap-on: #4a4944;
  --ui-fader-cap-edge: var(--brand-ink);
  --ui-fader-shine: rgba(248, 245, 236, 0.55);
  --ui-led-off: #d0ccbd;
  --ui-led-on: var(--brand-accent);
  --ui-led-inset: rgba(25, 25, 25, 0.2);
  --ui-led-glow: rgba(221, 170, 72, 0.55);
  --ui-swatch-ring: var(--brand-ink); /* around the chosen track color */
  --ui-meter: #2a2a28; /* level meters: ink, then gold, then red */
  --ui-meter-warn: var(--brand-accent);
  --ui-meter-hot: var(--brand-primary);

  /* Notices */
  --ui-notice: #f3e2b3; /* something needs attention */
  --ui-info: #dcdad0; /* listening only, a copy, turn the phone */
  --ui-local: var(--brand-ink); /* the landing Drop's welcome */
  --ui-inapp: var(--brand-ink); /* inside another app's browser */

  /* The arrangement */
  --ui-tick-bar: rgba(25, 25, 25, 0.5); /* ruler ticks */
  --ui-tick-beat: rgba(25, 25, 25, 0.24);
  --ui-marker: var(--brand-ink); /* playheads, loop markers, peak holds, the tuner's needle */
  --ui-loop-strip: rgba(25, 25, 25, 0.03);
  --ui-loop-strip-hover: rgba(25, 25, 25, 0.07);
  --ui-loop-strip-rule: rgba(25, 25, 25, 0.14);
  --ui-loop-band-edge: rgba(25, 25, 25, 0.22);
  --ui-loop-line: #a27f3a; /* the loop's ends across the lanes */
  /* A clip is its track's color: all of it in the body, shaded with ink for the outline and the label. */
  --ui-clip-mix: 100%;
  --ui-clip-midi-mix: 100%;
  --ui-clip-edge-mix: 80%;
  --ui-clip-label-mix: 48%;
  --ui-wave-mix: 30%; /* the waveform where --ui-wave (below, by the clip rules) isn't supported */
  --ui-clip-base: var(--brand-canvas);
  --ui-clip-edge-base: var(--brand-ink);
  --ui-clip-label-base: var(--brand-ink);
  --ui-wave-base: var(--brand-ink);
  --ui-clip-label-text: rgba(248, 245, 236, 0.96);
  --ui-clip-fallback: #c9c5b6; /* a clip where color-mix isn't supported */
  --ui-rec-clip: rgba(214, 64, 50, 0.18); /* the take being recorded */
  --ui-rec-wave: var(--brand-primary);
  --ui-error-a: #f2cfc9; /* a clip whose audio didn't load */
  --ui-error-b: #e9b7af;
  --ui-progress: #fefcf7; /* a take being saved */
  --ui-progress-trough: rgba(25, 25, 25, 0.3);
  --ui-select-ring: #fefcf7; /* the selected clip: a paper mat, an ink frame, a paper label */
  --ui-select-ring-out: rgba(25, 25, 25, 0.85);
  --ui-select-label: #fefcf7;
  --ui-clip-grip: rgba(255, 255, 255, 0.3); /* a clip's edges under the pointer */
  --ui-fade-shade: rgba(230, 226, 213, 0.62); /* what a fade takes away */
  --ui-fade-line: rgba(25, 25, 25, 0.85);
  --ui-handle: #fefcf7;
  --ui-handle-edge: rgba(25, 25, 25, 0.8);
  --ui-loop-marks: rgba(25, 25, 25, 0.4); /* where a MIDI clip repeats */

  /* Editors, instruments and effects */
  --ui-pr-white: #f4f1e7; /* piano roll: rows of white and black keys, grid lines */
  --ui-pr-black: #e6e2d5;
  --ui-pr-line: rgba(25, 25, 25, 0.06);
  --ui-pr-beat: rgba(25, 25, 25, 0.14);
  --ui-pr-bar: rgba(25, 25, 25, 0.36);
  --ui-pr-beyond: rgba(25, 25, 25, 0.13); /* past the loop's end */
  --ui-pr-muted: #b5b1a2; /* a muted note */
  --ui-pr-stem-ink: 0.4; /* how much ink goes into a track's color for the velocity stems, so a pale color reads on paper */
  --ui-pr-soft: 254, 252, 247; /* r, g, b laid over a quiet note: it pales */
  --ui-pr-note-text: rgba(25, 25, 25, 0.9);
  --ui-pr-marquee: rgba(25, 25, 25, 0.1);
  --ui-pr-white-key: #fefcf7;
  --ui-pr-black-key: #2a2a28;
  --ui-pr-pad-key: #e6e2d5; /* a drum pad's row of the keyboard */
  --ui-pr-pad-key-alt: #efebdf;
  --ui-aq-bar: rgba(25, 25, 25, 0.22); /* audio quantize: grid lines */
  --ui-aq-step: rgba(25, 25, 25, 0.08);
  --ui-aq-wave: #8e8f84; /* the take as recorded */
  --ui-aq-quantized: var(--brand-ink); /* and quantized */
  --ui-aq-marker: #b98a2b; /* an attack */
  --ui-aq-moved: rgba(185, 138, 43, 0.4); /* where it was */
  --ui-aq-picked: rgba(221, 170, 72, 0.4); /* behind a selected one */
  --ui-graph: #fefcf7; /* the paper of graphs: EQ, compressor, envelopes, waves */
  --ui-graph-grid: #dad6c8;
  --ui-graph-mark: #8c8a80; /* reference lines, a wave that is off */
  --ui-band-low: #8a6717; /* the multiband compressor's bands, as curves, arcs and tab names */
  --ui-band-mid: #6f7168;
  --ui-band-high: var(--lamp);
  --ui-band-ring: #fefcf7; /* around the EQ handle being moved */
  --ui-cmp-output: var(--brand-ink); /* the compressor's monitor: what goes out (what comes in is stone) */
  --ui-cmp-reduction: var(--brand-primary);
  --ui-cmp-live: var(--brand-ink);
  --ui-cmp-input-fill: rgba(168, 169, 157, 0.35);
  --ui-cmp-output-fill: rgba(25, 25, 25, 0.14);
  --ui-eq-cut: #6f7168; /* EQ handles: the two cuts, low shelf, mid, high shelf */
  --ui-eq-low: #8a6717;
  --ui-eq-mid: var(--brand-ink);
  --ui-eq-high: var(--lamp);
  --ui-master: var(--brand-ink); /* the master strip's color */
  --ui-synth: var(--lamp); /* Riff Synth: its name, arcs, waves, the first envelope and its attack */
  --ui-env2: var(--brand-ink); /* the filter envelope */
  --ui-env-decay: #8a6717; /* decay, sustain, release in an envelope's picture */
  --ui-env-sustain: #6f7168;
  --ui-env-release: var(--brand-ink);
  --ui-drums: #7a5c14; /* Drop Kit: its name, arcs, pad names */
  --ui-tuner-off: #f0cfc9; /* the tuner's scale: out of tune, nearly, in tune */
  --ui-tuner-mid: #efebdf;
  --ui-tuner-on: #ebd08e;
  --ui-tick: #8c8a80;
}

/* Every other theme was designed on a dark base: this one, with its own palette over it. */
:root:not([data-theme="studio"]) {
  --bg: #141615;
  --panel: #212328;
  --panel-2: #27292f;
  --panel-3: #30333a;
  --lane: #1a1b1f;
  --line: #0c0d0f;
  --line-soft: #34373e;
  --grid-bar: rgba(255, 255, 255, 0.075);
  --grid-beat: rgba(255, 255, 255, 0.03);
  --text: #eee9df;
  --text-dim: #a0a59f;
  --accent: #d8ae75;
  --accent-two: #a7baad;
  --lamp: #d8ae75;
  --rec: #e5484d;
  --play: #4cc472;
  --mute: #f0a23d;
  --solo: #f1d548;
  --primary: var(--accent);
  --on-primary: var(--bg);
  --on-accent: var(--bg);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 12px/1.35 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
:root[data-theme="studio"] ::selection { background: var(--brand-accent); color: var(--brand-ink); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--text-dim); }
.spacer { flex: 1; }
.error-text { color: var(--ui-danger-text, #ff8d8f); }

/* ── Top bar (shared by home + DAW) ───────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.04em;
  color: var(--text);
  text-decoration: none;
  flex: none;
}
.brand-wordmark { white-space: nowrap; }
/* Studio's wordmark: lowercase, in one color, closed by the brand's red period. */
:root[data-theme="studio"] .brand-wordmark { text-transform: lowercase; }
:root[data-theme="studio"] .brand-wordmark::after { content: "."; color: var(--ui-dot); }
.brand-drop { color: var(--ui-wordmark-drop, var(--lamp)); }
.product-mark { display: block; width: 26px; height: 26px; flex: none; }

.drop-name {
  font-weight: 750;
  font-size: 13px;
  letter-spacing: -0.01em;
  max-width: 220px;
  min-width: 60px;
  padding: 3px 6px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.drop-name:hover { background: var(--panel-3); }

.transport, .tempo, .zoom { display: flex; align-items: center; gap: 3px; flex: none; }

.tbtn {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(var(--ui-btn, #33363d), var(--ui-btn, #2a2d33));
  color: var(--text);
  cursor: pointer;
}
.tbtn:hover { background: linear-gradient(var(--ui-btn-hover, #3a3d45), var(--ui-btn-hover, #30333a)); }
.tbtn .icon { width: 14px; height: 14px; fill: currentColor; }
.tbtn.play .icon { fill: var(--ui-ink, #c9ccd2); }
.tbtn.play.on { background: var(--ui-ink-fill, #1f3a29); }
.tbtn.play.on .icon { fill: var(--ui-on-ink, var(--play)); }
.tbtn.rec .icon { fill: var(--rec); }
.tbtn.rec.on { background: var(--rec); }
.tbtn.rec.on .icon { fill: var(--ui-on-red, #fff); }
.tbtn.rec.blink { animation: blink 0.5s steps(2, start) infinite; }
.tbtn.toggle.on { background: var(--ui-lit, #263b57); color: var(--ui-ink, #cfe3ff); border-color: var(--ui-lit-edge, #0d1a2b); }
.tbtn.toggle.on .icon { fill: var(--ui-ink, #9cc8ff); }
.tbtn.text { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.tbtn.text.on { color: var(--ui-ink, #cfe3ff); }
@keyframes blink { to { background: var(--rec); } }

.lcd {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  background: var(--ui-lcd, #0e0f11);
  border: 1px solid var(--ui-well-edge, #000);
  border-radius: 3px;
  padding: 1px 10px;
  min-width: 112px;
  text-align: right;
  line-height: 1.15;
  flex: none;
}
.lcd-main { font-size: 15px; font-weight: 650; color: var(--ui-ink, #e8f1ff); letter-spacing: 0; }
.lcd-sub { font-size: 10px; color: var(--text-dim); }

.field-btn, .field-static {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--ui-well-edge, #000);
  border-radius: 3px;
  background: var(--ui-lcd, #0e0f11);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  line-height: 26px;
}
.field-btn { cursor: text; }
.field-btn .bpm-value { font-size: 14px; font-weight: 650; color: var(--ui-ink, #e8f1ff); }
.field-btn .unit, .field-static { font-size: 10px; color: var(--text-dim); }
.field-static { font-size: 12px; color: var(--ui-ink-dim, #c9ccd2); }

.author-input {
  width: 110px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ui-field, #18191c);
}

.share-btn, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(var(--ui-btn, #33363d), var(--ui-btn, #2a2d33));
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}
.share-btn .icon, .add-track .icon { width: 13px; height: 13px; fill: currentColor; }
.btn.primary { background: linear-gradient(var(--ui-btn-primary, #3d79c9), var(--ui-btn-primary, #2f63a8)); border-color: var(--ui-btn-primary-edge, #10233d); color: var(--ui-on-red, #fff); }
.btn:disabled { opacity: 0.5; cursor: default; }
.text-btn { background: none; border: 0; color: var(--text-dim); cursor: pointer; text-decoration: underline; }

.inline-edit {
  width: 100%;
  min-width: 60px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--ui-field, #0e0f11);
  outline: none;
}
.bpm-edit { width: 58px; font-family: var(--sans); font-variant-numeric: tabular-nums; }

.notice-bar {
  padding: 6px 12px;
  background: var(--ui-notice, #3a2a12);
  color: var(--ui-ink, #ffd9a3);
  border-bottom: 1px solid var(--line);
}

/* ── DAW layout ───────────────────────────────────────────────────── */

body.daw-page { overflow: hidden; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.daw-page #app { flex: 1; min-height: 0; }
.daw { display: flex; flex-direction: column; height: 100%; }

.arrange {
  position: relative;
  flex: 1;
  overflow: auto;
  background: var(--bg);
  overscroll-behavior: contain;
}
.arrange-inner {
  position: relative;
  width: calc(var(--header-w) + var(--timeline-w, 1000px));
  min-height: 100%;
}

/* Ruler (sticky on top) */
.ruler-row {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  height: var(--ruler-h);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.corner {
  position: sticky;
  left: 0;
  z-index: 6;
  width: var(--header-w);
  flex: none;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.ruler {
  position: relative;
  width: var(--timeline-w);
  flex: none;
  cursor: pointer;
  user-select: none;
  background-image:
    linear-gradient(to right, var(--ui-tick-bar, rgba(255, 255, 255, 0.32)) 1px, transparent 1px),
    linear-gradient(to right, var(--ui-tick-beat, rgba(255, 255, 255, 0.16)) 1px, transparent 1px);
  background-size: var(--bar-px) 100%, var(--beat-px) 7px;
  background-position: 0 0, 0 100%;
  background-repeat: repeat-x;
}
.dense .ruler { background-size: var(--bar-px) 100%, 0 0; }
.bar-label {
  position: absolute;
  top: 15px;
  padding-left: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-ink-dim, #aeb3bc);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.ruler-head {
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--ui-marker, #f4f4f4);
  pointer-events: none;
}

/* Tracks */
.track-row {
  display: flex;
  height: var(--track-h);
  border-bottom: 1px solid var(--line);
}
.track-header {
  position: sticky;
  left: 0;
  z-index: 6;
  display: flex;
  width: var(--header-w);
  flex: none;
  background: var(--panel-2);
  border-right: 1px solid var(--line);
  user-select: none;
}
.track-row.selected .track-header { background: var(--ui-header-on, #31353d); }
.track-row.selected .track-name { color: var(--ui-ink, #fff); }
.color-chip {
  width: 7px;
  flex: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.track-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 0 8px 0 9px;
}
.track-top { display: flex; align-items: center; gap: 4px; min-width: 0; }
.track-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ui-ink, #c9ccd2);
}
.more {
  display: grid;
  place-items: center;
  width: 20px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.more:hover { background: var(--panel-3); color: var(--text); }
.more .icon { width: 12px; height: 12px; fill: currentColor; }
.track-controls { display: flex; align-items: center; gap: 4px; }
.flag {
  width: 22px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--ui-edge, #111215);
  border-radius: 2px;
  background: var(--ui-flag, #3a3d44);
  color: var(--ui-ink-soft, #c3c7ce);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.flag:hover { background: var(--ui-flag-hover, #454952); }
.flag.arm.on { background: var(--rec); color: var(--ui-on-red, #fff); }
.flag.mute.on { background: var(--mute); color: var(--ui-on-ink, #1d1406); }
.flag.solo.on { background: var(--solo); color: var(--ui-ink, #1d1a06); }
.meter {
  flex: 1;
  height: 6px;
  margin-left: 4px;
  background: var(--ui-trough, #0f1012);
  border-radius: 1px;
  overflow: hidden;
  visibility: hidden;
}
.track-row.armed .meter { visibility: visible; }
.meter-fill { width: 0; height: 100%; background: var(--play); transition: width 50ms linear; }
.meter-fill.hot { background: var(--rec); }

.lane {
  position: relative;
  width: var(--timeline-w);
  flex: none;
  background-color: var(--lane);
  background-image:
    linear-gradient(to right, var(--grid-bar) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-beat) 1px, transparent 1px);
  background-size: var(--bar-px) 100%, var(--beat-px) 100%;
}
.dense .lane { background-size: var(--bar-px) 100%, 0 0; }
.track-row.selected .lane { background-color: var(--ui-lane-on, #1e2025); }

.add-row { height: 34px; }
.add-cell { align-items: center; padding-left: 10px; background: var(--panel); }
.add-track {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(var(--ui-btn, #33363d), var(--ui-btn, #2a2d33));
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.add-track:hover { background: linear-gradient(var(--ui-btn-hover, #3a3d45), var(--ui-btn-hover, #30333a)); }
.lane.filler { background-color: transparent; }

/* Clips */
.clip {
  position: absolute;
  top: 3px;
  bottom: 3px;
  overflow: hidden;
  border-radius: 3px;
  /* Plain fallbacks first for Safari < 16.2 (no color-mix). */
  border: 1px solid var(--track-color);
  background: var(--ui-clip-fallback, #2a2c31);
  border: 1px solid color-mix(in srgb, var(--track-color) var(--ui-clip-edge-mix, 75%), var(--ui-clip-edge-base, #000));
  background: color-mix(in srgb, var(--track-color) var(--ui-clip-mix, 26%), var(--ui-clip-base, #121316));
}
.clip-label {
  height: 14px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ui-clip-label-text, rgba(255, 255, 255, 0.92));
  background: var(--track-color);
  background: color-mix(in srgb, var(--track-color) var(--ui-clip-label-mix, 62%), var(--ui-clip-label-base, #000));
}
.clip .wave {
  position: absolute;
  left: 0;
  top: 15px;
  width: 100%;
  height: calc(100% - 16px);
  fill: var(--track-color);
  stroke: var(--track-color);
  fill: var(--ui-wave, color-mix(in srgb, var(--track-color) var(--ui-wave-mix, 80%), var(--ui-wave-base, #fff)));
  stroke: var(--ui-wave, color-mix(in srgb, var(--track-color) var(--ui-wave-mix, 80%), var(--ui-wave-base, #fff)));
  stroke-width: 0.6px;
}
/* Studio's clips are their track's color, so a waveform is drawn pale on a dark one and dark on a
   pale one, where the browser can read a color's lightness (elsewhere: dark, from --ui-wave-mix). */
@supports (color: oklch(from red clamp(0.36, (0.62 - l) * 1000, 0.88) calc(c * 0.42) h)) {
  :root[data-theme="studio"] .clip { --ui-wave: oklch(from var(--track-color) clamp(0.36, (0.62 - l) * 1000, 0.88) calc(c * 0.42) h); }
}
.clip.loading { animation: pulse 1.2s ease-in-out infinite; }
.clip.error {
  border-color: var(--rec);
  background: repeating-linear-gradient(45deg, var(--ui-error-a, #3b1d1f) 0 6px, var(--ui-error-b, #2a1517) 6px 12px);
}
.clip.saving .clip-label { font-style: italic; }
.clip-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ui-progress-trough, rgba(0, 0, 0, 0.45)); }
.clip-progress > div { height: 100%; background: var(--ui-progress, #fff); transition: width 0.15s; }
.clip.failed { border: 1px dashed var(--rec); }
.clip.failed .clip-label { background: var(--rec); }
.clip.recording { border-color: var(--rec); background: var(--ui-rec-clip, rgba(229, 72, 77, 0.22)); }
.clip.recording .clip-label { background: var(--rec); }
.clip.recording .wave { fill: var(--ui-rec-wave, #ffc9cb); stroke: var(--ui-rec-wave, #ffc9cb); }
@keyframes pulse { 50% { opacity: 0.45; } }

/* Playhead */
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--ui-marker, #f4f4f4);
  z-index: 4;
  pointer-events: none;
  will-change: transform;
}

.load-error { padding: 40px 20px; text-align: center; color: var(--text-dim); }

/* Menus */
.menu {
  position: fixed;
  z-index: 50;
  min-width: 170px;
  padding: 4px;
  background: var(--ui-pop, #2b2e34);
  border: 1px solid var(--ui-pop-edge, #0b0c0e);
  border-radius: 4px;
  box-shadow: 0 10px 30px var(--ui-shadow, rgba(0, 0, 0, 0.45));
}
.menu-item {
  display: block;
  width: 100%;
  padding: 5px 10px;
  border: 0;
  border-radius: 2px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: var(--ui-lit, var(--accent)); color: var(--ui-ink, #171a16); }
.menu-item.danger { color: var(--ui-danger-text, #ff8d8f); }
.menu-item.danger:hover { background: var(--rec); color: var(--ui-on-red, #fff); }
.swatches { display: grid; grid-template-columns: repeat(6, 20px); gap: 5px; padding: 6px 8px; }
.swatch { width: 20px; height: 20px; border: 1px solid var(--ui-edge, #000); border-radius: 3px; cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid var(--ui-swatch-ring, #fff); outline-offset: 1px; }

/* Toasts */
.toasts { position: fixed; right: 14px; bottom: 14px; display: grid; gap: 6px; z-index: 60; }
.toast {
  padding: 7px 12px;
  background: var(--ui-pop, #2f333a);
  border: 1px solid var(--ui-pop-edge, #0b0c0e);
  border-left: 3px solid var(--ui-lit, var(--accent));
  border-radius: 3px;
  box-shadow: 0 6px 20px var(--ui-shadow, rgba(0, 0, 0, 0.4));
  max-width: 360px;
}

/* ── Home ─────────────────────────────────────────────────────────── */

.home-page { background: var(--ui-page, #101211); }
.home-topbar { max-width: 1200px; height: 88px; padding: 0 32px; margin: auto; background: transparent; border-color: var(--ui-ink-rule, #2a2e29); gap: 18px; }
.home-topbar .brand { font-size: 28px; letter-spacing: -.045em; }
.home-topbar .product-mark { width: 34px; height: 34px; }
.brand-byline { color: var(--text-dim); font: 600 10px var(--sans); letter-spacing: .03em; padding-left: 18px; border-left: 1px solid var(--ui-hair, #383d35); }
.home-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; font-size: 12px; }
.home-nav a { color: var(--ui-ink, #c3c6bc); font-weight: 600; text-decoration: none; padding-block: 12px; }
.home-nav a:hover { color: var(--lamp); }
.home-nav a span { margin-left: 5px; }
.home { max-width: 1200px; margin: 0 auto; padding: 0 32px 64px; }
.eyebrow { font: 800 10px/1.5 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.signal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-dot, var(--lamp)); box-shadow: 0 0 10px var(--ui-glow, #d8ae7530); flex: none; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: center; padding: 72px 0 58px; }
.hero-copy > .eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; color: var(--lamp); }
.hero h1 { font-size: clamp(42px, 4.8vw, 64px); line-height: 1.08; letter-spacing: -.05em; font-weight: 850; margin: 0 0 26px; }
.hero h1 > span { color: var(--ui-headline, var(--lamp)); }
.hero-description { max-width: 370px; color: var(--ui-ink-soft, #adb2a9); font-size: 15px; line-height: 1.7; margin: 0 0 28px; }
.home .btn.primary { background: var(--ui-cta, #e2d9c6); border: 1px solid var(--ui-cta-edge, #eee5d3); color: var(--ui-on-red, #1a1d18); border-radius: 5px; height: 40px; padding: 0 16px; }
.home .btn.primary:hover { background: var(--ui-cta-hover, #f3ead7); }
.home .btn.hero-cta { height: 48px; gap: 12px; font-size: 13px; }
.hero-cta svg { width: 17px; height: 17px; }
.cta-arrow { margin-left: 17px; font-size: 17px; }
.cta-note { font-size: 11px; color: var(--text-dim); margin: 12px 0 0; }
.origin-note { max-width: 36em; font-size: 13px; color: var(--text-dim); line-height: 1.7; overflow-wrap: anywhere; }
.session-figure { margin: 28px 0 0; min-width: 0; }
.session-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 2px 15px; }
.session-caption .eyebrow, .session-no { font: 9px var(--mono); letter-spacing: .06em; }
.session-no { color: #93998e; white-space: nowrap; }
.session-preview { border: 1px solid #41453b; border-radius: 8px; background: #191c19; overflow: hidden; box-shadow: 0 24px 64px #0004, 0 1px 0 #ffffff0a inset; transform: rotate(-2deg); }
.preview-title { height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 16px; border-bottom: 1px solid #30352e; font-size: 12px; font-weight: 600; }
.preview-format { margin-left: auto; color: #a5ac9e; font: 9px var(--mono); }
.preview-transport { display: flex; height: 46px; align-items: center; gap: 18px; padding: 0 18px; background: #232720; border-bottom: 1px solid #30352e; }
.preview-stop { width: 8px; height: 8px; background: #9da398; }
.preview-play { border-left: 9px solid #c2c8b9; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.preview-record { width: 9px; height: 9px; background: #e07868; border-radius: 50%; }
.preview-position { font: 13px var(--mono); background: #131611; padding: 6px 12px; border: 1px solid #343c2c; border-radius: 3px; color: #e2dccb; }
.preview-mode { margin-left: auto; font: 8px var(--mono); letter-spacing: .1em; color: #a5ac9e; }
.preview-ruler, .preview-track { display: grid; grid-template-columns: 118px 1fr; }
.preview-ruler { height: 27px; font: 8px var(--mono); color: #9ca591; background: #121510; }
.preview-ruler > span { padding: 8px 14px; border-right: 1px solid #353c2d; letter-spacing: .08em; }
.preview-ruler > div { display: grid; grid-template-columns: repeat(4, 1fr); }
.preview-ruler > div span { border-left: 1px solid #343b2e; padding: 8px; }
.preview-track { height: 83px; border-bottom: 1px solid #32382e; --clip-color: #d8ae75; }
.preview-track.bass { --clip-color: #98b6a2; }
.preview-track.texture { --clip-color: #a5a6cf; }
.preview-track-label { position: relative; border-right: 1px solid #343b2e; border-left: 3px solid var(--clip-color); padding: 17px 8px 8px 13px; background: #22261f; }
.preview-track-label strong { display: block; font-size: 10px; font-weight: 500; }
.preview-track-label small { color: #a2a998; font-size: 9px; }
.preview-track-number { display: block; font: 8px var(--mono); color: var(--clip-color); margin-bottom: 5px; }
.preview-lane { min-width: 0; padding: 8px 10px; background: repeating-linear-gradient(90deg, #ffffff07 0 1px, transparent 1px 25%); }
.preview-clip { height: 100%; border: 1px solid color-mix(in srgb, var(--clip-color) 45%, #171a16); border-radius: 3px; color: var(--clip-color); background: color-mix(in srgb, var(--clip-color) 12%, #171a16); overflow: hidden; }
.preview-clip > span { display: block; font: 8px var(--mono); padding: 4px 7px; border-bottom: 1px solid color-mix(in srgb, var(--clip-color) 25%, #171a16); }
.illustrated-wave { display: block; width: 100%; height: 100%; }
.preview-clip .illustrated-wave { height: 40px; }
.bass .preview-clip { margin-left: 16%; }
.texture .preview-clip { margin-left: 29%; }
.preview-bottom { display: flex; justify-content: space-between; align-items: center; height: 33px; padding: 0 13px; color: #a2a998; font: 8px var(--mono); }
.preview-meter { color: #b3c1a3; letter-spacing: 1px; }
.session-figure figcaption { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 26px; color: var(--text-dim); font-size: 11px; }
.layer-dots { display: flex; padding-left: 5px; }
.layer-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #101211; background: #d8ae75; margin-left: -5px; }
.layer-dots i:nth-child(2) { background: #98b6a2; }
.layer-dots i:nth-child(3) { background: #a5a6cf; }
.home-details { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; border-block: 1px solid var(--ui-hair, #2a2e29); color: var(--ui-ink-soft, #acb1a6); font-size: 11px; }
.home-details > span { display: flex; align-items: center; gap: 9px; }
.home-details > span > span { color: var(--lamp); font-size: 17px; }
.how-it-works { padding-top: 68px; scroll-margin-top: 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-heading .eyebrow { margin: 0 0 10px; color: var(--lamp); }
.section-heading h2 { font-size: 29px; font-weight: 800; letter-spacing: -.035em; margin: 0; }
.section-heading > p { margin: 0 0 2px; font-size: 12px; line-height: 1.7; color: var(--text-dim); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; margin: 0; padding: 0; }
.step-art { height: 124px; border: 1px solid #30362c; border-radius: 5px; background: #181c16; margin-bottom: 25px; display: flex; align-items: center; justify-content: center; padding: 20px 22px; color: var(--lamp); overflow: hidden; }
.record-art { gap: 15px; }
.art-record { width: 11px; height: 11px; flex: none; border-radius: 50%; background: #e07868; box-shadow: 0 0 0 7px #e078680d; }
.record-art .illustrated-wave { flex: 1; min-width: 0; height: 55px; }
.art-time { font: 9px var(--mono); color: #adb5a5; }
.share-art { gap: 7px; }
.art-person { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 1px solid #63583e; border-radius: 50%; color: #d8ae75; background: #d8ae7509; font: 9px var(--mono); }
.art-person.friend { color: #98b6a2; border-color: #435949; background: #98b6a209; width: 58px; height: 58px; }
.share-art svg { min-width: 45px; width: 120px; fill: none; stroke: #8f9a84; stroke-width: 1.5; }
.layers-art { flex-direction: column; gap: 5px; padding: 20px 45px; }
.art-layer { width: 100%; height: 24px; background: #d8ae7514; border: 1px solid #d8ae7540; border-radius: 2px; color: #d8ae75; }
.art-layer:nth-child(2) { width: 78%; align-self: end; color: #98b6a2; border-color: #98b6a240; background: #98b6a214; }
.art-layer:nth-child(3) { width: 63%; align-self: end; color: #a5a6cf; border-color: #a5a6cf40; background: #a5a6cf14; }
.step-heading { display: flex; align-items: baseline; gap: 11px; }
.step-number { color: var(--lamp); font: 800 10px var(--sans); font-variant-numeric: tabular-nums; }
.step h3 { font-size: 17px; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.step > p { font-size: 12px; line-height: 1.85; color: var(--ui-ink-soft, #a9afa2); margin: 12px 0 0; max-width: 29em; }
.headphone-tip { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 36px 0 0; padding: 20px 0 0; color: var(--text-dim); font-size: 11px; }
.headphone-tip svg { width: 17px; height: 17px; flex: none; color: var(--lamp); }
.browser-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 54px 0 28px; }
.browser-head h1 { margin: 0; font-size: 34px; font-weight: 850; letter-spacing: -.045em; }
.browser-head .eyebrow { color: var(--lamp); margin: 0 0 6px; }
.drop-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--ui-frame, #343a30); border-radius: 6px; }
.drop-table { width: 100%; border-collapse: collapse; background: var(--ui-card, #191d17); }
.drop-table th, .drop-table td { padding: 16px 18px; text-align: left; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--ui-sep, #30362b); }
.drop-table th { font: 800 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); background: var(--ui-card-head, #20251d); }
.drop-table th:not(:first-child), .drop-table td:not(:first-child) { white-space: nowrap; }
.drop-table tr:last-child td { border: 0; }
.drop-table tr:hover td { background: var(--ui-card-hover, #242a20); }
.drop-table a { color: var(--text); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.drop-table a:hover { color: var(--lamp); }
.empty-drops { padding: 60px 20px; text-align: center; border: 1px dashed var(--ui-frame, #343a30); border-radius: 6px; background: var(--ui-card, #171b15); }
.empty-record { display: inline-grid; place-items: center; height: 42px; width: 42px; color: var(--lamp); font-size: 18px; border: 1px solid var(--ui-frame, #464532); border-radius: 50%; }
.empty-drops h2 { font-size: 18px; font-weight: 750; letter-spacing: -.02em; }

/* Documents (privacy, terms) and the footer linking to them. */
.doc { max-width: 680px; margin: 0 auto; padding: 22px 16px 24px; font-size: 14px; line-height: 1.6; }
.doc h1 { font-size: 24px; font-weight: 850; letter-spacing: -.035em; margin: 18px 0 2px; }
.doc h2 { font-size: 15px; font-weight: 750; letter-spacing: -.01em; margin: 26px 0 6px; }
.doc p, .doc ul { margin: 0 0 10px; }
.doc ul { padding-left: 20px; }
.doc li { margin: 3px 0; }
.doc code { font-family: var(--mono); font-size: 12px; }
.site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 28px 36px; max-width: 1200px; margin: 0 auto; padding: 32px 32px 36px; border-top: 1px solid var(--ui-ink-rule, #2a2e29); font-size: 12px; }
.studio-brand { display: flex; width: fit-content; align-items: center; gap: 9px; color: inherit; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.studio-mark { width: 30px; height: 30px; flex: none; }
.studio-audio { display: block; font-size: 10px; letter-spacing: .17em; font-weight: 400; margin-top: 4px; }
.footer-studio p { color: var(--text-dim); font-size: 10px; margin: 13px 0 0; }
.footer-contact { display: flex; flex-direction: column; gap: 9px; margin-left: auto; }
.footer-contact .eyebrow { font-size: 8px; }
.footer-contact a { color: var(--text); text-decoration: none; }
.footer-contact a span { margin-left: 10px; color: var(--lamp); }
.footer-links { display: flex; gap: 18px; font-size: 11px; }
.footer-links a { color: var(--text-dim); text-underline-offset: 4px; }
.site-footer a:hover { color: var(--lamp); }

/* A little hardware finish; the arrangement stays a compact DAW. */
.daw .topbar { background: linear-gradient(var(--ui-topbar, #2b2e2b), var(--ui-topbar, #222522)); border-bottom-color: var(--ui-ink-rule, #090b09); box-shadow: 0 1px 0 var(--ui-glow, #ffffff08) inset; height: 50px; }
.daw .brand { letter-spacing: -.04em; padding: 0 6px; }
.daw .drop-name { border-left: 1px solid var(--ui-hair, #42473e); border-radius: 0; padding-left: 12px; }
.daw .transport { padding: 3px; background: var(--ui-transport, #151815); border: 1px solid var(--ui-well-edge, #353d30); border-radius: 5px; gap: 3px; }
.daw .lcd { background: var(--ui-lcd, #10150e); border-color: var(--ui-well-edge, #080b06); box-shadow: 0 1px 0 var(--ui-glow, #ffffff0b); }
.daw .lcd-main { color: var(--ui-ink, #e0dfbe); }
.daw .lcd-sub { color: var(--ui-ink-dim, #a2ac90); }
.daw .field-btn, .daw .field-static { background: var(--ui-lcd, #131810); border-color: var(--ui-well-edge, #090c07); }
.daw .tbtn { box-shadow: 0 1px 0 var(--ui-glow, #ffffff0a) inset; }
.daw .share-btn { background: var(--ui-cta, #d8ae75); color: var(--ui-on-red, #201d13); border-color: var(--ui-cta-edge, #e3be8b); }
.daw .share-btn:hover { background: var(--ui-cta-hover, #e6c38f); }
.daw .ruler-row, .daw .corner { background-color: var(--ui-ruler, #242824); }
.daw .track-header { background: var(--ui-header, #272c26); }
.daw .track-row.selected .track-header { background: var(--ui-header-on, #343b30); }
.daw .track-row.selected .lane { background-color: var(--ui-lane-on, #20251f); }
.daw .track-name { color: var(--ui-ink, #e0e2d8); }
.daw .clip { box-shadow: 0 1px 3px var(--ui-shadow-soft, #0003); }
.daw .playhead { box-shadow: 0 0 5px var(--ui-glow, #ffffff20); }
.daw-footer { flex: none; display: flex; align-items: center; gap: 24px; min-height: 30px; padding: 4px 14px; background: var(--ui-daw-footer, #1d211c); border-top: 1px solid var(--ui-hair, #353d30); font: 500 9px var(--sans); color: var(--ui-ink-dim, #a2ac99); }
.daw-workspace-label { font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.daw-shortcuts { display: flex; align-items: center; gap: 6px; }
.daw-shortcuts kbd { font: 8px var(--mono); padding: 1px 4px; border: 1px solid var(--ui-edge, #454d3f); border-radius: 3px; color: var(--ui-ink-soft, #c9cebe); margin-left: 8px; }
.daw-studio { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--ui-ink-soft, #c9cebe); text-decoration: none; }
.daw-studio:hover { color: var(--lamp); }
.daw-studio .studio-mark { width: 15px; height: 15px; }
:focus-visible { outline: 2px solid var(--ui-focus, var(--lamp)); outline-offset: 4px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 18px; background: var(--ui-ink-fill, #e2d9c6); color: var(--ui-on-ink, #101211); }
.skip-link:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Narrow screens: keep the DAW layout, just tighter. */
@media (max-width: 760px) {
  :root { --header-w: 150px; }
  .topbar { overflow-x: auto; }
  .drop-name, .author-input, .zoom { display: none; }
}

@media (max-width: 960px) {
  .hero { gap: 32px; padding-top: 55px; }
  .hero h1 { font-size: 50px; }
  .preview-ruler, .preview-track { grid-template-columns: 96px 1fr; }
  .preview-track-label { padding-left: 9px; }
  .preview-track-label strong { font-size: 9px; }
  .session-no, .preview-mode { display: none; }
  .steps { gap: 20px; }
  .step-art { padding-inline: 16px; }
  .section-heading h2 { font-size: 26px; }
  .daw-shortcuts { display: none; }
}
@media (max-width: 760px) {
  .home-topbar { height: 72px; padding-inline: 22px; overflow: visible; }
  .home-topbar .brand { font-size: 20px; }
  .home-topbar .product-mark { width: 28px; height: 28px; }
  .brand-byline { display: none; }
  .home-nav { gap: 18px; font-size: 11px; min-width: 0; }
  .account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home { padding: 0 22px 40px; }
  .hero { grid-template-columns: 1fr; padding: 44px 0 34px; gap: 28px; }
  .hero h1 { font-size: clamp(42px, 8.5vw, 64px); }
  .desktop-break { display: none; }
  .hero-description { max-width: 32em; }
  .session-figure { margin: 15px 5px 0; }
  .session-no, .preview-mode { display: block; }
  .preview-ruler, .preview-track { grid-template-columns: 110px 1fr; }
  .preview-track-label strong { font-size: 10px; }
  .preview-track { height: 76px; }
  .preview-clip .illustrated-wave { height: 34px; }
  .home-details { flex-direction: column; gap: 10px; padding-block: 20px; }
  .how-it-works { padding-top: 40px; }
  .section-heading { display: block; margin-bottom: 24px; }
  .section-heading h2 { font-size: 26px; }
  .section-heading > p { margin-top: 14px; }
  .steps { grid-template-columns: 1fr; gap: 30px; }
  .step-art { height: 118px; margin-bottom: 18px; }
  .record-art { padding-inline: 30px; }
  .layers-art { padding-inline: 60px; }
  .step > p { max-width: none; margin-top: 8px; font-size: 13px; }
  .headphone-tip { align-items: start; line-height: 1.7; text-align: left; }
  .headphone-tip svg { margin-top: 2px; }
  .site-footer { padding: 30px 22px; gap: 26px; align-items: start; flex-direction: column; }
  .footer-contact { margin-left: 0; }
  .footer-contact a { overflow-wrap: anywhere; }
  .browser-head { margin-top: 35px; }
  .daw-footer { gap: 10px; padding-inline: 10px; font-size: 8px; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 38px; }
  .home-topbar { flex-wrap: wrap; height: auto; padding-block: 16px 12px; gap: 10px; }
  .home-nav { width: 100%; justify-content: space-between; }
  .session-no, .preview-mode { display: none; }
  .home-nav { gap: 12px; }
  .preview-ruler, .preview-track { grid-template-columns: 96px 1fr; }
}

/* Account colors reuse the DAW's palette, including lanes, faders and chrome. */
:root[data-theme="aurora"], .palette-aurora {
  --bg: #111b1d; --panel: #19292d; --panel-2: #203339; --panel-3: #29434a;
  --lane: #142327; --line: #0c1719; --line-soft: #36515a;
  --text: #e6f1ec; --text-dim: #a1bdb7; --accent: #8bddbd; --lamp: #8bddbd;
}
:root[data-theme="midnight-tape"], .palette-midnight-tape {
  --bg: #191723; --panel: #252236; --panel-2: #302b42; --panel-3: #3d3654;
  --lane: #1e1b2a; --line: #100f19; --line-soft: #514463;
  --text: #f0e7ef; --text-dim: #b9abc4; --accent: #d4aff0; --lamp: #d4aff0;
}
/* Studio's sleeve in the collection, whatever theme the page wears; its dots are the brand's red, gold and stone. */
.palette-studio { --bg: var(--brand-canvas); --panel: #f1eee3; --panel-2: #e9e5d9; --panel-3: var(--brand-secondary); --lane: #e6e2d5; --line-soft: #d8d4c6; --accent: var(--brand-primary); --accent-two: var(--brand-accent); }
:root:not([data-theme="studio"]) .home-page,
:root:not([data-theme="studio"]) .home-topbar { background: var(--bg); }
.account-page { min-height: 100vh; }
.account-main { max-width: 1040px; padding: 72px 32px 96px; margin: auto; font-size: 15px; line-height: 1.65; }
.account-main[data-view="support"], .account-main[data-view="thanks"] { max-width: 780px; }
.account-main h1 { font-size: clamp(30px, 4.2vw, 48px); font-weight: 850; line-height: 1.12; letter-spacing: -.045em; margin: 12px 0 20px; }
.account-main h2 { font-size: 19px; font-weight: 800; line-height: 1.3; margin: 0 0 8px; letter-spacing: -.02em; }
.account-intro { color: var(--text-dim); font-size: 20px; max-width: 600px; }
.account-main .btn { min-height: 44px; padding: 10px 18px; font-size: 14px; }
.account-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.support-symbol { display: grid; place-items: center; color: var(--ui-dot, var(--accent)); border: 1px solid var(--line-soft); border-radius: 50%; width: 62px; height: 62px; font-size: 34px; margin-bottom: 30px; }
.support-form { margin: 36px 0 26px; max-width: 520px; }
.support-form fieldset { padding: 0; border: 0; margin: 0 0 24px; }
.support-form legend { margin-bottom: 12px; font-size: 13px; }
.support-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.support-amounts label { position: relative; cursor: pointer; }
.support-amounts input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.support-amounts span { display: block; padding: 15px; text-align: center; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel); }
@media (max-width: 340px) { .support-amounts span { font-size: 21px; } } /* four amounts across the narrowest phones */
.support-amounts input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.support-amounts input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 4px; }
.support-submit { width: 100%; justify-content: center; }
.checkout-note { font-size: 12px; text-align: center; }
.support-fineprint { font-size: 12px; color: var(--text-dim); max-width: 490px; margin-top: 32px; }
.signin-support { border-top: 1px solid var(--line-soft); margin: 30px 0; padding-top: 15px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 36px 0 26px; }
.theme-card { min-width: 0; }
.theme-preview { border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px; width: 100%; text-align: left; background: var(--panel); cursor: pointer; }
.theme-preview:hover { border-color: var(--text-dim); }
.theme-preview[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-title { display: flex; gap: 6px; justify-content: space-between; align-items: center; font-weight: 750; font-size: 15px; margin-top: 16px; }
.theme-label { color: var(--text-dim); font-size: 10px; font-weight: 400; }
.theme-description { display: block; font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.mini-daw { display: block; background: var(--lane); border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden; height: 144px; }
.mini-top { display: flex; align-items: center; gap: 5px; height: 28px; background: var(--panel-2); border-bottom: 1px solid var(--line-soft); padding: 8px; }
.mini-top i { height: 4px; width: 15px; background: var(--accent); opacity: .7; }
.mini-track { display: flex; height: 38px; border-bottom: 1px solid var(--line-soft); position: relative; align-items: center; }
.mini-track > i { width: 36px; background: var(--panel); border-right: 1px solid var(--line-soft); height: 100%; margin-right: 12px; }
.mini-track b { font-size: 24px; line-height: 25px; height: 25px; width: 66%; letter-spacing: 2px; background: var(--accent); color: var(--lane); border-radius: 3px; overflow: hidden; opacity: .8; }
.mini-track:nth-child(3) b { width: 40%; margin-left: 18%; opacity: .5; }
.mini-track:nth-child(4) b { width: 55%; opacity: .65; }
.theme-actions { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.theme-actions p { margin: 0; max-width: 460px; font-size: 13px; }
.account-support { margin-top: 42px; font-size: 14px; }
.account-support p { color: var(--text-dim); }
.support-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; border: 1px solid var(--line-soft); border-radius: 12px; padding: 28px 32px; margin-top: 40px; background: var(--panel); }
.support-card h2 { font-size: 21px; font-weight: 800; letter-spacing: -.025em; margin: 4px 0 10px; }
.support-card p { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin: 0; }
.support-card .eyebrow { color: var(--accent); font-size: 10px; }
.support-card .btn { white-space: nowrap; }
.supporter-thanks { color: var(--accent); padding: 22px 0; font-size: 13px; line-height: 1.8; }
.supporter-thanks a { margin-left: 12px; }
@media (max-width: 700px) {
  .account-main { padding: 42px 20px 64px; }
  .theme-grid { grid-template-columns: 1fr; gap: 14px; }
  .mini-daw { height: 120px; }
  .mini-track { height: 30px; }
  .theme-actions, .support-card { align-items: flex-start; flex-direction: column; gap: 12px; }
  .support-card { padding: 24px; }
  .home-nav .account-name { display: none; }
  .account-page .home-nav { gap: 12px; font-size: 11px; }
}
.account-page .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.account-page .btn.primary:hover { filter: brightness(1.08); }
:root:not([data-theme="studio"]) .daw .share-btn { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Language menu (topbars, DAW footer). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lang-picker { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--ui-ink, #c3c6bc); font-size: 12px; cursor: pointer; }
.lang-picker svg { width: 15px; height: 15px; flex: none; opacity: 0.8; }
.lang-select { appearance: none; -webkit-appearance: none; padding: 5px 22px 5px 8px; border: 1px solid var(--line-soft); border-radius: 6px; background: transparent var(--ui-select-arrow, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a0a59f' stroke-width='1.4'/%3E%3C/svg%3E")) no-repeat right 7px center / 9px; color: inherit; font: inherit; cursor: pointer; }
.lang-select:hover { border-color: var(--text-dim); }
.lang-select:focus-visible { outline: 2px solid var(--ui-focus, var(--lamp, var(--accent))); outline-offset: 2px; }
.lang-select option { background: var(--panel); color: var(--text); }
.doc-topbar { gap: 14px; }
.doc-topbar .lang-picker { margin-left: auto; }
.daw-footer .lang-picker { margin-left: auto; font: inherit; color: inherit; }
.daw-footer .lang-picker + .daw-studio { margin-left: 0; }
.daw-footer .lang-picker svg { width: 12px; height: 12px; }
.daw-footer .lang-select { padding: 2px 18px 2px 6px; border-radius: 4px; background-position: right 5px center; }
@media (max-width: 760px) {
  .lang-picker { font-size: 11px; }
  .lang-select { padding: 4px 20px 4px 6px; }
}

/* Audio files dragged over the arrangement: the target track and where the clip will start. */
.track-row.drop-target .lane { background-color: color-mix(in srgb, var(--track-color, var(--accent)) 14%, var(--lane)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--track-color, var(--accent)) 60%, transparent); }
.add-row.drop-target .lane { background-color: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.drop-marker { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--track-color, var(--accent)); box-shadow: 0 0 8px var(--track-color, var(--accent)); pointer-events: none; z-index: 4; }

/* Clip editing: selection, trim edges, dragging, box selection. */
.clip.editable { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.clip.selected { box-shadow: inset 0 0 0 2px var(--ui-select-ring, #fff), 0 0 0 1px var(--ui-select-ring-out, rgba(0, 0, 0, 0.6)); z-index: 2; }
.clip.selected .clip-label { background: var(--ui-select-label, #fff); color: var(--ui-ink, #111); }
.clip-edge { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 3; cursor: ew-resize; }
.clip-edge[data-edge="start"] { left: 0; }
.clip-edge[data-edge="end"] { right: 0; }
.clip.editable:hover .clip-edge, .clip.trimming .clip-edge { background: var(--ui-clip-grip, rgba(255, 255, 255, 0.12)); }
.clip.dragging { pointer-events: none; z-index: 6; opacity: 0.85; box-shadow: inset 0 0 0 2px var(--ui-select-ring, #fff), 0 8px 22px var(--ui-shadow, rgba(0, 0, 0, 0.5)); }
body.clip-dragging, body.clip-dragging * { cursor: grabbing !important; }
/* Clip fades: the curve over the waveform, what it takes away shaded, and a handle at each top
   corner (at the end of its fade) that drags inward. A handle shows on hover, on a selected
   clip and once its fade is set. */
.clip .fades { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.fade-shade { fill: var(--ui-fade-shade, rgba(6, 7, 9, 0.5)); }
.fade-line { fill: none; stroke: var(--ui-fade-line, rgba(255, 255, 255, 0.9)); stroke-width: 1.2px; }
.fade-handle { position: absolute; top: 0; z-index: 4; width: 8px; height: 8px; box-sizing: border-box; border: 1px solid var(--ui-handle-edge, rgba(0, 0, 0, 0.7)); border-radius: 1px; background: var(--ui-handle, #f4f4f4); cursor: ew-resize; opacity: 0; transition: opacity 0.12s; }
.clip.editable:hover .fade-handle, .clip.selected .fade-handle, .clip.trimming .fade-handle, .fade-handle.set { opacity: 1; }
.marquee { position: absolute; z-index: 7; pointer-events: none; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* Transport: undo/redo and the snap grid. */
.edit-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.grid-picker { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; color: var(--text-dim); cursor: pointer; }
.grid-picker .icon { width: 13px; height: 13px; fill: currentColor; }
.grid-select { appearance: none; -webkit-appearance: none; height: 26px; padding: 0 20px 0 7px; border: 1px solid var(--ui-edge, #0d0e10); border-radius: 3px; background: var(--ui-field, #24262b) var(--ui-select-arrow, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a0a59f' stroke-width='1.4'/%3E%3C/svg%3E")) no-repeat right 6px center / 8px; color: var(--text); font: 600 11px var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.grid-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid-select option { background: var(--panel); color: var(--text); }

/* Menus: shortcuts and separators. */
.menu-item { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.menu-shortcut { color: var(--text-dim); font: 11px var(--mono); }
.menu-item:hover .menu-shortcut { color: inherit; }
.menu-item:disabled { opacity: 0.4; cursor: default; }
.menu-item:disabled:hover { background: none; color: inherit; }
.menu-sep { height: 1px; margin: 4px 2px; background: var(--ui-sep, #41454d); }
@media (max-width: 760px) { .edit-tools .grid-picker .icon { display: none; } }

/* Loop region: the ruler's top strip, and lines across the arrangement while looping. */
.loop-strip { position: absolute; left: 0; right: 0; top: 0; height: 12px; z-index: 2; cursor: crosshair; background: var(--ui-loop-strip, rgba(255, 255, 255, 0.025)); border-bottom: 1px solid var(--ui-loop-strip-rule, rgba(0, 0, 0, 0.35)); }
.loop-strip:hover { background: var(--ui-loop-strip-hover, rgba(255, 255, 255, 0.06)); }
.loop-band { position: absolute; top: 1px; bottom: 1px; min-width: 4px; border-radius: 2px; cursor: grab; background: var(--ui-stone, #5b606b); box-shadow: inset 0 0 0 1px var(--ui-loop-band-edge, rgba(0, 0, 0, 0.35)); }
.loop-band.on { background: var(--ui-lit, var(--accent)); box-shadow: 0 0 10px var(--ui-glow, color-mix(in srgb, var(--accent) 45%, transparent)); }
.loop-marker { position: absolute; top: -1px; bottom: -1px; width: 7px; cursor: ew-resize; }
.loop-marker[data-edge="start"] { left: -3px; border-left: 3px solid var(--ui-marker, #f4f4f4); }
.loop-marker[data-edge="end"] { right: -3px; border-right: 3px solid var(--ui-marker, #f4f4f4); }
.loop-line { position: absolute; top: var(--ruler-h); bottom: 0; left: 0; width: 1px; z-index: 3; pointer-events: none; background: var(--ui-loop-line, color-mix(in srgb, var(--accent) 70%, transparent)); }

/* ── Instruments, mixer and collaboration ─────────────────────────── */

/* Top bar: view buttons and the faces of the others; never cut off (scrolls sideways if it must). */
.daw .topbar { overflow-x: auto; scrollbar-width: none; }
.daw .topbar::-webkit-scrollbar { display: none; }
.daw .topbar > * { flex: none; }
.daw .topbar .spacer { flex: 1 0 8px; }
/* Publish and Share stay in reach: pinned to the bar's right end where a window is too narrow for the whole bar. */
.top-actions { display: flex; align-items: center; gap: 8px; }
@media (min-width: 761px) and (min-height: 521px) {
  .daw .topbar .top-actions { position: sticky; right: 0; z-index: 2; align-self: stretch; padding-left: 4px; background: inherit; }
  /* What scrolls beneath fades out before them, and doesn't show in the bar's own margin after them. */
  .daw .topbar .top-actions::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 14px; background: linear-gradient(to right, transparent, var(--ui-topbar, #262926)); pointer-events: none; }
  .daw .topbar .top-actions::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 10px; background: inherit; }
}
.view-tools { display: flex; align-items: center; gap: 3px; flex: none; }
.notepad-btn.unread { position: relative; }
.notepad-btn.unread::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 2px var(--panel); }
.presence { display: flex; align-items: center; flex: none; padding-left: 4px; }
.presence:empty { display: none; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; border: 2px solid var(--panel); background: hsl(var(--avatar-hue, 30) 55% 46%); color: #fff; font: 700 10px/1 var(--sans); letter-spacing: .02em; cursor: default; user-select: none; }
.avatar:first-child { margin-left: 0; }
.avatar.owner { box-shadow: 0 0 0 1px var(--accent); }
.avatar.recording { border-color: var(--rec); animation: pulse 1.4s ease-in-out infinite; }
.avatar.playing { border-color: var(--play); }
.avatar.more { background: var(--panel-3); color: var(--text-dim); }

/* Layout: the arrangement with the side panel next to it, the editor dock below. */
.workspace { flex: 1; min-height: 0; display: flex; position: relative; }
.workspace .arrange { min-width: 0; }
.side-panel { position: relative; flex: none; width: 300px; min-width: 0; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); }
.side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-close { position: absolute; top: 6px; right: 6px; z-index: 2; }
.rotate-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; background: var(--ui-info, #23303a); color: var(--ui-ink, #cfe3ff); border-bottom: 1px solid var(--line); font-size: 12px; }
.rotate-hint .text-btn { color: inherit; }

/* Track headers: kind, comments, volume and pan, effects, instrument. */
.track-kind { display: grid; place-items: center; width: 14px; flex: none; color: var(--text-dim); }
.track-kind .icon { width: 12px; height: 12px; fill: currentColor; }
.track-row.midi .track-kind { color: var(--track-color); }
/* On studio's pale headers a pale track color would vanish: shaded with ink. */
:root[data-theme="studio"] .track-row.midi .track-kind { color: color-mix(in srgb, var(--track-color) 62%, var(--brand-ink)); }
.track-controls { gap: 3px; }
.track-controls .knob { flex: none; }
.flag.fx { width: auto; min-width: 22px; padding: 0 3px; font-size: 9px; letter-spacing: .02em; }
.flag.fx.on { background: var(--ui-stone, #2f4a3a); color: var(--ui-ink, #bff0cf); }
.flag.inst { display: grid; place-items: center; }
.flag.inst .icon { width: 12px; height: 12px; fill: currentColor; }
.comment-badge { display: inline-flex; align-items: center; gap: 2px; height: 18px; padding: 0 3px; border: 0; border-radius: 2px; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 10px; opacity: .55; }
.comment-badge.has { opacity: 1; color: var(--accent); }
.track-header:hover .comment-badge { opacity: 1; }
.comment-badge:hover { background: var(--panel-3); }
.comment-badge .icon { width: 12px; height: 12px; fill: currentColor; }
.add-cell { gap: 6px; }
.add-instrument { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 3px; background: linear-gradient(var(--ui-btn, #33363d), var(--ui-btn, #2a2d33)); color: var(--text); font-weight: 600; cursor: pointer; }
.add-instrument:hover { background: linear-gradient(var(--ui-btn-hover, #3a3d45), var(--ui-btn-hover, #30333a)); }
.add-instrument .icon { width: 13px; height: 13px; fill: currentColor; }

/* MIDI clips: a miniature of the notes, with the loop repeats marked. */
.clip.midi { background: color-mix(in srgb, var(--track-color) var(--ui-clip-midi-mix, 18%), var(--ui-clip-base, #121316)); }
.clip .notes { position: absolute; left: 0; top: 16px; width: 100%; height: calc(100% - 19px); fill: var(--ui-wave, color-mix(in srgb, var(--track-color) var(--ui-wave-mix, 80%), var(--ui-wave-base, #fff))); }
.clip .notes .loop-marks { stroke: var(--ui-loop-marks, rgba(255, 255, 255, 0.3)); stroke-dasharray: 2 2; fill: none; }
.clip.recording .notes { fill: var(--ui-rec-wave, #ffc9cb); }
.comment-marker { position: absolute; top: 2px; z-index: 3; display: grid; place-items: center; width: 16px; height: 16px; margin-left: -8px; padding: 0; border: 0; border-radius: 3px 3px 3px 0; background: var(--ui-lit, var(--accent)); color: var(--ui-ink, #1a1710); cursor: pointer; box-shadow: 0 1px 4px var(--ui-shadow-soft, #0006); }
.comment-marker .icon { width: 10px; height: 10px; fill: currentColor; }

/* Knobs and faders. */
.knob { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; width: 42px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: ns-resize; outline: none; }
.knob-dial { width: 30px; height: 30px; display: block; }
.knob-track { fill: none; stroke: var(--ui-trough, #0d0e10); stroke-width: 3.5; stroke-linecap: round; }
.knob-arc { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.knob-cap { fill: var(--ui-knob-cap, #3a3e46); stroke: var(--ui-knob-edge, #15171a); stroke-width: 1; }
.knob-pointer { stroke: var(--ui-knob-pointer, #f2f2ee); stroke-width: 2; stroke-linecap: round; }
.knob:hover .knob-cap, .knob.active .knob-cap { fill: var(--ui-knob-cap-hover, #474c56); }
.knob:focus-visible .knob-dial { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 50%; }
.knob-label { max-width: 100%; font: 500 9px/1.2 var(--sans); font-variant-numeric: tabular-nums; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.knob.active .knob-label { color: var(--text); }
.knob.sm { width: 34px; }
.knob.sm .knob-dial { width: 24px; height: 24px; }
.knob.xs { position: relative; width: 20px; gap: 0; }
.knob.xs .knob-dial { width: 19px; height: 19px; }
.knob.xs .knob-label { display: none; }
.knob.xs.active .knob-label { display: block; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 20; max-width: none; padding: 1px 4px; background: var(--ui-field, #0e0f11); border: 1px solid var(--line); border-radius: 2px; color: var(--text); }
.fader { position: relative; width: 16px; height: 100%; min-height: 70px; margin: 0 auto; border-radius: 3px; background: var(--ui-trough, #0d0e10); box-shadow: inset 0 0 0 1px var(--ui-trough-edge, #000); touch-action: none; cursor: ns-resize; outline: none; }
.fader::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--ui-fader-slot, #2a2d33); }
.fader-thumb { position: absolute; left: -5px; width: 26px; height: 12px; margin-bottom: -6px; border-radius: 2px; background: linear-gradient(var(--ui-fader-cap, #6a6f78), var(--ui-fader-cap, #3c4048)); border: 1px solid var(--ui-fader-cap-edge, #0b0c0e); box-shadow: inset 0 5px 0 -4px var(--ui-fader-shine, #fff8), 0 2px 4px var(--ui-shadow-soft, #0008); }
.fader.active .fader-thumb, .fader:focus-visible .fader-thumb { background: linear-gradient(var(--ui-fader-cap-on, #8a8f98), var(--ui-fader-cap-on, #4c5058)); }

/* Device panels (instruments, effects): labelled sections of knobs. */
.device { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.device-section { padding: 6px 8px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--ui-section, rgba(0, 0, 0, 0.18)); }
.device-section h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font: 800 10px/1.2 var(--sans); letter-spacing: .1em; color: var(--text-dim); text-transform: uppercase; }
.device-section h4:has(> span:empty:only-child) { display: none; }
.device-controls { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: flex-end; }
.param-choice { display: inline-flex; flex-direction: column; gap: 3px; font-size: 10px; color: var(--text-dim); }
.param-choice .param-label { font: 500 9px var(--sans); }
.param-select, .preset-select { height: 24px; max-width: 160px; padding: 0 6px; border: 1px solid var(--ui-edge, #0d0e10); border-radius: 3px; background: var(--ui-field, #1b1d21); color: var(--text); font: 600 11px var(--sans); }
.led-toggle { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px; border: 1px solid var(--ui-edge, #0d0e10); border-radius: 3px; background: var(--ui-btn, #24262b); color: var(--text-dim); font-size: 10px; cursor: pointer; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--ui-led-off, #2c3a2f); box-shadow: inset 0 1px 2px var(--ui-led-inset, #000a); }
.led-toggle.on .led { background: var(--ui-led-on, #63e07f); box-shadow: 0 0 6px var(--ui-led-glow, #63e07f99); }
.led-toggle.on { color: var(--text); }
.device-section h4 .led-toggle { height: 16px; padding: 0 3px; font-size: 0; gap: 0; }

/* The dock (piano roll, instrument, mixer). */
.dock { flex: none; display: flex; flex-direction: column; height: var(--dock-h, 320px); min-height: 0; background: var(--ui-dock, #17191c); border-top: 1px solid var(--ui-ink-rule, #000); box-shadow: 0 -6px 18px var(--ui-shadow-soft, #0005); position: relative; }
.dock.max { height: 74vh; height: 74dvh; }
.dock-handle { position: absolute; top: -4px; left: 0; right: 0; height: 8px; cursor: ns-resize; z-index: 5; touch-action: none; }
.dock-head { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.dock-tabs { display: flex; gap: 2px; }
.dock-tab { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--text-dim); font-weight: 600; cursor: pointer; }
.dock-tab .icon { width: 13px; height: 13px; fill: currentColor; }
.dock-tab:hover { background: var(--panel-3); color: var(--text); }
.dock-tab.on { background: var(--ui-field, #0e0f11); border-color: var(--line); color: var(--text); }
.dock-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-title:not(:empty)::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--track-color); }
.dock-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* Piano roll. */
.piano-roll { flex: 1; min-height: 0; display: flex; flex-direction: column; --pr-white: var(--ui-pr-white, #24272c); --pr-black: var(--ui-pr-black, #1c1e22); --pr-line: var(--ui-pr-line, rgba(255, 255, 255, 0.045)); --pr-beat: var(--ui-pr-beat, rgba(255, 255, 255, 0.1)); --pr-bar: var(--ui-pr-bar, rgba(255, 255, 255, 0.24)); }
.pr-toolbar { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-bottom: 1px solid var(--line); background: var(--ui-toolbar, #1d2023); overflow-x: auto; scrollbar-width: none; flex: none; }
.pr-toolbar > * { flex: none; }
.pr-toolbar .spacer { flex: 1 0 6px; }
.pr-tools { display: flex; gap: 2px; padding: 2px; background: var(--ui-well, #0e0f11); border: 1px solid var(--ui-well-edge, #000); border-radius: 4px; }
.pr-tool { display: grid; place-items: center; width: 28px; height: 24px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--text-dim); cursor: pointer; }
.pr-tool .icon { width: 14px; height: 14px; fill: currentColor; }
.pr-tool:hover { background: var(--panel-3); color: var(--text); }
.pr-tool.on { background: var(--ui-lit, var(--accent)); color: var(--ui-ink, #1a1710); }
.pr-zoom, .pr-typing { display: flex; align-items: center; gap: 2px; }
.pr-octave { min-width: 22px; text-align: center; font: 11px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-dim); }
.pr-info { font: 11px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-dim); }
.pr-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 26px minmax(0, 1fr) 72px; }
.pr-corner { background: var(--ui-toolbar, #1d2023); border-right: 1px solid var(--ui-hair, #000); border-bottom: 1px solid var(--ui-hair, #000); }
.pr-velocity-label { display: flex; align-items: center; justify-content: center; background: var(--ui-toolbar, #1d2023); border-right: 1px solid var(--ui-hair, #000); border-top: 1px solid var(--ui-hair, #000); font: 600 9px var(--sans); color: var(--text-dim); }
.pr-ruler, .pr-velocity, .pr-keys { display: block; touch-action: none; }
.pr-ruler { cursor: pointer; border-bottom: 1px solid var(--ui-hair, #000); }
.pr-velocity { border-top: 1px solid var(--ui-hair, #000); cursor: ns-resize; }
.pr-keys { border-right: 1px solid var(--ui-hair, #000); cursor: pointer; }
.pr-main { position: relative; min-height: 0; overflow: hidden; }
.pr-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; }
.pr-grid { position: sticky; left: 0; top: 0; display: block; touch-action: none; cursor: crosshair; }
.pr-grid[data-tool="delete"] { cursor: not-allowed; }
.pr-grid[data-tool="select"] { cursor: default; }
.pr-grid[data-tool="slice"] { cursor: col-resize; }
.pr-sizer { pointer-events: none; }
.pr-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--ui-marker, #f4f4f4); box-shadow: 0 0 5px var(--ui-glow, #fff6); pointer-events: none; will-change: transform; z-index: 2; }

/* Popovers: note properties, quantize, comments, tuner. */
.popover { position: fixed; z-index: 55; min-width: 220px; max-width: min(380px, calc(100vw - 16px)); padding: 10px 12px; background: var(--ui-pop, #2b2e34); border: 1px solid var(--ui-pop-edge, #0b0c0e); border-radius: 6px; box-shadow: 0 14px 40px var(--ui-shadow, rgba(0, 0, 0, 0.55)); }
.popover h4 { margin: 0 0 8px; font-size: 12px; }
.popover-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.popover-head .icon { width: 14px; height: 14px; fill: var(--accent); }
.popover-head .muted { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover-head .plugin-close { margin-left: auto; }
.popover-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.audio-transform-panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 420px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow-y: auto; }
.audio-transform-panel .popover-head { justify-content: space-between; }
.audio-transform-panel .popover-head h4 { flex: none; margin: 0; }
.audio-transform-panel .popover-head > span { max-width: 45%; }
.audio-transform-description { margin: 8px 0 16px; font-size: 12px; line-height: 1.5; color: var(--text-dim); }
.audio-transform-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.audio-transform-field { display: flex; flex-direction: column; gap: 6px; font-size: 11px; min-width: 0; }
.audio-transform-field > div { display: flex; align-items: center; gap: 7px; }
.audio-transform-field input { width: 100%; min-width: 0; padding: 8px; background: var(--ui-field, #161a20); color: var(--text); border: 1px solid var(--ui-edge, #46535c); border-radius: 4px; font: 14px var(--mono); }
.audio-transform-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.audio-transform-field input[aria-invalid=true] { border-color: var(--ui-danger, #df8a76); }
.audio-transform-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; padding: 12px; background: var(--ui-box, #1b2027); border: 1px solid var(--ui-well-edge, #3a434c); border-radius: 5px; }
.audio-transform-comparison > div { display: grid; gap: 7px; min-width: 0; }
.audio-transform-comparison strong { font-size: 10px; color: var(--text-dim); font-weight: 500; }
.audio-transform-comparison .mono { font-size: 11px; white-space: nowrap; }
.audio-transform-bar { height: 5px; }
.audio-transform-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ui-stone, #7a8a99); }
.audio-transform-bar.result i { background: var(--ui-ink-fill, #65d8c5); }
.audio-transform-speed, .audio-transform-help { font-size: 10px; line-height: 1.5; }
.audio-transform-error { color: var(--ui-danger-text, #f2a18e); font-size: 11px; line-height: 1.5; }
.audio-transform-panel .popover-actions { flex-wrap: wrap; }
.audio-transform-panel .popover-actions > :first-child { margin-right: auto; font-size: 10px; }
.clip-transform-badge { position: absolute; right: 5px; bottom: 4px; padding: 1px 4px; border-radius: 3px; background: var(--ui-ink-fill, #14252ce0); color: var(--ui-on-ink, #9ce3d6); font: 600 9px var(--sans); font-variant-numeric: tabular-nums; line-height: 13px; pointer-events: none; }
.prop { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 11px; color: var(--text-dim); }
.prop > span:first-child { min-width: 64px; }
.prop input[type="range"] { flex: 1; accent-color: var(--accent); }
.prop input[type="number"] { width: 70px; height: 24px; padding: 0 6px; border: 1px solid var(--ui-edge, #0d0e10); border-radius: 3px; background: var(--ui-field, #18191c); color: var(--text); }
.prop.check { gap: 6px; }
.prop.check > span:first-child { min-width: 0; }
.prop-row { display: flex; gap: 14px; }
.mono { font-family: var(--mono); }
.btn.small { height: 24px; padding: 0 9px; font-size: 11px; }

/* Mixer (FL Studio style): channel strips, and the selected channel's insert slots. */
.mixer { flex: 1; min-height: 0; display: flex; }
.mixer-strips { flex: 1; min-width: 0; display: flex; gap: 2px; padding: 6px; overflow-x: auto; overflow-y: hidden; background: var(--ui-tray, #131417); }
.strip { flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px 3px; border: 1px solid var(--ui-edge, #0b0c0e); border-top: 3px solid var(--track-color); border-radius: 3px; background: linear-gradient(var(--ui-strip, #2a2d33), var(--ui-strip, #222429)); cursor: pointer; min-height: 0; }
.strip.master { width: 74px; background: linear-gradient(var(--ui-strip-master, #33302a), var(--ui-strip-master, #26241f)); margin-right: 6px; }
.strip.selected { background: linear-gradient(var(--ui-strip-on, #3a4250), var(--ui-strip-on, #2c323d)); box-shadow: 0 0 0 1px var(--accent); }
.strip-name { width: 100%; font-size: 10px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-meter { position: relative; width: 8px; height: 46px; flex: none; border-radius: 2px; background: var(--ui-trough, #0b0c0e); overflow: hidden; }
.strip-level { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(to top, var(--ui-meter, #4cc472), var(--ui-meter, #4cc472) 65%, var(--ui-meter-warn, #e8c547) 85%, var(--ui-meter-hot, #e5484d)); }
.strip-level.hot { box-shadow: 0 -2px 0 var(--ui-meter-hot, #e5484d); }
.strip .fader { flex: 1; min-height: 60px; }
.strip-db { font-size: 9px; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.strip-led, .slot-led { width: 12px; height: 12px; flex: none; padding: 0; border: 1px solid var(--ui-edge, #0b0c0e); border-radius: 50%; background: var(--ui-led-off, #213326); cursor: pointer; }
.strip-led.on, .slot-led.on { background: var(--ui-led-on, #63e07f); box-shadow: 0 0 6px var(--ui-led-glow, #63e07f88); }
.strip-led-gap, .slot-led-gap { width: 12px; height: 12px; flex: none; }
.strip-fx { min-height: 12px; font: 600 9px var(--sans); color: var(--ui-ink-dim, #8fd4a5); }
.mixer-rack { flex: none; width: 280px; display: flex; flex-direction: column; border-left: 1px solid var(--ui-hair, #000); background: var(--ui-toolbar, #1d1f23); overflow-y: auto; }
.rack-head { position: sticky; top: 0; z-index: 1; background: var(--ui-toolbar, #1d1f23); padding: 6px 10px; border-bottom: 1px solid var(--ui-hair, #000); font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rack-head strong { color: var(--text); }
.slots { list-style: none; margin: 0; padding: 4px; display: grid; gap: 3px; }
.slot { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 5px; border: 1px solid var(--ui-edge, #0b0c0e); border-radius: 3px; background: var(--ui-slot, #26292e); }
.slot.filled { background: linear-gradient(var(--ui-slot-filled, #323740), var(--ui-slot-filled, #2a2e35)); }
.slot.off .slot-name { color: var(--text-dim); text-decoration: line-through; }
.slot-menu { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid var(--ui-edge, #0b0c0e); border-radius: 2px; background: var(--ui-btn, #3a3e46); color: var(--text); cursor: pointer; }
.slot-menu .icon { width: 10px; height: 10px; fill: currentColor; }
.slot-name { flex: 1; min-width: 0; height: 22px; padding: 0 6px; border: 0; border-radius: 2px; background: transparent; color: var(--text); text-align: left; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot:not(.filled) .slot-name { color: var(--ui-ink-ghost, #6d727b); font-weight: 400; font-style: italic; }
.slot-name:hover { background: var(--panel-3); }
.knob-gap { width: 20px; flex: none; }
.rack-hint { margin: 6px 10px 10px; font-size: 10px; color: var(--text-dim); }

/* Effect windows (like FL Studio's plugin windows). */
.plugin-window { position: fixed; z-index: 54; min-width: 260px; max-width: calc(100vw - 16px); background: var(--ui-window, #24272c); border: 1px solid var(--ui-pop-edge, #0b0c0e); border-radius: 6px; box-shadow: 0 18px 50px var(--ui-shadow, rgba(0, 0, 0, 0.6)); }
.plugin-title { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 9px; border-bottom: 1px solid var(--ui-hair, #000); border-radius: 6px 6px 0 0; background: linear-gradient(var(--ui-titlebar, #3a3e46), var(--ui-titlebar, #2c2f35)); cursor: move; user-select: none; touch-action: none; }
.plugin-name { font-weight: 800; }
.plugin-channel { flex: 1; color: var(--text-dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plugin-close { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--text-dim); cursor: pointer; }
.plugin-close:hover { background: var(--panel-3); color: var(--text); }
.plugin-close .icon { width: 11px; height: 11px; fill: currentColor; }
.plugin-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.plugin-body .device-section { border: 0; background: transparent; padding: 0; }
.eq-curve { width: 100%; height: 96px; background: var(--ui-graph, #141518); border: 1px solid var(--ui-well-edge, #000); border-radius: 3px; }
.eq-editor { width: 100%; min-width: 0; padding: 0 12px; box-sizing: border-box; }
.eq-plot { position: relative; height: 180px; }
.eq-plot .eq-curve { display: block; height: 180px; }
.eq-node { position: absolute; z-index: 1; width: 24px; height: 24px; padding: 0; border: 2px solid var(--eq-band-color); border-radius: 50%; background: var(--ui-field, #20242a); color: var(--eq-band-color); transform: translate(-50%, -50%); font: 700 10px/1 var(--sans); cursor: grab; touch-action: none; user-select: none; }
.eq-node:hover, .eq-node:focus-visible, .eq-node.selected { background: var(--eq-band-color); color: var(--ui-on-ink, #11151b); outline: 2px solid var(--ui-band-ring, #11151b); outline-offset: 1px; }
.eq-editor.active .eq-node.selected { cursor: grabbing; }
.eq-graph-toolbar { display: flex; align-items: center; gap: 10px; min-height: 28px; padding-top: 6px; }
.eq-readout { flex: 1; min-width: 0; font-size: 10px; color: var(--text-dim); }
.eq-graph-toolbar button { font-size: 11px; }
.eq-graph-toolbar button:disabled { opacity: .35; cursor: default; }
.eq-graph-hint { margin: 2px 0 0; max-width: 580px; font-size: 10px; color: var(--text-dim); }
.gr-meter { position: relative; display: flex; align-items: center; height: 16px; border-radius: 2px; background: var(--ui-graph, #141518); border: 1px solid var(--ui-well-edge, #000); overflow: hidden; }
.gr-fill { position: absolute; top: 0; right: 0; bottom: 0; width: 0; background: var(--ui-meter-warn, #e8a33d); }
.gr-label { position: relative; padding-left: 6px; font-size: 9px; color: var(--text-dim); }

/* Compressor monitoring: measured envelopes, gain history and transfer curves. */
.compressor-window { width: 760px; }
.compressor-window .plugin-body { max-height: calc(100vh - 62px); overflow-y: auto; overscroll-behavior: contain; }
.compressor-view { min-width: 0; padding: 10px 10px 8px; border: 1px solid var(--ui-well-edge, #34414b); border-radius: 6px; background: linear-gradient(130deg, var(--ui-cmp, #17232c), var(--ui-cmp, #131b22) 55%, var(--ui-cmp, #1c252e)); box-shadow: inset 0 1px var(--ui-glow, #ffffff07); }
.compression-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; }
.compression-heading { font-size: 11px; font-weight: 700; color: var(--ui-ink, #d8e5ed); }
.compression-tabs { display: flex; gap: 3px; padding: 3px; background: var(--ui-well, #0b1319); border-radius: 5px; }
.compression-tabs button { --band-color: var(--ui-cmp-output, #6fe0ce); min-height: 24px; padding: 4px 9px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--ui-ink-soft, #9eafbd); font-size: 10px; cursor: pointer; }
.compression-tabs button[aria-selected=true] { color: var(--band-color); background: var(--ui-field, #26333e); border-color: var(--ui-edge, #40505c); box-shadow: inset 0 -2px var(--band-color); }
.compression-tabs button:focus-visible { outline: 2px solid var(--band-color); outline-offset: 2px; }
.compression-status { display: flex; align-items: center; gap: 5px; color: var(--ui-ink-dim, #8d9da9); font-size: 10px; }
.compression-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ui-stone, #64717a); }
.compression-status.live { color: var(--ui-cmp-live, #a7d8ce); }
.compression-status.live::before { background: var(--ui-cmp-output, #6fe0ce); box-shadow: 0 0 7px var(--ui-glow, #6fe0ce77); }
.compression-plots { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 10px; }
.compression-plot { min-width: 0; }
.compression-caption { display: flex; justify-content: space-between; gap: 7px; padding: 0 2px 6px; font-size: 9px; color: var(--ui-ink-dim, #8d9da9); }
.compression-caption strong { color: var(--ui-ink-soft, #bccbd5); font-weight: 500; }
.compression-plot canvas { display: block; width: 100%; height: 172px; border: 1px solid var(--ui-well-edge, #35424d); border-radius: 4px; }
.compression-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 8px 0 5px; }
.compression-legend { display: flex; gap: 12px; font-size: 10px; color: var(--ui-ink-soft, #9eafbd); }
.compression-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.compression-legend > span::before { content: ""; width: 12px; height: 3px; border-radius: 2px; }
.legend-input::before { background: var(--ui-stone, #81929e); }
.legend-output::before { background: var(--ui-cmp-output, #6fe0ce); }
.legend-reduction::before { background: var(--ui-cmp-reduction, #f0b66a); }
.compression-readout { font-size: 10px; color: var(--ui-ink, #cee1ea); font-variant-numeric: tabular-nums; }
.compression-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; font-size: 9px; color: var(--ui-ink-dim, #83939f); }
.compression-mix { white-space: nowrap; }
.compressor-view.bypassed .compression-plots { opacity: .45; }
.compressor-window .effect-multiband { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.compressor-window .effect-multiband .device-section { padding: 8px; border: 1px solid var(--ui-well-edge, #3b424b); border-radius: 4px; background: var(--ui-box, #1d2228); min-width: 0; }
.compressor-window .effect-multiband .device-section h4 { margin-bottom: 7px; }
.compressor-window .effect-multiband .section-crossovers { grid-column: span 2; order: 0; }
.compressor-window .effect-multiband .section-output { order: 0; }
.compressor-window .effect-multiband .section-low { --accent: var(--ui-band-low, #e6af6d); border-top-color: var(--ui-band-low, #e6af6d); order: 1; }
.compressor-window .effect-multiband .section-mid { --accent: var(--ui-band-mid, #76d6ba); border-top-color: var(--ui-band-mid, #76d6ba); order: 1; }
.compressor-window .effect-multiband .section-high { --accent: var(--ui-band-high, #92b6f8); border-top-color: var(--ui-band-high, #92b6f8); order: 1; }
.compressor-window .effect-multiband :is(.section-low, .section-mid, .section-high) .device-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 4px; justify-items: center; }
.compressor-window .effect-compressor .device-controls { justify-content: center; gap: 12px; }
.compressor-window .knob { width: 56px; max-width: 100%; }
.compressor-window .effect-lfo { border-top: 1px solid var(--ui-well-edge, #3b424b); padding-top: 9px; }
@media (max-width: 600px) {
  .compression-plots { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 6px; }
  .compression-plot canvas { height: 145px; }
  .compression-caption { font-size: 8px; }
  .compression-caption > span { display: none; }
  .compression-tabs button { padding: 4px 6px; }
  .compressor-window .knob-label { font-size: 8px; }
  .compressor-window .effect-multiband { grid-template-columns: minmax(0, 1fr); }
  .compressor-window .effect-multiband .section-crossovers { grid-column: auto; }
  .compressor-window .effect-multiband :is(.section-low, .section-mid, .section-high) .device-controls { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Instrument panels. */
.instrument-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.instrument-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--ui-toolbar, #1d2023); flex: none; overflow-x: auto; scrollbar-width: none; }
.instrument-head > * { flex: none; }
.instrument-head .spacer { flex: 1 0 6px; }
.instrument-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.instrument-hint .icon { width: 14px; height: 14px; fill: currentColor; }
.device-brand { font: 900 13px/1 var(--sans); letter-spacing: .14em; color: var(--ui-synth, #62e0d0); text-shadow: 0 0 10px var(--ui-glow, #62e0d066); }
.device-brand b { color: var(--text); margin-left: 3px; }
.device-brand.drums { color: var(--ui-drums, #ff9f5a); text-shadow: 0 0 10px var(--ui-glow, #ff9f5a55); }
.instrument-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.synth-panel { --accent: var(--ui-synth, #62e0d0); }
.synth-panel .device-section { background: linear-gradient(var(--ui-synth-section, #20252b), var(--ui-synth-section, #1a1e23)); border-color: var(--ui-well-edge, #0c1013); }
.synth-panel :is(.section-env1, .section-env2) { width: 280px; max-width: 100%; }
.synth-envelope { margin: 0 0 9px; border: 1px solid var(--ui-well-edge, #314047); border-radius: 4px; background: var(--ui-graph, #10171b); --envelope-color: var(--ui-synth, #62e0d0); }
.synth-envelope.env2 { --envelope-color: var(--ui-env2, #84b8fa); }
.synth-envelope figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px 0; color: var(--ui-ink-dim, #a5bbc3); font-size: 10px; }
.envelope-kind { color: var(--envelope-color); font: 800 10px var(--sans); letter-spacing: .12em; }
.envelope-chart { display: block; width: 100%; height: auto; font: 11px var(--sans); font-variant-numeric: tabular-nums; fill: var(--ui-ink-dim, #99aeb8); }
.envelope-grid { stroke: var(--ui-graph-grid, #34444e); stroke-width: .7; }
.envelope-fill { fill: var(--envelope-color); opacity: .09; }
.envelope-line { stroke: var(--envelope-color); stroke-width: 2; fill: none; stroke-linejoin: round; }
.envelope-note-off { stroke: var(--ui-graph-mark, #c3cdd3); stroke-width: 1; stroke-dasharray: 3 3; opacity: .65; }
.wave-view { display: block; width: 100%; max-width: 220px; height: 64px; margin-bottom: 6px; background: var(--ui-graph, #0d1114); border: 1px solid var(--ui-well-edge, #000); border-radius: 3px; }
.drum-panel { --accent: var(--ui-drums, #ff9f5a); }
.drum-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr); gap: 10px; padding: 8px; overflow: auto; }
.drum-pads { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pad { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; height: 54px; padding: 6px; border: 1px solid var(--ui-edge, #0b0c0e); border-radius: 5px; background: linear-gradient(var(--ui-btn, #3a3d44), var(--ui-btn, #2b2e34)); color: var(--text); cursor: pointer; text-align: left; touch-action: none; user-select: none; }
.pad:hover { background: linear-gradient(var(--ui-btn-hover, #444851), var(--ui-btn-hover, #33363d)); }
.pad.selected { box-shadow: 0 0 0 2px var(--accent); }
.pad.hit { background: linear-gradient(var(--ui-lit, #ffb37a), var(--ui-lit, #ff9f5a)); color: var(--ui-ink, #2a1606); }
.pad-short { font: 800 10px var(--sans); letter-spacing: .06em; color: var(--accent); }
.pad.hit .pad-short { color: inherit; }
.pad-name { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pad-editor { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pad-editor-name { min-width: 90px; font-weight: 700; }
.pad-editor .device-section { border: 0; background: transparent; padding: 0; }
.drum-loops { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--ui-section, rgba(0, 0, 0, 0.18)); }
.loops-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.loop-list { list-style: none; margin: 0; padding: 4px; overflow: auto; }
.loop-item { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 3px; }
.loop-item:hover { background: var(--panel-3); }
.loop-name { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loop-meta { font-size: 10px; color: var(--text-dim); white-space: nowrap; }

/* Browser (side panel). */
.browser { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel-tabs { display: flex; gap: 2px; padding: 6px 36px 0 6px; border-bottom: 1px solid var(--line); flex: none; }
.panel-tab { height: 28px; padding: 0 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; background: transparent; color: var(--text-dim); font-weight: 600; cursor: pointer; }
.panel-tab.on { background: var(--ui-field, #18191c); border-color: var(--line); color: var(--text); }
.browser-search { margin: 6px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--ui-field, #18191c); flex: none; }
.browser-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 4px 10px; }
.browser-group ul { list-style: none; margin: 0 0 4px; padding: 0; }
.group-head { display: flex; align-items: center; gap: 6px; width: 100%; height: 26px; padding: 0 4px; border: 0; background: transparent; color: var(--text); font-weight: 700; font-size: 11px; cursor: pointer; text-align: left; }
.group-head .icon { width: 10px; height: 10px; fill: var(--text-dim); transform: rotate(-90deg); transition: transform .12s; }
.browser-group.open .group-head .icon { transform: none; }
.group-count { margin-left: auto; font: 10px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-dim); }
.browser-item { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 3px; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.browser-item:hover { background: var(--panel-3); }
.browser-item > .icon { width: 13px; height: 13px; flex: none; fill: var(--text-dim); }
.item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-btn { display: grid; place-items: center; width: 22px; height: 22px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--ui-btn, #2a2d33); color: var(--text); cursor: pointer; opacity: .7; }
.browser-item:hover .item-btn, .item-btn:focus-visible { opacity: 1; }
.item-btn .icon { width: 10px; height: 10px; fill: currentColor; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 70; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--accent); border-radius: 4px; background: var(--ui-pop, #2b2e34); box-shadow: 0 8px 24px var(--ui-shadow, #0008); pointer-events: none; font-weight: 600; }
.drag-ghost .icon { width: 13px; height: 13px; fill: var(--accent); }
body.browser-dragging, body.browser-dragging * { cursor: grabbing !important; }
.browser-target.track-row .lane, .browser-target.add-row .lane { background-color: color-mix(in srgb, var(--accent) 14%, var(--lane)); box-shadow: inset 0 0 0 1px var(--accent); }
.browser-target.track-row .track-header { box-shadow: inset 0 0 0 1px var(--accent); }
.browser-target.strip, .browser-target.mixer-rack { box-shadow: inset 0 0 0 2px var(--accent); }

/* Notepad. */
.notepad { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px; gap: 6px; }
.notepad-head { display: flex; align-items: baseline; gap: 8px; padding-right: 30px; }
.notepad-status { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notepad-text { flex: 1; min-height: 0; width: 100%; resize: none; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--ui-field, #16171a); color: var(--text); font: 13px/1.55 var(--mono); outline: none; tab-size: 4; }
.notepad-text:focus { border-color: var(--accent); }

/* Comments. */
.popover.comments { width: 340px; }
.comment-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.comment { padding: 7px 4px; border-bottom: 1px solid var(--ui-sep, #3a3e46); }
.comment.highlight { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.comment.empty { border: 0; text-align: center; font-size: 11px; }
.comment-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.comment-meta .muted { font-size: 10px; }
.comment-time { padding: 0 4px; border: 1px solid var(--line); border-radius: 2px; background: var(--ui-field, #1b1d21); color: var(--accent); font-size: 10px; cursor: pointer; }
.comment-resolve { margin-left: auto; width: 22px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--text-dim); cursor: pointer; }
.comment-resolve:hover { background: var(--ui-stone, #2f4a3a); color: var(--ui-ink, #bff0cf); }
.comment-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.comment-compose { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.comment-compose .btn { align-self: flex-end; }
.comment-input { width: 100%; resize: vertical; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--ui-field, #18191c); color: var(--text); font: inherit; }

/* Tuner. */
.popover.tuner { width: 330px; }
.tuner-display { text-align: center; padding: 4px 0 8px; }
.tuner-main { display: inline-flex; align-items: flex-start; gap: 2px; }
.tuner-note { font: 850 52px/1 var(--sans); letter-spacing: -.04em; color: var(--text); }
.tuner-octave { margin-top: 6px; font: 600 16px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-dim); }
.tuner-cents { font: 600 14px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-dim); min-height: 18px; }
.tuner-freq { font-size: 10px; font-variant-numeric: tabular-nums; color: var(--text-dim); min-height: 14px; }
.popover.tuner.in-tune .tuner-note, .popover.tuner.in-tune .tuner-cents { color: var(--ui-ok-text, #63e07f); }
.tuner-scale { position: relative; height: 34px; margin: 4px 6px 10px; border-radius: 4px; background: linear-gradient(to right, var(--ui-tuner-off, #3b2020), var(--ui-tuner-mid, #2b2e34) 40%, var(--ui-tuner-on, #24402c) 47%, var(--ui-tuner-on, #24402c) 53%, var(--ui-tuner-mid, #2b2e34) 60%, var(--ui-tuner-off, #3b2020)); border: 1px solid var(--ui-well-edge, #000); }
.tuner-tick { position: absolute; bottom: 2px; transform: translateX(-50%); font: 9px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-dim); }
.tuner-tick::before { content: ""; position: absolute; left: 50%; bottom: 14px; width: 1px; height: 8px; background: var(--ui-tick, #6b7078); }
.tuner-tick.zero::before { height: 16px; background: var(--ui-lit, #63e07f); }
.tuner-needle { position: absolute; top: -3px; bottom: -3px; left: 50%; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ui-marker, #f4f4f4); box-shadow: 0 0 8px var(--ui-glow, #fff8); transition: left .08s linear; }
.popover.tuner.in-tune .tuner-needle { background: var(--ui-lit, #63e07f); box-shadow: 0 0 10px var(--ui-glow, #63e07f); }
.tuner-strings { display: flex; justify-content: center; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.tuner-string { min-width: 38px; height: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--ui-field, #1b1d21); color: var(--text); font: 600 12px var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.tuner-string.near { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--ui-field, #1b1d21)); }
.tuner-options { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tuner-options .prop > span:first-child { min-width: 0; }
.tuner-a4 { width: 56px !important; }
.tuner-hint { margin: 6px 0 0; font-size: 10px; }
.popover.latency-panel { width: 340px; }
.latency-panel p { margin: 0 0 6px; font-size: 12px; line-height: 1.4; }
.latency-panel p.muted { font-size: 11px; }
.latency-actions { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.latency-actions .latency-status { margin: 0; font-size: 11px; color: var(--text-dim); }
.latency-ms { width: 64px; }
.latency-panel .latency-details { margin: 6px 0 0; font-size: 10px; }

/* Narrow screens. */
@media (max-width: 760px) {
  .side-panel { position: fixed; top: 50px; right: 0; bottom: 0; z-index: 45; width: min(320px, 88vw); box-shadow: -10px 0 30px var(--ui-shadow, #0008); }
  .mixer-rack { width: 220px; }
  .drum-body { grid-template-columns: 1fr; }
  .presence .avatar:nth-child(n + 4) { display: none; }
}

/* Phones turned sideways: every row of pixels counts. */
@media (orientation: landscape) and (max-height: 520px) {
  .daw .topbar { height: 40px; gap: 6px; }
  .daw .topbar .brand-wordmark, .daw .drop-name, .daw .author-input, .daw .zoom, .daw .lcd-sub, .daw .field-static { display: none; }
  .daw .lcd { min-width: 70px; }
  .daw .tbtn { min-width: 34px; height: 30px; }
  :root { --track-h: 56px; --ruler-h: 30px; --header-w: 190px; }
  .daw-footer { display: none; }
  .dock { height: calc(100vh - 40px) !important; height: calc(100dvh - 40px) !important; }
  .dock-head { height: 32px; }
  .pr-body { grid-template-rows: 22px minmax(0, 1fr) 56px; }
  .side-panel { position: fixed; top: 40px; right: 0; bottom: 0; z-index: 45; width: min(320px, 60vw); box-shadow: -10px 0 30px var(--ui-shadow, #0008); }
  .popover, .plugin-window { max-height: calc(100vh - 16px); overflow-y: auto; }
}
@media (pointer: coarse) {
  .flag { min-width: 26px; height: 22px; }
  .knob.xs { width: 24px; }
  .knob.xs .knob-dial { width: 23px; height: 23px; }
  .slot { height: 34px; }
  .clip-edge { width: 12px; }
}
@supports (padding: env(safe-area-inset-left)) {
  body.daw-page { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

/* ── Share dialog, listen-only links, copies, dragging tracks ─────────────── */

.share-pop { position: fixed; z-index: 60; width: min(400px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; padding: 12px 14px; background: var(--ui-pop, #2b2e34); border: 1px solid var(--ui-pop-edge, #0b0c0e); border-radius: 6px; box-shadow: 0 14px 40px var(--ui-shadow, rgba(0, 0, 0, 0.55)); }
.share-title { font-weight: 800; font-size: 13px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-section { padding: 8px 0; border-top: 1px solid var(--line-soft); }
.share-section:first-of-type { border-top: 0; }
.share-section h3 { margin: 0 0 3px; font-size: 12px; }
.share-section p { margin: 0 0 8px; font-size: 11px; }
.share-link { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.share-url { flex: 1; min-width: 0; height: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--ui-field, #0e0f11); color: var(--text); font-family: var(--mono); font-size: 11px; }
.share-link .text-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; text-decoration: none; color: var(--text); }
.share-link .text-btn .icon { width: 12px; height: 12px; fill: currentColor; }
.socials { display: flex; flex-wrap: wrap; gap: 6px; }
.social { height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-3); color: var(--text); font-size: 11px; font-weight: 600; cursor: pointer; }
.social:hover { background: var(--ui-btn-hover, #3a3d45); border-color: var(--accent); }
.social.more { background: none; color: var(--text-dim); }

.listen-bar, .copy-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--ui-info, #1d2a3a); color: var(--ui-ink, #bcd6f5); }
.listen-bar .text-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--ui-ink, #fff); text-decoration: none; font-weight: 600; }
.listen-bar .icon { width: 12px; height: 12px; fill: currentColor; }
/* A listen-only link plays and copies; nothing that would change the Drop shows. */
.listen-only .transport .rec, .listen-only .edit-tools, .listen-only .author-input, .listen-only .notepad-btn,
.listen-only .add-row, .listen-only .flag.arm, .listen-only .clip-edge, .listen-only .fade-handle, .listen-only .comment-badge, .listen-only .comment-marker,
.listen-only .track-header .more, .listen-only .flag.fx, .listen-only .flag.inst, .listen-only .mixer-btn { display: none !important; }
.listen-only .track-header .knob, .listen-only .field-btn { pointer-events: none; opacity: 0.6; }

.track-kind[draggable="true"] { cursor: grab; }
.add-row.drop-target .add-cell { outline: 2px dashed var(--accent); outline-offset: -3px; }

/* ── Export ─────────────────────────────────────────────────────────────── */

.export-panel { left: 50%; top: 64px; transform: translateX(-50%); width: min(460px, calc(100vw - 16px)); max-width: none; max-height: calc(100vh - 80px); overflow: auto; }
.export-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.export-label { width: 84px; flex: none; font-size: 11px; color: var(--text-dim); }
.export-about { margin: 2px 0 6px 94px; font-size: 11px; }
.export-credit { margin: 6px 0 0; font-size: 10px; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.segmented button { height: 24px; padding: 0 9px; border: 0; border-right: 1px solid var(--line); background: var(--panel-3); color: var(--text-dim); font-size: 11px; cursor: pointer; }
.segmented button:last-child { border-right: 0; }
.segmented button.on { background: var(--ui-ink-fill, #3d79c9); color: var(--ui-on-ink, #fff); }
.export-progress { margin-top: 10px; }
.export-bar { height: 6px; border-radius: 3px; background: var(--ui-trough, #0e0f11); overflow: hidden; margin-bottom: 4px; }
.export-bar > div { height: 100%; width: 0; background: var(--play); transition: width 0.2s; }
.export-go .icon { width: 12px; height: 12px; fill: currentColor; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 520px) { .export-about { margin-left: 0; } .export-label { width: 70px; } }

/* ── Audio quantize (editor dock) ────────────────────────────────────────── */

.audio-editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.aq-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.aq-slider { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); }
.aq-slider input { width: 110px; }
.aq-slider .mono { width: 34px; color: var(--text); font-family: var(--mono); }
.aq-toolbar .btn.ab.on { border-color: var(--accent); color: var(--accent); }
.aq-status { font-size: 11px; }
.aq-shift-amount { width: 68px; }
.aq-shift-label, .aq-selection { font-size: 11px; color: var(--text-dim); }
.aq-marker-toolbar { gap: 8px; }
.aq-scroll { position: relative; flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; background: var(--lane); }
.aq-sizer { height: 1px; }
.aq-canvas { position: absolute; top: 0; cursor: crosshair; touch-action: none; }
.aq-hint { padding: 3px 10px; font-size: 10px; border-top: 1px solid var(--line); }
.clip-badge { position: absolute; top: 2px; right: 12px; padding: 0 4px; border-radius: 3px; background: var(--ui-lit, rgba(255, 200, 120, 0.85)); color: var(--ui-ink, #1a1205); font-size: 9px; font-weight: 700; pointer-events: none; }

/* Laptop widths: the Drop's top bar keeps every control within the window where it can. The wordmark goes first
   (the logo stays), then fixed labels and the zoom buttons, then Publish's word, then some air. Whatever is still
   too wide scrolls beneath Publish and Share (.top-actions). */
@media (max-width: 1700px) and (min-width: 761px) {
  .daw .topbar { gap: 8px; }
  .daw .topbar .brand-wordmark { display: none; }
}
@media (max-width: 1560px) and (min-width: 761px) {
  .daw .field-static, .daw .zoom { display: none; } /* ⌘/Ctrl + scroll still zooms */
}
@media (max-width: 1500px) and (min-width: 761px) {
  .daw .publish-btn .publish-label { display: none; }
  .daw .publish-btn { padding: 0 10px; }
}
@media (max-width: 1400px) and (min-width: 761px) {
  .daw .topbar { gap: 5px; }
  .daw .mm-bars { width: 72px; }
}
@media (max-width: 1300px) and (min-width: 761px) {
  .daw .topbar { gap: 4px; overflow-x: auto; padding-left: 6px; }
  .daw .mm-bars { width: 56px; }
  .daw .mm-readouts { min-width: 52px; }
  .daw .view-tools { gap: 2px; }
  .daw .drop-name { padding-left: 8px; }
}

/* ── Inside an app's built-in browser (Instagram, Facebook, TikTok…) ───────── */

.inapp-banner { position: relative; z-index: 70; flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 44px 10px 14px; background: var(--ui-inapp, #2a1f3d); color: var(--ui-on-ink, #f0e8ff); border-bottom: 1px solid var(--ui-hair, #000); font-size: 13px; line-height: 1.4; }
.inapp-banner strong { display: block; color: var(--ui-on-ink, #fff); }
.inapp-text { flex: 1 1 260px; }
.inapp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.inapp-actions .btn { white-space: nowrap; }
.inapp-dismiss { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ui-on-ink, #f0e8ff); font-size: 22px; line-height: 1; cursor: pointer; }
.inapp-dismiss:hover, .inapp-dismiss:focus-visible { background: var(--ui-veil, rgba(255, 255, 255, 0.12)); }
.inapp-card .inapp-note { color: var(--text); }
.inapp-how { flex-basis: 100%; font-size: 12px; color: var(--ui-on-ink-soft, #d7c9f2); }
.inapp-sheet { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: var(--ui-scrim, rgba(0, 0, 0, 0.6)); }
.inapp-card { width: min(440px, 100%); padding: 18px 18px 14px; border-radius: 12px; background: var(--ui-pop, #2b2e34); border: 1px solid var(--ui-pop-edge, #0b0c0e); color: var(--text); box-shadow: 0 18px 50px var(--ui-shadow, rgba(0, 0, 0, 0.6)); }
.inapp-card h2 { margin: 0 0 8px; font-size: 17px; }
.inapp-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: var(--text-dim); }
.inapp-card .inapp-how { color: var(--text-dim); }
.inapp-close { margin-top: 12px; width: 100%; }

/* ── RiffDrop for iPhone (js/app-banner.js, the App Store badges) ─────────── */

/* Offered in the iPhone browsers that don't show Apple's Smart App Banner (Chrome, Firefox…), laid out like it. */
.app-banner { position: relative; z-index: 70; flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 4px; background: var(--panel); color: var(--text); border-bottom: 1px solid var(--line-soft); font-size: 13px; line-height: 1.35; }
.app-banner-close { flex: none; width: 36px; height: 36px; margin-right: -6px; border: 0; border-radius: 50%; background: transparent; color: var(--text-dim); font-size: 22px; line-height: 1; cursor: pointer; }
.app-banner-close:hover, .app-banner-close:focus-visible { background: var(--ui-hover-veil, rgba(255, 255, 255, 0.08)); color: var(--text); }
.app-banner-icon { flex: none; width: 48px; height: 48px; border-radius: 11px; }
.app-banner-text { flex: 1; min-width: 0; }
.app-banner-text strong { display: block; font-weight: 600; }
.app-banner-text span { color: var(--text-dim); font-size: 12px; }
.app-banner .btn { flex: none; height: 32px; padding: 0 16px; border-radius: 16px; }
@media (orientation: landscape) and (max-height: 520px) {
  .app-banner { padding-block: 4px; }
  .app-banner-icon { width: 36px; height: 36px; border-radius: 8px; }
}
/* The studio's question on an iPhone that can install it: a sheet at the bottom, like the in-app browser's. */
.app-prompt { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: var(--ui-scrim, rgba(0, 0, 0, 0.6)); }
.app-prompt-card { display: flex; flex-direction: column; gap: 10px; width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 18px; border-radius: 14px; background: var(--ui-pop, #2b2e34); border: 1px solid var(--ui-pop-edge, #0b0c0e); color: var(--text); box-shadow: 0 18px 50px var(--ui-shadow, rgba(0, 0, 0, 0.6)); }
.app-prompt-card:focus { outline: none; }
.app-prompt-app { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.app-prompt-card h2 { margin: 4px 0 0; font-size: 18px; line-height: 1.3; }
.app-prompt-card p { margin: 0 0 4px; font-size: 14px; line-height: 1.45; color: var(--text-dim); }
.app-prompt-card .btn { justify-content: center; width: 100%; height: 44px; border-radius: 10px; font-size: 15px; }
@media (orientation: landscape) and (max-height: 520px) {
  .app-prompt-app .app-banner-icon { width: 36px; height: 36px; border-radius: 8px; }
  .app-prompt-card .btn { height: 40px; }
}

/* Apple's badge, unaltered: 40px tall, with room around it. */
.app-store-badge { display: inline-block; flex: none; border-radius: 7px; line-height: 0; }
.app-store-badge img { display: block; width: auto; height: 40px; }
.app-store-badge:focus-visible { outline: 2px solid var(--ui-focus, var(--lamp)); outline-offset: 3px; }
.iphone-app { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 28px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.app-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; border: 1px solid var(--line-soft); border-radius: 12px; padding: 24px 32px; margin-top: 40px; background: var(--panel); }
.app-card h2 { font-size: 21px; font-weight: 800; letter-spacing: -.025em; margin: 4px 0 10px; }
.app-card p { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin: 0; max-width: 46em; }
.app-card .eyebrow { color: var(--accent); font-size: 10px; }
.app-card + .support-card { margin-top: 16px; }
@media (max-width: 700px) {
  .app-card { align-items: flex-start; flex-direction: column; gap: 16px; padding: 24px; }
  /* A phone's studio footer has no room to spare; the banner above (Apple's in Safari) offers the app. */
  .daw-footer [data-app-store] { display: none; }
}

/* ── A Drop on this device (the landing page) ────────────────────────────── */

.local-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; background: var(--ui-local, #1f2b22); color: var(--ui-on-ink-soft, #cfe8d3); }
.local-bar strong { color: var(--ui-on-ink, #fff); }
.local-actions { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.local-actions .text-btn { color: var(--ui-on-ink, #fff); font-weight: 600; text-decoration: none; }
.local-actions .text-btn:hover { text-decoration: underline; }
.local-drop .copy-btn, .local-drop .presence { display: none; }
/* Phones and tablets: no keyboard to press; a phone also keeps it to one short line. */
@media (pointer: coarse) { .local-bar .local-keys { display: none; } }
@media (max-height: 500px), (max-width: 600px) {
  .local-bar { padding-top: 6px; padding-bottom: 6px; }
  .local-bar .local-keys, .local-bar .local-more { display: none; }
}
.device-drop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 16px; border-radius: 8px; }
.device-drop[hidden] { display: none; }
.device-drop-actions { display: inline-flex; align-items: center; gap: 12px; }
.daw-footer .daw-about { color: var(--text-dim); text-decoration: none; font-size: 11px; }
.daw-footer .daw-about:hover { color: var(--text); }

/* The way to the community from the studio: only where there is room for it. */
@media (max-width: 900px), (pointer: coarse) {
  .local-discover, .daw-footer .daw-discover { display: none; }
}
