:root{font-family:Arial,Helvetica,sans-serif;color:#28332c;background:#e9e7e0;font-synthesis:none;--green:#d5ed99;--muted:#687168;--line:#c9cec3}
*{box-sizing:border-box}
body{margin:0}
[hidden]{display:none!important}
button,a,input,summary{-webkit-tap-highlight-color:transparent}
button,input,summary{accent-color:#486b45}
button{font:inherit;cursor:pointer}
button:focus-visible,summary:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #597d3e;outline-offset:4px}
button:disabled{cursor:default}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
main{max-width:1440px;margin:auto;padding:30px 32px 24px}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px;flex-wrap:wrap}
.view-controls{display:flex;align-items:center;gap:24px;flex-wrap:wrap}
.view-switch{display:flex;padding:3px;background:#dcded4;border-radius:6px;gap:2px}
.view-switch button{border:0;background:transparent;color:var(--muted);padding:8px 13px;font-size:11px;border-radius:4px}
.view-switch button[aria-pressed=true]{background:#f6f5ee;color:#28332c;box-shadow:0 1px 3px #25332214}
.label-controls{display:flex;gap:16px;font-size:11px;color:var(--muted)}
.label-controls label{display:flex;align-items:center;gap:6px;cursor:pointer;white-space:nowrap}
.label-controls input{width:13px;height:13px;margin:0;cursor:pointer}
.tools{display:flex;gap:6px}
.tools button{border:1px solid var(--line);background:transparent;border-radius:4px;padding:9px 12px;font-size:11px;white-space:nowrap}
.tools #enable{background:#283d30;color:#f2f2e8;border-color:#283d30}
.tools #enable:disabled{opacity:.5;cursor:wait}
.tools #enable.enabled{background:var(--green);color:#283d30;border-color:#b8ce8c}
.bank-viewport{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#abb39f transparent;padding:4px 0 12px}
.bank{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer}
.singer{border:0;padding:0;position:relative;aspect-ratio:9/16;min-width:0;overflow:hidden;background:#adb0a4;color:#fff;touch-action:none;border-radius:0}
.portrait{position:absolute;inset:0;display:block;overflow:hidden;pointer-events:none}
.singer img,.singer canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 30%;pointer-events:none}
.singer canvas{opacity:0}
.singer.animating canvas{opacity:1}
.singer::after{content:'';position:absolute;inset:0;background:linear-gradient(transparent 62%,#15271bd4);pointer-events:none}
.singer.unavailable img{filter:saturate(.25);opacity:.48}
.singer.unavailable{cursor:default}
.cell-footer{position:absolute;z-index:2;bottom:15px;left:13px;right:13px;display:flex;align-items:end;justify-content:space-between;gap:8px;pointer-events:none}
.note{font:20px Georgia,serif;letter-spacing:-.6px}
.key{font:10px Arial,sans-serif;border:1px solid #ffffff55;border-radius:3px;padding:3px 5px;color:#fffc;margin-left:auto}
.soon{font-size:11px;color:#fff9;margin-left:auto}
.energy{position:absolute;z-index:3;bottom:0;left:0;height:4px;width:100%;background:var(--green);transform:scaleX(var(--level,0));transform-origin:left;transition:transform 40ms linear;pointer-events:none}
.singer.active{outline:2px solid var(--green);outline-offset:-2px}
.singer.active .note{color:var(--green)}
.hide-notes .note,.hide-keys .key{display:none}
/* All keys share the same height. A 96:284 window is exactly the middle
   60% of each 160:284 portrait; no extra resampling or assets are needed. */
.bank.piano{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:3px;width:100%;min-width:840px;background:#c9cdc1;isolation:isolate}
.piano .singer{position:relative;order:var(--piano-order);width:100%;aspect-ratio:24/71;align-self:start;border-radius:2px 2px 4px 4px;background:#f4f1e5}
.piano .portrait{inset:0}
.piano .singer img,.piano .singer canvas{width:166.666667%;left:-33.333333%;height:100%;object-fit:fill;object-position:center}
.piano .singer::before{content:'';position:absolute;z-index:3;left:0;right:0;top:0;height:7px;background:#f4f1e5;pointer-events:none}
.piano .black-key::before{background:#26372c}
.piano .black-key{background:#26372c}
.piano .singer.active{outline:2px solid var(--green);outline-offset:-2px}
.piano .singer.active::before{background:var(--green)}
.piano .cell-footer{bottom:14px;left:8px;right:8px;gap:4px;flex-wrap:wrap}
.piano .note{font-size:17px}
.piano .key{font-size:9px;padding:2px 4px}
.piano .unavailable .portrait{opacity:.65}
.piano-scroll{display:flex;align-items:center;gap:12px;padding:2px 4px 10px;color:var(--muted);font-size:12px}
.piano-scroll input{width:100%;height:16px;cursor:ew-resize}
footer{display:flex;justify-content:space-between;gap:20px;font-size:10px;color:var(--muted);padding:16px 0 20px;border-bottom:1px solid var(--line);line-height:1.6}
.live-status{display:flex;align-items:center;gap:8px;font-size:11px}
.live-status>span:first-child{width:6px;height:6px;background:#8a9485;border-radius:50%;flex-shrink:0}
body.sounding #status-light{background:#63932d;box-shadow:0 0 0 4px #63932d16}
.settings{font-size:11px;color:var(--muted);padding-top:17px}
.settings summary{cursor:pointer;width:max-content}
.setting-grid{display:flex;gap:30px;flex-wrap:wrap;padding:20px 0 7px}
.setting-grid label{display:flex;align-items:center;gap:10px}
.setting-grid input{width:110px}
.setting-grid output{min-width:48px}
.settings p{font-size:10px;line-height:1.6}
#error{background:#f5d8ce;padding:15px;font-size:12px}
.take-editor{font-size:12px;color:#435343;padding:19px 0;border-bottom:1px solid var(--line)}
.take-editor summary{cursor:pointer;width:max-content;color:#283d30}
.take-editor button,.take-editor select,.take-editor input[type=number],.take-editor textarea{font:inherit;color:inherit;background:#f5f5ed;border:1px solid #bfc8b7;border-radius:4px;padding:8px}
.take-editor button:hover{background:#dce9ce}
.editor-top{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:20px 0}
.editor-top>label{display:flex;gap:10px;align-items:center}.editor-top>button{margin-left:auto}#take-count{font-size:11px;color:var(--muted)}
.editor-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:28px;align-items:start}
.take-preview video{display:block;width:100%;background:#18251c;aspect-ratio:480/854;object-fit:contain;border-radius:5px}
.take-preview p{font-size:10px;line-height:1.6;overflow-wrap:anywhere;color:var(--muted)}
#take-description{margin:0 0 15px;line-height:1.6;max-width:720px}
#take-waveform{width:100%;height:90px;display:block;border:1px solid var(--line);border-radius:4px;cursor:crosshair}
.playhead-row{display:flex;align-items:center;gap:9px;margin:10px 0 18px}.playhead-row input{flex:1;min-width:50px}.playhead-row output{min-width:115px;text-align:right;font-size:11px;font-variant-numeric:tabular-nums}.playhead-row button{white-space:nowrap;font-size:11px}
.point-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.point-field label{display:flex;flex-direction:column;gap:7px}.point-field input{width:100%;font-variant-numeric:tabular-nums}.point-field button{margin-top:6px;width:100%;font-size:10px}
.preview-actions,.point-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:15px 0}.preview-actions label{display:flex;align-items:center;gap:6px;margin-right:auto}.point-actions{font-size:11px}.point-actions span{margin-left:auto;color:var(--muted)}
.take-notes{display:flex;flex-direction:column;gap:8px}.take-notes textarea{width:100%;resize:vertical;line-height:1.5}.editor-help{font-size:10px;color:var(--muted);line-height:1.7}
@media(max-width:900px){.editor-layout{grid-template-columns:170px minmax(0,1fr);gap:18px}.point-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.editor-layout{grid-template-columns:1fr}.take-preview video{width:min(220px,100%);margin:auto}.editor-top>label{width:100%;flex-direction:column;align-items:stretch}.editor-top>button{margin-left:0}.playhead-row{flex-wrap:wrap}.playhead-row output{min-width:90px}.point-actions span{width:100%;margin:0}.preview-actions label{width:100%;margin:0}}
@media(min-width:1250px){main{max-width:1320px}.bank:not(.piano){gap:5px}}
@media(max-width:760px){main{padding:20px 16px}.toolbar{gap:14px;margin-bottom:18px}.view-controls{gap:14px}.label-controls{gap:12px}.bank:not(.piano){grid-template-columns:repeat(3,minmax(0,1fr))}footer{flex-direction:column;gap:6px}.cell-footer{left:9px;right:9px;bottom:12px}.note{font-size:18px}}
@media(prefers-reduced-motion:reduce){.energy{transition:none}}

.copy-settings{margin:20px 0;padding:14px;border:1px solid var(--line);border-radius:5px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.copy-settings legend{padding:0 7px}.copy-settings label{display:flex;align-items:center;gap:6px;font-size:12px}.copy-settings p{width:100%;margin:0;font-size:11px;color:var(--muted)}#instrument-target{font-size:12px;color:var(--muted)}

.take-preview{position:sticky;top:16px;align-self:start}.take-preview canvas{display:block;width:100%;aspect-ratio:480/854;background:#18251c;border-radius:5px}.take-preview [hidden]{display:none!important}.preview-switch{display:flex;gap:6px;margin-bottom:10px}.preview-switch button{flex:1;padding:7px 4px}.preview-switch button[aria-pressed=true]{background:#d5ed99}.take-preview .preview-actions{gap:6px;margin:10px 0}.waveform-tools{display:flex;align-items:center;gap:12px;margin:0 0 8px;flex-wrap:wrap}.waveform-tools label,.waveform-pan{display:flex;gap:8px;align-items:center}.waveform-tools input{width:125px}.waveform-tools output{font-size:11px;font-variant-numeric:tabular-nums}.waveform-tools>output{margin-left:auto}.waveform-pan{font-size:11px;margin:8px 0}.waveform-pan input{flex:1;min-width:60px}#take-waveform{height:135px;touch-action:manipulation}.take-instrument{padding:14px 0 0;border-top:1px solid var(--line)}.take-instrument h3{font-size:12px;margin:0 0 8px}.take-instrument .setting-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.take-instrument .setting-grid label{display:grid;grid-template-columns:1fr auto;gap:7px}.take-instrument .setting-grid input{grid-column:1 / -1;grid-row:2;width:100%;margin:0}.take-instrument .setting-grid output{font-size:11px}.copy-settings{margin-bottom:0}@media(max-width:600px){.take-preview{position:static}.take-preview canvas{width:min(220px,100%);margin:auto}.take-preview .preview-switch,.take-preview .preview-actions{max-width:260px;margin-left:auto;margin-right:auto}.take-instrument .setting-grid{gap:10px}}

.waveform-wrap{position:relative}.waveform-wrap #playhead-time{position:absolute;top:5px;right:7px;padding:3px 5px;background:#f5f5eddd;font-size:11px;font-variant-numeric:tabular-nums;pointer-events:none}#take-waveform{touch-action:none}.waveform-tools{flex-wrap:nowrap;gap:7px;font-size:10px}.waveform-tools label{gap:5px;white-space:nowrap}.waveform-tools input[type=range]{width:72px}.waveform-tools button{font-size:9px;padding:4px 5px}.waveform-tools>output{white-space:nowrap;font-size:9px}.waveform-tools .compact{margin:0;gap:5px;flex-wrap:nowrap}.compact input[type=checkbox]{margin:0;width:11px;height:11px}.point-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px 12px;margin-top:12px}.point-field{display:flex;align-items:center;gap:5px}.point-field label{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:space-between;gap:5px;white-space:nowrap;font-size:10px}.point-field input{width:88px;padding:5px;font-size:11px}.point-field button{margin:0;width:auto;padding:5px 7px;font-size:10px}.take-instrument{border:0;padding-top:0}.take-controls .settings{border-top:0}.point-actions{margin:10px 0;font-size:10px}.point-actions button{padding:5px;font-size:9px}@media(max-width:600px){.waveform-tools{flex-wrap:wrap}.waveform-tools .compact label{width:auto}.waveform-tools>output{margin-left:auto}.point-grid{grid-template-columns:1fr}.point-field input{flex:1;max-width:150px}.point-field label{font-size:11px}}
.point-grid{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:9px}.point-field{padding:7px;background:#f5f6ee;border:1px solid #c2cbb9;border-top:3px solid var(--point-color);border-radius:5px;gap:5px}.point-field label{color:var(--point-color);min-width:0;gap:5px}.point-field input{width:78px;min-width:0;color:#283d30;background:#fffef8}.point-field button{border-color:var(--point-color);padding:5px 6px}.point-field[data-point=mouthOpen]{background:#edf5f7}@media(max-width:600px){.point-grid{grid-template-columns:1fr}}
.preview-frame{position:relative;isolation:isolate}.take-preview #ghost-preview{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;object-fit:contain;background:transparent;opacity:.4;pointer-events:none;z-index:1}.ghost-controls{display:grid;gap:8px;margin:10px 0}.ghost-controls label{display:flex;align-items:center;gap:8px;font-size:11px}.ghost-controls select{flex:1;min-width:0;padding:5px}.ghost-controls input{flex:1;width:60px;min-width:0}.ghost-controls output{font-size:10px;font-variant-numeric:tabular-nums}.ghost-controls #ghost-status{color:var(--muted);min-height:12px}@media(max-width:600px){.preview-frame{width:min(220px,100%);margin:auto}.ghost-controls{max-width:260px;margin:10px auto}}

/* A single uninterrupted portrait strip, independent of the editor layout. */
.performance-toggle{position:fixed;right:16px;bottom:14px;z-index:20;border:0;background:transparent;color:#687168;font-size:11px;padding:8px 10px;opacity:.65}
.performance-toggle:hover,.performance-toggle:focus-visible{opacity:1}
body.performance{background:#000;overflow:hidden;--stage-area-top:env(safe-area-inset-top);--stage-area-bottom:calc(46px + max(16px,env(safe-area-inset-bottom)));--stage-accessories:68px;--stage-available:calc(100svh - var(--stage-area-top) - var(--stage-area-bottom));--mobile-face-height:min(420px,calc(var(--stage-available) - var(--stage-accessories)));--mobile-stage-top:calc(var(--stage-area-top) + (var(--stage-available) - var(--mobile-face-height)) / 2)}
.performance main{position:relative;max-width:none;width:100%;height:100svh;min-height:0;margin:0;padding:0;display:block}
.performance .toolbar,.performance footer,.performance .take-editor,.performance .piano-scroll,.performance #error{display:none!important}
.performance .bank-viewport{position:absolute;top:var(--mobile-stage-top);height:var(--mobile-face-height);width:100%;padding:0;overflow:hidden}
.performance .bank,.performance .bank.piano{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:0;width:100%;min-width:0;background:#000}
.performance .singer,.performance .piano .singer{order:var(--piano-order);width:100%;height:var(--mobile-face-height);aspect-ratio:auto;border:0;border-radius:0;outline:none;background:#000}
.performance .singer img,.performance .singer canvas{width:100%;left:0;height:100%;object-fit:cover;object-position:center}
.performance .singer::before,.performance .singer::after,.performance .cell-footer,.performance .energy{display:none!important}
.performance .performance-toggle{color:#777}

.group-pitch{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin:0 0 20px;font-size:11px;color:var(--muted)}.group-pitch label{display:flex;align-items:center;gap:7px}.group-pitch input{width:115px}.group-pitch output{min-width:52px;font-variant-numeric:tabular-nums}.group-pitch button{border:1px solid var(--line);background:transparent;color:inherit;border-radius:4px;padding:6px 9px;font-size:10px}.performance .group-pitch{display:none}

.group-pitch select{font:inherit;color:inherit;background:transparent;border:1px solid var(--line);border-radius:4px;padding:5px}

.performance-controls{position:fixed;z-index:20;bottom:14px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:16px;white-space:nowrap}
.performance-controls button{border:0;border-radius:2px;background:#111;color:#595959;font-size:11px;padding:9px 10px;min-height:36px}
@media(hover:hover){.performance-controls button:hover{background:#151515}}
.performance-piano .singer{box-shadow:inset -1px 0 #000}
@media(max-width:500px){.performance-controls{gap:5px;left:10px;transform:none}.performance-controls button{padding:9px 7px}.performance .performance-toggle{right:7px}}

.performance-controls{gap:7px;flex-wrap:wrap;justify-content:center;width:max-content;max-width:calc(100% - 90px)}
.performance-dialog{color:#aaa;background:#0c0c0c;border:1px solid #333;border-radius:10px;padding:22px;width:min(380px,calc(100vw - 32px));font:12px Arial,sans-serif;box-shadow:0 12px 60px #0009}
.performance-dialog::backdrop{background:#000b}
.performance-dialog header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
.performance-dialog h2{font-size:14px;font-weight:400;color:#ddd;margin:0}
.performance-dialog button,.performance-dialog select{font:inherit;color:#ccc;border:1px solid #343434;background:#191919;border-radius:4px;padding:9px}
.performance-dialog header button{border:0;background:none;color:#888;font-size:20px;padding:0 4px}
.performance-dialog label{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:15px 0}
.performance-dialog select{max-width:75%;min-width:150px}
.performance-dialog p{font-size:11px;line-height:1.6;color:#888}
.performance-dialog button:focus-visible,.performance-dialog select:focus-visible{outline:1px solid #bbb;outline-offset:3px}

.performance-midi{position:fixed;top:max(14px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right));z-index:20;border:0;border-radius:2px;background:transparent;color:#4f4f4f;font-size:11px;padding:9px 10px;min-height:36px}
.performance-midi:hover,.performance-midi:focus-visible{color:#777;background:#080808}
.performance-title{display:none}
.performance .performance-title{display:block;position:fixed;top:max(14px,env(safe-area-inset-top));left:max(20px,env(safe-area-inset-left));z-index:20;padding:10px 0;color:#777;font-size:12px;font-weight:400;line-height:16px;text-decoration:none;transition:color 150ms ease}
.performance-title span{color:#505050;font-size:11px;margin-left:5px;transition:color 150ms ease}
.performance-title:hover,.performance-title:focus-visible{color:#aaa}
.performance-title:hover span,.performance-title:focus-visible span{color:#777}
.performance .performance-toggle{color:#666}
button{-webkit-user-select:none;user-select:none}
button:focus,button:focus-visible{outline:none;box-shadow:none}
.performance button,.performance button:focus,.performance button:focus-visible{outline:none;box-shadow:none}

.release #error{display:block!important;position:fixed;bottom:55px;left:50%;transform:translateX(-50%);z-index:20;max-width:90vw;background:#181010;color:#b89999;border-radius:3px}
.release #error[hidden]{display:none!important}

.piano-guide{position:absolute;bottom:calc(100% + 9px);left:50%;transform:translateX(-50%);width:180px;height:42px;overflow:visible;pointer-events:none;background:#000}
.piano-guide-lines{fill:none;stroke:#454545;stroke-width:1;stroke-linejoin:round}
.piano-guide-black{fill:#000;stroke:#454545;stroke-width:1;stroke-linejoin:round}
.piano-guide-labels{fill:#777;font:11px Arial,Helvetica,sans-serif;text-anchor:middle}

.piano-guide svg{display:block;width:100%;height:100%}

/* Selection owns the appearance; focus and touch hover never change its label. */
.performance .performance-controls button[aria-pressed=true]{color:#929292;background:#050505;box-shadow:inset 0 1px 3px #000;transform:translateY(1px)}
.performance .performance-controls button:active{background:#050505;transform:translateY(1px)}

.demo-voice-control{display:flex;align-items:center;gap:6px;font-size:10px;color:#555}
.demo-voice-control select{font:inherit;color:#888;background:#080808;border:0;border-radius:2px;padding:8px 5px;max-width:155px;outline:none}
.demo-voice-control select:focus-visible{outline:none}
/* The demo keeps its cast together at a constant size and color. The cap is
   70% of each portrait's proportional width at the shared displayed height. */
.performance-superman .bank,.performance-superman .bank.piano{max-width:calc(var(--mobile-face-height) * var(--demo-aspect-total));margin-inline:auto}
.performance-superman .singer.demo-unused{pointer-events:none}




.demo-cast{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));max-width:calc(var(--mobile-face-height) * var(--demo-aspect-total));width:100%;margin:0 auto;padding-top:9px;gap:0}
.demo-cast label{display:flex;flex-direction:column;gap:4px;min-width:0;padding:0 4px;color:#454545;font-size:9px}
.demo-cast select{width:100%;min-width:0;padding:7px 3px;border:0;border-radius:2px;background:#080808;color:#777;font:10px Arial,sans-serif;text-overflow:ellipsis;outline:none}
.demo-cast select:focus-visible{outline:none;background:#111;color:#aaa}
.performance-controls{flex-direction:row;align-items:center;gap:12px;flex-wrap:nowrap;max-width:calc(100% - 24px);bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%)}
.performance-controls button{color:#858585;min-height:38px;padding:10px 15px;transition:background 140ms ease,color 140ms ease}
.performance-mode-group{display:flex;gap:0;padding:3px;background:#0d0d0d;border-radius:5px}
.performance-controls .performance-mode-group button{border-radius:0;background:transparent;min-height:40px;font-size:12px;padding:11px 17px}
.performance-controls .performance-mode-group button:first-child{border-radius:3px 0 0 3px}
.performance-controls .performance-mode-group button:last-child{border-radius:0 3px 3px 0}
.performance .performance-mode-group button[aria-pressed=true]{background:#262626;color:#d0d0d0;box-shadow:inset 0 1px 2px #0008;transform:none}
.performance .performance-mode-group button:active{transform:none}
.performance-context{display:grid;min-height:38px;min-width:180px;align-items:center;justify-items:center}
.performance-context>div{grid-area:1/1}
.performance-chords{display:flex;align-items:center;gap:10px}
.performance-chords .demo-voice-control{display:flex;align-items:center;gap:10px;color:#858585;font-size:11px}
.performance-chords .demo-voice-control select{font-size:11px;color:#999;padding:8px;background:#111}
.performance-chords,.performance-chords .demo-voice-control,.performance-transport{opacity:1;visibility:visible;transition:opacity 200ms ease,visibility 0s}
.performance-chords.unavailable,.performance-chords .unavailable,.performance-transport.unavailable{opacity:0;visibility:hidden;pointer-events:none;transition:opacity 200ms ease,visibility 0s 200ms}
.performance .performance-controls .performance-transport button{min-width:100px;min-height:40px;height:40px;box-sizing:border-box;padding:8px 16px;border:1px solid #555;border-radius:4px;background:#303030;color:#eee;font-size:12px;font-weight:500;box-shadow:none;transform:none}
.performance .performance-controls .performance-transport button[aria-pressed=true]{background:#1c1c1c;border-color:#3c3c3c;color:#bbb}
.performance .performance-controls .performance-transport button:active{background:#454545}
.performance .performance-controls .performance-transport button:focus-visible{outline:1px solid #999;outline-offset:2px}
#performance-play{display:inline-flex;align-items:center;justify-content:center}
#performance-play-icon{display:inline-flex;align-items:center;justify-content:center;width:12px;height:12px;margin-right:4px;flex-shrink:0}
#performance-play-icon::before{content:'';width:0;height:0;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:6px solid currentColor}
#performance-play[aria-pressed=true] #performance-play-icon::before{width:7px;height:7px;border:0;background:currentColor}
.piano-guide{bottom:calc(100% + 16px)}
@media(max-width:500px){.performance-controls .performance-mode-group button{padding:11px 14px}.performance-chords{gap:10px}}

.performance-context{min-height:38px;align-items:center;margin-left:8px;padding-left:20px;border-left:1px solid #262626}
.performance-transport{display:flex;flex-direction:column;align-items:center}
.performance-controls #superman-about{position:absolute;bottom:calc(100% + 12px);left:50%;transform:translateX(-50%);min-height:24px;padding:4px 8px;color:#707070;font-size:10px;background:transparent}
.performance-controls #superman-about:hover{color:#aaa}
.performance-controls #superman-about:focus-visible{outline:1px solid #555;outline-offset:1px}
.superman-about-dialog{box-sizing:border-box;width:min(380px,calc(100vw - 32px))}
.superman-about-dialog p{font-size:12px;line-height:1.7;color:#a0a0a0}
.superman-about-dialog p:last-child{margin-bottom:0;color:#808080}

/* Only mode blending is eased; the live amplitude remains immediate. */
@property --piano-mix{syntax:'<number>';inherits:true;initial-value:0}
@property --demo-mix{syntax:'<number>';inherits:true;initial-value:0}
.performance{--piano-mix:0;--demo-mix:0;transition:--piano-mix 450ms ease,--demo-mix 650ms ease}
.performance.performance-piano{--piano-mix:1}
.performance.performance-superman{--demo-mix:1}
.performance .singer .portrait{--a:var(--amplitude,0);--color:calc(.22 + .78 * var(--a));--light:calc(.5 + .5 * var(--a));filter:saturate(calc(var(--color) + (1 - var(--color)) * var(--demo-mix))) brightness(calc(var(--light) + (1 - var(--light)) * var(--demo-mix)))}

@media(prefers-reduced-motion:reduce){.performance{transition:none}}

.performance .bank,.performance .bank.piano{max-width:100%;margin-inline:auto;transition:max-width 450ms linear}
.performance.performance-superman .bank,.performance.performance-superman .bank.piano{max-width:calc(var(--mobile-face-height) * var(--demo-aspect-total))}
@media(prefers-reduced-motion:reduce){.performance .bank,.performance .singer .portrait{transition:none}}

/* A small vertical stagger makes the piano rows legible without changing height. */
.performance .singer{translate:0 0;transition:translate 450ms ease}
.performance .bank-viewport{overflow:visible}
@media(prefers-reduced-motion:reduce){.performance .singer{transition:none}}

.demo-cast{opacity:0;transition:opacity 250ms ease}
.performance-superman.cast-ready .demo-cast{opacity:1}
@media(prefers-reduced-motion:reduce){.demo-cast{transition:none}}

.performance-swell .singer img,.performance-swell .singer canvas,.performance-superman .singer img,.performance-superman .singer canvas{transform:scale(calc(1 + var(--amplitude,0) * (.05 + .06 * var(--arc,0))));transform-origin:50% 45%;transition:transform 80ms linear}

/* Outgoing faces retain Swell's resting treatment as their tracks collapse. */
.performance-superman .singer.demo-unused .portrait{filter:saturate(.22) brightness(.5)}

/* The strip unfolds below the portraits without changing their layout height. */
.performance-key{display:none}
.performance .singer{overflow:visible}
.performance .singer .portrait{z-index:1}
.performance .performance-key{display:flex;position:absolute;top:100%;left:1px;right:1px;height:44px;align-items:center;justify-content:center;box-sizing:border-box;background:#a6a6a0;color:#353535;border-radius:0 0 2px 2px;font:10px Arial,sans-serif;transform:translateY(-100%);visibility:hidden;pointer-events:none;transition:transform 300ms ease,visibility 0s 300ms;filter:brightness(calc(.85 + .4 * var(--amplitude,0)))}
.performance .black-key .performance-key{background:#272727;color:#aaa;filter:brightness(calc(1 + 1.2 * var(--amplitude,0)))}
.performance.performance-piano:not(.performance-superman) .performance-key{transform:translateY(6px);visibility:visible;pointer-events:auto;transition:transform 300ms ease,visibility 0s}
@media(prefers-reduced-motion:reduce){.performance .performance-key{transition:none}}
@media(hover:none) and (pointer:coarse){.performance .performance-key{font-size:0}}
.performance-superman .singer img,.performance-superman .singer canvas{transform:scale(calc(1 + var(--amplitude,0) * (.10 + .12 * var(--arc,0))))}

/* A replacement inherits its part’s position rather than moving neighboring parts. */
.performance.performance-superman .singer,.performance.performance-superman .piano .singer{order:var(--demo-order)}

.landscape-message{display:none}
/* Short windows share top controls and a reserved accessory row below the stage. */
@media(height < 750px){
  body.performance{--stage-area-top:calc(46px + env(safe-area-inset-top));--stage-area-bottom:env(safe-area-inset-bottom)}
  .performance .performance-title{top:calc(8px + env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));padding:4px 0;font-size:11px;line-height:14px}
  .performance-title span{display:block;margin:0;font-size:9px;line-height:13px}
  .performance .performance-controls{top:calc(6px + env(safe-area-inset-top));bottom:auto;left:calc(132px + env(safe-area-inset-left));right:max(52px,env(safe-area-inset-right));width:auto;max-width:none;transform:none;flex-direction:row;gap:12px;justify-content:center;align-items:center}
  .performance-controls .performance-mode-group button{min-height:34px;padding:8px 10px;font-size:11px}
  .performance-context{min-width:128px;min-height:34px;align-items:center;margin-left:8px;padding-left:20px;border-left:1px solid #262626}
  .performance .performance-controls .performance-transport button{min-height:34px;height:34px}
  .performance-controls .performance-chords{gap:7px}
  .performance-controls .performance-chords button,.performance-chords .demo-voice-control select{font-size:10px}
  .performance .performance-midi{top:calc(8px + env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));padding:8px 4px;min-height:32px;font-size:10px}
  .performance main{position:relative;display:block;height:100svh;min-height:0}
  .performance .bank-viewport{position:absolute;top:var(--mobile-stage-top);height:var(--mobile-face-height);box-sizing:border-box;padding-inline:env(safe-area-inset-left) env(safe-area-inset-right)}
  .performance .singer,.performance .piano .singer{height:var(--mobile-face-height)}
  .performance.performance-superman .bank,.performance.performance-superman .bank.piano,.performance .demo-cast{max-width:calc(var(--mobile-face-height) * var(--demo-aspect-total))}
  .performance .demo-cast{padding-top:6px}
  .performance .demo-cast select{height:28px;padding:5px 3px}
  .performance-controls #superman-about{position:fixed;top:calc(var(--mobile-stage-top) + var(--mobile-face-height) + 36px);bottom:auto;left:50%;min-height:24px;padding:4px 8px;font-size:9px}
}
@media(orientation:portrait) and (max-width:600px), (orientation:portrait) and (max-width:1024px) and (hover:none) and (pointer:coarse){
  .performance .landscape-message{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:30px;background:#000;color:#777;text-align:center;font:12px Arial,sans-serif}
  .landscape-message span{font-size:32px;font-weight:300;color:#505050}
  .landscape-message p{margin:0}
  .performance main,.performance .performance-controls,.performance .performance-midi,.performance .performance-toggle{display:none!important}
}

/* Own the menu colors instead of inheriting the operating system accent. */
.chord-menu{position:relative;font-size:11px;color:#999}
.chord-menu summary{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:75px;padding:8px;background:#111;border-radius:2px;cursor:pointer;list-style:none;user-select:none}
.chord-menu summary::-webkit-details-marker{display:none}
.chord-menu summary::after{content:'';width:5px;height:5px;border-right:1px solid #777;border-bottom:1px solid #777;transform:rotate(45deg) translateY(-2px)}
.chord-menu fieldset{position:absolute;z-index:30;bottom:calc(100% + 5px);right:0;min-width:110px;margin:0;padding:4px;border:1px solid #303030;border-radius:4px;background:#141414;box-shadow:0 4px 16px #0008}
.chord-menu label{display:flex;align-items:center;gap:9px;padding:8px;cursor:pointer;border-radius:2px}
.chord-menu label:hover,.chord-menu label:has(input:checked){background:#303030;color:#ddd}
.chord-menu input{appearance:none;-webkit-appearance:none;width:6px;height:6px;margin:0;border:0;border-radius:50%;background:transparent}
.chord-menu input:checked{background:#aaa}
.chord-menu summary:focus-visible,.chord-menu label:has(input:focus-visible){outline:1px solid #888;outline-offset:2px}
.chord-menu input:focus-visible{outline:none}
@media(height < 750px){.chord-menu{font-size:10px}.chord-menu fieldset{top:calc(100% + 5px);bottom:auto}}

/* A shallow engraved edge for the keyboard legends. */
.performance .performance-key{color:#45453f;text-shadow:0 1px 0 #ffffff55,0 -1px 0 #00000030}
.performance .black-key .performance-key{color:#999;text-shadow:0 -1px 1px #000,0 1px 0 #ffffff16}

.performance .performance-about{right:calc(max(16px,env(safe-area-inset-right)) + 52px)}
.about-dialog{width:min(620px,calc(100vw - 32px));max-height:calc(100svh - 32px);padding:24px;overflow-y:auto;overscroll-behavior:contain}
.about-dialog header{position:sticky;top:-24px;background:#0c0c0c;padding:12px 0;margin-top:-12px}
.about-dialog h2{font-size:17px}
.about-dialog p{font-size:14px;line-height:1.75;color:#aaa;margin:0 0 18px}
.about-dialog p:last-child{margin-bottom:0}
.about-dialog strong{color:#ddd}
@media(height < 750px){
  .performance .performance-about{right:calc(max(8px,env(safe-area-inset-right)) + 40px)}
  .performance .performance-controls{right:max(100px,env(safe-area-inset-right))}
  .about-dialog p{font-size:13px}
}
