/* PRIME COMIC WINDOW / R1
   The book engine owns sheet geometry, object depth, page turns and gestures.
   This layer is inert hardware chrome only. It cannot cover printed artwork,
   distort image ratios, intercept touches or allocate a second compositor. */
:root{
  --cr-prime-ink:#030609;
  --cr-prime-metal:#d7e0e5;
  --cr-prime-light:#7be7f6;
  --cr-prime-glass:rgba(10,16,22,.82);
  --cr-prime-line:rgba(210,235,244,.20);
}
html,body{max-width:100%;overscroll-behavior:none}
.cr-shell{min-width:0;min-height:0}
.cr-shell>.cr-stage{isolation:isolate}
.cr-shell>.cr-stage>.cr-prime-window-frame{
  position:absolute;
  inset:clamp(7px,1.1vmin,16px);
  z-index:1;
  border:1px solid rgba(168,224,243,.18);
  border-radius:clamp(12px,1.5vw,22px);
  background:
    linear-gradient(120deg,rgba(227,248,255,.045),transparent 16%,transparent 84%,rgba(157,229,255,.035)),
    radial-gradient(ellipse at 50% 0,rgba(123,231,246,.045),transparent 62%);
  box-shadow:
    inset 0 1px 0 rgba(246,252,255,.11),
    inset 0 0 0 3px rgba(2,7,12,.28),
    inset 0 0 0 4px rgba(181,222,238,.055),
    0 0 0 1px rgba(3,8,15,.6);
  pointer-events:none;
  user-select:none;
  contain:paint;
}
.cr-shell>.cr-stage>.cr-prime-window-frame::before,
.cr-shell>.cr-stage>.cr-prime-window-frame::after{
  content:"";
  position:absolute;
  width:clamp(21px,4vw,48px);
  height:clamp(21px,4vw,48px);
  pointer-events:none;
}
.cr-shell>.cr-stage>.cr-prime-window-frame::before{
  top:7px;left:7px;
  border-top:1px solid rgba(180,244,255,.52);
  border-left:1px solid rgba(180,244,255,.35);
  border-radius:6px 0 0 0;
}
.cr-shell>.cr-stage>.cr-prime-window-frame::after{
  right:7px;bottom:7px;
  border-right:1px solid rgba(180,244,255,.35);
  border-bottom:1px solid rgba(180,244,255,.52);
  border-radius:0 0 6px 0;
}
/* Small restrained hardware glow responds to Spatial without altering page
   pixels, perspective, transforms, overlays or the depth/MapMask renderer. */
.cr-shell[data-view="reader"][data-spatial="true"]>.cr-stage>.cr-prime-window-frame{
  border-color:rgba(151,230,249,.33);
  box-shadow:
    inset 0 1px 0 rgba(246,252,255,.13),
    inset 0 0 0 3px rgba(2,7,12,.32),
    inset 0 0 0 4px rgba(181,222,238,.09),
    0 0 18px rgba(83,190,221,.075);
}
.cr-shell[data-view="reader"]>.cr-toolbar:not(.is-dragging){
  border-color:rgba(178,225,240,.35)!important;
  background:
    linear-gradient(160deg,rgba(207,239,249,.14),transparent 22%),
    linear-gradient(180deg,rgba(33,53,67,.96),rgba(6,17,27,.97))!important;
  box-shadow:
    inset 0 1px rgba(247,252,255,.20),
    inset 0 -2px rgba(1,5,10,.6),
    0 9px 27px rgba(0,0,0,.43)!important;
}
/* Uniform Prime control finish; current remote layout/drag and touch targets
   are never rewritten by this file. */
.cr-shell[data-view="reader"]>.cr-toolbar .cr-control:not(:disabled){
  border-color:rgba(157,216,233,.29)!important;
  color:#eaf8fd!important;
}
.cr-shell[data-view="reader"]>.cr-toolbar .cr-control:focus-visible,
.cr-shell :is(.cr-volume-picker select,.cr-navbtn):focus-visible{
  outline:2px solid var(--cr-prime-light)!important;
  outline-offset:2px!important;
}
.cr-shell>.cr-stage>.cr-empty{
  max-width:min(92%,31rem);
  border:1px solid rgba(181,228,241,.21);
  border-radius:clamp(14px,2vw,24px);
  background:
    linear-gradient(145deg,rgba(212,235,244,.065),transparent 38%),
    linear-gradient(155deg,rgba(13,26,36,.94),rgba(3,10,17,.94));
  box-shadow:inset 0 1px rgba(255,255,255,.12),0 18px 46px rgba(0,0,0,.36);
}
/* Embedded Page 06 remains framed inside its Prime portal. Standalone mode
   uses precisely the same sheet and hardware treatment. */
html[data-prime-viewport-embedded="true"],
html[data-prime-viewport-embedded="true"] body{
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  overflow:hidden;
}
@media(max-height:420px){
  .cr-shell>.cr-stage>.cr-prime-window-frame{inset:5px;border-radius:10px}
  .cr-shell>.cr-stage>.cr-prime-window-frame::before,
  .cr-shell>.cr-stage>.cr-prime-window-frame::after{width:16px;height:16px}
}
@media(prefers-reduced-motion:reduce){
  .cr-shell>.cr-stage>.cr-prime-window-frame{animation:none!important;transition:none!important}
}
