/* One close-control axis across the catalogue and its lower detail sheet.
 * The detail button lives on the catalogue card, outside the clipped reader. */
#home-screen ~ .library-approved-v11:is(#general-library-panel, #weapon-library-panel, #item-library-panel) .library-atlas-card {
  --library-close-inset: 24px;
  --library-main-close-size: 58px;
  --library-detail-close-size: 44px;
}
#home-screen ~ .library-approved-v11:is(#general-library-panel, #weapon-library-panel, #item-library-panel) .library-atlas-card > .daily-reward-close {
  right: var(--library-close-inset) !important;
  width: var(--library-main-close-size) !important;
  height: var(--library-main-close-size) !important;
}
#home-screen ~ .library-approved-v11:is(#general-library-panel, #weapon-library-panel, #item-library-panel) .library-atlas-card.is-detail > .library-detail__close[data-aligned-close] {
  position: absolute !important;
  left: auto !important;
  right: calc(var(--library-close-inset) + (var(--library-main-close-size) - var(--library-detail-close-size)) / 2) !important;
  top: calc(var(--library-detail-start) + 10px) !important;
  width: var(--library-detail-close-size) !important;
  height: var(--library-detail-close-size) !important;
  min-height: var(--library-detail-close-size) !important;
  transform: none !important;
  z-index: 9 !important;
}
/* The reader does not scroll itself. Reserve just one themed scrollbar lane,
 * centred below the fixed close control, instead of two nested gutters. */
#home-screen ~ #general-library-panel.library-approved-v11 .library-atlas-card.is-detail > .general-library-detail {
  scrollbar-gutter: auto !important;
}
#home-screen ~ #general-library-panel.library-approved-v11 .general-detail__scroll-content {
  margin-right: 5px !important;
  padding-right: 16px !important;
  scrollbar-width: auto !important;
  scrollbar-color: auto !important;
  scrollbar-gutter: stable !important;
}
#home-screen ~ #general-library-panel.library-approved-v11 .general-detail__scroll-content::-webkit-scrollbar {
  width: 10px !important;
}
#home-screen ~ #general-library-panel.library-approved-v11 .general-detail__scroll-content::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
#home-screen ~ #general-library-panel.library-approved-v11 .general-detail__scroll-content::-webkit-scrollbar-track {
  margin-top: 48px !important;
  margin-bottom: 8px !important;
  background: transparent !important;
  border: 0 !important;
}
#home-screen ~ #general-library-panel.library-approved-v11 .general-detail__scroll-content::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #7e5834, #b58a53 48%, #7e5834) !important;
  border: 2px solid transparent !important;
  background-clip: padding-box !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
/* Weapon and item readers reserve a header row for their close key and start
   the illustration below it. Their content is intentionally lower than the
   compact general sheet. */
#home-screen ~ .library-approved-v11:is(#weapon-library-panel, #item-library-panel) .library-atlas-card.is-detail > .library-detail:not(.is-hidden) {
  padding-top: 66px !important;
  box-sizing: border-box !important;
}
/* General details are a separate, compact sheet: move the full identity and
   stats upward while keeping the close key at the sheet's upper-left edge. */
#home-screen ~ #general-library-panel.library-approved-v11 .library-atlas-card.is-detail > .general-library-detail:not(.is-hidden) {
  padding-top: 36px !important;
  box-sizing: border-box !important;
}
/* Ownership is visible even when the item is not equipped. Keep the existing
 * equipped treatment and wording, and leave unpurchased badges unchanged. */
#home-screen ~ #item-library-panel.library-approved-v11 .item-atlas-entry.is-owned:not(.is-equipped) .item-atlas-entry__status {
  color: #34553c !important;
  background: #e7eddc !important;
  border-color: #6f8d65 !important;
}

