/* DRAGON | NEXUS 0.7.24.29: single measured sticky navigation system.
   Visual/layout-only; scene, mark, source, and evidence data are untouched.
   Placed after legacy CSS so no user overrides / !important editing is needed. */
:root{--dg2429-header:50px;--dg2429-dock:0px;--dg2429-tabs:0px}
body>header{top:0!important;margin-bottom:0!important;z-index:160!important}
/* Mode belongs to the v0.7.24.28 compact project strip. Production Tools and
   progress are in page flow, NOT absent phantom layers in the sticky stack. */
#editorPanel #dragonModeSwitcher{position:static!important;top:auto!important;z-index:auto!important}
#editorPanel #dg248WorkspaceTools{position:static!important;top:auto!important;z-index:auto!important;box-shadow:none!important}
#filmPanel .film-progress{position:static!important;top:auto!important;z-index:auto!important;box-shadow:none!important}
/* Two true editing layers: episode selector and the applicable Story/Scene tabs. */
#filmPanel #dg250EpisodeDock{
 position:sticky!important;top:var(--dg2429-header)!important;z-index:159!important;
 margin:0!important;padding:6px 10px!important;gap:10px!important;
 border-radius:0 0 9px 9px!important;box-shadow:0 3px 10px rgba(0,0,0,.2)!important;
 min-height:45px;box-sizing:border-box;flex-wrap:nowrap!important
}
#filmPanel #dg250EpisodeDock[hidden]{display:none!important}
#filmPanel #dg250EpisodeDock label{flex:0 1 225px!important;min-width:0!important;max-width:260px!important;margin:0!important;gap:3px!important}
#filmPanel #dg250EpisodeMirror{min-width:0;width:100%;min-height:30px;padding:4px 8px!important}
#filmPanel #dg250EpisodeDock .dgsb-beat-rail{min-width:0!important;flex:1 1 0!important;flex-wrap:nowrap!important}
#filmPanel .dgnav-tabs{
 position:sticky!important;top:calc(var(--dg2429-header) + var(--dg2429-dock))!important;
 z-index:158!important;box-sizing:border-box;
 margin:0 0 9px!important;padding:5px 7px!important;
 border-radius:0 0 9px 9px!important;
 background:#152940!important;box-shadow:0 4px 12px rgba(0,0,0,.23)!important;
 display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;overflow-y:hidden;
 overscroll-behavior-x:contain;scrollbar-width:thin;max-width:100%;min-height:39px;
}
#filmPanel .dgnav-tabs.dgnav-hide,#filmPanel .dgnav-tabs[hidden]{display:none!important}
#filmPanel .dgnav-tabs button{flex:0 0 auto;min-height:32px;margin:0!important;padding:5px 11px!important;line-height:1.24!important;white-space:nowrap}
html.dg2429-film-active{scroll-padding-top:calc(var(--dg2429-header) + var(--dg2429-dock) + var(--dg2429-tabs) + 12px)}
html.dg2429-film-active #filmPanel :is(h2,h3,h4,[id]){scroll-margin-top:calc(var(--dg2429-header) + var(--dg2429-dock) + var(--dg2429-tabs) + 12px)}
/* Trim the accumulated gaps between compact shell, tools, episode controls and editor. */
body:has(#loggedIn.dg2428-shell:not([hidden])) main{padding-top:4px!important}
#loggedIn.dg2428-shell .dg2428-command{margin-top:0!important;margin-bottom:5px!important;min-height:56px!important;padding-block:7px!important}
#loggedIn.dg2428-shell #editorPanel{margin-top:3px!important;padding-top:6px!important}
#editorPanel .dg2428-editor-head{padding:7px 10px!important;margin-bottom:5px!important}
#editorPanel #dg248WorkspaceTools{margin:4px 0 6px!important;padding:7px 10px!important}
#editorPanel #filmPanel{margin-top:3px!important}
#filmPanel .film-progress{margin:0 0 6px!important}
#filmPanel .film-workspace{margin-top:0!important;padding-top:0!important}
#filmPanel .film-workspace>.film-section-head{margin-top:7px!important;margin-bottom:9px!important;padding-top:0!important}
#filmPanel .film-workspace>.film-section-head :is(h2,h3){margin-top:0!important;margin-bottom:5px!important;line-height:1.25}
#filmPanel .dgnav-route{margin:6px 0 9px!important;padding:8px 11px!important}
#filmPanel .dgnav-tab-help{margin:0 0 8px!important}
#filmPanel #dg250EpisodeDock + .film-workspace{margin-top:0!important}
@media(max-width:700px){
 #filmPanel #dg250EpisodeDock{padding:4px 7px!important;gap:6px!important;min-height:42px}
 #filmPanel #dg250EpisodeDock label{flex:0 0 clamp(118px,44vw,190px)!important;max-width:190px!important;min-width:0!important;font-size:10px!important}
 #filmPanel #dg250EpisodeMirror{font-size:12px!important;padding:4px 5px!important}
 #filmPanel #dg250BeatRail span{font-size:10px!important;padding:4px 6px!important}
 #filmPanel .dgnav-tabs{min-height:38px;padding:4px 5px!important}
 #filmPanel .dgnav-tabs button{font-size:12px!important;padding:5px 9px!important}
 #editorPanel .dg2428-editor-head{padding:6px 8px!important}
}
@media(prefers-reduced-motion:reduce){#filmPanel .dgnav-tabs{scroll-behavior:auto!important}}
