/* Phone workspace: reading first; secondary actions live in two labelled menus. */
.header-menu-actions{display:contents}
body .mobile-only,.mobile-adjustment-label{display:none!important}
@media(max-width:740px){
 body{--mobile-controls-height:114px}
 body .mobile-only{display:flex!important}
 body .mobile-adjustment-label{display:block!important}
 body:not(.focus-screen) .app-header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 8px;padding:6px 8px;min-height:60px}
 body:not(.focus-screen) .header-identity{min-width:0;gap:0}
 body:not(.focus-screen) .app-header .brand{font-size:17px;letter-spacing:.4px}
 body:not(.focus-screen) .app-name{font-size:11px}
 body:not(.focus-screen) .header-book-context{display:none}
 body:not(.focus-screen) .header-actions{grid-column:2;grid-row:1;display:flex;gap:4px;flex-wrap:nowrap}
 body .header-actions #openMyLibrary,body #mobileMainMenu{min-height:44px;padding:6px 8px;font-size:13px;width:auto;white-space:nowrap}
 body .header-menu-actions{display:none}
 body.mobile-menu-open .header-menu-actions{display:flex;position:fixed;z-index:30;top:62px;right:8px;left:8px;max-height:calc(100dvh - 80px);overflow:auto;flex-direction:column;align-items:stretch;gap:8px;padding:12px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 30px #0003}
 body .header-menu-actions .header-views{display:contents}
 body .header-menu-actions button,body .header-menu-actions #newSong,body .header-menu-actions #newSongbook,body .header-menu-actions #uploadSharedSong{width:100%;min-height:44px;justify-content:flex-start;font-size:16px;padding:10px}
 body .header-menu-actions button span{display:inline}
 body:not(.focus-screen) main{padding:6px 8px calc(var(--mobile-controls-height) + env(safe-area-inset-bottom));overflow:hidden;gap:0}
 body.focus-screen main{padding-bottom:calc(var(--mobile-controls-height) + env(safe-area-inset-bottom))!important}
 body .song-top{display:flex;flex-flow:row nowrap;align-items:center;gap:6px;margin:0 0 6px;min-height:48px}
 body .song-heading{flex:1;min-width:0}
 body .song-heading h1{font-size:19px;margin:0;line-height:1.25}
 body .song-heading p{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body .song-heading .eyebrow{display:none}
 body .song-actions{width:auto;flex:none;margin:0}
 body .song-actions>button:not(#fullscreen){display:none!important}
 body .song-actions .fullscreen-primary{min-width:44px;width:44px;min-height:44px;padding:8px}
 body .song-actions .fullscreen-primary>span{display:none}
 body #gg-feedback-host #gg-feedback-launcher{display:none!important}
 body .song-tools,body .site-footer{display:none!important}
 body .number-legend{max-height:64px;overflow:auto;flex-shrink:0}
 body .chord-diagram-panel{max-height:30dvh;overflow-y:auto;flex:0 1 auto}
 body .reading-shell,body:not(.focus-screen) .reading-shell,body.focus-screen .reading-shell{flex:1 1 0;min-height:0;margin:0;padding:0!important;gap:4px}
 body .reader-navigation,body:not(.focus-screen) .reader-navigation{display:flex!important;position:static;transform:none;order:2;flex:0 0 48px;height:48px;width:100%;padding:2px 0;gap:4px;overflow:hidden;box-sizing:border-box}
 body .reader-navigation #readerSongs{flex:1;min-width:90px;width:auto;font-size:13px}
 body .reader-navigation .stanza-navigation{display:flex;flex:2;flex-flow:row nowrap;gap:4px}
 body .reader-navigation .stanza-navigation button{flex:1;min-width:0;width:auto;padding:4px;font-size:12px;min-height:44px}
 body .reader-navigation .reader-song-navigation{display:none}
 body .reader-controls,body:not(.focus-screen) .reader-controls,body.focus-screen .reader-controls{position:fixed;inset:auto 0 0;z-index:12;display:block!important;flex:none;container-type:normal;background:var(--surface);padding:0;border-top:1px solid var(--border);overflow:visible}
 body .reader-controls>.mobile-dock,body.focus-screen .reader-controls>.mobile-dock{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center;gap:4px;margin:0;width:100%;height:calc(60px + env(safe-area-inset-bottom));padding:6px max(4px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));overflow:visible;box-sizing:border-box}
 body .mobile-dock>button,body.focus-screen .mobile-dock>button{min-width:44px;min-height:44px;padding:6px;font-size:13px;flex:none}
 body .mobile-dock #mobilePlay,body.focus-screen .mobile-dock #mobilePlay{flex:1 1 0;min-width:74px;white-space:normal;font-size:12px;line-height:1.25;order:-3}
 body .mobile-dock #stopScroll{order:-2}
 body .mobile-dock #mobileOptions{display:inline-flex}
 body .mobile-dock #quickEditText{width:44px;min-width:44px;justify-content:center}
 body .mobile-dock #quickEditText span{display:none}
 body .mobile-dock #readerReplaceSong,body.focus-screen .mobile-dock #readerFeedback{display:none!important}
 body .mobile-dock #readerFeedback{display:none!important}
 body .mobile-dock #mobileExit{margin-left:0;width:44px;min-width:44px}
 body:not(.focus-screen) .mobile-dock #mobileExit{display:none}
 body #mobileSongActions{flex:1 0 100%;flex-wrap:wrap;gap:8px}
 body #mobileSettings button{min-height:44px}
 body #mobileSettings .start-delay-control{display:flex;flex-direction:column;gap:6px;flex:1 0 100%;font-size:14px}
 body #mobileSettings .start-delay-control span{display:flex;gap:6px}
 body #mobileSettings .start-delay-control input{width:70px;min-height:44px;font-size:16px}
 body #mobileSettings .start-delay-control small{font-size:12px}
 body #mobileSettings #pdfViewLabel:not([hidden]){display:flex;flex-direction:column;gap:6px;flex:1 0 100%;font-size:14px}
 body #mobileSettings select{font-size:16px!important}
 body #mobileSettings .reader-settings-heading{font-size:16px}
 body.mobile-controls-open #mobileSettings.transport{bottom:calc(var(--mobile-controls-height) + 8px + env(safe-area-inset-bottom));max-height:calc(100dvh - var(--mobile-controls-height) - 28px - env(safe-area-inset-bottom));overscroll-behavior:contain}
 body .sidebar{position:fixed;inset:60px auto 60px 0;height:auto;max-height:none;box-shadow:4px 0 24px #0002}
 body #mobileSidebarClose{flex:none;width:100%;margin-bottom:12px}
 body dialog{max-width:calc(100vw - 12px);max-height:calc(100dvh - 16px)}
 body .dialog-header,body .dialog-footer{padding:12px;gap:8px;flex-wrap:wrap}
 body .dialog-header h2{font-size:20px;overflow-wrap:anywhere}
 body .source-side,body .settings-section{padding:12px}
 body .field-row{flex-wrap:wrap}
 body .field-row>label{flex:1 0 100%}
 body input,body textarea{font-size:16px}
}

@media(max-width:740px){
 body #mobileReadingAdjustments {
   display:grid!important;
   grid-template-columns:repeat(2,minmax(0,1fr));
   gap:8px;
   height:54px;
   padding:4px max(6px,env(safe-area-inset-right)) 5px max(6px,env(safe-area-inset-left));
   box-sizing:border-box;
   border-bottom:1px solid var(--border);
 }
 body #mobileReadingAdjustments > div {
   display:grid;
   grid-template-columns:44px minmax(0,1fr) 44px;
   grid-template-rows:18px 26px;
   place-items:center;
   gap:0;
   min-width:0;
   margin:0;
   padding:0;
   border:1px solid var(--border);
   border-radius:10px;
 }
 #mobileReadingAdjustments .stepper {display:contents}
 #mobileReadingAdjustments :is(.mobile-adjustment-label,.performance-font-control > span) {
   grid-area:1 / 2;
   font-size:12px;
   line-height:1;
 }
 #mobileReadingAdjustments output {
   grid-area:2 / 2;
   min-width:0;
   font-size:14px;
   line-height:1;
   font-weight:700;
   font-variant-numeric:tabular-nums;
 }
 body #mobileReadingAdjustments button {
   grid-row:1 / 3;
   justify-content:center;
   width:44px;
   min-width:44px;
   min-height:44px;
   padding:2px;
   border:0;
   border-radius:9px;
   font-size:14px;
 }
 #mobileReadingAdjustments :is(#mobileSlower,#performanceSmaller) {grid-column:1}
 #mobileReadingAdjustments :is(#mobileFaster,#performanceLarger) {grid-column:3}
}
