/* Integrated Qafar Qaadâ Gadda reader styles */
:root{
  --bg:#f7f1e7;--paper:#fffaf0;--ink:#241a12;--muted:#6e5c4a;--accent:#b23b22;--accent2:#d6a94f;--shadow:0 24px 70px rgba(31,18,9,.22);--line:rgba(55,35,20,.12);--radius:28px;--reader-font:18px;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{}.site-hero{min-height:100vh;display:grid;place-items:center;padding:28px;position:relative;overflow:hidden}.site-hero:before{content:"";position:absolute;inset:-30%;background:linear-gradient(45deg,rgba(178,59,34,.22),transparent 35%),linear-gradient(135deg,rgba(24,92,61,.18),transparent 40%);transform:rotate(-8deg)}.topbar{position:absolute;top:24px;left:24px;right:24px;display:flex;align-items:center;gap:12px;z-index:1}.brand-mark{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#b23b22,#d6a94f);display:grid;place-items:center;color:white;font-weight:900;box-shadow:var(--shadow);font-family:Arial,sans-serif}.topbar span{display:block;color:var(--muted);font-size:14px}.intro-card{position:relative;z-index:1;width:min(720px,94vw);background:rgba(255,250,240,.9);backdrop-filter:blur(14px);border:1px solid rgba(255,255,255,.55);box-shadow:var(--shadow);border-radius:var(--radius);padding:54px;text-align:center}.eyebrow{letter-spacing:.22em;text-transform:uppercase;color:var(--accent);font-weight:800;font-family:Arial,sans-serif;font-size:13px}.intro-card h1{font-size:clamp(42px,8vw,86px);line-height:.92;margin:14px 0;color:#2b160b}.intro-text{font-size:20px;line-height:1.75;color:var(--muted);max-width:620px;margin:0 auto 30px}.hero-actions{display:flex;gap:14px;justify-content:center;flex-wrap:wrap}.primary-btn,.ghost-btn,.tool-btn,.icon-btn{border:0;cursor:pointer;transition:.25s ease;font-weight:800}.primary-btn{background:linear-gradient(135deg,var(--accent),#7e2113);color:white;padding:15px 26px;border-radius:999px;box-shadow:0 14px 30px rgba(178,59,34,.3)}.primary-btn:hover{transform:translateY(-2px);box-shadow:0 18px 40px rgba(178,59,34,.4)}.primary-btn.small{padding:11px 18px}.ghost-btn{background:transparent;color:var(--accent);border:1px solid rgba(178,59,34,.35);padding:14px 24px;border-radius:999px}.preview-wrap{padding:70px 24px}.preview-card{width:min(900px,94vw);margin:auto;background:var(--paper);border-radius:24px;padding:34px;box-shadow:var(--shadow);border:1px solid var(--line)}.preview-card h2{color:var(--accent);font-size:34px;margin:0 0 12px}.preview-card p{font-size:19px;color:var(--muted);line-height:1.7}.reader-modal{position:fixed;inset:0;z-index:1000;display:none}.reader-modal.open{display:block}.modal-backdrop{position:absolute;inset:0;background:rgba(19,12,8,.72);backdrop-filter:blur(6px)}.reader-shell{position:relative;width:min(1500px,96vw);height:94vh;margin:3vh auto;background:var(--paper);border-radius:24px;box-shadow:0 30px 100px rgba(0,0,0,.45);display:grid;grid-template-columns:330px 1fr;overflow:hidden}.sidebar{background:#2b1b12;color:#f8ead2;min-width:0;display:flex;flex-direction:column;border-right:1px solid rgba(255,255,255,.12)}.sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:18px 18px 8px}.sidebar h2{margin:0;font-size:22px}.search-box{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.12)}.search-box input{width:100%;padding:12px 13px;border-radius:14px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.09);color:white;outline:none}.search-box input::placeholder{color:rgba(255,255,255,.55)}#resultCount{font-family:Arial,sans-serif;font-size:12px;background:rgba(214,169,79,.25);padding:7px 9px;border-radius:99px}.toc-nav{overflow:auto;padding:12px 10px 22px}.toc-link{display:block;color:#f8ead2;text-decoration:none;padding:9px 10px;border-radius:12px;font-size:14px;line-height:1.35;margin:2px 0;opacity:.86}.toc-link:hover,.toc-link.active{background:rgba(214,169,79,.18);opacity:1}.toc-link.level-3{padding-left:22px;font-size:13px;color:#e8d4ad}.reader-panel{display:flex;flex-direction:column;min-width:0;background:linear-gradient(90deg,rgba(0,0,0,.035),transparent 36px),var(--paper)}.reader-toolbar{min-height:82px;display:flex;align-items:center;gap:14px;padding:14px 18px;border-bottom:1px solid var(--line);background:rgba(255,250,240,.9);backdrop-filter:blur(10px)}.reader-toolbar h2{margin:0;font-size:22px}.reader-toolbar p{margin:3px 0 0;color:var(--muted);font-size:13px;font-family:Arial,sans-serif}.toolbar-actions{margin-left:auto;display:flex;gap:8px;align-items:center}.tool-btn,.icon-btn{min-width:40px;height:40px;border-radius:13px;background:#f1dfc0;color:#3a2417}.tool-btn:hover,.icon-btn:hover{background:#e5c98e}.close-reader{background:#b23b22;color:white}.menu-btn{display:none}.progress-track{height:4px;background:rgba(0,0,0,.08)}#readingProgress{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:width .1s linear}.book-pages{overflow:auto;padding:50px clamp(24px,5vw,82px);font-size:var(--reader-font);line-height:1.85}.book-section{max-width:920px;margin:0 auto}.book-pages h1{font-size:clamp(38px,6vw,64px);line-height:1.08;color:var(--accent);margin:0 0 30px}.book-pages h2{font-size:clamp(28px,4vw,42px);color:#3a2417;margin:54px 0 18px;padding-bottom:10px;border-bottom:2px solid rgba(178,59,34,.18)}.book-pages h3{font-size:clamp(22px,3vw,30px);color:#7e2113;margin:36px 0 12px}.book-pages p{margin:0 0 18px;text-align:justify}.contents-box{background:#fff6df;border:1px solid rgba(178,59,34,.16);border-radius:20px;padding:22px;margin:18px 0 40px}.toc-header{font-weight:bold;color:var(--accent)}.toc-line{border-bottom:1px dashed rgba(77,48,31,.22);padding:6px 0;margin:0!important}.mark{background:#ffe066;border-radius:4px;padding:0 2px}.dark-mode{--bg:#10100f;--paper:#171512;--ink:#f7ead5;--muted:#c4ad90;--line:rgba(255,255,255,.12)}.dark-mode .reader-panel{background:linear-gradient(90deg,rgba(255,255,255,.035),transparent 36px),var(--paper)}.dark-mode .reader-toolbar{background:rgba(23,21,18,.9)}.dark-mode .book-pages h2{color:#ffe3ad}.dark-mode .tool-btn,.dark-mode .icon-btn{background:#30271e;color:#ffe8c4}.dark-mode .contents-box{background:#211b15}.dark-mode .preview-card,.dark-mode .intro-card{background:rgba(23,21,18,.9);color:var(--ink)}.dark-mode .intro-card h1{color:#ffe8c4}@media(max-width:900px){.reader-shell{grid-template-columns:1fr;width:100vw;height:100vh;margin:0;border-radius:0}.sidebar{position:absolute;z-index:5;width:min(86vw,340px);height:100%;transform:translateX(-105%);transition:.25s ease}.sidebar.open{transform:translateX(0)}.menu-btn{display:inline-grid}.reader-toolbar{height:auto}.toolbar-actions{gap:5px}.book-pages{padding:30px 20px}.intro-card{padding:34px 24px}.reader-toolbar h2{font-size:18px}.reader-toolbar p{display:none}}@media(max-width:560px){.tool-btn{min-width:34px;padding:0 8px}.icon-btn{min-width:36px;height:36px}.intro-text{font-size:17px}.book-pages p{text-align:left}.reader-toolbar{gap:8px;padding:10px}.toolbar-actions{margin-left:0}.reader-toolbar{flex-wrap:wrap}}

/* === FIX: reliable modal scrolling + visible Close/Esc button === */
.reader-shell, .reader-panel, .book-pages { min-height: 0; }
.reader-panel { overflow: hidden; }
.book-pages {
  flex: 1 1 auto;
  height: 100%;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.close-reader {
  width: auto !important;
  min-width: 104px !important;
  padding: 0 14px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #b23b22 !important;
  color: #fff !important;
  font-family: Arial, sans-serif;
}
.close-reader::after {
  content: "Esc";
  font-size: 11px;
  font-weight: 800;
  opacity: .88;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 6px;
  padding: 2px 5px;
}
@media(max-width:900px){
  .book-pages{height: calc(100vh - 96px);}
  .close-reader{min-width: 92px !important;}
}


/* Integration wrapper: matches existing Afar Culture theme */
.ac-book-launch-section{padding:80px 0;background:linear-gradient(135deg,#fff8e6 0%,#f0f4f8 100%);}
.ac-book-launch-section .preview-card{border-top:6px solid var(--accent-gold, #ffd700);font-family:Georgia,"Times New Roman",serif;}
.ac-book-launch-section .preview-card h2{color:var(--primary-blue,#1a3a5c);}
.ac-book-launch-section .primary-btn{font-family:'Poppins',Arial,sans-serif;background:linear-gradient(135deg,var(--primary-blue,#1a3a5c),var(--secondary-blue,#2c5f7c));}
.ac-book-launch-section .ghost-btn{font-family:'Poppins',Arial,sans-serif;color:var(--primary-blue,#1a3a5c);border-color:var(--primary-blue,#1a3a5c);}
.reader-modal{z-index:20000;}
.reader-modal .primary-btn,.reader-modal .ghost-btn,.reader-modal .tool-btn,.reader-modal .icon-btn{font-family:Arial,sans-serif;}
.reader-modal .book-pages{font-family:Georgia,"Times New Roman",serif;color:var(--ink);}
.reader-modal .modal-backdrop{z-index:0;}
.reader-modal .reader-shell{z-index:1;}

/* =========================
   PREVIEW CARD FINAL OVERRIDE
========================= */

.ac-book-launch-section {
  padding-top: 0px !important;
  padding-bottom: 70px !important;
}

.ac-book-launch-section .container {
  display: flex !important;
  justify-content: center !important;
}

.ac-book-launch-section .preview-card {
  width: 94% !important;
  max-width: 980px !important;
  min-height: 380px !important;
  padding: 70px 60px !important;
  margin: -35px auto 0 !important;
  border-radius: 24px !important;
  border-top: 7px solid #ffd700 !important;
  background: linear-gradient(145deg, #fffaf0, #ffffff) !important;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18) !important;
}

.ac-book-launch-section .preview-card h2 {
  font-size: 2.45rem !important;
  margin-bottom: 18px !important;
}

.ac-book-launch-section .preview-card p {
  font-size: 1.12rem !important;
  line-height: 1.85 !important;
}

.ac-book-launch-section .doc-meta {
  display: flex !important;
  justify-content: center !important;
  gap: 22px !important;
  margin-bottom: 25px !important;
}

@media (max-width: 768px) {
  .ac-book-launch-section .preview-card {
    width: 94% !important;
    min-height: auto !important;
    padding: 44px 24px !important;
    margin: -15px auto 0 !important;
  }

  .ac-book-launch-section .preview-card h2 {
    font-size: 1.85rem !important;
  }
}


/* =========================
   READER POPUP FINAL SIZE
========================= */

.reader-panel {
  width: 80% !important;
  max-width: 1280px !important;
  height: 86vh !important;
  max-height: 900px !important;
  margin: 35px auto !important;
  border-radius: 22px !important;
}

/* toolbar should stay fixed height */
.reader-toolbar {
  min-height: 78px !important;
  padding: 16px 22px !important;
}

/* readable scroll area */
.book-pages {
  height: calc(86vh - 115px) !important;
  max-height: calc(900px - 115px) !important;
  overflow-y: auto !important;
  padding: 38px 58px !important;
}

/* slightly bigger reading text */
.book-section {
  max-width: 920px !important;
  margin: 0 auto !important;
}

.book-section p {
  font-size: 1.08rem !important;
  line-height: 1.9 !important;
}

/* Mobile */
@media (max-width: 768px) {
  .reader-panel {
    width: 96% !important;
    height: 90vh !important;
    margin: 18px auto !important;
  }

  .book-pages {
    height: calc(90vh - 120px) !important;
    padding: 26px 20px !important;
  }
}

.book-section p {
  font-size: inherit !important;
}

/* =========================
   MOBILE PREVIEW CARD POLISH
========================= */

@media (max-width: 768px) {
  .ac-book-launch-section {
    padding-top: 0 !important;
    padding-bottom: 55px !important;
  }

  .ac-book-launch-section .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .ac-book-launch-section .preview-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: -10px auto 0 !important;
    padding: 34px 26px 38px !important;
    border-radius: 26px !important;
    border-top-width: 8px !important;
  }

  .ac-book-launch-section .doc-meta {
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 18px !important;
    margin-bottom: 28px !important;
    flex-wrap: wrap !important;
    font-size: 0.95rem !important;
    line-height: 1.35 !important;
  }

  .ac-book-launch-section .doc-meta span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    max-width: 45% !important;
  }

  .ac-book-launch-section .preview-card .eyebrow {
    font-size: 0.9rem !important;
    letter-spacing: 0.2em !important;
    line-height: 1.8 !important;
    margin-bottom: 22px !important;
  }

  .ac-book-launch-section .preview-card h2 {
    font-size: clamp(2.2rem, 9vw, 3rem) !important;
    line-height: 1.05 !important;
    margin-bottom: 22px !important;
    color: #173b5f !important;
  }

  .ac-book-launch-section .preview-card p:not(.eyebrow) {
    font-size: 1.12rem !important;
    line-height: 1.85 !important;
    margin-bottom: 26px !important;
  }

  .ac-book-launch-section .hero-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  .ac-book-launch-section .primary-btn,
  .ac-book-launch-section .ghost-btn {
    width: 100% !important;
    min-height: 56px !important;
    justify-content: center !important;
    font-size: 1rem !important;
    border-radius: 999px !important;
  }
}

@media (max-width: 420px) {
  .ac-book-launch-section .preview-card {
    padding: 30px 22px 34px !important;
  }

  .ac-book-launch-section .doc-meta span {
    max-width: 48% !important;
    font-size: 0.9rem !important;
  }

  .ac-book-launch-section .preview-card h2 {
    font-size: 2.25rem !important;
  }

  .ac-book-launch-section .preview-card p:not(.eyebrow) {
    font-size: 1.04rem !important;
  }
}

/* =========================
   FIX CARD POSITION (FINAL)
========================= */

/* give space between hero & card */
.ac-book-launch-section {
  padding-top: 50px !important;  /* ← increase this if needed */
}

/* remove aggressive negative lift */
.ac-book-launch-section .preview-card {
  margin-top: 0 !important;
  transform: translateY(-20px) !important; /* subtle lift only */
}

/* BOOK COVER STYLE */
.book-cover {
  width: 150px;
  height: 210px;
  object-fit: cover;

  border-radius: 14px;
  margin: 0 auto 22px;

  display: block;

  box-shadow: 0 20px 50px rgba(0,0,0,0.25);

  transition: transform 0.4s ease;
}

/* subtle hover */
.preview-card:hover .book-cover {
  transform: scale(1.05) rotate(-1deg);
}

/* =========================
   KINDLE / MEDIUM TYPOGRAPHY
========================= */

.book-pages {
  background: #fffaf1 !important;
  color: #2f2119 !important;
  font-family: Georgia, "Times New Roman", serif !important;
}

.book-section {
  max-width: 850px !important;
  margin: 0 auto !important;
}

.book-section p {
  font-size: 1.08rem !important;
  line-height: 1.72 !important;
  margin: 0 0 14px !important;
  color: #3d3028 !important;
}

.book-section h1 {
  font-size: clamp(2.8rem, 5vw, 4.2rem) !important;
  line-height: 1.05 !important;
  margin: 35px 0 28px !important;
  color: #b43724 !important;
  font-family: Georgia, "Times New Roman", serif !important;
}

.book-section h2 {
  font-size: clamp(2rem, 4vw, 3rem) !important;
  line-height: 1.15 !important;
  margin: 34px 0 18px !important;
  color: #2f2119 !important;
  border-bottom: 2px solid rgba(180, 55, 36, 0.18) !important;
  padding-bottom: 10px !important;
}

.book-section h3 {
  font-size: 1.45rem !important;
  line-height: 1.3 !important;
  margin: 26px 0 12px !important;
  color: #7c2419 !important;
}

.contents-box {
  background: #fff4d8 !important;
  border: 1px solid rgba(180, 55, 36, 0.22) !important;
  border-radius: 18px !important;
  padding: 22px 28px !important;
  margin: 20px 0 45px !important;
}

.toc-header {
  font-weight: 800 !important;
  color: #b43724 !important;
  font-size: 1.1rem !important;
}

/* Better selected / search highlight feel */
mark {
  background: #ffd700 !important;
  color: #2f2119 !important;
  border-radius: 4px !important;
  padding: 0 3px !important;
}

/* Mobile reading */
@media (max-width: 768px) {
  .book-pages {
    padding: 24px 18px !important;
  }

  .book-section {
    max-width: 100% !important;
  }

  .book-section p {
    font-size: 1rem !important;
    line-height: 1.68 !important;
  }

  .book-section h1 {
    font-size: 2.4rem !important;
  }

  .book-section h2 {
    font-size: 1.9rem !important;
  }
}

/* =========================
   TEXT SPACING REFINEMENT
========================= */

/* Reader (book text) */
.book-section p {
  margin-bottom: 12px !important;   /* reduce gap between paragraphs */
  line-height: 1.65 !important;     /* tighter but still readable */
}

/* Headings spacing */
.book-section h1,
.book-section h2,
.book-section h3 {
  margin-top: 24px !important;
  margin-bottom: 10px !important;
}

/* Card paragraph */
.preview-card p:not(.eyebrow) {
  margin-bottom: 18px !important;
  line-height: 1.7 !important;
}

/* Remove accidental double spacing from Word */
.book-section p + p {
  margin-top: 0 !important;
}

/* =========================
   AMHARIC CULTURE BOOK CARD
========================= */
.book-category {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: #ffd700;
  color: #123a5a;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.am-preview-card,
.am-preview-card .eyebrow,
.am-preview-card h2,
.am-preview-card p,
.am-preview-card button {
  font-family: "Noto Sans Ethiopic", "Noto Sans", "Poppins", Arial, sans-serif !important;
}
.am-preview-card:hover {
  transform: translateY(-28px) scale(1.012) !important;
  box-shadow: 0 38px 96px rgba(0,0,0,.22) !important;
}
.amharic-book-pages,
.amharic-book-section,
.amharic-book-section p,
.amharic-book-section h1,
.amharic-book-section h2,
.amharic-book-section h3 {
  font-family: "Noto Sans Ethiopic", Georgia, "Times New Roman", serif !important;
}
.amharic-book-section p {
  text-align: left !important;
  line-height: 1.85 !important;
}
@media (max-width: 768px) {
  .am-preview-card:hover {
    transform: translateY(-20px) !important;
  }
}

/* ===== FINAL UNIVERSAL READER OPEN/CLOSE FIX ===== */
.reader-modal {
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.reader-modal.open,
.reader-modal.active,
.reader-modal.show,
.reader-modal.is-open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.reader-modal .reader-shell {
  display: grid !important;
}
.book-pages {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.book-section p { font-size: inherit !important; }

/* =========================================================
   FINAL BOOK CARD + READER RESPONSIVE POLISH
   Safe to keep at the end of afar-book.css
========================================================= */
.ac-book-launch-section {
  padding: 45px 0 65px !important;
  overflow-x: hidden !important;
}
.ac-book-launch-section .container {
  display: flex !important;
  justify-content: center !important;
  max-width: 100% !important;
}
.ac-book-launch-section .preview-card {
  width: min(760px, 92vw) !important;
  max-width: 760px !important;
  min-height: auto !important;
  padding: 34px 36px !important;
  margin: 0 auto !important;
  border-radius: 24px !important;
  border-top: 7px solid #ffd700 !important;
  transform: none !important;
  text-align: left !important;
}
.ac-book-launch-section .preview-card:hover {
  transform: translateY(-6px) scale(1.006) !important;
}
.ac-book-launch-section .preview-card h2 {
  font-size: clamp(2rem, 3.8vw, 2.65rem) !important;
  line-height: 1.12 !important;
  margin: 0 0 16px !important;
  text-align: center !important;
}
.ac-book-launch-section .preview-card p {
  font-size: 1rem !important;
  line-height: 1.65 !important;
  margin-bottom: 14px !important;
}
.ac-book-launch-section .preview-card .eyebrow {
  font-size: .9rem !important;
  line-height: 1.55 !important;
  letter-spacing: .22em !important;
  margin: 12px auto 12px !important;
}
.ac-book-launch-section .book-cover {
  width: 112px !important;
  height: 145px !important;
  object-fit: cover !important;
  border-radius: 14px !important;
  margin: 14px auto 18px !important;
  display: block !important;
}
.ac-book-launch-section .doc-meta {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
  margin: 0 0 10px !important;
  font-size: .92rem !important;
  line-height: 1.35 !important;
}
.ac-book-launch-section .hero-actions {
  justify-content: center !important;
  gap: 12px !important;
  margin-top: 16px !important;
}
.ac-book-launch-section .primary-btn,
.ac-book-launch-section .ghost-btn {
  min-height: 48px !important;
  padding: 12px 20px !important;
  border-radius: 999px !important;
}

/* Reader modal: stable desktop/tablet size */
.reader-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.reader-modal.open,
.reader-modal.active,
.reader-modal.show,
.reader-modal.is-open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.reader-modal .reader-shell {
  width: min(1280px, 92vw) !important;
  height: 86vh !important;
  max-height: 900px !important;
  margin: 35px auto !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  display: grid !important;
}
.book-pages {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  font-size: var(--reader-font, 18px) !important;
}
.book-section p { font-size: inherit !important; }

@media (max-width: 768px) {
  .ac-book-launch-section {
    padding: 28px 12px 45px !important;
  }
  .ac-book-launch-section .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .ac-book-launch-section .preview-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px 20px !important;
    border-radius: 22px !important;
  }
  .ac-book-launch-section .preview-card h2 {
    font-size: clamp(1.85rem, 8vw, 2.35rem) !important;
  }
  .ac-book-launch-section .preview-card p {
    font-size: .98rem !important;
    line-height: 1.62 !important;
  }
  .ac-book-launch-section .book-cover {
    width: 86px !important;
    height: 112px !important;
    margin: 10px auto 15px !important;
  }
  .ac-book-launch-section .doc-meta {
    gap: 9px !important;
    font-size: .86rem !important;
  }
  .ac-book-launch-section .hero-actions {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .ac-book-launch-section .primary-btn,
  .ac-book-launch-section .ghost-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .reader-modal .reader-shell {
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  .reader-toolbar {
    min-height: auto !important;
    padding: 10px !important;
    gap: 8px !important;
  }
  .reader-title h2 { font-size: 1rem !important; }
  .toolbar-actions { flex-wrap: wrap !important; }
  .book-pages {
    padding: 22px 16px !important;
  }
}


/* =========================
   FINAL BOOK MODAL FIX
   Fix sidebar scroll + top clipping
========================= */

.reader-modal {
  align-items: center !important;
  justify-content: center !important;
  padding: 22px !important;
  overflow: hidden !important;
}

.reader-shell {
  width: min(94vw, 1480px) !important;
  height: min(88vh, 900px) !important;
  max-height: calc(100vh - 44px) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: 340px 1fr !important;
  overflow: hidden !important;
}

/* LEFT CONTENT TAB / SIDEBAR */
.sidebar {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.sidebar-header {
  flex: 0 0 auto !important;
}

.search-box {
  flex: 0 0 auto !important;
}

.toc-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-bottom: 30px !important;
}

/* RIGHT READER */
.reader-panel {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.reader-toolbar {
  flex: 0 0 auto !important;
}

.progress-track {
  flex: 0 0 auto !important;
}

.book-pages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

/* Mobile */
@media (max-width: 900px) {
  .reader-modal {
    padding: 12px !important;
    align-items: flex-start !important;
  }

  .reader-shell {
    width: 100% !important;
    height: calc(100vh - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    bottom: 12px !important;
    width: min(86vw, 340px) !important;
    height: auto !important;
    z-index: 9999 !important;
  }

  .book-pages {
    padding-top: 24px !important;
  }
}

/* =====================================================
   FINAL READER POLISH - sidebar top clipping + toolbar
   Added for culture/customs readers
===================================================== */
.reader-modal.open,
.reader-modal.active,
.reader-modal.show,
.reader-modal.is-open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 18px !important;
}

.reader-modal .reader-shell {
  height: calc(100dvh - 36px) !important;
  max-height: calc(100dvh - 36px) !important;
  margin: 0 auto !important;
  border-radius: 26px !important;
}

.reader-modal .sidebar-header {
  padding-top: 28px !important;
  padding-bottom: 16px !important;
}

.reader-modal .sidebar-header h2 {
  line-height: 1.15 !important;
  padding-top: 2px !important;
}

.reader-lang-switch {
  min-width: 150px !important;
  height: 44px !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 14px !important;
  padding: 0 14px !important;
  background: #ead6ad !important;
  color: #2e1d13 !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}

.reader-lang-switch:hover,
.reader-lang-switch:focus {
  background: #ffd700 !important;
  color: #1a3a5c !important;
}

.theme-toggle-wide,
#themeToggle {
  min-width: 138px !important;
  padding: 0 18px !important;
  white-space: nowrap !important;
}

@media (max-width: 900px) {
  .reader-modal.open,
  .reader-modal.active,
  .reader-modal.show,
  .reader-modal.is-open {
    padding: 0 !important;
    align-items: stretch !important;
  }
  .reader-modal .reader-shell {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
  .reader-modal .sidebar {
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
  }
  .reader-modal .sidebar-header {
    padding-top: 26px !important;
  }
  .reader-lang-switch {
    min-width: 120px !important;
    max-width: 150px !important;
    height: 40px !important;
    font-size: .9rem !important;
  }
  .theme-toggle-wide,
  #themeToggle {
    min-width: 116px !important;
    max-width: 138px !important;
    font-size: .9rem !important;
  }
}
