/* Audio · DAW */
.mode-seg { margin-left: 12px; flex: none; }
.mode-seg button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; font-size: 12px; }
.mode-seg .ic { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mode-seg [data-mode="daw"][aria-pressed="true"] { background: linear-gradient(135deg, #7c3aed, #0891b2); color: #fff; }
body.daw-on .top-mid { display: none; }
.daw-cta { background: linear-gradient(135deg, #7c3aed, #0891b2); border-color: transparent; color: #fff; }
.daw-cta:hover { filter: brightness(1.08); background: linear-gradient(135deg, #7c3aed, #0891b2); }
.daw-cta .ic { fill: none; stroke: currentColor; stroke-width: 2; }
.w-feats .w-daw { border-color: color-mix(in srgb, #7c3aed 40%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, #7c3aed 9%, var(--panel)), var(--panel)); }

.daw { --dw-hw: 200px; height: calc(100dvh - 48px); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto var(--arr-h, 40%) auto minmax(0, 1fr) auto; min-height: 0; }
.daw[hidden] { display: none; }
/* Barra */
.dw-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--panel); overflow-x: auto; scrollbar-width: none; }
.dw-bar::-webkit-scrollbar { display: none; }
.dw-g { display: flex; align-items: center; gap: 2px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--border); flex: none; }
.dw-name { flex: 0 1 190px; width: 190px; }
.dw-tp { gap: 4px; }
.dw-tp .play-btn { width: 42px; height: 42px; margin: 0 2px; }
.dw-rec .rec-dot { width: 14px; height: 14px; }
.dw-rec[aria-pressed="true"] { background: var(--danger-soft); }
.dw-rec[aria-pressed="true"] .rec-dot { animation: recblink 1s infinite; }
#dwLoop[aria-pressed="true"] { background: rgba(234, 179, 8, .18); color: #ca8a04; }
#dwMetro[aria-pressed="true"], #dwKbBtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.dw-clock { display: grid; gap: 0; margin-left: 6px; min-width: 64px; font-variant-numeric: tabular-nums; }
.dw-clock b { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.dw-clock span { font-size: 11px; }
.dw-song { gap: 8px; }
.dw-song .mini-f > span { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.dw-bpm { width: 58px; height: 28px; border: 1px solid var(--border); border-radius: 6px; background: var(--sunken); color: var(--text); font-size: 13px; padding: 0 6px; }
.dw-tap { align-self: end; height: 28px; }
.dw-song .mini-f input[type="range"] { width: 70px; }
#dwSwingV { font-variant-numeric: tabular-nums; }
.dw-send { flex: none; height: 34px; gap: 6px; }
.dw-send .ic { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#dwMeter { flex: none; width: 90px; height: 18px; border-radius: 4px; }

/* Arreglo */
.dw-arr { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--border); }
.dw-arr-h { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px; background: var(--panel); border-bottom: 1px solid var(--border); font-size: 12px; }
.dw-arr-tip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dw-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; background: var(--sunken); overscroll-behavior: contain; }
.dw-rrow { position: sticky; top: 0; z-index: 3; display: flex; width: max-content; min-width: 100%; }
.dw-corner { position: sticky; left: 0; z-index: 2; flex: none; width: var(--dw-hw); height: 24px; background: var(--panel); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.dw-rcell { flex: none; height: 24px; cursor: pointer; touch-action: none; }
#dwRuler { position: sticky; left: var(--dw-hw); display: block; }
.dw-body { display: flex; width: max-content; min-width: 100%; }
.dw-heads { position: sticky; left: 0; z-index: 2; flex: none; width: var(--dw-hw); background: var(--panel); border-right: 1px solid var(--border); }
.dw-lane { position: relative; flex: none; touch-action: none; }
#dwArr { position: sticky; left: var(--dw-hw); display: block; }
.dw-ph { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ef4444; pointer-events: none; z-index: 1; }
.dw-ph::before { content: ""; position: absolute; top: -1px; left: -4px; border: 5px solid transparent; border-top-color: #ef4444; }
.dw-empty { padding: 16px; margin: 0; }
.dw-th { position: relative; display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 2px 8px; height: 56px; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
.dw-th.on { background: color-mix(in srgb, var(--c) 9%, var(--panel)); }
.dw-tc { grid-row: 1 / 3; align-self: stretch; width: 4px; border-radius: 0 3px 3px 0; background: var(--c); }
.dw-tm { display: grid; min-width: 0; }
.dw-tn { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-ti { justify-self: start; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.dw-ti:hover { color: var(--accent); text-decoration: underline; }
.dw-tb { display: flex; gap: 3px; }
.dw-ms { width: 26px; height: 24px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--sunken); color: var(--text-2); font: 700 10.5px var(--sans); cursor: pointer; }
.dw-ms:hover { color: var(--text); border-color: var(--text-3); }
.dw-ms[aria-pressed="true"] { background: #f59e0b; border-color: #f59e0b; color: #1c1917; }
.dw-ms.s[aria-pressed="true"] { background: #22c55e; border-color: #22c55e; }
.dw-tv { grid-column: 2 / 4; width: 100%; height: 14px; accent-color: var(--c); }
.dw-addrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.dw-addrow .btn .ic { width: 13px; height: 13px; }

/* Barra de herramientas de los editores: título encima, controles de 32 px */
.ed-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 10px 12px 11px; border-bottom: 1px solid var(--border); background: var(--panel); flex: none; }
.ed-f { display: grid; gap: 5px; min-width: 0; }
.ed-l { font: 600 10px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.ed-sep { align-self: stretch; width: 1px; margin: 15px 2px 0; background: var(--border); }
.ed-acts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-left: auto; }
.ed-in { height: 32px; min-width: 76px; padding: 0 28px 0 10px; border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); font: 500 12.5px var(--sans); cursor: pointer; appearance: none;
  background: var(--sunken) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23908f8a' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; }
.ed-in.wide { min-width: 150px; }
.ed-in:hover { border-color: var(--text-3); }
.ed-in:focus-visible, .ed-btn:focus-visible, .ed-seg button:focus-visible, .ed-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ed-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--panel); color: var(--text); font: 500 12.5px var(--sans); white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s; }
.ed-btn:hover { background: var(--hover); border-color: var(--text-3); }
.ed-btn:active { transform: scale(.97); }
.ed-btn:disabled { opacity: .45; pointer-events: none; }
.ed-btn .ic { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ed-btn.ic { width: 32px; padding: 0; }
.ed-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ed-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.ed-btn[data-try] .ic, .ed-btn#ipTry .ic { fill: currentColor; stroke: none; width: 12px; height: 12px; }
.ed-grp { display: inline-flex; }
.ed-grp > .ed-btn { border-radius: 0; margin-left: -1px; }
.ed-grp > .ed-btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.ed-grp > .ed-btn:last-child { border-radius: 0 8px 8px 0; }
.ed-grp > .ed-btn:hover { position: relative; z-index: 1; }
.ed-val { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-block: 1px solid var(--border-2); margin-left: -1px; background: var(--sunken); font: 600 12px var(--sans); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-seg { display: inline-flex; gap: 2px; height: 32px; padding: 2px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--sunken); }
.ed-seg button { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font: 500 12.5px var(--sans); white-space: nowrap; cursor: pointer; }
.ed-seg button:hover { color: var(--text); }
.ed-seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.ed-seg .ic { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ed-range { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--sunken); }
.ed-range input { width: 96px; margin: 0; accent-color: var(--accent); }
.ed-range output, .ed-range > span { font: 600 11.5px var(--sans); color: var(--text-2); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.ed-range > span { min-width: 0; text-align: left; }
.ed-tog { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 9px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--sunken); color: var(--text-2); font: 500 12.5px var(--sans); white-space: nowrap; cursor: pointer; user-select: none; }
.ed-tog input { position: absolute; opacity: 0; pointer-events: none; }
.ed-tog .ic { width: 15px; height: 15px; padding: 1px; border: 1.5px solid var(--border-2); border-radius: 4px; fill: none; stroke: transparent; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; box-sizing: border-box; }
.ed-tog:hover { border-color: var(--text-3); color: var(--text); }
.ed-tog:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.ed-tog:has(input:checked) .ic { background: var(--accent); border-color: var(--accent); stroke: var(--on-accent); }
.ed-tog:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.ed-chip { height: 32px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 99px; background: var(--sunken); color: var(--text-2); font: 500 12.5px var(--sans); cursor: pointer; }
.ed-chip:hover { color: var(--text); border-color: var(--text-3); }
.ed-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* versión baja para la cabecera del arreglo */
.ed-tog.sm, .ed-grp.sm .ed-btn { height: 28px; font-size: 12px; }
.ed-grp.sm .ed-btn.ic { width: 28px; }
.ed-tog.sm .ic { width: 14px; height: 14px; }
/* interruptor (como en Ajustes) */
.daw .switch { appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 99px; background: var(--border-2); cursor: pointer; transition: background-color .15s; }
.daw .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s var(--ease); }
.daw .switch:checked { background: var(--accent); }
.daw .switch:checked::after { transform: translateX(14px); }
.daw .switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Separador arrastrable entre el arreglo y el editor de abajo */
.dw-split { position: relative; height: 10px; background: var(--panel); border-bottom: 1px solid var(--border); cursor: row-resize; touch-action: none; display: grid; place-items: center; }
.dw-split::before { content: ""; position: absolute; inset: -7px 0; }
.dw-split i { width: 44px; height: 4px; border-radius: 99px; background: var(--border-2); transition: background .12s, width .12s; }
.dw-split:hover i, .dw-split:focus-visible i, .dw-split.drag i { background: var(--accent); width: 64px; }
.dw-split:focus-visible { outline: none; }
:root[data-input="touch"] .dw-split { height: 18px; }
:root[data-input="touch"] .dw-split i { width: 56px; height: 5px; }

/* Panel inferior */
.dw-low { min-width: 0; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.dw-tabs { display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--border); background: var(--panel); overflow-x: auto; scrollbar-width: none; flex: none; }
.dw-tabs button { height: 32px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font: 600 12.5px var(--sans); white-space: nowrap; }
.dw-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.dw-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.dw-pane-in { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dw-empty-ed { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 30px 16px; text-align: center; }
.dw-empty-ed p { flex-basis: 100%; margin: 0 0 4px; color: var(--text-2); }
.dw-empty-ed .btn .ic { width: 14px; height: 14px; }

/* Piano roll y pasos */
.pr-scroll, .dg-scroll { flex: 1; min-height: 160px; overflow: auto; position: relative; background: var(--sunken); overscroll-behavior: contain; }
.pr-content { display: grid; }
.pr-corner { position: sticky; top: 0; left: 0; z-index: 3; background: var(--panel); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pr-ruler { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border); background: var(--panel); }
.pr-ruler canvas { position: sticky; left: var(--kw); display: block; }
.pr-keys { position: sticky; left: 0; z-index: 2; border-right: 1px solid var(--border); background: var(--panel); cursor: pointer; touch-action: none; }
.pr-keys canvas { position: sticky; top: var(--rul); display: block; }
.pr-gridc { position: relative; touch-action: none; }
.pr-gridc canvas { position: sticky; top: var(--rul); left: var(--kw); display: block; }
.pr-gridc canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pr-ph { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: #ef4444; pointer-events: none; z-index: 1; }
.pr-ph[hidden] { display: none; }
.pr-vel { display: grid; grid-template-columns: var(--kw) minmax(0, 1fr); align-items: center; height: 48px; border-top: 1px solid var(--border); background: var(--panel); flex: none; }
.pr-vel > span { font-size: 10px; color: var(--text-3); text-align: center; }
#prVel { display: block; cursor: ns-resize; touch-action: none; }
.pr-hint { margin: 0; padding: 4px 10px; border-top: 1px solid var(--border); background: var(--panel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.dg-content { display: flex; }
.dg-labels { position: sticky; left: 0; z-index: 2; flex: none; width: var(--lw); background: var(--panel); border-right: 1px solid var(--border); }
.dg-row { display: flex; align-items: center; gap: 2px; padding: 0 4px 0 8px; border-bottom: 1px solid var(--border); box-sizing: border-box; }
.dg-name { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--text); font-size: 11.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-name:hover { color: var(--accent); }
.dg-more { display: grid; place-items: center; width: 24px; height: 22px; border: 0; border-radius: 5px; background: none; color: var(--text-3); cursor: pointer; }
.dg-more .ic { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.dg-more:hover { background: var(--hover); color: var(--text); }
.dg-gridc { position: relative; flex: none; touch-action: none; cursor: pointer; }
.dg-gridc canvas { position: sticky; left: var(--lw); display: block; }

/* Elegir instrumento */
.dw-modal { width: min(560px, 100%); max-height: min(86dvh, 760px); display: flex; flex-direction: column; }
.dw-modal > div:last-child { min-height: 0; overflow: auto; }
.ipk-modal { width: min(760px, 100%); }
#dwOvB:has(.ipk-list) { display: flex; flex-direction: column; gap: 10px; }
.ipk-top .search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); }
.ipk-top .search .ic { width: 15px; height: 15px; color: var(--text-3); }
.ipk-top input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font-size: 14px; outline: none; }
.ipk-cats { display: flex; flex-wrap: wrap; gap: 5px; }
.ipk-cats button { height: 28px; padding: 0 11px; border: 1px solid var(--border); border-radius: 99px; background: var(--panel); color: var(--text-2); font-size: 12px; }
.ipk-cats button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ipk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.ipk-i { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); overflow: hidden; }
.ipk-i.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ipk-pick { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 8px 10px; border: 0; background: none; color: var(--text); text-align: left; }
.ipk-pick:hover { background: var(--hover); }
.ipk-pick b { font-size: 13px; }
.ipk-pick span { font-size: 11px; color: var(--text-3); }
.ipk-play { align-self: center; margin-right: 6px; }
.ipk-play .ic { fill: currentColor; stroke: none; }
.ipk-smp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--border-2); border-radius: 10px; }
.ipk-smp > div { flex: 1; min-width: 200px; display: grid; gap: 2px; }

/* Perillas */
.kn { position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; width: 60px; }
.kn.sm { width: 44px; gap: 1px; }
.kn-d { position: relative; width: 44px; height: 44px; border-radius: 50%; cursor: ns-resize; touch-action: none; outline: none;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--text) 10%, var(--panel)), var(--sunken) 70%); box-shadow: inset 0 0 0 1px var(--border-2), 0 3px 8px -4px rgba(0, 0, 0, .5); }
.kn.sm .kn-d { width: 32px; height: 32px; }
.kn-d svg { width: 100%; height: 100%; overflow: visible; }
.kn-t, .kn-a { fill: none; stroke-width: 3.4; stroke-linecap: round; }
.kn-t { stroke: color-mix(in srgb, var(--text) 14%, transparent); }
.kn-a { stroke: var(--kc, var(--accent)); }
.kn-p { stroke: var(--text); stroke-width: 2.6; stroke-linecap: round; }
.kn-d:hover, .kn-d.drag { box-shadow: inset 0 0 0 1px var(--kc, var(--accent)), 0 3px 8px -4px rgba(0, 0, 0, .5); }
.kn-d:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.kn-in { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.kn output { font: 600 10.5px/1.2 var(--sans); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kn.sm output { font-size: 9.5px; }
.kn.sm .kn-l { font-size: 9.5px; }
.kn-l { max-width: 100%; font: 600 10px/1.2 var(--sans); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.kf { display: grid; align-content: start; gap: 6px; min-width: 0; }
.kf .ed-in { width: 128px; }
.kf.sm .ed-in { width: 92px; }
.kf.ksw { justify-items: center; width: 66px; }
.kf.ksw .switch { margin-top: 9px; }

/* Módulos del rack */
.md { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.md.wide { grid-column: 1 / -1; }
.md.w2 { grid-column: span 2; }
@media (max-width: 1250px) { .md.w2 { grid-column: auto; } }
.md-h { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.md-h > .ic { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-h b { font-size: 12.5px; font-weight: 650; }
.md-h .switch { margin-left: auto; }
.md-b { display: flex; flex-direction: column; gap: 10px; transition: opacity .15s; }
.md.off .md-b { opacity: .45; }
.md-k { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 4px; }
.md-note { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text-3); }
.md-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.md-g { display: block; width: 100%; height: 56px; border-radius: 8px; background: var(--sunken); }
.md-g .gg { fill: none; stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.md-g .gl { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.md-g .ga { fill: var(--accent-soft); }
.md-waves { display: inline-flex; align-self: flex-start; gap: 2px; padding: 2px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--sunken); }
.md-waves button { display: grid; place-items: center; width: 38px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--text-2); cursor: pointer; }
.md-waves button:hover { color: var(--text); }
.md-waves button[aria-pressed="true"] { background: var(--panel); color: var(--accent); box-shadow: var(--shadow-sm); }
.md-waves .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-seg { align-self: flex-start; }
.md-seg button { min-width: 34px; justify-content: center; }

/* Instrumento: ficha a la izquierda y rack de módulos */
.ir { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px; }
.ir-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--c) 40%, var(--border)); border-radius: 14px; background: linear-gradient(165deg, color-mix(in srgb, var(--c) 16%, var(--panel)), var(--panel) 70%); }
.ir-card { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ir-ic { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--c); color: #fff; box-shadow: 0 6px 16px -6px var(--c); }
.ir-ic .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ir-card > div { display: grid; gap: 2px; min-width: 0; }
.ir-card b { font-size: 14px; line-height: 1.25; }
.ir-card span { font-size: 11.5px; color: var(--text-3); }
.ir-trk { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 6px 8px; border-radius: 8px; background: var(--sunken); font-size: 12px; color: var(--text-2); }
.ir-trk i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.ir-trk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ir-mode { display: flex; }
.ir-mode button { flex: 1; justify-content: center; }
.ir-acts { display: flex; gap: 6px; }
.ir-acts .ed-btn:not(.ic) { flex: 1; padding: 0 8px; }
.ir-near { display: grid; gap: 6px; }
.ir-near .kn-l { text-align: left; }
.ir-near > div { display: flex; flex-wrap: wrap; gap: 4px; }
.ir-n { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--border-2); border-radius: 99px; background: var(--panel); color: var(--text-2); font: 500 11.5px var(--sans); cursor: pointer; }
.ir-n:hover { color: var(--text); border-color: var(--c); }
.ir-rec { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #16a34a; }
.ir-rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); grid-auto-flow: row dense; gap: 10px; align-items: start; }

/* Mezclador: tiras de canal + panel de efectos */
.mx2 { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }   /* efectos a la izquierda, tiras a continuación */
.cs-row { display: flex; gap: 6px; min-height: 0; padding: 10px; overflow: auto; }
.cs { flex: none; display: flex; flex-direction: column; gap: 7px; width: 98px; min-height: 360px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); --kc: var(--c); }
.cs.on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.cs-master { margin-left: 8px; background: color-mix(in srgb, var(--text) 4%, var(--panel)); --kc: var(--accent); }
.cs-h { display: flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 7px; border: 0; border-radius: 6px; background: color-mix(in srgb, var(--c) 22%, var(--sunken)); color: var(--text); font: 600 11.5px var(--sans); cursor: pointer; }
.cs-h i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cs-h b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-ins { display: flex; flex-direction: column; gap: 2px; height: 74px; padding: 3px; overflow: auto; border-radius: 6px; background: var(--sunken); scrollbar-width: thin; }
.cs-slot { display: flex; align-items: center; flex: none; gap: 5px; min-width: 0; height: 20px; padding: 0 5px; border: 0; border-radius: 4px; background: var(--panel); color: var(--text); font: 500 10.5px var(--sans); text-align: left; cursor: pointer; }
.cs-slot:hover { background: var(--hover); }
.cs-slot i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 5px #22c55e; }
.cs-slot.off { color: var(--text-3); }
.cs-slot.off i { background: var(--border-2); box-shadow: none; }
.cs-slot span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-add { display: flex; align-items: center; justify-content: center; flex: none; gap: 3px; height: 20px; border: 1px dashed var(--border-2); border-radius: 4px; background: none; color: var(--text-3); font: 500 10.5px var(--sans); cursor: pointer; }
.cs-add:hover { color: var(--text); border-color: var(--text-3); }
.cs-add .ic { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.cs-k { display: flex; justify-content: space-around; }
.cs-pan { align-self: center; }
.cs-sp { height: 60px; }
.cs-fd { flex: 1; display: flex; justify-content: center; gap: 8px; min-height: 110px; padding: 8px 0; border-radius: 8px; background: var(--sunken); }
.cs-m { width: 8px; height: 100%; border-radius: 3px; }
.cs-f { writing-mode: vertical-lr; direction: rtl; width: 22px; height: 100%; margin: 0; accent-color: var(--c); }
.cs-db { align-self: center; font: 600 11px var(--sans); font-variant-numeric: tabular-nums; }
.cs-ms { display: flex; justify-content: center; gap: 4px; min-height: 24px; }
.mx-det { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 10px 12px 12px; overflow: auto; border-right: 1px solid var(--border); }
.mx-dh { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mx-dh i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.mx-dh b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-dh > span { font-size: 12px; color: var(--text-3); }
.mx-fxs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.mx-fxt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 7px 3px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text-2); font: 500 10px var(--sans); cursor: pointer; }
.mx-fxt:hover { color: var(--text); border-color: var(--text-3); }
.mx-fxt span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-fxt .ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mx-fxt[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.mx-fxt.lit::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 5px #22c55e; }
.mx-tip { padding: 0 2px; }

/* Asistentes */
.gn { display: grid; gap: 10px; align-content: start; padding: 10px; }
.gn-sec { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.gn-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 22px; }
.gn-h > .ic { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gn-h > b { font-size: 13.5px; }
.gn-h > span { font-size: 12px; color: var(--text-3); }
.gn-all { margin-left: auto; }
.gn-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 6px; }
.gn-tile { position: relative; display: grid; gap: 1px; min-width: 0; padding: 8px 10px 8px 14px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: linear-gradient(120deg, color-mix(in srgb, var(--c) 20%, var(--panel)), var(--panel) 80%); color: var(--text); text-align: left; cursor: pointer; transition: border-color .12s, transform .12s; }
.gn-tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.gn-tile:hover { border-color: var(--c); transform: translateY(-1px); }
.gn-tile b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-tile span { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.gn-tile.pick b { padding-right: 16px; }
.gn-pick { display: inline-flex; width: 14px; height: 14px; color: #f59e0b; }
.gn-tile .gn-pick { position: absolute; top: 7px; right: 7px; }
.gn-pick svg { width: 100%; height: 100%; fill: currentColor; }
.gn-legend { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; font-size: 10.5px; color: var(--text-3); }
.gn-main { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 10px; align-items: start; }
.gn-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gf { display: grid; gap: 4px; min-width: 0; }
.gf .ed-in { width: 100%; }
.gf .kn-l { text-align: left; }
.gf.wide { grid-column: 1 / -1; }
.gn-chords { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
.gn-ch { position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 4px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); }
.gn-ch b { font-size: 17px; letter-spacing: -.01em; }
.gn-chn { position: absolute; top: 4px; left: 6px; font-size: 9.5px; color: var(--text-3); }
.gn-chd { font-size: 10px; color: var(--text-3); }
.gn-pa { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gn-layers { gap: 6px; }
.gn-row { display: grid; grid-template-columns: auto 140px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); transition: opacity .15s; }
.gn-row.off { opacity: .55; }
.gn-use { position: relative; cursor: pointer; }
.gn-use input { position: absolute; opacity: 0; pointer-events: none; }
.gn-ic { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--border-2); border-radius: 9px; background: var(--panel); color: var(--text-3); }
.gn-ic .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gn-use input:checked + .gn-ic { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.gn-use input:focus-visible + .gn-ic { outline: 2px solid var(--accent); outline-offset: 2px; }
.gn-name { display: grid; gap: 1px; min-width: 0; }
.gn-name b { font-size: 13px; }
.gn-name span { font-size: 11px; line-height: 1.3; color: var(--text-3); }
.gn-opts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 8px; min-width: 0; }
.gn-opts .gf { width: 150px; }
.gn-opts .gf.sm { width: 112px; }
.gn-opts .gf.xs { width: 64px; }
.gn-act { display: flex; gap: 6px; }

/* Confirmar canción completa */
.sc-modal { width: min(620px, 100%); }
.sc-warn { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, #f59e0b 45%, var(--border)); border-radius: 10px; background: color-mix(in srgb, #f59e0b 10%, var(--panel)); }
.sc-warn .ic { flex: none; width: 20px; height: 20px; fill: none; stroke: #f59e0b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-warn > div { display: grid; gap: 3px; font-size: 12.5px; }
.sc-warn span { color: var(--text-2); }
.sc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sc-meta span { padding: 5px 10px; border-radius: 99px; background: var(--sunken); font-size: 12px; color: var(--text-2); }
.sc-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.sc-form { display: flex; gap: 3px; margin: 12px 0 8px; }
.sc-sec { display: grid; align-content: center; gap: 1px; min-width: 0; height: 46px; padding: 0 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.sc-sec b { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-sec i { font-style: normal; font-size: 10px; color: var(--text-3); }
.sc-chorus, .sc-drop, .sc-post { background: color-mix(in srgb, var(--accent) 22%, var(--sunken)); }
.sc-pre, .sc-bridge, .sc-break, .sc-build { background: color-mix(in srgb, var(--accent) 10%, var(--sunken)); }

/* ¿Grabar? (tecla R) */
.cr-modal { width: min(440px, 100%); }
.cr-t { font-size: 13px; color: var(--text-2); }
.cr-no { margin-top: 12px; }
.cr-modal #crGo { gap: 8px; }

/* Teclado en pantalla */
.dw-kb { border-top: 1px solid var(--border); background: var(--panel); padding: 6px 10px 10px; }
.dw-kb[hidden] { display: none; }
.kb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 8px; font-size: 12px; }
.kb-t { font-weight: 600; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-v input { width: 80px; }
.kb-keys { position: relative; display: flex; height: 110px; touch-action: none; user-select: none; }
.kb-w { position: relative; height: 100%; border: 1px solid #c8c8c4; border-radius: 0 0 7px 7px; background: linear-gradient(#fff, #f2f2ef); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 6px; gap: 2px; color: #555; }
.kb-b { position: absolute; top: 0; height: 62%; z-index: 1; border: 1px solid #111; border-radius: 0 0 6px 6px; background: linear-gradient(#3a3a3a, #111); color: #bbb; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; }
.kb-w.on { background: var(--accent); color: var(--on-accent); }
.kb-b.on { background: var(--accent); }
.kb-keys kbd { font: 600 9.5px var(--sans); opacity: .7; }
.kb-w span { font-size: 9.5px; font-weight: 600; }
.kb-pads { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; touch-action: none; user-select: none; }
.kb-pad { height: 52px; display: grid; place-content: center; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); color: var(--text); font-size: 11px; }
.kb-pad.on { background: var(--accent); color: var(--on-accent); }
.kb-pad kbd { font: 600 9.5px var(--sans); color: var(--text-3); }

/* Proyectos y envíos */
.dw-songs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dw-songs li { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding-right: 6px; }
.dw-songs li.on { border-color: var(--accent); }
.dw-sg { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 9px 12px; border: 0; background: none; color: var(--text); text-align: left; }
.dw-sg b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-radios { display: grid; gap: 6px; }
#dwOvB .field { margin-top: 12px; }
#dwOvB > p { margin: 0; }

/* Pestaña DAW en el panel del editor */
.dawv-hero { display: grid; gap: 8px; justify-items: start; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, #7c3aed 35%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, #7c3aed 12%, var(--panel)), color-mix(in srgb, #0891b2 10%, var(--panel))); }
.dawv-hero b { font-size: 15px; }
.dawv-hero p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.dawv-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, #7c3aed, #0891b2); }
.dawv-ic .ic { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; }
.dawv-h { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.dawv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dawv-song { width: 100%; display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--text); text-align: left; }
.dawv-song:hover { border-color: var(--accent-line); }

/* Pantallas medianas y móviles: la página se desplaza y cada zona tiene su altura */
@media (max-width: 1000px) {
  .daw { height: auto; min-height: calc(100dvh - 48px); grid-template-rows: auto var(--arr-h, 280px) auto minmax(460px, auto) auto; }
  .dw-pane { overflow: visible; }
  .pr-scroll, .dg-scroll { height: 380px; flex: none; }
  .mx2 { flex: none; grid-template-columns: minmax(0, 1fr); align-content: start; }
  .cs { height: 380px; min-height: 0; }
  .mx-det { border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .gn-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .daw { --dw-hw: 124px; }
  .mode-seg { margin-left: 6px; }
  .mode-seg button span { display: none; }
  .mode-seg button { padding: 0 9px; }
  .dw-name { width: 130px; }
  .dw-bar { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
  .dw-g { border-right: 0; padding-right: 2px; }
  .dw-bar > .grow { display: none; }
  .dw-song { flex: 1 1 100%; flex-wrap: wrap; min-width: 0; }
  .dw-song select { max-width: 132px; }
  .pr-hint { white-space: normal; }
  .dw-send { margin-left: auto; }
  .dw-arr-tip { display: none; }
  .dw-th { grid-template-columns: 4px minmax(0, 1fr); gap: 2px 6px; }
  .dw-tb { grid-column: 2; grid-row: 2; }
  .dw-tv { display: none; }
  .dw-tn { font-size: 12px; }
  .ed-acts { margin-left: 0; }
  .ed-sep { display: none; }
  .ed-bar { gap: 10px; }
  .dg-labels { width: 112px; }
  .ir { grid-template-columns: minmax(0, 1fr); }
  .ir-side { position: static; }
  .ir-rack { grid-template-columns: minmax(0, 1fr); }
  .gn-row { grid-template-columns: auto minmax(0, 1fr); }
  .gn-opts, .gn-act { grid-column: 1 / -1; }
  .gn-opts .gf, .gn-opts .gf.sm { width: calc(50% - 4px); }
  .gn-act .ed-btn:not(.ic) { flex: 1; }
  .gn-all { margin-left: 0; width: 100%; }
  .kb-keys { height: 96px; }
}
:root[data-input="touch"] .dw-ms { width: 34px; height: 30px; }
:root[data-input="touch"] .dw-bpm, :root[data-input="touch"] .dw-song select { height: 38px; font-size: 16px; }
:root[data-input="touch"] .ed-in, :root[data-input="touch"] .ed-btn, :root[data-input="touch"] .ed-tog, :root[data-input="touch"] .ed-range, :root[data-input="touch"] .ed-val, :root[data-input="touch"] .ed-chip, :root[data-input="touch"] .ed-seg { height: 40px; }
:root[data-input="touch"] .ed-in { font-size: 16px; }
:root[data-input="touch"] .ed-btn.ic { width: 40px; }
:root[data-input="touch"] .ed-seg button { height: 34px; }
:root[data-input="touch"] .kn-d { width: 48px; height: 48px; }
:root[data-input="touch"] .kn.sm .kn-d { width: 38px; height: 38px; }
:root[data-input="touch"] .cs { width: 108px; }
:root[data-input="touch"] .cs-slot, :root[data-input="touch"] .cs-add { height: 28px; }
:root[data-input="touch"] .cs-ins { height: 96px; }
:root[data-input="touch"] .md-waves button { width: 44px; height: 36px; }
:root[data-input="touch"] .ir-n { height: 34px; }
:root[data-input="touch"] .dg-more { width: 34px; height: 34px; }
:root[data-input="touch"] .ipk-cats button { height: 36px; }
:root[data-input="touch"] .dw-tabs button { height: 40px; }
.ipk-rec { margin-left: 6px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, #16a34a 16%, transparent); color: #15803d; font-style: normal; font-size: 10px; font-weight: 600; white-space: nowrap; }
:root[data-theme="dark"] .ipk-rec { color: #4ade80; }
