/* Size to the available CSS viewport, including OS scaling and browser zoom. */
:root{--practice-font-size:clamp(16px, .85vw, 18px);--sidebar-width:clamp(184px,12vw,224px)}
html,body{height:100%;min-height:100%;overflow:hidden}
.sidebar{display:flex;width:var(--sidebar-width);height:100dvh;box-sizing:border-box;padding:16px 12px}
main{box-sizing:border-box;margin-left:var(--sidebar-width);width:calc(100% - var(--sidebar-width));height:100dvh;min-height:0;padding:12px 14px;gap:8px;overflow:hidden}
main>header{display:flex;justify-content:center;flex:none;min-height:44px}
.top-media-controls{position:static;transform:none;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;margin:0;max-width:100%}
.top-media-controls>:is(button,select),.top-media-controls #recent-files{box-sizing:border-box;display:block;flex:none;width:auto;min-width:116px;height:44px;max-width:100%;padding:8px 14px;margin:0;align-self:auto;border:1px solid #7d9bc3;border-radius:5px;background:#35445a;color:#edf5ff;font:600 var(--practice-font-size) 'Segoe UI',sans-serif;white-space:nowrap}
.top-media-controls #recent-files{width:150px;text-overflow:ellipsis}
.top-media-controls #upload-side{background:#285487}
main>header .header-actions:empty{display:none}
.track-heading{flex:none;min-height:0}.track-heading h2{overflow-wrap:anywhere;font-size:clamp(18px,1.1vw,22px)}
.transport{position:static;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;flex:none;gap:8px;padding:8px;min-width:0}
.transport>*{margin:0!important;flex:none}
.transport .pitch-settings{flex-wrap:wrap;height:auto;min-height:50px}
.transport .volume-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:center}
.volume-tools .volume{display:flex;align-items:center;gap:8px;height:50px;padding:6px 8px;box-sizing:border-box;border:1px solid #73839a;border-radius:5px;background:#343a46}
.volume-tools .volume>label{color:#ffdb64}
.volume-tools .volume input{width:clamp(76px,7vw,140px)}
.volume-tools #show-video{height:50px;padding:6px 12px;border:1px solid #73839a;border-radius:5px}
.transport>.zoom input{width:clamp(80px,7vw,130px)}
.timeline-card,.media-workspace{flex:1 1 0;min-height:220px;overflow:hidden}
.timeline-body{flex:1 1 0;min-height:0}.timeline-content,.track-labels{height:100%;min-height:0}
.time-ruler .inner-beat{color:#8e99aa;font-weight:400;opacity:.65}
.time-ruler .bar-start{color:#edf2f8;font-weight:600}
dialog{box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}
@media(max-width:1400px){main{padding:10px;gap:6px}.transport{gap:6px}.transport .pitch-control{gap:4px}.transport .pitch-control input{width:44px}.transport .pitch-settings{padding:6px}.transport>.zoom output{min-width:42px}.top-media-controls{gap:6px}}
@media(max-height:850px){main{padding-top:8px;padding-bottom:8px;gap:5px}.top-media-controls>:is(button,select),.top-media-controls #recent-files{height:40px}.track-heading p{margin:2px 0}.card-heading,.timeline-foot{padding:6px 10px}}
@media(max-width:1100px){:root{--sidebar-width:180px}.sidebar .brand{font-size:25px}.sidebar .parts,.sidebar .side-bottom{display:flex}.sidebar .side-bottom{flex-direction:column}.sidebar .divider{display:block}.transport .pitch-settings{max-width:100%}.transport .speed>span{display:block}.transport .volume{display:flex}}
@media(max-width:760px){:root{--sidebar-width:152px}.sidebar{padding:10px 8px}.sidebar .brand{font-size:21px}.sidebar .brand-icon{font-size:26px}.sidebar .keys{font-size:14px}.sidebar .keys span{flex-wrap:wrap}.top-media-controls>:is(button,select),.top-media-controls #recent-files{min-width:94px;padding:6px 9px}.track-heading h2{font-size:18px}.transport .pitch-control{flex-wrap:wrap}.timeline-foot{font-size:16px}.timeline-foot #snap-help{white-space:normal}}
/* Very small windows scroll vertically rather than clip controls or shrink text. */
@media(max-height:600px),(max-width:520px){html,body{height:auto;overflow:auto}main{height:auto;min-height:100dvh;overflow:visible}.timeline-card,.media-workspace{flex:none;min-height:380px;height:55dvh}.sidebar .side-bottom .keys{display:none}}
.sidebar .parts{display:block;overflow-x:hidden}.sidebar .part-item{width:100%;box-sizing:border-box}.sidebar .part-main{flex:1;min-width:0}
/* Keep video visibility separate from the centered tool groups. */
main>header{position:relative;padding-right:144px;padding-left:144px;box-sizing:border-box}
.top-video-control{position:absolute;right:0;top:0;margin-left:24px}
.top-video-control #show-video{height:44px;padding:8px 14px;border:1px solid #7d9bc3;border-radius:5px;background:#285487;color:#edf5ff;font:600 var(--practice-font-size) 'Segoe UI',sans-serif;white-space:nowrap}
.top-video-control:has(#show-video[hidden]){display:none}
main>header:has(#show-video[hidden]){padding-left:0;padding-right:0}
#video-panel .video-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
#video-panel .video-tempo{display:flex;align-items:center;gap:6px;height:46px;box-sizing:border-box;padding:5px 8px;border-radius:5px}
#video-panel .video-tempo>span{color:#ffdb64}
#video-panel .video-tempo button{width:32px;height:32px;padding:0}
#video-panel .video-tempo output{min-width:60px;text-align:center;font-size:19px}
#video-panel .video-tools{justify-content:flex-end}
@media(max-width:1100px){main>header{padding-right:0;padding-left:0;gap:12px}.top-video-control{position:static;margin-left:16px}}
#video-panel .video-tempo output{background:#20242b;color:#fff;border:1px solid #697689;border-radius:4px;padding:4px 6px;box-sizing:border-box}

main>header{padding-left:0;padding-right:0}.top-media-controls{gap:8px}.top-media-controls .top-video-control{position:static;margin-left:7px;flex:none}.top-video-control #show-video[aria-pressed=true]{background:transparent;border-color:#59616f;color:#939caa;opacity:.55;box-shadow:none}.top-video-control #show-video[aria-pressed=true]:hover{filter:none}
#video-panel{container-type:inline-size}
#video-panel .video-loop-keys{justify-content:center;align-items:center;max-height:96px;padding:8px 30px;gap:7px;background:#303744}
#video-panel .video-bottom-controls{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:18px;padding:14px 16px;flex:none;box-sizing:border-box;background:#303744}
#video-panel .video-bottom-controls>.video-tempo{justify-self:end;margin:0}
#video-panel .video-bottom-controls>.video-transport{justify-self:center}
#video-panel .video-right-controls{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex-wrap:wrap;min-width:0}
#video-panel .video-seek-controls{padding:0;gap:6px;margin:0;min-width:0;flex:none;background:none}
#video-panel .video-scrub-track{width:86px;flex:none}
#video-panel .video-seek-controls input{width:86px;min-width:0}
#video-panel .video-offset-group{margin:0;display:flex;align-items:center;flex:none}
#video-panel .video-offset-group label{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:var(--practice-font-size)}
#video-panel .video-offset-group input{width:62px;padding:5px}
@container(max-width:640px){#video-panel .video-bottom-controls{display:flex;justify-content:center;flex-wrap:wrap;gap:14px;padding:12px}#video-panel .video-bottom-controls>.video-transport{order:0}#video-panel .video-bottom-controls>.video-tempo{order:1}#video-panel .video-right-controls{order:2;justify-content:center;flex-basis:100%;gap:14px}}
.transport-buttons #loop{display:flex;flex-direction:column;gap:0;padding:2px 4px;background:#343a46;color:#c3cbd7}
.transport-buttons #loop svg{width:24px;height:23px;flex:none}
.transport-buttons #loop .loop-mode-label{display:block;font-size:16px;font-weight:700;line-height:18px;text-transform:uppercase;white-space:nowrap}
.transport-buttons #loop[aria-checked=true]{background:#0066ff;color:#fff;box-shadow:inset 0 0 0 2px #8ccaff}
.transport-buttons #loop[aria-checked=false]{background:#343a46;color:#c3cbd7;box-shadow:none}

.transport>.pitch-settings{gap:8px;padding:6px 8px}.transport .pitch-settings .pitch-control{gap:4px}.transport .pitch-settings input{width:44px}
/* Loop mode is communicated by icon color and the whole loop strip. */
.transport-buttons #loop{flex-direction:row;justify-content:center;padding:8px}
.transport-buttons #loop svg{width:28px;height:28px}
.transport-buttons #loop[aria-checked=true]{background:#ffdb36;color:#111;box-shadow:inset 0 0 0 2px #ffe982}
.transport-buttons #loop[aria-checked=false]{background:#343a46;color:#7d8591;box-shadow:none}
body.looping-off .track-labels span:nth-child(4){background:#626a76;color:#e4e7ec}
body.looping-off .loop-lane{background:repeating-linear-gradient(to bottom,#353b44 0px,#353b44 46px,#737c89 46px,#737c89 48px)}
body.looping-off .loop-lane .saved-loop-range,body.looping-off .loop-lane .loop-shade{background:#929ba8;color:#18202b;border-color:#66707e}
body.looping-off .saved-loop-end,body.looping-off .loop-lane .loop-handle,body.looping-off .loop-seed{background:#747e8d;border-color:#566170;color:#edf0f6}
body.looping-off .eighth-tick{border-left-color:#c0c7d21c}body.looping-off .eighth-tick.beat{border-left-color:#c0c7d238}
body.looping-off #video-loop-keys button{background:#555e6b;border-color:#7b8491;color:#edf0f6}body.looping-off #video-loop-keys kbd{background:#424b58}

.transport-buttons #video-loop{display:flex;align-items:center;justify-content:center;padding:8px}.transport-buttons #video-loop svg{width:28px;height:28px}.transport-buttons #video-loop[aria-checked=true]{background:#ffdb36;color:#111;box-shadow:inset 0 0 0 2px #ffe982}.transport-buttons #video-loop[aria-checked=false]{background:#343a46;color:#7d8591;box-shadow:none}
html body.initializing #video-panel.floating-video{visibility:hidden!important;pointer-events:none!important}
#video-panel .video-window-title .video-offset-group{margin-right:16px}
#video-panel .video-window-actions{flex-wrap:wrap;justify-content:flex-end}
#video-panel .video-right-controls{flex-wrap:nowrap}
.btc-trial-dialog{width:min(640px,calc(100vw - 24px));padding:24px;background:#2e3139;color:#edf2f8;border:1px solid #8ba3c3;border-radius:8px}
.btc-trial-dialog::backdrop{background:#0009}.btc-trial-dialog h2{margin:0 0 14px}.btc-trial-dialog p{line-height:1.5}.btc-trial-dialog label{display:flex;align-items:center;gap:12px}.btc-trial-dialog select,.btc-trial-dialog button{font-size:16px;background:#35445a;color:#edf2f8;padding:8px 12px;border:1px solid #7d9bc3;border-radius:5px}.btc-actions{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}.btc-trial-dialog [data-btc-close]{float:right}.btc-trial-dialog [data-btc-status]{clear:both;min-height:48px}.btc-test-button{border-color:#ffdb36!important;color:#ffdb36!important}
.feedback-dialog{box-sizing:border-box;width:min(760px,calc(100vw - 28px));max-height:calc(100dvh - 28px);padding:28px;border:1px solid #8ba3c3;border-radius:16px;background:#2e3139;color:#edf2f8;overflow:auto;box-shadow:0 12px 50px #0009}
.feedback-dialog::backdrop{background:#0009;backdrop-filter:blur(2px)}.feedback-dialog form{display:flex;flex-direction:column;gap:18px}.feedback-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;order:0;min-height:0;margin:0;padding:0}.feedback-dialog h2{font-size:25px;margin:0}.feedback-dialog header p{display:block;margin:6px 0 0;color:#b8c4d5}.feedback-dialog p{margin:0;line-height:1.45;font-size:16px}.feedback-dialog label:not(.feedback-check){display:flex;flex-direction:column;align-items:stretch;gap:8px;font-size:18px}.feedback-dialog label>span{font-size:16px;color:#bac6d6}.feedback-dialog textarea,.feedback-dialog input[type=email]{box-sizing:border-box;width:100%;padding:10px 12px;border:1px solid #8294ae;border-radius:7px;background:#20242b;color:#fff;font-size:18px;user-select:text}.feedback-dialog textarea{min-height:135px;resize:vertical}.feedback-dialog button{padding:9px 14px;border:1px solid #8297b3;border-radius:5px;background:#35445a;color:#edf5ff;font-size:16px}.feedback-dialog [data-feedback-close]{font-size:27px;padding:0 8px;line-height:30px}.feedback-dialog .feedback-check{display:flex;align-items:flex-start;gap:10px;font-size:16px;line-height:1.4}.feedback-dialog input[type=checkbox]{flex:none;width:19px;height:19px;accent-color:#64b3ff;margin:2px 0 0}.feedback-capture{display:flex;flex-direction:column;gap:10px;border-block:1px solid #647085;padding:16px 0}.feedback-capture>button{align-self:flex-start}.feedback-capture>p{color:#bcc8d8}.feedback-dialog [data-feedback-preview]{display:flex;flex-direction:column;gap:10px}.feedback-dialog [data-feedback-preview][hidden]{display:none}.feedback-dialog img{display:block;max-width:100%;max-height:35vh;object-fit:contain;background:#161a20;border:1px solid #77859b}.feedback-dialog [data-feedback-remove]{align-self:flex-start;background:#49343c;border-color:#9c6f76;color:#ffb8a7}.feedback-dialog pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;padding:12px;background:#20242b;border-radius:5px;color:#cdd7e4;font-size:16px;user-select:text}.feedback-dialog summary{cursor:pointer}.feedback-dialog .feedback-status{color:#ffdb64;min-height:22px}.feedback-dialog .feedback-delivery{color:#bcc8d8}.feedback-dialog footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;order:0;margin:0;padding:0}.feedback-dialog [data-feedback-submit]{background:#0066ff;border-color:#72b0ff;color:white;font-weight:700;min-width:200px}.feedback-dialog button:disabled{opacity:.45;cursor:default}
@media(max-height:750px){.feedback-dialog{padding:20px}.feedback-dialog form{gap:12px}.feedback-dialog textarea{min-height:100px}}
.feedback-dialog [data-feedback-full]{display:block;align-self:flex-start;max-width:100%;padding:0;border:0;background:none;cursor:zoom-in}
.feedback-image-dialog{box-sizing:border-box;width:96vw;height:92dvh;max-width:96vw;max-height:92dvh;padding:16px;background:#20242b;color:#edf2f8;border:1px solid #8ba3c3;border-radius:9px;overflow:hidden}.feedback-image-dialog::backdrop{background:#000b}.feedback-image-dialog[open]{display:flex;flex-direction:column;gap:12px}.feedback-image-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:40px;flex:none;padding:0;margin:0}.feedback-image-dialog h2{font-size:22px;margin:0}.feedback-image-dialog header>span{display:flex;gap:10px;align-items:center}.feedback-image-dialog button{padding:7px 12px;font-size:16px;color:#edf2f8;background:#35445a;border:1px solid #8297b3;border-radius:4px}.feedback-image-scroll{min-height:0;flex:1;overflow:auto;display:flex;align-items:center;justify-content:center}.feedback-image-dialog img{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain}.feedback-image-dialog.actual-size .feedback-image-scroll{display:block}.feedback-image-dialog.actual-size img{max-width:none;max-height:none}

/* Match the 2px chord border plus its 12px text inset. */
html body .ruler .bar-tick{padding-left:14px;text-align:left;overflow:hidden}

#audio-reconnect{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#202a33e8;z-index:8;padding:20px;text-align:center}#audio-reconnect[hidden]{display:none}#audio-reconnect p{margin:0;color:#edf2f8}#audio-reconnect button{padding:12px 20px;border:1px solid #84baff;border-radius:5px;background:#0066ff;color:white;font:inherit}

/* Instruction text belongs to the visible viewport, not recording time zero. */
html body .marker-empty,html body #loop-new-row{position:absolute;left:var(--visible-track-left,0px);right:auto;width:var(--visible-track-width,100%);max-width:var(--visible-track-width,100%);box-sizing:border-box;padding-left:14px;padding-right:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}

/* All lanes use the same time origin; avoid cumulative flex rounding. */
html body .ruler,html body .chord-lane{position:relative;display:block}
html body .ruler .bar-tick,html body .chord-lane .chord-cell{position:absolute;top:0;height:100%;box-sizing:border-box;margin:0;text-align:left;padding-left:14px}
html body .chord-lane .chord-cell{border-left:0;border-right:0;border-top:0;border-radius:0;box-shadow:inset 1px 0 #8797ab}
html body .chord-lane .chord-cell.current{box-shadow:inset 0 0 0 3px #fff}
html body .time-ruler .bar-start{padding-left:14px}
/* A marker's stem is its exact timestamp; the flag sits beside it. */
html body .marker-lane .timeline-marker{top:0;height:100%;max-width:260px;display:flex;align-items:center;padding:0 0 0 8px;border:0;border-radius:0;background:transparent;box-shadow:none;outline:none;overflow:visible}
html body .marker-lane .timeline-marker::before{left:0;right:auto;top:0;bottom:0;width:1px;background:#ffdb36;box-shadow:none}
html body .marker-lane .timeline-marker::after{left:-4px;right:auto;top:0;bottom:auto;border:0;border-top:7px solid #ffdb36;border-left:4px solid transparent;border-right:4px solid transparent;filter:none}
html body .marker-lane .timeline-marker .marker-name-text{padding:6px 10px;max-width:244px;max-height:calc(100% - 12px);border:1px solid #ae861e;border-radius:4px;background:#ffdb36;color:#2c2300;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .marker-lane .timeline-marker.near-end{padding:0 8px 0 0}
html body .marker-lane .timeline-marker.near-end::before{left:auto;right:0}
html body .marker-lane .timeline-marker.near-end::after{left:auto;right:-4px}
html body .marker-lane .timeline-marker.selected .marker-name-text{box-shadow:inset 0 0 0 2px #8a6716}
html body .marker-lane .timeline-marker.dragging .marker-name-text{background:#ffe98b}
html body .marker-lane .marker-empty{top:50%;transform:translateY(-50%);padding-top:0;padding-bottom:0}

/* Endpoint faces stay within the selected interval, including while pressed. */
html body #loop-lane #loop-left,html body #loop-lane #loop-left:active{transform:none}
html body #loop-lane #loop-right,html body #loop-lane #loop-right:active{transform:translateX(-100%)}

html body.chords-disabled .chord-lane,html body.chords-disabled .track-labels span:nth-child(2),body.chords-disabled .editor-panel,body.chords-disabled .btc-test-button{display:none!important}

html body .ruler .ruler-beat-tick{position:absolute;bottom:0;top:auto;height:14px;width:1px;background:#566274;opacity:.65;z-index:2;pointer-events:none}

/* Removing the chord items must also remove their grid track. */
html body.chords-disabled .timeline-content,html body.chords-disabled .track-labels{grid-template-rows:var(--measure-height) var(--marker-height) var(--loop-view-height) minmax(40px,1fr) var(--time-height)}
html body .media-workspace{--time-height:28px}

html body .ruler .bar-tick.current-bar{background:#ffdb36;color:#302300}

/* Current bar and hover share the transport gold, never the marker yellow. */
html body .ruler .bar-tick.current-bar,html body .ruler .bar-tick.current-bar:hover{background:#e3ba45;color:#211b0d;filter:none}
html body .ruler .bar-tick:hover:not(.current-bar){background:#e3ba4538;filter:none}
html body .count-in-heading{display:flex;align-items:center;justify-content:center}
html body .count-in-heading #count-in-status{background:transparent;color:#e3ba45;padding:0;letter-spacing:normal;text-transform:none}
html body .count-in-heading #count-in-status.counting{background:#e3ba45;color:#211b0d;padding:3px 10px}
html body .track-labels{position:relative}
html body .track-labels::after{content:"";position:absolute;top:0;bottom:0;right:0;width:3px;background:#101722;z-index:5;pointer-events:none}

html body .track-heading{padding-top:18px}

html body .track-heading h2{font-size:clamp(24px,1.6vw,30px);line-height:1.25}

html body .transport{border:0;box-shadow:none;background:transparent;border-radius:0}

html body .ruler .bar-tick,html body .ruler .bar-tick:active{transition:none;transform:none}
html body .track-heading{padding-left:var(--tool-title-inset,0px);box-sizing:border-box}
html body .track-heading h2{font-size:clamp(30px,2vw,37.5px);line-height:1.25}

.library-heading-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.library-import-limit{color:#bdc8d8;margin:-8px 0 16px}#song-library-dialog #upload-side{background:#0066ff;color:#fff}

html body .chord-lane .chord-cell,html body .chord-lane .chord-cell:active{transition:none;animation:none;transform:none}

/* Build identification shares the count-in strip without shifting its center. */
html body .count-in-heading{position:relative;padding-right:12px;padding-left:12px;min-height:38px}
html body .count-in-heading .timeline-build{position:absolute;right:12px;top:50%;transform:translateY(-50%);margin:0;padding:0;background:transparent;border:0;color:#a4aab3;font-weight:400;font-size:var(--practice-font-size,16px);letter-spacing:normal;text-transform:none}
html body .sidebar>.brand+.divider{margin-top:12px}
@media(max-width:600px){html body .count-in-heading{justify-content:space-between;gap:12px}html body .count-in-heading .timeline-build{position:static;transform:none;margin-left:auto}}

.library-context-menu{position:absolute;z-index:30;background:#303947;border:1px solid #8497ae;padding:4px;border-radius:5px;box-shadow:0 4px 16px #0008}.library-context-menu button{color:#ffb3a7;min-width:120px;text-align:left}.library-undo-delete{margin-top:12px}

/* Library actions use the same dark destructive/control palette as editors. */
#song-library-dialog .library-context-menu button{box-sizing:border-box;background:#49343c;color:#ffb8a7;border:1px solid #9c6f76;border-radius:4px;padding:8px 12px;font:600 var(--practice-font-size,16px) "Segoe UI",sans-serif;filter:none;transform:none}
#song-library-dialog .library-context-menu button:hover,#song-library-dialog .library-context-menu button:focus-visible{background:#65424b;border-color:#db9b92;color:#ffe1da;filter:none}
#song-library-dialog .library-context-menu button:focus-visible{outline:2px solid #db9b92;outline-offset:2px}
#song-library-dialog .library-undo-delete{padding:8px 12px;background:#35445a;border:1px solid #7d9bc3;border-radius:4px;color:#edf5ff;font-size:var(--practice-font-size,16px)}

/* Video controls respond to window width, independently of picture proportions. */
#video-panel .video-window-title{box-sizing:border-box;min-height:46px;padding:6px 8px;gap:8px;overflow:visible}
#video-panel .video-window-title>strong{font-size:18px;white-space:nowrap}
#video-panel .video-window-actions{gap:6px;flex:none;flex-wrap:nowrap}
#video-panel .video-window-actions>button,#video-panel .video-options>summary{box-sizing:border-box;width:34px;height:34px;padding:0;display:flex;align-items:center;justify-content:center;border:1px solid #8ba3c3;border-radius:4px;background:#414a59;color:#eef4ff;font:600 23px 'Segoe UI',sans-serif;cursor:pointer;list-style:none}
#video-panel .video-options>summary::-webkit-details-marker{display:none}
#video-panel .video-options{position:relative}
#video-panel .video-options-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:40;width:242px;max-width:calc(100vw - 36px);box-sizing:border-box;display:flex;flex-direction:column;gap:14px;padding:14px;background:#303744;border:1px solid #8ba3c3;border-radius:6px;box-shadow:0 8px 24px #0008;cursor:default}
#video-panel .video-options:not([open]) .video-options-menu{display:none}
#video-panel .video-options-menu .video-offset-group{margin:0;justify-content:flex-start}
#video-panel .video-options-menu .video-offset-group label{font-size:16px;gap:6px}
#video-panel .video-options-menu .video-right-controls{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
#video-panel .video-options-menu .video-right-controls::before{content:'Scrub';color:#d0d9e7;font-weight:600}
#video-panel .video-loop-keys{box-sizing:border-box;display:flex;flex-wrap:nowrap;justify-content:flex-start;align-items:center;gap:6px;height:auto;max-height:52px;min-height:44px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:4px 10px;background:#303744}
#video-panel .video-loop-keys:not(:has([data-video-loop])){display:none}
#video-panel .video-loop-keys button{flex:none;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;padding:4px 7px;min-height:32px}
#video-panel .video-loop-keys button:first-child{margin-left:auto}#video-panel .video-loop-keys button:last-child{margin-right:auto}
#video-panel[data-controls-layout] .video-bottom-controls{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px;align-items:center;padding:10px 26px 10px 12px}
#video-panel .video-tempo{height:44px;gap:4px;padding:4px 6px;flex-wrap:nowrap;white-space:nowrap}
#video-panel .video-tempo button{width:30px;height:32px;flex:none}#video-panel .video-tempo output{min-width:52px;padding:4px;font-size:18px}
#video-panel .video-seek-controls{display:flex;flex-wrap:nowrap;align-items:center;gap:5px}
#video-panel .video-seek-controls button{box-sizing:border-box;padding:4px 6px;min-width:38px;height:34px;font-size:16px;border:1px solid #708099;border-radius:4px;background:#414a59;color:#edf4ff}
#video-panel .video-scrub-track,#video-panel .video-seek-controls input{width:60px;min-width:60px;flex:none}
#video-panel[data-controls-layout=medium] .video-bottom-controls{grid-template-columns:1fr 1fr;gap:8px 12px}
#video-panel[data-controls-layout=medium] .video-transport{grid-column:1/-1;grid-row:1;justify-self:center}
#video-panel[data-controls-layout=medium] .video-tempo{grid-column:1;grid-row:2;justify-self:end}
#video-panel[data-controls-layout=medium] .video-bottom-controls>.video-right-controls{grid-column:2;grid-row:2;justify-self:start;flex-basis:auto;justify-content:flex-start}
#video-panel[data-controls-layout=compact] .video-bottom-controls{grid-template-columns:1fr;gap:8px;padding:8px 26px 8px 12px}
#video-panel[data-controls-layout=compact] .video-transport{grid-column:1;grid-row:1;justify-self:center}
#video-panel[data-controls-layout=compact] .video-tempo{grid-column:1;grid-row:2;justify-self:center}
#video-panel[data-controls-layout=wide] .video-bottom-controls>.video-right-controls{flex-basis:auto;justify-content:flex-start}

#video-panel .video-window-title{position:relative}#video-panel .video-options{position:static}#video-panel .video-options-menu{right:8px;max-width:calc(100% - 16px)}

/* All video shapes expose the same annotations; square/tall video uses a side rail. */
#video-panel [hidden]{display:none!important}
#video-panel .video-annotations{min-height:0;min-width:0;background:#303744;flex:none}
#video-panel .video-annotation-tabs{display:flex;justify-content:center;gap:4px;padding:5px 8px 2px;flex:none}
#video-panel .video-annotation-tabs button{padding:5px 12px;border:1px solid #71859e;border-radius:4px;background:#303947;color:#cdd6e3;font-size:16px}
#video-panel .video-annotation-tabs button[aria-selected=true]{background:#285487;color:#fff;border-color:#88b9ef}
#video-panel .video-marker-keys{display:flex;flex-wrap:nowrap;gap:6px;align-items:center;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:4px 10px;min-height:44px;max-height:52px}
#video-panel .video-marker-key{flex:none;max-width:180px;min-height:32px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:4px 7px;background:#ffdb36;color:#302600;border:1px solid #b49a2b;border-radius:4px;font-size:16px;text-align:left}
#video-panel .video-marker-key.active{border-color:#fff;box-shadow:inset 0 0 0 1px #715514}
#video-panel .video-marker-empty{font-size:16px;color:#bec8d8;padding:6px}
#video-panel .video-loop-keys:not(:has([data-video-loop])){display:flex}
#video-panel .video-offset-group label{display:flex;flex-direction:column;align-items:flex-start;gap:5px}
#video-panel .video-offset-stepper{display:flex;gap:4px;align-items:center}
#video-panel .video-offset-stepper button{width:30px;height:32px;padding:0;background:#414a59;color:#edf4ff;border:1px solid #8495ad;border-radius:4px;font-size:18px}
#video-panel .video-offset-stepper input{box-sizing:border-box;width:70px;text-align:center;background:#20242b;color:#fff;border:1px solid #8495ad;border-radius:4px;padding:5px;appearance:textfield}
#video-panel .video-offset-stepper input::-webkit-inner-spin-button,#video-panel .video-offset-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#video-panel[data-video-arrangement=side]{display:grid!important;grid-template-columns:minmax(0,1fr) var(--video-rail-width,244px);grid-template-rows:auto minmax(0,1fr)}
#video-panel[data-video-arrangement=side]>.video-window-title{grid-column:1/-1;grid-row:1}
#video-panel[data-video-arrangement=side]>.video-stage{grid-column:1;grid-row:2;width:100%;height:100%!important;aspect-ratio:auto!important;min-width:0;min-height:0}
#video-panel[data-video-arrangement=side]>.video-bottom-controls{display:none!important}
#video-panel[data-video-arrangement=side] .video-options{display:none}
#video-panel .video-side-controls{grid-column:2;grid-row:2;display:flex;flex-direction:column;align-items:center;gap:12px;min-height:0;min-width:0;box-sizing:border-box;padding:12px;background:#303744;border-left:1px solid #718299;overflow:hidden}
#video-panel .video-side-controls>.video-transport,#video-panel .video-side-controls>.video-tempo,#video-panel .video-side-controls>.video-right-controls,#video-panel .video-side-controls>.video-offset-group{flex:none;margin:0;align-self:center}
#video-panel .video-side-controls>.video-right-controls{display:flex;flex-direction:row;flex-wrap:nowrap}
#video-panel .video-side-controls>.video-annotations{align-self:stretch;display:flex;flex-direction:column;flex:1;min-height:40px;overflow:hidden}
#video-panel .video-side-controls .video-annotation-tabs{padding:0 0 6px;justify-content:stretch}
#video-panel .video-side-controls .video-annotation-tabs button{flex:1;min-width:0;padding:5px 6px}
#video-panel .video-side-controls :is(.video-loop-keys,.video-marker-keys){display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;flex:1;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto;padding:0 4px 4px 0;gap:6px}
#video-panel .video-side-controls :is(.video-loop-keys,.video-marker-keys) button{width:100%;max-width:none;text-align:left;margin:0;flex:none}
#video-panel[data-video-arrangement=side]:fullscreen{height:100dvh!important;grid-template-columns:minmax(0,1fr) var(--video-rail-width,244px)}

/* Playback controls remain beneath the picture for every video shape. */
#video-panel[data-video-arrangement=side]{grid-template-rows:auto minmax(0,1fr) auto}
#video-panel[data-video-arrangement=side]>.video-bottom-controls{display:flex!important;grid-column:1;grid-row:3;flex-wrap:wrap;justify-content:center;gap:12px;padding:12px;box-sizing:border-box;min-width:0}
#video-panel[data-video-arrangement=side] .video-options{display:block}
#video-panel[data-video-arrangement=side]>.video-side-controls{grid-row:2/4}
#video-panel .video-bottom-controls>.video-right-controls{display:flex!important;flex-direction:row;justify-content:center;flex-wrap:nowrap}
#video-panel[data-video-arrangement=side] .video-bottom-controls>.video-transport{order:1}
#video-panel[data-video-arrangement=side] .video-bottom-controls>.video-tempo{order:2}
#video-panel[data-video-arrangement=side] .video-bottom-controls>.video-right-controls{order:3}

/* Playback strip spans the picture and annotation rail. */
#video-panel[data-video-arrangement=side]>.video-bottom-controls{grid-column:1/-1;grid-row:3}
#video-panel[data-video-arrangement=side]>.video-side-controls{grid-row:2}

/* One continuous playback row, with progressively shorter tempo label. */
#video-panel[data-controls-layout]>.video-bottom-controls{display:flex!important;flex-wrap:nowrap;align-items:center;justify-content:center;gap:14px;padding:10px 18px;overflow-x:auto}
#video-panel .video-bottom-controls>.video-tempo,#video-panel .video-bottom-controls>.video-transport,#video-panel .video-bottom-controls>.video-right-controls{flex:none;flex-basis:auto;order:initial;min-width:0;margin:0}
#video-panel .video-bottom-controls>.video-tempo{order:0}
#video-panel .video-bottom-controls>.video-transport{order:1}
#video-panel .video-bottom-controls>.video-right-controls{order:2}
#video-panel .video-tempo>span{font-size:0}
#video-panel .video-tempo>span::after{content:'Tempo';font-size:18px}
@container(max-width:680px){
 #video-panel[data-controls-layout]>.video-bottom-controls{gap:10px;padding:10px}
 #video-panel .video-tempo>span::after{content:'Tmpo'}
 #video-panel .video-transport .transport-key{width:36px;min-width:36px;height:40px;padding:5px}
}
@container(max-width:520px){
 #video-panel[data-controls-layout]>.video-bottom-controls{gap:7px;padding:8px}
 #video-panel .video-tempo>span::after{content:'T';font-size:16px}
 #video-panel .video-tempo{gap:2px;padding:3px;height:38px}
 #video-panel .video-tempo button{width:24px;min-width:24px;padding:0;height:30px}
 #video-panel .video-tempo output{min-width:40px;font-size:16px;padding:2px}
 #video-panel .video-transport .transport-key{width:28px;min-width:28px;height:36px;padding:3px}
 #video-panel .video-seek-controls{gap:3px}
 #video-panel .video-seek-controls button{min-width:30px;padding:3px;font-size:14px}
 #video-panel .video-scrub-track,#video-panel .video-seek-controls input{width:40px;min-width:40px}
}

/* Keep responsive label/button changes from resizing the video window. */
#video-panel[data-controls-layout]>.video-bottom-controls{height:66px;min-height:66px;max-height:66px;box-sizing:border-box}

/* Landscape annotation tabs and scrolling items share a single row. */
#video-panel[data-video-arrangement=bottom]>.video-annotations{display:flex;flex-direction:row;align-items:center;gap:12px;padding:8px 12px;box-sizing:border-box;min-width:0}
#video-panel[data-video-arrangement=bottom] .video-annotation-tabs{display:flex;flex:none;flex-wrap:nowrap;padding:0;gap:4px}
#video-panel[data-video-arrangement=bottom] .video-annotations>:is(.video-loop-keys,.video-marker-keys){display:flex;flex:1;flex-wrap:nowrap;justify-content:flex-start;min-width:0;max-height:none;overflow-x:auto;overflow-y:hidden;padding:2px 0;gap:6px}
#video-panel[data-video-arrangement=bottom] .video-annotations :is(.video-loop-keys,.video-marker-keys) button{flex:none;margin:0}

/* Matching segmented annotation selector and blue loop shortcut badges. */
#video-panel .video-annotation-tabs{display:flex;gap:0!important;border:1px solid #8297b4;border-radius:6px;padding:0!important;background:#202630;overflow:hidden;flex:none}
#video-panel .video-annotation-tabs button{border:0!important;border-radius:0!important;margin:0;padding:7px 12px;background:transparent;color:#bfc9d8;font-weight:600;min-height:34px;box-shadow:none}
#video-panel .video-annotation-tabs button+button{border-left:1px solid #8297b4!important}
#video-panel .video-annotation-tabs button[aria-selected=true]{background:#2c5987;color:#fff;box-shadow:inset 0 -3px #83c3ff}
#video-panel .video-annotation-tabs button:hover{background:#3b4e67;color:#fff}
#video-panel .video-annotation-tabs button[aria-selected=true]:hover{background:#32689c}
#video-panel .video-loop-keys kbd{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:26px;padding:0 4px;box-sizing:border-box;border:0;border-radius:4px;background:#006bff;color:#fff;font:700 16px 'Segoe UI',sans-serif;box-shadow:none}

/* Shortcut numbers stay blue, including when looping is switched off. */
#video-panel #video-loop-keys button kbd,body.looping-off #video-panel #video-loop-keys button kbd{background:#006bff;color:#fff;border:0;border-radius:4px}

#first-import-dialog{width:min(460px,calc(100vw - 32px));padding:26px;border:1px solid #8297b4;border-radius:8px;background:#303744;color:#edf2f8;font-size:var(--practice-font-size,18px)}
#first-import-dialog::backdrop{background:#0009}
#first-import-dialog h2{margin-top:0}
.first-import-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}
.first-import-actions button{padding:9px 16px;border:1px solid #8297b4;border-radius:5px;background:#414a59;color:#fff}
#first-import-choose{background:#006bff;border-color:#82b8ff}

/* First-use welcome. */
#first-import-dialog{width:min(580px,calc(100vw - 32px));padding:32px 36px 26px;border:1px solid #7891b0;border-radius:12px;background:linear-gradient(145deg,#354257,#262d39);color:#edf2f8;box-shadow:0 22px 80px #0008;text-align:left;max-height:calc(100dvh - 32px);overflow:auto}
#first-import-dialog::backdrop{background:#080b11b8}
#first-import-dialog .welcome-brand{font-size:48px;line-height:1;color:#edc14c;margin-bottom:16px;font-weight:700}
#first-import-dialog h2{font-size:32px;line-height:1.2;margin:0 0 10px;color:#fff;letter-spacing:-.4px}
#first-import-dialog .welcome-tagline{font-size:21px;color:#edc14c;font-weight:600;margin:0 0 20px}
#first-import-description{font-size:18px;line-height:1.55;margin:0 0 22px;color:#dde6f2}
#first-import-dialog .welcome-features{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:24px}
#first-import-dialog .welcome-features span{padding:7px 10px;border:1px solid #627794;border-radius:5px;background:#233044;color:#d8e6f7;font-size:16px}
#first-import-dialog .welcome-file-note{font-size:16px;color:#bdcadd;margin:0}
#first-import-dialog .first-import-actions{margin-top:20px;gap:12px}
#first-import-dialog .first-import-actions button{min-height:44px;font-size:18px;font-weight:600;padding:10px 18px}
#first-import-dialog #first-import-cancel{background:transparent;border-color:#71829a;color:#d8e2ef}
#first-import-dialog #first-import-choose{background:#006bff;border-color:#85b8ff;color:#fff}
#first-import-dialog .welcome-later{font-size:16px;color:#bdcadd;margin:18px 0 0;line-height:1.4}
@media(max-width:480px){#first-import-dialog{padding:24px}#first-import-dialog h2{font-size:28px}#first-import-dialog .first-import-actions{justify-content:stretch}#first-import-dialog .first-import-actions button{flex:1;padding:10px}}

body.empty-track .timeline-foot{visibility:hidden}

.transport>.playback{position:relative}
.transport>.playback>#count-in-status{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);white-space:nowrap;margin:0;padding:0;color:#edc14c;background:transparent;font-weight:600;text-align:center;pointer-events:none}
