:root {
  --bg: #121110;
  --surface: #1a1816;
  --surface-2: #23201d;
  --surface-3: #2d2925;
  --line: #36312b;
  --text: #f4eee5;
  --muted: #a89f93;
  --dim: #6f675d;
  --accent: #ffb347;
  --accent-ink: #1d1406;
  --accent-soft: rgba(255, 179, 71, 0.14);
  --chord: #7ad3c8;
  --danger: #ff7a6b;
  --ok: #9bd67a;
  --radius: 14px;
  --ui: "Bricolage Grotesque", system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, "Cascadia Mono", monospace;
  --lyric-size: 34px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------ piezas comunes */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); border-color: #4a433b; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #ffc16b; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

input[type=text], input[type=url], input[type=number], input[type=search], input[type=email], textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; font-family: var(--mono); font-size: 14px; line-height: 1.5; min-height: 280px; }
label.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted);
}
.badge.ok { color: var(--ok); background: rgba(155, 214, 122, .1); }
.badge.accent { color: var(--accent); background: var(--accent-soft); }
.badge svg { width: 12px; height: 12px; }

#toast {
  position: fixed; left: 50%; bottom: 110px; transform: translate(-50%, 20px);
  background: var(--surface-3); border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
  max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { border-color: var(--danger); color: var(--danger); }

/* ------------------------------------------------ biblioteca */
.library { max-width: 1180px; margin: 0 auto; padding: 36px 24px 80px; }
.lib-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.logo { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.logo-mark { width: 44px; height: 44px; }
.logo-word { font-size: 36px; font-weight: 800; letter-spacing: -0.003em; line-height: 1; color: var(--accent); }
.logo-word span { color: var(--accent); }
.logo-sub { color: var(--dim); font-size: 13px; margin-top: 3px; }
.lib-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search input { padding-left: 42px; border-radius: 999px; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--dim); }
.chips { display: flex; gap: 6px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: #50483f; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .5; transition: opacity .2s, transform .4s; }
.card:hover .card-bg { opacity: .65; transform: scale(1.04); }
.card-bg.none { background: radial-gradient(120% 90% at 20% 10%, #3a2a17 0%, var(--surface) 60%); opacity: 1; }
.card-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(12,11,10,.96) 12%, rgba(12,11,10,.35) 60%, rgba(12,11,10,.1)); }
.card-body { position: relative; padding: 16px 18px; }
.card-title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.card-artist { color: var(--muted); font-size: 15px; margin-top: 3px; }
.card-badges { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.card-edit { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity .15s; background: rgba(18,17,16,.75); backdrop-filter: blur(6px); }
.card:hover .card-edit, .card:focus-within .card-edit { opacity: 1; }
.card-play {
  position: absolute; top: 14px; left: 14px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s;
}
.card-play svg { width: 20px; height: 20px; margin-left: 2px; }
.card:hover .card-play { opacity: 1; transform: scale(1); }

.empty {
  border: 1px dashed var(--line); border-radius: 20px; padding: 64px 24px; text-align: center; color: var(--muted);
}
.empty h2 { color: var(--text); margin: 0 0 8px; font-size: 26px; letter-spacing: -0.02em; }
.empty p { margin: 0 auto 22px; max-width: 460px; line-height: 1.55; }
.hint { color: var(--dim); font-size: 13px; margin-top: 30px; text-align: center; }
kbd {
  font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--text);
}

.quick {
  display: flex; align-items: center; gap: 10px; margin-bottom: 26px; padding: 8px 8px 8px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .15s, box-shadow .15s;
}
.quick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick-icon { color: var(--accent); display: grid; }
.quick-icon svg { width: 22px; height: 22px; }
.quick input { border: none; background: transparent; padding: 10px 4px; box-shadow: none !important; font-size: 16px; }

/* ------------------------------------------------ editor */
.editor { max-width: 1180px; margin: 0 auto; padding: 28px 24px 120px; }
.ed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.ed-head h1 { font-size: 28px; margin: 0; letter-spacing: -0.02em; margin-right: auto; }
.panel.magic { margin-bottom: 22px; border-color: #4a3a22; background: linear-gradient(135deg, #221b12, var(--surface) 60%); }
.panel.magic h2 svg { width: 20px; height: 20px; color: var(--accent); }
.magic-row { display: flex; gap: 10px; align-items: center; }
.magic-row input { flex: 1; }
.magic-row.small { margin-bottom: 12px; }
.magic-row.small input { padding: 8px 12px; font-size: 14px; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.steps li svg { width: 16px; height: 16px; flex: none; }
.steps li.ok { color: var(--text); }
.steps li.ok svg { color: var(--ok); }
.steps li.warn { color: var(--accent); }
.steps li.err { color: var(--danger); }
.steps b { font-weight: 600; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.magic-done { display: flex; align-items: center; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.status a { color: inherit; }

.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.ed-col { display: grid; gap: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { font-size: 17px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.panel h2 .num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; line-height: 1.5; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.row.tight { gap: 8px; align-items: center; }
.row.tight > * { flex: none; }
.stack { display: grid; gap: 12px; }
.results { display: grid; gap: 6px; max-height: 300px; overflow: auto; margin-top: 12px; }
.result {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
}
.result:hover { border-color: var(--accent); }
.result.sel { border-color: var(--accent); background: var(--accent-soft); }
.result-main { flex: 1; min-width: 0; }
.result-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-meta { color: var(--muted); font-size: 13px; }
.status { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.status svg { width: 16px; height: 16px; flex: none; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--accent); }
.status.err { color: var(--danger); }
.yt-preview { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.yt-preview img { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.preview-sheet {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
  max-height: 520px; overflow: auto; font-family: var(--mono); font-size: 13px; line-height: 1.35;
}
.preview-sheet .pv-chords { color: var(--chord); font-weight: 700; white-space: pre; }
.preview-sheet .pv-lyric { white-space: pre; }
.preview-sheet .pv-lyric.nomatch { color: var(--dim); }
.preview-sheet .pv-sec { color: var(--accent); font-weight: 700; margin-top: 8px; font-family: var(--ui); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.preview-sheet .pv-t { color: var(--dim); font-size: 11px; display: inline-block; width: 44px; }
.ed-foot {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 24px;
  background: rgba(18,17,16,.9); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  display: flex; justify-content: center;
}
.ed-foot-in { max-width: 1180px; width: 100%; display: flex; gap: 10px; align-items: center; }
.ed-foot-in .spacer { flex: 1; }

/* ------------------------------------------------ modo tocar */
.player { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.pl-top {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px; z-index: 5;
  background: linear-gradient(to bottom, var(--bg) 60%, rgba(18,17,16,0));
  transition: opacity .4s;
}
.pl-title { min-width: 0; margin-right: auto; }
.pl-title b { font-size: 18px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-title span { color: var(--muted); font-size: 14px; }
.pl-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.chord-strip {
  display: flex; gap: 6px; padding: 0 18px 8px; overflow-x: auto; z-index: 5; scrollbar-width: none;
  transition: opacity .4s;
}
.chord-strip::-webkit-scrollbar { display: none; }
.cs-item {
  flex: none; display: grid; justify-items: center; gap: 0; padding: 6px 6px 2px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); min-width: 62px;
}
.cs-item b { font-family: var(--mono); color: var(--chord); font-size: 14px; }
.diagram { width: 56px; height: 66px; }
.diagram .fret, .diagram .string { stroke: #5a534a; stroke-width: 1; }
.diagram .nut { fill: #cfc6b8; }
.diagram .dot { fill: var(--text); }
.diagram .open { fill: none; stroke: var(--text); stroke-width: 1.2; }
.diagram .mark, .diagram .fretnum { fill: var(--muted); font-size: 8px; font-family: var(--mono); }

.stage {
  flex: 1; overflow-y: auto; position: relative; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 80%, transparent 100%);
}
.sheet { max-width: 1100px; margin: 0 auto; padding: 38vh 40px 60vh; }
.sheet.mono { font-family: var(--mono); }
.ln {
  font-size: var(--lyric-size); line-height: 1.25; padding: 6px 14px; border-radius: 12px;
  color: var(--muted); transition: color .35s, opacity .35s, background .35s, transform .35s;
  cursor: pointer; transform-origin: left center;
}
.sheet.mono .ln { font-size: calc(var(--lyric-size) * .78); }
.ln:hover { background: rgba(255,255,255,.03); }
.ln.past { color: var(--dim); opacity: .55; }
.ln.now { color: var(--text); background: var(--accent-soft); }
.ln.now .ly { background: linear-gradient(90deg, var(--accent) var(--p, 0%), var(--text) var(--p, 0%)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ln .ch { color: var(--chord); font-weight: 700; white-space: pre; font-size: .82em; line-height: 1.2; min-height: 1em; }
.ln .ly { white-space: pre-wrap; display: inline; }
.sheet.mono .ln .ly { white-space: pre; }
.ln.past .ch { color: #3f6b66; }
.ln .ch .c { transition: color .2s, text-shadow .2s; }
.ln .ch .c.on { color: var(--accent); text-shadow: 0 0 18px rgba(255, 179, 71, .55); }

/* panel lateral de acordes */
.rail {
  position: absolute; right: 18px; top: 118px; bottom: 92px; width: var(--rail-w); z-index: 4;
  display: flex; flex-direction: column; gap: 12px; overflow-y: auto; scrollbar-width: none;
  pointer-events: none; transition: width .3s;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { pointer-events: auto; flex: none; }
.player { --rail-w: 240px; }
.player.rail-wide { --rail-w: min(460px, 40vw); }
.chord-panel {
  position: relative;
  background: rgba(26, 24, 22, .94); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 16px;
  display: grid; gap: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.cp-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.cp-label span { letter-spacing: 0; text-transform: none; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cp-now { display: grid; justify-items: center; gap: 2px; min-height: 186px; align-content: center; }
.cp-now b { font-family: var(--mono); font-size: 46px; line-height: 1; color: var(--chord); }
.cp-now .diagram { width: 118px; height: 140px; }
.cp-now b.none, .cp-next-body b.none { color: var(--dim); }
.cp-wait { color: var(--dim); font-size: 13px; margin-top: 8px; }
.cp-now.pop { animation: cp-pop .28s ease-out; }
@keyframes cp-pop { from { transform: scale(.9); opacity: .5; } to { transform: none; opacity: 1; } }
.cp-next { border-top: 1px solid var(--line); padding-top: 10px; }
.cp-next-body { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 70px; }
.cp-next-body b { font-family: var(--mono); font-size: 28px; color: var(--text); transition: color .2s; }
.cp-next-body .diagram { width: 54px; height: 64px; }
.cp-bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.cp-bar div { height: 100%; width: 0; background: var(--accent); }
.chord-panel.soon .cp-next-body b, .chord-panel.soon .cp-label span { color: var(--accent); }
.player.has-rail .sheet { max-width: none; padding-left: max(32px, calc((100vw - 1100px) / 2 - 120px)); padding-right: calc(var(--rail-w) + 52px); }
.ln.sec {
  font-family: var(--ui); font-size: 14px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
  color: var(--accent); opacity: .75; padding-top: 22px; cursor: default;
}
.ln.sec:hover { background: none; }
.ln.blank { height: calc(var(--lyric-size) * .6); padding: 0; cursor: default; }
.ln.blank:hover { background: none; }
.ln.tab { font-family: var(--mono); font-size: calc(var(--lyric-size) * .5); white-space: pre; color: var(--chord); }
.sheet.plain .ln { cursor: default; }

.no-lyrics { text-align: center; color: var(--muted); padding-top: 30vh; }
.no-lyrics h2 { color: var(--text); }

.pl-dock {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 18px; z-index: 6;
  background: rgba(30,27,24,.92); backdrop-filter: blur(14px); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,.45); transition: opacity .4s, transform .4s;
  max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none;
}
.pl-dock::-webkit-scrollbar { display: none; }
.dock-sep { width: 1px; height: 26px; background: var(--line); margin: 0 6px; flex: none; }
.play-btn {
  width: 54px; height: 54px; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; border: none; cursor: pointer; flex: none;
}
.play-btn svg { width: 24px; height: 24px; }
.dock-group { display: flex; align-items: center; gap: 2px; flex: none; }
.dock-val { font-family: var(--mono); font-size: 13px; color: var(--muted); min-width: 58px; text-align: center; }
.dock-label { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; display: block; text-align: center; }
.dock-time { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 0 10px; min-width: 104px; text-align: center; flex: none; }

.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; z-index: 7; cursor: pointer; }
.progress div { height: 100%; background: var(--accent); width: 0; }
.progress:hover { height: 6px; }

/* franja del punteo: debajo de la letra, nunca encima */
.tab-lane {
  flex: none; margin: 0 18px 92px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; z-index: 3; position: relative;
}
.player.has-rail .tab-lane { margin-right: calc(var(--rail-w) + 36px); }
.tl-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tl-title { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--text); }
.tl-title svg { width: 16px; height: 16px; color: var(--accent); }
.tl-label { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.tl-count { color: var(--dim); font-family: var(--mono); font-size: 12px; margin-right: auto; }
.tl-src a { color: var(--dim); font-size: 12px; }
.tl-fwd svg { transform: rotate(180deg); }
.tl-body { --tab-size: 14px; padding: 10px 14px 12px; display: grid; gap: 8px; }
.tl-body.arrive .tl-sys.now { animation: tl-in .35s ease-out; }
.tl-body.arrive .tl-sys.next { animation: tl-in2 .35s ease-out; }
@keyframes tl-in { from { transform: translateY(40%); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes tl-in2 { from { transform: translateY(60%); opacity: 0; } to { transform: none; opacity: .5; } }
.tl-sys { position: relative; font-family: var(--mono); font-size: var(--tab-size); }
.tl-sys pre { margin: 0; line-height: 1.22; color: var(--text); white-space: pre; font: inherit; }
.tl-sys.next { opacity: .5; font-size: calc(var(--tab-size) * .75); }
.tl-sys.next pre { color: var(--muted); }
.tl-chords { color: var(--chord); font-weight: 700; white-space: pre; line-height: 1.3; }
.tl-cursor {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -12px; background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 179, 71, .7); border-radius: 2px; transition: left .12s linear;
}
.tl-empty { padding: 6px 0 4px; color: var(--muted); }
.tl-empty p { margin: 0 0 10px; }
.tl-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tl-actions input { flex: 1; min-width: 220px; padding: 7px 12px; font-size: 14px; }
textarea.tabtext { min-height: 160px; font-size: 12px; line-height: 1.25; white-space: pre; }
.panel h2 .opt { font-size: 11px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.st-tabprev { font-family: var(--mono); font-size: 13px; line-height: 1.2; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 4px 0; }

/* video: vive en la columna derecha, debajo de los acordes */
.video-card {
  border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.vc-head { display: flex; align-items: center; gap: 2px; padding: 4px 6px 4px 12px; }
.vc-title { margin-right: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.vc-title svg { width: 14px; height: 14px; color: var(--accent); }
.vc-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; display: grid; place-items: center; transition: background .15s, color .15s;
}
.vc-btn:hover { background: var(--surface-3); color: var(--text); }
.vc-btn svg { width: 14px; height: 14px; }
.vc-body { position: relative; aspect-ratio: 16 / 9; background: #000; }
.vc-body > div, .vc-body iframe { width: 100%; height: 100%; border: 0; display: block; }
/* minimizado: queda la barrita; el video sigue sonando (se achica a 1px, no se apaga) */
.video-card.mode-mini .vc-body { aspect-ratio: auto; height: 1px; opacity: 0; }
.video-card.mode-mini .vc-title::after { content: "· sonando"; color: var(--dim); font-weight: 500; }
/* cerrado: sale de la pantalla pero sigue sonando */
.video-card.mode-off { position: fixed; left: -10000px; top: 0; width: 320px; }
.video-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; text-align: center; background: var(--surface); font-size: 13px; color: var(--muted); }

/* estudio */
.studio { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.st-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; padding: 8px 22px 22px; min-height: 0; }
.st-main { overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.st-side { display: flex; flex-direction: column; gap: 12px; }
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; max-width: 760px; }
.st-card h2 { margin: 0 0 16px; font-size: 22px; }
.st-opt { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; cursor: pointer; background: var(--surface-2); }
.st-opt input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; flex: none; }
.st-opt span { display: grid; gap: 4px; }
.st-opt em { font-style: normal; color: var(--muted); font-size: 14px; line-height: 1.45; }
.st-opt.off { opacity: .55; cursor: default; }
.st-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.st-rate { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; margin-right: auto; }
.st-rate select { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.st-note { color: var(--dim); font-size: 13px; margin: 14px 0 0; line-height: 1.5; }
.st-mark { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 20px 10px; }
.st-count { color: var(--dim); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.st-prev { color: var(--dim); font-size: 22px; }
.st-prev span { font-family: var(--mono); font-size: 13px; margin-left: 8px; }
.st-cur-label { color: var(--accent); font-size: 14px; font-weight: 600; margin-top: 8px; }
.st-cur { font-size: clamp(28px, 4vw, 48px); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.st-cur.done { font-size: 22px; color: var(--ok); font-weight: 600; }
.st-next { color: var(--muted); font-size: 22px; }
.st-controls { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 0 4px; }
.st-controls kbd { margin-left: 6px; }
.st-big { padding: 14px 28px; font-size: 18px; }
.st-big kbd { background: rgba(0,0,0,.15); color: var(--accent-ink); border-color: rgba(0,0,0,.2); }
.st-live { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; min-height: 60px; }
.st-live:empty { display: none; }
.st-time { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.st-live-chords { display: grid; gap: 4px; }
.st-live-chords span { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); font-weight: 700; }
.st-live-chords b { font-family: var(--mono); color: var(--chord); font-size: 24px; }
.st-prog { position: relative; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.st-sheet { margin-top: 12px; max-height: 340px; white-space: pre; color: var(--text); }
.plain-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.plain-box summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; }
.plain-box .sub { margin-top: 10px; }
textarea.plain { min-height: 200px; font-family: var(--ui); font-size: 15px; }
.studio-link { margin-top: 14px; margin-bottom: 0; }
@media (max-width: 900px) {
  .st-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .st-side { flex-direction: row; align-items: flex-start; }
  .st-side .video-card { width: 260px; flex: none; }
  .st-side .st-live { flex: 1; }
  .st-side .st-prog { display: none; }
}

.tune-hint { cursor: pointer; border: 0; font: inherit; font-size: 12px; font-weight: 600; }
.tune-hint svg, .badge.ok svg { width: 12px; height: 12px; }
.icon-btn.tuning { animation: tune-pulse 1.4s ease-in-out infinite; }
@keyframes tune-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,179,71,.5); } 50% { box-shadow: 0 0 0 6px rgba(255,179,71,0); } }

.player.idle .pl-top, .player.idle .chord-strip { opacity: .12; }
.player.idle .pl-dock { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.player.idle { cursor: none; }

.help {
  position: absolute; inset: 0; background: rgba(10,9,8,.8); backdrop-filter: blur(6px); z-index: 20;
  display: grid; place-items: center; padding: 20px;
}
.help-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px 30px; max-width: 520px; width: 100%; }
.help-card h2 { margin: 0 0 16px; }
.help-card dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; align-items: center; }
.help-card dt { text-align: right; }
.help-card dd { margin: 0; color: var(--muted); }

.modal-back { position: fixed; inset: 0; background: rgba(10,9,8,.7); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; max-width: 420px; width: 100%; }
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.modal .row.tight { justify-content: flex-end; }

@media (max-height: 620px) {
  .rail { top: 104px; }
  .cp-now { min-height: 0; }
  .cp-now .diagram { width: 84px; height: 100px; }
  .cp-now b { font-size: 36px; }
}
@media (max-width: 900px) {
  .player { --rail-w: 170px; }
  .player.rail-wide { --rail-w: 46vw; }
  .rail { right: 10px; }
  .cp-next-body .diagram { display: none; }
  .player.has-rail .sheet { padding-left: 16px; padding-right: calc(var(--rail-w) + 24px); }
  .ed-grid { grid-template-columns: 1fr; }
  .sheet { padding-left: 16px; padding-right: 16px; }
  :root { --lyric-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* ================================================================ versión web */
body.web .only-local { display: none !important; }
.lib-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn svg[viewBox="0 0 24 24"] path[fill] { stroke: none; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary img { width: 24px; height: 24px; border-radius: 50%; }
.account-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  display: grid; gap: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.account-mail { color: var(--muted); font-size: 13px; word-break: break-all; }
.sync-banner {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid #5a4424; color: var(--text);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 20px; font-size: 15px;
}
.site-foot { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 34px; color: var(--dim); font-size: 13px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); }
.site-foot b { color: var(--accent); font-weight: 700; }

/* reproductor de YouTube: siempre visible y de al menos 200×200 px (reglas de YouTube) */
.vc-body { aspect-ratio: auto; height: max(200px, calc(var(--rail-w) * 9 / 16)); }
.player .rail { min-width: 200px; }

/* ================================================================ celular */
@media (max-width: 640px) {
  :root { --lyric-size: 23px; }
  .library, .editor { padding-left: 14px; padding-right: 14px; }
  .logo-word { font-size: 28px; }
  .lib-head { gap: 12px; }
  .lib-actions { width: 100%; }
  .lib-actions .btn.primary { margin-left: auto; }
  .quick { padding-left: 12px; }
  .quick .btn { padding: 9px 12px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-title { font-size: 16px; }
  .card-body { padding: 10px 12px; }
  .ed-foot { padding: 10px 14px; }
  .ed-foot-in .btn { padding: 9px 12px; font-size: 14px; }
  .magic-row { flex-wrap: wrap; }
  .magic-row input { min-width: 100%; }

  /* modo tocar: arriba el video + el acorde de ahora, abajo la letra a todo el ancho */
  .player { --rail-w: 100vw; }
  .player > .pl-top { order: 0; padding: 6px 10px; }
  .player > .rail { order: 1; }
  .player > .chord-strip { display: none; }
  .player > .stage { order: 2; }
  .player > .tab-lane { order: 3; margin: 0 10px 88px !important; }
  .rail {
    position: relative; inset: auto; right: auto; top: auto; bottom: auto; width: auto; min-width: 0;
    flex-direction: row; align-items: stretch; gap: 8px; padding: 0 10px 6px; overflow: visible;
  }
  .rail > .video-card { flex: 1 1 auto; min-width: 200px; order: 0; }
  .rail > .chord-panel { width: 112px; flex: none; order: 1; padding: 8px 10px; gap: 4px; }
  .vc-head { display: none; }
  .vc-body { height: 200px; }
  .cp-now { min-height: 0; }
  .cp-now b { font-size: 30px; }
  .cp-now .diagram { width: 64px; height: 76px; }
  .cp-next-body { min-height: 0; gap: 6px; }
  .cp-next-body b { font-size: 18px; }
  .cp-next-body .diagram, .cp-wait { display: none; }
  .player.has-rail .sheet, .sheet { padding: 18vh 12px 50vh !important; max-width: none; }
  .pl-dock { bottom: 10px; padding: 4px; gap: 2px; }
  .pl-dock .icon-btn { width: 38px; height: 38px; }
  .play-btn { width: 48px; height: 48px; }
  .dock-time { min-width: 0; padding: 0 6px; font-size: 12px; }
  #sz-dn, #sz-up, #full, #helpb { display: none; }
  .pl-meta .badge:not(.accent) { display: none; }
}

/* ventana de cuenta */
a.logo { color: inherit; text-decoration: none; }
.account-modal { display: grid; gap: 12px; max-width: 400px; }
.account-modal h3 { margin: 0; font-size: 22px; }
.account-modal p { margin: 0; }
.am-warn { background: var(--accent-soft); color: var(--text) !important; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.am-google { justify-content: center; background: var(--text); color: var(--bg); border-color: var(--text); }
.am-google:hover { background: #fff; }
.am-google svg { width: 18px; height: 18px; }
.am-or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.am-or::before, .am-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.am-form { display: grid; gap: 8px; }
.am-form .btn { justify-content: center; }
.am-help { color: var(--dim) !important; font-size: 13px; }
.am-status { font-size: 14px; min-height: 1em; }
.am-status.ok { color: var(--ok); }
.am-status.err { color: var(--danger); }
.am-close { justify-self: center; }
.google-slot { display: flex; justify-content: center; }
.google-slot:empty { display: none; }
@media (max-width: 640px) { .hint { display: none; } }

/* ---- tres vistas: karaoke / acordes / punteo */
.views { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); flex: none; }
.views button {
  border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s;
}
.views button:hover:not(:disabled) { color: var(--text); }
.views button.on { background: var(--accent); color: #121110; }
.views button:disabled { opacity: .35; cursor: not-allowed; }
.views button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.kara-intro { display: none; }
.player.view-karaoke .kara-intro {
  display: grid; gap: 6px; max-width: 560px; margin: 0 auto 28px; padding: 16px 20px; text-align: center;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--muted); font-size: 15px; line-height: 1.45;
}
.kara-intro b { color: var(--accent); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.kara-intro em { color: var(--text); font-style: normal; font-weight: 700; }
.player.view-karaoke .chord-strip,
.player.view-punteo .chord-strip,
.player.view-karaoke .ln .ch,
.player.view-karaoke .ln.tab { display: none; }
.player.view-karaoke .sheet.mono { font-family: inherit; }
.player.view-karaoke .ln,
.player.view-karaoke .sheet.mono .ln { font-size: calc(var(--lyric-size) * 1.22); text-align: center; font-weight: 600; }
.player.view-karaoke .sheet.mono .ln .ly { white-space: pre-wrap; }
.player.view-karaoke .ln.sec { font-size: 13px; }

/* punteo a pantalla completa: reemplaza a la letra */
.player.view-punteo .stage { display: none; }
.player.view-punteo .tab-lane { flex: 1; min-height: 0; margin: 4px 18px 92px; display: flex; flex-direction: column; }
.player.view-punteo.has-rail .tab-lane { margin-right: calc(var(--rail-w) + 36px); }
.player.view-punteo .tl-body { flex: 1; min-height: 0; align-content: start; gap: 18px; padding: 18px 20px; overflow: hidden; }
.tl-sys.next.later { opacity: .3; }
@media (max-width: 640px) {
  .pl-top { flex-wrap: wrap; }
  .views { order: 3; width: 100%; justify-content: stretch; }
  .views button { flex: 1; padding: 7px 6px; }
  .player.view-punteo .tab-lane { margin: 0 10px 88px !important; }
}
.player.view-karaoke .dock-tone { display: none; }

/* ---- cuando falta el punteo o los acordes: pegarlos ahí mismo */
.tl-empty, .chords-empty { display: grid; gap: 10px; max-width: 640px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.tl-empty h3, .chords-empty h3 { margin: 0; color: var(--text); font-size: 19px; }
.tl-empty p, .chords-empty p { margin: 0; }
.tl-empty textarea, .chords-empty textarea {
  width: 100%; box-sizing: border-box; font-family: var(--mono); font-size: 13px; line-height: 1.35; resize: vertical;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.tl-empty textarea:focus, .chords-empty textarea:focus { outline: none; border-color: var(--accent); }
.beta-note { font-size: 13px; color: var(--dim); border-left: 2px solid var(--accent); padding-left: 10px; }
.ce-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chords-empty { display: none; margin: 0 auto 28px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.player.view-acordes .chords-empty { display: grid; }
.player.view-punteo .tl-body:has(.tl-empty) { overflow-y: auto; }
.tl-chord { font-family: var(--mono); font-weight: 800; color: var(--chord); font-size: 18px; min-width: 2ch; }
.icon-btn.txt-btn { width: auto; padding: 0 10px; }
.txt-btn b { font-size: 13px; font-family: var(--mono); }
.loop-zone { position: absolute; top: 0; bottom: 0; background: rgba(122, 211, 200, .45); pointer-events: none; }
/* si no cabe en una fila, la barra pasa a dos (nada queda escondido fuera de la pantalla) */
.pl-dock { flex-wrap: wrap; justify-content: center; row-gap: 4px; width: max-content; }
@media (max-width: 640px) {
  .pl-dock .dock-sep, #helpb { display: none; }
  .pl-dock .dock-val { min-width: 44px; font-size: 12px; }
  .pl-dock .txt-btn { padding: 0 7px; }
  .pl-dock { row-gap: 2px; }
}

/* ------------------------------------------------------------ burbuja flotante "Donar" */
.donate-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; background: var(--accent); color: #121110; font-weight: 800; font-size: 15px;
  text-decoration: none; box-shadow: 0 12px 30px rgba(0,0,0,.45), 0 0 0 0 rgba(255,179,71,.5);
  transition: transform .2s cubic-bezier(.16,1,.3,1), opacity .3s; animation: fab-pulse 3.2s ease-out 2s 3;
}
.donate-fab svg { width: 18px; height: 18px; }
.donate-fab:hover { transform: translateY(-2px); }
.donate-fab.hide { opacity: 0; pointer-events: none; transform: translateY(12px); }
@keyframes fab-pulse { 0% { box-shadow: 0 12px 30px rgba(0,0,0,.45), 0 0 0 0 rgba(255,179,71,.55); } 70%, 100% { box-shadow: 0 12px 30px rgba(0,0,0,.45), 0 0 0 16px rgba(255,179,71,0); } }
@media (prefers-reduced-motion: reduce) { .donate-fab { animation: none; } .dn-goal-bar div { transition: none; } }
@media (max-width: 640px) { .donate-fab { right: 12px; bottom: 12px; padding: 10px 14px; font-size: 14px; } }

/* ---- donaciones dentro de la app */
.lib-donate { border-color: rgba(255,179,71,.5); color: var(--accent); font-weight: 700; }
.lib-donate:hover { border-color: var(--accent); background: rgba(255,179,71,.08); }
.donate-card {
  display: grid; grid-template-columns: 1fr auto; gap: 18px 28px; align-items: center; margin: 34px 0 10px;
  padding: 26px 28px; border-radius: 20px; border: 1px solid rgba(255,179,71,.45);
  background: radial-gradient(90% 140% at 100% 0%, rgba(255,179,71,.16), transparent 60%), var(--surface);
}
.donate-card h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.donate-card p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; line-height: 1.5; }
.btn.big-cta { padding: 14px 24px; font-size: 16px; }
@media (max-width: 640px) { .donate-card { grid-template-columns: 1fr; padding: 20px; } .donate-card .btn { justify-self: start; } }
.account-pop .btn.primary { justify-content: center; }
.end-donate {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; width: min(420px, calc(100vw - 32px));
  display: grid; gap: 10px; padding: 24px; border-radius: 20px; background: var(--surface-2); border: 1px solid rgba(255,179,71,.5);
  box-shadow: 0 24px 60px rgba(0,0,0,.5); text-align: center;
}
.end-donate b { font-size: 20px; color: var(--text); }
.end-donate p { margin: 0; color: var(--muted); line-height: 1.5; }
.end-donate-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

/* ---- insignias de apoyo (una por nivel) */
.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: .01em; border: 1px solid; }
.badge-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-pua { color: #d9cfc2; border-color: #5a534a; background: #23201d; }
.badge-cuerda { color: #7ad3c8; border-color: rgba(122,211,200,.5); background: rgba(122,211,200,.08); }
.badge-acorde { color: #ffb347; border-color: rgba(255,179,71,.55); background: rgba(255,179,71,.10); }
.badge-capo { color: #ff8a5c; border-color: rgba(255,138,92,.55); background: rgba(255,138,92,.10); }
.badge-solista { color: #f4eee5; border-color: #f4eee5; background: rgba(244,238,229,.08); }
.badge-fundador { color: #121110; border-color: #ffb347; background: linear-gradient(135deg, #ffcf7a, #ffb347); }
.account-badge { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }

/* ---- gracias por donar */
.thanks-modal { text-align: center; max-width: 440px; }
.thanks-badge { font-size: 15px; padding: 6px 14px; margin-bottom: 6px; }
.thanks-modal h3 { font-size: 26px; margin: 6px 0 4px; }
.thanks-modal b { color: var(--text); }
.thanks-perks { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; color: var(--text); font-weight: 600; }
.thanks-note { color: var(--muted); font-size: 14px; }
.thanks-sign { color: var(--accent); font-weight: 700; font-size: 14px; margin-top: 6px; }
.modal.thanks-modal .row.tight { justify-content: center; }

/* ---- cuenta 3, 2, 1 */
.count-in { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; background: rgba(18,17,16,.35); }
.count-in b { font-size: clamp(120px, 24vw, 260px); font-weight: 800; color: var(--accent); line-height: 1; text-shadow: 0 10px 60px rgba(255,179,71,.45); animation: count-pop .85s cubic-bezier(.16,1,.3,1); }
@keyframes count-pop { from { transform: scale(1.5); opacity: 0; } 30% { opacity: 1; } to { transform: scale(.9); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .count-in b { animation: none; } }

/* ---- afinador */
.tuner { max-width: 640px; margin: 0 auto; padding: 18px 18px 60px; display: grid; gap: 18px; }
.tuner-top { display: flex; align-items: center; gap: 12px; }
.tuner-top h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.tuner-sub, .tuner-foot { color: var(--muted); margin: 0; line-height: 1.5; }
.tuner-foot { font-size: 14px; color: var(--dim); }
.tuner-dial { display: grid; gap: 14px; justify-items: center; padding: 26px 20px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); transition: border-color .3s, background .3s; }
.tuner-dial.ok { border-color: #5fd39a; background: linear-gradient(180deg, rgba(95,211,154,.10), var(--surface)); }
.t-scale { display: flex; justify-content: space-between; width: 100%; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.t-track { position: relative; width: 100%; height: 14px; border-radius: 999px; background: var(--surface-3); }
.t-zone { position: absolute; left: 45%; width: 10%; top: 0; bottom: 0; border-radius: 999px; background: rgba(95,211,154,.35); }
.t-needle { position: absolute; top: -8px; bottom: -8px; left: 50%; width: 4px; margin-left: -2px; border-radius: 4px; background: var(--dim); transition: left .12s linear, background .2s; }
.tuner-dial.live .t-needle { background: var(--accent); box-shadow: 0 0 14px rgba(255,179,71,.6); }
.tuner-dial.ok .t-needle { background: #5fd39a; box-shadow: 0 0 14px rgba(95,211,154,.7); }
.t-note { display: grid; justify-items: center; }
.t-note b { font-family: var(--mono); font-size: clamp(72px, 18vw, 120px); line-height: 1; color: var(--text); }
.tuner-dial.ok .t-note b { color: #5fd39a; }
.t-note span { color: var(--muted); font-size: 15px; }
.t-hint { font-weight: 700; color: var(--text); min-height: 1.4em; }
.t-hz { font-family: var(--mono); font-size: 12px; color: var(--dim); min-height: 1em; }
.t-strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.t-str { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, background .2s; }
.t-str b { font-family: var(--mono); font-size: 22px; }
.t-str small { color: var(--dim); font-size: 11px; }
.t-str.on { border-color: var(--accent); background: rgba(255,179,71,.10); }
.t-start { justify-self: center; }

/* ---- punteo pro (Guitar Pro) */
.pro { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.pro-top { display: flex; align-items: center; gap: 12px; padding: 10px 18px; flex-wrap: wrap; }
.pro-top .pl-title { margin-right: auto; }
.pro-select { font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }
.pro-file { cursor: pointer; }
.pro-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 0 18px 96px; }
.pro-scroll { position: relative; overflow: auto; border-radius: 18px; border: 1px solid var(--line); background: #151412; }
#pro-at { min-height: 100%; }
.pro-video { width: 300px; }
.pro-video .vc-body { height: 200px; }
.pro-empty { max-width: 620px; margin: 40px auto; padding: 0 22px; display: grid; gap: 14px; justify-items: start; color: var(--muted); line-height: 1.55; }
.pro-empty h2 { margin: 0; color: var(--text); font-size: 28px; letter-spacing: -0.02em; }
.pro-empty b { color: var(--text); }
.pro-hint { font-size: 14px; color: var(--dim); }
.pro-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: rgba(21,20,18,.85); z-index: 2; }
.pro-dock { flex-wrap: wrap; }
.pro-mode button { font-size: 12px; padding: 5px 10px; }
.at-cursor-bar { background: rgba(255,179,71,.10); }
.at-cursor-beat { background: var(--accent); width: 3px; opacity: .9; }
.at-highlight * { fill: var(--accent); stroke: var(--accent); }
.at-selection div { background: rgba(122,211,200,.18); }
.tl-pro { margin-left: 6px; }
@media (max-width: 760px) {
  .pro-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding: 0 10px 110px; }
  .pro-video { width: auto; order: -1; }
  .pro-video .vc-body { height: 180px; }
}

/* textos de la tablatura en claro sobre el fondo oscuro */
#pro-at .at-surface text, #pro-at .at-surface tspan { fill: #d9cfc2 !important; }
#pro-at .at-surface .at-highlight text, #pro-at .at-surface .at-highlight * { fill: var(--accent); }
.pro-scroll { overflow-x: hidden; }

/* ---- agregar canción (simple) */
.quickadd { max-width: 680px; margin: 0 auto; padding: 18px 18px 80px; display: grid; gap: 18px; }
.qa-top { display: flex; align-items: center; gap: 12px; }
.qa-top h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.qa-form { display: grid; gap: 10px; padding: 20px; border-radius: 20px; border: 1px solid rgba(255,179,71,.45); background: linear-gradient(170deg, rgba(255,179,71,.10), var(--surface) 60%); }
.qa-form label { font-weight: 800; font-size: 18px; color: var(--text); }
.qa-row { display: flex; gap: 8px; }
.qa-row input, .qa-ask input, .qa-ask textarea { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; }
.qa-row input:focus, .qa-ask input:focus, .qa-ask textarea:focus { outline: none; border-color: var(--accent); }
.qa-help { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.qa-help b { color: var(--text); }
.qa-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.qa-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }
.qa-song { display: grid; margin-bottom: 6px; }
.qa-song b { font-size: 17px; }
.qa-song span { color: var(--muted); font-size: 14px; }
.qa-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.qa-steps li { display: flex; gap: 8px; align-items: center; }
.qa-steps li svg { width: 16px; height: 16px; color: #5fd39a; flex: none; }
.qa-steps li.err { color: #ff8a70; }
.qa-steps li.warn { color: var(--accent); }
.qa-ok, .qa-ask { margin-top: 14px; padding: 22px; border-radius: 20px; display: grid; gap: 12px; }
.qa-ok { border: 1px solid rgba(95,211,154,.5); background: linear-gradient(170deg, rgba(95,211,154,.10), var(--surface) 60%); text-align: center; justify-items: center; }
.qa-ask { border: 2px solid var(--accent); background: var(--surface); }
.qa-ok h2, .qa-ask h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.qa-ok p, .qa-ask p { margin: 0; color: var(--muted); line-height: 1.5; }
.qa-play { font-size: 18px; padding: 15px 28px; justify-self: stretch; justify-content: center; }
.qa-ok .qa-play { justify-self: center; }
.qa-sec a { color: var(--muted); font-size: 14px; }
.qa-opt { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.qa-opt h3 { margin: 0; font-size: 16px; }
.qa-small { font-size: 14px !important; }
.qa-row-2 { flex-wrap: wrap; }
.qa-row-2 input { flex: 1 1 160px; }
.qa-more summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 6px 2px; }
.qa-more-in { display: grid; gap: 8px; margin-top: 8px; }
.qa-more-in .btn { justify-content: flex-start; }
@media (max-width: 520px) {
  .quickadd { padding: 12px 12px 60px; }
  .qa-row:not(.qa-row-2) { flex-direction: column; }
  .qa-row .btn { justify-content: center; padding: 13px; }
  .qa-card { grid-template-columns: 88px minmax(0, 1fr); }
  .qa-thumb { width: 88px; }
}

/* ================================================================ celular: pensado para el pulgar */
.mobile-nav { display: none; }
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .donate-fab { display: none !important; }            /* "Donar" ya está en la barra de abajo */
  .library, .quickadd, .tuner { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(22,20,18,.94);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .mn-item { display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; }
  .mn-item svg { width: 22px; height: 22px; }
  .mn-item.on { color: var(--accent); }
  .mn-add svg { width: 26px; height: 26px; padding: 8px; box-sizing: content-box; border-radius: 16px; background: var(--accent); color: #121110; margin-top: -18px; box-shadow: 0 8px 24px rgba(255,179,71,.35); }
  .mn-add.on { color: var(--accent); }

  /* cabecera limpia: logo + cuenta */
  .lib-head { flex-wrap: nowrap; justify-content: space-between; margin-bottom: 16px; }
  .lib-actions { width: auto !important; flex-wrap: nowrap; }
  .logo-sub { font-size: 11px; }

  /* pegar el link: grande y claro */
  .quick { padding: 6px 6px 6px 14px; border-radius: 18px; }
  .quick input { font-size: 16px; }
  .quick .btn { padding: 11px 14px; }

  /* canciones: una por fila, fácil de leer y de tocar */
  .grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .card { aspect-ratio: auto; min-height: 92px; justify-content: center; }
  .card-bg { right: auto; width: 118px; opacity: .9; border-radius: 0; }
  .card-bg.none { width: 118px; }
  .card-shade { background: linear-gradient(90deg, rgba(12,11,10,0) 0, rgba(12,11,10,.2) 70px, var(--surface) 118px); }
  .card-body { padding: 12px 88px 12px 132px !important; }
  .card-title { font-size: 17px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-artist { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-badges { margin-top: 8px; gap: 4px; }
  .card-badges .badge { font-size: 11px; padding: 2px 7px; }
  .card-play { opacity: 1; transform: none; top: 50%; left: 41px; margin-top: -18px; width: 36px; height: 36px; }
  .card-edit { opacity: 1; top: 50%; right: 8px; transform: translateY(-50%); }
  .card-edit svg { width: 16px; height: 16px; }
  .lib-tools { gap: 10px; }
  .donate-card h2 { font-size: 20px; }
  .site-foot { margin-bottom: 8px; }
}
.qa-form.compact .qa-help, .qa-form.compact label { display: none; } .qa-form.compact { padding: 12px; }
#qa-out { scroll-margin-top: 12px; }
/* editor en el celular: una sola columna, nada se sale de la pantalla */
@media (max-width: 900px) {
  .ed-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .ed-col, .ed-col > *, .panel { min-width: 0; }
}
@media (max-width: 640px) {
  .editor .row { flex-wrap: wrap; }
  .editor .row > * { flex: 1 1 100%; min-width: 0; }
  .editor textarea, .editor input { max-width: 100%; box-sizing: border-box; }
  .editor .links { flex-wrap: wrap; }
  .editor .btn { white-space: normal; }
  .ed-foot-in { flex-wrap: wrap; }
}
.qa-more-in .btn { white-space: normal; text-align: left; }

/* ---- bienvenida a la beta */
.welcome-modal { max-width: 460px; text-align: left; display: grid; gap: 10px; }
.wel-logo { font-family: var(--ui); font-weight: 800; font-size: 34px; color: var(--accent); letter-spacing: -0.003em; line-height: 1; }
.wel-tag { justify-self: start; font-size: 12px; font-weight: 800; color: #121110; background: var(--accent); padding: 3px 10px; border-radius: 999px; }
.welcome-modal h3 { font-size: 26px; margin: 4px 0 0; }
.welcome-modal p { margin: 0; color: var(--muted); line-height: 1.5; }
.wel-steps { margin: 4px 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text); line-height: 1.45; }
.wel-note a, .wel-donate a { color: var(--accent); }
.wel-donate { font-size: 14px; color: var(--muted); padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,179,71,.4); background: rgba(255,179,71,.07); line-height: 1.45; }
.welcome-modal .row.tight { justify-content: stretch; }
.welcome-modal [data-ok] { width: 100%; justify-content: center; }

/* ---- repertorio sugerido */
.repertoire { margin: 34px 0 6px; display: grid; gap: 18px; }
.rep-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.rep-head p { margin: 4px 0 0; color: var(--muted); }
.rep-cat h3 { margin: 0 0 10px; font-size: 15px; color: var(--accent); letter-spacing: .02em; }
.rep-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 200px); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rep-item { scroll-snap-align: start; display: grid; gap: 3px; text-decoration: none; color: var(--text); padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, transform .2s; }
.rep-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.rep-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; margin-bottom: 6px; }
.rep-item b { font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-item span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-item em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.rep-item em svg { width: 14px; height: 14px; }
.rep-item em.have { color: #5fd39a; }
.rep-foot { color: var(--muted); font-size: 14px; margin: 0; }
.rep-foot a { color: var(--accent); }
@media (max-width: 640px) { .rep-row { grid-auto-columns: 62%; margin-right: -14px; padding-right: 14px; } .rep-head h2 { font-size: 21px; } }

/* afinador: afinación, referencia y hacia dónde girar */
.t-conf { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
.t-tuning { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); flex: 1 1 220px; }
.t-tuning select { font: inherit; font-size: 15px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.t-a4 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.t-a4 b { font-family: var(--mono); color: var(--text); font-size: 15px; min-width: 64px; text-align: center; }
.t-sides { display: flex; justify-content: space-between; width: 100%; font-weight: 800; font-size: 15px; line-height: 1.25; }
.t-sides small { font-weight: 600; font-size: 12px; }
.t-flat, .t-sharp { color: var(--dim); transition: color .15s; }
.t-sharp { text-align: right; }
.tuner-dial.flat .t-flat, .tuner-dial.sharp .t-sharp { color: #ff8a70; }
.t-scale span:nth-child(2), .t-scale span:nth-child(4) { opacity: .5; }
.t-cents { font-family: var(--mono); font-size: 14px; color: var(--muted); min-height: 1.2em; }
.tuner-dial.ok .t-cents { color: #5fd39a; }
.repertoire { grid-template-columns: minmax(0, 1fr); } .rep-cat { min-width: 0; } @media (max-width: 640px) { .rep-row { margin-right: 0 !important; padding-right: 0 !important; grid-auto-columns: 64% !important; } }
.am-free { margin: -4px 0 6px; color: var(--muted); font-size: 14px; }

/* ---- ajustar la letra */
.calib-bar { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 25; width: min(560px, calc(100vw - 24px));
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px;
  background: var(--surface-2); border: 2px solid var(--accent); box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.calib-bar b { color: var(--accent); }
.calib-bar span { color: var(--text); font-size: 15px; flex: 1 1 220px; }
.calib-bar span b { color: var(--text); }
.lrc-modal { max-width: 520px; }
.lrc-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; margin: 10px 0; }
.lrc-opt { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.lrc-opt span { color: var(--muted); font-size: 13px; }
.lrc-opt:hover { border-color: var(--accent); }
.lrc-opt.sel { border-color: #5fd39a; }
.tl-searching { justify-items: center; text-align: center; margin: 40px auto; } .tl-searching .spin { width: 28px; height: 28px; }

/* ---- entrar con el código del correo */
.code-step { display: grid; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.code-step input { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.code-step .btn { justify-content: center; }
.code-status { font-size: 14px; min-height: 1em; margin: 0; }
.code-status.err { color: var(--danger); }
