/* Dziedzictwo R40D-R1 — NO REDESIGN.
 * The daytime parchment remains EXACTLY R40/R40A/R40C (no day selectors here).
 * Night readers reuse the SAME R40 transparent artwork, SAME edge shape,
 * SAME 9-slice dimensions and SAME full-height treatment as other cards.
 * Only the colors of the rendered art change; no gradients, masks, fading,
 * new parchment graphics, reader JS, typography, layout or content changes.
 */
body[data-page="story"] .dz-story-reader .dz-story-paper.dz-night,
body[data-page="excerpt"] #reader-stage.is-night .zd-paper {
  position: relative !important;
  isolation: isolate;
  background: transparent !important;
  background-image: none !important;
  background-color: transparent !important;
  border-image: none !important;
  border-radius: 0 !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
  color: #f5e8d5 !important;
}

body[data-page="story"] .dz-story-reader .dz-story-paper.dz-night::before,
body[data-page="excerpt"] #reader-stage.is-night .zd-paper::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: -1 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  pointer-events: none !important;
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 28px solid transparent !important;
  border-image-source: url('/assets/dz-r40-burned-parchment-left.webp') !important;
  border-image-slice: 67 fill !important;
  border-image-width: 28px !important;
  border-image-outset: 0 !important;
  border-image-repeat: stretch round !important;
  /* Original R40 asset, simply darkened. No invented backdrop. */
  filter: brightness(.31) saturate(.71) contrast(1.05) drop-shadow(0 5px 8px rgba(0,0,0,.26)) !important;
}

body[data-page="story"] .dz-story-reader .dz-story-paper.dz-night > *,
body[data-page="excerpt"] #reader-stage.is-night .zd-paper > * {
  position: relative;
  z-index: 1;
}

body[data-page="story"] .dz-story-reader .dz-story-paper.dz-night::after,
body[data-page="excerpt"] #reader-stage.is-night .zd-paper::after {
  content: none !important;
}

@media (max-width: 600px) {
  body[data-page="story"] .dz-story-reader .dz-story-paper.dz-night::before,
  body[data-page="excerpt"] #reader-stage.is-night .zd-paper::before {
    border-width: 20px !important;
    border-image-width: 20px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="story"] .dz-story-reader .dz-story-paper.dz-night::before,
  body[data-page="excerpt"] #reader-stage.is-night .zd-paper::before {
    transition: none !important;
  }
}
