/* ===== Ensayo — estilos ===== */
:root {
  --bg: #0e1014;
  --bg2: #14171d;
  --card: #1a1e26;
  --card2: #222733;
  --line: #2b313d;
  --tx: #eef0f4;
  --tx2: #a6adba;
  --tx3: #6f7686;
  --acc: #ff7a45;
  --acc-tx: #1a0d06;
  --chord: #ffb347;
  --ok: #3ecf8e;
  --warn: #f5c04a;
  --bad: #ff5d6c;
  --info: #62b0ff;
  --r: 14px;
  --toph: 56px;
  --tabh: 62px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f4f0;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #efebe4;
  --line: #e0dbd2;
  --tx: #1b1d22;
  --tx2: #565c68;
  --tx3: #8a909b;
  --acc: #e85d22;
  --acc-tx: #fff;
  --chord: #c2410c;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ----- Barra superior ----- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 4px;
  height: calc(var(--toph) + var(--safe-t));
  padding: var(--safe-t) 6px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-title { flex: 1; min-width: 0; padding: 0 6px; }
.tb-title h1 { margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title small { display: block; color: var(--tx3); font-size: 12px; margin-top: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-spacer { width: 8px; }
.tb-actions { display: flex; gap: 2px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: transparent; border: 0; color: var(--tx);
}
.icon-btn:active { background: var(--card2); }

/* ----- Contenido ----- */
.view {
  padding: 14px 14px calc(var(--tabh) + var(--safe-b) + 28px);
  max-width: 820px; margin: 0 auto;
}

/* ----- Barra de pestañas ----- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabh) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--tx3); font-size: 11px; font-weight: 600;
}
.tabbar a.on { color: var(--acc); }

/* ----- Tipografía y bloques ----- */
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--tx3); margin: 22px 2px 8px; font-weight: 700; }
h2:first-child { margin-top: 4px; }
.muted { color: var(--tx2); }
.small { font-size: 13px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px;
}
.card + .card { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.empty { text-align: center; color: var(--tx2); padding: 40px 16px; }
.empty svg { width: 44px; height: 44px; color: var(--tx3); margin-bottom: 8px; }
.empty p { margin: 4px 0 16px; }

/* ----- Botones ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card2); color: var(--tx);
  font-weight: 600; white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-tx); }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 50%, transparent); color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; }
.btn:active:not(:disabled) { transform: scale(.98); }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabh) + var(--safe-b) + 18px); z-index: 25;
  width: 58px; height: 58px; border-radius: 18px; border: 0;
  background: var(--acc); color: var(--acc-tx);
  display: grid; place-items: center; box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
@media (min-width: 860px) { .fab { right: calc(50% - 400px); } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--tx2);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip.on { background: var(--acc); border-color: var(--acc); color: var(--acc-tx); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card2); color: var(--tx2); }
.pill.nueva { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.pill.ensayando { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.lista { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.ensayo { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.pill.concierto { background: color-mix(in srgb, var(--acc) 20%, transparent); color: var(--acc); }
.pill.otro { background: var(--card2); color: var(--tx2); }
.pill.tag { background: transparent; border: 1px solid var(--line); font-weight: 600; }

/* ----- Formularios ----- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--tx2); font-weight: 600; margin: 0 2px 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 11px 13px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--tx); outline: none;
}
.input:focus { border-color: var(--acc); }
textarea.input { resize: vertical; line-height: 1.5; }
textarea.lyrics { font-family: var(--mono); font-size: 14px; min-height: 360px; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 4; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.search { position: relative; margin-bottom: 10px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tx3); width: 19px; height: 19px; }
.search .input { padding-left: 40px; }
input[type="range"] { width: 100%; accent-color: var(--acc); }
input[type="checkbox"] { accent-color: var(--acc); width: 18px; height: 18px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx2); }
details.help { background: var(--bg2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; color: var(--tx2); }
details.help summary { cursor: pointer; font-weight: 600; color: var(--tx); }
details.help pre { font-family: var(--mono); font-size: 13px; background: var(--card); padding: 10px; border-radius: 8px; overflow-x: auto; color: var(--tx); }
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.palette button { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; }
.palette button.ch { color: var(--chord); }
.palette .lbl { font-size: 12px; color: var(--tx3); align-self: center; margin-right: 2px; }

/* ----- Listas ----- */
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 62px; width: 100%; background: none; border: 0; text-align: left; }
.item:active { background: var(--card2); }
.item .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .num { width: 26px; text-align: center; font-weight: 800; color: var(--tx3); font-variant-numeric: tabular-nums; }
.item .key { min-width: 44px; padding: 4px 8px; border-radius: 8px; background: var(--card2); color: var(--chord); font-weight: 800; text-align: center; font-size: 14px; }
.item .chev { color: var(--tx3); width: 18px; height: 18px; }
.item .ico-audio { width: 16px; height: 16px; color: var(--tx3); vertical-align: -3px; margin-left: 4px; }
.handle { touch-action: none; color: var(--tx3); padding: 8px 4px; display: grid; place-items: center; cursor: grab; }
li.dragging { background: var(--card2); opacity: .85; }
.mini-btns { display: flex; align-items: center; gap: 4px; }
.mini-btns button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); display: grid; place-items: center; font-weight: 800; }
.mini-btns button svg { width: 16px; height: 16px; }
.mini-btns .val { min-width: 30px; text-align: center; font-weight: 700; font-size: 14px; color: var(--chord); }

/* ----- Inicio ----- */
.hero { background: linear-gradient(135deg, color-mix(in srgb, var(--acc) 26%, var(--card)), var(--card)); }
.hero .label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.hero .big { font-size: 22px; font-weight: 800; margin: 4px 0 2px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--tx2); font-weight: 600; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-weight: 650; }
.quick a svg { color: var(--acc); }

/* ----- Visor de canción ----- */
.song-head .meta { color: var(--tx2); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.song-head .meta b { color: var(--tx); }
.song-head .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.notes { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); font-size: 14px; white-space: pre-wrap; }

.ctrl {
  position: sticky; top: calc(var(--toph) + var(--safe-t)); z-index: 20;
  margin: 12px -14px 0; padding: 8px 14px;
  display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.ctrl::-webkit-scrollbar { display: none; }
.ctrl > * { flex: none; }
.tone { display: inline-flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; height: 42px; }
.tone > button { width: 40px; height: 40px; border: 0; background: none; font-size: 22px; font-weight: 700; color: var(--tx); }
.tone .tv { width: auto; min-width: 62px; padding: 0 6px; display: flex; flex-direction: column; align-items: center; line-height: 1.05; font-size: 15px; }
.tone .tv b { color: var(--chord); font-size: 17px; }
.tone .tv small { color: var(--tx3); font-size: 11px; font-weight: 700; }
.cbtn { height: 42px; min-width: 42px; padding: 0 11px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--tx2); }
.cbtn.on { color: var(--acc-tx); background: var(--acc); border-color: var(--acc); }
.cbtn svg { width: 19px; height: 19px; }
.cbtn.beat { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 55%, transparent); }

.tone-saved { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--tx2); }

.song-body { margin-top: 16px; font-size: 18px; line-height: 1.35; }
.song-body .ln { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.35em; }
.song-body .ln.hc { margin-top: .25em; }
.song-body .sg { display: inline-block; vertical-align: bottom; white-space: pre; }
.song-body .ch, .song-body .chl { color: var(--chord); font-weight: 750; }
.song-body .ch { display: block; line-height: 1.2; padding-right: .4em; min-height: 1.2em; }
.song-body .ly { display: block; }
.song-body .chl { white-space: pre-wrap; font-family: var(--mono); font-size: .92em; margin: .35em 0 .1em; }
.song-body .sec { margin: 1.1em 0 .35em; display: inline-block; font-size: .72em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); background: color-mix(in srgb, var(--acc) 13%, transparent); padding: 3px 10px; border-radius: 6px; }
.song-body .cmt { margin: .4em 0; font-style: italic; color: var(--tx2); font-size: .85em; }
.song-body .blank { height: .7em; }
.song-body.nochords .ch, .song-body.nochords .chl { display: none; }
.song-body.nochords .ln.hc { margin-top: 0; }

.audio .row + .row { margin-top: 10px; }
.audio .play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--acc); color: var(--acc-tx); display: grid; place-items: center; flex: none; }
.audio .play svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.audio .times { display: flex; justify-content: space-between; font-size: 12px; color: var(--tx3); font-variant-numeric: tabular-nums; }
.audio .name { font-size: 13px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 6px; border-radius: 3px; background: var(--card2); overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; width: 0; background: var(--acc); transition: width .15s; }
.loopbtn.on { background: color-mix(in srgb, var(--acc) 22%, var(--card2)); border-color: var(--acc); color: var(--acc); }

.set-nav { position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + var(--safe-b)); z-index: 24; display: flex; gap: 8px; padding: 8px 12px; background: color-mix(in srgb, var(--bg2) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.set-nav .btn { flex: 1; min-width: 0; justify-content: flex-start; overflow: hidden; }
.set-nav .btn span { overflow: hidden; text-overflow: ellipsis; }
.set-nav .btn.next { justify-content: flex-end; }
.set-nav .pos { align-self: center; font-size: 13px; color: var(--tx3); font-weight: 700; white-space: nowrap; }
.has-setnav .view { padding-bottom: calc(var(--tabh) + var(--safe-b) + 90px); }

/* Modo escenario */
body.stage .topbar, body.stage .tabbar, body.stage .song-head, body.stage .audio, body.stage .tone-saved { display: none !important; }
body.stage .ctrl { top: 0; padding-top: calc(8px + var(--safe-t)); }
body.stage .view { padding-bottom: 120px; max-width: none; }
body.stage .set-nav { bottom: 0; padding-bottom: calc(8px + var(--safe-b)); }
body.stage.ctrl-hidden .ctrl { opacity: 0; pointer-events: none; }
body.stage.ctrl-hidden .set-nav { opacity: 0; pointer-events: none; }
body.stage .song-body { margin-top: 10px; }

/* ----- Hojas / diálogos ----- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88vh; overflow-y: auto;
  background: var(--bg2); border-top-left-radius: 20px; border-top-right-radius: 20px;
  padding: 10px 16px calc(18px + var(--safe-b));
  transform: translateY(100%); transition: transform .22s ease;
  max-width: 640px; margin: 0 auto;
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; }
.sheet-msg { font-size: 16px; margin: 4px 0 18px; }
.menu { display: flex; flex-direction: column; }
.menu button { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border: 0; background: none; text-align: left; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu button:last-child { border-bottom: 0; }
.menu button.danger { color: var(--bad); }
.menu button svg { color: var(--tx2); }
.menu button.danger svg { color: var(--bad); }
.keygrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px; }
.keygrid button { height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 800; color: var(--chord); }
.keygrid button.on { background: var(--acc); color: var(--acc-tx); border-color: var(--acc); }
.keygrid button small { display: block; font-size: 10px; color: var(--tx3); font-weight: 700; }
.keygrid button.on small { color: inherit; }
.pick-list { max-height: 52vh; overflow-y: auto; margin: 0 -4px 12px; }
.pick-list label { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.pick-list label .t { font-weight: 600; }

/* ----- Toast ----- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabh) + var(--safe-b) + 24px); z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--tx); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: all .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ----- Metrónomo ----- */
.metro-bpm { text-align: center; margin: 10px 0 4px; }
.metro-bpm b { font-size: 76px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.metro-bpm span { display: block; color: var(--tx2); font-weight: 600; }
.beats { display: flex; justify-content: center; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.beats i { width: 22px; height: 22px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); transition: transform .06s, background .06s; }
.beats i.accent { width: 26px; height: 26px; }
.beats i.on { background: var(--acc); transform: scale(1.25); }
.big-play { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--acc); color: var(--acc-tx); display: grid; place-items: center; margin: 0 auto; }
.big-play svg { width: 34px; height: 34px; fill: currentColor; stroke: none; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 8px; }
.stepper button { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 18px; font-weight: 800; }

/* ----- Afinador ----- */
.tuner { text-align: center; padding: 26px 14px; }
.tuner .note { font-size: 96px; font-weight: 800; line-height: 1; }
.tuner .note sub { font-size: 30px; color: var(--tx3); font-weight: 700; }
.tuner .hz { color: var(--tx2); font-variant-numeric: tabular-nums; margin-top: 6px; }
.gauge { position: relative; height: 70px; margin: 28px 6px 6px; }
.gauge .scale { position: absolute; left: 0; right: 0; top: 30px; height: 2px; background: var(--line); }
.gauge .tick { position: absolute; top: 20px; width: 2px; height: 22px; background: var(--line); transform: translateX(-1px); }
.gauge .tick.c { background: var(--ok); height: 30px; top: 16px; }
.gauge .needle { position: absolute; top: 6px; left: 50%; width: 4px; height: 50px; border-radius: 2px; background: var(--tx3); transform: translateX(-2px); transition: left .12s ease-out, background .12s; }
.gauge .needle.ok { background: var(--ok); }
.gauge .lab { position: absolute; top: 52px; font-size: 12px; color: var(--tx3); transform: translateX(-50%); }
.tuner .cents { font-weight: 700; font-variant-numeric: tabular-nums; }
.tuner .cents.ok { color: var(--ok); }
.strings { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.strings span { padding: 4px 10px; border-radius: 8px; background: var(--card2); font-weight: 700; color: var(--tx2); font-size: 14px; }

/* ----- Herramientas ----- */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tools a { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 112px; }
.tools a svg { width: 28px; height: 28px; color: var(--acc); }
.tools a b { font-size: 16px; }
.tools a span { font-size: 13px; color: var(--tx2); }
.seg-ctl { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg-ctl button { flex: 1; height: 38px; border: 0; background: none; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--tx2); }
.seg-ctl button.on { background: var(--card2); color: var(--tx); box-shadow: 0 1px 3px rgba(0,0,0,.25); }

/* ----- Impresión ----- */
.print-area { display: none; }
@media print {
  body { background: #fff; color: #000; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block; font-family: system-ui, sans-serif; color: #000; }
  .print-area h1 { font-size: 26pt; margin: 0 0 4pt; }
  .print-area .sub { font-size: 12pt; color: #444; margin-bottom: 14pt; }
  .print-area ol { font-size: 22pt; font-weight: 700; line-height: 1.5; padding-left: 1.4em; }
  .print-area ol small { font-weight: 600; color: #555; font-size: 14pt; }
  .print-area .song-body { font-size: 12.5pt; }
  .print-area .song-body .ch, .print-area .song-body .chl { color: #000; font-weight: 800; }
  .print-area .song-body .sec { color: #000; background: #eee; }
  .print-area .song-body .ln, .print-area .song-body .sg { break-inside: avoid; }
}
body.stage .ctrl [data-a="stage"] { order: -1; }
.seg-ctl button { white-space: nowrap; padding: 0 4px; }
.grid2, .grid3 { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.grid3 { --cols: 3; }
.input { min-width: 0; }
input[type="date"].input, input[type="time"].input { -webkit-appearance: none; appearance: none; }

/* ===== Banda, roles e instrumentos ===== */
.role-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.role-chip { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--tx2); font-weight: 650; text-align: left; }
.role-chip svg { color: var(--tx3); }
.role-chip.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, var(--bg2)); color: var(--tx); }
.role-chip.on svg { color: var(--acc); }
.role-btn { color: var(--tx); }
.role-btn svg { color: var(--acc); }
.role-icons svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; color: var(--acc); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: color-mix(in srgb, var(--acc) 22%, var(--card2)); color: var(--acc); flex: none; }
.space-card { width: 100%; margin-bottom: 12px; color: var(--tx); text-align: left; }
.space-card > svg { color: var(--acc); }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.avatar svg { width: 20px; height: 20px; }
.code { font-family: var(--mono); font-size: 26px; font-weight: 800; letter-spacing: .14em; color: var(--acc); }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tx3); flex: none; }
.sync-dot.ok, .sync-dot.idle { background: var(--ok); }
.sync-dot.syncing { background: var(--info); animation: pulse 1s infinite alternate; }
.sync-dot.error { background: var(--bad); }
.sync-dot.offline { background: var(--warn); }
@keyframes pulse { to { opacity: .3; } }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

.role-panel { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.role-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.role-note svg { color: var(--warn); margin-top: 1px; }
.tip { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.tip > svg { color: var(--acc); }
.tip.good { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.tip.good > svg { color: var(--ok); }
.tip.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.tip.warn > svg { color: var(--warn); }
.dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: thin; }
.dias.big { justify-content: center; gap: 18px; flex-wrap: wrap; }
.dias.big > div { text-align: center; }
.dias.big .dia { width: 150px; height: auto; }
.dias.big .dia.piano { width: 230px; }
.dias small { display: block; font-size: 11px; color: var(--tx2); text-align: center; margin-top: 2px; }
.dia-b { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 4px; }
.dia { display: block; width: 88px; height: auto; overflow: visible; }
.dia.piano { width: 140px; }
.dia .dn { fill: var(--tx); font: 800 12px system-ui, sans-serif; text-anchor: middle; }
.dia .fn { fill: var(--tx2); font: 700 9px system-ui, sans-serif; }
.dia .ox { fill: var(--tx3); font: 700 10px system-ui, sans-serif; text-anchor: middle; }
.dia .fl, .dia .st { stroke: var(--tx3); stroke-width: 1; }
.dia .nut { stroke: var(--tx); stroke-width: 3; }
.dia .dot { fill: var(--chord); }
.dia .open { fill: none; stroke: var(--tx2); stroke-width: 1.2; }
.dia .wk { fill: #f4f1ea; stroke: #555; stroke-width: .6; }
.dia .bk { fill: #23252b; stroke: #111; stroke-width: .6; }
.dia .kon { fill: var(--chord); }
.dia .kr { fill: var(--acc); }
.bass-chip { flex: none; min-width: 76px; padding: 8px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.bass-chip b { display: block; font-size: 22px; color: var(--chord); }
.bass-chip small { color: var(--tx2); font-size: 11px; }
.drum .bpm-big { text-align: center; min-width: 84px; }
.drum .bpm-big b { display: block; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.drum .bpm-big small { color: var(--tx2); font-size: 12px; font-weight: 600; }
.drum .beats { margin: 0; justify-content: flex-start; }
.tap-chords .ch { cursor: pointer; }
.tap-chords .ch:active { opacity: .6; }
body.stage .role-panel { display: none; }
.dia text { stroke: none; }
