/* One compact header in every app view. Layout depends on viewport, never on the current page. */
body .app-shell .topbar{display:flex!important;align-items:center;position:relative;flex:none;z-index:150;height:64px!important;min-height:64px!important;max-height:64px;padding:8px 20px!important;gap:12px!important;border:0;border-bottom:1px solid var(--line);border-radius:0;margin:0;background:var(--bg);box-sizing:border-box}
body .app-shell .topbar .brand{order:1;display:flex;flex:none;gap:7px;font-size:20px;padding:0;white-space:nowrap}
body .app-shell .topbar .brand-mark{width:30px;height:34px;font-size:24px}
body .app-shell .topbar .brand-version{font-size:9px;margin-top:2px}
body .app-shell .topbar .header-back{order:0;flex:none;display:grid;place-items:center;width:36px;min-width:36px;height:40px;padding:0;border:1px solid var(--line);border-radius:10px;background:transparent;color:var(--text);font-size:23px}
body .app-shell .topbar .header-back:disabled{opacity:.3;cursor:default}
body .app-shell .topbar #learnNavBtn{order:2;flex:none;display:inline-flex!important;justify-content:center;align-items:center;min-height:42px;padding:7px 12px;border:1px solid var(--accent-2);border-radius:12px;color:var(--accent-2);background:var(--surface);font-size:13px;font-weight:750;line-height:1.2;white-space:nowrap}
body .app-shell .topbar #learnNavBtn.active{background:var(--accent-2);color:#04121a}
body .app-shell .topbar .nav-actions{order:3;display:flex;align-items:center;justify-content:flex-end;flex:1 1 auto;min-width:0;gap:4px}
body .app-shell .topbar .nav-actions .ghost{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:7px 8px;border:1px solid transparent;border-radius:9px;font-size:12px;white-space:nowrap}
body .app-shell .topbar .nav-actions .ghost.active{border-color:var(--line);background:var(--surface-2);color:var(--accent)}
body .app-shell .topbar .nav-actions .desktop-home{display:none}
body .app-shell .topbar #toolsNavBtn.tools-nav{border:1px solid transparent;border-radius:9px;background:transparent;padding:7px 8px;font-size:12px;gap:4px}
body .app-shell .topbar #toolsNavBtn svg{height:16px;width:16px}
body[data-view] .app-shell .topbar .language-switch{display:flex!important;visibility:visible!important;align-items:center;gap:2px;margin:0;padding:0;border:0;background:transparent;flex:none}
body[data-view] .app-shell .topbar .language-switch button{display:grid;place-items:center;min-width:30px;width:30px;min-height:36px;height:36px;padding:5px;border:1px solid transparent;border-radius:8px;background:transparent;font-size:0}
body[data-view] .app-shell .topbar .language-switch button[aria-pressed="true"]{border-color:var(--accent-2);background:var(--surface-2)}
body .app-shell .topbar .language-flag{width:21px;height:15px}
body .app-shell .topbar #newSongBtn{display:inline-flex;align-items:center;justify-content:center;gap:4px;flex:none;min-height:38px;padding:7px 10px;font-size:12px;white-space:nowrap;border-radius:10px}
body .app-shell .topbar .account-nav{min-width:34px;min-height:36px;padding:6px}
body .app-shell .topbar .account-nav span{display:none}
body .app-shell .topbar .header-menu-toggle{display:none;order:4;flex:none;width:40px;height:40px;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text)}
.header-menu-toggle svg{display:block;width:22px;height:22px}
body .app-shell .topbar #searchToggle,body .song-view #songSearchBtn,body .app-shell .topbar #versionBtn,body .app-shell .topbar .global-search{display:none!important}
/* Navigation now lives in the top menu on every screen. */
body .app-shell .bottom-nav{display:none!important}
body .app-shell main{padding-bottom:0}
.topbar button:focus-visible,.topbar a:focus-visible{outline:3px solid var(--accent-2);outline-offset:2px}
@media(max-width:1200px) and (min-width:1100px){body .app-shell .topbar{gap:7px!important;padding-inline:12px!important}body .app-shell .topbar .brand{font-size:18px}body .app-shell .topbar .nav-actions .ghost{font-size:11px;padding-inline:5px}body .app-shell .topbar #learnNavBtn{font-size:12px;padding-inline:9px}}
@media(max-width:1099px){
 body .app-shell .topbar{height:56px!important;min-height:56px!important;max-height:56px;padding:6px 10px!important;gap:8px!important}
 body .app-shell .topbar .brand{font-size:16px;gap:6px;margin-right:auto}
 body .app-shell .topbar .brand-mark{width:26px;height:30px;font-size:21px}
 body .app-shell .topbar .header-back{width:32px;min-width:32px;height:40px;font-size:22px}
 body .app-shell .topbar #learnNavBtn{width:112px;min-height:40px;white-space:normal;font-size:12px;padding:5px 7px;text-align:center}
 body .app-shell .topbar .header-menu-toggle{display:block}
 body .app-shell .topbar .nav-actions{display:none;position:absolute;left:10px;right:10px;top:calc(100% + 6px);z-index:160;max-height:calc(100vh - 78px);overflow-y:auto;padding:10px;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 16px 40px #0008;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 body .app-shell .topbar.menu-open .nav-actions{display:grid}
 body .app-shell .topbar .nav-actions .ghost,body .app-shell .topbar .nav-actions .desktop-home,body .app-shell .topbar .nav-actions #aboutBtn,body .app-shell .topbar #toolsNavBtn.tools-nav{display:flex;justify-content:flex-start;min-height:44px;font-size:14px;padding:10px;background:var(--surface-2);border-radius:9px}
 body[data-view] .app-shell .topbar .language-switch{justify-content:flex-start;gap:6px;padding-left:4px}
 body[data-view] .app-shell .topbar .language-switch button{width:40px;height:40px}
 body .app-shell .topbar #newSongBtn{min-height:44px;font-size:14px}
 body .app-shell .topbar .account-nav{justify-content:flex-start;padding:10px;min-height:44px}
 body .app-shell .topbar .account-nav span{display:inline;font-size:14px}
 .home-more{display:none!important}
 .song-view .song-heading{padding-top:8px!important}
}
@media(max-width:360px){body .app-shell .topbar{gap:5px!important;padding-inline:7px!important}body .app-shell .topbar .brand{font-size:14px;gap:5px}body .app-shell .topbar .brand-mark{width:23px;height:27px;font-size:19px}body .app-shell .topbar #learnNavBtn{width:100px;font-size:11px}body .app-shell .topbar .header-menu-toggle{width:36px;padding:6px}}
@media print{body .app-shell .topbar{display:none!important}}
body .app-shell .topbar .nav-actions #aboutBtn{display:inline-flex}
/* The global previous-screen control replaces the duplicate arrow in the song heading. */
body .song-view #backBtn{display:none}
body .app-shell .topbar #learnNavBtn{width:158px}
@media(max-width:1200px) and (min-width:1100px){body .app-shell .topbar #learnNavBtn{width:142px}}
@media(max-width:1099px){body .app-shell .topbar #learnNavBtn{width:112px}}
@media(max-width:360px){body .app-shell .topbar #learnNavBtn{width:100px}}
/* Tools and Learning are peers: both remain prominent beside the brand. */
body .app-shell .topbar #toolsNavBtn.tools-nav{order:3;display:inline-flex!important;flex:none;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:7px 12px;border:1px solid var(--accent-2);border-radius:12px;background:#0d343c;color:var(--accent-2);font-size:13px;font-weight:750;white-space:nowrap}
body .app-shell .topbar #toolsNavBtn.tools-nav.active{background:var(--accent-2);color:#04121a}
body .app-shell .topbar #toolsNavBtn.tools-nav svg{width:18px;height:18px;flex:none}
body .app-shell .topbar .nav-actions{order:4}
body .app-shell .topbar .header-menu-toggle{order:5}
@media(max-width:1200px) and (min-width:1100px){body .app-shell .topbar #toolsNavBtn.tools-nav{font-size:11px;padding-inline:8px}}
@media(max-width:1099px){body .app-shell .topbar{gap:6px!important}body .app-shell .topbar #toolsNavBtn.tools-nav{width:40px;min-width:40px;height:40px;min-height:40px;padding:8px}body .app-shell .topbar #toolsNavBtn.tools-nav>span{display:none}body .app-shell .topbar .brand{font-size:15px;gap:5px}}
@media(max-width:374px){body .app-shell .topbar .brand>span:last-child{display:none}body .app-shell .topbar .brand-mark{width:27px;height:31px}}
/* 0.8.79 — clear labels and deliberate sizing, including the mobile popover. */
body .app-shell .topbar #newSongBtn{width:auto;min-width:0;max-width:none;white-space:normal}
body .app-shell .topbar #newSongBtn #addSongLabel{display:block;min-width:0;line-height:1.2}
body .app-shell .topbar #mobileToolsNavBtn{display:none}
@media(max-width:1099px){
 body .app-shell .topbar #toolsNavBtn.tools-nav{display:none!important}
 body .app-shell .topbar .header-menu-toggle{display:flex;align-items:center;justify-content:center;gap:5px;width:72px;min-width:72px;height:44px;min-height:44px;padding:8px;border-color:#70889e;background:#173145;color:#fff1ca;box-shadow:inset 0 1px 0 #ffffff18}
 body .app-shell .topbar .header-menu-toggle svg{width:20px;height:20px;flex:none}
 body .app-shell .topbar .header-menu-toggle span{font-size:11px;font-weight:750}
 body .app-shell .topbar .header-menu-toggle[aria-expanded="true"]{border-color:var(--accent-2);background:#12505a;color:#ecfffb}
 body .app-shell .topbar .nav-actions{padding:12px;gap:8px;border-color:#365b73;border-radius:18px;background:#0b1b2b;box-shadow:0 18px 45px #0009}
 body .app-shell .topbar .nav-actions .ghost,body .app-shell .topbar .nav-actions #aboutBtn{width:100%;justify-content:flex-start;gap:8px;min-height:48px;padding:11px 12px;border:1px solid #263f54;background:#142b3e;color:#eaf3fc;border-radius:11px;text-align:left;font-size:13px;line-height:1.3}
 body .app-shell .topbar .nav-actions .ghost.active{border-color:#3a838d;background:#123943;color:#85fff0}
 body .app-shell .topbar #mobileToolsNavBtn{display:flex;color:#77eee0;border-color:#267f87;background:#0c333e}
 body .app-shell .topbar .nav-actions .desktop-home{order:0}
 body .app-shell .topbar #browseBtn{order:1}body .app-shell .topbar #libraryBtn{order:2}body .app-shell .topbar #setlistsNavBtn{order:3}
 body .app-shell .topbar #mobileToolsNavBtn{order:4}body .app-shell .topbar #aboutBtn{order:5}
 body .app-shell .topbar .account-nav{order:6;width:100%;min-width:0;min-height:48px;border-color:#36536a;background:#102538;gap:8px;font-size:13px}
 body .app-shell .topbar .account-nav span{font-size:13px;line-height:1.2}
 body .app-shell .topbar #newSongBtn{order:7;display:flex;width:100%;min-width:0;min-height:48px;max-width:none;justify-self:stretch;justify-content:center;padding:9px 10px;gap:5px;font-size:13px;overflow:visible;border:1px solid #ffdc85;background:var(--accent);color:#172033}
 body .app-shell .topbar #newSongBtn #addSongLabel{white-space:normal;overflow-wrap:normal}
 body[data-view] .app-shell .topbar .language-switch{order:8;grid-column:1/-1;justify-content:center;padding:7px 0 0;border-top:1px solid #263f54;gap:12px}
 body[data-view] .app-shell .topbar .language-switch button{width:44px;height:40px;border:1px solid #36536a;background:#132b3e}
 body[data-view] .app-shell .topbar .language-switch button[aria-pressed="true"]{border-color:var(--accent-2);background:#0c4249}
 body .app-shell .topbar .brand>span:last-child{display:inline}
}
@media(max-width:360px){body .app-shell .topbar .brand>span:last-child{display:none}}
body .app-shell .topbar #newSongBtn:before{content:none;display:none}
body .app-shell .topbar .menu-item-icon{display:none}
@media(max-width:1099px){body .app-shell .topbar .menu-item-icon{display:block;width:18px;height:18px;flex:none;color:#86c3ce}}
/* 0.8.104: viewport alone controls navigation; search never replaces desktop links. */
body .app-shell .topbar #searchToggle{display:grid!important;place-items:center;order:4;flex:0 0 36px;width:36px;min-width:36px;height:40px;padding:7px;border:1px solid var(--accent-2);border-radius:10px;background:var(--surface);color:var(--accent-2)}
body .app-shell .topbar #searchToggle svg{width:21px;height:21px}
body .app-shell .topbar.search-expanded #globalSearchPanel{display:flex!important;align-items:center;position:absolute;top:calc(100% + 5px);right:10px;left:auto;width:520px;max-width:calc(100vw - 20px);min-width:0;margin:0;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 10px 24px #0006;z-index:180;box-sizing:border-box}
body .app-shell .topbar #globalSearchPanel input{width:100%;min-width:0;height:44px;border:1px solid var(--accent-2);border-radius:9px;background:var(--surface);color:var(--text);padding:8px 36px;font-size:16px}
body .app-shell .topbar #globalSearchPanel .search-icon{position:absolute;left:19px;top:50%;transform:translateY(-50%);color:var(--accent-2);font-size:17px}
body .app-shell .topbar #globalSearchPanel>kbd{position:absolute;right:17px;font-size:10px}
body .app-shell .topbar #globalSearchPanel .search-results{position:absolute;top:calc(100% + 6px);left:0;right:0;max-height:60vh;overflow-y:auto;background:var(--surface);z-index:180}
@media(min-width:1100px){body .app-shell .topbar #headerNavigation{display:flex;position:static;width:auto;max-height:none;overflow:visible;padding:0;border:0;background:transparent;box-shadow:none;flex-wrap:nowrap}body .app-shell .topbar #headerMenuBtn{display:none}}
@media(max-width:599px){
body .app-shell .topbar .brand>span:last-child{display:none}
body .app-shell .topbar #learnNavBtn{width:96px;font-size:11px}
body .app-shell .topbar #headerMenuBtn{width:44px;min-width:44px;padding:9px}
body .app-shell .topbar #headerMenuBtn>span{display:none}
body .app-shell .topbar.search-expanded #globalSearchPanel{left:10px;right:10px;width:auto;max-width:none}
body .app-shell .topbar #globalSearchPanel>kbd{display:none}
}
