:root {
  --bg: #f6f0eb;
  --bg-2: #fdfaf7;
  --surface: rgba(255, 252, 249, 0.82);
  --surface-strong: #fffdfb;
  --line: rgba(110, 86, 70, 0.16);
  --ink: #2f251d;
  --muted: #6f6258;
  --brand: #9a7a62;
  --brand-dark: #755844;
  --brand-soft: #efe1d5;
  --accent: #d9baa3;
  --shadow: 0 28px 70px rgba(70, 50, 36, 0.16);
  --shadow-soft: 0 16px 44px rgba(70, 50, 36, 0.10);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --header-h: 78px;
  --bargig-logo-url: none;
}


* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  direction: rtl;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(213, 184, 163, 0.32), transparent 26%),
    radial-gradient(circle at bottom left, rgba(219, 198, 180, 0.22), transparent 24%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--header-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(14px, 4vw, 42px);
  background: rgba(250, 245, 239, 0.8);
  border-bottom: 1px solid rgba(255,255,255,0.65);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
img[data-brand-logo="1"],
img[data-wp-logo="1"],
#wpHeaderLogo {
  display: block;
  object-fit: contain;
  background: transparent;
}
.brand-mark {
  width: clamp(98px, 13vw, 154px);
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(67, 48, 34, 0.14));
}
.brand-text strong {
  display: block;
  font-size: 1.12rem;
}
.brand-text small {
  color: var(--muted);
  font-size: .88rem;
}
.top-nav {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  padding-block: 2px;
  scrollbar-width: thin;
}
.top-nav a {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(110, 86, 70, 0.13);
  box-shadow: 0 12px 28px rgba(70, 50, 36, 0.08);
  font-weight: 800;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.top-nav a:hover,
.top-nav a:focus-visible {
  background: rgba(255,255,255,0.94);
  color: var(--ink);
  border-color: rgba(145, 114, 93, 0.24);
  box-shadow: 0 16px 34px rgba(70, 50, 36, 0.12);
  transform: translateY(-1px);
}
.top-nav .category-nav-link {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(239,225,213,0.72));
}
.top-nav .category-nav-link.active,
.top-nav .category-nav-link[aria-current="location"] {
  color: var(--ink);
  border-color: rgba(164, 114, 58, 0.34);
  background: linear-gradient(180deg, rgba(255,247,232,0.96), rgba(235,206,175,0.78));
  box-shadow: 0 12px 28px rgba(94, 67, 42, 0.14);
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 42px) 60px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand-dark);
  font-weight: 800;
  letter-spacing: .04em;
}
.button, .small-button {
  border: 0;
  border-radius: 999px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover, .small-button:hover { transform: translateY(-1px); }
.button:active, .small-button:active { transform: translateY(0); }
.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  font-weight: 800;
}
.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 20px 40px rgba(117, 88, 68, 0.28);
}
.ghost, .soft, .small-button {
  color: var(--brand-dark);
  background: rgba(255,255,255,0.84);
  border: 1px solid var(--line);
}

.panel {
  margin-top: 48px;
  padding: clamp(18px, 3vw, 34px);
  border-radius: var(--radius-xl);
  /* Solid panels are much cheaper to paint while scrolling than a large backdrop blur.
     The page background is static, so this keeps the same soft card look without forcing
     the browser to recalculate a blurred backdrop on every scroll frame. */
  background: rgba(255, 252, 249, 0.94);
  border: 1px solid rgba(255,255,255,0.88);
  box-shadow: 0 25px 80px rgba(62, 45, 34, 0.1);
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}
.section-head h2, .catalog-intro h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3.2rem);
  letter-spacing: -0.04em;
}
.section-note {
  margin: 0;
  max-width: 480px;
  color: var(--muted);
  line-height: 1.7;
}

.catalog-category-list {
  --catalog-category-gap-x: 42px;
  --catalog-card-gap: var(--catalog-category-gap-x);
  --catalog-layout-columns: 3;
  display: grid;
  grid-template-columns: repeat(var(--catalog-layout-columns), minmax(0, 1fr));
  align-items: start;
  gap: var(--catalog-category-gap-x);
  margin-top: 24px;
}
.catalog-category-list > .empty-state {
  grid-column: 1 / -1;
}
.catalog-category-section {
  position: relative;
  min-width: 0;
  grid-column: span var(--category-span, var(--catalog-layout-columns, 3));
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.catalog-category-section::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -12px -14px -16px;
  border: 1px solid transparent;
  border-radius: 26px;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: scale(.988);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.catalog-category-section > * {
  position: relative;
  z-index: 1;
}
.catalog-category-section.is-category-focus::before {
  border-color: rgba(176, 124, 64, 0.38);
  background: linear-gradient(180deg, rgba(255, 244, 222, 0.58), rgba(255, 250, 244, 0.1));
  box-shadow: 0 18px 44px rgba(88, 62, 38, 0.12), inset 0 0 0 1px rgba(255,255,255,0.72);
  opacity: 1;
  transform: scale(1);
}
.catalog-category-section.is-category-focus::before {
  animation: categoryFocusPulse 1.55s ease-out;
}
.catalog-category-section.is-category-focus .catalog-category-head {
  border-bottom-color: rgba(176, 124, 64, 0.34);
}
.catalog-category-section.is-category-focus .catalog-category-head h3 {
  color: var(--brand-dark);
}

@keyframes categoryFocusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(176, 124, 64, 0.26), inset 0 0 0 1px rgba(255,255,255,0.72);
  }
  45% {
    box-shadow: 0 0 0 10px rgba(176, 124, 64, 0.08), 0 18px 44px rgba(88, 62, 38, 0.12), inset 0 0 0 1px rgba(255,255,255,0.72);
  }
  100% {
    box-shadow: 0 18px 44px rgba(88, 62, 38, 0.12), inset 0 0 0 1px rgba(255,255,255,0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-category-section.is-category-focus::before {
    animation: none;
  }
}

.catalog-category-section[data-inline-divider="1"]::after {
  content: "";
  position: absolute;
  inset-block: 3px;
  inset-inline-end: calc(var(--catalog-category-gap-x) / -2);
  width: 1px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(110, 86, 70, 0.28) 18%, rgba(110, 86, 70, 0.16) 82%, transparent);
  pointer-events: none;
}
.catalog-category-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-height: 52px;
  margin-inline-end: auto;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(110, 86, 70, 0.12);
}
.catalog-category-head h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.12;
  font-size: clamp(1.28rem, 1.85vw, 2rem);
  letter-spacing: -0.025em;
}
.catalog-category-section .pill {
  min-height: 32px;
  padding-inline: 10px;
  font-size: .86rem;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--catalog-card-gap, 14px);
  justify-content: start;
  margin-top: 22px;
}
.catalog-category-grid {
  grid-template-columns: repeat(var(--category-span, var(--catalog-layout-columns, 3)), minmax(0, 1fr));
  margin-inline-end: auto;
  margin-top: 16px;
}
.catalog-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(58, 43, 33, 0.085);
  transition: border-color .16s ease, background .16s ease;
}
.catalog-card:hover {
  border-color: rgba(145, 114, 93, 0.26);
}
.catalog-cover {
  width: 100%;
  aspect-ratio: 1.55 / 1;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: linear-gradient(135deg, #ede2d9, #d8c1b0);
}
.catalog-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  flex: 1;
}
.catalog-body h3 {
  margin: 0;
  min-height: calc(1.16rem * 1.28 * 2);
  font-size: 1.16rem;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-body p {
  margin: 0;
  min-height: calc(1em * 1.58 * 2);
  color: var(--muted);
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-meta, .catalog-meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: .9rem;
  font-weight: 700;
}
.catalog-card .catalog-actions { display: flex; gap: 8px; margin-top: auto; }
.catalog-card .button { min-height: 40px; padding-inline: 16px; flex: 1; }


.search-panel {
  margin-bottom: 26px;
}
.search-head {
  align-items: end;
}
.search-box {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 8px;
  border: 1px solid rgba(110, 86, 70, 0.15);
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 16px 40px rgba(57,43,33,0.07);
}
.search-input {
  width: 100%;
  min-height: 48px;
  border: 0;
  outline: 0;
  padding: 0 18px;
  color: var(--ink);
  background: transparent;
}
.search-input::placeholder { color: rgba(111, 98, 88, 0.72); }
.search-status {
  margin: 12px 8px 0;
  color: var(--muted);
  line-height: 1.7;
}
.search-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.search-result-card,
.search-empty {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 14px 34px rgba(57, 43, 33, 0.08);
  overflow: hidden;
}
.search-result-button {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: right;
  transition: transform .18s ease, background .18s ease;
}
.search-result-button:hover {
  transform: translateY(-2px);
  background: rgba(154, 122, 98, 0.07);
}
.search-result-thumb {
  width: 96px;
  height: 122px;
  object-fit: cover;
  border-radius: 14px;
  background: linear-gradient(135deg, #ede2d9, #d8c1b0);
}
.search-result-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding-top: 4px;
}
.search-result-body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}
.search-result-meta {
  color: var(--brand-dark);
  font-weight: 800;
}
.search-result-excerpt {
  color: var(--muted);
  line-height: 1.55;
  font-size: .92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-empty {
  grid-column: 1 / -1;
  padding: 24px;
}
.search-empty strong { display: block; margin-bottom: 8px; font-size: 1.12rem; }
.search-empty p { margin: 0; color: var(--muted); line-height: 1.8; }
.search-empty code {
  direction: ltr;
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(154, 122, 98, 0.12);
}

.last-view-card {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(170px, .56fr) minmax(0, 2.15fr);
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 24px;
  border: 1px solid rgba(110, 86, 70, 0.16);
  color: var(--ink);
  text-align: right;
  font: inherit;
  background:
    radial-gradient(circle at 10% 20%, rgba(199, 155, 112, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(239,225,213,0.62));
  box-shadow: 0 16px 34px rgba(57, 43, 33, 0.09);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.last-view-card.has-last-view:hover,
.last-view-card.has-last-view:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(154, 122, 98, 0.34);
  box-shadow: 0 20px 42px rgba(57, 43, 33, 0.13);
}
.last-view-card:focus-visible {
  outline: 3px solid rgba(154, 122, 98, 0.28);
  outline-offset: 3px;
}
.last-view-card:disabled {
  cursor: default;
  color: rgba(45, 36, 30, 0.82);
  box-shadow: 0 10px 24px rgba(57, 43, 33, 0.06);
}
.last-view-card:disabled:hover {
  transform: none;
}
.last-view-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.last-view-copy strong {
  font-size: 1.05rem;
}
.last-view-copy small {
  color: var(--muted);
  line-height: 1.55;
}
.last-view-details {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(190px, 1.75fr) minmax(128px, .82fr) minmax(190px, 1.08fr);
  gap: 12px;
}
.last-view-detail {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(110, 86, 70, 0.12);
  background: rgba(255,255,255,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}
.last-view-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.last-view-value {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  color: var(--brand-dark);
  font-size: clamp(.94rem, 1vw, 1.02rem);
  font-weight: 900;
}
.last-view-card:not(.has-last-view) .last-view-details {
  display: none;
}
.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(12px, 2vw, 18px);
  align-items: start;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--brand-dark);
  font-weight: 700;
}
.back-link:hover { text-decoration: underline; }
.catalog-description {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 760px;
}
.catalog-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
}
.select-wrap {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .92rem;
}
select {
  min-width: min(360px, 80vw);
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  color: var(--ink);
}
select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(154, 122, 98, 0.22);
  outline-offset: 2px;
}

.detail-catalog-picker {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: min(380px, 100%);
  color: var(--muted);
  font-size: .92rem;
}
.detail-catalog-picker-label {
  font-weight: 800;
}
.detail-catalog-menu-toggle {
  justify-content: space-between;
  gap: 16px;
  min-width: min(380px, 80vw);
  min-height: 46px;
  padding-inline: 18px;
  color: var(--ink);
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}
.detail-catalog-menu-toggle:hover,
.detail-catalog-menu-toggle[aria-expanded="true"] {
  background: #fff;
  border-color: rgba(154, 122, 98, 0.32);
  box-shadow: 0 12px 28px rgba(117, 88, 68, 0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}
.catalog-view-mode-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}
.catalog-view-mode-actions .button {
  min-height: 46px;
}
.catalog-actions-row .button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}
.detail-catalog-menu.reader-catalog-menu {
  top: calc(100% + 10px);
  right: 0;
  width: min(calc(100vw - 32px), 760px);
  max-height: min(480px, calc(100vh - 120px));
  border-color: rgba(110, 86, 70, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255, 249, 244, 0.98));
  box-shadow: 0 24px 68px rgba(62, 45, 34, 0.18), inset 0 1px 0 rgba(255,255,255,0.88);
}
.detail-catalog-menu.reader-catalog-menu::before {
  background: rgba(255,255,255,0.98);
  border-top-color: rgba(110, 86, 70, 0.16);
  border-left-color: rgba(110, 86, 70, 0.16);
}
.detail-catalog-menu .reader-catalog-menu-section + .reader-catalog-menu-section {
  border-top-color: rgba(154, 122, 98, 0.22);
}
.detail-catalog-menu .reader-catalog-menu-category {
  color: var(--muted);
}
.detail-catalog-menu .reader-catalog-menu-category::before,
.detail-catalog-menu .reader-catalog-menu-category::after {
  background: linear-gradient(90deg, transparent, rgba(154, 122, 98, 0.26), transparent);
}
.detail-catalog-menu .reader-catalog-menu-item {
  color: var(--ink);
  border-color: rgba(110, 86, 70, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245, 235, 226, 0.58));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.detail-catalog-menu .reader-catalog-menu-item:hover,
.detail-catalog-menu .reader-catalog-menu-item.active {
  background: linear-gradient(180deg, rgba(236, 219, 204, 0.9), rgba(255,255,255,0.88));
  border-color: rgba(154, 122, 98, 0.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 12px 28px rgba(117, 88, 68, 0.12);
}
.detail-catalog-menu .reader-catalog-menu-item small,
.detail-catalog-menu .reader-catalog-menu-empty {
  color: var(--muted);
}
.detail-catalog-menu .reader-catalog-menu-item.active small {
  color: var(--brand-dark);
}
.catalog-cover-wrap {
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.68));
  padding: 18px;
  border: 1px solid rgba(255,255,255,.96);
  box-shadow: var(--shadow-soft);
}
.catalog-cover-preview {
  width: 100%;
  border-radius: 18px;
  aspect-ratio: 0.85 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, #ebdfd3, #d8c1af);
}
.gallery-toolbar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.gallery-toolbar strong { display: block; font-size: 1.1rem; }
.gallery-toolbar p { margin: 8px 0 0; color: var(--muted); line-height: 1.7; }

.page-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.page-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 12px 28px rgba(57, 43, 33, 0.08);
  transition: border-color .16s ease, background .16s ease;
}
.page-card:hover {
  border-color: rgba(145, 114, 93, 0.24);
}
.page-button {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
}
.page-thumb-wrap {
  position: relative;
  padding: 14px 14px 0;
}
.page-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 0.8 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: linear-gradient(135deg, #ede2d9, #d8c1b0);
  transform: scale(1);
  transition: opacity .28s ease, transform .28s ease;
}
.page-number-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  min-width: 44px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(47, 37, 29, 0.74);
  backdrop-filter: blur(12px);
  font-weight: 800;
}
.page-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
}
.page-card-title { font-weight: 800; }
.page-card-hint { color: var(--muted); font-size: .92rem; }

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: 26px;
  border: 1px dashed rgba(110, 86, 70, 0.28);
  background: rgba(255,255,255,0.58);
}
.empty-state strong { display: block; font-size: 1.4rem; margin-bottom: 10px; }
.empty-state p { margin: 0; color: var(--muted); line-height: 1.8; }
.empty-state code, .site-footer code {
  direction: ltr;
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(154, 122, 98, 0.12);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}


.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #080604;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.04), transparent 42%),
    #070504;
}
.lightbox-dialog {
  position: fixed;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  background: #080604;
  display: block;
  overflow: hidden;
}
/* The unified viewer uses the same top chrome as the former standalone reader. */
.catalog-progress {
  --catalog-progress-ratio: 0;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 36;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  background: rgba(255,255,255,0.13);
  box-shadow: 0 1px 10px rgba(0,0,0,0.18);
}
.catalog-progress-value {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--catalog-progress-ratio));
  transform-origin: right center;
  background: linear-gradient(270deg, rgba(255,255,255,0.94), rgba(217,186,163,0.78));
  transition: transform .22s ease;
}
.lightbox-progress {
  z-index: 36;
}
.reader-progress {
  z-index: 36;
}
.lightbox-top-hotspot {
  z-index: 35;
}
.lightbox-top-shell {
  z-index: 34;
}
.lightbox.show-ui .lightbox-top-shell,
.lightbox-top-hotspot:hover + .lightbox-top-shell,
.lightbox-top-shell:hover,
.lightbox-top-shell:focus-within {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.lightbox.show-ui .lightbox-top-hotspot {
  opacity: 0;
  pointer-events: none;
}
.reader-header.lightbox-reader-header {
  width: 100%;
  grid-template-columns: minmax(190px, 1fr) minmax(220px, 560px) minmax(220px, 1fr);
  justify-content: stretch;
}
.lightbox-actions {
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: visible;
}
.lightbox-actions .reader-button {
  flex: 0 0 auto;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}
.reader-control-icon-button {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0 !important;
  border-radius: 13px;
}
.reader-control-icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.viewer-mode-toggle svg {
  fill: currentColor;
  stroke: none;
}
.viewer-mode-toggle .viewer-mode-icon-single {
  display: none;
  fill: none;
  stroke: currentColor;
}
.viewer-mode-toggle[data-viewer-mode="scroll"] .viewer-mode-icon-scroll {
  display: none;
}
.viewer-mode-toggle[data-viewer-mode="scroll"] .viewer-mode-icon-single {
  display: block;
}
.viewer-fullscreen-toggle .viewer-fullscreen-icon-exit {
  display: none;
}
.viewer-fullscreen-toggle[data-fullscreen-active="true"] {
  background: rgba(217, 186, 163, 0.24) !important;
  border-color: rgba(255,255,255,0.28) !important;
}
.viewer-fullscreen-toggle[data-fullscreen-active="true"] .viewer-fullscreen-icon-enter {
  display: none;
}
.viewer-fullscreen-toggle[data-fullscreen-active="true"] .viewer-fullscreen-icon-exit {
  display: block;
}
.lightbox-actions .viewer-zoom-control,
.lightbox-actions #fitBtn,
.lightbox-actions #fullscreenToggle {
  min-width: 38px;
}
.close-button {
  color: #fff;
  background: rgba(154, 122, 98, 0.82) !important;
  border-color: rgba(255,255,255,0.18) !important;
  font-size: 1.35rem;
  line-height: 1;
}
.lightbox-meta { margin: 0; color: rgba(255,255,255,0.78); }
.lightbox-stage {
  position: fixed;
  inset: 0;
  z-index: 2;
}
.stage-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: block;
  padding: 8px;
  touch-action: none;
  cursor: default;
  border: 0;
  border-radius: 0;
  background: #080604;
  overscroll-behavior: contain;
}
.loading-pill {
  position: fixed;
  top: 18px;
  right: 50%;
  translate: 50% 0;
  z-index: 12;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,0.62);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(12px);
}
.lightbox-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  transform-origin: center center;
  will-change: transform;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 20px 80px rgba(0,0,0,0.45);
  user-select: none;
  cursor: grab;
}
.lightbox.is-zoomed .lightbox-image { cursor: move; }
.lightbox.is-zoomed .stage-canvas { cursor: grab; }
.lightbox.is-zoomed .stage-canvas:active { cursor: grabbing; }
.stage-nav {
  position: fixed;
  z-index: 7;
  top: 50%;
  translate: 0 -50%;
  width: clamp(48px, 5vw, 76px);
  height: clamp(74px, 9vh, 118px);
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,0.34);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1;
  direction: ltr;
  unicode-bidi: isolate;
  box-shadow: none;
  backdrop-filter: blur(10px);
  transition: background .18s ease, opacity .18s ease, transform .18s ease;
}
.stage-nav:hover,
.stage-nav:focus-visible {
  background: rgba(0,0,0,0.62);
  transform: scale(1.04);
}
.stage-nav:disabled {
  opacity: .18;
  cursor: default;
  transform: none;
}
.stage-next { left: clamp(8px, 2vw, 28px); }
.stage-prev { right: clamp(8px, 2vw, 28px); }
.thumbs-hotspot {
  position: fixed;
  z-index: 6;
  right: 0;
  left: 0;
  bottom: 0;
  height: 105px;
}
.lightbox-thumbs {
  position: fixed;
  z-index: 10;
  right: 50%;
  bottom: 14px;
  translate: 50% 16px;
  width: min(1120px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  display: flex;
  direction: rtl;
  gap: 10px;
  overflow-x: auto;
  padding: 10px;
  border-radius: 20px;
  background: rgba(0,0,0,0.56);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 60px rgba(0,0,0,0.42);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, translate .22s ease;
}
.lightbox.show-thumbs .lightbox-thumbs,
.thumbs-hotspot:hover + .lightbox-thumbs,
.lightbox-thumbs:hover,
.lightbox-thumbs:focus-within {
  opacity: 1;
  pointer-events: auto;
  translate: 50% 0;
}
.lightbox-thumb {
  flex: 0 0 clamp(104px, 11vw, 158px);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 5px;
  background: rgba(255,255,255,0.12);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.lightbox-thumb:hover { transform: translateY(-2px); background: rgba(255,255,255,0.2); }
.lightbox-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
}
.lightbox-thumb.active {
  border-color: rgba(255,255,255,0.82);
  background: rgba(154, 122, 98, 0.55);
}
.lightbox-floating-preview {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: 128px;
  width: min(420px, 34vw);
  min-width: min(260px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  padding: 9px;
  border-radius: 22px;
  color: #fff;
  background: rgba(11,9,8,0.88);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 24px 76px rgba(0,0,0,0.52);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px) scale(.96);
  transition: opacity .14s ease, transform .14s ease;
}
.lightbox-floating-preview.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.lightbox-floating-preview img {
  display: block;
  width: 100%;
  max-height: min(58vh, 520px);
  border-radius: 15px;
  object-fit: contain;
  background: #fff;
}
.lightbox-floating-preview span {
  position: absolute;
  top: 18px;
  right: auto;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  min-width: 58px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: .9rem;
  font-weight: 900;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.lightbox-brand-lockup .reader-logo {
  width: clamp(90px, 7.5vw, 116px);
}
.viewer-mode-toggle {
  background: rgba(217, 186, 163, 0.24) !important;
  border-color: rgba(255,255,255,0.28) !important;
}
.lightbox.mode-scroll .viewer-zoom-control {
  display: none;
}
.lightbox-scroll-view {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(10px, 2.5vw, 26px);
  color: #fff;
  background: #080604;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  touch-action: pan-y;
}
.lightbox.mode-scroll .lightbox-scroll-view {
  display: block;
}
.lightbox.mode-scroll .lightbox-stage,
.lightbox.mode-scroll .thumbs-hotspot,
.lightbox.mode-scroll .lightbox-thumbs {
  display: none;
}
.lightbox-scroll-pages {
  display: grid;
  gap: clamp(12px, 2.3vw, 24px);
  justify-items: center;
  padding-block: 8px 28px;
  transform-origin: top left;
  will-change: transform;
}
.lightbox.mode-scroll.is-zoomed .lightbox-scroll-view {
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.lightbox.mode-scroll.is-zoomed .lightbox-scroll-view:active {
  cursor: grabbing;
}
.lightbox.mode-scroll.is-zoomed .lightbox-scroll-pages {
  user-select: none;
}
.lightbox-scroll-page-frame {
  width: min(100%, 1320px);
  margin: 0;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 90px rgba(0,0,0,0.44);
}
.lightbox-scroll-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  background: #fff;
}
.lightbox-scroll-page-hit {
  outline: 4px solid rgba(217, 186, 163, 0.78);
  outline-offset: 5px;
}
.lightbox-side-hotspot {
  position: fixed;
  z-index: 12;
  top: 0;
  right: 0;
  width: 34px;
  height: 100vh;
  display: none;
  place-items: center;
  color: #fff;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.lightbox.mode-scroll .lightbox-side-hotspot {
  display: grid;
}
.lightbox-side-hotspot span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 58px;
  border-radius: 999px 0 0 999px;
  color: rgba(255,255,255,0.88);
  background: rgba(11,9,8,0.68);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 30px rgba(0,0,0,0.36);
  backdrop-filter: blur(14px);
  font-size: 1.25rem;
  line-height: 1;
}
.lightbox-page-rail {
  position: fixed;
  z-index: 13;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: clamp(190px, 16vw, 268px);
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border-radius: 22px;
  color: #fff;
  background: rgba(11,9,8,0.76);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 70px rgba(0,0,0,0.44);
  backdrop-filter: blur(16px);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
  transition: transform .24s ease, opacity .2s ease;
}
.lightbox.mode-scroll .lightbox-page-rail {
  display: grid;
}
.lightbox.show-page-rail .lightbox-page-rail,
.lightbox-page-rail:focus-within {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.lightbox.show-page-rail .lightbox-side-hotspot {
  opacity: 0;
  pointer-events: none;
}
.lightbox-page-rail-title {
  padding-inline: 4px;
  color: rgba(255,255,255,0.76);
  font-size: .84rem;
  font-weight: 900;
  text-align: center;
}
.lightbox-page-thumbs {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 2px 2px 14px 6px;
}
.lightbox-page-thumb {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 8px;
  border-radius: 17px;
  border: 2px solid transparent;
  color: #fff;
  background: rgba(255,255,255,0.12);
  cursor: pointer;
  overflow: visible;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.lightbox-page-thumb:hover,
.lightbox-page-thumb:focus-visible {
  transform: translateX(-3px);
  background: rgba(255,255,255,0.2);
}
.lightbox-page-thumb.active {
  border-color: rgba(255,255,255,0.86);
  background: rgba(154, 122, 98, 0.55);
}
.lightbox-page-thumb-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.lightbox-page-thumb-image-wrap > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.lightbox-page-thumb-number {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: .82rem;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(10px);
}
.lightbox.mode-scroll .lightbox-floating-preview {
  bottom: auto;
  left: auto;
  width: min(440px, 34vw);
  max-width: calc(100vw - 330px);
  transform: translateY(-50%) translateX(16px) scale(.96);
}
.lightbox.mode-scroll .lightbox-floating-preview.visible {
  transform: translateY(-50%) translateX(0) scale(1);
}


.reader-page {
  min-height: 100vh;
  color: #f6f1ec;
  background: #0b0908;
  overflow-x: hidden;
}
.reader-page img { max-width: none; }
.reader-top-hotspot,
.reader-side-hotspot {
  position: fixed;
  z-index: 35;
  display: grid;
  place-items: center;
  color: #fff;
  pointer-events: auto;
}
.reader-top-hotspot {
  top: 0;
  right: 0;
  left: 0;
  height: 34px;
}
.reader-top-hotspot span,
.reader-side-hotspot span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 22px;
  border-radius: 0 0 999px 999px;
  color: rgba(255,255,255,0.88);
  background: rgba(11,9,8,0.68);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 30px rgba(0,0,0,0.36);
  backdrop-filter: blur(14px);
  font-size: 1rem;
  line-height: 1;
}
.reader-top-shell {
  position: fixed;
  z-index: 34;
  top: 0;
  right: 0;
  left: 0;
  overflow: visible;
  transform: translateY(calc(-100% - 8px));
  opacity: 0;
  pointer-events: none;
  transition: transform .24s ease, opacity .2s ease;
}
.reader-top-open .reader-top-shell,
.reader-top-shell:focus-within {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.reader-top-open .reader-top-hotspot {
  opacity: 0;
  pointer-events: none;
}
.reader-header {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(220px, 560px) minmax(120px, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 12px;
  padding: 7px clamp(10px, 2.4vw, 22px);
  background: linear-gradient(180deg, rgba(11,9,8,0.97), rgba(11,9,8,0.88));
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
}
.reader-brand-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  justify-self: start;
}
.reader-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.reader-header-spacer {
  min-width: 0;
}
.reader-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,0.105);
  border: 1px solid rgba(255,255,255,0.16);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 26px rgba(0,0,0,0.16);
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.reader-home {
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  line-height: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.reader-brand-lockup {
  cursor: default;
}
a.reader-brand-lockup,
button.reader-brand-lockup {
  cursor: pointer;
}
.reader-button { cursor: pointer; }
.reader-home:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  opacity: .95;
  transform: none;
}
.reader-button:hover {
  background: rgba(255,255,255,0.17);
  border-color: rgba(255,255,255,0.24);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 14px 32px rgba(0,0,0,0.24);
}
.reader-brand-lockup:hover {
  transform: none;
  opacity: 1;
}
a.reader-home:focus-visible {
  outline: 2px solid rgba(255,255,255,0.88);
  outline-offset: 4px;
}
.reader-home:active,
.reader-button:active {
  transform: translateY(0);
}
.reader-icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0 !important;
  border-radius: 13px;
}
.reader-icon-button svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}
.reader-icon-button-done {
  background: rgba(217, 186, 163, 0.34) !important;
  border-color: rgba(255,255,255,0.34) !important;
}

.site-tooltip {
  position: fixed;
  inset: auto auto auto auto;
  z-index: 9999;
  max-width: min(320px, calc(100vw - 20px));
  padding: 9px 12px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(180deg, rgba(45, 34, 27, 0.97), rgba(26, 21, 18, 0.96));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 18px 42px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.12);
  backdrop-filter: blur(14px);
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(.985);
  transition: opacity .14s ease, transform .14s ease;
}
.site-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.site-tooltip.hidden {
  display: none;
}
.site-tooltip::after {
  content: "";
  position: absolute;
  left: var(--site-tooltip-arrow-x, 50%);
  width: 10px;
  height: 10px;
  background: rgba(26, 21, 18, 0.96);
  border: 1px solid rgba(255,255,255,0.13);
  transform: translateX(-50%) rotate(45deg);
}
.site-tooltip-above::after {
  bottom: -6px;
  border-top: 0;
  border-left: 0;
}
.site-tooltip-below::after {
  top: -6px;
  border-right: 0;
  border-bottom: 0;
  background: rgba(45, 34, 27, 0.97);
}
@media (prefers-reduced-motion: reduce) {
  .site-tooltip { transition: none; }
  .page-thumb,
  .lightbox-image-frame.page-swap-enter {
    animation: none !important;
    opacity: 1;
    transform: none;
    transition: none !important;
  }
  .lightbox-image-frame.page-swap-enter {
    transform: translate(-50%, -50%) translate(var(--single-pan-x, 0), var(--single-pan-y, 0)) scale(var(--single-zoom, 1));
  }
}
.reader-header-search {
  min-width: 0;
  width: 100%;
  max-width: 560px;
  justify-self: center;
  position: relative;
}
.reader-title-wrap {
  min-width: 0;
  text-align: center;
}
.reader-title-wrap strong,
.reader-title-wrap span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(10px, 2.5vw, 26px);
}

.reader-search-box {
  min-width: 0;
  position: relative;
  display: block;
  overflow: visible;
}
.reader-search-field {
  position: relative;
  min-width: 0;
  width: 100%;
}
.reader-search-input {
  width: 100%;
  min-height: 42px;
  padding: 0 16px 0 142px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,0.135), rgba(255,255,255,0.08));
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.reader-search-input::-webkit-search-cancel-button,
.reader-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.reader-search-input::placeholder { color: rgba(255,255,255,0.62); }
.reader-search-input:disabled { opacity: .55; }
.reader-search-field:focus-within .reader-search-input {
  border-color: rgba(217, 186, 163, 0.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 0 3px rgba(217, 186, 163, 0.16);
}

.reader-search-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.reader-search-toolbar .reader-search-box {
  min-width: 0;
}
.reader-catalog-menu-wrap,
.reader-search-scope-wrap {
  position: relative;
  min-width: 0;
}
.reader-catalog-menu-toggle {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0 !important;
  border-radius: 15px;
  color: rgba(255,255,255,0.94);
  background: linear-gradient(180deg, rgba(217, 186, 163, 0.24), rgba(255,255,255,0.09));
  border-color: rgba(217, 186, 163, 0.28);
}
.reader-catalog-menu-toggle:hover,
.reader-catalog-menu-toggle[aria-expanded="true"] {
  background: linear-gradient(180deg, rgba(217, 186, 163, 0.34), rgba(217, 186, 163, 0.16));
  border-color: rgba(217, 186, 163, 0.46);
}
.reader-catalog-menu-toggle svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: currentColor;
}
.reader-search-scope-wrap {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
}
.reader-search-scope-toggle {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 12px;
  gap: 5px;
  white-space: nowrap;
  font-size: .82rem;
  background: rgba(11,9,8,0.42);
  border-color: rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.reader-search-scope-toggle:hover,
.reader-search-scope-toggle[aria-expanded="true"] {
  background: rgba(217, 186, 163, 0.2);
  border-color: rgba(217, 186, 163, 0.34);
  transform: none;
}
.reader-search-scope-toggle span {
  font-size: .9em;
  opacity: .78;
}
.reader-search-scope-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  left: 0;
  width: 190px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(26,22,19,0.97), rgba(10,9,8,0.95));
  box-shadow: 0 20px 54px rgba(0,0,0,0.44), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
}
.reader-search-scope-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 24px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: rgba(26,22,19,0.97);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-left: 1px solid rgba(255,255,255,0.12);
}
.reader-search-scope-menu button {
  position: relative;
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px 0 34px;
  border: 0;
  border-radius: 13px;
  appearance: none;
  -webkit-appearance: none;
  color: rgba(255,255,255,0.9);
  background: transparent;
  font: inherit;
  font-weight: 850;
  text-align: right;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.reader-search-scope-menu button + button {
  margin-top: 4px;
}
.reader-search-scope-menu button::after {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%) scale(.82);
  opacity: 0;
  color: #f0d6bf;
  font-weight: 900;
}
.reader-search-scope-menu button:hover,
.reader-search-scope-menu button.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(217, 186, 163, 0.24), rgba(255,255,255,0.08));
}
.reader-search-scope-menu button.active::after {
  opacity: 1;
}
.reader-catalog-menu {
  position: absolute;
  z-index: 79;
  top: calc(100% + 9px);
  right: 0;
  width: min(calc(100vw - 32px), 780px);
  max-height: min(480px, calc(100vh - 82px));
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(28,24,21,0.98), rgba(9,8,7,0.96));
  box-shadow: 0 24px 68px rgba(0,0,0,0.48), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
}
.reader-catalog-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: rgba(28,24,21,0.98);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-left: 1px solid rgba(255,255,255,0.12);
}
.reader-catalog-menu-section + .reader-catalog-menu-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(217, 186, 163, 0.26);
}
.reader-catalog-menu-category {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 9px;
  color: rgba(255,255,255,0.76);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.reader-catalog-menu-category::before,
.reader-catalog-menu-category::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, transparent, rgba(217, 186, 163, 0.28), transparent);
}
.reader-catalog-menu-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.reader-catalog-menu-item {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  appearance: none;
  -webkit-appearance: none;
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,0.105), rgba(255,255,255,0.055));
  font: inherit;
  text-align: right;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.reader-catalog-menu-item:hover,
.reader-catalog-menu-item.active {
  background: linear-gradient(180deg, rgba(217, 186, 163, 0.26), rgba(217, 186, 163, 0.12));
  border-color: rgba(217, 186, 163, 0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 12px 28px rgba(0,0,0,0.2);
}
.reader-catalog-menu-item:hover {
  transform: translateY(-1px);
}
.reader-catalog-menu-item strong,
.reader-catalog-menu-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-catalog-menu-item strong {
  font-size: .94rem;
}
.reader-catalog-menu-item small,
.reader-catalog-menu-empty {
  color: rgba(255,255,255,0.65);
}
.reader-catalog-menu-item.active small {
  color: rgba(255,255,255,0.78);
}
.reader-catalog-menu-empty {
  padding: 14px;
  text-align: center;
}


.lightbox-search {
  min-width: 0;
}
.lightbox-search .reader-search-box {
  min-width: 0;
}

.reader-search-clear,
.lightbox-search-clear {
  --reader-clear-button-width: 54px;
  position: absolute;
  top: 50%;
  left: calc(-1 * (var(--reader-clear-button-width) + 8px));
  z-index: 5;
  width: var(--reader-clear-button-width);
  min-width: var(--reader-clear-button-width);
  min-height: 40px;
  padding-inline: 0;
  transform: translateY(-50%);
}

.reader-search-clear:hover,
.reader-search-clear:active,
.lightbox-search-clear:hover,
.lightbox-search-clear:active {
  transform: translateY(-50%);
}

.reader-search-results {
  width: min(calc(100% - 24px), 1040px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: min(360px, calc(100vh - 78px));
  overflow: auto;
  margin: 8px auto 12px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background: rgba(11,9,8,0.9);
  box-shadow: 0 18px 55px rgba(0,0,0,0.34);
  backdrop-filter: blur(16px);
}
.reader-search-result,
.reader-search-empty {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.reader-search-result {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px;
  text-align: right;
}
.reader-search-result:hover { background: rgba(255,255,255,0.14); }
.reader-search-result img {
  width: 54px;
  height: 68px;
  border-radius: 9px;
  object-fit: cover;
  background: #fff;
}
.reader-search-result span { min-width: 0; }
.reader-search-result strong { display: block; margin-bottom: 3px; }
.reader-search-result small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: rgba(255,255,255,0.68);
  line-height: 1.45;
}
.reader-search-empty {
  grid-column: 1 / -1;
  padding: 12px 14px;
}
.reader-search-empty strong { display: block; margin-bottom: 3px; }
.reader-search-empty span { color: rgba(255,255,255,0.68); }
.reader-page-frame-hit {
  outline: 4px solid rgba(217, 186, 163, 0.78);
  outline-offset: 5px;
}
.reader-side-hotspot {
  top: 0;
  right: 0;
  width: 34px;
  height: 100vh;
}
.reader-side-hotspot span {
  width: 24px;
  height: 58px;
  border-radius: 999px 0 0 999px;
  font-size: 1.25rem;
}
.reader-page-rail {
  position: fixed;
  z-index: 30;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: clamp(190px, 16vw, 268px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border-radius: 22px;
  color: #fff;
  background: rgba(11,9,8,0.76);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 70px rgba(0,0,0,0.44);
  backdrop-filter: blur(16px);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
  transition: transform .24s ease, opacity .2s ease;
}
.reader-side-open .reader-page-rail,
.reader-page-rail:focus-within {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.reader-side-open .reader-side-hotspot {
  opacity: 0;
  pointer-events: none;
}
.reader-page-rail-title {
  padding-inline: 4px;
  color: rgba(255,255,255,0.76);
  font-size: .84rem;
  font-weight: 900;
  text-align: center;
}
.reader-page-thumbs {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 2px 14px 6px;
}
.reader-page-thumb {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 8px;
  border-radius: 17px;
  border: 2px solid transparent;
  color: #fff;
  background: rgba(255,255,255,0.12);
  cursor: pointer;
  overflow: visible;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.reader-page-thumb:hover,
.reader-page-thumb:focus-visible {
  transform: translateX(-3px);
  background: rgba(255,255,255,0.2);
}
.reader-page-thumb.active {
  border-color: rgba(255,255,255,0.86);
  background: rgba(154, 122, 98, 0.55);
}
.reader-thumb-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.reader-thumb-image-wrap > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.reader-thumb-number {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: .82rem;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(10px);
}
.reader-floating-preview {
  position: fixed;
  z-index: 42;
  top: 50%;
  right: clamp(218px, 19vw, 322px);
  width: min(440px, 34vw);
  max-width: calc(100vw - 330px);
  padding: 9px;
  border-radius: 22px;
  color: #fff;
  background: rgba(11,9,8,0.88);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 24px 76px rgba(0,0,0,0.52);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(16px) scale(.96);
  transition: opacity .14s ease, transform .14s ease;
}
.reader-floating-preview.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}
.reader-floating-preview img {
  display: block;
  width: 100%;
  max-height: min(74vh, 620px);
  border-radius: 15px;
  object-fit: contain;
  background: #fff;
}
.reader-floating-preview span {
  position: absolute;
  top: 18px;
  right: auto;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  min-width: 58px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: .9rem;
  font-weight: 900;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.reader-pages {
  display: grid;
  gap: clamp(12px, 2.3vw, 24px);
  justify-items: center;
}
.reader-page-frame {
  width: min(100%, 1320px);
  margin: 0;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 90px rgba(0,0,0,0.44);
}
.reader-image {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
.reader-empty {
  margin-top: 20vh;
  padding: 22px 26px;
  border-radius: 20px;
  color: #fff;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
}


/* Embedded Bargig branding */
.catalog-image-frame,
.catalog-cover-frame,
.page-thumb-wrap,
.catalog-cover-wrap,
.search-result-thumb-frame,
.lightbox-image-frame,
.lightbox-thumb,
.lightbox-scroll-page-frame,
.lightbox-page-thumb-frame,
.reader-page-frame,
.reader-page-thumb-frame,
.reader-search-thumb-frame {
  position: relative;
}

.has-bargig-logo .catalog-image-frame::after,
.has-bargig-logo .catalog-cover-wrap::after,
.has-bargig-logo .page-thumb-wrap::after,
.has-bargig-logo .lightbox-image-frame::after,
.has-bargig-logo .lightbox-thumb::after,
.has-bargig-logo .lightbox-scroll-page-frame::after,
.has-bargig-logo .lightbox-page-thumb-frame::after,
.has-bargig-logo .reader-page-frame::after,
.has-bargig-logo .reader-page-thumb-frame::after,
.has-bargig-logo .reader-search-thumb-frame::after,
.has-bargig-logo .search-result-thumb-frame::after {
  content: "";
  position: absolute;
  top: clamp(8px, 2.2%, 18px);
  left: 50%;
  right: auto;
  z-index: 6;
  width: clamp(58px, 16%, 138px);
  aspect-ratio: 786 / 317;
  background: var(--bargig-logo-url) center / contain no-repeat;
  pointer-events: none;
  opacity: .98;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.16));
}

.has-bargig-logo .page-thumb-wrap::after {
  top: 24px;
  left: 50%;
  right: auto;
  width: clamp(54px, 20%, 92px);
}

.has-bargig-logo .catalog-cover-wrap::after {
  top: 28px;
  left: 50%;
  right: auto;
}

.has-bargig-logo .reader-page-frame::after,
.has-bargig-logo .lightbox-scroll-page-frame::after,
.has-bargig-logo .lightbox-image-frame::after {
  width: clamp(82px, 13%, 170px);
  top: clamp(10px, 2%, 24px);
  left: 50%;
  right: auto;
}

.has-bargig-logo .lightbox-thumb::after,
.has-bargig-logo .lightbox-page-thumb-frame::after,
.has-bargig-logo .reader-page-thumb-frame::after,
.has-bargig-logo .search-result-thumb-frame::after,
.has-bargig-logo .reader-search-thumb-frame::after {
  width: clamp(28px, 42%, 50px);
  top: 6px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}

.catalog-cover-frame {
  width: 100%;
  aspect-ratio: 1.55 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #ede2d9, #d8c1b0);
}
.catalog-cover-frame .catalog-cover {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.search-result-thumb-frame {
  display: block;
  width: 96px;
  height: 122px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #ede2d9, #d8c1b0);
}
.search-result-thumb-frame .search-result-thumb {
  width: 100%;
  height: 100%;
}

.page-number-badge {
  right: auto;
  left: 24px;
}

.lightbox-image-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  transform-origin: center center;
  will-change: transform;
  background: #fff;
  box-shadow: 0 20px 80px rgba(0,0,0,0.45);
  user-select: none;
  cursor: grab;
}
.lightbox-image-frame .lightbox-image {
  position: static;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  transform: none;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.lightbox.is-zoomed .lightbox-image-frame { cursor: move; }

.lightbox-image-frame.page-swap-enter {
  animation: lightbox-page-swap .22s cubic-bezier(.2, .72, .22, 1) both;
}

.lightbox.is-page-loading .lightbox-image-frame {
  filter: brightness(.92);
}

.lightbox-image-frame,
.lightbox-image-frame .lightbox-image {
  backface-visibility: hidden;
}

@keyframes lightbox-page-swap {
  from {
    opacity: .42;
    transform: translate(-50%, -50%) translate(var(--single-pan-x, 0), var(--single-pan-y, 0)) scale(calc(var(--single-zoom, 1) * .988));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--single-pan-x, 0), var(--single-pan-y, 0)) scale(var(--single-zoom, 1));
  }
}

.reader-logo {
  width: clamp(92px, 8.6vw, 122px);
  height: auto;
  flex: 0 0 auto;
  border-radius: 15px;
  clip-path: inset(0 round 15px);
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.18));
}
.reader-header .reader-home {
  padding: 5px 8px;
  border-radius: 17px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(255,255,255,0.72);
  box-shadow: 0 8px 24px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.92);
}
.reader-header .reader-home:hover,
.reader-header .reader-home:focus-visible {
  background: #fff;
}
.reader-header .reader-logo {
  filter: brightness(1.08) contrast(.94) drop-shadow(0 3px 8px rgba(0,0,0,0.10));
}
.reader-home {
  gap: 9px;
}

.reader-search-thumb-frame {
  display: block;
  width: 54px;
  height: 68px;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}
.reader-search-thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-footer {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 42px) 30px;
  color: var(--muted);
}
.site-footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px 18px;
  flex-wrap: wrap;
  text-align: center;
}
.site-footer-row p {
  margin: 0;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
}
.footer-hidden-tools-link {
  color: inherit;
  text-decoration: none;
  cursor: default;
}
.footer-hidden-tools-link:hover,
.footer-hidden-tools-link:focus-visible {
  color: inherit;
  text-decoration: none;
  outline: none;
}
.footer-contact {
  min-width: 132px;
  text-align: center;
  text-decoration: none;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.footer-contact:hover,
.footer-contact:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 24px 46px rgba(117, 88, 68, 0.34);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay { transition-delay: .12s; }


/* Catalog interaction fixes */
.search-panel {
  margin-top: 26px;
}

.catalog-cover-card-picker,
.catalog-cover-button {
  color: inherit;
  font: inherit;
}

.catalog-cover-card-picker {
  display: block;
  cursor: pointer;
}

.catalog-cover-button {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.catalog-cover-card-picker::before,
.catalog-cover-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.46));
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}

.catalog-cover-card-picker:hover::before,
.catalog-cover-card-picker:focus-visible::before,
.catalog-cover-card-picker:focus-within::before,
.catalog-cover-button:hover::before,
.catalog-cover-button:focus-visible::before {
  opacity: 1;
}

.catalog-cover-card-mode-actions,
.catalog-cover-cta {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 8;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}

.catalog-cover-card-mode-actions {
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.catalog-cover-card-mode-button,
.catalog-cover-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(47, 37, 29, 0.78);
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  font-size: .88rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.catalog-cover-card-mode-button {
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
  pointer-events: auto;
}

.catalog-cover-card-mode-button:hover,
.catalog-cover-card-mode-button:focus-visible {
  background: rgba(47, 37, 29, 0.92);
  border-color: rgba(255,255,255,0.48);
  transform: translateY(-1px);
}

.catalog-cover-card-picker:hover .catalog-cover-card-mode-actions,
.catalog-cover-card-picker:focus-visible .catalog-cover-card-mode-actions,
.catalog-cover-card-picker:focus-within .catalog-cover-card-mode-actions,
.catalog-cover-button:hover .catalog-cover-cta,
.catalog-cover-button:focus-visible .catalog-cover-cta {
  opacity: 1;
  transform: translateY(0);
}

.catalog-cover-button {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  text-align: inherit;
}

/* Search inside the unified viewer uses the reader search layout. */
.lightbox-search {
  min-width: 0;
  width: 100%;
  justify-self: center;
}
.lightbox-search-clear {
  min-height: 40px;
}
.lightbox-search-results {
  position: static;
}
.lightbox-search-result,
.lightbox-search-empty {
  text-align: right;
}
@media (max-width: 1180px) {
  .catalog-category-list { --catalog-layout-columns: 2; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-category-grid { grid-template-columns: repeat(var(--category-span, var(--catalog-layout-columns, 2)), minmax(0, 1fr)); }
  .page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .catalog-hero { grid-template-columns: 1fr; }
  .gallery-toolbar, .section-head, .catalog-category-head { flex-direction: column; align-items: stretch; }
  .search-results, .reader-search-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .last-view-card { grid-template-columns: 1fr; align-items: stretch; }
  .last-view-details { grid-template-columns: minmax(0, 1.55fr) minmax(112px, .75fr) minmax(150px, 1fr); }
  .reader-header { grid-template-columns: minmax(170px, .85fr) minmax(180px, 520px) minmax(170px, .85fr); }
  .reader-header.lightbox-reader-header { grid-template-columns: minmax(170px, .85fr) minmax(180px, 520px) minmax(220px, .85fr); }
  .lightbox-actions { justify-content: flex-end; }
  .lightbox-actions .reader-button { flex: 0 0 auto; }
}

@media (max-width: 760px) {
  :root { --header-h: 108px; }
  .site-header { padding-inline: 12px; gap: 8px; }
  .top-nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .top-nav a { min-height: 36px; padding-inline: 12px; font-size: .9rem; }
  .brand-mark { width: 110px; height: auto; }
  .brand-text small { display: none; }
  main, .site-footer { padding-inline: 10px; }
  .panel { border-radius: 24px; padding: 16px; }
  .catalog-category-list { --catalog-layout-columns: 1; grid-template-columns: 1fr; column-gap: 0; row-gap: 32px; }
  .catalog-category-section { grid-column: span 1; }
  .catalog-category-section[data-inline-divider="1"]::after { content: none; }
  .catalog-grid, .page-grid, .search-results, .reader-search-results { grid-template-columns: 1fr; }
  .catalog-category-grid { grid-template-columns: 1fr; width: 100%; }
  .search-box { grid-template-columns: 1fr; border-radius: 22px; }
  .search-clear { width: 100%; }
  .last-view-card { grid-template-columns: 1fr; align-items: stretch; border-radius: 20px; }
  .last-view-details { grid-template-columns: 1fr; }
  .search-result-button { grid-template-columns: 82px minmax(0, 1fr); }
  .search-result-thumb { width: 82px; height: 106px; }
  .reader-top-shell { max-height: calc(100vh - 8px); }
  .reader-header,
  .reader-header.lightbox-reader-header {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "search search";
    gap: 7px;
    padding-inline: 8px;
  }
  .reader-brand-actions {
    grid-area: brand;
    min-width: 0;
    gap: 5px;
    justify-self: start;
  }
  .reader-header-search {
    grid-area: search;
    max-width: none;
    justify-self: stretch;
  }
  .reader-header-spacer,
  .lightbox-actions {
    grid-area: actions;
    justify-self: end;
  }
  .reader-header-spacer { display: none; }
  .lightbox-actions {
    max-width: min(62vw, 230px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .lightbox-actions::-webkit-scrollbar { display: none; }
  .reader-header .reader-home { padding: 4px 6px; border-radius: 14px; }
  .reader-logo,
  .lightbox-brand-lockup .reader-logo { width: 84px; border-radius: 12px; clip-path: inset(0 round 12px); }
  .reader-icon-button { width: 36px; min-width: 36px; min-height: 36px; }
  .reader-icon-button svg { width: 18px; height: 18px; }
  .reader-search-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
  }
  .reader-catalog-menu-toggle { width: 38px; min-width: 38px; min-height: 38px; border-radius: 13px; }
  .reader-catalog-menu-toggle svg { width: 18px; height: 18px; }
  .reader-header-search .reader-search-box { border-radius: 16px; }
  .reader-search-input { padding-inline: 12px 118px; }
  .reader-search-scope-wrap { left: 4px; }
  .reader-search-scope-toggle { min-height: 30px; padding-inline: 8px; font-size: .75rem; border-radius: 11px; }
  .reader-search-scope-menu { left: 0; width: 178px; }
  .reader-header-search .reader-search-clear,
  .lightbox-search-clear {
    --reader-clear-button-width: 48px;
    min-height: 38px;
    font-size: .82rem;
  }
  .reader-search-input { min-height: 38px; }
  .reader-search-results,
  .reader-catalog-menu { width: calc(100% - 16px); max-height: calc(100vh - 70px); }
  .reader-catalog-menu-items { grid-template-columns: 1fr; }
  .reader-page-rail {
    top: auto;
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-height: 168px;
    grid-template-rows: auto minmax(0, 1fr);
    transform: translateY(calc(100% + 18px));
  }
  .reader-side-open .reader-page-rail,
  .reader-page-rail:focus-within { transform: translateY(0); }
  .reader-page-thumbs {
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
  }
  .reader-page-thumb {
    flex: 0 0 116px;
    width: 116px;
  }
  .reader-page-thumb:hover, .reader-page-thumb:focus-visible { transform: translateY(-2px); }
  .reader-floating-preview { display: none; }
  .reader-side-hotspot { top: auto; right: 0; bottom: 0; width: 100vw; height: 34px; }
  .reader-side-hotspot span { width: 58px; height: 24px; border-radius: 999px 999px 0 0; transform: rotate(90deg); }
  .select-wrap, select, .detail-catalog-picker, .detail-catalog-menu-toggle, .catalog-view-mode-actions { width: 100%; min-width: 100%; }
  .catalog-view-mode-actions .button { flex: 1 1 140px; }
  .stage-nav { width: 44px; height: 62px; font-size: 2.2rem; }
  .lightbox-thumb { flex-basis: 116px; }
  .lightbox-floating-preview { display: none; }
  .lightbox-scroll-view { padding: 8px; }
  .lightbox-scroll-page-frame { border-radius: 12px; }
  .lightbox-page-rail {
    top: auto;
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-height: 168px;
    grid-template-rows: auto minmax(0, 1fr);
    transform: translateY(calc(100% + 18px));
  }
  .lightbox.show-page-rail .lightbox-page-rail,
  .lightbox-page-rail:focus-within { transform: translateY(0); }
  .lightbox-page-thumbs {
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x;
    padding: 2px 2px 8px;
  }
  .lightbox-page-thumb {
    flex: 0 0 116px;
    width: 116px;
  }
  .lightbox-page-thumb:hover,
  .lightbox-page-thumb:focus-visible { transform: translateY(-2px); }
  .lightbox-side-hotspot { top: auto; right: 0; bottom: 0; width: 100vw; height: 34px; }
  .lightbox-side-hotspot span { width: 58px; height: 24px; border-radius: 999px 999px 0 0; transform: rotate(90deg); }
  .lightbox-actions { gap: 5px; }
  .reader-control-icon-button { width: 36px; min-width: 36px; min-height: 36px; border-radius: 12px; }
  .reader-control-icon-button svg { width: 18px; height: 18px; }
  .catalog-cover-card-mode-actions, .catalog-cover-cta { opacity: 1; transform: none; }
  .catalog-cover-card-picker::before { opacity: 1; }
  .lightbox-search-clear { width: var(--reader-clear-button-width); }
  .lightbox-top-hotspot { height: 92px; }
  .reader-main { padding: 8px; }
  .reader-page-frame { border-radius: 12px; }
}

@media (max-width: 520px) {
  .reader-header,
  .reader-header.lightbox-reader-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
  }
  .reader-logo,
  .lightbox-brand-lockup .reader-logo { width: 72px; }
  .reader-header .reader-home { padding: 3px 5px; border-radius: 13px; }
  .lightbox-actions { max-width: min(52vw, 130px); }
  .reader-quick-actions { gap: 4px; }
  .reader-icon-button,
  .reader-control-icon-button { width: 34px; min-width: 34px; min-height: 34px; border-radius: 12px; }
  .reader-search-input { padding-inline: 10px 108px; }
  .reader-search-scope-toggle { padding-inline: 7px; font-size: .7rem; }
  .reader-catalog-menu-toggle { width: 36px; min-width: 36px; min-height: 36px; }
  .lightbox-actions .viewer-zoom-control { display: none; }
}

@media (max-width: 420px) {
  .reader-quick-actions { display: none; }
  .reader-search-input { padding-inline: 9px 96px; font-size: .9rem; }
  .reader-search-scope-toggle { max-width: 94px; overflow: hidden; text-overflow: ellipsis; }
  .lightbox-actions { max-width: 118px; }
}

/* Keep catalog surfaces isolated for painting without lazy layout activation during scroll. */
.catalogs-section,
.catalog-detail {
  isolation: isolate;
}

.catalog-card,
.page-card,
.reader-page-frame,
.lightbox-scroll-page-frame {
  contain: layout paint;
}

.catalog-detail,
.page-grid {
  overflow-anchor: none;
}

.reader-image,
.lightbox-scroll-image {
  transition: opacity .16s ease;
}

.reader-image[data-src],
.lightbox-scroll-image[data-src] {
  opacity: 0;
}

.reader-page-frame[style*="aspect-ratio"] .reader-image,
.lightbox-scroll-page-frame[style*="aspect-ratio"] .lightbox-scroll-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
