/* One visible header and one window controller per retained document. */
html[data-den-embedded] .den-header,
html[data-den-embedded] .den-header *{visibility:hidden!important;pointer-events:none!important}
html[data-den-embedded] body{padding-bottom:var(--den-player-tray,0px)}
html[data-den-embedded] #den-menu-shade{z-index:220!important}
@media(max-width:1180px){
 html[data-den-embedded] body.den-menu-open :is(#sidebar,#left-rail,.den-cinema-side-rail){z-index:230!important}
}
html[data-den-embedded] [data-den-persistent-surface]{box-sizing:border-box!important;position:fixed!important;z-index:1000!important;right:12px;bottom:calc(12px + var(--den-player-tray,0px));max-width:calc(100% - 16px)!important;max-height:calc(100dvh - 168px)!important;transform:none!important;transition:none!important}
html[data-den-embedded] [data-den-minimized]{visibility:hidden!important;pointer-events:none!important;clip-path:inset(100%)!important}
html[data-den-embedded] .den-persistent-controls{box-sizing:border-box;position:fixed;z-index:1001;height:36px;display:flex;gap:4px;align-items:center;padding:3px 5px;border:1px solid #bd975755;border-radius:9px 9px 0 0;background:#13281f;color:#efe3c7;box-shadow:0 -3px 15px #0002;font:14px Arial,sans-serif}
html[data-den-embedded] .den-persistent-controls[hidden]{display:none!important}
.den-persistent-controls button{box-sizing:border-box;height:28px;min-width:30px;border:1px solid #dcc39544;border-radius:5px;background:#1a3429;color:#efe3c7;cursor:pointer}
.den-persistent-controls .den-persistent-grip{min-width:0;flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:grab;touch-action:none;padding:2px 8px}
.den-persistent-controls button:focus-visible{outline:2px solid #e6bd73}
/* Native media controls stay; old drag/size/popup/close controls yield to the toolbar. */
html[data-den-embedded] #player-dock :is(.player-window-bar,.player-drag-handle){display:none!important}
html[data-den-embedded] .den-cinema-mini-close{display:none!important}
html[data-den-embedded] #player-dock{width:min(580px,calc(100% - 16px))!important;display:grid!important;grid-template-columns:minmax(200px,1fr) 216px!important;min-height:200px!important;overflow:hidden!important}
html[data-den-embedded] #player-dock .player-mini-art{display:none!important}
html[data-den-embedded] #player-dock .player-video{width:100%!important;min-width:200px!important;height:224px!important;min-height:200px!important;aspect-ratio:auto!important;overflow:hidden!important}
html[data-den-embedded] #player-dock .player-video iframe{display:block!important;width:100%!important;height:100%!important;min-width:200px!important;min-height:200px!important;border:0}
html[data-den-embedded] #player-dock .player-info{min-width:0!important;padding:12px!important;max-height:224px!important;overflow:auto!important;justify-content:flex-start!important}
html[data-den-embedded] #player-dock .player-title{margin:0 0 10px!important}
html[data-den-embedded] #player-dock .player-library-controls{padding-right:0!important}
html[data-den-embedded] #player-dock .player-controls{display:flex!important;flex-wrap:wrap;gap:6px!important}
html[data-den-embedded] #player-dock .now-playing-label{display:none!important}
html[data-den-embedded] #player-dock.den-persistent-large{width:min(760px,calc(100% - 16px))!important;grid-template-columns:minmax(200px,1fr) 240px!important}
html[data-den-embedded] #player-dock.den-persistent-large .player-video{height:300px!important}
html[data-den-embedded] #player-dock.den-persistent-large .player-info{max-height:300px!important}
html[data-den-embedded] #player-dock.spotify-active{display:flex!important;flex-direction:column;width:min(430px,calc(100% - 16px))!important;padding-top:0!important;overflow:auto!important}
html[data-den-embedded] #player-dock.spotify-active .player-video{height:auto!important;min-height:152px!important;flex:none!important;overflow:visible!important}
html[data-den-embedded] #player-dock.spotify-active #spotify-player iframe{min-width:0!important;min-height:152px!important;height:152px!important}
html[data-den-embedded] #player-dock.spotify-active #spotify-player[data-collection=true] iframe{height:352px!important;min-height:352px!important}
html[data-den-embedded] .den-floating-video{inset:auto 12px 64px auto;width:min(480px,calc(100% - 16px))!important;height:auto!important;aspect-ratio:auto;background:#0b1713;border-radius:12px;overflow:hidden}
html[data-den-embedded] .den-floating-video .den-floating-video-viewport{position:relative!important;width:100%!important;height:270px!important;min-height:200px!important}
html[data-den-embedded] .den-floating-video iframe{width:100%!important;height:100%!important;min-height:200px!important}
html[data-den-embedded] .den-floating-video.den-persistent-large{width:min(760px,calc(100% - 16px))!important}
html[data-den-embedded] .den-floating-video.den-persistent-large .den-floating-video-viewport{height:min(428px,calc(100dvh - 168px))!important}
html[data-den-embedded] .den-narrator{overflow:auto}
html[data-den-embedded] .den-narrator.den-persistent-large{width:min(560px,calc(100% - 16px))!important}
html[data-den-embedded] body.book-reader{padding-top:76px}
html[data-den-embedded] body.book-reader .reader-bar{top:76px}
#den-navigation-error{position:fixed;top:90px;left:10%;right:10%;z-index:1500;display:flex;gap:12px;align-items:center;justify-content:center;padding:16px;border:1px solid #b5955f;border-radius:12px;background:#13281f;color:#ffe0a7;box-shadow:0 8px 26px #0006}
#den-navigation-error p{margin:0}
#den-navigation-error button{border:1px solid #d8bb7a;border-radius:8px;padding:7px 11px;background:#e0bd73;color:#17231e;font:inherit;font-weight:700;cursor:pointer}
#den-navigation-error button:focus-visible{outline:2px solid #fff1c7;outline-offset:2px}
@media(max-width:700px){
 html[data-den-embedded] [data-den-persistent-surface]{left:8px!important;right:8px!important;top:auto!important;bottom:calc(68px + var(--den-player-tray,0px))!important;width:calc(100% - 16px)!important;max-height:calc(100dvh - 236px)!important}
 html[data-den-embedded] #player-dock,html[data-den-embedded] #player-dock.den-persistent-large{grid-template-columns:minmax(0,1fr)!important;min-height:0!important;overflow:auto!important}
 html[data-den-embedded] #player-dock .player-video,html[data-den-embedded] #player-dock.den-persistent-large .player-video{height:200px!important}
 html[data-den-embedded] #player-dock .player-info{padding:10px!important;max-height:155px!important;overflow:auto!important}
 html[data-den-embedded] .den-floating-video .den-floating-video-viewport{height:200px!important}
 html[data-den-embedded] .den-narrator .nr-body{max-height:calc(100dvh - 300px);overflow:auto}
}
@media(max-height:500px){
 html[data-den-embedded] [data-den-persistent-surface]{top:auto!important;bottom:calc(4px + var(--den-player-tray,0px))!important;max-height:calc(100dvh - 156px)!important;overflow:auto!important}
 html[data-den-embedded] #player-dock,html[data-den-embedded] #player-dock.den-persistent-large{grid-template-columns:minmax(200px,1fr) minmax(165px,216px)!important}
 html[data-den-embedded] #player-dock .player-video,html[data-den-embedded] #player-dock.den-persistent-large .player-video,html[data-den-embedded] .den-floating-video .den-floating-video-viewport{height:200px!important}
 html[data-den-embedded] #player-dock .player-info{max-height:200px!important}
 html[data-den-embedded] .den-narrator .nr-body{max-height:calc(100dvh - 235px)}
}

/* Leave the shared header and the complete window toolbar visible at every size. */
html[data-den-embedded] [data-den-persistent-surface]{max-height:max(40px,calc(100dvh - var(--den-shell-h,134px) - 104px - var(--den-player-tray,0px)))!important}
@media(max-width:700px){html[data-den-embedded] [data-den-persistent-surface]{max-height:max(40px,calc(100dvh - var(--den-shell-h,134px) - 112px - var(--den-player-tray,0px)))!important}}
@media(max-height:500px){html[data-den-embedded] [data-den-persistent-surface]{min-height:0!important;max-height:max(40px,calc(100dvh - var(--den-shell-h,134px) - 48px - var(--den-player-tray,0px)))!important}html[data-den-embedded] #player-dock{min-height:0!important}}
