/* Audio · estudio */
.top-mid { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; margin: 0 12px; }
.top-mid[hidden] { display: none; }
.name-in { min-width: 0; flex: 0 1 260px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r); background: none; color: var(--text); font: 600 14px var(--sans); text-overflow: ellipsis; }
.name-in:hover, .name-in:focus { border-color: var(--border-2); background: var(--sunken); outline: none; }
.chips { display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.chips span { flex: none; padding: 2px 8px; border-radius: 99px; background: var(--sunken); border: 1px solid var(--border); font-size: 11px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
#helpBtn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.rec-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.rec-dot.live { animation: recblink 1.2s infinite; margin-right: 8px; }
@keyframes recblink { 50% { opacity: .25; } }
.btn.big { height: 42px; padding: 0 18px; font-size: 14px; gap: 8px; }
.btn.big .ic, .btn.big svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn.sm svg:not(.ic) { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Bienvenida */
.welcome { min-height: calc(100dvh - 48px); display: grid; align-content: center; justify-items: center; gap: 28px; padding: 28px 16px; }
.welcome[hidden], .studio[hidden] { display: none; }
.w-hero { display: grid; justify-items: center; gap: 12px; text-align: center; width: min(620px, 100%); padding: 34px 26px; border: 2px dashed var(--border-2); border-radius: 18px; background: var(--panel); }
body.dragging .w-hero { border-color: var(--accent); background: var(--accent-soft); }
.w-hero h1 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.02em; }
.w-hero p { margin: 0; max-width: 52ch; line-height: 1.5; }
.w-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, #0891b2, #0e7490); box-shadow: 0 6px 20px rgba(8, 145, 178, .3); }
.w-ic svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.w-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 2px; }
.resume { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--accent-line); border-radius: 12px; background: var(--accent-soft); text-align: left; }
.resume[hidden] { display: none; }
.resume > div { flex: 1; display: grid; gap: 2px; min-width: 180px; }
.w-feats { list-style: none; margin: 0; padding: 0; width: min(900px, 100%); display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.w-feats li { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); font-size: 12.5px; line-height: 1.45; }
.w-feats b { font-size: 13px; }
.w-feats span { color: var(--text-2); }

/* Estudio: barra arriba, editor a la izquierda y herramientas a la derecha */
.studio { height: calc(100dvh - 48px); display: grid; grid-template-columns: minmax(0, 1fr) min(380px, 40vw); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "bar bar" "stage side"; }
.studio > .bar { grid-area: 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; }
.studio > .bar::-webkit-scrollbar { display: none; }
.bg { display: flex; gap: 1px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--border); flex: none; }
.grow { flex: 1; }
.tb { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 50px; height: 44px; padding: 0 6px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 10.5px var(--sans); white-space: nowrap; flex: none; }
.tb:hover { background: var(--hover); }
.tb:active { transform: scale(.96); }
.tb:disabled { opacity: .35; pointer-events: none; }
.tb svg, .tb .ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tb .rec-dot { width: 13px; height: 13px; margin: 2.5px 0; }
.studio > .bar > .btn.primary { flex: none; height: 34px; gap: 6px; }

.stage { grid-area: stage; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 12px; }
.wave-wrap { position: relative; flex: 1; min-height: 180px; border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); overflow: hidden; }
body.dragging .wave-wrap { box-shadow: inset 0 0 0 3px var(--accent); }
#wave { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: text; touch-action: none; }
#wave:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wave-tools { position: absolute; right: 8px; top: 24px; display: flex; align-items: center; gap: 6px; }
.wave-tools .seg { background: var(--panel); }
.wt-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--r); background: var(--panel); color: var(--text-2); font: 500 11.5px var(--sans); }
.wt-btn.ic { width: 28px; padding: 0; justify-content: center; }
.wt-btn:hover { color: var(--text); }
.wt-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wt-btn[aria-pressed="true"] { border-color: #f43f5e; background: rgba(244, 63, 94, .12); color: #f43f5e; }
#fsBtn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.amp { position: absolute; right: 10px; top: 58px; bottom: 30px; display: flex; align-items: center; }
.amp input { writing-mode: vertical-lr; direction: rtl; width: 18px; height: 100%; max-height: 140px; accent-color: var(--accent); opacity: .55; }
.amp input:hover, .amp input:focus { opacity: 1; }
.wave-hint { position: absolute; left: 10px; bottom: 6px; right: 40px; pointer-events: none; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overview { display: block; width: 100%; height: 34px; flex: none; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); cursor: pointer; touch-action: none; }

.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); flex: none; }
.tp-btns { display: flex; align-items: center; gap: 4px; }
.icon-btn.tp { width: 34px; height: 34px; }
.icon-btn.tp .ic { width: 18px; height: 18px; }
.icon-btn.tp svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#loopBtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.play-btn { width: 46px; height: 46px; margin: 0 4px; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.play-btn:hover { background: var(--accent-hover); }
.play-btn:active { transform: scale(.95); }
.play-btn .ic { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.clock { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.clock b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; min-width: 9ch; }
.selbox { display: flex; gap: 6px; }
.selbox label { display: grid; gap: 1px; }
.selbox span, .mini-f span { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.selbox input { width: 92px; height: 28px; padding: 0 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--sunken); color: var(--text); font: 12px var(--mono); }
.selbox input:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.mon { display: flex; align-items: center; gap: 10px; }
.mini-f { display: grid; gap: 1px; }
.mini-f select { height: 28px; border: 1px solid var(--border); border-radius: 6px; background: var(--sunken); color: var(--text); font-size: 12px; padding: 0 4px; }
.mini-f input[type="range"] { width: 80px; accent-color: var(--accent); height: 28px; }
.meter { width: 120px; height: 22px; border-radius: 4px; }
.zoom { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.zoom .ic { width: 16px; height: 16px; }
.status { display: flex; align-items: center; gap: 10px; min-height: 22px; padding: 0 2px; font-size: 12px; color: var(--text-2); flex: none; }
.status b { color: var(--accent); font-weight: 600; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* Panel de herramientas */
.side { grid-area: side; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); background: var(--panel); }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px; border-bottom: 1px solid var(--border); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 500 11px var(--sans); }
.tabs button:hover { background: var(--hover); color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.search { position: relative; padding: 8px 10px 4px; }
.search .ic { position: absolute; left: 20px; top: 50%; margin-top: 2px; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-3); }
.search input { width: 100%; height: 32px; padding: 0 10px 0 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); color: var(--text); font-size: 13px; outline: none; }
.search input:focus { border-color: var(--accent); background: var(--panel); }
.panel { flex: 1; overflow: auto; padding: 6px 10px 20px; display: grid; align-content: start; gap: 6px; }
.panel .empty { text-align: center; padding: 20px 0; }

.tool { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.tool.open { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.tool-h { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 11px; border: 0; border-radius: 10px; background: none; text-align: left; color: var(--text); }
.tool-h:hover { background: var(--hover); }
.tool-n { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.tool-n em { font-style: normal; font-size: 10.5px; color: var(--accent); }
.tool-h .muted { grid-column: 1; line-height: 1.4; }
.chev { grid-row: 1 / span 2; grid-column: 2; align-self: center; width: 16px; height: 16px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; transition: transform .15s; }
.tool.open .chev { transform: rotate(180deg); }
.tool-b { display: none; }
.tool.open .tool-b { display: grid; gap: 10px; padding: 2px 11px 11px; }
.presets { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-b { height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: 99px; background: var(--sunken); color: var(--text-2); font: 500 11.5px var(--sans); }
.chip-b:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.prms { display: grid; gap: 9px; }
.prm { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 8px; font-size: 12px; color: var(--text-2); }
.prm > input[type="range"], .prm > select, .prm > .input, .prm > .fmts { grid-column: 1 / -1; }
.prm > input[type="number"] { grid-column: auto; }
.prm output { font: 600 11.5px var(--mono); color: var(--text); }
.prm input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0; height: 20px; }
.prm .input { width: 100%; height: 30px; }
.prm-c { font-size: 12.5px; }
.tool-note { margin: 0; }
.tool-x { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-a { display: flex; align-items: center; gap: 6px; padding-top: 2px; }
.tool-a .scope { flex: 1; min-width: 0; font-size: 11px; }
.tool-a .btn { gap: 5px; }

.eq { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 8px 4px 2px; border-radius: 8px; background: var(--sunken); }
.eq label { display: grid; justify-items: center; gap: 3px; font-size: 10px; color: var(--text-3); }
.eq output { font: 600 9.5px var(--mono); color: var(--text); }
.eq input { writing-mode: vertical-lr; direction: rtl; width: 22px; height: 110px; accent-color: var(--accent); margin: 0; }

/* Vistas propias (Analizar, Marcas, Exportar) */
.view { display: grid; gap: 12px; padding-top: 4px; }
.view > p { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stats div { padding: 8px 10px; border-radius: 8px; background: var(--sunken); }
.stats dt { font-size: 10.5px; color: var(--text-3); }
.stats dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; }
.tips { margin: 0; padding: 10px 12px 10px 28px; border-radius: 8px; background: var(--accent-soft); font-size: 12px; line-height: 1.5; }
.sub { margin: 4px 0 0; font-size: 12px; font-weight: 600; }
.spec { width: 100%; height: 150px; border-radius: 8px; background: var(--sunken); }
.marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.marks li { display: grid; grid-template-columns: auto 88px 1fr auto auto; align-items: center; gap: 4px; }
.mk-n { width: 24px; height: 24px; border: 0; border-radius: 6px; background: #f59e0b; color: #000; font: 700 11px var(--sans); }
.marks .input { height: 28px; padding: 0 6px; font-size: 12px; min-width: 0; }
.auto { border: 1px solid var(--border); border-radius: 10px; padding: 0 11px; }
.auto summary { padding: 9px 0; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.auto[open] summary { margin-bottom: 4px; }
.auto > .prms { padding-bottom: 11px; }
.auto .prm { grid-template-columns: auto 80px 1fr; }
.auto .prm .input { grid-column: auto; }
.exp .auto .prm { grid-template-columns: 1fr; }
.exp .auto .grid2 .prm, .exp .auto .prm .input { grid-column: auto; }
.fmts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.fmt { display: grid; gap: 1px; padding: 7px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); color: var(--text); text-align: center; }
.fmt b { font-size: 12.5px; }
.fmt span { font-size: 9.5px; color: var(--text-3); line-height: 1.25; }
.fmt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.fmt:disabled { opacity: .4; }
#eEst { margin: 0; }
#eGo { justify-self: stretch; justify-content: center; }
#eGo .ic { width: 17px; height: 17px; }

/* Barra de vista previa */
.prev-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px); padding: 8px 8px 8px 14px; border: 1px solid var(--border-2); border-radius: 99px; background: var(--panel); box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.2)); font-size: 12.5px; }
.prev-bar[hidden] { display: none; }
.prev-bar #prevT { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: recblink 1s infinite; }

/* Ventanas */
.rec-modal h2 { display: flex; align-items: center; }
.rec-time { font-size: 34px; font-weight: 600; text-align: center; margin: 6px 0 12px; }
.rec-meter { height: 10px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.rec-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), #eab308 70%, var(--danger)); transition: width .06s linear; }
#recSet { display: grid; gap: 12px; }
#recSet h2 { margin-bottom: 0; }
#recSet .modal-actions { margin-top: 4px; }
#recSet .btn .rec-dot { margin-right: 4px; }
.busy-modal { display: grid; justify-items: center; gap: 12px; text-align: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-modal .bar { width: 100%; height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.busy-modal .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.busy-modal .bar.indet i { width: 40% !important; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.help-modal { width: min(560px, 100%); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: 12.5px; }
.keys div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; }
.keys kbd { font: 11px var(--mono); padding: 2px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; background: var(--sunken); white-space: nowrap; }

/* Pantallas medianas: el panel baja debajo del editor */
@media (max-width: 1000px) {
  .studio { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "bar" "stage" "side"; }
  .studio > .bar { position: sticky; top: 0; z-index: 5; }
  .wave-wrap { flex: none; height: clamp(200px, 42vh, 380px); }
  .side { border-left: 0; border-top: 1px solid var(--border); }
  .tabs { display: flex; overflow-x: auto; scrollbar-width: none; position: sticky; top: 56px; z-index: 4; background: var(--panel); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; min-width: 72px; }
  .panel { overflow: visible; }
  .chips span:nth-child(n+3) { display: none; }
}
/* Pantallas táctiles: objetivos más grandes */
:root[data-input="touch"] .icon-btn.tp { width: 42px; height: 42px; }
:root[data-input="touch"] .play-btn { width: 54px; height: 54px; }
:root[data-input="touch"] .overview { height: 44px; }
:root[data-input="touch"] .tb { min-width: 56px; height: 50px; font-size: 11px; }
:root[data-input="touch"] .chip-b { height: 34px; padding: 0 13px; font-size: 13px; }
:root[data-input="touch"] .tool-h { padding: 12px; }
:root[data-input="touch"] .prm .input, :root[data-input="touch"] .selbox input, :root[data-input="touch"] .marks .input, :root[data-input="touch"] .search input { height: 40px; font-size: 16px; }
:root[data-input="touch"] .mini-f select { height: 38px; font-size: 16px; }
:root[data-input="touch"] .tool-a .btn { height: 38px; padding: 0 14px; font-size: 13px; }
:root[data-input="touch"] .tool-a .icon-btn { width: 38px; height: 38px; }
:root[data-input="touch"] .marks .icon-btn, :root[data-input="touch"] .mk-n { width: 38px; height: 38px; }
:root[data-input="touch"] .prm input[type="range"] { height: 32px; }
:root[data-input="touch"] .wave-tools .seg button, :root[data-input="touch"] .wt-btn { min-height: 34px; }
:root[data-input="touch"] .wt-btn.ic { width: 34px; }
:root[data-input="touch"] .trk-b { width: 34px; height: 30px; }
@media (max-width: 640px) {
  .top-mid { margin: 0 4px; }
  .chips { display: none; }
  .welcome { gap: 18px; padding: 16px; align-content: start; }
  .w-hero { padding: 24px 16px; }
  .w-btns .btn { width: 100%; justify-content: center; }
  .stage { padding: 8px; }
  .transport { gap: 8px; padding: 8px; justify-content: center; }
  .tp-btns { width: 100%; justify-content: space-between; }
  .clock { width: 100%; justify-content: center; }
  .selbox { width: 100%; }
  .selbox label { flex: 1; min-width: 0; }
  .selbox input { width: 100%; }
  .mon { width: 100%; justify-content: space-between; }
  .mini-f input[type="range"] { width: 90px; }
  .meter { width: 100px; }
  .zoom { width: 100%; margin: 0; justify-content: space-between; }
  .zoom .btn { flex: 1; justify-content: center; }
  .status { flex-wrap: wrap; font-size: 12px; line-height: 1.4; }
  .wave-hint { display: none; }
  .tabs { top: 62px; }
  .keys { grid-template-columns: 1fr; }
  .marks li { grid-template-columns: auto 78px 1fr auto auto; }
  .fmts { grid-template-columns: repeat(3, 1fr); }
  .eq input { height: 120px; }
}

/* Canal al que se aplica */
.ch-pick { display: flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; font-size: 11.5px; color: var(--text-2); }
.ch-pick[hidden] { display: none; }
.ch-pick .seg button { min-width: 38px; }

/* Barra: final fijo a la derecha, herramientas propias y modo compacto */
.bar-end { position: sticky; right: -10px; margin-right: -10px; padding-right: 10px; display: flex; align-items: center; gap: 4px; padding-left: 6px; background: var(--panel); flex: none; box-shadow: -10px 0 10px -6px var(--panel); }
.bar-tools .tb-tool span { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
.bar-tools[hidden], .studio > .bar .bg[hidden], .tb[hidden] { display: none; }
.studio > .bar.compact .tb { min-width: 34px; height: 36px; }
.studio > .bar.compact .tb span:not(.rec-dot) { display: none; }
#quickExp .ic { width: 16px; height: 16px; }

/* Franja de pistas */
.tracks { display: grid; gap: 3px; padding: 6px 8px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); flex: none; max-height: 34vh; overflow: auto; overflow-x: hidden; }
.tracks[hidden] { display: none; }
.trk-h { display: flex; align-items: center; gap: 8px; font-size: 12px; padding-bottom: 2px; }
.trk { display: grid; grid-template-columns: minmax(70px, 150px) auto auto minmax(0, 1fr); align-items: center; gap: 4px; border-radius: 7px; padding: 1px; }
.trk.on { background: var(--accent-soft); }
.trk-n { display: flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--text); font: 500 12px var(--sans); text-align: left; }
.trk-n i { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.trk-n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk.on .trk-n { font-weight: 600; }
.trk-b { width: 24px; height: 22px; border: 1px solid var(--border); border-radius: 5px; background: var(--sunken); color: var(--text-3); font: 700 10.5px var(--sans); }
.trk-b[data-mute][aria-pressed="true"] { background: #f59e0b; border-color: #f59e0b; color: #000; }
.trk-b[data-solo][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.trk-cv { width: 100%; min-width: 0; height: 26px; border-radius: 5px; background: var(--sunken); cursor: grab; touch-action: none; }

/* Pestaña Pistas */
.tcard { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.tcard.on { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.tc-h { display: flex; align-items: center; gap: 6px; }
.tc-h i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.tc-h .input { flex: 1; min-width: 0; height: 30px; font-weight: 600; }
.tc-row { display: flex; align-items: center; gap: 14px; }
.tc-row .muted { margin-left: auto; }
.tc-env { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tc-env > .muted { flex: 1 1 100%; }
.tcard .prm .input { grid-column: auto; width: 110px; justify-self: end; }

/* Cadenas */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); }
.st-n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 10.5px var(--sans); }
.st-t { flex: 1; min-width: 0; display: grid; gap: 1px; font-size: 12.5px; }
.st-t .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps .icon-btn { font-size: 13px; }
.add-step { display: flex; gap: 6px; }
.add-step .input { flex: 1; min-width: 0; height: 30px; }

/* Tono de llamada, comparación y afinador */
.ring { display: grid; gap: 8px; padding: 10px 11px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); margin-bottom: 12px; }
.ring-h { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ring-h svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ring .row { align-items: center; }
.ring .input { width: auto; height: 28px; }
.an-more { display: grid; gap: 10px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 12px; }
.cmp th, .cmp td { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: right; }
.cmp th:first-child { text-align: left; font-weight: 500; color: var(--text-2); }
.cmp thead th { font-size: 10.5px; color: var(--text-3); font-weight: 500; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.lg.a { background: var(--accent); }
.lg.b { background: #f59e0b; }
.tun-modal { text-align: center; }
.tun-note { font-size: 54px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0; }
.tun-meter { position: relative; height: 38px; margin: 6px 4px; border-radius: 8px; background: linear-gradient(90deg, rgba(220, 38, 38, .15), var(--sunken) 40%, var(--sunken) 60%, rgba(220, 38, 38, .15)); }
.tun-meter::before { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--ok); }
.tun-meter i { position: absolute; top: 2px; bottom: 2px; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--danger); transition: left .12s; }
.tun-meter i.ok { background: var(--ok); }
.tun-meter span { position: absolute; bottom: -16px; font-size: 10px; color: var(--text-3); }
.tun-meter span:nth-of-type(1) { left: 0; }
.tun-meter span:nth-of-type(2) { left: 50%; transform: translateX(-50%); }
.tun-meter span:nth-of-type(3) { right: 0; }
.tun-info { margin: 22px 0 6px; font-size: 13px; }

/* Personalizar la barra y atajos */
.cfg-modal { width: min(620px, 100%); max-height: 88dvh; overflow: auto; }
.cfg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 12px; margin-bottom: 8px; }
.cfg-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.cfg-tools fieldset { margin: 0; padding: 6px 10px 8px; border: 1px solid var(--border); border-radius: 8px; display: grid; gap: 2px; }
.cfg-tools legend { font-size: 11px; color: var(--text-3); padding: 0 4px; }
.help-modal { max-height: 88dvh; overflow: auto; }
.keys .kset { font-size: 11px; margin-left: 4px; }
#helpOv.editing .keys div { grid-template-columns: 190px 1fr; }

/* Pantalla completa del editor */
body.stage-full { overflow: hidden; }
body.stage-full .stage { position: fixed; inset: 0; z-index: 70; background: var(--bg); padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
body.stage-full .wave-wrap { flex: 1; height: auto; min-height: 120px; }
body.stage-full .tracks { max-height: 22vh; }
@media (max-height: 520px) {
  body.stage-full .status, body.stage-full .selbox, body.stage-full .mon .mini-f:first-child, body.stage-full .tracks, body.stage-full .wave-hint { display: none; }
  body.stage-full .transport { flex-wrap: nowrap; gap: 6px; padding: 4px 8px; }
  body.stage-full .tp-btns, body.stage-full .clock, body.stage-full .zoom, body.stage-full .mon { width: auto; }
  body.stage-full .overview { height: 26px; }
  body.stage-full .play-btn { width: 40px; height: 40px; }
}
@media (max-width: 640px) {
  .trk { grid-template-columns: 84px auto auto minmax(0, 1fr); }
  .trk-h { flex-wrap: wrap; }
  .trk-h [data-goto] { display: none; }
  .wt-btn span { display: none; }
  .wt-btn { width: 34px; padding: 0; justify-content: center; }
  .cfg-grid { grid-template-columns: 1fr 1fr; }
  #helpOv.editing .keys div { grid-template-columns: 1fr; }
  .bar-end #closeBtn { display: none; }
  #quickExp span { display: none; }
  #quickExp { width: 40px; padding: 0; justify-content: center; }
}

/* Aviso de la envolvente sobre la onda */
.env-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; border: 1px solid #f43f5e; border-radius: 10px; background: color-mix(in srgb, #f43f5e 16%, var(--panel)); color: var(--text); font-size: 12.5px; box-shadow: var(--shadow-sm); }
.env-bar[hidden] { display: none; }
.env-bar span { flex: 1; min-width: 0; }
.env-bar .btn { flex: none; }

/* Vista de todas las pistas juntas */
.multi { flex: 1; min-height: 220px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); overflow: hidden; }
.multi[hidden], .wave-wrap[hidden], .overview[hidden] { display: none; }
.mv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--panel); font-size: 12px; }
.mv-sel { display: inline-flex; align-items: center; gap: 6px; }
.mv-sel i { width: 9px; height: 9px; border-radius: 50%; }
.mv-off, .mv-align { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.mv-off .input { width: 96px; height: 28px; }
.mv-align .input { width: auto; max-width: 150px; height: 28px; }
.mv-time { font-size: 13px; min-width: 7ch; text-align: right; }
.mv-zoom { display: inline-flex; align-items: center; gap: 2px; }
.mv-zoom .ic { width: 14px; height: 14px; }
#mcv { flex: 1; min-height: 160px; width: 100%; display: block; touch-action: none; }
#mcv:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mv-hint { margin: 0; padding: 5px 10px; border-top: 1px solid var(--border); background: var(--panel); }
.trk-h [data-multi] { gap: 5px; }
.trk-h [data-multi] .ic { width: 14px; height: 14px; }
@media (max-width: 1000px) { .multi { flex: none; height: clamp(260px, 50vh, 460px); } }
:root[data-input="touch"] .mv-off .input, :root[data-input="touch"] .mv-align .input { height: 38px; font-size: 16px; }
