/* CCTA Multitracks — diseño sobrio: negro, grises neutros y un solo acento */
@font-face { font-family: 'InterVar'; font-weight: 100 900; font-style: normal; src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2'); font-display: block; }
@font-face { font-family: 'InterVar'; font-weight: 100 900; font-style: normal; src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; font-display: block; }

:root {
  --accent: #3dd17f;
  --accent-ink: #06140c;
  --bg: #0e0e0f;
  --bg-1: #141415;
  --bg-2: #1a1a1c;
  --bg-3: #212123;
  --bg-4: #2a2a2d;
  --line: #262628;
  --line-2: #323235;
  --text: #ececee;
  --text-2: #a1a1a6;
  --text-3: #6c6c71;
  --red: #ff5a52;
  --yellow: #f4c542;
  --font: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'InterVar', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --font-d: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'InterVar', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
}
:root[data-accent='dorado'] { --accent: #e2b453; --accent-ink: #1a1203; }
:root[data-accent='azul'] { --accent: #3f8cff; --accent-ink: #050d1c; }
:root[data-accent='blanco'] { --accent: #f2f2f4; --accent-ink: #111; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body { font: 400 13px/1.35 var(--font); letter-spacing: -0.003em; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; font-feature-settings: 'tnum' 1, 'cv11' 1; }
input, textarea, select { user-select: text; -webkit-user-select: text; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: default; border: 0; background: none; padding: 0; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ======================================================================= Barra superior */
.app { display: grid; grid-template-rows: 72px minmax(0, 1fr); height: 100vh; }
.toolbar { display: flex; gap: 6px; padding: 8px; background: var(--bg); border-bottom: 1px solid var(--line); -webkit-app-region: drag; }
.toolbar > * { -webkit-app-region: no-drag; }
.tb { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; min-width: 56px; padding: 0 14px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); transition: background 0.1s; }
.tb:hover { background: var(--bg-3); }
.tb:active { background: var(--bg-4); }
.tb .ico { width: 26px; height: 26px; }
.tb.text { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-2); }
.tb.on { color: var(--accent); }
.tb.flex { flex: 1; }
.tb.play { color: var(--accent); }
.tb.play .ico { width: 30px; height: 30px; }
.lcd { display: flex; flex-direction: column; justify-content: center; height: 56px; border-radius: 6px; background: var(--bg-1); border: 1px solid var(--line); padding: 0 12px; flex: none; }
.lcd.bpm { width: 64px; align-items: center; padding: 0 6px; }
.lcd.bpm b { font: 600 17px var(--font-d); }
.lcd.bpm span { font-size: 12px; color: var(--text-2); border-top: 1px solid var(--line-2); width: 100%; text-align: center; margin-top: 2px; padding-top: 1px; }
.lcd.time { width: 150px; align-items: center; }
.lcd.time b { font: 300 26px/1 var(--font-d); letter-spacing: 0.01em; }
.lcd.time span { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }
.lcd.sec { width: 210px; align-items: flex-start; }
.lcd.sec .now { font: 600 15px var(--font-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lcd.sec .next { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lcd.sec .next b { color: var(--accent); font-weight: 600; }
.lcd .beats { display: flex; gap: 4px; margin-top: 5px; }
.lcd .beats i { width: 6px; height: 6px; border-radius: 50%; background: var(--bg-4); }
.lcd .beats i.on { background: var(--text); }
.lcd .beats i.on.first { background: var(--accent); }

.popover { position: fixed; z-index: 60; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); padding: 12px; animation: pop 0.12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu { padding: 6px; min-width: 230px; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 6px; color: var(--text); width: 100%; text-align: left; }
.menu-item:hover { background: var(--accent); color: var(--accent-ink); }
.menu-item .ico { width: 16px; height: 16px; }
.menu-item small { margin-left: auto; color: var(--text-3); }
.menu-item:hover small { color: inherit; opacity: 0.7; }
.menu-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }

/* ======================================================================= Controles comunes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 6px; font-weight: 500; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--text); white-space: nowrap; transition: background 0.1s; }
.btn:hover { background: var(--bg-4); }
.btn:active { filter: brightness(0.92); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-3); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn .ico { width: 15px; height: 15px; }
.btn.on { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-3)); }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--text-2); }
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.icon-btn .ico { width: 16px; height: 16px; }
.input, .select, .textarea { width: 100%; height: 30px; padding: 0 10px; border-radius: 6px; background: var(--bg-1); border: 1px solid var(--line-2); outline: none; }
.input:focus, .select:focus { border-color: var(--accent); }
.select { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px; background-size: 4px 4px; background-repeat: no-repeat; }
.select option { background: var(--bg-2); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 7px; }
.seg button { height: 24px; padding: 0 10px; border-radius: 5px; color: var(--text-2); font-size: 12px; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg-4); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.toggle { display: inline-flex; align-items: center; gap: 8px; }
.toggle input { display: none; }
.toggle .track { width: 34px; height: 20px; border-radius: 10px; background: var(--bg-4); position: relative; transition: background 0.15s; flex: none; }
.toggle .track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(14px); }
.toggle .lbl { color: var(--text-2); font-size: 12px; }
.hslider { -webkit-appearance: none; appearance: none; width: 100%; height: 3px; border-radius: 2px; background: var(--bg-4); outline: none; }
.hslider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #e9e9eb; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.mt { margin-top: 12px; }
.mt-s { margin-top: 8px; }
.small { font-size: 12px; }
kbd { font: 500 11px var(--font); padding: 1px 6px; border-radius: 4px; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--text); }

/* ======================================================================= En vivo */
.view { min-height: 0; overflow: hidden; position: relative; }
.live { display: grid; grid-template-rows: 154px minmax(150px, 1fr) 44px 292px; height: 100%; }

/* --- setlist (carrusel de portadas) */
.carousel { display: flex; gap: 8px; padding: 10px 8px 6px; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--line); scroll-behavior: smooth; }
.song-card { flex: none; width: 206px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.song-card .art { width: 206px; height: 112px; border-radius: 4px; object-fit: cover; background: var(--bg-2); border: 2px solid transparent; display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.song-card .art .ico { width: 30px; height: 30px; }
.song-card .art.click-art { background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); font: 600 20px var(--font-d); color: var(--text-2); }
.song-card .ttl { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.song-card .ttl span { overflow: hidden; text-overflow: ellipsis; }
.song-card .ttl em { font-style: normal; color: var(--text-3); flex: none; }
.song-card .ttl .ico { width: 12px; height: 12px; color: var(--accent); }
.song-card.loaded .art { border-color: var(--accent); }
.song-card.loaded .ttl { color: var(--text); font-weight: 600; }
.song-card.cued .art { border-color: color-mix(in srgb, var(--accent) 45%, transparent); border-style: dashed; }
.song-card .badge { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--text-2); }
.song-card .badge .ico { width: 12px; height: 12px; }
.song-card .badge.on { background: var(--text); color: #111; border-color: transparent; }
.song-card .num { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); color: var(--text-2); }
.song-card.dragging { opacity: 0.35; }
.song-card.drop-before::before { content: ''; position: absolute; left: -5px; top: 0; height: 112px; width: 2px; background: var(--accent); }
.song-card.add .art { border: 1px dashed var(--line-2); background: transparent; }
.song-card.add:hover .art { color: var(--text); border-color: var(--text-3); }
.song-card .prog { position: absolute; left: 2px; right: 2px; top: 108px; height: 2px; }
.song-card .prog i { display: block; height: 100%; background: var(--accent); width: 0; }

/* --- onda + secciones */
.wave-area { position: relative; min-height: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.wave { position: absolute; inset: 0; overflow: hidden; }
.wave canvas { position: absolute; inset: 0; display: block; }
.wave .reveal { position: absolute; inset: 0; overflow: hidden; pointer-events: none; will-change: transform; z-index: 1; }
.wave .reveal canvas { will-change: transform; }
.wave .playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.35); will-change: transform; pointer-events: none; z-index: 3; }
.wave .markers { position: absolute; left: 0; right: 0; top: 10px; height: 26px; z-index: 4; pointer-events: none; }
.marker { position: absolute; display: flex; align-items: center; gap: 4px; pointer-events: auto; transform: translateX(4px); }
.marker .badge { min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; border: 1.5px solid var(--c); color: var(--c); background: rgba(14, 14, 15, 0.85); font: 600 11px var(--font); display: grid; place-items: center; transition: background 0.1s; }
.marker .badge:hover { background: color-mix(in srgb, var(--c) 25%, #0e0e0f); }
.marker.cur .badge { background: var(--c); color: #0e0e0f; }
.marker.queued .badge { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); animation: blink 0.9s ease-in-out infinite; }
.marker .loop { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); background: rgba(14, 14, 15, 0.6); }
.marker .loop:hover { color: var(--text); }
.marker .loop .ico { width: 15px; height: 15px; }
.marker .loop.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, #0e0e0f); }
.marker .loop.armed { color: var(--accent); }
@keyframes blink { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 20%, transparent); } }
.wave .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); text-align: center; }
.wave .empty h2 { font: 600 20px var(--font-d); color: var(--text-2); margin: 0 0 6px; }
.loading-overlay { position: absolute; inset: 0; background: rgba(14, 14, 15, 0.8); display: grid; place-items: center; z-index: 10; }
.loading-overlay .box { width: 280px; text-align: center; }
.loading-bar { height: 2px; background: var(--bg-4); border-radius: 1px; overflow: hidden; margin-top: 8px; }
.loading-bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.15s; }

/* --- barra de control bajo la onda */
.ctrlbar { display: flex; align-items: center; gap: 6px; padding: 0 8px; border-bottom: 1px solid var(--line); background: var(--bg-1); overflow: hidden; }
.ctrlbar .sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; flex: none; }
.ctrlbar .lbl { font-size: 11.5px; color: var(--text-3); margin-right: 2px; }
.ctrlbar .grow { flex: 1; }
.stepper { display: inline-flex; align-items: center; height: 28px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-2); overflow: hidden; flex: none; }
.stepper > span { padding: 0 8px; font-size: 11.5px; color: var(--text-3); }
.stepper b { min-width: 48px; text-align: center; font-weight: 600; font-size: 12.5px; }
.stepper button { width: 26px; height: 100%; color: var(--text-2); font-size: 15px; }
.stepper button:hover { background: var(--bg-3); color: var(--text); }
.stepper.changed b { color: var(--accent); }

/* --- mezclador */
.mixer { display: flex; min-height: 0; background: var(--bg-1); }
.strips { display: flex; overflow-x: auto; overflow-y: hidden; flex: 1; padding: 0 2px; }
.strips.fixed { flex: none; border-left: 1px solid var(--line); background: var(--bg); padding: 0 4px; }
.strip { width: 84px; flex: none; display: grid; grid-template-rows: 30px minmax(0, 1fr) 34px; justify-items: center; border-right: 1px solid var(--line); position: relative; }
.strips.fixed .strip:last-child { border-right: 0; }
.strip .top { display: flex; gap: 4px; align-items: center; justify-content: flex-start; width: 100%; padding: 6px 6px 0; }
.strip .top button { width: 22px; height: 20px; border-radius: 4px; font-size: 10.5px; font-weight: 600; color: var(--text-3); background: var(--bg-2); border: 1px solid var(--line-2); }
.strip .top button:hover { color: var(--text); }
.strip .top .m.on { background: var(--red); border-color: transparent; color: #fff; }
.strip .top .s.on { background: var(--yellow); border-color: transparent; color: #1a1400; }
.strip .top .bus { margin-left: auto; width: 22px; display: grid; place-items: center; }
.strip .top .bus .ico { width: 12px; height: 12px; }
.strip .top .bus.monitor { color: var(--accent); }
.strip .name { align-self: center; font-size: 12px; color: var(--text-2); width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.strip .name::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #777); margin-right: 5px; vertical-align: 1px; }
.strip.dim .name { color: var(--text-3); }
.strip.master .name { color: var(--text); font-weight: 600; }
.fader { display: flex; gap: 6px; height: 100%; padding: 6px 0 2px; position: relative; }
.fader-meter { position: relative; width: 4px; height: 100%; border-radius: 2px; background: #000; overflow: hidden; contain: strict; }
.fader-meter { background: linear-gradient(to top, #2fa866 0%, #3dd17f 72%, #f4c542 88%, #ff5a52 100%); }
.fader-meter .fill { position: absolute; inset: 0; background: #000; transform-origin: 50% 0; transform: scaleY(1); will-change: transform; }
.fader-meter .pk { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: #bdbdc2; opacity: 0; will-change: transform; }
.fader-meter .pk.clip { background: #ff5a52; }
.fader-track { position: relative; width: 36px; height: 100%; cursor: ns-resize; touch-action: none; }
.fader-track::before { content: ''; position: absolute; left: 17px; top: 0; bottom: 0; width: 2px; background: #000; border-radius: 1px; box-shadow: 0 0 0 1px var(--line-2); }
.fader-track .unity { position: absolute; left: 6px; right: 6px; height: 1px; background: var(--text-3); opacity: 0.5; }
.fader-fill { display: none; }
.fader-thumb { position: absolute; left: 2px; width: 32px; height: 24px; border-radius: 3px; background: linear-gradient(180deg, #3a3a3e, #2a2a2d 45%, #232326); border: 1px solid #47474b; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.55); }
.fader-thumb::after { content: ''; position: absolute; left: 3px; right: 3px; top: 10px; height: 2px; border-radius: 1px; background: #f0f0f2; }
.fader-tip { position: absolute; left: 50%; transform: translateX(-50%); top: -2px; font-size: 10.5px; color: var(--text-2); background: var(--bg-3); padding: 1px 5px; border-radius: 4px; pointer-events: none; opacity: 0; transition: opacity 0.15s; white-space: nowrap; z-index: 2; }
.fader.active .fader-tip { opacity: 1; }
.mixer-empty { flex: 1; display: grid; place-items: center; color: var(--text-3); }

/* --- pads (popover) */
.pads-pop { width: 300px; }
.pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 600; }
.pop-head .grow { flex: 1; }
.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.keys button { height: 40px; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; }
.keys button:hover { background: var(--bg-4); }
.keys button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.keys button.sug { border-color: var(--text-3); }
.power { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--text-2); }
.power .ico { width: 15px; height: 15px; }
.power.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.pop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.pop-row .select { width: 150px; height: 28px; }
.pop-row .hslider { width: 150px; }

/* ======================================================================= Vistas de página (biblioteca, editor, ajustes) */
.page { height: 100%; overflow-y: auto; background: var(--bg); }
.page-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: rgba(14, 14, 15, 0.92); border-bottom: 1px solid var(--line); }
.page-head h2 { margin: 0; font: 600 18px var(--font-d); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head .search { width: 260px; }

/* --- biblioteca */
.library { display: grid; grid-template-columns: 230px minmax(0, 1fr) 320px; height: 100%; }
.lib-side { background: var(--bg-1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 10px 8px; }
.lib-side .list { flex: 1; overflow-y: auto; }
.side-h { font-size: 11px; font-weight: 600; color: var(--text-3); padding: 14px 8px 6px; }
.lib-sl { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px; color: var(--text-2); }
.lib-sl:hover { background: var(--bg-2); color: var(--text); }
.lib-sl.on { background: var(--bg-3); color: var(--text); }
.lib-sl .ico { width: 15px; height: 15px; }
.lib-sl small { margin-left: auto; color: var(--text-3); }
.lib-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.lib-grid { flex: 1; overflow-y: auto; padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 16px; align-content: start; }
.card { cursor: default; position: relative; }
.card .art { width: 100%; aspect-ratio: 16 / 9; border-radius: 5px; object-fit: cover; display: grid; place-items: center; background: var(--bg-2); color: var(--text-3); border: 1px solid var(--line); }
.card .art .ico { width: 30px; height: 30px; }
.card:hover .art { filter: brightness(1.08); }
.card .t { margin-top: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .a { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .m { display: flex; gap: 8px; margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.card .acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.card:hover .acts { opacity: 1; }
.card .acts button { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: rgba(14, 14, 15, 0.8); color: var(--text); }
.card .acts button:hover { background: var(--accent); color: var(--accent-ink); }
.card .acts .ico { width: 14px; height: 14px; }
.card .warn { position: absolute; left: 6px; top: 6px; font-size: 10.5px; font-weight: 600; background: rgba(14, 14, 15, 0.85); color: var(--yellow); padding: 2px 7px; border-radius: 4px; }
.lib-setlist { background: var(--bg-1); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.lib-setlist .head { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.lib-setlist .head .grow { flex: 1; }
.lib-setlist .items { flex: 1; overflow-y: auto; padding: 6px; }
.lib-setlist .foot { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 6px; }
.lib-setlist .foot .btn { flex: 1; }
.sl-row { display: grid; grid-template-columns: 18px 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px; border-radius: 6px; }
.sl-row:hover { background: var(--bg-2); }
.sl-row .num { color: var(--text-3); font-size: 12px; text-align: right; }
.sl-row .cv { width: 56px; height: 32px; border-radius: 3px; object-fit: cover; background: var(--bg-3); display: grid; place-items: center; color: var(--text-3); }
.sl-row .cv .ico { width: 14px; height: 14px; }
.sl-row .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-row .a { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-row.dragging { opacity: 0.35; }
.sl-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.drop-zone { position: absolute; inset: 10px; border: 1.5px dashed var(--accent); border-radius: 12px; background: rgba(14, 14, 15, 0.88); display: grid; place-items: center; z-index: 20; font: 600 16px var(--font-d); color: var(--accent); pointer-events: none; }
.empty-lib { grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: var(--text-2); }
.empty-lib h2 { font: 600 20px var(--font-d); color: var(--text); margin: 0 0 8px; }
.empty-lib p { max-width: 460px; margin: 0 auto 16px; }

/* --- grupos estilo Ajustes del sistema */
.group-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 22px 4px 8px; display: flex; align-items: center; gap: 8px; }
.group-title .grow { flex: 1; }
.group { background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 2px 14px; }
.group.pad { padding: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .l { min-width: 0; }
.set-row .l b { display: block; font-weight: 500; }
.set-row .l small { color: var(--text-3); font-size: 11.5px; }
.set-row .select { width: 230px; }
.tip { font-size: 12px; color: var(--text-3); margin: 8px 2px 0; }
.tip b { color: var(--text-2); font-weight: 600; }

/* --- editor */
.editor-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; padding: 4px 20px 40px; }
.stack { display: flex; flex-direction: column; }
.cover-edit { width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--bg-2); border: 1px dashed var(--line-2); display: grid; place-items: center; overflow: hidden; position: relative; color: var(--text-3); text-align: center; }
.cover-edit img { width: 100%; height: 100%; object-fit: cover; }
.cover-edit:hover { border-color: var(--text-3); }
.cover-edit .over { position: absolute; inset: auto 0 0 0; padding: 7px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); font-size: 12px; opacity: 0; transition: opacity 0.15s; }
.cover-edit:hover .over { opacity: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vstack { display: flex; flex-direction: column; gap: 10px; }
.ed-wave { position: relative; height: 140px; border-radius: 6px; background: var(--bg-1); border: 1px solid var(--line); overflow: hidden; cursor: crosshair; }
.ed-wave canvas { position: absolute; inset: 0; }
.ed-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.sec-row { display: grid; grid-template-columns: 6px 170px 100px auto 1fr 28px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sec-row:last-child { border-bottom: 0; }
.sec-row .sw { width: 6px; height: 22px; border-radius: 3px; }
.sec-row .input { height: 28px; }
.sec-row .nudge { display: flex; gap: 2px; }
.sec-row .nudge button { height: 26px; padding: 0 7px; border-radius: 5px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 11px; color: var(--text-2); }
.sec-row .nudge button:hover { color: var(--text); background: var(--bg-3); }
.sec-row.cur { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.arr { display: flex; flex-wrap: wrap; gap: 6px; }
.arr-item { display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 10px; border-radius: 15px; background: var(--bg-2); border: 1.5px solid var(--c); color: var(--c); font-weight: 600; font-size: 12px; }
.arr-item button { width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; color: var(--text-3); }
.arr-item button:hover { background: var(--bg-4); color: var(--text); }
.arr-item .ico { width: 12px; height: 12px; }
.arr-item.dragging { opacity: 0.35; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.chips-pick button { height: 26px; padding: 0 9px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); }
.chips-pick button::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.chips-pick button:hover { color: var(--text); background: var(--bg-3); }
.tr-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) 150px 170px 28px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tr-row:last-child { border-bottom: 0; }
.tr-row .col { width: 8px; height: 8px; border-radius: 50%; }
.tr-row .input, .tr-row .select { height: 28px; }
.ai-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, var(--bg-1)), var(--bg-1)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ai-box .ico { width: 22px; height: 22px; color: var(--accent); }
.ai-box .grow { flex: 1; }
.ai-box b { display: block; }
.ai-box small { color: var(--text-2); }

/* --- ajustes */
.settings-body { max-width: 760px; margin: 0 auto; padding: 0 20px 60px; }
.cue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; padding: 12px 0; }
.cue-cell { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 12.5px; }
.cue-cell span { flex: 1; }
.cue-cell.has { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.cue-cell.rec { border-color: var(--red); }
.cue-cell button { width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; color: var(--text-2); }
.cue-cell button:hover { background: var(--bg-4); color: var(--text); }
.cue-cell button.rec { color: var(--red); }
.cue-cell .ico { width: 14px; height: 14px; }
.keys-table { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; padding: 12px 0; font-size: 12.5px; }
.about { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.about img { width: 54px; height: 54px; border-radius: 12px; }
.accent-pick { display: flex; gap: 8px; }
.accent-pick button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; }
.accent-pick button.on { border-color: var(--text); }

/* ======================================================================= Modales / avisos */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; z-index: 100; animation: fade 0.12s; }
.modal { width: min(420px, 92vw); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.modal.wide { width: min(620px, 94vw); max-height: 86vh; display: flex; flex-direction: column; }
.modal h3 { margin: 0 0 8px; font: 600 16px var(--font-d); }
.modal p { margin: 0 0 10px; }
.modal .list { overflow-y: auto; margin: 8px 0; flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 6px; }
.pick-row:hover { background: var(--bg-3); }
.pick-row img, .pick-row .ph { width: 56px; height: 32px; border-radius: 3px; object-fit: cover; background: var(--bg-3); display: grid; place-items: center; color: var(--text-3); flex: none; }
.pick-row .grow { flex: 1; min-width: 0; }
.pick-row.sel { background: color-mix(in srgb, var(--accent) 18%, transparent); }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 310px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 200; pointer-events: none; align-items: center; }
.toast { padding: 8px 14px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--line-2); font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: fade 0.15s; }
.toast.err { border-color: color-mix(in srgb, var(--red) 60%, var(--line-2)); }
.toast.out { opacity: 0; transition: opacity 0.3s; }

/* --- cajas de editor y ajustes (estilo agrupado) */
.editor, .settings { height: 100%; overflow-y: auto; background: var(--bg); }
.editor-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: rgba(14, 14, 15, 0.92); border-bottom: 1px solid var(--line); }
.editor-head h2 { margin: 0; font: 600 17px var(--font-d); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-box { background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 16px; }
.card-box h3 { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; letter-spacing: 0; text-transform: none; }
.card-box h3 .ico { width: 15px; height: 15px; }
.card-box h3 .grow { flex: 1; }
.settings-body .card-box { margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--bg-3); color: var(--text-2); font-size: 11px; font-weight: 600; }
.chip.gold { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-3)); }
.chip .ico { width: 13px; height: 13px; }
.ai-box { margin-bottom: 12px; }
.ai-box.err .ico { color: #ef6461; }
.ai-box .loading-bar { height: 4px; margin-top: 0; }

/* --- ordenar setlist en vivo, transición pendiente, paneo */
.carousel.reorder .song-card:not(.add) .art { filter: brightness(0.75); }
.carousel.reorder .song-card:not(.add) { cursor: grab; }
.song-card .mv { position: absolute; left: 0; right: 0; top: 38px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.song-card .mv button, .song-card .mv .grip { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(14, 14, 15, 0.88); border: 1px solid var(--line-2); color: var(--text); }
.song-card .mv button:disabled { opacity: 0.3; }
.song-card .mv button:first-child .ico { transform: none; }
.song-card .mv button:last-child .ico { transform: none; }
.song-card .mv .grip { color: var(--text); cursor: grab; }
.song-card .mv .ico { width: 16px; height: 16px; }
.song-card.add.order.on .art { border-color: var(--accent); color: var(--accent); border-style: solid; }
.song-card.pending .art { border-color: var(--accent); border-style: dashed; animation: pendpulse 1s ease-in-out infinite; }
.song-card .pend { position: absolute; left: 6px; bottom: 30px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--accent); color: #06130b; }
@keyframes pendpulse { 50% { border-color: transparent; } }
.ctrlbar .btn.on { background: var(--accent); color: #06130b; border-color: transparent; }
.strip { grid-template-rows: 30px 22px minmax(0, 1fr) 34px; }
.strip .pan { display: flex; align-items: center; gap: 4px; width: 100%; padding: 0 8px; }
.strip .pan input { flex: 1; min-width: 0; height: 14px; -webkit-appearance: none; appearance: none; background: transparent; }
.strip .pan input::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--bg-4), var(--bg-4)) ; }
.strip .pan input::-webkit-slider-thumb { -webkit-appearance: none; width: 9px; height: 9px; margin-top: -3px; border-radius: 50%; background: var(--text-2); }
.strip .pan span { width: 26px; text-align: right; font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.live { grid-template-rows: 154px minmax(150px, 1fr) 48px 300px; }
.ctrlbar .btn { height: 34px; font-size: 13px; }
.remote-info { margin-top: 10px; padding: 12px 14px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line-2); }
.remote-info .url { font: 600 17px ui-monospace, Menlo, Consolas, monospace; color: var(--accent); user-select: text; margin-bottom: 4px; }
/* --- recorrido guiado */
.tour { position: fixed; inset: 0; z-index: 300; }
.tour-hole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72); border: 2px solid var(--accent); transition: all 0.25s ease; pointer-events: none; }
.tour-card { position: fixed; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); transition: top 0.25s ease, left 0.25s ease; }
.tour-n { font-size: 11px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.tour-t { font: 600 17px var(--font-d); margin-bottom: 6px; }
.tour-x { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.tour-b { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.tour-b .grow { flex: 1; }
.strip { grid-template-columns: minmax(0, 1fr); }
.strip > * { min-width: 0; max-width: 100%; }
.strip .pan input { width: 100%; }
.strip .pan.none { visibility: hidden; }
/* --- onda que sigue la reproducción */
.wave-inner { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; will-change: transform; }
.wave .ov { position: absolute; left: 10px; right: 170px; bottom: 8px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); z-index: 6; cursor: pointer; }
.wave .ov .win { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: rgba(255, 255, 255, 0.22); }
.wave .ov .ph { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--accent); }
.wave .vbtn { position: absolute; right: 8px; bottom: 2px; z-index: 6; height: 20px; padding: 0 10px; border-radius: 10px; font-size: 11px; color: var(--text-2); background: rgba(14, 14, 15, 0.8); border: 1px solid var(--line-2); }
.wave .vbtn:hover { color: var(--text); }
.ctrlbar .seg button { white-space: nowrap; padding: 0 9px; }
@media (max-width: 1240px) { .ctrlbar .lbl { display: none; } .ctrlbar .btn { padding: 0 10px; } .ctrlbar .stepper span { display: none; } }
