/* ONAC Sound Studio. Colours follow the ONAC site tokens; the --wave-* and
   --ruler-* tokens are read by the canvas drawing code. */

:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --border: #e2e4f0;
  --text: #12172a;
  --muted: #5b6685;
  --accent: #7858c3;
  --accent-dark: #5c3fa0;
  --accent-soft: #f1ecfb;
  --accent-line: #d9cdf2;
  --hover: #eef0f8;
  --danger: #d6362a;
  --ok: #0a9c58;
  --shadow: 0 1px 2px rgba(18, 23, 42, 0.05), 0 10px 30px rgba(18, 23, 42, 0.12);
  --radius: 10px;

  --wave-panel: #f5f6fb;
  --wave-lane: #ffffff;
  --wave-empty: #eceef6;
  --wave-sel: #e6ddf8;
  --wave-fill: #7858c3;
  --wave-rms: #4a2f8c;
  --wave-clip: #d6362a;
  --wave-grid: #e4e6f0;
  --wave-cursor: #12172a;
  --wave-play: #0a9c58;
  --wave-hover: rgba(18, 23, 42, 0.18);
  --ruler-bg: #f5f6fb;
  --ruler-sel: #e2d8f6;
  --ruler-text: #5b6685;
  --ruler-tick: #a3a9c2;
  --clip-head: #e3dbf6;
  --clip-head-text: #3d2a78;
  --clip-head-active: #7858c3;
  --clip-edge: #b9a8e4;
  --wave-rec: #d6362a;
  --mute-veil: rgba(245, 246, 251, 0.35);

  --meter-ok: #0a9c58;
  --meter-warn: #c77700;
  --meter-hot: #d6362a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11131c; --surface: #1a1d29; --surface-2: #161925; --border: #2c3044;
    --text: #e8eaf3; --muted: #9aa2bf; --accent: #9d84e0; --accent-dark: #b9a6ee;
    --accent-soft: #2a2440; --accent-line: #4a3f73; --hover: #252a3b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.45);
    --wave-panel: #161925; --wave-lane: #1d2030; --wave-empty: #151722; --wave-sel: #352c55;
    --wave-fill: #a48cf0; --wave-rms: #ddd3ff; --wave-clip: #ff5a4d; --wave-grid: #2a2e42;
    --wave-cursor: #e8eaf3; --wave-play: #36c785; --wave-hover: rgba(232, 234, 243, 0.22);
    --ruler-bg: #161925; --ruler-sel: #30284d; --ruler-text: #9aa2bf; --ruler-tick: #4c5270;
    --clip-head: #2f2850; --clip-head-text: #d6cbff; --clip-head-active: #9d84e0; --clip-edge: #5a4a92;
    --wave-rec: #ff5a4d; --mute-veil: rgba(17, 19, 28, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11131c; --surface: #1a1d29; --surface-2: #161925; --border: #2c3044;
  --text: #e8eaf3; --muted: #9aa2bf; --accent: #9d84e0; --accent-dark: #b9a6ee;
  --accent-soft: #2a2440; --accent-line: #4a3f73; --hover: #252a3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.45);
  --wave-panel: #161925; --wave-lane: #1d2030; --wave-empty: #151722; --wave-sel: #352c55;
  --wave-fill: #a48cf0; --wave-rms: #ddd3ff; --wave-clip: #ff5a4d; --wave-grid: #2a2e42;
  --wave-cursor: #e8eaf3; --wave-play: #36c785; --wave-hover: rgba(232, 234, 243, 0.22);
  --ruler-bg: #161925; --ruler-sel: #30284d; --ruler-text: #9aa2bf; --ruler-tick: #4c5270;
    --clip-head: #2f2850; --clip-head-text: #d6cbff; --clip-head-active: #9d84e0; --clip-edge: #5a4a92;
    --wave-rec: #ff5a4d; --mute-veil: rgba(17, 19, 28, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.app {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ---------------------------------------------------------------- menu bar */

.menubar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  height: 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.logo { height: 18px; width: auto; flex: none; }
.logo-link { display: inline-flex; flex: none; }
.beta-tag { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--accent-line); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; cursor: help; }
:root[data-theme="dark"] .logo { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { filter: invert(1) hue-rotate(180deg); } }

.menus { display: flex; gap: 2px; min-width: 0; }
.menu { position: relative; }
.menu-btn {
  border: 0; background: none; padding: 6px 10px; border-radius: 6px; cursor: default;
  font-weight: 500;
}
.menu-btn:hover, .menu.open .menu-btn { background: var(--hover); }
.menu-list {
  display: none;
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
  min-width: 260px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu.open .menu-list { display: block; }
.menu-item {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 6px;
  width: 100%; border: 0; background: none; text-align: left;
  padding: 6px 8px; border-radius: 6px; cursor: default;
}
.menu-item:hover:not(:disabled) { background: var(--accent-soft); }
.menu-item:disabled { color: var(--muted); opacity: 0.55; }
.mi-key { color: var(--muted); font-size: 12px; padding-left: 18px; white-space: nowrap; }
.mi-check { color: var(--accent); font-weight: 700; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }

.doc-title {
  margin-left: auto; color: var(--muted); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.doc-title b { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- toolbars */

.toolbars {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tb {
  display: flex; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
}
.tb-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: var(--border); }
.tbtn {
  display: grid; place-items: center;
  width: 32px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--text);
  cursor: pointer;
}
.tbtn svg { width: 18px; height: 18px; }
.tbtn:hover:not(:disabled) { background: var(--hover); }
.tbtn:disabled { color: var(--muted); opacity: 0.4; cursor: default; }
.tbtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tbtn.play { color: var(--ok); }
.tbtn.rec { color: var(--danger); }
.tbtn.play:disabled, .tbtn.rec:disabled { color: var(--muted); }
.tbtn.rec[aria-pressed="true"] { background: var(--danger); color: #fff; box-shadow: none; }
.meter-rec {
  display: flex; align-items: center; gap: 6px; padding: 2px 6px; margin: 0;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.meter-rec:hover { background: var(--hover); }
.meter-rec svg { width: 16px; height: 16px; flex: none; }
.meter-rec[aria-pressed="true"] { border-color: var(--danger); color: var(--danger); }
.meter-rec .meter-bar i {
  background: linear-gradient(90deg, #d6362a 0 80%, #c77700 80% 93%, #ff2a1a 93%);
  background-size: 180px 100%;
}
.tbtn:focus-visible, .menu-btn:focus-visible, .menu-item:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.tb-meter { gap: 12px; padding: 3px 10px; }
.tb-speed { gap: 10px; padding: 3px 10px; font-size: 12.5px; }
.speed { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.speed svg { width: 18px; height: 18px; flex: none; }
.speed input { width: 100px; accent-color: var(--accent); }
.speed output { min-width: 40px; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 500; }
.keep-pitch { display: flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.keep-pitch input { accent-color: var(--accent); margin: 0; }
.vol { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.vol svg { width: 18px; height: 18px; }
.vol input { width: 90px; accent-color: var(--accent); }
.meter { display: grid; gap: 3px; width: 180px; }
.meter-row { display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.meter-bar { position: relative; height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.meter-bar i {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, var(--meter-ok) 0 80%, var(--meter-warn) 80% 93%, var(--meter-hot) 93%);
  background-size: 180px 100%;
}

/* --------------------------------------------------------------- workspace */

.workspace { position: relative; min-height: 0; display: flex; }
.tracks {
  --panel-w: 200px;
  --sbw: 0px;
  width: 100%; height: 100%; min-width: 0; min-height: 0; position: relative;
  display: grid;
  grid-template-columns: var(--panel-w) minmax(0, 1fr);
  grid-template-rows: 28px minmax(0, 1fr) 14px auto;
  --pane-h: 0px;
}
.ruler-corner {
  display: flex; align-items: center; padding: 0 12px;
  font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  background: var(--ruler-bg);
}
.ruler-wrap { position: relative; margin-right: var(--sbw); cursor: pointer; background: var(--ruler-bg); }
.ruler-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.area {
  grid-column: 1 / -1;
  position: relative;
  overflow-y: auto; overflow-x: hidden; min-height: 0;
  background: var(--wave-panel);
  touch-action: none;
}
.area-empty { padding: 28px 24px; color: var(--muted); text-align: center; }
#over {
  position: absolute; top: 0; left: var(--panel-w); right: var(--sbw);
  width: calc(100% - var(--panel-w) - var(--sbw)); height: calc(100% - 14px - var(--pane-h));
  pointer-events: none; z-index: 5;
}
.corner { background: var(--surface); border-right: 1px solid var(--border); border-top: 1px solid var(--border); }
.hscroll { position: relative; background: var(--surface-2); border-top: 1px solid var(--border); margin-right: var(--sbw); }

/* One row per track: control panel on the left, waveform canvas on the right. */
.trow {
  position: relative;
  display: grid; grid-template-columns: var(--panel-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.trow canvas { width: 100%; height: 100%; min-width: 0; min-height: 0; display: block; cursor: text; }
.thead {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 5px;
  padding: 6px 8px 8px 10px;
  background: var(--surface);
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.thead::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.trow.selected .thead { background: var(--accent-soft); }
.trow.selected .thead::before { background: var(--accent); }
.th-top { display: flex; align-items: center; gap: 4px; }
.th-close {
  flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: none;
  color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
}
.th-close:hover { background: var(--hover); color: var(--danger); }
.th-name {
  flex: 1; min-width: 0; padding: 2px 6px; border: 1px solid transparent; border-radius: 5px;
  background: transparent; font-weight: 600; font-size: 12.5px;
}
.th-name:hover { border-color: var(--border); }
.th-name:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.th-btns { display: flex; gap: 4px; }
.th-btn {
  flex: 1; padding: 2px 0; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2);
  font-size: 11.5px; font-weight: 500; cursor: pointer;
}
.th-btn:hover { background: var(--hover); }
.th-btn.mute[aria-pressed="true"] { background: #c77700; border-color: #c77700; color: #fff; }
.th-btn.solo[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.th-slider { display: grid; grid-template-columns: 30px 1fr 46px; align-items: center; gap: 4px; color: var(--muted); }
.th-slider input { width: 100%; min-width: 0; accent-color: var(--accent); margin: 0; }
.th-slider output { text-align: right; font-variant-numeric: tabular-nums; font-size: 11px; }
.th-info { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tresize { position: absolute; left: 0; right: 0; bottom: -3px; height: 7px; cursor: ns-resize; z-index: 2; }
.trow.recording .thead::before { background: var(--danger); }
.th-view {
  padding: 2px 4px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-size: 11.5px;
}
.trow.label-track .th-btns, .trow.label-track .th-slider, .trow.label-track .th-view { display: none; }
.trow.label-track .th-name { font-style: italic; }

.label-editor {
  position: absolute; z-index: 8; display: flex; flex-direction: column; gap: 6px; width: 300px;
  padding: 8px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow);
  border: 1px solid var(--accent);
}
.label-editor .le-text, .label-editor .le-note {
  width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 12.5px;
}
.label-editor .le-text { font-weight: 600; }
.label-editor .le-note { resize: vertical; min-height: 44px; line-height: 1.4; }
.label-editor .le-text:focus, .label-editor .le-note:focus { outline: 2px solid var(--accent-line); outline-offset: 0; }
.le-actions { display: flex; align-items: center; gap: 8px; }
.le-hint { flex: 1; color: var(--muted); font-size: 11px; text-align: center; }
.le-actions button { padding: 3px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.le-del { border: 1px solid var(--border); background: none; color: var(--muted); }
.le-del:hover { color: var(--danger); border-color: var(--danger); }
.le-done { border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.ann-chip {
  position: absolute; z-index: 7; padding: 3px 10px; border: 1px solid var(--accent); border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer;
}
.ann-chip:hover { filter: brightness(1.1); }
.ann-chip[hidden] { display: none; }

/* Diagnose panel */
.diag {
  width: 100%; height: 100%; min-height: 0; overflow-y: auto;
  background: var(--surface);
  font-size: 13px;
}
.dg-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.dg-head h2 { margin: 0; font-size: 15px; }
.dg-close { width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.dg-close:hover { background: var(--hover); color: var(--text); }
.dg-sec { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 9px; }
.dg-sec h3 { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.dg-target { margin: 0; }
.dg-run { align-self: flex-start; }
.dg-stale { margin: 0; color: #a66a00; font-weight: 500; }
.dg-field { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.dg-field select { padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-weight: 400; }
.dg-checks, .dg-radios { border: 0; margin: 0; padding: 0; display: grid; gap: 3px 10px; }
.dg-checks { grid-template-columns: 1fr 1fr; }
.dg-radios { grid-template-columns: repeat(3, auto); justify-content: start; }
.dg-checks legend, .dg-radios legend { font-weight: 500; padding: 0; margin-bottom: 4px; }
.dg-checks label, .dg-radios label { display: flex; align-items: center; gap: 5px; }
.dg-checks input, .dg-radios input, .diag .check input { accent-color: var(--accent); }
.dg-cause { border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; margin-bottom: 8px; background: var(--surface-2); }
.dg-cause header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dg-cause h4 { margin: 0; font-size: 13.5px; }
.dg-badge { flex: none; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid; }
.dg-badge.high { color: #b42318; border-color: #f3b4ae; background: #fdecea; }
.dg-badge.medium { color: #a66a00; border-color: #f0d79b; background: #fdf6e3; }
.dg-badge.low { color: var(--muted); border-color: var(--border); background: var(--surface); }
.dg-reasons { margin: 6px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.dg-reasons li { position: relative; padding-left: 16px; line-height: 1.45; }
.dg-reasons li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.dg-reasons li.for::before { content: "+"; color: var(--ok); }
.dg-reasons li.against::before { content: "−"; color: var(--danger); }
.dg-reasons li.note::before { content: "·"; color: var(--muted); }
.dg-findings { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
.dg-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dg-seek {
  margin-left: 4px; padding: 0 6px; border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark); font-size: 11.5px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.dg-seek:hover { border-color: var(--accent); }
.dg-empty { margin: 0; color: var(--muted); }
@media (max-width: 760px) {
  .diag { position: absolute; inset: 0; z-index: 20; width: auto; border-left: 0; }
}

.dlg-plot { width: min(760px, calc(100vw - 32px)); }
.plot-canvas { width: 100%; height: 320px; display: block; border-radius: 8px; }
.plot-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; color: var(--muted); }
.plot-legend b { color: var(--text); font-weight: 600; }
.plot-legend label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.plot-legend input { accent-color: var(--accent); margin: 0; }
.plot-key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.plot-key.now { background: var(--wave-fill); }
.plot-key.prev { background: repeating-linear-gradient(90deg, var(--ruler-text) 0 4px, transparent 4px 7px); }
.plot-cursor { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); min-height: 1.4em; }
.plot-controls { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.plot-controls label { display: flex; align-items: center; gap: 6px; }
.plot-controls select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.plot-peaks-wrap { display: flex; flex-direction: column; gap: 4px; }
.plot-peaks { margin: 0; padding-left: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.thumb {
  position: absolute; top: 2px; bottom: 2px; left: 0; width: 0; min-width: 24px;
  border-radius: 5px; background: var(--accent-line); cursor: grab;
}
.thumb:hover, .thumb.drag { background: var(--accent); }

.empty { flex: 1; display: grid; place-items: center; padding: 16px; }
.empty-card {
  max-width: 460px; text-align: center; padding: 32px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.empty-card h1 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.01em; }
.empty-card p { margin: 0 0 18px; }
.empty-card .small { margin: 18px 0 0; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-weight: 500;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: 0.5; cursor: default; }

.busy, .drop-hint {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.busy-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--accent-line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.drop-hint div {
  padding: 26px 40px; border: 2px dashed var(--accent); border-radius: 16px;
  background: var(--surface); color: var(--accent-dark); font-weight: 600; font-size: 16px;
}

/* ----------------------------------------------------------- selection bar */

.selbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px;
  padding: 7px 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.sb-item { display: flex; align-items: center; gap: 8px; }
.sb-label { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.05em; }
.sb-sel label { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.time, .time-out { font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.time {
  width: 112px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
}
.time:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.time:disabled { opacity: 0.5; }
.time-out { min-width: 96px; }
.sel-hz { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; white-space: nowrap; cursor: help; }
.selbar select { padding: 3px 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }
.status { margin-left: auto; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.status.error { color: var(--danger); font-weight: 500; }

/* ----------------------------------------------------------------- dialogs */

.dlg {
  border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; width: min(420px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
/* A floating, non-modal window (Diagnose): drag by the title, resize from the corner. */
.dlg-float[open] {
  position: fixed; inset: 96px 24px auto auto; margin: 0; padding: 0; z-index: 50;
  display: flex; flex-direction: column;
  width: min(440px, calc(100vw - 32px)); height: min(720px, calc(100vh - 120px));
  min-width: 300px; min-height: 240px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  resize: both; overflow: hidden;
}
.fl-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--border); cursor: move; user-select: none; touch-action: none; }
.fl-head h2 { flex: 1; margin: 0; font-size: 16px; }
.fl-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; }
.fl-btn:hover { background: var(--hover); color: var(--text); }
.fl-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fl-body > .diag { flex: 1; }
.dlg-float.fl-left[open] { inset: 96px auto auto 24px; width: min(420px, calc(100vw - 32px)); }
.nt { overflow-y: auto; font-size: 13px; }
.nt-sec { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.nt-sec h3 { margin: 0; font-size: 13px; }
.nt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nt-head .btn { padding: 4px 10px; font-size: 12px; }
.nt-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); font-size: 11px; text-align: center; }
.nt-count:empty { display: none; }
.nt-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.nt-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.nt-item { display: flex; flex-direction: column; gap: 5px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.nt-item.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.nt-row { display: flex; align-items: center; gap: 6px; }
.nt-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.nt-time { flex: 1; padding: 2px 4px; border: 0; background: none; color: var(--accent-dark); font-size: 12px; text-align: left; font-variant-numeric: tabular-nums; cursor: pointer; border-radius: 4px; }
.nt-time:hover { background: var(--hover); text-decoration: underline; }
.nt-del { width: 22px; height: 22px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.nt-del:hover { background: var(--hover); color: var(--danger); }
.nt-text, .nt-note, .nt-field input, .nt-field textarea { width: 100%; padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; }
.nt-text { font-weight: 600; }
.nt-note, .nt-field textarea { resize: vertical; min-height: 36px; line-height: 1.4; }
.nt-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.nt-opts { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.nt-opts label { display: flex; align-items: center; gap: 6px; }
.nt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dlg-float.fl-mid[open] { inset: 110px auto auto calc(50vw - 230px); width: min(460px, calc(100vw - 32px)); }
.toa-target { margin: 0; font-size: 12.5px; font-weight: 600; }
.toa-tracks { display: flex; flex-direction: column; gap: 3px; max-height: 150px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.toa-track { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.toa-track small { margin-left: auto; color: var(--muted); font-size: 11px; }
.toa-grid { display: grid; grid-template-columns: 1fr; gap: 6px; font-size: 12px; color: var(--muted); }
.toa-grid label { display: flex; flex-direction: column; gap: 2px; }
.toa-grid select, .toa-custom input { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; }
.toa-custom { display: flex; align-items: center; gap: 6px; color: var(--text); }
.toa-custom[hidden] { display: none; }
.toa-custom input { width: 80px; }
.toa-headline { margin: 0; font-size: 13.5px; line-height: 1.45; }
.toa-warn { margin: 0; padding: 6px 8px; border-radius: 6px; background: rgba(255, 176, 32, 0.14); color: var(--text); font-size: 12px; }
.toa-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.toa-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 3px 4px; border-bottom: 1px solid var(--border); }
.toa-table td { padding: 4px; border-bottom: 1px solid var(--border); }
.toa-table td:nth-child(2) { font-weight: 600; }
.toa-canvas { width: 100%; height: 150px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.dlg-wide { width: min(640px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(10, 12, 24, 0.35); }
.dlg h2 { margin: 0 0 16px; font-size: 17px; }
.dlg form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13px; border: 0; padding: 0; margin: 0; }
.field legend { padding: 0; margin-bottom: 5px; }
.field input, .field select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); font-weight: 400; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.radio, .check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13.5px; }
.radio input, .check input { accent-color: var(--accent); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.dlg p { margin: 0; }

.dlg-fx { width: min(480px, calc(100vw - 32px)); }
.dlg-actions .spacer { flex: 1; }
.fx-fields { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.fx-row label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.fx-row input[type="number"], .fx-row select {
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); font-weight: 400;
}
.fx-row input:focus, .fx-row select:focus { outline: none; border-color: var(--accent); }
.fx-check label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.fx-check input { accent-color: var(--accent); }
.fx-range label { display: grid; grid-template-columns: 1fr 1.6fr 62px; align-items: center; gap: 10px; font-weight: 400; }
.fx-range input { width: 100%; accent-color: var(--accent); }
.fx-range output { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); }
.fx-button .btn { width: 100%; }
.fx-error { color: var(--danger); font-size: 13px; font-weight: 500; }

.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 24px; max-height: 60vh; overflow: auto; }
.keys h3 { grid-column: 1 / -1; margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.keys h3:first-child { margin-top: 0; }
.key-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.key-row kbd { font: 12px ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------------- narrow view */

@media (max-width: 760px) {
  .logo, .doc-title { display: none; }
  .menubar { padding: 2px 6px; height: auto; min-height: 40px; }
  .menus { flex-wrap: wrap; }
  .menu-btn { padding: 6px 7px; }
  .sb-sel { flex-wrap: wrap; }
  .selbar { gap: 6px 14px; }
  .menu-list { min-width: 230px; }
  .tracks { --panel-w: 130px; }
  .th-slider { grid-template-columns: 1fr; }
  .th-slider span, .th-slider output { display: none; }
  .meter { width: 110px; }
  .vol input { width: 70px; }
  .time { width: 96px; }
  .status { margin-left: 0; }
}

/* Ruler readout */
.ruler-box {
  position: absolute; top: 34px; right: calc(var(--sbw) + 10px); z-index: 7;
  display: flex; flex-direction: column; gap: 4px;
  max-width: min(440px, calc(100% - var(--panel-w) - 24px));
  padding: 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 12px; font-variant-numeric: tabular-nums;
}
.rb-head { display: flex; align-items: center; gap: 8px; }
.ruler-box.small #rb-peaks, .ruler-box.small .rb-phase, .ruler-box.small #rb-phase-read, .ruler-box.small #rb-from-sel { display: none !important; }
.rb-head b { margin-right: auto; }
.rb-btn { padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: 11.5px; cursor: pointer; }
.rb-btn:hover { background: var(--hover); }
.rb-x { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.rb-x:hover { background: var(--hover); color: var(--text); }
.rb-row { line-height: 1.5; }
.rb-row .r1 { color: #b76e00; font-weight: 600; }
.rb-row .r2 { color: #0d8a7e; font-weight: 600; }
.rb-muted { color: var(--muted); }
.rb-phase { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.rb-phase label { display: flex; align-items: center; gap: 4px; }
.rb-phase input[type="checkbox"] { accent-color: #f59e0b; margin: 0; }
.rb-phase input[type="number"] { width: 52px; padding: 1px 4px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); }

/* Spectrum pane */
.spec-pane {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface);
}
.sp-resize { position: absolute; left: 0; right: 0; top: -3px; height: 7px; cursor: ns-resize; z-index: 3; }
.sp-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  padding: 5px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border);
}
.sp-head b { color: var(--text); font-size: 12.5px; }
.sp-head label { display: flex; align-items: center; gap: 5px; }
.sp-head select { padding: 2px 4px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-size: 12px; }
.sp-head input[type="checkbox"] { accent-color: var(--accent); margin: 0; }
.sp-mode { color: var(--accent-dark); font-weight: 500; }
.sp-read { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
#sp-canvas { flex: 1; min-height: 0; width: 100%; display: block; cursor: crosshair; }

/* Reference data */
.ref-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ref-cols { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 0.7fr) auto; gap: 6px 8px; align-items: center; font-size: 12.5px; max-height: 40vh; overflow: auto; }
.ref-cols .rh { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.ref-cols input[type="text"], .ref-cols select { width: 100%; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }
.ref-cols input[type="checkbox"] { accent-color: var(--accent); }
.ref-cols .rng { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trow.data-track .th-btns, .trow.data-track .th-slider, .trow.data-track .th-view,
.trow.video-track .th-btns, .trow.video-track .th-slider, .trow.video-track .th-view { display: none; }
.th-kind { display: none; padding: 2px 4px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-size: 11.5px; }
.trow.data-track .th-kind { display: block; }
.trow.dsyncing { box-shadow: inset 0 0 0 2px var(--accent); }
.th-sync { display: none; align-items: center; gap: 2px; }
.trow.data-track .th-sync { display: flex; }
.th-off::-webkit-inner-spin-button, .th-off::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.th-off { -moz-appearance: textfield; appearance: textfield; flex: 1 1 0; width: 0; min-width: 36px; padding: 1px 2px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-size: 11px; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }
.trow.data-track .th-info, .th-sync { flex-shrink: 0; }
.th-nudge, .th-dsync { flex-shrink: 0; padding: 1px 2px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-size: 10.5px; line-height: 16px; cursor: pointer; color: var(--text); }
.th-dsync { font-weight: 600; color: var(--accent-dark); border-color: var(--accent-line); background: var(--accent-soft); }
.th-dsync[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.th-nudge:hover { background: var(--hover); }
.trow.data-track .th-info { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12px; }

/* Worksheet: boxes that move, resize, snap and maximise (as in Data Analyser) */
.ws-area { position: absolute; inset: 0; padding: 3px; isolation: isolate; }
.dp { position: absolute; padding: 3px; min-width: 0; min-height: 0; }
.dp-frame {
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.dp.is-active .dp-frame { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.dp-head {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 4px 0 10px; flex-shrink: 0;
  border-bottom: 1px solid var(--border); cursor: grab; user-select: none; touch-action: none; background: var(--surface-2);
}
.dp.is-active .dp-head { background: var(--accent-soft); }
.dp.is-dragging .dp-head { cursor: grabbing; }
.dp-icon { display: inline-flex; color: var(--accent-dark); }
.dp-icon svg { width: 15px; height: 15px; }
.dp-title { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-actions { display: inline-flex; gap: 1px; }
.dp-btn {
  width: 24px; height: 22px; border: 0; border-radius: 5px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; cursor: pointer;
}
.dp-btn:hover { background: var(--surface); color: var(--text); }
.dp-btn[data-act="close"]:hover { color: var(--danger); }
.dp-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dp-rs { position: absolute; z-index: 5; }
.dp-rs-n, .dp-rs-s { left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.dp-rs-n { top: -1px; } .dp-rs-s { bottom: -1px; }
.dp-rs-e, .dp-rs-w { top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.dp-rs-e { right: -1px; } .dp-rs-w { left: -1px; }
.dp-rs-ne, .dp-rs-nw, .dp-rs-se, .dp-rs-sw { width: 14px; height: 14px; }
.dp-rs-ne { top: -1px; right: -1px; cursor: nesw-resize; } .dp-rs-sw { bottom: -1px; left: -1px; cursor: nesw-resize; }
.dp-rs-nw { top: -1px; left: -1px; cursor: nwse-resize; } .dp-rs-se { bottom: -1px; right: -1px; cursor: nwse-resize; }
.dp-rs-se::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); opacity: 0.45; border-radius: 0 0 2px 0; }
.ws-area.is-arranging .dp-body { pointer-events: none; }
.ws-area.has-max .dp:not(.is-max) { visibility: hidden; }
.dp.is-max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; z-index: 50 !important; }
.dp.is-max .dp-rs { display: none; }
.dp-body > .tracks, .dp-body > .spec-pane, .dp-body > .diag, .dp-body > .vbox { flex: 1; min-height: 0; }
@media (max-width: 760px) {
  .dp-rs { display: none; }
}

/* Video box */
.vbox { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.vb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; padding: 5px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.vb-bar select { padding: 2px 4px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-size: 12px; max-width: 140px; }
.vb-field { display: flex; align-items: center; gap: 5px; }
.vb-field input { width: 74px; padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.vb-nudge { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.vb-nudge button { padding: 2px 6px; border: 0; border-right: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.vb-nudge button:last-child { border-right: 0; }
.vb-nudge button:hover, .vb-sync:hover { background: var(--hover); }
.vb-sync { padding: 2px 9px; border: 1px solid var(--accent-line); border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 600; cursor: pointer; }
.vb-sync[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.vb-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
.vb-syncbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; font-size: 12px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); }
.vb-syncbar span { flex: 1; min-width: 200px; }
.vb-syncbar .btn { padding: 3px 10px; font-size: 12px; }
.vb-readbar { display: flex; flex-direction: column; gap: 5px; padding: 6px 8px; font-size: 12px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); overflow-x: hidden; overflow-y: auto; max-height: 55%; }
.vr-row > * { min-width: 0; max-width: 100%; }
.vr-row select { max-width: 100%; }
.vr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; }
.vr-row label { display: inline-flex; align-items: center; gap: 4px; }
.vr-row input[type="text"], .vr-row input[type="number"], .vr-row select { padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); font-size: 12px; }
.vr-row input[type="number"] { width: 80px; }
.vr-row .btn { padding: 3px 10px; font-size: 12px; }
.vr-help { margin: 0; color: var(--text); line-height: 1.4; }
.vr-known { color: var(--muted); font-variant-numeric: tabular-nums; }
.vr-known b { color: var(--text); }
#vr-crop { height: 40px; border: 1px solid var(--border); border-radius: 4px; background: #000; image-rendering: pixelated; }
.vr-progress { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
.vr-overlay { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.vb-stage { position: relative; flex: 1; min-height: 0; background: #000; }
.vb-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vw-note { position: absolute; inset: 0; display: grid; place-items: center; color: #ccc; font-size: 13px; background: rgba(0,0,0,0.6); }
.vb-popped { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #ddd; font-size: 13px; background: #111; }
.vb-popped p { margin: 0; }
.dp.is-syncing .dp-frame { border-color: var(--accent); }

/* Ruler dock (PicoScope-style handles) */
.ruler-corner { justify-content: space-between; gap: 6px; }
.ruler-dock { display: inline-flex; gap: 3px; }
.rd-flag {
  display: inline-grid; place-items: center; width: 16px; height: 15px; border-radius: 3px;
  color: #fff; font: 700 10px Inter, system-ui, sans-serif; cursor: grab; touch-action: none; user-select: none;
}
.rd-flag.r1 { background: #f59e0b; }
.rd-flag.r2 { background: #14b8a6; }
.rd-flag:active { cursor: grabbing; }
.rd-flag.fr { width: 22px; }
.sp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.sp-filter label { display: flex; align-items: center; gap: 5px; }
.sp-filter select, .sp-filter input { padding: 2px 4px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); font-size: 12px; }
.sp-filter input { width: 70px; font-variant-numeric: tabular-nums; }
.sp-filter.on { background: rgba(20, 184, 166, 0.08); }
.sp-filter.on #lf-type { border-color: #14b8a6; color: #0d8a7e; font-weight: 600; }
.sp-hint { margin-left: auto; font-size: 11px; }

/* Reference import: play-faster choice for signal tracks */
.ref-speed { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 0 24px; }
.ref-speed[hidden] { display: none; }
.ref-speed label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ref-speed p { margin: 0; }
#ref-fixrate { width: 120px; }
