/* The full-size viewer has its own viewport/top layer; dossier navigation cannot overlap it. */
#codexExpandedViewer {
  position:fixed; inset:0; margin:0; padding:0; border:0;
  width:100vw; height:100dvh; max-width:none; max-height:none;
  box-sizing:border-box; background:var(--bg,#0d1012); color:var(--ink,#eef1f2);
  overflow:hidden;
}
#codexExpandedViewer[open] { display:block; }
#codexExpandedViewer > .visual.image-expanded {
  position:static; inset:auto; width:100%; height:100%; min-height:0;
  box-sizing:border-box; display:grid; grid-template-rows:minmax(0,1fr) auto auto auto;
  gap:0; padding:clamp(6px,1.55vh,16px) clamp(10px,2.25vw,38px);
  padding-left:max(clamp(10px,2.25vw,38px),env(safe-area-inset-left)); overflow:auto;
  background:transparent;
}
#codexExpandedViewer .image-viewport {
  display:grid; grid-template-rows:minmax(0,1fr) auto auto;
  height:100%; min-height:0; min-width:0; gap:3px;
}
#codexExpandedViewer #stage { height:auto; min-height:0; max-height:none; align-self:stretch; }
#codexExpandedViewer .image-filmstrip { min-width:0; max-height:min(52px,12dvh); }
#codexExpandedViewer .image-filmstrip:empty { display:none; }
#codexExpandedViewer .image-filmstrip button { height:clamp(23px,9dvh,44px); }
#codexExpandedViewer .image-command-line { justify-content:center; flex-wrap:wrap; padding:4px 0; gap:4px 9px; }
#codexExpandedViewer .image-command-line button { padding:3px 6px; }
#codexExpandedViewer :is(details.photo-credit,#adjustPanel) { margin:2px 0 0; padding:3px 0; min-width:0; }
#codexExpandedViewer :is(details.photo-credit,#adjustPanel)[open] { max-height:min(36dvh,170px); overflow:auto; }
#codexExpandedViewer .adjust-toggle, #codexExpandedViewer .adjustment-row { flex-wrap:wrap; gap:4px 8px; margin:2px 0; }
:is(#screen > .object-screen .image-command-line,#codexExpandedViewer .image-command-line) .owner-expand-image {
  position:relative; display:inline-grid; place-items:center; flex:none;
  width:30px; height:30px; padding:0!important;
  border:1px solid color-mix(in srgb,currentColor 52%,transparent);
  border-radius:50%; color:inherit; background:transparent; line-height:1;
}
.owner-expand-image > .owner-expand-glyph { font:600 16px/1 Interface,sans-serif; }
.owner-expand-image[aria-expanded=true] > .owner-expand-glyph { transform:rotate(180deg); }
.owner-expand-image > .owner-expand-tip {
  position:absolute; left:50%; bottom:calc(100% + 5px); transform:translateX(-50%); z-index:20;
  padding:3px 5px; color:#fff5dc; background:#10161bf5; border:1px solid #af9365; border-radius:3px;
  font:500 11px/1.4 Interface,sans-serif; white-space:nowrap; visibility:hidden; pointer-events:none;
}
.owner-expand-image:is(:hover,:focus-visible) > .owner-expand-tip { visibility:visible; }
.owner-expand-image:focus-visible { outline:2px solid #e5bd73; outline-offset:2px; }
