/* BilboTabs — mismo lenguaje visual que bilbolab.es: cristal, blobs, rojo "REC" */
:root {
  --bg: #07070c;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.55);
  --glass: rgba(255,255,255,.06);
  --glass-strong: rgba(255,255,255,.10);
  --stroke: rgba(255,255,255,.14);
  --blob1: #5b6cff;
  --blob2: #ff3b6b;
  --blob3: #2fd3c5;
  --blob4: #b0122f;
  --red: #ff453a;
  --indigo: #9aa6ff;
  --green: #34c759;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f2f7;
    --text: rgba(10,10,20,.9);
    --muted: rgba(10,10,20,.55);
    --glass: rgba(255,255,255,.45);
    --glass-strong: rgba(255,255,255,.65);
    --stroke: rgba(255,255,255,.8);
    --red: #d70015;
    --indigo: #4b5bd6;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
::selection { background: var(--red); color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .92em; padding: 1px 6px; border-radius: 6px; background: var(--glass-strong); }

/* ---- Fondo ---- */
.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; filter: blur(80px) saturate(140%); }
.blob { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; opacity: .5; mix-blend-mode: screen; will-change: transform; }
@media (prefers-color-scheme: light) { .blob { mix-blend-mode: multiply; opacity: .3; } }
.b1 { background: var(--blob1); top: -12%; left: -10%; animation: drift1 22s ease-in-out infinite alternate; }
.b2 { background: var(--blob2); bottom: -18%; right: -12%; animation: drift2 26s ease-in-out infinite alternate; }
.b3 { background: var(--blob3); top: 35%; left: 40%; width: 30vmax; height: 30vmax; opacity: .3; animation: drift3 30s ease-in-out infinite alternate; }
.b4 { background: var(--blob4); top: 5%; right: 15%; width: 26vmax; height: 26vmax; opacity: .45; animation: drift1 34s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(18vw, 22vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-22vw, -16vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-16vw, 12vh) scale(1.25); } }
body.playing .b2 { animation: drift2 26s ease-in-out infinite alternate, beat var(--beat, .6s) ease-out infinite; }
@keyframes beat { 0% { opacity: .62; } 100% { opacity: .5; } }
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45)); }
@media (prefers-color-scheme: light) { .vignette { background: radial-gradient(ellipse at center, transparent 60%, rgba(120,0,20,.08)); } }
.spot { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,.07), transparent 60%); }
@media (prefers-reduced-motion: reduce) { .blob { animation: none !important; } }

.glass {
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 20px 50px rgba(0,0,0,.15);
}

/* ---- Barra superior ---- */
nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 6px;
  background: var(--glass); border: 1px solid var(--stroke); border-radius: 999px;
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0,0,0,.18); z-index: 30; max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none;
}
nav .logo { font-weight: 700; letter-spacing: -.02em; padding: 8px 14px; display: flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; }
nav .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blinkrec 1.2s steps(1) infinite; }
body:not(.playing) nav .rec { animation-duration: 2.4s; }
@keyframes blinkrec { 50% { opacity: .15; } }
nav a.link { color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s; white-space: nowrap; }
nav a.link:hover, nav a.link.on { color: var(--text); background: var(--glass-strong); }
nav a.out { opacity: .75; }
@media (max-width: 640px) { nav a.out { display: none; } nav a.link { padding: 8px 10px; } nav .logo { padding: 8px 10px; } }
body.focus nav { opacity: 0; pointer-events: none; transform: translate(-50%, -80px); transition: .3s; }

/* ---- Biblioteca ---- */
main.view { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hero { min-height: 56vh; display: grid; place-items: center; align-content: center; text-align: center; padding-top: 110px; }
.hero.small { min-height: 0; padding: 120px 0 8px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--stroke); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); margin-bottom: 24px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,69,58,.6); } 70% { box-shadow: 0 0 0 10px rgba(255,69,58,0); } 100% { box-shadow: 0 0 0 0 rgba(255,69,58,0); } }
h1 {
  font-size: clamp(52px, 11vw, 132px); font-weight: 800; letter-spacing: -.06em; line-height: .95;
  background: linear-gradient(120deg, var(--text) 20%, #9aa6ff 42%, #ff4f7b 58%, var(--text) 80%);
  background-size: 250% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: -250% center; } }
.tagline { margin-top: 20px; font-size: clamp(18px, 2.4vw, 24px); color: var(--muted); letter-spacing: -.01em; }
.tagline .hl { color: var(--text); font-weight: 600; }
section { padding: 24px 0 64px; }
.section-title { font-size: clamp(30px, 5vw, 48px); font-weight: 700; letter-spacing: -.04em; text-align: center; }
.section-title em { font-style: normal; color: var(--red); }
.section-sub { text-align: center; color: var(--muted); margin: 10px auto 32px; font-size: 17px; max-width: 640px; line-height: 1.5; }

.toolbar { position: sticky; top: 80px; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px; border-radius: 24px; margin-bottom: 18px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--stroke); }
.search span { color: var(--muted); font-size: 18px; }
.search input { flex: 1; background: none; border: 0; outline: 0; padding: 11px 0; font-size: 15px; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--stroke); background: transparent; color: var(--muted); transition: .2s; white-space: nowrap; }
.chip:hover { color: var(--text); background: var(--glass-strong); }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; padding: 22px; border-radius: 26px; overflow: hidden; min-height: 190px;
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 20px 50px rgba(0,0,0,.15);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(380px circle at var(--cx, 50%) var(--cy, 50%), rgba(255,255,255,.16), transparent 50%); }
.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 30px 70px rgba(0,0,0,.25), 0 0 0 1px rgba(255,69,58,.25); }
.card .cover { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; margin-bottom: 16px; box-shadow: 0 8px 20px rgba(0,0,0,.2); color: #fff; font-weight: 700; }
.card h3 { font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.card .artist { color: var(--muted); font-size: 14px; margin-top: 2px; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 10px; flex: 1; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--stroke); color: var(--muted); }
.level { position: absolute; top: 22px; right: 22px; display: flex; gap: 3px; }
.level i { width: 6px; height: 14px; border-radius: 3px; background: var(--stroke); }
.level i.on { background: var(--red); }
.card .fav { position: absolute; top: 46px; right: 18px; background: none; border: 0; font-size: 18px; color: var(--muted); padding: 4px; }
.card .fav.on { color: #ffcc00; }
.card .del { position: absolute; bottom: 16px; right: 16px; background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 32px; border-radius: 26px; border-style: dashed; cursor: pointer; margin-bottom: 16px; text-align: center; transition: .2s; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--glass-strong); }
.drop-ico { font-size: 30px; }
.drop span { color: var(--muted); font-size: 14px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px 60px; line-height: 1.8; }
footer a { color: var(--muted); text-underline-offset: 3px; }
footer a:hover { color: var(--text); }

/* ---- Reproductor ---- */
main.view.player { max-width: none; padding: 78px 12px 0; height: 100vh; display: flex; flex-direction: column; gap: 10px; }
body.focus main.view.player { padding-top: 12px; }
.ptop { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 22px; flex-wrap: wrap; }
.back { text-decoration: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--glass-strong); flex: none; }
.ptitle { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.ptitle b { font-size: 17px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptitle span { font-size: 13px; color: var(--muted); }
.tracks { display: flex; gap: 6px; flex-wrap: wrap; }
.trk { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--stroke); background: transparent; color: var(--muted); white-space: nowrap; }
.trk i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.trk.on { color: var(--text); background: var(--glass-strong); border-color: var(--c, var(--stroke)); }
.trk.muted { text-decoration: line-through; opacity: .6; }
.ic { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--stroke); font-size: 15px; transition: transform .2s, background .2s; }
.ic:hover { transform: scale(1.06); }
.ic.on { background: var(--text); color: var(--bg); }
#b-fav.on { color: #ffcc00; }

.stage { flex: 1; min-height: 0; display: flex; gap: 10px; }
.score { position: relative; flex: 1; min-width: 0; border-radius: 26px; overflow: auto; overscroll-behavior: contain; padding: 18px 10px 40px; }
#at { min-height: 100%; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); z-index: 3; background: var(--glass); backdrop-filter: blur(10px); border-radius: inherit; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--stroke); border-top-color: var(--red); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* cursores y resaltado de alphaTab */
.at-cursor-bar { background: rgba(255,69,58,.08); }
.at-cursor-beat { background: var(--red); width: 3px; border-radius: 2px; box-shadow: 0 0 12px var(--red); }
.at-selection div { background: rgba(124,140,255,.22); }
.at-highlight * { fill: var(--red); stroke: var(--red); }
.at-surface { cursor: pointer; }

.panel { width: 340px; flex: none; border-radius: 26px; display: flex; flex-direction: column; overflow: hidden; }
.panel-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--stroke); align-items: center; }
.panel-tabs button { font-size: 13px; padding: 8px 12px; border-radius: 999px; border: 0; background: none; color: var(--muted); }
.panel-tabs button.on { background: var(--glass-strong); color: var(--text); }
.panel-tabs .close { margin-left: auto; width: 32px; height: 32px; padding: 0; border: 1px solid var(--stroke); }
.panel-body { padding: 14px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) {
  .panel { position: fixed; right: 12px; left: 12px; bottom: 92px; top: auto; width: auto; max-height: 60vh; z-index: 20; }
}

.mx { padding: 12px; border-radius: 18px; background: var(--glass); border: 1px solid var(--stroke); display: grid; gap: 10px; }
.mx-head { display: flex; align-items: center; gap: 8px; }
.mx-head b { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.mx-btn { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--stroke); background: var(--glass-strong); font-size: 12px; font-weight: 700; }
.mx-btn.solo.on { background: #ffcc00; color: #000; border-color: transparent; }
.mx-btn.mute.on { background: var(--red); color: #fff; border-color: transparent; }
.mx-btn.eye.on { background: var(--text); color: var(--bg); }
.mx-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mx-row input[type=range] { flex: 1; }
.mx-row select { flex: 1; min-width: 0; }
select { background: var(--glass-strong); border: 1px solid var(--stroke); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
select option { background: #1b1b24; color: #fff; }
@media (prefers-color-scheme: light) { select option { background: #fff; color: #000; } }
.mx-listen { font-size: 12px; text-align: right; }
.mx-listen button { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

input[type=range] { accent-color: var(--red); }
.field { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--stroke); font-size: 14px; }
.field:last-child { border-bottom: 0; }
.field > span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.row { display: flex; align-items: center; gap: 10px; }
.row input[type=range] { flex: 1; }
output { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; font-family: var(--mono); font-size: 13px; }
.presets { display: flex; gap: 6px; }
.presets button, .mini { font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--glass-strong); }
.mini:hover, .presets button:hover { border-color: var(--red); }
.sw { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.sw input { display: none; }
.sw i { width: 38px; height: 22px; border-radius: 999px; background: var(--stroke); position: relative; transition: .2s; flex: none; }
.sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.sw input:checked + i { background: var(--red); }
.sw input:checked + i::after { transform: translateX(16px); }
.trainer-grid { display: flex; gap: 8px; }
.trainer-grid label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.trainer-grid input { width: 52px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--stroke); background: var(--glass-strong); }
.range-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: 12px; background: rgba(124,140,255,.18); }
.range-chip span { flex: 1; }
.range-chip button { background: none; border: 0; text-decoration: underline; color: var(--muted); }
.stats b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

/* Explicaciones */
.hint { color: var(--muted); font-size: 14px; line-height: 1.5; }
.ex-head { display: flex; align-items: baseline; gap: 10px; }
.ex-big { font-size: 34px; font-weight: 800; letter-spacing: -.04em; }
.ex-sub { color: var(--muted); font-size: 13px; }
.ex-card { padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--stroke); }
.ex-card h4 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.ex-card h4 .sym { font-family: var(--mono); font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--glass-strong); color: var(--red); }
.ex-card p { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 4px; }
.ex-card a { color: var(--indigo); font-size: 12px; }
.fretboard { width: 100%; height: auto; display: block; margin-top: 4px; }

/* Barra inferior */
.pbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 999px; margin: 0 auto 12px; flex-wrap: wrap; max-width: 100%; justify-content: center; }
.play { width: 50px; height: 50px; flex: none; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); font-size: 18px; transition: transform .2s; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.play:hover:not(:disabled) { transform: scale(1.07); }
.play:disabled { opacity: .4; cursor: progress; }
.time { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 1 1 200px; min-width: 180px; }
.time input { flex: 1; }
.pgroup { display: flex; gap: 4px; align-items: center; padding-left: 8px; border-left: 1px solid var(--stroke); }
.tg { height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--stroke); background: transparent; color: var(--muted); font-size: 13px; white-space: nowrap; transition: .2s; }
.tg:hover { color: var(--text); background: var(--glass-strong); }
.tg.on { color: var(--text); background: var(--glass-strong); border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
@media (max-width: 900px) {
  .pbar { border-radius: 26px; }
  .pgroup { border-left: 0; padding-left: 0; }
  .time { order: -1; flex-basis: 100%; }
}

/* ---- Aprender ---- */
.learn-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding-bottom: 260px; align-items: start; }
.toc { position: sticky; top: 90px; border-radius: 22px; padding: 10px; display: grid; gap: 2px; }
.toc a { text-decoration: none; padding: 9px 12px; border-radius: 12px; color: var(--muted); font-size: 14px; display: flex; gap: 8px; }
.toc a:hover { color: var(--text); background: var(--glass-strong); }
.gsec { margin-bottom: 40px; scroll-margin-top: 100px; }
.gsec h3 { font-size: 28px; letter-spacing: -.03em; margin-bottom: 6px; }
.gsec > p { color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.gitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.gitem { padding: 18px; border-radius: 22px; display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 100px; }
.gitem h4 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.gitem p { color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.gitem button { align-self: flex-start; margin-top: 6px; }
.gitem.flash { box-shadow: 0 0 0 2px var(--red); }
@media (max-width: 760px) { .learn-layout { grid-template-columns: 1fr; } .toc { position: static; display: flex; overflow-x: auto; } .toc a { white-space: nowrap; } }
.example { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(900px, calc(100% - 32px)); border-radius: 26px; z-index: 25; max-height: 50vh; overflow: auto; padding: 10px 10px 16px; }
.example-bar { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; position: sticky; top: 0; }
.example-bar b { flex: 1; }

/* ---- Editor ---- */
.editor { display: grid; grid-template-columns: minmax(300px, 1fr) 1.3fr; gap: 14px; padding-bottom: 60px; }
.ed-left, .ed-right { border-radius: 24px; padding: 12px; min-width: 0; }
.ed-right { overflow: auto; max-height: 75vh; }
.ed-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
#ed-src { width: 100%; min-height: 360px; resize: vertical; border-radius: 16px; border: 1px solid var(--stroke); background: rgba(0,0,0,.25); padding: 14px; font-family: var(--mono); font-size: 13px; line-height: 1.6; outline: 0; tab-size: 2; }
@media (prefers-color-scheme: light) { #ed-src { background: rgba(255,255,255,.6); } }
#ed-src:focus { border-color: var(--red); }
.ed-err { color: var(--red); font-size: 13px; font-family: var(--mono); min-height: 1.2em; margin-top: 6px; white-space: pre-wrap; }
.cheat { margin-top: 10px; font-size: 13px; }
.cheat summary { cursor: pointer; color: var(--muted); }
.cheat table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.cheat td { padding: 5px 4px; border-bottom: 1px solid var(--stroke); color: var(--muted); }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }

/* ---- Afinador ---- */
.tuner { max-width: 520px; margin: 0 auto 80px; border-radius: 30px; padding: 28px; display: grid; gap: 20px; justify-items: center; text-align: center; }
.tn-note { display: grid; }
#tn-name { font-size: 96px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
#tn-freq { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.tn-meter { position: relative; width: 100%; height: 60px; }
.tn-scale { position: absolute; inset: 24px 0; border-radius: 999px; background: linear-gradient(90deg, var(--red), #ffb340 35%, var(--green) 50%, #ffb340 65%, var(--red)); opacity: .55; }
.tn-needle { position: absolute; top: 4px; bottom: 4px; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 14px var(--text); transition: left .12s; }
.tn-cents { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.tn-cents.ok { color: var(--green); font-weight: 700; }
.tn-strings { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tn-strings button { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--stroke); background: var(--glass-strong); font-weight: 700; font-size: 16px; }
.tn-strings button.near { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.small-print { font-size: 12px; color: var(--muted); }
.btn { text-decoration: none; color: var(--text); font-size: 15px; font-weight: 500; padding: 14px 26px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--stroke); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn:hover { transform: translateY(-2px) scale(1.03); }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; opacity: 0; pointer-events: none; transition: .3s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media print {
  body * { visibility: hidden; }
}

/* ---- Cuenta ---- */
nav button.acct { border: 1px solid var(--stroke); background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
nav button.acct.in { color: var(--text); background: var(--glass-strong); }
.acct-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal-card { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 28px; padding: 28px; background: var(--glass-strong); }
@media (prefers-color-scheme: dark) { .modal-card { background: rgba(20,20,30,.82); } }
.modal-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; }
#acct-body h3 { font-size: 24px; letter-spacing: -.03em; margin-right: 36px; }
.acct-lead { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 6px 0 18px; }
.acct-form { display: grid; gap: 12px; }
.acct-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.acct-form input { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--stroke); background: rgba(0,0,0,.2); font-size: 15px; outline: 0; }
@media (prefers-color-scheme: light) { .acct-form input { background: rgba(255,255,255,.7); border-color: rgba(0,0,0,.12); } }
.acct-form input:focus { border-color: var(--red); }
.acct-form .btn { margin-top: 4px; }
.acct-form .btn:disabled { opacity: .6; cursor: progress; }
.acct-err { color: var(--red); font-size: 13px; min-height: 1em; }
.acct-row { display: flex; gap: 8px; justify-content: flex-end; }
.acct-notice { margin-top: 20px; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(255,69,58,.35); background: rgba(255,69,58,.08); font-size: 13px; line-height: 1.5; display: grid; gap: 6px; }
.acct-notice b { font-size: 14px; }
.acct-notice p { color: var(--muted); }
.acct-privacy { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.acct-privacy a { color: var(--muted); }
.acct-actions { display: grid; gap: 8px; margin-top: 18px; }
.btn.danger { color: var(--red); }
.quota { display: grid; gap: 6px; }
.quota-bar { height: 8px; border-radius: 999px; background: var(--stroke); overflow: hidden; }
.quota-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7c8cff, var(--red)); border-radius: inherit; }
.quota small { color: var(--muted); font-size: 12px; }
.section-sub a { color: var(--text); }
body.modal-open { overflow: hidden; }
@media (max-width: 640px) {
  nav { gap: 2px; padding: 5px; }
  nav .logo .lt { display: none; }
  nav .logo { padding: 8px 9px; }
  nav a.link, nav button.link { font-size: 13px; padding: 8px 6px; }
  nav button.acct .acct-name { display: none; }
}
