/* Shesheshens: dark "stage lights" theme. */
:root {
  color-scheme: dark;
  --bg: #0c0614;
  --panel: rgba(28, 15, 45, .72);
  --panel-solid: #1a0e2b;
  --text: #f7f0ff;
  --muted: #a996c2;
  --border: rgba(190, 145, 255, .16);
  --pink: #ff3d8b;
  --orange: #ff9f43;
  --violet: #9b6bff;
  --grad: linear-gradient(100deg, var(--pink), var(--orange) 55%, var(--violet));
  --danger: #ff6b6b;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  scrollbar-color: rgba(190, 145, 255, .3) transparent;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; display: grid; grid-template-columns: 260px 1fr; height: 100dvh; background: var(--bg); color: var(--text); }
body.sidebar-collapsed { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
body.sidebar-collapsed #sidebar { display: none; }
body.sidebar-collapsed #collapsed-bar { display: flex !important; }

.collapsed-bar {
  align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--panel); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); z-index: 12;
}
.collapsed-bar .logo { font-size: 1.05rem; }
.collapsed-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sidebar-head-actions { display: flex; align-items: center; gap: 6px; }
.sidebar-toggle { padding: 5px 9px; font-weight: 800; font-size: .9rem; border-radius: 999px; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); z-index: 24; }

/* Slowly drifting coloured spotlights behind everything. */
body::before {
  content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(35% 30% at 18% 12%, rgba(255, 61, 139, .3), transparent 70%),
    radial-gradient(32% 28% at 85% 18%, rgba(155, 107, 255, .34), transparent 70%),
    radial-gradient(40% 35% at 62% 92%, rgba(255, 159, 67, .2), transparent 70%);
  animation: lights 26s ease-in-out infinite alternate;
}
@keyframes lights {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(4%, -3%) rotate(4deg); }
  100% { transform: translate(-4%, 3%) rotate(-3deg); }
}

/* Animated gradient wordmark. */
.logo {
  margin: 0; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--violet), var(--pink));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 8s linear infinite;
}
.logo a { color: transparent; text-decoration: none; }
@keyframes shimmer { to { background-position: 200% center; } }

#sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--panel); backdrop-filter: blur(14px); min-height: 0; }
#sidebar header { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; gap: 8px; }
#sidebar h1 { font-size: 1.12rem; }
.primary-nav { display: flex; flex-direction: column; gap: 4px; padding: 0 10px 10px; border-bottom: 1px solid var(--border); }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none;
  font-size: .88rem; font-weight: 600; border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); }
.nav-item.active { background: color-mix(in srgb, var(--pink) 18%, transparent); border-color: color-mix(in srgb, var(--pink) 45%, transparent); color: #fff; }
.nav-item small { color: var(--muted); font-weight: 600; font-size: .76rem; font-variant-numeric: tabular-nums; }
.nav-stage { margin: 4px 0 0 !important; justify-content: center; padding: 7px 12px !important; font-size: .84rem !important; }
.sidebar-section-label {
  padding: 10px 14px 5px; font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted); opacity: .82;
}
.sidebar-songs-box { display: flex; flex-direction: column; flex: 1; min-height: 0; border-top: 1px solid var(--border); }
#search { margin: 2px 12px 6px; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; background: rgba(0, 0, 0, .25); color: inherit; font: inherit; font-size: .84rem; transition: border-color .2s, box-shadow .2s; }
#search:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 61, 139, .22); }
/* Folder chips ("crates") */
#folders { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px 10px; }
.chip { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; text-decoration: none; cursor: pointer; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1) both; transition: border-color .2s, background .2s, box-shadow .2s, transform .15s; }
.chip:nth-child(2) { animation-delay: 30ms; } .chip:nth-child(3) { animation-delay: 60ms; } .chip:nth-child(4) { animation-delay: 90ms; } .chip:nth-child(n+5) { animation-delay: 120ms; }
.chip:hover { border-color: var(--c); transform: translateY(-1px); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.chip small { color: var(--muted); font-weight: 500; }
.chip.active { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 40%, transparent); }
.chip.active:not([style]) { --c: var(--pink); }
.chip.unfiled { --c: #8a7aa3; }
.chip.add { --c: var(--orange); border-style: dashed; color: var(--muted); }
.chip-input { width: 140px; padding: 4px 10px; border-radius: 999px; font-size: .8rem; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }

#song-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
#song-list a { display: block; padding: 9px 14px; color: inherit; text-decoration: none; transition: background .2s, transform .2s, box-shadow .2s; }
#song-list a:hover { background: rgba(255, 255, 255, .05); transform: translateX(3px); }
#song-list a.active { background: linear-gradient(90deg, rgba(255, 61, 139, .2), transparent); box-shadow: inset 3px 0 0 var(--pink); }
#song-list a[style] { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c) 55%, transparent); }
#song-list a[style].active { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 25%, transparent), transparent); box-shadow: inset 3px 0 0 var(--c); }
#song-list small { display: block; color: var(--muted); margin-top: 2px; }
#song-list .none { padding: 14px; color: var(--muted); }

main { overflow-y: auto; padding: 28px 36px; min-width: 0; }
main > * { animation: rise .35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.empty, .muted { color: var(--muted); }

.btn { display: inline-block; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, .04); color: inherit; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .15s, box-shadow .2s, border-color .2s, filter .2s; }
.btn:hover { border-color: rgba(255, 255, 255, .35); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 18px rgba(255, 61, 139, .35); }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 6px 24px rgba(255, 61, 139, .5); }
.btn.active { border-color: #22d3ee; background: rgba(34, 211, 238, .16); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.actions { display: flex; gap: 8px; align-items: flex-start; }
.wrap-actions { flex-wrap: wrap; align-items: center; }
.field-hint { font-size: .75rem; color: var(--muted); font-weight: 400; }
.field-hint code { color: var(--orange); }

/*Only one audio/video plays at a time: glow on tr, section, or .rec-card */
.rec-card.playing { border-color: rgba(255, 61, 139, .55); box-shadow: 0 0 26px rgba(255, 61, 139, .22); }

/* Lifecycle Stage Pipeline & Chips */
.stages-bar { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 8px; }
.stage-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px;
  border-radius: 999px; font-size: .7rem; font-weight: 700; white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--sc, var(--muted)) 45%, transparent);
  background: color-mix(in srgb, var(--sc, var(--muted)) 14%, transparent);
  color: var(--sc, var(--text));
}
td .stage-badge { margin-left: 7px; vertical-align: 2px; }
.stage-idea { --sc: #22d3ee; }
.stage-rehearsing { --sc: #ff9f43; }
.stage-gig_ready { --sc: #ff3d8b; }
.stage-studio { --sc: #4ade80; }

.stage-pipeline {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 18px; padding: 6px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border);
}
.pipe-step {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  border-radius: 999px; border: 1px solid transparent; background: none;
  color: var(--muted); font: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer; transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.pipe-step:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.pipe-step.active {
  color: #fff;
  border-color: color-mix(in srgb, var(--sc) 70%, transparent);
  background: color-mix(in srgb, var(--sc) 28%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--sc) 40%, transparent);
}
.pipe-arrow { color: var(--muted); font-size: .75rem; opacity: .55; }

/* Multi-take Recordings & Synchronized Stem Mixer */
.recordings-section { max-width: 900px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.rec-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-section-head h3 { margin: 0; }
.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-card {
  padding: 12px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px;
  transition: border-color .2s, box-shadow .2s;
}
.rec-card.primary-rec { border-color: rgba(255, 159, 67, .42); }
.rec-card audio { width: 100%; height: 36px; display: block; }
.rec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-title-area { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec-kind {
  padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: rgba(255, 255, 255, .07); color: var(--orange);
}
.rec-kind.kind-idea { color: #22d3ee; }
.rec-kind.kind-studio { color: #4ade80; }
.rec-kind.kind-live { color: var(--pink); }
.rec-meta { display: inline-flex; gap: 8px; font-size: .78rem; color: var(--muted); }
.rec-meta span::before { content: "· "; }
.rec-actions { display: flex; align-items: center; gap: 8px; }
.btn.star-active { border-color: rgba(255, 159, 67, .55); color: var(--orange); background: rgba(255, 159, 67, .14); cursor: default; opacity: 1; }
.rec-notes { margin: 0; font-size: .86rem; color: var(--muted); white-space: pre-wrap; }

.rec-mode-bar { display: flex; gap: 8px; }
.rec-file-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, .2); border: 1px solid var(--border); }
.rec-opts-row { display: flex; flex-wrap: wrap; gap: 16px; }
.inline-check { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--text) !important; cursor: pointer; }
.pending-stems { display: flex; flex-direction: column; gap: 6px; }
.pending-stem-row { display: grid; grid-template-columns: minmax(120px, 180px) 130px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); }
.pending-stem-row.paired { border-color: rgba(34, 211, 238, .45); background: rgba(34, 211, 238, .06); }

/* Stereo Makeup-Gain Row */
.stereo-player-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stereo-player-row audio { flex: 1; min-width: 220px; }
.stereo-gain-box { flex-direction: row !important; align-items: center; gap: 8px !important; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .25); border: 1px solid var(--border); font-size: .76rem; color: var(--text) !important; }
.stereo-gain-label { min-width: 74px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--orange); }
.stereo-gain-box .ch-slider { width: 90px; }
.stereo-tools-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Studio & Practice Multitrack Console (Two-Tier Practice Mode by default, Studio Mode on toggle) */
.recordings-section { max-width: min(1320px, 100%); margin: 28px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.studio-console { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: rgba(6, 3, 12, .62); border: 1px solid var(--border); min-width: 0; }
.studio-console:not(.is-studio) .studio-only { display: none !important; }
.studio-console:not(.is-studio) .ch-strip:not(.master-strip):not(.group-strip) { width: 88px; }
.studio-mode-btn { margin-left: auto; border-color: rgba(34, 211, 238, .45); color: #22d3ee; }
.studio-console.is-studio .studio-mode-btn { margin-left: 0; }
.studio-mode-btn.active { background: rgba(34, 211, 238, .22); border-color: #22d3ee; color: #fff; box-shadow: 0 0 14px rgba(34, 211, 238, .28); }
.console-transport { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stem-time { font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 96px; font-weight: 600; }
.stream-badge { padding: 2px 7px; border-radius: 999px; font-size: .68rem; font-weight: 800; color: #4ade80; background: rgba(74, 222, 128, .14); border: 1px solid rgba(74, 222, 128, .45); }
.loop-controls, .zoom-controls { display: inline-flex; gap: 4px; align-items: center; }
.zoom-controls { margin-left: auto; }
.loop-controls .icon-btn.active, .zoom-controls .icon-btn.active { border-color: #22d3ee; color: #22d3ee; background: rgba(34, 211, 238, .14); }
.marker-add-btn { color: #facc15; border-color: rgba(250, 204, 21, .35); }
.marker-add-btn:hover { color: #fff !important; border-color: #facc15 !important; background: rgba(250, 204, 21, .16); }
.speed-select { padding: 4px 8px; border-radius: 6px; font-size: .78rem; font-weight: 700; background: rgba(255, 255, 255, .04); }

/* Waveform Overview, Time/Marker Ruler & Draggable Loop Selection */
.wave-section { display: flex; flex-direction: column; gap: 6px; }
.wave-canvas-wrap {
  position: relative; width: 100%; height: 78px; border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(190, 145, 255, .22); background: rgba(10, 5, 20, .75);
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
}
.wave-canvas-wrap:hover { border-color: rgba(34, 211, 238, .45); }
.wave-canvas { display: block; width: 100%; height: 78px; }
.wave-loading-hint {
  position: absolute; inset: 19px 0 0; display: grid; place-items: center;
  font-size: .75rem; color: var(--muted); pointer-events: none;
}
.wave-pan-row { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.wave-pan-row small { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .72rem; }
.wave-pan-slider { flex: 1; accent-color: #22d3ee; }

.marker-chips-bar { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.marker-chip {
  --mc: #facc15; display: inline-flex; align-items: center; border-radius: 999px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--mc) 45%, transparent);
  background: color-mix(in srgb, var(--mc) 12%, rgba(16, 8, 30, .85));
  font-size: .73rem; transition: box-shadow .15s, border-color .15s;
}
.marker-chip.active-loop {
  border-color: #22d3ee; background: rgba(34, 211, 238, .18);
  box-shadow: 0 0 12px rgba(34, 211, 238, .32);
}
.marker-chip button {
  border: 0; background: none; color: var(--text); font: inherit; cursor: pointer;
  padding: 3px 7px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.marker-chip .marker-jump { color: var(--mc); padding-left: 9px; }
.marker-chip.active-loop .marker-jump { color: #22d3ee; }
.marker-chip .marker-loop-btn { border-left: 1px solid rgba(255, 255, 255, .1); opacity: .8; padding: 3px 6px; }
.marker-chip .marker-loop-btn:hover { opacity: 1; background: rgba(34, 211, 238, .22); color: #22d3ee; }
.marker-chip .marker-rm-btn { border-left: 1px solid rgba(255, 255, 255, .1); color: var(--muted); padding: 3px 7px; }
.marker-chip .marker-rm-btn:hover { color: var(--danger); background: rgba(255, 107, 107, .16); }

/* Selected Channel / Subgroup / Global FX Parameter Inspector Panel */
.fx-inspector-slot {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
  border-radius: 9px; background: rgba(18, 10, 34, .95);
  border: 1px solid rgba(34, 211, 238, .45); box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
}
.insp-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .84rem; color: #22d3ee; }
.insp-header strong { margin-right: auto; }
.insp-cards { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.insp-card {
  flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; padding: 10px 11px;
  border-radius: 8px; background: rgba(0, 0, 0, .34); border: 1px solid var(--border); min-width: 0;
}
.insp-eq-card { flex: 1.35 1 360px; }
.insp-comp-card { flex: 1.2 1 330px; }
.insp-sends-card, .insp-lim-card { flex: 0 1 175px; justify-content: flex-start; }
.insp-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: nowrap; min-height: 24px;
  font-size: .73rem; font-weight: 800; color: var(--orange); text-transform: uppercase; letter-spacing: .05em;
}
.insp-card-head > strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.insp-head-btns { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; white-space: nowrap; }
.stem-btn { white-space: nowrap; }
.stem-btn.pwr-btn {
  padding: 3px 8px; border-radius: 999px; font-size: .66rem; letter-spacing: .04em;
  border-color: rgba(255, 255, 255, .2); color: var(--muted);
  min-width: 82px; text-align: center; flex-shrink: 0; white-space: nowrap;
}
.stem-btn.pwr-btn.comp-pwr { min-width: 96px; }
.stem-btn.pwr-btn.master-pwr { min-width: 108px; }
.master-preset-sel { width: auto; min-width: 195px; }
.stem-btn.pwr-btn.active { background: rgba(74, 222, 128, .2); border-color: #4ade80; color: #4ade80; box-shadow: 0 0 10px rgba(74, 222, 128, .25); }
.stem-btn.pwr-btn.comp-pwr.active { background: rgba(250, 204, 21, .2); border-color: #facc15; color: #facc15; box-shadow: 0 0 10px rgba(250, 204, 21, .24); }
.eq-trim-col { display: flex; align-items: center; padding-right: 10px; border-right: 1px solid var(--border); }
.eq-switchable-body { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; transition: opacity .15s, filter .15s; }
.comp-switchable-body { display: flex; flex-direction: column; gap: 8px; transition: opacity .15s, filter .15s; }
.module-bypassed { opacity: .36; filter: grayscale(.65); pointer-events: none; }
.insp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 7px 10px; }
.gr-badge { padding: 1px 7px; border-radius: 999px; font-size: .68rem; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--border); }
.gr-badge.compressing { color: #facc15; border-color: rgba(250, 204, 21, .55); background: rgba(250, 204, 21, .14); }
.dly-sync-bar { display: flex; gap: 4px; flex-wrap: wrap; }

/* Live Waterfall Spectrogram + RTA + EQ Curve & Visual Compressor Scopes */
.eq-spec-wrap { width: 100%; height: 132px; border-radius: 7px; overflow: hidden; border: 1px solid rgba(190, 145, 255, .24); background: #090414; }
.eq-spec-canvas { display: block; width: 100%; height: 132px; }
.comp-vis-wrap { width: 100%; height: 108px; border-radius: 7px; overflow: hidden; }
.comp-vis-canvas { display: block; width: 100%; height: 108px; }

.eq-controls-deck { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 2px; }
.eq-rotary-col { display: flex; align-items: flex-end; gap: 10px; padding-right: 10px; border-right: 1px solid var(--border); }
.hpf-knob-box { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.hpf-knob-box .stem-btn { width: 64px; font-size: .65rem; padding: 3px 4px; text-align: center; white-space: nowrap; }

/* Hardware SVG Rotary Potentiometer Knobs */
.rotary-knob {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 54px;
  cursor: ns-resize; user-select: none; -webkit-user-select: none; touch-action: none; outline: none;
}
.rk-label { font-size: .63rem; font-weight: 700; color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.rk-svg { width: 44px; height: 44px; display: block; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .55)); transition: transform .12s; }
.rotary-knob:hover .rk-svg, .rotary-knob.dragging .rk-svg { transform: scale(1.06); }
.rk-val { font-size: .68rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: text; padding: 1px 4px; border-radius: 4px; }
.rk-val:hover { background: rgba(255, 255, 255, .09); }
.rotary-knob.touched .rk-val { color: #22d3ee; }

.comp-knobs-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.sends-knobs-row { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 10px; padding: 6px 0; margin: auto 0; }

/* Vertical 3-Band EQ Rack (Low -> Mid -> High Left-to-Right, Up = +15 dB Boost, Down = -15 dB Cut) */
.veq-bank { display: flex; align-items: center; gap: 10px; margin: 0 auto; }
.veq-scale {
  position: relative; width: 22px; height: 96px; margin-top: 8px;
  font-size: .58rem; font-variant-numeric: tabular-nums; color: rgba(169, 150, 194, .7);
  pointer-events: none; user-select: none;
}
.veq-band { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 44px; }
.veq-head { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.veq-head strong { font-size: .68rem; color: var(--text); letter-spacing: .06em; }
.veq-head small { font-size: .6rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.veq-track {
  position: relative; width: 28px; height: 96px; touch-action: none;
  cursor: ns-resize; user-select: none; -webkit-user-select: none; outline: none;
}
.veq-fill {
  position: absolute; left: 50%; width: 4px; transform: translateX(-50%);
  border-radius: 999px; background: #22d3ee; pointer-events: none;
}
.veq-fill.cut { background: var(--pink); }
.veq-cap { height: 14px; }
.veq-cap::after { top: 6px; }
.veq-val { font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.veq-band.touched .veq-val { color: #22d3ee; }

/* 24-Channel Scrollable Left Desk + Pinned Right MASTER & FX Dock */
.console-desk { display: flex; align-items: stretch; gap: 0; min-width: 0; }
.console-channels-scroll {
  flex: 1; min-width: 0; display: flex; gap: 6px;
  overflow-x: auto; padding: 2px 8px 8px 2px; align-items: stretch;
  scrollbar-width: thin;
}
.console-master-dock {
  flex-shrink: 0; display: flex; align-items: stretch;
  padding: 2px 0 8px 10px; border-left: 2px solid rgba(34, 211, 238, .32);
  box-shadow: -10px 0 20px rgba(6, 3, 12, .65); z-index: 3;
}

.ch-strip {
  --gc: rgba(190, 145, 255, .35);
  width: 112px; flex-shrink: 0; display: flex; flex-direction: column; gap: 5px;
  padding: 8px 7px; border-radius: 9px; background: rgba(24, 13, 40, .88);
  border: 1px solid var(--border); border-top: 3px solid var(--gc);
  transition: opacity .15s, border-color .15s, box-shadow .15s;
}
.ch-strip.editing-strip { border-color: #22d3ee; box-shadow: 0 0 16px rgba(34, 211, 238, .25); }
.ch-strip.stereo-strip { width: 116px; }
.ch-strip.group-strip {
  width: 122px; background: color-mix(in srgb, var(--gc) 13%, #130a24);
  border-color: color-mix(in srgb, var(--gc) 50%, transparent);
}
.ch-strip.master-strip {
  --gc: #22d3ee; width: 132px;
  border-color: rgba(34, 211, 238, .45); background: rgba(14, 11, 32, .98);
}
.ch-strip.audible-dim { opacity: .5; }

.ch-head { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.ch-title-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ch-num { font-size: .62rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ch-name { font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); flex: 1; cursor: pointer; }
.ch-del-btn {
  padding: 0 4px; border: 0; border-radius: 4px; background: transparent;
  color: rgba(169, 150, 194, .6); font: inherit; font-size: .82rem; font-weight: 800; line-height: 1.1;
  cursor: pointer; flex-shrink: 0; transition: color .15s, background .15s;
}
.ch-del-btn:hover { color: var(--danger); background: rgba(255, 107, 107, .18); }

/* Inline Add Tracks Drawer inside Multitrack Console */
.add-tracks-drawer {
  display: flex; flex-direction: column; gap: 10px; padding: 12px;
  border-radius: 9px; background: rgba(18, 10, 34, .95);
  border: 1px dashed rgba(34, 211, 238, .5);
}
.add-tracks-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; align-items: end; }
.exist-add-row { display: flex; gap: 6px; align-items: center; }
.exist-add-row select { flex: 1; min-width: 0; }
.group-strip .ch-name { color: var(--gc); font-size: .75rem; letter-spacing: .03em; }
.master-strip .ch-name { color: #22d3ee; letter-spacing: .05em; font-size: .76rem; }
.grp-sub { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.st-badge { padding: 1px 5px; border-radius: 4px; background: rgba(34, 211, 238, .18); border: 1px solid rgba(34, 211, 238, .5); color: #22d3ee; font-size: .62rem; font-weight: 800; flex-shrink: 0; }
.ch-pair-row { display: flex; gap: 4px; }
.ch-pair-row button { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pair-btn { color: #22d3ee !important; border-style: dashed !important; }

.ch-fx-selects { display: flex; flex-direction: column; gap: 4px; }
.fx-field { display: flex !important; flex-direction: column; gap: 2px !important; font-size: .65rem !important; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fx-mini-select { width: 100%; padding: 3px 5px; font-size: .72rem; border-radius: 5px; background: rgba(0, 0, 0, .38); border: 1px solid var(--border); color: var(--text); }
.fx-mini-select.active-fx { border-color: var(--orange); color: var(--orange); background: rgba(255, 159, 67, .12); font-weight: 700; }
.grp-select { font-size: .69rem; padding: 2px 4px; }

.ch-ms-two { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.stem-btn { padding: 4px 4px; border-radius: 5px; border: 1px solid var(--border); background: rgba(255, 255, 255, .04); color: var(--muted); font: inherit; font-size: .7rem; font-weight: 800; cursor: pointer; }
.stem-btn:hover { border-color: rgba(255, 255, 255, .35); color: var(--text); }
.stem-btn.mute.active { background: rgba(255, 107, 107, .28); border-color: var(--danger); color: var(--danger); }
.stem-btn.solo.active { background: rgba(250, 204, 21, .26); border-color: #facc15; color: #facc15; }
.stem-btn.hpf.active, .stem-btn.lim.active, .stem-btn.active-cyan { background: rgba(34, 211, 238, .2); border-color: #22d3ee; color: #22d3ee; }
.stem-btn.lpf.active { background: rgba(255, 159, 67, .22); border-color: var(--orange); color: var(--orange); }
.eq-toggle { width: 100%; }

.ch-group { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 6px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(190, 145, 255, .14); }
.ch-param { display: flex; flex-direction: column; gap: 1px; }
.ch-param-head { display: flex; justify-content: space-between; font-size: .67rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ch-param-head b { font-weight: 700; color: var(--text); }
.ch-param.touched .ch-param-head b { color: #22d3ee; }
.ch-slider { width: 100%; height: 13px; padding: 0; margin: 0; border: 0; background: transparent; accent-color: var(--orange); cursor: pointer; }
.ch-param.touched .ch-slider { accent-color: #22d3ee; }

/* Hardware-style Custom Vertical Volume Fader (−∞ to +10 dB) + Scale Markers + Live VU Meter */
.ch-fader-well { display: flex; align-items: center; justify-content: center; gap: 8px; height: 168px; padding: 10px 0 6px; margin-top: auto; }
.vfader-unit { display: flex; align-items: center; gap: 3px; height: 148px; }
.vfader-scale {
  position: relative; width: 22px; height: 148px; pointer-events: none;
  font-size: .58rem; font-variant-numeric: tabular-nums; color: rgba(169, 150, 194, .68);
  user-select: none; -webkit-user-select: none;
}
.vfader-mark {
  position: absolute; right: 0; transform: translateY(50%); line-height: 1; white-space: nowrap;
}
.vfader-mark.unity { color: #22d3ee; font-weight: 800; font-size: .64rem; }
.vfader-mark.max { color: var(--orange); font-weight: 700; }
.vfader-mark.inf { color: rgba(169, 150, 194, .85); font-size: .64rem; }

.vfader-track {
  position: relative; width: 28px; height: 148px; touch-action: none;
  cursor: ns-resize; user-select: none; -webkit-user-select: none; outline: none;
}
.vfader-tick {
  position: absolute; left: 3px; right: 3px; height: 1px;
  background: rgba(255, 255, 255, .14); pointer-events: none;
}
.vfader-tick.vfader-unity {
  left: 0; right: 0; height: 1.5px;
  background: rgba(34, 211, 238, .65); box-shadow: 0 0 6px rgba(34, 211, 238, .4);
}
.vfader-slot {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; transform: translateX(-50%);
  border-radius: 999px; background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .1);
}
.vfader-fill {
  position: absolute; left: 50%; bottom: 0; width: 4px; transform: translateX(-50%);
  border-radius: 999px; background: linear-gradient(to top, var(--violet), var(--pink));
  pointer-events: none;
}
.group-fader .vfader-fill { background: var(--gc); }
.master-fader .vfader-fill { background: #22d3ee; }
.vfader-cap {
  position: absolute; left: 2px; right: 2px; height: 18px; border-radius: 4px;
  background: linear-gradient(180deg, #4b3869, #241738);
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .65), inset 0 8px 0 rgba(255, 255, 255, .08);
  pointer-events: none; transition: border-color .12s, box-shadow .12s;
}
.vfader-cap::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 8px; height: 2px;
  background: #fff; border-radius: 1px;
}
.vfader-track:hover .vfader-cap, .vfader-track.dragging .vfader-cap {
  border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 61, 139, .55);
}
.vu-meter { width: 9px; height: 148px; border-radius: 999px; background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .09); display: flex; align-items: flex-end; overflow: hidden; }
.vu-fill { width: 100%; height: 0%; background: linear-gradient(to top, #4ade80 0%, #facc15 72%, #ff3d8b 95%); transition: height 55ms linear; border-radius: 999px; }
.ch-fader-val { text-align: center; font-size: .71rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

.console-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--border); }

/* Sidebar Gigs & Stage bar */
.gigs-bar { display: flex; align-items: center; gap: 6px; padding: 0 14px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; flex-wrap: wrap; }
.chip.gigs-chip { --c: #22d3ee; }
.stage-launch { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; background: var(--grad); color: #fff; font-size: .78rem; font-weight: 700; text-decoration: none; box-shadow: 0 2px 12px rgba(255, 61, 139, .32); transition: filter .2s, transform .15s; }
.stage-launch:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-select { padding: 7px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; cursor: pointer; background: rgba(255, 255, 255, .05); }

/* Gig lists & Setlist builder */
.gigs-page, .gig-detail { max-width: 960px; display: flex; flex-direction: column; gap: 18px; }
.card-panel { background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.card-panel h3 { margin: 0; }
.small-copy { margin: 0; font-size: .85rem; line-height: 1.5; }
.gig-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gig-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; transition: transform .18s, border-color .2s, box-shadow .2s; }
.gig-card:hover { transform: translateY(-2px); border-color: #22d3ee; box-shadow: 0 8px 26px rgba(34, 211, 238, .14); }
.gig-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gig-card h3 { margin: 0; font-size: 1.15rem; color: var(--text); text-transform: none; letter-spacing: 0; }
.gig-date { font-size: .78rem; color: #22d3ee; font-weight: 700; white-space: nowrap; }
.gig-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; font-size: .82rem; color: var(--muted); }
.back-link { font-size: .82rem; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--orange); }
.gig-heading { margin: 4px 0 0; font-size: 2rem; }
.gig-stats { margin: 4px 0 0; font-size: .9rem; }
.adder-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr) auto auto; gap: 8px; align-items: center; }
.setlist-items { display: flex; flex-direction: column; gap: 6px; }
.setlist-row { display: grid; grid-template-columns: 36px minmax(160px, 1.4fr) auto minmax(140px, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s, background .15s; }
.setlist-row:hover { border-color: rgba(255, 255, 255, .28); }
.setlist-row.dragging { opacity: .45; }
.setlist-row.break-row { background: rgba(155, 107, 255, .1); border-style: dashed; border-color: rgba(155, 107, 255, .4); grid-template-columns: 36px 1fr minmax(140px, 1fr) auto; }
.slot-num { font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; text-align: center; cursor: grab; user-select: none; }
.break-row .slot-num { color: var(--violet); }
.slot-song a { color: var(--text); font-weight: 700; text-decoration: none; }
.slot-song a:hover { color: var(--orange); }
.slot-song small { display: block; color: var(--muted); font-size: .78rem; }
.slot-badges { display: flex; gap: 5px; flex-wrap: wrap; font-size: .75rem; }
.slot-badge { padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--muted); font-weight: 600; white-space: nowrap; }
.slot-badge.warn { color: var(--orange); background: rgba(255, 159, 67, .14); border: 1px solid rgba(255, 159, 67, .35); }
.slot-cue { padding: 5px 9px; font-size: .82rem; border-radius: 6px; width: 100%; }
.slot-controls { display: flex; gap: 4px; }
.icon-btn { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: rgba(255, 255, 255, .04); color: var(--muted); cursor: pointer; font: inherit; font-size: .8rem; }
.icon-btn:hover:not(:disabled) { color: var(--text); border-color: rgba(255, 255, 255, .35); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.save-status { font-size: .82rem; }

/* Song list table & unified filter bar */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.table-filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.table-search {
  flex: 1 1 240px; max-width: 380px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: .88rem;
}
.table-stages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stage-filter-pill {
  --c: var(--pink);
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px;
  border-radius: 999px; border: 1px solid var(--border); background: rgba(255, 255, 255, .04);
  color: var(--muted); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.stage-filter-pill:hover { color: var(--text); border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.stage-filter-pill.active {
  color: #fff; border-color: color-mix(in srgb, var(--c) 75%, transparent);
  background: color-mix(in srgb, var(--c) 24%, transparent);
}
.stage-filter-pill small { opacity: .75; font-weight: 600; font-variant-numeric: tabular-nums; }
.stem-table-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--border); background: rgba(255, 255, 255, .04);
  font-size: .78rem; color: #22d3ee !important;
}
.stem-table-link:hover { border-color: #22d3ee; background: rgba(34, 211, 238, .12); }
.song-table h2 { margin: 0; font-size: 1.9rem; display: flex; align-items: center; gap: 10px; }
.song-table[style] .list-title { color: var(--c); text-shadow: 0 0 24px color-mix(in srgb, var(--c) 50%, transparent); }
.folder-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--c); box-shadow: 0 0 14px var(--c); transform: rotate(45deg); animation: spin-in .5s ease-out both; }
@keyframes spin-in { from { transform: rotate(-135deg) scale(0); } }
.song-table[style] table { border-color: color-mix(in srgb, var(--c) 35%, transparent); }
.pill { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; color: var(--c) !important; background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); vertical-align: 2px; }
.folder-badge { display: inline-block; margin-top: 10px; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; text-decoration: none; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); transition: box-shadow .2s; }
.folder-badge::before { content: "▣ "; }
.folder-badge:hover { box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
.song-table h2 small { color: var(--muted); font-weight: 400; font-size: 1rem; }
table { width: 100%; border-collapse: collapse; background: var(--panel); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
tbody tr { animation: rise .4s ease-out both; animation-delay: min(calc(var(--i, 0) * 40ms), 600ms); transition: background .2s; }
tbody tr:hover { background: rgba(255, 61, 139, .07); }
tbody tr.playing { background: linear-gradient(90deg, rgba(255, 61, 139, .2), rgba(155, 107, 255, .08)); }
tbody tr:last-child td { border-bottom: 0; }
td a { color: inherit; font-weight: 700; text-decoration: none; transition: color .2s; }
td a:hover { color: var(--orange); }
td small { display: block; color: var(--muted); }
td.player { width: 45%; min-width: 240px; }
td.player audio { width: 100%; height: 36px; display: block; }

/* Equalizer shown next to whatever is playing */
.eq { display: none; gap: 2px; height: 13px; width: 15px; align-items: flex-end; margin-left: 8px; vertical-align: -1px; }
.playing .eq { display: inline-flex; }
.eq i { flex: 1; border-radius: 1px; background: var(--pink); animation: eq .8s ease-in-out infinite alternate; }
.eq i:nth-child(2) { background: var(--orange); animation-delay: -.3s; animation-duration: .65s; }
.eq i:nth-child(3) { background: var(--violet); animation-delay: -.55s; animation-duration: .9s; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }

/* Song page (Compact Header + Reference Bar + Sheet-First Layout) */
.song-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.song-title-block { min-width: 0; }
.song-head h2 { margin: 0; font-size: 2.2rem; line-height: 1.12; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.song-subline { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin-top: 6px; }
.artist { margin: 0; color: var(--muted); font-size: 1.02rem; font-weight: 600; }
.song-subline .folder-badge { margin-top: 0; padding: 2px 10px; font-size: .76rem; }
.stage-select {
  --sc: #22d3ee;
  padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; cursor: pointer;
  color: var(--sc); border: 1px solid color-mix(in srgb, var(--sc) 55%, transparent);
  background: color-mix(in srgb, var(--sc) 14%, rgba(16, 8, 28, .85));
}
.stage-select:hover { border-color: var(--sc); }

/* Overflow ⋯ action menu */
.action-menu { position: relative; }
.action-menu > summary { list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.icon-more { padding: 4px 10px; font-weight: 900; letter-spacing: .06em; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 210px; padding: 8px; border-radius: 10px;
  background: var(--panel-solid); border: 1px solid var(--border);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .65);
  display: flex; flex-direction: column; gap: 6px;
}
.menu-field { font-size: .74rem; color: var(--muted); gap: 4px; padding: 2px 4px 6px; border-bottom: 1px solid var(--border); }
.menu-field select { font-size: .82rem; padding: 5px 8px; }
.menu-item {
  width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; border: 0;
  background: none; color: var(--text); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
}
.menu-item:hover { background: rgba(255, 255, 255, .07); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: rgba(255, 107, 107, .14); }

/* Merge Songs Modal Dialog */
.merge-dialog {
  width: min(540px, calc(100vw - 24px)); padding: 0; border-radius: 14px;
  border: 1px solid var(--border); background: var(--panel-solid); color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .75);
}
.merge-dialog::backdrop { background: rgba(5, 2, 10, .72); backdrop-filter: blur(3px); }
.merge-form { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.merge-form h3 { margin: 0; font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.merge-form h3 span { color: var(--orange); }
.merge-list {
  max-height: min(340px, 50vh); overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  padding: 4px 2px;
}
.merge-row {
  display: flex; flex-direction: row !important; align-items: center; gap: 10px !important;
  padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03); color: var(--text) !important; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.merge-row:hover { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); }
.merge-row.checked { border-color: #22d3ee; background: rgba(34, 211, 238, .12); }
.merge-row input[type=checkbox] { width: 17px; height: 17px; margin: 0; accent-color: #22d3ee; flex-shrink: 0; cursor: pointer; }
.merge-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.merge-row-body strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merge-row-body small { font-size: .76rem; color: var(--muted); }
.merge-take-pill {
  padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap; flex-shrink: 0;
}
.merge-take-pill.has-audio { color: #22d3ee; border-color: rgba(34, 211, 238, .4); background: rgba(34, 211, 238, .1); }
.merge-summary { margin: 0; font-size: .82rem; }
.merge-empty { padding: 14px 4px; text-align: center; }
.merge-actions { justify-content: flex-end; }

.song-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 18px;
  flex-wrap: wrap; margin: 12px 0 14px;
}
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.meta div {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 11px;
}
.meta dt { font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.meta dd { margin: 0; font-size: .85rem; font-weight: 700; color: var(--pink); }
.meta div:nth-child(3n+2) dd { color: var(--orange); }
.meta div:nth-child(3n) dd { color: #c3a3ff; }

/* Compact Reference Audio Bar right above Chords & Lyrics */
.ref-bar {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  max-width: 960px; padding: 8px 14px; margin: 0 0 14px;
  border-radius: var(--radius); background: var(--panel);
  border: 1px solid rgba(255, 159, 67, .35); transition: border-color .2s, box-shadow .2s;
}
.ref-bar.playing { border-color: rgba(255, 61, 139, .55); box-shadow: 0 0 24px rgba(255, 61, 139, .2); }
.ref-bar-title { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; }
.ref-star { color: var(--orange); }
.ref-bar audio { flex: 1 1 240px; height: 34px; min-width: 180px; }
.ref-spacer { flex: 1; }

/* Collapsible Form & Card Disclosures */
.form-disclosure, .card-disclosure {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(255, 255, 255, .025); overflow: hidden;
}
.card-disclosure { background: var(--panel); }
.form-disclosure > summary, .card-disclosure > summary {
  padding: 10px 14px; cursor: pointer; font-weight: 700; font-size: .88rem;
  color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  user-select: none;
}
.form-disclosure > summary:hover, .card-disclosure > summary:hover { background: rgba(255, 255, 255, .04); }
.form-disclosure > summary small, .card-disclosure > summary small { font-weight: 400; font-size: .78rem; }
.disclosure-body {
  padding: 12px 14px 14px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.audio { padding: 12px 14px; max-width: 900px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); transition: box-shadow .3s, border-color .3s; }
.audio.playing { border-color: rgba(255, 61, 139, .5); box-shadow: 0 0 30px rgba(255, 61, 139, .25); }
.audio audio { width: 100%; display: block; }
.audio h3 { margin: 0 0 8px; }
.video video { width: 100%; max-width: 900px; max-height: 60vh; background: #000; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--orange); margin: 24px 0 8px; }
pre { white-space: pre-wrap; margin: 0; font: inherit; }
.sheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 32px; }
.sheet { position: relative; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1rem; line-height: 1.55; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; overflow: hidden; }
.sheet.lyrics { font-family: inherit; font-size: 1.05rem; line-height: 1.7; }
.sheet::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--grad); }

/* Forms */
.song-form { max-width: 900px; display: flex; flex-direction: column; gap: 14px; }
.song-form h2 { margin: 0; font-size: 1.8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.grid .wide { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: var(--muted); }
input, select, textarea { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: rgba(0, 0, 0, .28); color: var(--text); font: inherit; font-size: .95rem; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 61, 139, .22); }
select option { background: var(--panel-solid); }
textarea { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; background: rgba(255, 255, 255, .02); }
legend { color: var(--orange); font-size: .85rem; font-weight: 600; padding: 0 6px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--grad); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
progress { width: 100%; height: 8px; accent-color: var(--pink); }
.btn.small { padding: 4px 12px; font-size: .8rem; }
.bpm-tools { display: flex; gap: 4px; }
.bpm-tools button { flex: 1; padding: 3px 0; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: .78rem; cursor: pointer; transition: border-color .2s, background .2s; }
.bpm-tools button:hover { border-color: var(--pink); background: rgba(255, 61, 139, .12); }
.analysis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.analysis-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; color: var(--text); }
.analysis-status.busy { color: var(--orange); animation: pulse .8s ease-in-out infinite alternate; }
.analysis-status.error { color: var(--danger); }
@keyframes pulse { to { opacity: .4; } }
input.flash { animation: flash 1.4s ease-out; }
@keyframes flash { from { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 159, 67, .45); } }
.error { color: var(--danger); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
a.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; color: #c3a3ff; background: rgba(155, 107, 255, .12); border: 1px solid rgba(155, 107, 255, .3); text-decoration: none; transition: background .2s, border-color .2s, color .2s; }
a.tag::before { content: "#"; opacity: .55; margin-right: 1px; }
a.tag:hover { color: #fff; background: rgba(155, 107, 255, .3); border-color: var(--violet); }
.meta dd:has(a.tag) { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 3px; }
.meta dd a.tag { font-size: .8rem; }
.chip.tags-chip, .chip.tags-chip.active { --c: var(--violet); }
.tag-cloud-view h2 { margin: 0 0 20px; font-size: 1.9rem; }
.tag-cloud-view h2 small { color: var(--muted); font-weight: 400; font-size: 1rem; }
.tag-cloud { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 10px 18px; max-width: 900px; padding: 28px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.tag-cloud a.tag { font-size: calc(var(--size) * 1rem); padding: 2px 12px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border-color: color-mix(in srgb, var(--c) 35%, transparent); animation: pop .4s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: min(calc(var(--i) * 25ms), 500ms); }
.tag-cloud a.tag:hover { color: #fff; background: color-mix(in srgb, var(--c) 35%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 45%, transparent); }
.tag-cloud a.tag small { margin-left: 5px; font-size: .6em; color: var(--muted); font-weight: 500; }

/* Votes and emoji reactions */
.song-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.votes, .reactions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vote, .rx { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.vote b, .rx b { font-weight: 700; font-variant-numeric: tabular-nums; }
.vote:hover, .rx:hover { transform: translateY(-1px); }
.vote.up { color: #4ade80; } .vote.up:hover { border-color: #4ade80; background: rgba(74, 222, 128, .12); }
.vote.down { color: var(--danger); } .vote.down:hover { border-color: var(--danger); background: rgba(255, 107, 107, .12); }
.rx .emoji { font-size: 1.05rem; line-height: 1; }
.rx:hover { border-color: var(--orange); background: rgba(255, 159, 67, .12); }
.rx.add { color: var(--muted); border-style: dashed; }
.vote:disabled, .rx:disabled { cursor: progress; transform: none; }
/* Press and hold removes one, so keep phones from selecting text or opening a callout. */
.vote, .rx { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.undo-toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: .9rem; animation: rise .25s ease-out both; }
.bump { animation: bump .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 50% { transform: scale(1.25); } }

.emoji-picker { position: fixed; z-index: 10; width: min(340px, calc(100vw - 16px)); max-height: min(360px, 70vh); display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .55); animation: pop .2s ease-out both; }
.emoji-all { overflow-y: auto; padding: 0 8px 8px; }
.emoji-picker h4 { margin: 10px 4px 4px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.emoji-grid.quick { padding: 8px; border-bottom: 1px solid var(--border); }
.emoji-grid button { padding: 4px 0; border: 0; border-radius: 8px; background: none; font-size: 1.35rem; line-height: 1.3; cursor: pointer; transition: background .15s, transform .15s; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: rgba(255, 255, 255, .1); transform: scale(1.2); outline: none; }

/* Compact counts in the song lists */
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .8rem; color: var(--text); }
.summary b { margin-left: 2px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.sum-votes { display: inline-flex; gap: 4px; font-weight: 700; }
.sum-votes .up { color: #4ade80; } .sum-votes .down { color: var(--danger); }
#song-list .summary { margin-top: 4px; }
td.buzz { min-width: 150px; }

/* Comments */
.comments { max-width: 900px; margin-top: 28px; }
.comments h3 { margin-top: 0; }
.composer { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(0, 0, 0, .25); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 61, 139, .22); }
.toolbar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); }
.tool { min-width: 30px; padding: 3px 6px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; }
.tool:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.fmt-toggle { font-size: .8rem; font-weight: 800; border: 1px solid var(--border); padding: 2px 8px; }
.fmt-toggle.active { border-color: var(--pink); color: #fff; background: rgba(255, 61, 139, .18); }
.tool-bold { font-weight: 800; } .tool-italic { font-style: italic; font-family: Georgia, serif; } .tool-strikeThrough { text-decoration: line-through; }
.editor { position: relative; min-height: 64px; max-height: 300px; overflow-y: auto; padding: 10px 12px; outline: none; line-height: 1.5; overflow-wrap: anywhere; }
.editor.empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; position: absolute; }
.composer-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 6px 8px; }
.composer-actions small { margin-right: auto; font-size: .75rem; }
.btn.primary:disabled { cursor: not-allowed; opacity: .45; }

.comment-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.comment-list.expanded { max-height: 70vh; overflow-y: auto; padding-right: 6px; }
.thread { display: flex; flex-direction: column; gap: 8px; animation: rise .3s ease-out both; }
.thread > .composer { margin-left: 28px; }
.comment { padding: 10px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.comment time { font-size: .75rem; color: var(--muted); }
.replies { display: flex; flex-direction: column; gap: 8px; margin-left: 28px; padding-left: 12px; border-left: 2px solid color-mix(in srgb, var(--violet) 45%, transparent); }
.comment-body, .editor { overflow-wrap: anywhere; }
.comment-body { margin: 4px 0 8px; line-height: 1.5; }
.comment-body > :first-child, .editor > :first-child { margin-top: 0; }
.comment-body > :last-child, .editor > :last-child { margin-bottom: 0; }
.comment-body p, .editor p { margin: 0 0 .5em; }
.comment-body ul, .comment-body ol, .editor ul, .editor ol { margin: .3em 0; padding-left: 1.4em; }
.comment-body blockquote, .editor blockquote { margin: .4em 0; padding: 2px 12px; border-left: 3px solid var(--orange); color: var(--muted); }
.comment-body a, .editor a { color: var(--orange); }
.comment-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.comment-bar .vote, .comment-bar .rx { padding: 2px 8px; font-size: .78rem; }
.link-btn { padding: 2px 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; }
.link-btn:first-of-type { margin-left: auto; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.link-btn.danger:hover { color: var(--danger); }
.show-more { margin-top: 10px; }

/* Login */
.login-page { display: grid; place-items: center; grid-template-columns: 1fr; padding: 20px; }
.login-box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; background: var(--panel); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; animation: rise .5s ease-out both, glow 4s ease-in-out infinite alternate; }
.login-box .logo { font-size: 2rem; text-align: center; }
.tagline { margin: -10px 0 6px; text-align: center; color: var(--muted); font-size: .9rem; letter-spacing: .2em; text-transform: uppercase; }
@keyframes glow {
  from { box-shadow: 0 0 40px rgba(255, 61, 139, .18); }
  to   { box-shadow: 0 0 60px rgba(155, 107, 255, .28); }
}
.sidebar-footer {
  margin-top: auto; border-top: 1px solid var(--border); padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.storage { flex: 1; min-width: 0; margin: 0; font-size: .72rem; color: var(--muted); }
.storage-bar { position: relative; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 4px 0 0; }
.storage-bar span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; }
.storage-bar .used { background: rgba(190, 145, 255, .35); }
.storage-bar .app { background: var(--grad); }
.storage.low .storage-free { color: var(--danger); }
.storage.low .storage-bar .used { background: var(--danger); }
.logout { flex-shrink: 0; margin: 0; color: var(--muted); font: inherit; font-size: .8rem; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: color .2s, background .2s; }
.logout:hover { color: var(--pink); background: rgba(255, 61, 139, .1); }

@media (max-width: 760px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #collapsed-bar { display: flex !important; }
  #sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); height: 100dvh;
    z-index: 25; background: var(--panel-solid); border-right: 1px solid var(--border);
    box-shadow: 14px 0 40px rgba(0, 0, 0, .7);
  }
  body.sidebar-collapsed #sidebar { display: none; }
  main { padding: 18px 16px; }
  .grid .wide { grid-column: 1 / -1; }
  .song-head { flex-direction: column; }
  .song-head h2 { font-size: 1.9rem; }
  th:nth-child(2), td:nth-child(2), th:nth-child(4), td:nth-child(4) { display: none; }
  td.player { min-width: 160px; }
  .replies, .thread > .composer { margin-left: 12px; }
  .adder-row { grid-template-columns: 1fr; }
  .setlist-row, .setlist-row.break-row { grid-template-columns: 28px 1fr auto; }
  .slot-badges, .slot-cue { grid-column: 2 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
