/* SIW shared hand-inked grid + restrained gradient; single source for review routes.
   Grid art and scale match the Classic manual's approved vector. No content revision. */
:root{
  --siw-grid-image:url("../assets/grid-manual.svg");
  --siw-grid-size:710px 963px;
  --siw-grid-duration:26s;
}
html{background:#fff}
body.siw-unified-grid{
  position:relative;
  isolation:isolate;
  background:transparent!important;
}
body.siw-unified-grid::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background-image:
    linear-gradient(112deg,rgba(255,255,255,.03),rgba(234,234,234,.30),rgba(255,255,255,.03)),
    var(--siw-grid-image);
  background-repeat:no-repeat,repeat;
  background-size:220% 220%,var(--siw-grid-size);
  background-position:0% 50%,0 0;
  animation:siw-grid-drift var(--siw-grid-duration) ease-in-out infinite alternate;
}
@keyframes siw-grid-drift{
  from{background-position:0% 45%,0 0}
  to{background-position:100% 55%,-86px -116px}
}
/* The outer shell owns a single grid while its same-origin iframe is open.
   Inside the frame, only the page's own paper/panel art remains. */
html.siw-grid-embedded{background:transparent!important}
html.siw-grid-embedded body.siw-unified-grid{background:transparent!important}
html.siw-grid-embedded body.siw-unified-grid::before{display:none!important}
html body.siw-unified-grid .siw-sheet{
  background-image:var(--siw-grid-image)!important;
  background-repeat:repeat!important;
  background-size:var(--siw-grid-size)!important;
}
@media(prefers-reduced-motion:reduce){
  body.siw-unified-grid::before{animation:none;background-position:50% 50%,0 0}
}
@media print{
  body.siw-unified-grid::before{display:none!important}
}


/* Three-entry website Classic Manual: immersive, full-grid reading mode.
   The approved website's 710x963 SVG is the ONE visible background. The
   transparent manual art floats on top instead of showing a second stretched
   paper grid or the old gray PDF surround. Scoped to classic.html?siwPreview=1,
   screen only: Fit Page, standalone QR/manual and US Letter print stay intact. */
@media screen{
  html.siw-preview-manual[data-view="width"] body.siw-unified-grid{
    background-color:#fff!important;
    background-image:var(--siw-grid-image)!important;
    background-repeat:repeat!important;
    background-size:var(--siw-grid-size)!important;
    background-position:0 0!important;
    background-attachment:fixed!important;
  }
  html.siw-preview-manual[data-view="width"] main{
    padding:0 0 18px;
    background:transparent;
  }
  html.siw-preview-manual[data-view="width"] .paper{
    width:min(calc(100vw - 16px),1120px);
    max-width:none;
    margin:0 auto 8px;
    background:transparent;
    box-shadow:none;
  }
  /* The same grid is now shared across the FULL viewport and every page. */
  html.siw-preview-manual[data-view="width"] .paper .ink-grid-vector{
    display:none;
  }
  html.siw-preview-manual[data-view="width"] footer{
    background:transparent;
  }
}
