/* Viewer only: explicit width prevents aspect-ratio/min-height from widening mobile pages. */
.viewer .stage { width:100%; min-width:0; min-height:0; }
.focus-count, #orientation-hint { display:none; }
body.presentation-open { overflow:hidden; }
.presentation.is-immersive, .presentation.is-immersive:fullscreen {
  position:fixed; inset:0; z-index:100; width:100%; height:100vh; height:100dvh;
  max-width:none; overflow:hidden; background:#000;
}
.is-immersive .viewer-main { position:relative; display:block; width:100%; height:100%; max-width:none; margin:0; padding:0; }
.is-immersive .view-column { position:relative; width:100%; height:100%; min-width:0; }
.is-immersive .stage, .presentation.is-immersive:fullscreen .stage {
  position:absolute; inset:0; width:100%; height:100%; min-height:0; max-height:none;
  aspect-ratio:auto; border:0; border-radius:0; background:#000;
}
.is-immersive .slide-image { width:100%; height:100%; object-fit:contain; background:#000; }
.is-immersive .text-scene { min-height:0; padding:7%; overflow:auto; }
.is-immersive .scene-head, .is-immersive .details, .is-immersive .viewer-footer, .is-immersive .notice { display:none; }
.is-immersive .topbar {
  position:absolute; top:0; left:0; right:0; z-index:30; height:auto; min-height:54px;
  padding:calc(6px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  gap:8px; border:0; background:linear-gradient(#000e,#0009);
}
.is-immersive .topbar .brand, .is-immersive .admin-link { display:none; }
.is-immersive .focus-count { display:block; flex-shrink:0; color:var(--ink); font-size:13px; font-variant-numeric:tabular-nums; }
.is-immersive .top-actions { margin-left:auto; gap:8px; }
.is-immersive .topbar .quiet { min-height:44px; color:var(--ink); font-size:13px; }
.is-immersive .transport {
  position:absolute; left:0; right:0; bottom:0; z-index:20; margin:0;
  padding:14px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background:linear-gradient(#0009,#000f);
}
.is-immersive .transport-main { gap:8px; }
.is-immersive .transport-main > .primary { min-width:112px; }
.is-immersive .mode-group .muted { display:none; }
.is-immersive .seek-row { margin-top:8px; }
.is-immersive #player-status {
  position:absolute; left:12px; bottom:calc(var(--controls-height, 130px) + 4px);
  z-index:21; max-width:min(700px, calc(100% - 24px)); min-height:0;
  margin:0; padding:4px 8px; border-radius:4px; background:#000b; color:#d5ded9; font-size:12px;
}
.is-immersive .chapters {
  position:absolute; top:calc(58px + env(safe-area-inset-top, 0px)); bottom:0; left:0;
  width:min(420px, 100%); max-height:none; z-index:25; padding:18px;
  background:var(--bg); box-shadow:8px 0 40px #0008; overflow-y:auto;
}
.is-immersive .presenter { right:12px; bottom:calc(var(--controls-height, 130px) + 42px); width:21%; }
.is-immersive.controls-hidden .presenter { bottom:12px; }
.is-immersive.controls-hidden .presenter-label { display:none; }
.is-immersive.controls-hidden .topbar,
.is-immersive.controls-hidden .transport,
.is-immersive.controls-hidden #orientation-hint { opacity:0; visibility:hidden; pointer-events:none; }
/* Keep live status announcements available to assistive technology. */
.is-immersive.controls-hidden #player-status { width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); }
@media (max-width:800px) {
  .viewer-main { padding-left:12px; padding-right:12px; }
  .is-immersive .viewer-main { padding:0; }
  .is-immersive .mode-group { order:4; flex-basis:100%; }
  .is-immersive .transport-main > .primary { min-width:110px; }
  .is-immersive .speed-label { font-size:11px; }
}
@media (orientation:portrait) and (max-width:850px) {
  .is-immersive #orientation-hint {
    display:block; position:absolute; z-index:21; top:calc(65px + env(safe-area-inset-top, 0px));
    left:12px; right:12px; margin:0; text-align:center; font-size:12px; color:#bdc8c2;
  }
}
@media (orientation:landscape) and (max-height:550px) {
  .is-immersive .topbar { min-height:48px; padding-top:2px; padding-bottom:2px; }
  .is-immersive .transport { padding-top:7px; padding-bottom:max(5px, env(safe-area-inset-bottom, 0px)); }
  .is-immersive .transport-main { flex-wrap:nowrap; gap:5px; }
  .is-immersive .mode-group { order:0; flex-basis:auto; justify-content:flex-start; }
  .is-immersive .transport-main > .primary { flex:0 1 auto; font-size:13px; }
  .is-immersive .mode-group button, .is-immersive #show-video { font-size:12px; padding-left:7px; padding-right:7px; }
  .is-immersive .seek-row { margin-top:4px; }
  .is-immersive .presenter { min-width:100px; max-width:180px; }
  .is-immersive .presenter video { max-height:100px; }
}
@media (prefers-reduced-motion:no-preference) {
  .is-immersive .topbar, .is-immersive .transport, .is-immersive #orientation-hint { transition:opacity .18s ease; }
}
