:root,[data-theme=light]{--bg-chrome: #f5f1e6;--bg-stage: #fcf9f0;--bg-lane-alt: #f5f0e2;--bg-pill: #eae4d3;--bg-pill-active: #1f1d1a;--text-pill-active: #fcf9f0;--bg-surface: #fffdf7;--border-subtle: #e0d9c6;--grid-measure: #d8d1be;--grid-beat: rgba(138, 130, 112, .16);--text-primary: #1f1d1a;--text-muted: #6e685c;--piano-felt: #8c1d24;--piano-felt-lip: #2a1215;--key-white: #fffefa;--key-white-border: #d7d0be;--key-white-lip: #ddd6c5;--key-black: #1e1e22;--key-black-lip: #3a3a42;--lh-nat: #d47436;--lh-sharp: #b3581f;--lh-tint: rgba(212, 116, 54, .24);--rh-nat: #568eca;--rh-sharp: #3568a2;--rh-tint: rgba(86, 142, 202, .24);--pedal-bar: #6b8e5a;--pedal-bar-bg: rgba(107, 142, 90, .14);--pedal-active: #3d7a37;--ok: #2e8540;--warn: #c77d19;--err: #d94141;--shadow-modal: 0 18px 44px rgba(31, 29, 26, .22)}[data-theme=dark]{--bg-chrome: #111318;--bg-stage: #0b0d11;--bg-lane-alt: #12151c;--bg-pill: #1b202b;--bg-pill-active: #f3f4f6;--text-pill-active: #0b0d11;--bg-surface: #151922;--border-subtle: #252b38;--grid-measure: #262c3a;--grid-beat: rgba(255, 255, 255, .06);--text-primary: #f3f4f6;--text-muted: #9ca3af;--piano-felt: #7f1d22;--piano-felt-lip: #050608;--key-white: #f4f2ec;--key-white-border: #383c47;--key-white-lip: #c8c3b8;--key-black: #16181d;--key-black-lip: #323640;--lh-nat: #e07d3e;--lh-sharp: #ba5d22;--lh-tint: rgba(224, 125, 62, .28);--rh-nat: #5f9be0;--rh-sharp: #3b74b8;--rh-tint: rgba(95, 155, 224, .28);--pedal-bar: #79b36b;--pedal-bar-bg: rgba(121, 179, 107, .14);--pedal-active: #57c46b;--ok: #42b866;--warn: #e69d35;--err: #ef5350;--shadow-modal: 0 18px 48px rgba(0, 0, 0, .55)}*,*:before,*:after{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body,#root{margin:0;padding:0;width:100%;height:100dvh;overflow:hidden;background:var(--bg-chrome);color:var(--text-primary);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:13px;user-select:none;-webkit-user-select:none}button{font:inherit;color:inherit;background:transparent;border:none;cursor:pointer;padding:0}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--rh-nat);outline-offset:1px}.app-shell{display:flex;flex-direction:column;width:100%;height:100dvh;padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px);padding-bottom:env(safe-area-inset-bottom,0px);background:var(--bg-chrome)}.topbar{height:44px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 10px;border-bottom:1px solid var(--border-subtle);background:var(--bg-chrome)}.topbar-left,.topbar-center,.topbar-right{display:flex;align-items:center;gap:6px;min-width:0}.topbar-left{flex:0 1 auto}.topbar-center{flex:0 0 auto}.topbar-right{flex:0 1 auto;justify-content:flex-end}.ble-label{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.song-title-btn{display:flex;align-items:center;gap:6px;padding:5px 9px;border-radius:8px;background:var(--bg-pill);font-weight:600;max-width:240px;overflow:hidden}.song-title-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.segmented{display:inline-flex;align-items:center;padding:2px;border-radius:8px;background:var(--bg-pill);gap:2px}.segmented button{padding:4px 9px;border-radius:6px;font-size:12px;font-weight:600;color:var(--text-muted);white-space:nowrap;transition:background .12s ease,color .12s ease}.segmented button.active{background:var(--bg-pill-active);color:var(--text-pill-active)}.pill-btn{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 9px;border-radius:8px;background:var(--bg-pill);font-size:12px;font-weight:600;white-space:nowrap}.pill-btn.active{background:var(--bg-pill-active);color:var(--text-pill-active)}.pill-btn.connected{background:#2e854029;color:var(--ok);border:1px solid rgba(46,133,64,.32)}.pill-btn.connecting{background:#c77d1929;color:var(--warn)}.status-dot{width:7px;height:7px;border-radius:999px;background:var(--text-muted);flex-shrink:0}.status-dot.connected{background:var(--ok)}.status-dot.connecting{background:var(--warn)}.status-dot.lh{background:var(--lh-nat)}.status-dot.rh{background:var(--rh-nat)}.status-dot.hollow{background:transparent;border:1.5px solid currentColor}.hand-toggle{display:inline-flex;align-items:center;gap:4px}.hand-toggle.muted{color:var(--text-muted);opacity:.85}.hand-toggle.hidden{color:var(--text-muted);opacity:.5;text-decoration:line-through}.acc-pill{font-variant-numeric:tabular-nums;padding:0 8px;height:28px;display:inline-flex;align-items:center;border-radius:8px;background:var(--bg-pill);font-weight:700;font-size:12px}.stage-wrap{position:relative;flex:1 1 auto;min-height:0;display:flex;flex-direction:column;background:var(--bg-stage);overflow:hidden}.roll-canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}.roll-canvas:active{cursor:grabbing}.zoom-pill{position:absolute;top:8px;right:10px;z-index:14;display:inline-flex;align-items:center;gap:3px;padding:3px 6px;border-radius:999px;background:var(--bg-surface);border:1px solid var(--border-subtle);box-shadow:0 3px 10px #00000024;font-size:11px;font-weight:700}.zoom-pill button{width:22px;height:22px;border-radius:6px;background:var(--bg-pill);font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center}.portrait-banner{position:absolute;top:6px;left:50%;transform:translate(-50%);z-index:20;display:none;align-items:center;gap:8px;height:30px;padding:0 12px;border-radius:999px;background:var(--bg-pill-active);color:var(--text-pill-active);font-size:12px;font-weight:600;box-shadow:0 4px 12px #00000040}@media(orientation:portrait){.portrait-banner.visible{display:flex}}.feedback-toast{position:absolute;top:10px;left:50%;transform:translate(-50%);z-index:15;padding:4px 12px;border-radius:999px;font-weight:700;font-size:12px;letter-spacing:.02em;pointer-events:none;background:var(--bg-surface);border:1px solid var(--border-subtle);box-shadow:0 4px 12px #00000024}.feedback-toast.perfect{color:var(--ok)}.feedback-toast.good{color:var(--rh-nat)}.feedback-toast.early,.feedback-toast.late{color:var(--warn)}.feedback-toast.wrong{color:var(--err)}.wait-indicator{position:absolute;bottom:8px;right:12px;z-index:12;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:700;background:var(--bg-surface);border:1px solid var(--border-subtle);color:var(--text-muted);pointer-events:none}.ble-error-banner{position:absolute;top:8px;right:10px;z-index:18;max-width:340px;padding:6px 10px;border-radius:8px;background:var(--bg-surface);border:1px solid var(--err);color:var(--err);font-size:12px;display:flex;align-items:center;gap:8px}.sheet-stage{position:relative;width:100%;height:100%;overflow:hidden;display:flex;align-items:center;background:#fffdf7;color:#1f1d1a}.sheet-strip{position:relative;display:flex;align-items:center;height:100%;will-change:transform;padding-left:36px}.sheet-measure-slot{position:relative;flex:0 0 auto;height:min(248px,100%)}.sheet-cursor{position:absolute;top:12px;bottom:12px;width:18px;margin-left:-9px;border-radius:6px;background:#568eca38;border:1.5px solid rgba(86,142,202,.72);pointer-events:none;z-index:5}.sheet-loading{margin:auto;color:#6e685c;font-weight:600}.piano-dock-wrap{position:relative;flex-shrink:0;height:clamp(76px,23dvh,146px);display:flex;flex-direction:column;background:var(--piano-felt-lip);touch-action:none}.piano-felt{height:5px;flex-shrink:0;background:linear-gradient(180deg,var(--piano-felt-lip) 0%,var(--piano-felt) 65%,#5c1015 100%)}.piano-keys-row{position:relative;flex:1 1 auto;display:flex;width:100%;background:#1a1a1d}.pedal-dock-cell{flex:0 0 34px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:6px 3px;background:var(--bg-chrome);border-right:1px solid var(--border-subtle)}.pedal-badge{writing-mode:vertical-rl;transform:rotate(180deg);font-size:10px;font-weight:700;letter-spacing:.08em;color:var(--text-muted)}.pedal-lamp{width:18px;height:18px;border-radius:5px;border:1.5px solid var(--border-subtle);background:var(--bg-pill);transition:background 80ms ease,border-color 80ms ease}.pedal-lamp.song-down{border-color:var(--pedal-bar);background:var(--pedal-bar-bg)}.pedal-lamp.user-down{background:var(--pedal-active);border-color:var(--pedal-active);box-shadow:0 0 8px #57c46b8c}.piano-keys-area{position:relative;flex:1 1 auto;height:100%;overflow:hidden}.key-white{position:absolute;top:0;bottom:0;background:var(--key-white);border-right:1px solid var(--key-white-border);border-bottom:4px solid var(--key-white-lip);border-radius:0 0 4px 4px;display:flex;align-items:flex-end;justify-content:center;padding-bottom:4px;font-size:9px;font-weight:700;color:var(--text-muted);overflow:hidden;white-space:nowrap}.key-white.expected-L{background:color-mix(in srgb,var(--key-white) 74%,var(--lh-nat));border-bottom-color:var(--lh-nat)}.key-white.expected-R{background:color-mix(in srgb,var(--key-white) 74%,var(--rh-nat));border-bottom-color:var(--rh-nat)}.key-white.pressed-L{background:var(--lh-nat);border-bottom-width:1px;color:#fff}.key-white.pressed-R,.key-white.pressed-free{background:var(--rh-nat);border-bottom-width:1px;color:#fff}.key-white.wrong{background:var(--err);border-bottom-width:1px;color:#fff}.key-black{position:absolute;top:0;height:62%;background:linear-gradient(180deg,#2b2d34 0%,var(--key-black) 85%);border-bottom:4px solid var(--key-black-lip);border-radius:0 0 4px 4px;z-index:3}.key-black.expected-L{background:var(--lh-sharp);border-bottom-color:var(--lh-nat)}.key-black.expected-R{background:var(--rh-sharp);border-bottom-color:var(--rh-nat)}.key-black.pressed-L{background:var(--lh-nat);border-bottom-width:1px}.key-black.pressed-R,.key-black.pressed-free{background:var(--rh-nat);border-bottom-width:1px}.key-black.wrong{background:var(--err);border-bottom-width:1px}.transport{height:40px;flex-shrink:0;display:flex;align-items:center;gap:8px;padding:0 10px;border-top:1px solid var(--border-subtle);background:var(--bg-chrome)}.play-btn{width:30px;height:30px;border-radius:999px;background:var(--bg-pill-active);color:var(--text-pill-active);display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex-shrink:0}.scrubber-wrap{flex:1 1 auto;min-width:80px;display:flex;align-items:center;gap:8px}.scrubber-track{position:relative;flex:1 1 auto;height:30px;display:flex;align-items:center;cursor:pointer;touch-action:none}.scrubber-rail{position:relative;width:100%;height:5px;border-radius:999px;background:var(--bg-pill);overflow:hidden}.scrubber-loop{position:absolute;top:0;bottom:0;background:#d4743659}.scrubber-fill{position:absolute;top:0;bottom:0;left:0;background:var(--rh-nat)}.scrubber-thumb{position:absolute;top:50%;width:12px;height:12px;border-radius:999px;background:var(--bg-pill-active);transform:translate(-50%,-50%);pointer-events:none}.time-readout{font-variant-numeric:tabular-nums;font-size:11px;color:var(--text-muted);white-space:nowrap}.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#00000073;display:flex}.drawer{width:min(440px,88vw);height:100%;background:var(--bg-surface);border-right:1px solid var(--border-subtle);display:flex;flex-direction:column;box-shadow:var(--shadow-modal)}.drawer-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border-bottom:1px solid var(--border-subtle)}.drawer-header h2{margin:0;font-size:16px}.upload-zone{margin:10px 14px 6px;padding:10px 12px;border-radius:10px;border:1.5px dashed var(--border-subtle);background:var(--bg-stage);display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.upload-zone.drag-over{border-color:var(--rh-nat);background:var(--rh-tint)}.library-controls{display:flex;align-items:center;gap:6px;padding:6px 14px 4px}.library-search-wrap{position:relative;flex:1 1 auto;min-width:0;display:flex;align-items:center}.library-search{width:100%;height:32px;padding:0 26px 0 10px;border-radius:8px;border:1px solid var(--border-subtle);background:var(--bg-stage);color:var(--text-primary);font:inherit;font-size:12px}.library-search-clear{position:absolute;right:4px;width:22px;height:22px;border-radius:6px;font-size:11px;color:var(--text-muted)}.library-diff-select{height:32px;padding:0 8px;border-radius:8px;border:1px solid var(--border-subtle);background:var(--bg-stage);color:var(--text-primary);font:inherit;font-size:12px;font-weight:600;flex-shrink:0}.filter-row{display:flex;gap:6px;padding:4px 14px 8px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.filter-row::-webkit-scrollbar{display:none}.song-group-heading{font-size:11px;font-weight:700;color:var(--text-muted);padding:8px 10px 3px;display:flex;justify-content:space-between}.song-list{flex:1 1 auto;overflow-y:auto;padding:4px 10px 14px}.song-row{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border-radius:10px;text-align:left;border:1px solid transparent}.song-row:hover{background:var(--bg-pill)}.song-row.active{background:var(--bg-pill);border-color:var(--rh-nat)}.song-row-meta{min-width:0}.song-row-title{font-weight:700;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.song-row-sub{font-size:11px;color:var(--text-muted);margin-top:2px}.song-row-right{display:flex;align-items:center;gap:8px;flex-shrink:0}.badge-diff{font-size:10px;padding:2px 6px;border-radius:999px;background:var(--bg-pill);color:var(--text-muted);font-weight:600}.modal-center{margin:auto;width:min(490px,92vw);max-height:88dvh;overflow-y:auto;background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:14px;padding:18px;box-shadow:var(--shadow-modal)}.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}.stat-card{padding:8px 10px;border-radius:10px;background:var(--bg-stage);border:1px solid var(--border-subtle);text-align:center}.stat-value{font-size:20px;font-weight:800;font-variant-numeric:tabular-nums}.stat-label{font-size:11px;color:var(--text-muted)}.chart-box{margin-top:10px;padding:10px;border-radius:10px;background:var(--bg-stage);border:1px solid var(--border-subtle)}.chart-title{font-size:11px;font-weight:700;color:var(--text-muted);margin-bottom:6px;display:flex;justify-content:space-between}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px;flex-wrap:wrap}.btn-primary{padding:7px 14px;border-radius:8px;background:var(--bg-pill-active);color:var(--text-pill-active);font-weight:700;font-size:12px}.btn-secondary{padding:7px 12px;border-radius:8px;background:var(--bg-pill);font-weight:600;font-size:12px}.hand-popover{position:fixed;top:46px;left:10px;z-index:35;width:min(310px,90vw);max-height:calc(100dvh - 58px);overflow-y:auto;padding:12px;border-radius:12px;background:var(--bg-surface);border:1px solid var(--border-subtle);box-shadow:var(--shadow-modal);display:flex;flex-direction:column;gap:10px}.simple-badge{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:999px;font-size:11px;font-weight:700;background:#2e854024;color:var(--ok)}.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}.level-btn{display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 3px 5px;border-radius:8px;background:var(--bg-pill);border:1px solid transparent;font-size:11px;font-weight:700}.level-btn.active{background:var(--bg-pill-active);color:var(--text-pill-active)}.level-btn.redundant:not(.active){opacity:.62}.level-bar-track{width:82%;height:4px;border-radius:999px;background:#80808040;overflow:hidden}.level-bar-fill{height:100%;border-radius:999px;background:var(--rh-nat)}.level-btn.active .level-bar-fill{background:var(--lh-nat)}.level-pct{font-size:9px;font-weight:600;opacity:.8;font-variant-numeric:tabular-nums}.adv-details{border-top:1px solid var(--border-subtle);padding-top:8px}.adv-details>summary{cursor:pointer;font-size:11px;font-weight:700;color:var(--text-muted);list-style:none;display:flex;align-items:center;justify-content:space-between}.adv-details>summary::-webkit-details-marker{display:none}.adv-body{display:flex;flex-direction:column;gap:8px;margin-top:8px}@media(max-height:450px){.topbar{height:40px;padding:0 6px;gap:4px}.transport{height:38px;padding:0 6px;gap:5px}.piano-dock-wrap{height:clamp(68px,27dvh,112px)}.pill-btn{height:28px;padding:0 7px;font-size:11px}.segmented button{padding:4px 7px;font-size:11px}.song-title-btn{max-width:132px;padding:4px 7px;font-size:12px}.ble-label{max-width:72px}}
