/* 2.9.1: correctly proportioned switches and predictable touch controls. */
#neon-glow{appearance:none;-webkit-appearance:none;box-sizing:border-box;width:44px;min-width:44px;max-width:44px;height:26px;min-height:26px;max-height:26px;margin:0;padding:0;border:1px solid var(--line);border-radius:999px;display:block;background:var(--line);position:relative;flex:0 0 44px;transition:background-color .2s,border-color .2s}
#neon-glow::after{content:"";position:absolute;width:20px;height:20px;top:50%;left:2px;transform:translateY(-50%);border-radius:50%;background:var(--paper);box-shadow:0 1px 3px #0003;transition:left .2s}
#neon-glow:checked{background:var(--accent);border-color:var(--accent)}
#neon-glow:checked::after{left:20px;background:var(--button-ink)}
.glow-label{min-height:52px;cursor:pointer}.glow-label>span{min-width:0;line-height:1.6}
.theme-toggle svg{width:20px;height:20px;display:block;flex-shrink:0}.theme-toggle{justify-content:center;line-height:1}
.theme-choice-title{display:flex;align-items:center;gap:8px;min-width:0}.theme-choice-title svg{width:20px;height:20px;flex-shrink:0}.theme-choices small{display:block;margin:9px 0 0;line-height:1.5}
.custom-color-control{display:flex!important;align-items:center;gap:12px;margin:0!important;padding:0;flex-shrink:0}.custom-color-control>span{display:none}
.track-selector{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin:0;width:22px;min-height:24px;cursor:pointer}.track-selector input{margin:0}

@media(max-width:560px){
 /* Navigation has its own reserved region, never covering the scroll surface. */
 :root{--mobile-nav-height:calc(76px + env(safe-area-inset-bottom));--mobile-header-height:calc(64px + env(safe-area-inset-top))}
 html,body{height:100%;overflow:hidden}
 body{height:100dvh;min-height:100dvh}
 .main-shell{height:calc(var(--app-height,100dvh) - var(--mobile-nav-height));min-height:0;max-height:calc(var(--app-height,100dvh) - var(--mobile-nav-height));display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:var(--mobile-header-height) auto minmax(0,1fr) auto;overflow:hidden}
 .main-shell>main{grid-column:1;grid-row:3;padding:24px 16px;min-width:0;min-height:0;height:100%;max-height:100%;margin:0;align-self:stretch;max-width:none;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scroll-padding:16px 0 24px;-webkit-overflow-scrolling:touch}
 .sidebar{height:var(--mobile-nav-height);min-height:var(--mobile-nav-height);padding:6px 10px calc(6px + env(safe-area-inset-bottom));top:auto;bottom:0;z-index:30}
 .sidebar nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:6px}
 .sidebar .nav-item{min-width:0;width:100%;min-height:58px;margin:0;padding:8px 4px;line-height:1.5;justify-content:center;font-size:10px;border:1px solid transparent}
 .sidebar .nav-item.active{border-color:var(--accent-line)}
 .topbar{height:var(--mobile-header-height);min-height:var(--mobile-header-height);padding:env(safe-area-inset-top) 16px 0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;position:relative;top:auto;z-index:20;grid-column:1;grid-row:1}
 .breadcrumb{font-size:0;min-width:0;overflow:hidden;white-space:nowrap}.breadcrumb>span{display:none}.breadcrumb>strong{font-size:12px;display:block;overflow:hidden;text-overflow:ellipsis}
 .topbar-right{gap:10px;min-width:0}.topbar .theme-toggle{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;display:grid;place-items:center;border-radius:10px}.topbar .theme-toggle span{display:none}.topbar .theme-toggle svg{width:22px;height:22px}
 .topbar .subtle-button{min-height:44px;gap:6px;font-size:10px;max-width:156px;white-space:normal;line-height:1.5;text-align:right;justify-content:flex-end}
 /* Fixed dimensions, no flex-wrapping checkmarks or cramped text. */
 .download-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.download-tabs button{min-width:0;gap:8px}.download-tabs button>span:not(.tab-index){min-width:0;overflow-wrap:anywhere}
 .mode-switch{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.mode-switch button{display:grid;grid-template-columns:minmax(0,1fr) 20px;grid-template-rows:32px auto;gap:12px 6px;min-width:0;min-height:120px;padding:14px 12px;align-content:start;align-items:start;transform:none}
 .mode-switch .mode-icon{grid-column:1;grid-row:1;width:32px;height:32px}.mode-switch .mode-check{grid-column:2;grid-row:1;width:18px;height:18px;margin:0;align-self:center;justify-self:end}.mode-switch .mode-copy{grid-column:1/-1;grid-row:2;width:auto;min-width:0;order:initial;gap:6px}.mode-copy strong{font-size:14px;line-height:1.2}.mode-copy small{font-size:10px;line-height:1.5;overflow-wrap:anywhere}
 .theme-choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.theme-choices button{min-width:0;min-height:80px;padding:12px 10px}.theme-choice-title{gap:6px;font-size:13px}.theme-choices small{font-size:10px;margin-top:8px}
 .accent-controls{display:flex;flex-wrap:wrap;gap:12px;max-width:100%}.accent-swatches{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;flex:0 0 100%;width:100%}.accent-swatches button{width:100%;height:44px;min-height:44px;border-radius:8px;margin:0}.appearance-panel .custom-color-control{width:100%;max-width:100%;justify-content:space-between;min-height:44px}.custom-color-control>span{display:block;font-size:12px;color:var(--muted)}#accent-picker{width:48px;min-width:48px;height:44px;min-height:44px;margin:0}
 .track-selector{width:44px;min-height:44px}.library-track{column-gap:8px}.music-tools label,.group-select label{min-height:44px}.collection-footer{gap:4px 12px}.collection-footer .text-button{min-height:44px;white-space:normal;line-height:1.6}.job-actions{gap:6px 14px}.job-actions button,.job-actions a{min-height:44px;white-space:normal;line-height:1.5}
 .bulk-bar{position:static;bottom:auto;z-index:auto;margin:16px 0 12px;width:100%;min-width:0}.bulk-bar>div{min-width:0;flex:1 1 160px}.bulk-bar .primary{white-space:normal;line-height:1.5}
 /* Notifications participate in layout, rather than obscuring controls. */
 .main-shell>#toast{grid-column:1;grid-row:2;max-height:96px;overflow-y:auto;position:static;transform:none;translate:none;left:auto;right:auto;bottom:auto;width:auto;max-width:none;flex-shrink:0;margin:10px 16px 0;padding:12px 14px;font-size:12px;line-height:1.7;overflow-wrap:anywhere;z-index:auto}
 dialog{max-height:calc(var(--app-height,100dvh) - 24px);overflow-y:auto;overscroll-behavior:contain;scroll-padding:16px;inset:12px 12px auto;margin:0 auto;width:calc(100% - 24px);padding:20px 18px}
 #existing-dialog,#details-dialog,#delete-dialog{max-height:calc(var(--app-height,100dvh) - 24px);width:calc(100% - 24px);padding:20px 18px}dialog h2{font-size:24px;line-height:1.25;overflow-wrap:anywhere}
 dialog>.dialog-close{position:sticky;float:right;top:0;right:auto;margin:0 0 8px 8px;width:44px;height:44px;min-width:44px;min-height:44px;z-index:3;border:1px solid var(--line);border-radius:8px;background:var(--paper)}
 #existing-dialog>h2{padding-right:0}#details-dialog #job-details{clear:both;overflow-wrap:anywhere}#auth-dialog{inset:0;height:var(--app-height,100dvh);max-height:var(--app-height,100dvh);width:100%;margin:0;border:0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);border-radius:0}
 #auth-dialog .dialog-close{position:fixed;top:calc(10px + env(safe-area-inset-top));right:12px;left:auto;float:none;margin:0;width:44px;height:44px}.onboarding-form{padding-top:58px}.onboarding-form>.eyebrow{padding-right:24px}
 .delete-dialog-actions{gap:16px;flex-wrap:wrap}.delete-dialog-actions button{min-height:44px}
 .main-shell>main>.page,.main-shell>main>.guest-policy{flex-shrink:0}
 .main-shell>.bulk-bar{grid-column:1;grid-row:4;align-self:end;width:calc(100% - 32px);margin:8px 16px 12px;max-height:190px;overflow-y:auto}
 body:not([data-page=library]) .main-shell>.bulk-bar,body.keyboard-open .main-shell>.bulk-bar{display:none}
 body.keyboard-open .sidebar{display:none}body.keyboard-open .main-shell{height:var(--app-height,100dvh);max-height:var(--app-height,100dvh)}
}
@media(prefers-reduced-motion:reduce){#neon-glow,#neon-glow::after{transition:none}}
@media(max-width:560px) and (max-height:600px){
 .main-shell>.bulk-bar{flex-wrap:nowrap;gap:8px;padding:8px 10px;max-height:80px;margin-top:6px;margin-bottom:6px}.main-shell>.bulk-bar>div{flex:1;min-width:0}.main-shell>.bulk-bar small{display:none}.main-shell>.bulk-bar strong{font-size:10px;line-height:1.5}.main-shell>.bulk-bar .primary{width:auto;max-width:115px;margin-top:0;padding:9px;font-size:10px;gap:5px}.main-shell>#toast{max-height:64px}
}
/* Modal headers reserve their own space; close controls never float over text. */
.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-shrink:0;margin-bottom:14px;min-width:0}.dialog-heading h2{margin:4px 0;min-width:0;overflow-wrap:anywhere}.dialog-heading .dialog-close{position:static;float:none;flex:0 0 44px;width:44px;height:44px;min-height:44px;margin:0;border:1px solid var(--line);border-radius:8px;background:var(--paper)}
@media(max-width:560px){
 #existing-dialog[open],#details-dialog[open],#delete-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
 .dialog-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:0 1 auto;scroll-padding:12px}
 .dialog-heading{gap:12px;margin-bottom:12px}.dialog-heading h2{font-size:23px;line-height:1.3}#details-dialog #job-details{clear:none;max-height:none}
 #auth-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
 #auth-dialog .dialog-close{position:static;align-self:flex-end;flex:0 0 44px;float:none;width:44px;height:44px;margin:10px 12px 0}
 #auth-dialog .onboarding-layout{flex:1;display:block;min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding:16px}
 #auth-dialog .onboarding-form{padding-top:24px;margin:0 auto}
}
@media(max-width:560px){.mode-switch button:hover:not(:disabled){transform:none}}

/* The expanded network list must wrap at intermediate desktop/tablet widths too. */
.providers{flex-wrap:wrap;row-gap:14px}
.providers>.provider{flex:0 0 auto}
