/* AI Master — sistema visual (oscuro, titulares Montserrat, acentos violeta→azul, detalles lima) */
:root {
  color-scheme: dark;
  --bg: #0e0f17;
  --bg-deep: #0a0a11;
  --surface-1: #14141e;
  --surface-2: #1a1a26;
  --surface-3: #232331;
  --border: #22222a;
  --border-strong: #34344a;
  --text-primary: #ffffff;
  --text-body: #eff1f7;
  --text-secondary: #b3b6c6;
  --text-muted: #80839a;
  --grad: linear-gradient(90deg, #ff4fa3 0%, #ff63b4 30%, #3fcfee 72%, #22d3ee 100%);
  --grad-card: linear-gradient(150deg, #c42a78 0%, #8a1f63 48%, #0d6b85 100%);
  --accent: #ff4fa3;
  --accent-strong: #5fe0f5;
  --accent-ink: #ffffff;
  --lime: #e8ff3a;
  --lime-ink: #0e0f17;
  --glow: 0 10px 40px rgba(255, 79, 163, 0.38);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --grid: #262636;
  --good: #3ccf8e;
  --warning: #f2b233;
  --critical: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --font-head: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text-body);
  font: 15px/1.5 var(--font-body);
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent-strong); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--font-head); }

/* ------------------------------------------------------------------ header */
header.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 28px;
  background: rgba(10, 10, 17, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 30px; height: 30px; }
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.2px; color: var(--text-primary); }
.brand p { margin: 0; font-size: 12px; color: var(--text-muted); }
.top nav { display: flex; gap: 22px; margin-left: 24px; }
.top nav a { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; }
.top nav a:hover, .top nav a.on { color: var(--text-primary); }
.top .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface-1); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12.5px; white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.dot.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.warn { background: var(--warning); }
.dot.bad { background: var(--critical); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ hero de la app */
.app-hero {
  position: relative; overflow: hidden;
  padding: 16px 24px 14px; max-width: 1920px; margin: 0 auto;
  display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap;
}
.app-hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 180%;
  background: radial-gradient(closest-side, rgba(255, 79, 163, 0.22), transparent 70%);
  pointer-events: none;
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.app-hero h2 {
  position: relative; margin: 0; font-size: clamp(22px, 2vw, 28px); font-weight: 700;
  letter-spacing: -0.6px; line-height: 1.15; color: var(--text-primary);
}
.app-hero p { position: relative; margin: 0; flex: 1 1 420px; max-width: 900px; color: var(--text-secondary); font-size: 14px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------------ layout */
main.layout { padding: 4px 24px 64px; max-width: 1920px; margin: 0 auto; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* Pasos 1 a 4 en una fila (con el botón de masterizar a la vista); debajo, monitor y resultados. */
.steps { display: grid; gap: 16px; align-items: start;
  grid-template-columns: minmax(225px, 1fr) minmax(225px, 1fr) minmax(500px, 2.2fr) minmax(225px, .95fr); }
.steps .card { padding: 16px; }
.step-go { position: sticky; top: 70px; }
.results { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; margin-top: 22px;
  scroll-margin-top: 70px; align-items: start; }
@media (max-width: 1340px) {
  .steps { grid-template-columns: 1fr 1fr minmax(250px, .85fr); grid-template-areas: "mix target go" "chain chain go"; }
  #cardMix { grid-area: mix; } #cardTarget { grid-area: target; } #cardChain { grid-area: chain; } .step-go { grid-area: go; }
}
@media (max-width: 1000px) {
  main.layout { padding: 4px 16px 48px; }
  .steps { grid-template-columns: 1fr 1fr; grid-template-areas: "mix target" "chain chain" "go go"; }
  .step-go { position: static; }
  .results { grid-template-columns: 1fr; }
  header.top { padding: 10px 16px; flex-wrap: wrap; }
  .top nav { display: none; }
  .app-hero { padding: 16px 16px 12px; }
}
@media (max-width: 700px) {
  .steps { grid-template-columns: 1fr; grid-template-areas: "mix" "target" "chain" "go"; }
}

.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card.glow { box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.22), 0 20px 60px rgba(255, 79, 163, 0.14); }
.card h2 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; font-size: 15px; font-weight: 700; letter-spacing: -0.1px;
  color: var(--text-primary);
}
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--lime); color: var(--lime-ink); font: 700 12.5px var(--font-head); flex: none;
}
.card h2 .right { margin-left: auto; font: 400 12.5px var(--font-body); }

/* ------------------------------------------------------------------ dropzone */
.drop {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 170px; padding: 22px; text-align: center;
  border: 1.5px dashed rgba(255, 255, 255, 0.55); border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(255, 79, 163, 0.32), transparent 60%),
    radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px) 0 0 / 14px 14px,
    var(--surface-2);
  cursor: pointer; transition: border-color .15s, transform .15s;
}
.drop:hover, .drop.over { border-color: #fff; transform: translateY(-1px); }
.drop svg { width: 34px; height: 34px; color: #fff; }
.drop strong {
  display: inline-block; margin-top: 4px; padding: 10px 20px; border-radius: 999px;
  background: var(--grad); color: #fff; font-weight: 600; box-shadow: var(--glow);
}
.drop .muted { max-width: 320px; }
.file-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.file-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; color: var(--text-primary); }
.link { background: none; border: none; color: var(--accent-strong); cursor: pointer; padding: 0; font-size: 13px; }
.link:hover { text-decoration: underline; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; }
.stat .k { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.stat .v { font: 700 16px var(--font-head); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.stat .v small { font: 400 11px var(--font-body); color: var(--text-muted); }

.issues { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.issues li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-secondary); }
.issues li svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.issues .fix { margin-top: 3px; color: var(--text-muted); font-size: 12.5px; }
.issues .fix b { color: var(--text-secondary); font-weight: 600; }
.sev { font-weight: 600; }

/* guía de preparación y chequeo de la mezcla */
.tips { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.tips summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.tips summary::-webkit-details-marker { display: none; }
.tips summary svg { flex: none; width: 16px; height: 16px; color: var(--lime); }
.tips summary::after { content: "+"; margin-left: auto; color: var(--text-muted); font-weight: 400; }
.tips[open] summary::after { content: "−"; }
.tips > p { margin: 10px 0 6px; }
.tips-list { margin: 0 0 4px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.tips-list b { color: var(--text-primary); font-weight: 600; }
.mix-check { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 13px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-body); }
.mix-check > svg { flex: none; width: 18px; height: 18px; }
.mix-check .txt { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }
.mix-check .txt b { color: var(--text-primary); }
.mix-check.ok { background: rgba(60, 207, 142, 0.1); border: 1px solid rgba(60, 207, 142, 0.45); }
.mix-check.ok > svg { color: var(--good); }
.mix-check.warn { background: rgba(242, 178, 51, 0.1); border: 1px solid rgba(242, 178, 51, 0.5); }
.mix-check.warn > svg { color: var(--warning); }
.mix-check.crit { background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.55); }
.mix-check.crit > svg { color: var(--critical); }
#dlgIssues { width: min(580px, calc(100vw - 32px)); }
/* emulación por etapa */
#dlgIssues .issues { max-height: 50vh; overflow-y: auto; }
.sev.alto { color: var(--critical); } .sev.medio { color: var(--warning); } .sev.bajo { color: var(--text-muted); }

/* ------------------------------------------------------------------ segmented / chips */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--bg-deep); border: 1px solid var(--border); }
.seg button {
  border: none; background: none; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  color: var(--text-secondary); font-weight: 500; font-size: 13.5px; white-space: nowrap;
}
.seg button:hover:not(:disabled) { color: var(--text-primary); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.seg button.on { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(255, 79, 163, 0.32); }
.seg.full { display: flex; }
.seg.full button { flex: 1; min-width: 0; white-space: normal; line-height: 1.25; }

.genres { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.genres button {
  border: 1px solid var(--border-strong); background: transparent; border-radius: 999px;
  padding: 6px 13px; cursor: pointer; font-size: 13px; color: var(--text-secondary);
}
.genres button:hover { color: var(--text-primary); border-color: #555570; }
.genres button.on { background: #fff; border-color: #fff; color: #0e0f17; font-weight: 600; }

.presets { display: flex; flex-direction: column; gap: 8px; }
.preset {
  text-align: left; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px;
  transition: border-color .15s;
}
.preset:hover { border-color: var(--border-strong); }
.preset.on { background: var(--grad-card); border-color: transparent; box-shadow: 0 12px 34px rgba(196, 42, 120, 0.4); }
.preset .pn { font: 700 14.5px var(--font-head); color: var(--text-primary); }
.preset .pt { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: right; }
.preset.on .pt { color: #dfe2ff; }
.preset .pd { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-secondary); }
.preset.on .pd { color: #e6e8ff; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.field > label, .lbl { font-size: 12.5px; color: var(--text-secondary); display: flex; justify-content: space-between; gap: 8px; }
.field .val { color: var(--text-primary); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=range]:disabled { opacity: .35; }
select, input[type=text], input[type=password], input[type=search] {
  background: var(--bg-deep); border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 13px; min-width: 0;
}
select:focus, input:focus { outline: 2px solid rgba(34, 211, 238, 0.6); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-secondary); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.mods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px 10px; margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { min-width: 0; }
.grow { flex: 1; }
details.adv { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
details.adv summary { cursor: pointer; color: var(--text-secondary); font-size: 13.5px; }

.btn {
  border: 1px solid var(--border-strong); background: transparent; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--text-primary);
  text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: #6a6a88; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: var(--glow); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.white { background: #fff; color: #0e0f17; border-color: #fff; font-weight: 700; }
.next-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.cta { width: 100%; justify-content: center; padding: 16px; font: 700 16px var(--font-head); letter-spacing: -0.2px; }

/* ------------------------------------------------------------------ plugins */
.plug-list { max-height: 230px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; background: var(--bg-deep); }
.plug-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--border); }
.plug-item:last-child { border-bottom: none; }
.plug-item .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-secondary); white-space: nowrap; }
.tag.ai { background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.chain { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.chain-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 10px 12px; }
.chain-item.off { opacity: .55; }
.chain-item .top-row { display: flex; align-items: center; gap: 8px; }
.chain-item .pn { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.chain-item .ctl { display: flex; align-items: center; gap: 7px; margin-top: 7px; flex-wrap: wrap; }
.chain-item select { padding: 4px 9px; font-size: 12.5px; }
.mini { border: none; background: none; cursor: pointer; padding: 4px; border-radius: 999px; color: var(--text-secondary); display: inline-grid; place-items: center; }
.mini:hover { background: var(--surface-3); color: var(--text-primary); }
.mini svg { width: 15px; height: 15px; }
.status-txt { font-size: 12px; color: var(--text-muted); }
.status-txt.ok { color: var(--good); } .status-txt.warn { color: var(--warning); } .status-txt.bad { color: var(--critical); }
.empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.cloud-note {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,79,163,0.14), rgba(34,211,238,0.12)); border: 1px solid rgba(34,211,238,0.35);
  font-size: 13.5px; color: var(--text-body);
}
.cloud-note svg { flex: none; width: 22px; height: 22px; color: var(--lime); }

/* ------------------------------------------------------------------ monitor */
.monitor-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wave-wrap { position: relative; margin-top: 14px; height: 130px; border-radius: 12px; background: var(--bg-deep); border: 1px solid var(--border); overflow: hidden; cursor: pointer; }
.wave-wrap canvas { width: 100%; height: 100%; display: block; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--lime); box-shadow: 0 0 10px var(--lime); pointer-events: none; left: 0; }
.transport { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.play { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--grad); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: var(--glow); }
.play:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.play svg { width: 20px; height: 20px; }
.time { font-family: var(--mono); font-size: 13px; color: var(--text-secondary); min-width: 96px; }
.ab .on[data-src="mix"] { background: var(--series-1); box-shadow: none; }
.ab .on[data-src="master"] { background: var(--series-2); box-shadow: none; }
.ab .on[data-src="ref"] { background: var(--series-3); box-shadow: none; }

/* ------------------------------------------------------------------ medición */
table.meters { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.meters th, table.meters td { padding: 8px; text-align: right; border-bottom: 1px solid var(--border); }
table.meters th:first-child, table.meters td:first-child { text-align: left; color: var(--text-secondary); }
table.meters thead th { font-size: 12px; color: var(--text-muted); font-weight: 500; }
table.meters td { color: var(--text-primary); }
table.meters td.delta { color: var(--text-muted); font-size: 12px; }
.sw { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ------------------------------------------------------------------ gráfico */
.chart { position: relative; margin-top: 4px; }
.chart svg { width: 100%; height: 300px; display: block; overflow: visible; }
.chart .axis text { fill: var(--text-muted); font-size: 11px; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.legend i.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; height: 2px; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 11px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); min-width: 160px; z-index: 5;
}
.tooltip .tt-h { font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.tooltip .tt-r { display: flex; justify-content: space-between; gap: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.tooltip .tt-r b { color: var(--text-primary); font-weight: 600; }

/* ------------------------------------------------------------------ progreso / log */
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 12px 0; }
.progress > div { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .3s; box-shadow: var(--glow); }
.log {
  font-family: var(--mono); font-size: 12px; line-height: 1.6; background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; max-height: 260px; overflow: auto; color: var(--text-secondary); white-space: pre-wrap;
}
.log .t { color: var(--text-muted); }

/* ------------------------------------------------------------------ informe */
.decisions { display: flex; flex-direction: column; gap: 6px; }
.decision { display: grid; grid-template-columns: 130px 1fr; gap: 2px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.decision:last-child { border-bottom: none; }
.decision .st { font-size: 12px; font-weight: 700; color: var(--lime); text-transform: uppercase; letter-spacing: 0.5px; padding-top: 2px; }
.decision .ac { font-weight: 600; color: var(--text-primary); }
.decision .mo { grid-column: 2; font-size: 13px; color: var(--text-secondary); }
@media (max-width: 600px) {
  .decision { grid-template-columns: 1fr; } .decision .mo { grid-column: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); } .mods { grid-template-columns: repeat(2, 1fr); }
}
.summary { font-size: 15px; color: var(--text-primary); background: var(--grad-card); padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; }
.warns { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 7px; }
.warns li { display: flex; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.warns svg { flex: none; width: 16px; height: 16px; color: var(--warning); margin-top: 2px; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; }

dialog {
  border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface-1); color: var(--text-body);
  padding: 24px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
dialog::backdrop { background: rgba(5,5,10,.7); backdrop-filter: blur(2px); }
dialog h3 { margin: 0 0 8px; color: var(--text-primary); }
dialog p { color: var(--text-secondary); font-size: 13.5px; }
.placeholder { display: grid; place-items: center; text-align: center; color: var(--text-muted); min-height: 140px; font-size: 13.5px; }

/* selector de idioma */
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; }
.lang-switch button { border: none; background: none; color: var(--text-secondary); font: 600 12px var(--font-body); padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.lang-switch button.on { background: #fff; color: #0e0f17; }

#meters, #report { overflow-x: auto; }

/* ------------------------------------------------------------------ cadena del master (rack) */
.racks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 700px) { .racks { grid-template-columns: 1fr; } }
.chain-hint { margin: -6px 0 10px; }
.rack { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #0c0c11 0 10px, #141419 10px calc(100% - 10px), #0c0c11 calc(100% - 10px));
  border: 1px solid var(--border); }
.rack-io { font: 700 10.5px var(--font-body); letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; }
.rack-io::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.ru { position: relative; border-radius: 6px; }
.ru + .ru::before { content: ""; position: absolute; left: 50%; top: -9px; width: 2px; height: 10px; background: var(--border-strong); }
.ru-face .face { display: block; width: 100%; height: auto; border-radius: 5px; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.ru.is-off .ru-face { opacity: .55; }
.ru.is-idle .ru-face { opacity: .72; }
.ru-ctl { display: flex; align-items: center; gap: 10px; }
.ru-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.ru-ctl select { max-width: 62%; padding: 5px 8px; font-size: 13px; }
.ru-cap { margin-top: 3px; font-size: 12.5px; color: var(--text-secondary); min-height: 1.2em; }
.ru-cap b { color: var(--accent, #ff63b4); font-weight: 700; }
.ru-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; margin: 1px 0 5px; min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Pasos 1 a 4 compactos para que entren con el botón en pantallas bajas (notebooks). */
.steps .preset:not(.on) .pd { display: none; }
.genres .lbl { width: 100%; }
.genres select { width: 100%; }
.steps .stats { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
@media (max-height: 950px) and (min-width: 1001px) {
  .app-hero { padding: 10px 24px 8px; }
  .app-hero p { display: none; }
  .ru-desc { -webkit-line-clamp: 1; min-height: 1.35em; margin-bottom: 4px; }
  .steps .card h2 { margin-bottom: 10px; }
}
#meters { overflow-x: auto; }

/* ------------------------------------------------------------------ publicidad */
.ad-top { padding: 10px 24px 0; }
.app-shell { max-width: 1920px; margin: 0 auto; }
.ad-rail { display: none; }
@media (min-width: 1640px) {
  .app-shell { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 0 4px; padding-right: 24px; }
  .app-shell main.layout, .app-shell main.wiz { padding-right: 16px; }
  .ad-rail { display: block; padding-top: 4px; }
  .ad-rail .ad-slot { position: sticky; top: 70px; }
}
.ad-mid { margin: 20px 0 0; }
@media (max-height: 950px) and (min-width: 1001px) {
  body:not(.is-offline) .app-hero p { display: none; }
  .ad-top { padding-bottom: 6px; }
}
@media (max-height: 800px) and (min-width: 1001px) {
  .ad-top { padding: 6px 24px 2px; }
}

/* enlaces a los servicios de Zigma Pro (mezcla y mastering a medida) */
.pro-link { color: var(--text-secondary); font-size: 13px; }
a.pro-link, .pro-link a { color: #ffa24d; text-decoration: none; font-weight: 600; }
a.pro-link:hover, .pro-link a:hover { text-decoration: underline; }
.next-row a.pro-link { margin-left: auto; }

/* ------------------------------------------------------------------ asistente en pasos (ver wizard.js) */
main.wiz { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; padding: 4px 24px 64px; max-width: 1380px; margin: 0 auto; }
@media (max-width: 1100px) { main.wiz { grid-template-columns: 1fr; } .explain { display: none; } }
@media (max-width: 700px) { main.wiz { padding: 4px 14px 48px; } }
.wiz-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.wstep { display: flex; flex-direction: column; gap: 14px; }
.wstep[hidden] { display: none; }
.wsum { position: sticky; top: 62px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 14px; background: rgba(20, 20, 30, .92); backdrop-filter: blur(10px); border: 1px solid var(--border); }
.wdots { display: flex; gap: 3px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.wdots button { display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid transparent; background: none;
  color: var(--text-muted); font: 600 13px var(--font-head); cursor: pointer; }
.wdots button b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text-secondary); font: 800 12px var(--font-head); }
.wdots button:disabled { opacity: .45; cursor: default; }
.wdots button.done b { background: rgba(232, 255, 58, .12); border-color: rgba(232, 255, 58, .5); color: var(--lime); }
.wdots button.on { color: #fff; border-color: var(--border-strong); background: var(--surface-2); }
.wdots button.on b { background: var(--grad); border-color: transparent; color: #fff; }
.wsum-t { display: flex; gap: 14px; margin: 0 0 0 auto; flex-wrap: wrap; }
.wsum-t div { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; min-width: 0; }
.wsum-t dt { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }
.wsum-t dd { margin: 0; font: 700 14px var(--font-head); color: #fff; font-variant-numeric: tabular-nums; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsum-t dd small { font: 400 11px var(--font-body); color: var(--text-muted); }
.wsum-t .s-loud dd, .wsum-t .s-master dd { color: var(--accent-strong); }
@media (max-width: 760px) {
  .wdots button span { display: none; } .wdots button.on span { display: inline; } .wdots button { padding-right: 5px; } .wdots button.on { padding-right: 10px; }
  .wsum-t .s-ceil, .wsum-t .s-chain { display: none; }
  .wsum-t dd { max-width: 150px; font-size: 13px; }
}
.mon-slot:empty, .spec-slot:empty { display: none; }
.mon-slot .card, .spec-slot .card { margin: 0; }
#cardMix .mon-slot { margin-top: 14px; }
#cardMix .mon-card { background: var(--surface-2); padding: 14px; }
.quick { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 16px 0 4px; }
.quick .btn { width: auto; }
.quick .muted { flex: 1 1 260px; }
#mixTips { margin-top: 16px; }
.sub-h { margin: 20px 0 6px; font: 700 12.5px var(--font-head); letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-secondary); }
.card h2 .q { margin-left: auto; }
.q { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); background: none;
  color: var(--text-secondary); font: 700 12px var(--font-head); cursor: pointer; flex: none; }
.q:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.pitch { padding: 20px 22px; border-radius: var(--radius); background: linear-gradient(140deg, rgba(255, 79, 163, .14), rgba(34, 211, 238, .10)) padding-box, var(--grad) border-box;
  border: 1px solid transparent; }
.pitch h3 { margin: 0; font: 800 clamp(18px, 2vw, 22px)/1.25 var(--font-head); color: #fff; letter-spacing: -.3px; }
.pitch-sub { margin: 6px 0 10px; color: var(--accent-strong); font-weight: 600; font-size: 14px; }
.pitch ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; color: var(--text-body); font-size: 14.5px; }
.pitch li::marker { color: var(--lime); }
.plan-list { margin-top: 14px; }
.plan-foot { margin: 16px 0 12px; }
#cardPlan .cta { width: 100%; }
#quotaNote { margin: 10px 0 0; }
#quotaNote:empty { display: none; }
.center { text-align: center; }
.logbox { margin-top: 12px; }
.logbox summary { cursor: pointer; color: var(--text-secondary); font-size: 13px; }
.logbox .log { margin-top: 8px; }
.svc-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 18px; padding: 16px 18px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border-strong); }
.svc-cta > div { flex: 1 1 300px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--text-secondary); }
.svc-cta b { color: #fff; font-size: 15px; }
.wnav { display: flex; justify-content: space-between; gap: 12px; }
.wnav .btn { min-width: 130px; justify-content: center; }
.wnav [hidden] { display: none; }

/* panel de explicaciones y hoja inferior */
.explain { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.exp-kicker { font: 700 12px var(--font-head); letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent-strong); margin: 4px 0 2px; }
.xcard { padding: 15px 17px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); transition: border-color .3s, box-shadow .3s; }
.xcard[hidden] { display: none; }
.xcard.flash { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 79, 163, .15); }
.xcard h4, .sheet-box h4 { margin: 0 0 6px; font: 700 14.5px var(--font-head); color: #fff; }
.xcard p, .sheet-box p { margin: 0; color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .55); }
.sheet[hidden] { display: none; }
.sheet-box { position: relative; width: 100%; max-width: 560px; max-height: 70vh; overflow-y: auto; padding: 22px 20px 28px; border-radius: 20px 20px 0 0;
  background: var(--surface-2); border: 1px solid var(--border-strong); }
.sheet-box .x { position: absolute; right: 10px; top: 8px; border: none; background: none; color: var(--text-muted); font-size: 26px; cursor: pointer; padding: 4px 8px; }
.sheet-box h4 { padding-right: 30px; font-size: 16.5px; }
.sheet-box p { font-size: 15px; }

/* en el celular, la zona para soltar la mezcla se ve sin bajar */
@media (max-width: 700px) {
  .app-hero p { display: none; }
  .app-hero h2 { font-size: 22px; }
  .app-hero .eyebrow { display: none; }
}

/* Pie con los links legales */
.app-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; padding: 26px 16px 34px; color: var(--muted, #7b8093); font-size: 13px; }
.app-foot a { color: inherit; }
.app-foot a:hover { color: #fff; }

/* Selector de nivel de escucha del monitor (igualado, tal como sale o como en cada plataforma) */
.level-mode { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-secondary); }
.level-mode select { max-width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elev, #11131a); color: inherit; font: inherit; }

/* Vista previa del estribillo (paso Plan) */
.preview { margin: 16px 0 4px; padding: 14px; border: 1px dashed var(--border); border-radius: 12px; }
.preview .row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.pv-player { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.pv-player .seg button { white-space: nowrap; }
