html:has(body.app-shell){height:100%;overflow:hidden;overscroll-behavior:none}
body.app-shell{--muted:#596960;height:var(--app-height,100dvh);min-height:0;overflow:hidden;display:flex;flex-direction:column;margin:0;overscroll-behavior:none;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);box-sizing:border-box}
.app-shell [hidden]{display:none!important}
.app-shell .site-header{height:60px;min-height:60px;padding:0 max(16px,env(safe-area-inset-left));margin:0;border-bottom:1px solid var(--line);background:var(--paper);flex:none}
.app-shell .site-header nav{display:flex;margin-left:auto;margin-right:14px}
.app-shell .nav-current{display:block}.app-shell .nav-current:after{display:none}
.app-shell .site-header .version{display:none}
.app-shell .brand-symbol{width:34px;height:34px;border-radius:10px}
.app-shell .brand b{font-size:16px}.app-shell .brand small{font-size:8px}
.app-shell #help-open{min-width:44px;min-height:44px;justify-content:center}
.app-shell .app-actions{display:flex;flex:none;justify-content:center;gap:8px;padding:6px 16px;background:var(--paper);border-bottom:1px solid var(--line)}
.app-actions button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;min-width:80px;border:0;border-radius:8px;background:var(--green-light);color:var(--green);font:inherit;font-size:13px;cursor:pointer}
.app-actions svg,.drawer-header svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.app-shell .shell{width:100%;max-width:1160px;padding:0 20px;margin:0 auto;flex:1;min-height:0;display:flex;flex-direction:column}
.app-shell .page-heading,.app-shell .workflow,.app-shell .side-column,.app-shell .site-footer{display:none}
.app-shell .workspace,.app-shell .main-column{display:flex;flex:1;min-height:0;min-width:0;width:100%;margin:0;gap:0;flex-direction:column;align-items:stretch}
.app-shell .score-card{display:flex;flex:1;min-height:0;flex-direction:column;padding:0;border-radius:0;border:0;background:var(--paper);overflow:hidden}
.app-shell .score-heading{display:flex;flex-direction:row;padding:14px 20px 10px;flex:none;margin:0;gap:8px;align-items:flex-start;border-bottom:1px solid var(--line)}
.app-shell .score-heading>div{min-width:0}
.app-shell .score-heading h2{font-size:20px;line-height:1.4;margin:0}
.app-shell .score-heading p{font-size:12px;line-height:1.5;margin:4px 0 0;color:var(--muted)}
.app-shell #score-metadata{flex-shrink:0;font-size:11px;padding:5px 8px}
.app-shell .score-heading .tag{margin-top:0}
.app-shell .score-stage{position:relative;display:flex;flex:1;min-height:0;overflow:hidden}
.app-shell #staff{width:100%;flex:1;min-height:0;max-height:none!important;margin:0;padding:22px 18px 52px;overflow:auto!important;overscroll-behavior:contain;touch-action:pan-x pan-y pinch-zoom;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable;box-sizing:border-box;background:var(--paper)}
.app-shell #staff svg.lilypond-score{display:block;max-width:none;min-width:0;overflow:visible;color:var(--ink)}
.app-shell #staff .score-note{cursor:pointer;fill:currentColor;color:inherit}
.app-shell #staff .note-hit{fill:transparent;stroke:none;pointer-events:all}
.app-shell #staff .score-note.is-current{color:var(--green)}
.app-shell #staff .score-note.is-current .note-hit{fill:#176d5320;stroke:#176d53;stroke-width:.18}
.app-shell #staff .score-note.is-correct{color:var(--green)}
.app-shell #staff .score-note.is-warning,.app-shell #staff .score-note.is-missing{color:var(--danger)}
.app-shell #staff .score-note:focus-visible .note-hit{stroke:var(--green);stroke-width:.25}
.lily-note-name{font-family:system-ui,sans-serif;font-size:1.2px;fill:var(--muted);text-anchor:middle;pointer-events:none}
.score-loading{padding:24px 8px;color:var(--muted);font-size:14px;line-height:1.6}
.custom-score-notice{font-size:12px;color:var(--muted);margin:0 0 12px}
.library-description{font-size:14px;line-height:1.7;color:var(--muted);margin:0 0 14px}
.input-ribbon{display:flex;align-items:center;justify-content:center;gap:8px;min-height:24px;font-size:12px;color:var(--muted);margin-bottom:4px}
#mic-status[data-phase=on]{color:var(--green);font-weight:600}
#mic-status[data-phase=error]{color:var(--danger)}
.compact-meter{width:44px;height:4px;overflow:hidden;background:var(--line);border-radius:2px}
.compact-meter i{display:block;width:0;height:100%;background:var(--green)}
#compact-input{font-size:10px;min-width:42px;font-variant-numeric:tabular-nums}
.follow-score{position:absolute;bottom:8px;right:18px;min-height:44px;padding:6px 12px;border:1px solid var(--green-mid);border-radius:22px;color:var(--green);background:var(--paper);font:inherit;font-size:12px;box-shadow:0 2px 8px #23362f12}
.follow-score[aria-pressed=false]{background:var(--green);color:white}
.app-shell .score-foot{flex:none;min-height:44px;padding:0 18px;margin:0;gap:12px;border-top:1px solid var(--line);font-size:11px}
.app-shell .score-foot label,.app-shell #pitch-cue{min-height:44px;display:flex;align-items:center;font-size:12px;white-space:nowrap}
.app-shell .mobile-hint{display:none}.app-shell #range-text{margin-left:auto;white-space:nowrap}
.app-shell .transport-zone{margin:0;padding:0 18px 10px;border-top:1px solid var(--line);flex:none;background:var(--paper)}
.app-shell .live-ribbon{display:flex;gap:20px;align-items:center;justify-content:center;min-height:32px;color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums}
.live-ribbon b{color:var(--green);font-size:14px;margin-left:4px;min-width:20px;display:inline-block}
.app-shell .transport{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.app-shell .transport .button{height:48px;min-height:48px;padding:0 16px;font-size:14px;justify-content:center;flex:1;white-space:nowrap}
.app-shell .transport-time{display:inline;font-size:11px;margin-left:4px;white-space:nowrap;font-variant-numeric:tabular-nums}
.app-shell .beat-indicator{display:flex;gap:4px;margin-left:6px}.app-shell .beat-indicator span{width:5px;height:5px}
.app-shell .status-line{margin:6px 0 0;min-height:32px;align-items:center;font-size:11px;line-height:1.5;padding:0}
.app-shell #status-message{display:block;overflow:auto;max-height:34px;overscroll-behavior:contain}
.app-shell:not([data-state=idle]):not([data-state=finished]) #listen,.app-shell:not([data-state=idle]):not([data-state=finished]) #sing{display:none}
.app-shell .environment-note{font-size:11px;max-height:40px;overflow:auto;margin:0}
.app-shell dialog{color:var(--ink);border:1px solid var(--line);background:var(--paper);border-radius:20px 20px 0 0;max-width:760px;width:min(760px,100%);max-height:calc(var(--app-height,100dvh) - 24px);box-sizing:border-box;overscroll-behavior:contain}
.app-shell dialog::backdrop{background:#182c2460;backdrop-filter:blur(3px)}
.app-shell .app-drawer{padding:0;margin:auto auto 0;overflow:hidden}
.app-shell .app-drawer[open]{display:flex;flex-direction:column}
.drawer-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid var(--line);flex:none;background:var(--paper)}
.drawer-header h2{font-size:18px;margin:0}.drawer-close{width:44px;height:44px;border:0;border-radius:50%;background:var(--green-light);color:var(--green);display:grid;place-items:center;cursor:pointer}
.drawer-scroll{overflow:auto;overscroll-behavior:contain;min-height:0;padding:16px 18px max(20px,env(safe-area-inset-bottom));-webkit-overflow-scrolling:touch}
.drawer-scroll .card{padding:16px;margin-bottom:16px}.drawer-scroll .settings-card{padding:0;border:0}
.drawer-scroll .exercise-tabs{display:flex;flex-direction:column;gap:8px;margin:14px 0;padding:0;overflow:visible;max-height:none}
.drawer-scroll .exercise-tab{white-space:normal;text-align:left;min-height:48px;padding:10px 14px}
.drawer-scroll .bank-heading{align-items:flex-start;gap:12px;flex-wrap:wrap}.drawer-scroll .bank-heading>div{font-size:11px}
.drawer-scroll .source-details{margin:18px 0}.drawer-scroll .source-details summary{min-height:44px}
.drawer-scroll .local-badge{margin-top:20px}.drawer-scroll .practice-tip{display:none}
.drawer-stop{border:0;border-top:1px solid var(--line);background:#fff1ed;color:var(--danger);min-height:52px;font:inherit;font-size:14px;flex:none}
.app-shell #help-dialog{margin:auto auto 0;padding:24px;overflow:auto;font-size:14px;line-height:1.7}
.app-shell #help-close{min-width:44px;min-height:44px}.app-shell #help-dialog .dialog-top{position:sticky;top:-24px;background:var(--paper);padding:8px 0}
.app-shell select,.app-shell input[type=number]{min-height:44px}.app-shell input[type=range]{min-height:36px}
.app-shell button:focus-visible,.app-shell #staff:focus-visible{outline:2px solid var(--green);outline-offset:-2px}
@media(min-width:760px){.app-shell .app-actions button{max-width:240px}.app-shell .shell{padding:16px 24px}.app-shell .score-card{border:1px solid var(--line);border-radius:14px}.app-shell .transport{max-width:660px;margin:auto}.app-shell .status-line{justify-content:center}.app-shell dialog{border-radius:20px;margin:auto;max-height:calc(var(--app-height,100dvh) - 48px)}.app-shell .app-drawer,.app-shell #help-dialog{margin:auto}.app-shell .score-heading h2{font-size:22px}}
@media(max-width:759px){.app-shell .shell{padding:0}.app-shell .site-header{height:54px;min-height:54px}.app-shell .site-header .nav-current{font-size:12px}.app-shell .app-actions{padding:4px 12px;gap:8px}.app-shell .app-actions button{flex:1;min-height:40px}.app-shell .score-heading{padding:10px 16px 8px}.app-shell .score-heading h2{font-size:17px}.app-shell .score-heading p{display:none}.app-shell #score-metadata{padding:4px;font-size:10px}.app-shell #staff{padding:20px 14px 44px}.app-shell .score-foot{padding:0 12px;gap:8px}.app-shell .transport-zone{padding:0 12px 8px}.app-shell .beat-indicator{display:none}.app-shell .transport .button{font-size:13px;padding:0 10px}.app-shell .transport .button svg{width:18px;height:18px}.app-shell .transport-time{font-size:10px}.app-shell .live-ribbon{gap:14px;font-size:11px}.drawer-scroll{padding:14px 14px max(18px,env(safe-area-inset-bottom))}.app-shell .graph-legend{font-size:10px}.app-shell .metrics{grid-template-columns:1fr 1fr}}
@media(max-width:359px){.app-shell #range-text{display:none}.app-shell #pitch-cue{margin-left:auto}.app-shell .transport-time{width:62px;white-space:normal;text-align:right}.app-shell .brand small{display:none}.app-shell .site-header nav{margin-right:4px}.app-shell .score-heading{padding:8px 12px}.app-shell .live-ribbon{min-height:28px}.app-shell .status-line{margin-top:4px}}
@media(max-height:500px) and (orientation:landscape){.app-shell .site-header{height:44px;min-height:44px}.app-shell .site-header nav{display:none}.app-shell .app-actions{padding:2px 12px}.app-shell .app-actions button{min-height:38px;min-width:70px;background:transparent}.app-shell .shell{padding:0}.app-shell .score-heading{padding:5px 14px}.app-shell .score-heading h2{font-size:16px}.app-shell .score-heading p,.app-shell .live-ribbon,.app-shell .score-foot{display:none}.app-shell .transport-zone{padding:4px 16px}.app-shell .transport .button{height:40px;min-height:40px}.app-shell .status-line{min-height:18px;margin:2px 0 0}.app-shell #status-message{max-height:18px}.app-shell #staff{padding-top:14px}.app-shell .score-card{border:0;border-radius:0}}
@media(prefers-reduced-motion:reduce){.app-shell *{scroll-behavior:auto!important;transition:none!important}}
.app-shell .brand{min-height:44px}
.app-shell .app-actions button{min-height:44px}
.app-shell .status-line{font-size:12px;min-height:36px}
.app-shell #status-message{max-height:36px}
.app-shell button:not(:disabled):active{filter:brightness(.91)}
.app-shell #help-dialog.app-help{padding:0;overflow:hidden}
.app-shell #help-dialog.app-help[open]{display:flex;flex-direction:column}
.app-shell #help-dialog.app-help .dialog-top{position:static;flex:none;padding:10px 16px;margin:0;border-bottom:1px solid var(--line);gap:8px}
.app-shell #help-dialog .help-scroll{overflow:auto;overscroll-behavior:contain;padding:16px 24px max(24px,env(safe-area-inset-bottom));min-height:0}
.app-shell #help-dialog .drawer-stop{min-height:44px;white-space:nowrap;padding:0 12px;border:0;border-radius:8px}
@media(max-height:500px) and (orientation:landscape){
  .app-shell .live-ribbon{display:flex;min-height:26px}
  .app-shell .score-foot{display:flex;min-height:44px}
  .app-shell .status-line{min-height:18px}
  .app-shell #status-message{max-height:18px}
  .app-shell .transport .button{min-height:44px;height:44px}
}
.live-curve-panel{flex:none;height:154px;box-sizing:border-box;border-top:1px solid var(--line);padding:6px 16px 4px;display:flex;flex-direction:column;background:var(--paper)}
.curve-heading,.curve-foot{display:flex;align-items:center;gap:8px;flex:none;font-size:10px;line-height:20px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.curve-heading b{color:var(--ink);font-size:11px}.curve-heading #curve-status{color:var(--green);font-weight:600}.curve-heading #curve-register{margin-left:auto}
.curve-plot{position:relative;flex:1;min-height:0}.curve-plot canvas{display:block;width:100%;height:100%}
#curve-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:11px;pointer-events:none;background:#fafcf4a8}
.curve-foot{justify-content:space-between;gap:4px}.app-shell .live-ribbon{min-height:26px}
.app-shell .note-result-tag.pending{background:#eef0f3;color:#58616d}
#preparation-overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:8px 14px;box-sizing:border-box;pointer-events:none;background:color-mix(in srgb,var(--paper) 94%,transparent);background:#fffffff2;color:var(--green);text-align:center}
#preparation-value{font-size:clamp(56px,15vw,112px);font-weight:800;line-height:1;letter-spacing:-.035em;font-variant-numeric:tabular-nums}
#preparation-detail{max-width:100%;font-size:13px;line-height:1.5;color:var(--ink);text-wrap:balance}
#preparation-overlay::after{content:'';position:absolute;bottom:0;left:0;right:0;height:3px;background:var(--green);transform:scaleX(var(--cue-progress,0));transform-origin:left}
#preparation-overlay[data-phase=calibrating] #preparation-value,#preparation-overlay[data-phase=waiting] #preparation-value{font-size:clamp(36px,10vw,64px)}
#preparation-overlay[data-phase=count],#preparation-overlay[data-phase=go]{background:none;border:0;box-shadow:none;backdrop-filter:none}
#preparation-overlay[data-phase=count]::after,#preparation-overlay[data-phase=go]::after{content:none;display:none}
#preparation-overlay[data-phase=count] #preparation-detail,#preparation-overlay[data-phase=go] #preparation-detail{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.cue-volume-setting{margin:14px 0;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--green-light)}
.cue-volume-heading{display:flex;justify-content:space-between;gap:12px;font-size:13px;font-weight:600}
.cue-volume-setting input{width:100%}.cue-volume-setting .small-note{margin:2px 0 0}
@media(max-height:500px) and (orientation:landscape){#preparation-overlay{gap:2px;padding:2px 12px}#preparation-value{font-size:44px}#preparation-detail{font-size:11px;line-height:1.35}#preparation-overlay[data-phase=calibrating] #preparation-value,#preparation-overlay[data-phase=waiting] #preparation-value{font-size:32px}}
@media(max-width:359px),(max-height:700px){.live-curve-panel{height:118px;padding:3px 10px}.curve-heading,.curve-foot{font-size:9px;gap:4px;line-height:18px}.curve-heading b{font-size:10px}}
@media(max-height:500px) and (orientation:landscape){
  .live-curve-panel{height:104px;padding:2px 16px}.curve-heading,.curve-foot{line-height:17px}
  .app-shell .score-card{position:relative}
  .app-shell .score-heading{min-height:44px;box-sizing:border-box;padding:0 285px 0 14px;align-items:center}
  .app-shell .score-heading h2{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .app-shell .score-heading #score-metadata,.app-shell .score-foot #range-text{display:none}
  .app-shell .score-foot{position:absolute;top:0;right:6px;z-index:1;border:0;padding:0 8px;gap:16px}
  .app-shell .transport-zone{display:grid;grid-template-columns:minmax(220px,1fr) minmax(250px,1fr);grid-template-rows:24px 24px auto;column-gap:16px;padding:2px 16px}
  .app-shell .live-ribbon{grid-column:1;grid-row:1;min-height:0;justify-content:flex-start}
  .app-shell .input-ribbon{grid-column:1;grid-row:2;min-height:0;margin:0;justify-content:flex-start}
  .app-shell .transport{grid-column:2;grid-row:1 / 3;width:100%}
  .app-shell .status-line{grid-column:1 / 3;grid-row:3;margin:0;justify-content:flex-start}
  .app-shell #staff{padding:8px 14px 44px}
}
@media(max-height:350px) and (orientation:landscape){
  .live-curve-panel{height:78px}
  .app-shell .transport-zone{grid-template-rows:22px 22px auto}
  .app-shell .score-stage{container-type:size}
  .app-shell #staff{padding-top:0}
  .app-shell #staff svg.lilypond-score{max-width:400px;max-width:min(400px,360cqh);margin:auto}
}

#score-size-controls{padding:12px 0;border-bottom:1px solid var(--line,#ddd)}
#score-size-controls h3{font-size:16px;margin:0 0 8px}
.score-size-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.score-size-row button{min-width:44px;min-height:44px;padding:8px 12px;font:inherit}
.score-size-row output{min-width:48px;text-align:center;font-variant-numeric:tabular-nums}
#score-size-controls p{font-size:13px;line-height:1.5;margin:8px 0 0}
