/* In-flow reading utilities; no homepage or core-page selector. */
body.cp-page[data-resource-print] .jrc-motion-slot {
  margin-block: 18px 0;
  min-inline-size: 0;
  min-block-size: 54px;
}

body.cp-page[data-resource-print] :is(.jpc-controls, .jrc-motion-reserve) {
  position: static;
  inset: auto;
  z-index: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  inline-size: fit-content;
  max-inline-size: 100%;
  margin: 0;
  padding: 4px;
  border: 1px solid #edc13645;
  border-radius: 26px;
  background: #090a18ed;
  box-shadow: 0 8px 30px #0004;
}

body.cp-page[data-resource-print] .jpc-controls > button,
body.cp-page[data-resource-print] .jrc-motion-reserve > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 0;
  min-block-size: 44px;
  max-inline-size: 100%;
  margin: 0;
  padding: 8px 11px;
  border: 0;
  border-radius: 22px;
  font: 600 14px/1.4 var(--sans);
  color: #f0ece0;
  background: transparent;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}

body.cp-page[data-resource-print] .jrc-motion-reserve {
  visibility: hidden;
  pointer-events: none;
}

/* Preserve the existing gold hover feedback without overriding system colors. */
@media (forced-colors: none) {
  body.cp-page[data-resource-print] .jpc-controls > button:hover {
    color: #edc136;
    background: #edc13618;
  }
}

/* If the adapter fails, the original buttons remain usable after the footer,
   in normal flow. Their fixed-position fallback must never cover the article. */
body.cp-page[data-resource-print] > .jpc-controls {
  margin: 18px;
  max-inline-size: calc(100% - 36px);
}

@media (forced-colors: active) {
  body.cp-page[data-resource-print] .jpc-controls {
    border-color: CanvasText;
    color: CanvasText;
    background: Canvas;
    box-shadow: none;
  }
  body.cp-page[data-resource-print] .jpc-controls > button {
    color: ButtonText;
    background: ButtonFace;
  }
}

@media print {
  body.cp-page[data-resource-print] :is(.jrc-motion-slot, .jpc-controls) {
    display: none !important;
  }
}
