/* ==========================================================================
   apps/wisdom-tafsir/tafsir.css
   Reflow E-Book Reader for The Book of Wisdom: Volume 1 Tafsir (120 Chapters)
   ========================================================================== */

:root {
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;

  --gold: #C69B33;
  --gold-bright: #E6C365;
  --gold-ink: #8A6114;
  --gold-dim: rgba(198, 155, 51, 0.22);

  /* Default Theme: Archival Folio Cotton on Cool Museum Limestone */
  --bg-page: #ECEEF2;
  --bg-surface: #FFFFFF;
  --bg-elevated: #E3E6EC;
  --bg-plate: #13110E;
  --ink-primary: #171614;
  --ink-secondary: #484642;
  --ink-muted: #68655E;
  --accent-heading: #70260A;
  --border-subtle: #D5D9E0;
  --border-strong: #B6BCC7;
  --border-gold: rgba(152, 110, 26, 0.36);
  --header-bg: rgba(255, 255, 255, 0.94);
  --folio-shadow: 0 18px 48px rgba(15, 18, 26, 0.08), 0 2px 8px rgba(15, 18, 26, 0.04);

  /* Font size scale */
  --prose-size: 18px;
  --prose-lh: 1.86;
}

body[data-theme="sepia"] {
  --bg-page: #EAE0CA;
  --bg-surface: #F4EAD6;
  --bg-elevated: #E0D0B0;
  --bg-plate: #181410;
  --ink-primary: #271C12;
  --ink-secondary: #5A4532;
  --ink-muted: #7A614B;
  --accent-heading: #682307;
  --border-subtle: #D2BD99;
  --border-strong: #B69C72;
  --border-gold: rgba(142, 98, 22, 0.42);
  --header-bg: rgba(234, 224, 202, 0.94);
  --folio-shadow: 0 22px 60px rgba(48, 32, 12, 0.09), 0 2px 10px rgba(48, 32, 12, 0.05);
}

body[data-theme="obsidian"] {
  --bg-page: #0C0B09;
  --bg-surface: #151310;
  --bg-elevated: #1D1A16;
  --bg-plate: #090807;
  --gold: #DFBE63;
  --gold-bright: #F4DA84;
  --gold-ink: #E6C56B;
  --gold-dim: rgba(223, 190, 99, 0.2);
  --ink-primary: #EEE6D7;
  --ink-secondary: #BFB19B;
  --ink-muted: #93846F;
  --accent-heading: #ECC971;
  --border-subtle: #2C271F;
  --border-strong: #4A4030;
  --border-gold: rgba(223, 190, 99, 0.36);
  --header-bg: rgba(12, 11, 9, 0.94);
  --folio-shadow: 0 24px 68px rgba(0, 0, 0, 0.65);
}

body[data-font-size="small"] { --prose-size: 16px; }
body[data-font-size="medium"] { --prose-size: 18px; }
body[data-font-size="large"] { --prose-size: 20px; }
body[data-font-size="xlarge"] { --prose-size: 22px; }

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-page);
  color: var(--ink-primary);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  caret-color: var(--gold);
}

::selection {
  background: rgba(198, 155, 51, 0.28);
  color: var(--ink-primary);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Custom hairline scrollbars synced to codex palette */
.ebook-scroll-container::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.manuscript-pre::-webkit-scrollbar {
  width: 6px;
}

.ebook-scroll-container::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.ebook-scroll-container::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.manuscript-pre::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

/* ==========================================================================
   1. COVER SCREEN
   ========================================================================== */
.cover-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background-color: #050504;
  color: #F5EFE4;
}

.cover-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 36%, rgba(45, 212, 191, 0.22), transparent 72%);
  pointer-events: none;
}

.cover-ambient-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 30%, rgba(212, 160, 82, 0.25) 0%, transparent 68%),
    linear-gradient(180deg, rgba(5, 5, 4, 0.5) 0%, transparent 40%, rgba(5, 5, 4, 0.7) 80%, #050504 100%);
  pointer-events: none;
  animation: coverAmbientBreathe 8s ease-in-out infinite alternate;
}

@keyframes coverAmbientBreathe {
  0% { opacity: 0.7; }
  100% { opacity: 1.0; }
}

#particle-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.cover-topbar {
  position: relative;
  z-index: 30;
  width: 100%;
  padding: max(10px, env(safe-area-inset-top, 10px)) 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
}

.cover-portal-link {
  padding: 7px 14px;
  font-size: 12.5px;
  opacity: 0.88;
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(18, 16, 14, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8F5EE;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 200ms ease;
}

.glass-pill:hover {
  background: rgba(30, 26, 22, 0.95);
  border-color: #D4A052;
  color: #E2B774;
  transform: translateY(-1px);
}

.cover-stage {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px max(14px, env(safe-area-inset-bottom, 14px));
  box-sizing: border-box;
  overflow: hidden;
}

.cover-hero-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cover-hero-img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: high-quality;
}

.cover-hero-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, #050504 0%, transparent 3%, transparent 97%, #050504 100%),
    linear-gradient(to right, #050504 0%, transparent 2.5%, transparent 97.5%, #050504 100%);
}

.cover-actions {
  flex: 0 0 auto;
  width: 100%;
  max-width: 330px;
  margin: 8px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  position: relative;
  z-index: 20;
}

.btn-primary-enter {
  width: 100%;
  max-width: 320px;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, #2DD4BF 0%, #D4A052 100%);
  color: #0A0A08;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(45, 212, 191, 0.25);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 220ms ease,
              filter 220ms ease;
}

.btn-primary-enter:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 36px rgba(45, 212, 191, 0.35);
  filter: brightness(1.06);
}

.btn-primary-enter:active {
  transform: scale(0.98);
  box-shadow: 0 4px 14px rgba(45, 212, 191, 0.2);
}

.btn-primary-enter svg {
  transition: transform 200ms ease;
}

.btn-primary-enter:hover svg {
  transform: translateX(4px);
}

.btn-cover-toc {
  width: 100%;
  max-width: 320px;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #F8F5EE;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 200ms ease;
}

.btn-cover-toc:hover {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
  color: #5EEAD4;
  transform: translateY(-1px);
}

.btn-cover-toc:active {
  transform: scale(0.98);
  background: rgba(45, 212, 191, 0.2);
}

@media (min-width: 1024px) {
  .cover-stage {
    padding: 12px 24px max(24px, env(safe-area-inset-bottom, 24px));
  }

  .cover-actions {
    margin-top: 12px;
  }
}

@media (max-height: 600px) {
  .cover-topbar {
    padding: 6px 12px 2px;
  }

  .cover-stage {
    padding: 0 12px max(8px, env(safe-area-inset-bottom, 8px));
  }

  .cover-actions {
    margin-top: 4px;
    gap: 6px;
  }

  .btn-primary-enter {
    height: 38px;
    font-size: 12.5px;
  }

  .btn-cover-toc {
    height: 34px;
    font-size: 12px;
  }
}

/* ==========================================================================
   2. E-BOOK READER SHELL
   ========================================================================== */
.ebook-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(198, 155, 51, 0.08), transparent 65%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(112, 38, 10, 0.05), transparent 70%),
    var(--bg-page);
  color: var(--ink-primary);
}

body[data-theme="obsidian"] .ebook-screen {
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(223, 190, 99, 0.07), transparent 65%),
    var(--bg-page);
}

.ebook-header {
  height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  z-index: 20;
  flex-shrink: 0;
}

.ebook-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.header-chapter-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.header-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-chapter-title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-mobile-bab {
  display: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-heading);
  white-space: nowrap;
}

.ebook-header-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tool-btn:hover {
  border-color: var(--gold);
  color: var(--accent-heading);
}

.tool-btn-gold {
  border-color: var(--border-gold);
  background: rgba(198, 155, 51, 0.12);
  color: var(--accent-heading);
}

.scroll-progress-track {
  height: 2px;
  width: 100%;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #9A6D1C, var(--gold), var(--gold-bright));
  transition: width 0.1s linear;
}

/* ==========================================================================
   3. ILLUMINATED CODEX FOLIO STREAM & EDITORIAL TYPOGRAPHY
   ========================================================================== */
.ebook-scroll-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 34px 22px 92px;
  -webkit-overflow-scrolling: touch;
}

.ebook-article {
  position: relative;
  max-width: 790px;
  margin: 0 auto;
  padding: 46px 52px 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  outline: 1px solid var(--border-gold);
  outline-offset: -9px;
  border-radius: 4px;
  box-shadow: var(--folio-shadow);
  font-family: var(--font-serif);
  font-size: var(--prose-size);
  line-height: var(--prose-lh);
  color: var(--ink-primary);
}

/* Illuminated Chapter Title Plate */
.bab-hero-header {
  text-align: center;
  padding: 8px 0 32px;
  margin-bottom: 34px;
}

.bab-crest-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.bab-crest-wing {
  flex: 1;
  max-width: 110px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.bab-crest-medallion {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-ink);
}

body[data-theme="obsidian"] .bab-crest-medallion {
  color: var(--gold);
}

.hero-medallion-svg {
  flex-shrink: 0;
}

.bab-crest-numeral {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.bab-main-title {
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 4.4vw, 3.05rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--accent-heading);
  text-wrap: balance;
  max-width: 22ch;
  margin: 0 auto 16px;
}

.bab-tagline {
  font-family: var(--font-display);
  font-size: 1.24em;
  font-style: italic;
  font-weight: 500;
  color: var(--ink-secondary);
  max-width: 58ch;
  margin: 0 auto 22px;
  line-height: 1.55;
}

.bab-rule-ornament {
  display: flex;
  justify-content: center;
  color: var(--gold-ink);
  margin: 0 auto 22px;
}

body[data-theme="obsidian"] .bab-rule-ornament {
  color: var(--gold);
}

.bab-meta-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.bab-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 4px;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.bab-meta-chip-link,
.bab-meta-chip-accent {
  border-color: var(--border-gold);
  color: var(--accent-heading);
  text-decoration: underline;
  text-decoration-color: rgba(198, 155, 51, 0.45);
  text-underline-offset: 3px;
}

.bab-meta-chip-link:hover,
.bab-meta-chip-accent:hover {
  border-color: var(--gold);
  background: rgba(198, 155, 51, 0.1);
}

.bab-translate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 4px;
  background: rgba(198, 155, 51, 0.1);
  border: 1px solid var(--border-gold);
  color: var(--accent-heading);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.bab-translate-btn:hover {
  border-color: var(--gold);
  background: rgba(198, 155, 51, 0.18);
  transform: translateY(-1px);
}

/* Illuminated Essence Folio Inset (zero heavy left-stripe border) */
.tafsir-essence-box {
  position: relative;
  background:
    linear-gradient(180deg, rgba(198, 155, 51, 0.065), rgba(198, 155, 51, 0.02)),
    var(--bg-page);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 28px;
  margin-bottom: 30px;
}

.tafsir-essence-box::before,
.tafsir-essence-box::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1px;
  background: var(--border-gold);
  pointer-events: none;
}

.tafsir-essence-box::before { top: 4px; }
.tafsir-essence-box::after { bottom: 4px; }

.essence-seal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.essence-seal-rule {
  flex: 1;
  height: 1px;
  background: var(--border-gold);
}

.tafsir-essence-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-heading);
  white-space: nowrap;
}

.essence-prose p {
  font-size: 0.96em;
  line-height: 1.8;
  color: var(--ink-primary);
  margin-bottom: 12px;
}

.essence-prose p:last-child {
  margin-bottom: 0;
}

/* Archival Source Drawers */
.source-compare-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.compare-drawer {
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.compare-drawer[open] {
  border-color: var(--border-gold);
}

.compare-drawer summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-heading);
  cursor: pointer;
  user-select: none;
}

.compare-drawer summary::-webkit-details-marker {
  display: none;
}

.drawer-summary-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.drawer-chevron {
  font-size: 16px;
  line-height: 1;
  color: var(--gold-ink);
  transition: transform 0.2s ease;
}

.compare-drawer[open] .drawer-chevron {
  transform: rotate(45deg);
}

.compare-drawer-body {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 14px;
}

.compare-drawer-footer {
  margin-top: 12px;
  text-align: center;
}

.compare-canvas-img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  cursor: zoom-in;
  display: block;
  margin: 0 auto;
}

.manuscript-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-secondary);
  max-height: 320px;
  overflow-y: auto;
}

/* Continuous Illuminated Narrative Sections (NO nested card boxes) */
.tafsir-folio-stream {
  margin-top: 8px;
}

.tafsir-section {
  padding: 0;
  margin-bottom: 12px;
}

.section-ornament {
  display: flex;
  justify-content: center;
  color: var(--gold-ink);
  padding: 28px 0 18px;
}

body[data-theme="obsidian"] .section-ornament {
  color: var(--gold);
}

.tafsir-section:first-child .section-ornament {
  padding-top: 14px;
}

.tafsir-section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.01em;
  color: var(--accent-heading);
  text-wrap: balance;
  padding-bottom: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
}

.tafsir-section p {
  max-width: 66ch;
  margin-bottom: 18px;
}

.tafsir-section strong {
  color: var(--accent-heading);
  font-weight: 700;
}

/* Illuminated Monograph Drop Cap on opening section prose */
.tafsir-section-body p.tafsir-dropcap::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.35em;
  font-weight: 700;
  line-height: 0.76;
  padding: 5px 6px 0 0;
  color: var(--gold-ink);
}

body[data-theme="obsidian"] .tafsir-section-body p.tafsir-dropcap::first-letter {
  color: var(--gold-bright);
  text-shadow: none;
}

/* Museum Specimen Plates */
.visual-plate, .two-col-plate {
  margin: 26px 0 28px;
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(20, 14, 6, 0.07);
}

.plate-matte-frame {
  padding: 12px;
  background: var(--bg-plate);
  border-bottom: 1px solid var(--border-gold);
}

.visual-plate img, .asymmetric-card img, .two-col-plate img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  height: auto;
  display: block;
  cursor: zoom-in;
  margin: 0 auto;
}

.visual-caption {
  padding: 13px 18px 15px;
  font-size: 0.87em;
  line-height: 1.62;
  color: var(--ink-secondary);
  background: var(--bg-page);
}

.plate-index-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.plate-roman-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-heading);
}

.plate-zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--border-gold);
  background: transparent;
  color: var(--accent-heading);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.plate-zoom-btn:hover {
  background: rgba(198, 155, 51, 0.14);
}

/* Asymmetric Cards */
.asymmetric-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.asymmetric-card {
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 16px;
}

.asymmetric-card-title {
  font-family: var(--font-display);
  font-size: 1.25em;
  font-weight: 700;
  color: var(--accent-heading);
  margin: 12px 0 8px;
}

/* Engraved Marginalia Insight List (zero thick left stripes, zero nested pills) */
.insight-list {
  list-style: none;
  margin: 24px 0;
  padding: 6px 0;
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
}

.insight-list li {
  position: relative;
  padding: 14px 4px 14px 26px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.96em;
  line-height: 1.75;
}

.insight-list li:last-child {
  border-bottom: none;
}

.insight-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 24px;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* Comparison Table */
.comp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

.comp-table th, .comp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.comp-table th {
  background: var(--bg-page);
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
  color: var(--accent-heading);
  font-family: var(--font-sans);
  font-size: 0.8em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Illuminated Epiphany Pull-Quote Sanctuary */
.epiphany-quote, blockquote.sacred-quote {
  position: relative;
  margin: 34px auto 22px;
  padding: 28px 32px 24px;
  max-width: 62ch;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 70% at 50% 50%, rgba(198, 155, 51, 0.08), transparent 72%);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.32em;
  font-weight: 500;
  line-height: 1.62;
  color: var(--ink-primary);
}

.epiphany-quote::before {
  content: "\201C";
  display: block;
  font-family: var(--font-display);
  font-style: normal;
  font-size: 2.4rem;
  line-height: 0.6;
  color: var(--gold);
  margin-bottom: 10px;
}

.epiphany-quote > div:last-child {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-heading);
  text-align: center !important;
  margin-top: 14px !important;
}

/* Editorial Chapter Colophon & Inline Continuation */
.chapter-colophon {
  margin-top: 44px;
  padding-top: 10px;
}

.colophon-finial {
  display: flex;
  justify-content: center;
  color: var(--gold-ink);
  margin-bottom: 14px;
}

body[data-theme="obsidian"] .colophon-finial {
  color: var(--gold);
}

.colophon-note {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 20px;
}

.colophon-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.colophon-nav-grid.is-single-next {
  grid-template-columns: minmax(0, 440px);
  justify-content: center;
}

.colophon-nav-grid.is-single-next .colophon-nav-card.colophon-next {
  text-align: center;
  align-items: center;
}

.colophon-nav-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.colophon-nav-card.colophon-next {
  text-align: right;
  align-items: flex-end;
  border-color: var(--border-gold);
}

.colophon-nav-card:hover {
  border-color: var(--gold);
  background: rgba(198, 155, 51, 0.08);
}

.colophon-dir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-heading);
}

.colophon-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.28;
  color: var(--ink-primary);
}

/* Paywall Lock Gate Card */
.tafsir-gate-card {
  text-align: center;
  padding: 40px 28px;
  background: var(--bg-page);
  border: 1px solid var(--gold);
  outline: 1px solid var(--border-gold);
  outline-offset: -6px;
  border-radius: 4px;
  margin: 28px 0;
}

.tafsir-gate-actions {
  max-width: 340px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tafsir-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 4px;
  background: rgba(198, 155, 51, 0.14);
  border: 1px solid var(--border-gold);
  color: var(--accent-heading);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.tafsir-gate-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent-heading);
  margin-bottom: 10px;
}

.tafsir-gate-desc {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 520px;
  margin: 0 auto 22px;
}

/* ==========================================================================
   4. FLOATING ELEGANT BOTTOM DOCK & CAPSULE
   ========================================================================== */
.ebook-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  pointer-events: none;
  border-top: none;
  z-index: 25;
  flex-shrink: 0;
}

.dock-capsule {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: auto;
  max-width: 360px;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  box-shadow: 0 8px 28px rgba(15, 18, 26, 0.12), 0 2px 6px rgba(15, 18, 26, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body[data-theme="obsidian"] .dock-capsule {
  background: rgba(18, 16, 13, 0.92);
  border-color: rgba(223, 190, 99, 0.32);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dock-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.dock-nav-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--accent-heading);
  background: var(--bg-elevated);
  transform: scale(1.06);
}

.dock-nav-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.dock-nav-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

.dock-center-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--accent-heading);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.dock-center-pill:hover {
  background: var(--bg-elevated);
  color: var(--gold-ink);
}

body[data-theme="obsidian"] .dock-center-pill:hover {
  color: var(--gold);
}

.dock-bab-num {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
}

.dock-chevron-down {
  font-size: 11px;
  opacity: 0.75;
  transition: transform 0.18s ease;
}

.dock-center-pill:hover .dock-chevron-down {
  transform: translateY(1px);
  opacity: 1;
}

/* ==========================================================================
   4b. ARTBOOK-STYLE 3D PAGE CURL TRANSITION ANIMATIONS
   ========================================================================== */
.ebook-article {
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}

.ebook-article.m-flip-out-next {
  animation: mPageCurlOutNext 170ms cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.ebook-article.m-flip-in-next {
  animation: mPageCurlInNext 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.ebook-article.m-flip-out-prev {
  animation: mPageCurlOutPrev 170ms cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.ebook-article.m-flip-in-prev {
  animation: mPageCurlInPrev 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes mPageCurlOutNext {
  0% {
    transform: perspective(1200px) rotateY(0deg) scale(1);
    filter: brightness(1);
    opacity: 1;
  }
  100% {
    transform: perspective(1200px) rotateY(-40deg) scale(0.95) translateX(-28px);
    filter: brightness(0.72) contrast(1.1);
    opacity: 0.15;
  }
}

@keyframes mPageCurlInNext {
  0% {
    transform: perspective(1200px) rotateY(40deg) scale(0.95) translateX(28px);
    filter: brightness(0.75);
    opacity: 0.2;
  }
  65% {
    transform: perspective(1200px) rotateY(-2deg) scale(1.008) translateX(-1px);
    filter: brightness(1.02);
    opacity: 1;
  }
  100% {
    transform: perspective(1200px) rotateY(0deg) scale(1) translateX(0);
    filter: brightness(1);
    opacity: 1;
  }
}

@keyframes mPageCurlOutPrev {
  0% {
    transform: perspective(1200px) rotateY(0deg) scale(1);
    filter: brightness(1);
    opacity: 1;
  }
  100% {
    transform: perspective(1200px) rotateY(40deg) scale(0.95) translateX(28px);
    filter: brightness(0.72) contrast(1.1);
    opacity: 0.15;
  }
}

@keyframes mPageCurlInPrev {
  0% {
    transform: perspective(1200px) rotateY(-40deg) scale(0.95) translateX(-28px);
    filter: brightness(0.75);
    opacity: 0.2;
  }
  65% {
    transform: perspective(1200px) rotateY(2deg) scale(1.008) translateX(1px);
    filter: brightness(1.02);
    opacity: 1;
  }
  100% {
    transform: perspective(1200px) rotateY(0deg) scale(1) translateX(0);
    filter: brightness(1);
    opacity: 1;
  }
}

/* ==========================================================================
   5. MODALS & LIGHTBOX
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 7, 6, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog, .modal-drawer {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  background: var(--bg-surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-heading);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink-primary);
}

.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--ink-primary);
  font-size: 15px;
  cursor: pointer;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-search-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-page);
  color: var(--ink-primary);
  font-size: 14px;
}

.toc-pillars-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: -4px 0 2px;
  padding: 2px 2px 6px;
  flex-shrink: 0;
}

.toc-pillars-bar::-webkit-scrollbar {
  display: none;
}

.pillar-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  user-select: none;
}

.pillar-tab-btn:hover {
  border-color: var(--gold);
  color: var(--accent-heading);
  background: var(--bg-elevated);
}

.pillar-tab-btn.is-active {
  background: var(--gold);
  color: #0C0B09;
  border-color: var(--gold);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(198, 155, 51, 0.28);
}

.toc-chapters-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toc-item-btn:hover {
  border-color: var(--gold);
  background: var(--bg-elevated);
}

.toc-item-btn.is-active {
  border-color: var(--border-gold);
  background: rgba(198, 155, 51, 0.12);
  color: var(--accent-heading);
}

.toc-item-num-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--accent-heading);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-subtle);
}

.toc-item-btn.is-active .toc-item-num-chip {
  background: var(--gold);
  color: #0C0B09;
  border-color: var(--gold);
}

.toc-item-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-primary);
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toc-item-btn.is-active .toc-item-title {
  color: var(--accent-heading);
  font-weight: 700;
}

.toc-item-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  flex-shrink: 0;
  opacity: 0.7;
  margin-left: auto;
}

.search-results-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.search-result-item:hover {
  border-color: var(--gold);
}

.toc-item-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-heading);
  text-transform: uppercase;
}

.toc-item-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  white-space: nowrap;
}

/* Settings & Auth */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.settings-btn-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.settings-opt-btn {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.settings-opt-btn.is-active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.18);
  color: var(--accent-heading);
}

.settings-bridge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: rgba(212, 175, 55, 0.1);
  color: var(--ink-primary);
  text-decoration: none;
}

.settings-bridge-card span {
  display: block;
  font-size: 12px;
  color: var(--ink-secondary);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  color: var(--ink-secondary);
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.is-active {
  border-color: var(--gold);
  color: var(--accent-heading);
  background: rgba(212, 175, 55, 0.14);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.field-group label {
  font-size: 12px;
  font-weight: 600;
}

.field-group input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-page);
  color: var(--ink-primary);
  font-size: 14px;
}

.btn-gold-cta {
  width: 100%;
  padding: 13px 20px;
  border-radius: 10px;
  border: 1px solid #F5D77F;
  background: linear-gradient(135deg, #C89B3C 0%, #E7C36A 50%, #B88728 100%);
  color: #161109;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.offer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-page);
  color: var(--ink-primary);
  text-align: left;
  cursor: pointer;
}

.offer-card.is-selected {
  border: 2px solid var(--gold);
  background: rgba(212, 175, 55, 0.1);
}

.offer-title { font-weight: 700; font-size: 14px; }
.offer-sub { font-size: 12px; color: var(--ink-secondary); margin-top: 2px; }
.offer-price { font-weight: 700; color: var(--accent-heading); white-space: nowrap; }

.user-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.user-info-label { display: block; font-size: 11px; text-transform: uppercase; color: var(--ink-muted); }
.btn-outline-sm { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border-strong); background: transparent; color: var(--ink-primary); cursor: pointer; }
.unlocked-badge-box { padding: 12px 14px; border-radius: 10px; background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(16, 185, 129, 0.4); color: #065F46; font-size: 13px; margin-bottom: 12px; }
body[data-theme="obsidian"] .unlocked-badge-box { color: #6EE7B7; }
.auth-error-box { padding: 10px 12px; border-radius: 8px; background: rgba(220, 38, 38, 0.12); color: #B91C1C; font-size: 13px; margin-bottom: 10px; }

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 4, 0.96);
  display: flex;
  flex-direction: column;
}

.lightbox-topbar {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #F3D066;
}

.lightbox-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
  font-size: 16px;
  cursor: pointer;
}

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
}

#lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  transition: transform 0.15s ease;
}

.lightbox-Toolbar {
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: #FFF;
}

.lb-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.15);
  color: #F3D066;
  font-weight: 700;
  cursor: pointer;
}

mark.search-match {
  background: rgba(212, 175, 55, 0.35);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

@media (max-width: 768px) {
  .hide-sm { display: none; }
  .ebook-header { padding: 0 12px; gap: 8px; }
  .header-eyebrow { display: none; }
  .header-chapter-title { max-width: none; font-size: 13px; }
  .tool-btn { padding: 7px 9px; font-size: 12px; }
  .ebook-scroll-container { padding: 14px 10px 84px; }
  .ebook-article {
    padding: 28px 18px 34px;
    outline-offset: -6px;
  }
  .tafsir-essence-box { padding: 20px 16px; }
  .epiphany-quote, blockquote.sacred-quote { padding: 22px 16px 20px; font-size: 1.18em; }
  .colophon-nav-grid { grid-template-columns: 1fr; }
  .colophon-nav-card.colophon-next { text-align: left; align-items: flex-start; }
}

@media (max-width: 560px) {
  .header-chapter-meta { display: none; }
}

@media (max-width: 480px) {
  .hide-xs { display: none; }
  .dock-btn-text { display: none; }
  .ebook-article { padding: 24px 14px 30px; }
  .bab-crest-wing { max-width: 48px; }
}
