/* One permanent row; secondary controls open above it without resizing lyrics. */
body .mobile-dock,body.focus-screen .mobile-dock{
  display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;
  flex:0 0 auto;gap:8px;position:relative;bottom:auto;z-index:12;
  margin:0;width:100%;padding:6px max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));
  background:var(--surface);border-top:1px solid var(--border);
}
body .mobile-dock button{min-height:44px;min-width:44px;padding:6px 12px;font-size:14px;white-space:nowrap;touch-action:manipulation;flex:none}
body .mobile-dock #mobilePlay{min-width:110px}
body .mobile-dock .mobile-speed-group{display:flex;align-items:center;gap:4px;margin-inline:12px;white-space:nowrap}
body .mobile-dock .mobile-speed-group button{width:52px;padding:6px}
body .mobile-dock .mobile-speed-group output{min-width:48px;text-align:center;font-size:16px;font-weight:700;font-variant-numeric:tabular-nums}
body:not(.focus-screen) #mobileExit{display:none}
body.focus-screen main{overflow:hidden}
body.focus-screen .reading-shell{flex:1 1 0;min-height:0;margin-block:0}
body.focus-screen .reading-shell #stage{min-height:0}
body.focus-screen #bookNavigation{display:none!important}

body #mobileSettings.transport{display:none!important}
body.mobile-controls-open #mobileSettings.transport{
  display:flex!important;position:fixed;z-index:13;left:auto;right:16px;
  bottom:calc(66px + env(safe-area-inset-bottom));width:min(560px,calc(100vw - 32px));
  max-height:calc(100dvh - 88px - env(safe-area-inset-bottom));overflow-y:auto;
  flex-wrap:wrap;align-items:center;gap:16px;margin:0;padding:18px;
  border:1px solid var(--border);border-radius:14px;background:var(--surface);
  box-shadow:0 8px 36px #0003;
}
#mobileSettings .reader-settings-heading{display:flex;align-items:center;justify-content:space-between;flex:1 0 100%;font-size:17px}
#mobileSettings .reader-settings-heading button{min-width:44px;min-height:44px}
body #mobileSettings .play-controls{display:flex!important;flex:1 1 100%;flex-wrap:wrap;gap:6px;justify-content:flex-start}
body #mobileSettings .play-controls>button{display:inline-flex;min-width:44px;min-height:44px;width:auto;padding:8px 10px}
body.mobile-controls-open #mobileSettings .play-controls>button:not(#playPause){display:inline-flex}
body #mobileSettings .play-controls>button span{display:inline}
body #mobileSettings #playPause,body #mobileSettings #exitFullscreen{display:none!important}
body #mobileSettings .countdown{display:flex;flex:1 1 100%;flex-direction:column;min-width:0;max-width:none;margin:0;padding:0;gap:5px;order:0}
body #mobileSettings .countdown-label{display:flex;flex-direction:row;justify-content:space-between;align-items:center;margin:0;font-size:13px}
body #mobileSettings .countdown-label>span{display:inline;font-size:13px}
body #mobileSettings .performance-font-control,body #mobileSettings .performance-key-control{display:flex;flex-direction:column;align-items:flex-start;flex:1 1 180px;order:0;gap:6px;font-size:13px;font-weight:600}
body #mobileSettings .performance-font-control .stepper{height:44px}
body #mobileSettings .performance-font-control button{width:44px;min-height:42px;font-size:17px}
body #mobileSettings .performance-font-control output{min-width:38px;font-size:16px}
body #mobileSettings .performance-key-control select{width:100%;max-width:none;min-height:44px;font-size:16px}
body #mobileSettings .start-delay-control{flex:1 1 180px;font-size:13px;gap:6px}
body #mobileSettings .start-delay-control input{min-height:44px}
body #mobileSettings .mobile-jump-group{display:flex;flex:1 1 180px;align-items:center;gap:6px;font-size:13px}
body #mobileSettings .mobile-jump-group button{width:44px;min-height:44px;font-size:22px}
body #mobileSettings .pace-controls{display:flex;flex:1 1 100%;align-items:center;flex-wrap:wrap;min-width:0;max-width:none;margin:0;gap:16px;order:0}
body #mobileSettings .live-flow-speed{flex:1 1 260px;min-width:0;gap:5px}
body #mobileSettings .flow-stepper button{min-height:44px}
body #mobileSettings .reader-settings-actions{display:flex;align-items:center;flex:1 1 100%;flex-wrap:wrap;gap:8px;border-top:1px solid var(--border);padding-top:14px}
body #mobileSettings #mobileEdit{display:inline-flex;min-height:44px}
body #mobileSettings #copyScrollReport{margin:0;min-height:44px}
@media(max-width:540px){
  body .mobile-dock,body.focus-screen .mobile-dock{gap:4px;padding-inline:4px}
  body .mobile-dock #mobilePrevious,body .mobile-dock #mobileNext{display:none}
  body .mobile-dock #mobilePlay{min-width:82px;padding-inline:6px;font-size:13px}
  body .mobile-dock .mobile-speed-group{margin-inline:auto;gap:2px}
  body .mobile-dock .mobile-speed-group button{width:44px}
  body .mobile-dock .mobile-speed-group output{min-width:38px;font-size:14px}
  body .mobile-dock #mobileOptions{padding-inline:6px}
  body .mobile-dock #mobileExit{min-width:36px;padding-inline:6px}
  body.mobile-controls-open #mobileSettings.transport{left:8px;right:8px;width:auto;padding:14px;gap:12px}
}

/* Fit the controls to the reader width, including when the library is open. */
.reader-controls{container-type:inline-size;flex:0 0 auto;min-width:0;background:var(--surface);border-top:1px solid var(--border)}
.reader-controls .stanza-navigation{padding:6px 8px 0;margin:0;gap:8px}
.reader-controls .stanza-navigation button{min-height:44px;touch-action:manipulation}
.reader-controls .stanza-navigation>span{display:none}
body .reader-controls .mobile-dock{border-top:0}
@media(max-width:540px){
  .reader-controls .stanza-navigation{padding:4px 6px 0;gap:8px}
  .reader-controls .stanza-navigation button{font-size:14px;min-height:44px}
  body .reader-controls .mobile-dock{padding-bottom:max(6px,env(safe-area-inset-bottom))}
  body.mobile-controls-open #mobileSettings.transport{bottom:calc(108px + env(safe-area-inset-bottom));max-height:calc(100dvh - 124px - env(safe-area-inset-bottom))}
}

/* Desktop: the settings are part of the same toolbar, not a popup. */
@media(min-width:1000px){
  body .reader-controls{display:flex;align-items:center;gap:12px;padding:6px 12px;overflow-x:auto;container-type:normal}
  body .reader-controls .stanza-navigation{flex:none;padding:0;gap:6px}
  body .reader-controls .stanza-navigation button{font-size:14px;padding:6px 10px}
  body .reader-controls .mobile-dock{display:contents}
  body .reader-controls #mobilePlay{min-width:82px}
  body .reader-controls .mobile-speed-group{margin-inline:0}
  body .reader-controls #mobileOptions{display:none}
  body #mobileSettings.transport,body.mobile-controls-open #mobileSettings.transport{display:contents!important}
  body #mobileSettings .reader-settings-heading,body #mobileSettings #previous,body #mobileSettings #next,
  body #mobileSettings .live-flow-speed,body #mobileSettings #copyScrollReport{display:none!important}
  body #mobileSettings .play-controls,body #mobileSettings .pace-controls,body #mobileSettings .reader-settings-actions{display:contents!important}
  body #mobileSettings .countdown{flex:0 0 82px;gap:4px}
  body #mobileSettings .countdown-label{flex-direction:column;align-items:flex-start;gap:2px;font-size:12px}
  body #mobileSettings .countdown-label>span{font-size:11px}
  body #mobileSettings .performance-font-control,body #mobileSettings .performance-key-control,
  body #mobileSettings .start-delay-control,body #mobileSettings .mobile-jump-group{flex:none;gap:3px;font-size:12px;white-space:nowrap}
  body #mobileSettings .performance-font-control .stepper{height:36px}
  body #mobileSettings .performance-font-control button{width:36px;min-height:34px}
  body #mobileSettings .performance-font-control output{min-width:32px}
  body #mobileSettings .performance-key-control select{width:106px;min-height:36px;font-size:14px}
  body #mobileSettings .start-delay-control input{width:48px;min-height:36px;font-size:14px}
  body #mobileSettings .mobile-jump-group{display:grid;grid-template-columns:36px 36px;gap:3px}
  body #mobileSettings .mobile-jump-group>span{grid-column:1 / -1;text-align:center}
  body #mobileSettings .mobile-jump-group button{width:36px;min-height:36px;padding:2px;font-size:20px}
  body #mobileSettings #restart,body #mobileSettings #mobileEdit,body #mobileSettings #tapTempo{padding:6px 10px;min-height:44px;font-size:14px;white-space:nowrap}
  body #mobileSettings #performanceTheme{min-width:44px;min-height:44px;flex:none}
  body .reader-controls #mobileExit{order:5}
}

/* Keep line jumps beside the score only when those side controls are visible. */
@media(min-width:1000px){
  body #mobileSettings .mobile-jump-group{display:none!important}
  body .reader-controls{gap:6px;padding:6px 10px}
  body .reader-controls .stanza-navigation{order:0;border-right:1px solid var(--border);padding-right:10px;margin-right:4px}
  body .reader-controls #mobilePrevious,body .reader-controls #mobilePlay,body .reader-controls #mobileNext,
  body #mobileSettings #restart{order:1}
  body #mobileSettings #restart{min-width:44px;width:44px;padding:8px;justify-content:center;margin-right:4px}
  body #mobileSettings #restart span{display:none}
  body .reader-controls .mobile-speed-group{order:2;border-left:1px solid var(--border);padding-left:10px;position:relative;padding-top:13px}
  body .reader-controls .mobile-speed-group:before{content:'Skrunhraði';position:absolute;top:0;left:10px;font-size:11px;color:var(--muted);line-height:13px}
  body .reader-controls .mobile-speed-group button{min-height:36px;width:44px;padding:4px}
  body #mobileSettings .tap-control{order:2;padding-right:10px;border-right:1px solid var(--border);margin-right:4px}
  body #mobileSettings .performance-font-control,body #mobileSettings .performance-key-control{order:3;margin-right:6px}
  body #mobileSettings .start-delay-control{order:4;padding-left:10px;border-left:1px solid var(--border);margin-right:6px}
  body #mobileSettings #mobileEdit,body #mobileSettings #performanceTheme{order:5}
  body .reader-controls #mobileExit{order:6;margin-left:auto}
  body #mobileSettings .countdown{display:none}
}

/* The reader no longer reserves a column for two-line jump controls. */
body .reading-shell,body:not(.focus-screen) .reading-shell{padding:0!important}

/* A single visible speed control: the permanent bottom toolbar. */
body .reading-shell>.center-speed,body #mobileSettings .live-flow-speed{display:none!important}
body #mobileSettings .pace-controls{display:none!important}
/* Immediate playback actions precede the less urgent navigation group. */
@media(min-width:1000px){
 body .reader-controls #mobilePlay{order:0;min-width:100px;min-height:48px}
 body .reader-controls .mobile-speed-group{order:0;border-left:0;border-right:1px solid var(--border);padding-left:0;padding-right:14px;margin-right:6px}
 body .reader-controls .mobile-speed-group:before{left:0}
 body .reader-controls .mobile-speed-group button{min-height:40px;width:48px}
 body .reader-controls .stanza-navigation{order:1;border-right:0;padding-right:0;margin-right:0}
 body .reader-controls #mobilePrevious,body .reader-controls #mobileNext,body #mobileSettings #restart{order:1}
 body #mobileSettings #restart{border-right:1px solid var(--border);margin-right:10px}
}

/* Navigation has its own side rail, apart from immediate playback controls. */
.reader-navigation{position:absolute;left:0;top:50%;transform:translateY(-50%);width:144px;display:flex;flex-direction:column;gap:20px;padding:8px}
.reader-navigation .stanza-navigation,.reader-song-navigation{display:flex;flex-direction:column;gap:8px;padding:0}
.reader-navigation #stanzaHint{display:none}
.reader-navigation button{width:100%;min-height:44px;padding:8px;font-size:14px;white-space:nowrap;touch-action:manipulation}
body .reading-shell,body:not(.focus-screen) .reading-shell{padding:0 0 0 152px!important}
@media(max-width:999px){
 body .reading-shell,body:not(.focus-screen) .reading-shell{padding:0!important;display:flex;flex-direction:column;gap:4px}
 body .reading-shell #stage{flex:1 1 0;height:auto!important;min-height:0}
 .reader-navigation{position:static;transform:none;width:100%;order:2;flex:0 0 auto;flex-direction:row;gap:8px;overflow-x:auto;padding:4px 0}
 .reader-navigation .stanza-navigation,.reader-song-navigation{flex-direction:row;gap:4px;flex:none}
 .reader-navigation button{width:auto;min-width:94px;font-size:12px;padding:6px}
 .reader-song-navigation{border-left:1px solid var(--border);padding-left:8px}
}

body #mobileSettings #mobileEdit[hidden]{display:none!important}

.reader-navigation .performance-key-control{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;padding-top:14px;border-top:1px solid var(--border)}
.reader-navigation .performance-key-control select{width:100%;min-height:44px;font-size:16px}
@media(max-width:999px){
 .reader-navigation .performance-key-control{flex:none;width:110px;border-top:0;border-left:1px solid var(--border);padding:0 0 0 8px;gap:0;font-size:11px}
 .reader-navigation .performance-key-control select{min-height:32px;font-size:14px}
}

/* Live teaching controls remain together and visible, including on phones. */
body .mobile-dock .performance-font-control,body .mobile-dock .live-line-jumps{display:flex;flex-direction:column;gap:3px;flex:none;font-size:12px;font-weight:600;order:0}
body .mobile-dock .performance-font-control .stepper,body .mobile-dock .live-line-jumps>div{display:flex;gap:2px;align-items:center;height:40px}
body .mobile-dock .performance-font-control button,body .mobile-dock .live-line-jumps button{min-width:40px;min-height:40px;width:40px;padding:4px;font-size:17px}
body .mobile-dock .performance-font-control output{min-width:32px;text-align:center;font-size:15px}
@media(min-width:1000px){
 body .mobile-dock .live-line-jumps{padding-left:6px;margin-right:8px}
 body .mobile-dock .performance-font-control{border-right:1px solid var(--border);padding-right:14px;margin-right:8px}
}
@media(max-width:999px){
 body .reader-controls .mobile-dock{flex-wrap:wrap;gap:6px}
 body .mobile-dock .performance-font-control,body .mobile-dock .live-line-jumps{flex-direction:row;align-items:center;gap:4px}
 body .mobile-dock .performance-font-control>span{font-size:0}
 body .mobile-dock .performance-font-control>span:after{content:'Letur';font-size:12px}
 body .mobile-dock .performance-font-control button,body .mobile-dock .live-line-jumps button{min-width:44px;min-height:44px;width:44px}
 body .reader-controls #mobileOptions,body .reader-controls #mobileExit{order:1}
}

.reader-navigation .start-delay-control{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}
.reader-navigation .start-delay-control span{display:flex;align-items:center;gap:6px}
.reader-navigation .start-delay-control input{width:70px;min-height:44px;font-size:16px}
@media(max-width:999px){
 .reader-navigation .start-delay-control{flex:none;gap:0;font-size:11px;padding-left:8px;border-left:1px solid var(--border)}
 .reader-navigation .start-delay-control input{width:54px;min-height:32px;font-size:14px}
}

body .mobile-dock #restart{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:auto;min-width:100px;min-height:48px;padding:5px 10px;order:0}
body .mobile-dock #restart span{display:block;font-size:14px;font-weight:700}
body .mobile-dock #restart small{display:block;font-size:11px;font-weight:400;color:var(--muted)}

.reader-navigation .start-delay-control span{gap:3px}
.reader-navigation .start-delay-control input{width:48px;min-width:0;padding:4px;text-align:center}
.reader-navigation .start-delay-control button{width:34px;min-width:34px;min-height:44px;padding:3px;font-size:18px}
.reader-navigation .start-delay-control small{font-size:10px;font-weight:400;color:var(--muted)}
@media(max-width:999px){.reader-navigation .start-delay-control{width:130px}}

/* The pencil belongs to the permanent toolbar, including PDF and fullscreen. */
body .reader-controls #quickEditText{display:inline-flex;order:-1;align-items:center;justify-content:center;gap:6px;width:44px;min-width:44px;min-height:44px;padding-inline:0;flex:none;color:var(--blue)}
body .reader-controls #quickEditText span{display:none}
body .reader-controls #quickEditText svg{width:21px;height:21px}
@media(min-width:1000px){body #mobileSettings #mobileEdit{display:none!important}}
@media(max-width:999px){
 body .reader-controls .mobile-dock{justify-content:flex-start;overflow-x:auto;scrollbar-width:thin}
 body .reader-controls #quickEditText{position:sticky;left:0;z-index:1;background:var(--surface);padding:6px 10px}
}

/* A song stays readable while editing. Source directives remain in the model. */
.quick-text-dialog{width:min(1000px,96vw);max-height:92dvh}
.quick-text-dialog[open]{display:flex;flex-direction:column}
#quickTextForm{min-height:0;display:flex;flex-direction:column;overflow:hidden}
#quickTextForm>.dialog-header,#quickTextForm>.dialog-footer{flex:none}
#quickTextForm>.quick-text-content{min-height:0;overflow-y:auto;padding-bottom:22px}
.song-edit-settings{display:flex;align-items:flex-end;gap:16px}
.song-edit-settings label{display:flex;flex-direction:column;gap:5px;font-size:14px;font-weight:600}
.song-edit-settings label:first-child{flex:1}.song-edit-settings input,.song-edit-settings select{font-size:17px;min-height:44px;max-width:100%}
.song-edit-section{margin:22px 0 0}.song-edit-section h3{font-size:16px;color:var(--blue);margin:0 0 10px}
.song-edit-row{border:1px solid transparent;border-radius:9px;margin:3px 0}
.song-edit-row:hover{border-color:var(--border)}.song-edit-row.is-editing{border-color:var(--blue);background:var(--subtle)}
button.song-edit-preview{display:block;width:100%;text-align:left;white-space:normal;overflow-x:auto;background:transparent;border:0;border-radius:8px;padding:12px 10px;cursor:text;color:var(--text);font-weight:400}
.song-edit-preview:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.song-edit-preview .lyrics,.song-edit-preview .instrumental-progression{font-size:22px;line-height:1.5;letter-spacing:0}
.song-edit-preview .lyric-line{margin-bottom:0}.song-edit-preview .printed-beat{background:var(--surface);border-radius:3px;padding:0 2px}
.song-edit-fields{padding:8px 14px 14px;display:flex;flex-direction:column;gap:6px}
.song-edit-fields label,.song-edit-label{font-size:13px;font-weight:600}
#songEditLyric{font-size:20px;line-height:1.5;font-family:inherit;width:100%;min-height:70px;resize:vertical;padding:10px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:7px}
.song-edit-chords{margin-top:9px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.song-edit-chords small{color:var(--muted);font-size:12px}.song-edit-chord{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:7px}
.song-edit-chord input{width:88px;font-size:18px;font-weight:600;color:var(--blue)}.song-edit-chord select{max-width:260px;font-size:14px;flex:1}
.song-edit-chord [aria-invalid=true]{border-color:#b42318;outline:1px solid #b42318}
.song-edit-row-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.song-edit-row-actions .primary{margin-left:auto}
.empty-edit-line{font-size:18px;color:var(--muted)}
.song-edit-row:has(.lyrics) .lyric-line{white-space:normal}
body #stage .intact-word,.song-edit-preview .intact-word,.analysis-section .intact-word,#sectionEditPreview .intact-word{display:inline-flex;flex-direction:row;align-items:flex-start;white-space:pre;vertical-align:top}
.song-edit-preview .chord:not(.number){font-size:1em;line-height:1.15;min-height:1.15em}
.reader-songs-dialog{width:min(640px,96vw);height:min(720px,90dvh)}
.reader-songs-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
.reader-songs-dialog .dialog-header,.reader-songs-dialog .dialog-footer{flex:none}
.reader-song-filters{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px 24px 4px}
.reader-song-filters label{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:600;min-width:0}
.reader-song-filters input,.reader-song-filters select{width:100%;min-height:44px;font-size:16px}
.reader-song-count{margin:12px 24px;color:var(--muted);font-size:14px}
#readerSongList{flex:1;min-height:0;overflow-y:auto;padding:0 12px 16px}
#readerSongList>button{display:flex;align-items:center;gap:12px;width:100%;min-height:55px;text-align:left;white-space:normal;padding:12px;border:1px solid transparent;border-radius:8px;font-size:18px}
#readerSongList>button:hover{background:var(--subtle)}
#readerSongList>button[aria-current=true]{border-color:var(--blue);background:var(--blue-soft)}
.reader-song-number{min-width:28px;font-size:14px;color:var(--muted);text-align:center}
#readerSongList small{margin-left:auto;white-space:nowrap;font-size:12px;color:var(--blue)}
.reader-song-help{font-size:14px;color:var(--muted);line-height:1.5}
/* The import preview uses the same renderer as the reader. */
#editorDialog>.editor-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
#editorDialog .source-side,#editorDialog .analysis-side{min-height:0;overflow-y:auto;padding:18px 20px}
#editorDialog .analysis-side:has(#analysisResult:empty){display:block}
#editorDialog .analysis-section .lyrics,#editorDialog .analysis-section .instrumental-progression{font-size:20px;line-height:1.5}
#editorDialog .analysis-section{overflow-x:auto}
@media(max-width:740px){#editorDialog>.editor-grid{display:block}#editorDialog .source-side,#editorDialog .analysis-side{overflow:visible}.reader-song-filters{padding-inline:16px;grid-template-columns:1fr}.reader-songs-dialog .dialog-header{padding:16px}.reader-songs-dialog .dialog-footer{padding:12px 16px}}
@media(max-width:600px){.quick-text-content{padding-inline:12px}.song-edit-settings{flex-wrap:wrap;gap:10px}.song-edit-settings label:first-child{flex-basis:100%}.song-edit-preview .lyrics,.song-edit-preview .instrumental-progression{font-size:19px}.song-edit-chord select{max-width:210px}.song-edit-fields{padding-inline:8px}}

/* Keep preparation time available alongside reader navigation, including fullscreen. */
.reader-navigation .start-delay-control{line-height:1.35}
.reader-navigation .start-delay-control small{font-size:12px;line-height:1.4;white-space:normal}
@media(max-width:999px){.reader-navigation .start-delay-control{min-width:150px;white-space:normal;gap:4px}.reader-navigation .start-delay-control input{min-height:44px;font-size:16px}}

.whole-song-editor{min-height:45vh;padding:22px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font-family:inherit;font-size:22px;line-height:2.2;white-space:pre-wrap;overflow-wrap:break-word;outline:none;cursor:text}
.whole-song-editor:focus{border-color:var(--blue);box-shadow:0 0 0 2px var(--blue-soft)}
.whole-song-editor{line-height:3.1;padding-top:46px}
.whole-song-editor .editor-notation{display:inline-block;position:relative;width:0;height:0;color:var(--blue);font-weight:700;font-size:.8em;vertical-align:baseline;line-height:1.2;white-space:nowrap;user-select:none}
.editor-notation-label{position:absolute;left:0;bottom:1.1em;min-width:1em;border-radius:4px;padding:2px 3px;margin-left:-3px;cursor:pointer}
.editor-notation[data-notation^="beat:"] .editor-notation-label{bottom:.4em;font-size:.7em;pointer-events:none}
.editor-notation:has(+[data-notation^="beat:"]) .editor-notation-label,.editor-notation[data-notation^="beat:"]+[data-notation] .editor-notation-label{bottom:1.5em}
.editor-notation.selected-notation .editor-notation-label,.editor-notation:focus-within .editor-notation-label{background:var(--blue);color:#fff;outline:2px solid var(--blue);outline-offset:2px}
.whole-song-editor .editor-bar{width:auto;height:auto;font-size:1em;color:var(--text);font-weight:400}
.editor-bar .editor-notation-label{position:static;padding:0;margin:0;cursor:text}
.song-notation-toolbar{position:sticky;top:0;z-index:2;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px;margin:12px 0}
.song-chord-input,.song-notation-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.song-chord-input label{font-weight:700;font-size:14px}.song-chord-input input{width:165px;min-height:40px}
.song-notation-actions{margin-top:8px}.song-notation-actions button{font-size:12px;padding:7px 10px}
.song-notation-toolbar p{margin:8px 0 0;font-size:12px}.song-edit-legend{font-size:12px!important;color:var(--muted)}.chord-example{color:var(--blue);font-weight:700}
@media(max-width:600px){.whole-song-editor{padding:14px;font-size:20px}}

/* Playback color describes the current state; button text describes the action. */
body button[data-scroll-state="paused"]{background:#2455a4!important;border-color:#2455a4!important;color:#fff!important}
body button[data-scroll-state="running"]{background:#16703e!important;border-color:#16703e!important;color:#fff!important}
body button[data-scroll-state="countdown"]{background:#f4c542!important;border-color:#d7a924!important;color:#241c04!important}
body button[data-scroll-state]:hover{filter:brightness(.94)}
body button[data-scroll-state]:focus-visible{outline:3px solid var(--text);outline-offset:3px}

/* Presentation controls belong only to the fullscreen / window-filling reader. */
body:not(.focus-screen) .reader-navigation,
body:not(.focus-screen) .reader-controls,
body:not(.focus-screen) .reading-shell>.center-speed{display:none!important}
body:not(.focus-screen) .reading-shell{padding:0!important}
body .mobile-dock #startNow{order:0;flex:none;min-height:48px;padding:8px 12px;white-space:nowrap}
body .mobile-dock #stopScroll{order:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;min-height:48px;padding:8px 12px;white-space:nowrap;color:var(--red,#b42318);border-color:currentColor}
body.focus-screen .reading-shell{position:relative}
@media(min-width:1000px){body.focus-screen .reader-navigation{top:0;bottom:0;transform:none;overflow-y:auto;justify-content:safe center}}

.transpose-control{flex-wrap:wrap}
.transpose-hint{font-size:12px;font-weight:400;line-height:1.35;color:var(--muted);white-space:normal}
body .transpose-control .tool-label{display:inline}
@media(max-width:740px){.transpose-control .transpose-hint{flex-basis:100%}}

/* Transposition has its own visible row, outside the scrolling navigation rail. */
.transpose-picker{display:flex;align-items:center;gap:5px;min-width:0;max-width:100%}
body .transpose-picker>button{flex:none;width:44px;min-width:44px;min-height:44px;padding:5px;font-size:23px;font-weight:700}
body .transpose-picker>select{flex:1 1 auto;min-width:0;width:145px;max-width:190px;min-height:44px;font-size:16px}
body .transpose-control{gap:8px;padding:5px 8px;border:1px solid var(--border);border-radius:10px;background:var(--surface)}
body .transpose-control .tool-label,body #readerTranspose>label{font-size:16px;font-weight:750;color:var(--blue)}
body .reader-controls{flex-wrap:wrap}
body .reader-controls #readerTranspose{display:flex;flex-flow:row wrap;align-items:center;justify-content:flex-start;gap:8px;flex:1 0 100%;order:-2;width:100%;padding:5px 8px;border-bottom:1px solid var(--border)}
body #readerTranspose .transpose-picker{flex:0 1 auto}
/* Keep the local clock beside the theme toggle at every reader width. */
body .reader-controls .reader-utilities{display:flex;align-items:center;gap:10px;flex:none;order:1;white-space:nowrap}
body .reader-utilities #performanceTheme{width:44px;min-width:44px;min-height:44px;padding:8px;flex:none}
.local-clock{font-size:22px;font-weight:650;line-height:1.2;font-variant-numeric:tabular-nums;color:var(--text)}
@media(min-width:1000px){body .reader-controls .reader-utilities{order:5}}
@media(max-width:540px){
 body #readerTranspose>label{flex:1 0 100%;font-size:14px}
 body #readerTranspose .transpose-picker{width:100%;max-width:320px}
 body #readerTranspose .transpose-hint{flex-basis:100%}
 body .transpose-control{max-width:100%;min-width:0}
}

.song-repeat-control{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:16px}.song-repeat-control select{font:inherit;min-height:40px;max-width:180px}
