/*! Partituras · © 2026 Tomás Galán. Todos los derechos reservados. Prohibida su copia o distribución sin permiso. */
:root{--bg: #eef0f4;--panel: #ffffff;--ink: #1d2230;--muted: #6b7385;--line: #dde1e8;--paper: #fffdf8;--accent: #2563eb;--accent-soft: #dbe6fd;--right: #2563eb;--left: #e8690f;--sel: #d61f69;--radius: 8px;font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--ink)}*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:var(--bg);display:grid;grid-template-rows:auto auto 1fr auto;height:100vh;overflow:hidden;font-size:14px}.topbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;padding:10px 16px;background:#171b26;color:#e9ecf3}.brand{font-weight:700;font-size:18px;display:flex;align-items:center;gap:6px;margin-right:6px}.brand-clef{font-family:Noto Music,Segoe UI Symbol,serif;font-size:26px;line-height:1}.group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.group.end{margin-left:auto}.field{display:flex;align-items:center;gap:6px;color:#b9c0d0}.unit{color:#8a93a8;font-size:12px}.check{display:flex;align-items:center;gap:6px;cursor:pointer;user-select:none}.topbar input[type=number],.topbar select{background:#252b3b;color:#fff;border:1px solid #39415a;border-radius:6px;padding:5px 6px;font:inherit;width:64px}.topbar select{width:auto}.topbar input[type=range]{width:120px;accent-color:#6d9bff}.btn{font:inherit;font-weight:500;background:#2a3144;color:#e9ecf3;border:1px solid #3a4360;border-radius:6px;padding:6px 12px;cursor:pointer;white-space:nowrap}.btn:hover{background:#343c54}.btn.icon{padding:6px 10px}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;min-width:128px}.btn.primary:hover{background:#1d4fd0}.btn.primary.playing{background:#0f9d58;border-color:#0f9d58}.palette{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;padding:8px 16px;background:var(--panel);border-bottom:1px solid var(--line);position:relative}.pal-group{display:flex;gap:4px}.pal-sep{width:1px;height:42px;background:var(--line)}.pal-note,.pal-mod{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;width:70px;height:62px;padding:2px 2px 4px;border:1px solid var(--line);border-radius:var(--radius);background:#fafbfd;cursor:grab;user-select:none;touch-action:none;font:inherit;color:var(--ink)}.pal-mod{width:64px;cursor:pointer}.pal-note:hover,.pal-mod:hover{border-color:#b8c3d8;background:#f2f5fb}.pal-note.active,.pal-mod.active{border-color:var(--accent);background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent)}.pal-note svg{width:34px;height:40px;overflow:visible;pointer-events:none}.pal-label,.mod-label{font-size:10.5px;color:var(--muted);line-height:1.2}.pal-note.active .pal-label,.pal-mod.active .mod-label{color:var(--accent);font-weight:600}.mod-glyph{font-family:Noto Music,Segoe UI Symbol,serif;font-size:26px;line-height:36px}.pal-note kbd{position:absolute}.status{flex:1;min-width:200px;color:var(--muted);font-size:13px;padding-left:6px}.status b{color:var(--ink)}.help{position:relative}.help summary{cursor:pointer;list-style:none;color:var(--accent);font-weight:600;font-size:13px;padding:6px 10px;border-radius:6px;border:1px solid var(--line)}.help summary::-webkit-details-marker{display:none}.help-body{position:absolute;right:0;top:36px;z-index:20;width:330px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 12px 30px #141e3c26;padding:10px 14px;font-size:13px}.help-body p{margin:6px 0}kbd{font-family:inherit;font-size:11px;border:1px solid #c9cfdb;border-bottom-width:2px;border-radius:4px;padding:0 5px;background:#f6f7fa}.score-wrap{overflow-y:auto;overflow-x:hidden;padding:16px}#score{display:block;background:var(--paper);border-radius:4px;box-shadow:0 1px 3px #00000014,0 8px 24px #1e28460f;user-select:none;touch-action:none;cursor:crosshair}#score .staff-line{stroke:#2b2f3a;stroke-width:1}#score .bar{stroke:#2b2f3a;stroke-width:1.2}#score .bar-thick{fill:#2b2f3a}#score .ledger,#score .stem{stroke:#1d2230;stroke-width:1.3}#score .fill,#score .head ellipse{fill:#1d2230}#score .head .hole{fill:var(--paper)}#score .head .hit{fill:transparent}#score .head{cursor:grab}#score .acc{stroke:#1d2230;fill:none;stroke-linecap:butt}#score .acc .thick{stroke-width:2.6}#score .acc .thin{stroke-width:1.2}#score .clef{font-family:Noto Music,Segoe UI Symbol,serif;fill:#1d2230}#score .ts{font-family:Georgia,Times New Roman,serif;font-weight:700;font-size:25px;fill:#1d2230;text-anchor:middle}#score .mnum{font-size:11px;fill:var(--muted);font-style:italic}#score .rest{fill:#1d2230}#score .rest-stroke{stroke:#1d2230;stroke-width:1.4;fill:none}#score .chord.playing.treble .fill,#score .chord.playing.treble .head ellipse:not(.hole),#score .chord.playing.treble .stem{fill:var(--right);stroke:var(--right)}#score .chord.playing.bass .fill,#score .chord.playing.bass .head ellipse:not(.hole),#score .chord.playing.bass .stem{fill:var(--left);stroke:var(--left)}#score .chord.playing .stem{fill:none}#score .head.selected ellipse:not(.hole){fill:var(--sel)}#score .head.dragging{opacity:.25}#score .ghost ellipse:not(.hole),#score .ghost .fill{fill:var(--accent)}#score .ghost .ledger,#score .ghost .stem,#score .ghost .acc{stroke:var(--accent)}#score .ghost{opacity:.6;pointer-events:none}#score .ghost.invalid ellipse:not(.hole){fill:#c53030}#score .ghost-label{font-size:11px;font-weight:600;fill:var(--accent);opacity:1}#score .ghost-slot{fill:var(--accent);opacity:.07}#score .playhead{stroke:#0f9d58;stroke-width:2.5;opacity:.85;pointer-events:none}#score .playhead-cap{fill:#0f9d58;pointer-events:none}.piano-wrap{background:#171b26;padding:6px 12px 12px}.piano-bar{display:flex;align-items:center;gap:18px;color:#c8cede;font-size:12.5px;padding:2px 4px 7px;flex-wrap:wrap}.piano-bar .end{margin-left:auto}.legend{display:flex;align-items:center;gap:6px}.sw{width:14px;height:14px;border-radius:3px;display:inline-block}.sw-r{background:var(--right)}.sw-l{background:var(--left)}.now{color:#fff;font-weight:600;min-height:1em}.piano{position:relative;height:clamp(80px,17vh,150px);user-select:none;touch-action:none}.key{position:absolute;top:0;border-radius:0 0 5px 5px;cursor:pointer;transition:background .06s}.key.white{height:100%;background:linear-gradient(#fbfbfb,#f1f1f1);border:1px solid #8e94a3;border-top:none;z-index:1}.key.black{height:62%;background:linear-gradient(#3a3d46,#121318);z-index:2;border:1px solid #000;border-top:none;box-shadow:0 2px 2px #0006}.key .lbl{position:absolute;bottom:5px;left:0;right:0;text-align:center;font-size:9.5px;color:#707684;pointer-events:none;line-height:1.1}.key.c .lbl{color:#1d2230;font-weight:700}.piano.no-names .key:not(.c) .lbl{display:none}.key.black .lbl{color:#cfd3dc;bottom:4px;font-size:8px}.key.white.hint{background:linear-gradient(#f3f6ff,#c9d8fb)}.key.black.hint{background:linear-gradient(#56617d,#2c3a62)}.key.white.on-r{background:linear-gradient(#7aa3ff,var(--right))}.key.black.on-r{background:linear-gradient(#5b8cff,#1a45b8)}.key.white.on-l{background:linear-gradient(#ffb47a,var(--left))}.key.black.on-l{background:linear-gradient(#ff9a4d,#b04c05)}.key.white.on-r.on-l{background:linear-gradient(var(--right),var(--left))}.key.on-r .lbl,.key.on-l .lbl{color:#fff;font-weight:700}.key.white.press{background:linear-gradient(#e6e6e6,#cfcfcf)}.key.black.press{background:#000}.drag-avatar{position:fixed;left:0;top:0;pointer-events:none;z-index:50;display:none;width:44px;height:54px;border-radius:8px;background:#ffffffeb;box-shadow:0 6px 18px #0003;align-items:center;justify-content:center}.drag-avatar svg{width:34px;height:40px;overflow:visible}.drag-avatar.show{display:flex}.toast{position:fixed;left:50%;bottom:200px;transform:translate(-50%) translateY(10px);background:#1d2230;color:#fff;padding:9px 16px;border-radius:8px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:60}.toast.show{opacity:1;transform:translate(-50%) translateY(0)}@media(max-width:760px){.topbar{padding:8px 10px;gap:8px 10px}.group.end{margin-left:0}.pal-note,.pal-mod{width:54px;height:56px}.pal-label,.mod-label{font-size:9px}.piano{height:110px}.score-wrap{padding:8px}}#score .restg{cursor:grab}#score .restg .hit{fill:transparent}#score .restg.selected .rest{fill:var(--sel)}#score .restg.selected .rest-stroke{stroke:var(--sel)}#score .restg.dragging,#score .head.dragging{opacity:.25}#score .ghost-rest .rest{fill:var(--accent)}#score .ghost-rest .rest-stroke{stroke:var(--accent)}#score .hl-hover{fill:#2563eb;opacity:.1}#score .hl-sel{fill:var(--sel);opacity:.1}#score .marquee{fill:#2563eb14;stroke:var(--accent);stroke-dasharray:4 3;stroke-width:1;pointer-events:none}#score .seek{cursor:pointer}#score .seek-bg{fill:#eef1f6}#score .seek:hover .seek-bg{fill:#dcfce7}#score .seek-tick{stroke:#c3c9d5;stroke-width:1}#score .playhead-hit{stroke:transparent;stroke-width:16;pointer-events:stroke;cursor:ew-resize}#score .playhead-cap{pointer-events:all;cursor:ew-resize}#score.seeking,#score.seeking *{cursor:ew-resize!important}.key.white.sel-r{background:linear-gradient(#e3ebff,#a9c2fb)}.key.black.sel-r{background:linear-gradient(#4b6fc4,#253f86)}.key.white.sel-l{background:linear-gradient(#fed,#fbc79c)}.key.black.sel-l{background:linear-gradient(#c97b3d,#874310)}.key.sel-r .lbl,.key.sel-l .lbl{color:#1d2230;font-weight:700}.key.black.sel-r .lbl,.key.black.sel-l .lbl{color:#fff}body.colors-on #score .head.pc-0:not(.selected) ellipse:not(.hole){fill:var(--c0);stroke:#1d2230;stroke-width:.8}body.colors-on #score .head.pc-0:not(.selected) .hole{fill:color-mix(in srgb,var(--c0) 30%,var(--paper))}body.colors-on .key.white.pc-0:after{background:var(--c0)}body.colors-on #score .head.pc-1:not(.selected) ellipse:not(.hole){fill:var(--c1);stroke:#1d2230;stroke-width:.8}body.colors-on #score .head.pc-1:not(.selected) .hole{fill:color-mix(in srgb,var(--c1) 30%,var(--paper))}body.colors-on .key.white.pc-1:after{background:var(--c1)}body.colors-on #score .head.pc-2:not(.selected) ellipse:not(.hole){fill:var(--c2);stroke:#1d2230;stroke-width:.8}body.colors-on #score .head.pc-2:not(.selected) .hole{fill:color-mix(in srgb,var(--c2) 30%,var(--paper))}body.colors-on .key.white.pc-2:after{background:var(--c2)}body.colors-on #score .head.pc-3:not(.selected) ellipse:not(.hole){fill:var(--c3);stroke:#1d2230;stroke-width:.8}body.colors-on #score .head.pc-3:not(.selected) .hole{fill:color-mix(in srgb,var(--c3) 30%,var(--paper))}body.colors-on .key.white.pc-3:after{background:var(--c3)}body.colors-on #score .head.pc-4:not(.selected) ellipse:not(.hole){fill:var(--c4);stroke:#1d2230;stroke-width:.8}body.colors-on #score .head.pc-4:not(.selected) .hole{fill:color-mix(in srgb,var(--c4) 30%,var(--paper))}body.colors-on .key.white.pc-4:after{background:var(--c4)}body.colors-on #score .head.pc-5:not(.selected) ellipse:not(.hole){fill:var(--c5);stroke:#1d2230;stroke-width:.8}body.colors-on #score .head.pc-5:not(.selected) .hole{fill:color-mix(in srgb,var(--c5) 30%,var(--paper))}body.colors-on .key.white.pc-5:after{background:var(--c5)}body.colors-on #score .head.pc-6:not(.selected) ellipse:not(.hole){fill:var(--c6);stroke:#1d2230;stroke-width:.8}body.colors-on #score .head.pc-6:not(.selected) .hole{fill:color-mix(in srgb,var(--c6) 30%,var(--paper))}body.colors-on .key.white.pc-6:after{background:var(--c6)}body.colors-on #score .chord.playing.treble .head ellipse:not(.hole){stroke:var(--right);stroke-width:3}body.colors-on #score .chord.playing.bass .head ellipse:not(.hole){stroke:var(--left);stroke-width:3}body.colors-on .key.white:after{content:"";position:absolute;left:3px;right:3px;bottom:3px;height:17px;border-radius:4px;opacity:.9}body.colors-on .key.white .lbl{z-index:1;color:#1d2230;font-weight:700}body.colors-on .key.white.on-r:after,body.colors-on .key.white.on-l:after{opacity:1;box-shadow:0 0 0 2px #fff}.colors-body{width:290px}.colors-body .row{display:flex;align-items:center;gap:10px;margin:6px 0}.colors-body .row label{width:36px;font-weight:600}.colors-body input[type=color]{width:46px;height:28px;padding:0;border:1px solid var(--line);border-radius:6px;background:none;cursor:pointer}.colors-body .swatch-head{width:16px;height:12px;border-radius:50%;transform:rotate(-22deg);border:1px solid #1d2230}.colors-body .actions{display:flex;justify-content:space-between;align-items:center;margin-top:10px;gap:8px}.colors-body .small{font-size:12px;color:var(--muted)}.mini-btn{font:inherit;font-size:12.5px;padding:5px 10px;border-radius:6px;border:1px solid var(--line);background:#f6f7fa;cursor:pointer}.mini-btn:hover{background:#eef1f6}.help.colors summary{margin-right:4px}#score .nname{font:600 8.5px Inter,system-ui,sans-serif;fill:#4a5162;pointer-events:none}body.colors-on #score .nname.pc-0{fill:color-mix(in srgb,var(--c0) 65%,#1d2230)}body.colors-on #score .nname.pc-1{fill:color-mix(in srgb,var(--c1) 65%,#1d2230)}body.colors-on #score .nname.pc-2{fill:color-mix(in srgb,var(--c2) 65%,#1d2230)}body.colors-on #score .nname.pc-3{fill:color-mix(in srgb,var(--c3) 65%,#1d2230)}body.colors-on #score .nname.pc-4{fill:color-mix(in srgb,var(--c4) 65%,#1d2230)}body.colors-on #score .nname.pc-5{fill:color-mix(in srgb,var(--c5) 65%,#1d2230)}body.colors-on #score .nname.pc-6{fill:color-mix(in srgb,var(--c6) 65%,#1d2230)}.check.pal-check{font-size:13px;color:var(--ink);padding:6px 8px;border:1px solid var(--line);border-radius:6px;margin-right:4px;white-space:nowrap}.menu{position:relative}.menu>summary{list-style:none}.menu>summary::-webkit-details-marker{display:none}.menu-body{position:absolute;right:0;top:calc(100% + 6px);z-index:30;min-width:230px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 12px 30px #141e3c2e;padding:6px;display:flex;flex-direction:column}.menu-body button{font:inherit;font-size:13.5px;text-align:left;padding:8px 10px;border:0;border-radius:6px;background:none;color:var(--ink);cursor:pointer}.menu-body button:hover{background:#eef1f6}.menu-body small{display:block;color:var(--muted);font-size:11.5px}#score .chordsym{font:700 11.5px Inter,system-ui,sans-serif;fill:#6a3fb5;pointer-events:none;paint-order:stroke;stroke:var(--paper);stroke-width:3.5px;stroke-linejoin:round}#score .finger{font:700 10px Inter,system-ui,sans-serif;fill:#1d2230;pointer-events:none;paint-order:stroke;stroke:var(--paper);stroke-width:3px;stroke-linejoin:round}#score .loop-band{fill:#ffb02021;pointer-events:none}#score .loop-seek{fill:#f5a524;pointer-events:none}.piano-bar .legend input{margin:0;accent-color:#fff}.piano-bar .legend.off{opacity:.55;text-decoration:line-through}.piano-bar select{font:inherit;font-size:12.5px;padding:2px 4px;border-radius:5px;border:1px solid #4a5268;background:#2a3042;color:#fff}.piano-bar .mini{font:inherit;font-size:12.5px;padding:3px 9px;border-radius:5px;border:1px solid #4a5268;background:#2a3042;color:#fff;cursor:pointer}.piano-bar .mini:hover{background:#343b50}.piano-bar .mini.active{background:#f5a524;border-color:#f5a524;color:#1d2230;font-weight:600}.pal-fingers{display:flex;align-items:center;gap:3px;font-size:12px;color:var(--muted)}.pal-fingers button{font:700 12.5px Inter,system-ui,sans-serif;width:26px;height:28px;border-radius:6px;border:1px solid var(--line);background:#fff;color:var(--ink);cursor:pointer}.pal-fingers button:hover:not(:disabled){background:#eef1f6}.pal-fingers button:disabled{opacity:.4;cursor:default}#score .ghost .paste-bad ellipse:not(.hole),#score .ghost .paste-bad .fill{fill:#c53030}#score .ghost .paste-bad .stem,#score .ghost .paste-bad .ledger{stroke:#c53030}#score .paste-measure{fill:#2563eb1f;stroke:var(--accent);stroke-width:1.5;stroke-dasharray:5 4}#score.pasting,#score.pasting *{cursor:copy!important}.btn.active{background:var(--accent);border-color:var(--accent);color:#fff}.zoom{display:flex;align-items:center;gap:2px;font-size:12.5px;color:var(--muted);margin-right:4px}.zoom button{font:600 14px Inter,system-ui,sans-serif;width:26px;height:28px;border-radius:6px;border:1px solid var(--line);background:#fff;color:var(--ink);cursor:pointer}.zoom button:hover{background:#eef1f6}.zoom #zoomVal{min-width:44px;text-align:center;cursor:pointer;font-weight:600;color:var(--ink)}.about{border:0;border-radius:14px;padding:28px 32px 24px;max-width:min(440px,calc(100vw - 32px));background:var(--paper);color:var(--ink);text-align:center;box-shadow:0 20px 60px #0f142359}.about::backdrop{background:#1418248c;backdrop-filter:blur(2px)}.about-clef{font-family:Noto Music,Segoe UI Symbol,serif;font-size:52px;line-height:1.25;color:var(--accent)}.about h2{margin:10px 0 2px;font-size:24px}.about-sub{margin:0 0 18px;color:var(--muted);font-size:14px}.about-author{margin:0 0 14px;font-size:17px}.about-copy{margin:0 0 22px;color:var(--muted);font-size:12px;line-height:1.5}.about form{margin:0}.piano-wrap.collapsed{padding-bottom:4px}.piano-wrap.collapsed .piano{display:none}.help-dlg{border:0;border-radius:14px;padding:0;width:min(760px,calc(100vw - 32px));max-height:min(86vh,900px);background:var(--paper);color:var(--ink);box-shadow:0 20px 60px #0f142359}.help-dlg[open]{display:flex;flex-direction:column}.help-dlg::backdrop{background:#1418248c;backdrop-filter:blur(2px)}.help-head{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 8px}.help-head h2{margin:0;font-size:22px}.help-head form{margin:0}.help-close{font:inherit;font-size:18px;border:0;background:none;color:var(--muted);cursor:pointer;padding:4px 8px;border-radius:6px}.help-close:hover{background:var(--line);color:var(--ink)}.help-nav{display:flex;flex-wrap:wrap;gap:6px;padding:0 20px 12px;border-bottom:1px solid var(--line)}.help-nav a{font-size:13px;text-decoration:none;color:var(--accent);background:var(--accent-soft);padding:4px 10px;border-radius:999px}.help-nav a:hover{background:var(--accent);color:#fff}.help-content{overflow-y:auto;padding:4px 24px 20px;line-height:1.5;font-size:14px}.help-content h3{font-size:16px;margin:18px 0 6px}.help-content ul{margin:0;padding-left:20px}.help-content li{margin:4px 0}.help-content kbd{font:600 12px/1 Inter,system-ui,sans-serif;background:#fff;border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;padding:2px 5px}.help-content .hl-r{color:var(--right);font-weight:600}.help-content .hl-l{color:var(--left);font-weight:600}.help-keys{border-collapse:collapse;width:100%}.help-keys td{padding:5px 8px;border-bottom:1px solid var(--line);vertical-align:top}.help-keys td:first-child{white-space:nowrap;width:1%}
