
/* Nizam theme (from nizam/src/app/styles.ts) */
:root {
  --books-font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --books-font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --books-font-arabic: 'Amiri', 'Traditional Arabic', 'Segoe UI', serif;
  --books-font-arabic-quran: 'Amiri Quran', 'Amiri', 'Traditional Arabic', serif;
  --books-bg: #FFFFFF;
  --books-bg-alt: #F6F7F8;
  --books-paper: #FFFFFF;
  --books-surface: #FFFFFF;
  --books-surface-elevated: #F6F7F8;
  --books-dark: #1c2328;
  --books-primary: #2a6f70;
  --books-primary-hover: #245f60;
  --books-accent-dark: #245f60;
  --books-accent: #2a6f70;
  --books-accent-soft: #eef5f5;
  --books-text-faint: #8a959c;
  --books-font-nizam-sans: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --books-font-ui: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --books-ink: #1c2328;
  --books-muted: #5c686f;
  --books-line: #eceff1;
  --books-teal: #2a6f70;
  --books-header-height: 78px;
  --books-sidebar-width: 264px;
  --books-text: #0F172A;
  --books-text-muted: #64748B;
  --books-border: #E6EDF3;
  --books-border-strong: #D1DCE6;
  --books-shadow: 0 2px 8px rgba(15,23,42,0.06);
  --books-shadow-md: 0 8px 24px rgba(15,23,42,0.08);
  --books-shadow-lg: 0 20px 40px rgba(15,23,42,0.12);
  --books-radius: 14px;
  --books-radius-sm: 12px;
  --books-radius-pill: 999px;
  --books-container: 1100px;
  --books-pad: 24px;
  --books-reader-size: 1;
  --books-reader-line-height: 1.8;
  --books-reader-max-width: 880px;
  --books-reader-justify: left;
  --books-reader-font: 'The Seasons', 'EB Garamond', Garamond, Georgia, serif;
  --books-ayah-line-height: 1.95;
  --books-ayah-align: left;
  --books-arabic-relative: 1;
  --books-reader-letter-spacing: 0;
  --books-reader-word-spacing: 0;
  --books-reader-p-gap: 1em;
  --books-reader-font-weight: 400;
  --books-reader-hyphens: none;
  --books-reader-heading-scale: 1;
  --books-highlight-bg: rgba(234, 179, 8, 0.38);
}
@media (min-width: 768px) { :root { --books-pad: 28px; } }
@media (max-width: 640px) { :root { --books-pad: 18px; } }
@media (max-width: 380px) { :root { --books-pad: 14px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
html.books-reader-motion-reduce { scroll-behavior: auto !important; }
html.books-reader-motion-reduce * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--books-primary); outline-offset: 2px; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible,
.books-shelf:focus-visible, .books-tag:focus-visible, .books-filter-chip:focus-visible,
.books-reader-controls button:focus-visible, .books-reader-controls select:focus-visible {
  outline: 2px solid var(--books-primary); outline-offset: 2px; box-shadow: 0 0 0 1px var(--books-paper);
}
.books-skip-link {
  position: absolute; top: -100px; left: 0; z-index: 999;
  padding: 12px 20px; background: var(--books-primary); color: #fff;
  font-weight: 400; text-decoration: none; border-radius: 0 0 8px 0;
}
.books-skip-link:focus { top: 0; outline: 2px solid #fff; outline-offset: 2px; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
body {
  font-family: var(--books-font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--books-text);
  background: #FFFFFF;
  min-height: 100vh;
  position: relative;
}
strong, b, th, h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  pointer-events: none;
  z-index: 0;
}
.books-portal { position: relative; z-index: 1; }

.books-container { max-width: var(--books-container); width: 100%; margin: 0 auto; padding: 0 var(--books-pad); box-sizing: border-box; }
.books-main { max-width: 100%; overflow-x: clip; overflow-y: visible; box-sizing: border-box; padding: 0; }
#books-list-view {
  font-family: var(--books-font-body);
  overflow: visible;
}
#books-list-view > section:not(.books-hero) {
  max-width: var(--books-container);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.books-portal { min-height: 100vh; display: flex; flex-direction: column; }

/* Header - cinematic Books landing */
.books-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  color: var(--books-text);
  min-height: 78px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--books-border);
  box-shadow: 0 2px 12px rgba(15,23,42,0.04);
  backdrop-filter: none;
}
/* Hide main Books header in reader — only progress bar + options show */
body.books-reader-active .books-header { display: none !important; }
html.books-maktabah-embed .books-header,
html.books-maktabah-embed .books-mobile-menu,
body.books-maktabah-embed .books-header,
body.books-maktabah-embed .books-mobile-menu { display: none !important; }
html.books-maktabah-embed .books-library-shell,
html.books-maktabah-embed .books-footer { display: none !important; }
.books-coming-soon { display: none; }
html.books-maktabah-embed .books-coming-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 88px 24px 120px;
  background: #fff;
  color: #1c2328;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  text-align: center;
}
html.books-maktabah-embed .library-books-header{
  position:sticky;top:0;z-index:80;
  background:#fff;border-bottom:1px solid rgba(28,35,40,.06);
  font-family:'EB Garamond',Garamond,Georgia,serif;
}
html.books-maktabah-embed .library-books-header-inner{
  width:min(1200px,calc(100% - 48px));min-height:76px;margin:0 auto;
  padding:16px 0;display:flex;align-items:center;gap:24px;flex-wrap:nowrap;
}
html.books-maktabah-embed .library-books-logo{
  display:flex;align-items:center;gap:12px;color:#1c2328;text-decoration:none;flex:0 0 auto;
}
html.books-maktabah-embed .library-books-logo .maktabah-logo{
  width:40px;height:40px;border-radius:10px;object-fit:contain;display:block;
}
html.books-maktabah-embed .library-books-logo-title{
  font-size:1.22rem;font-weight:600;letter-spacing:0;line-height:1;
}
html.books-maktabah-embed .library-books-nav{
  display:flex;align-items:center;gap:22px;margin-left:auto;overflow:auto;
}
html.books-maktabah-embed .library-books-link,
html.books-maktabah-embed .library-books-signin{
  display:inline-flex;align-items:center;min-height:38px;padding:8px 2px;
  border:0;background:transparent;color:#5a656d;text-decoration:none;
  font-family:'EB Garamond',Garamond,Georgia,serif;font-size:.98rem;font-weight:500;
}
html.books-maktabah-embed .library-books-link:hover,
html.books-maktabah-embed .library-books-signin:hover{color:#1c2328}
html.books-maktabah-embed .library-books-link.active{
  color:#2a6f70;border-bottom:1.5px solid #2a6f70;padding-bottom:5px;
}
html.books-maktabah-embed .library-books-auth{display:flex;align-items:center;flex:0 0 auto}
@media(max-width:900px){
  html.books-maktabah-embed .library-books-header-inner{width:calc(100% - 28px);gap:12px}
  html.books-maktabah-embed .library-books-logo-title{display:none}
}
.books-header-inner { display: flex; align-items: center; justify-content: flex-start; width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 16px 0; gap: 24px; flex-wrap: nowrap; min-height: 76px; }
.books-header-inner.books-container { max-width: none; }
.books-header-auth { display: flex; align-items: center; gap: 0; margin-left: 0; flex: 0 0 auto; }
.books-btn-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 38px;
  padding: 8px 2px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #5a656d;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: .98rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.15s;
}
.books-btn-signin:hover { background: transparent; color: #1c2328; border: 0; }
.books-google-mark {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 999px;
  background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
}
.books-user-wrap { display: flex; align-items: center; gap: 12px; }
.books-user-name { font-size: 14px; font-weight: 400; color: var(--books-text-muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.books-btn-signout {
  min-height: 0;
  padding: 8px 14px;
  border-radius: var(--books-radius-sm);
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  color: var(--books-text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.books-btn-signout:hover { background: var(--books-bg-alt); color: var(--books-text); border-color: var(--books-border-strong); }
.books-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #1c2328;
  font-weight: 400;
  transition: opacity 0.2s;
}
.books-logo:hover { opacity: 0.85; }
.books-logo-img {
  width: 52px;
  height: 52px;
  border-radius: 0;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent;
}
.books-logo-title {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 1.22rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: #1c2328;
}
.books-mobile-menu-btn,
.books-mobile-menu {
  display: none;
}
.books-mobile-menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
}
.books-mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--books-text);
}
.books-mobile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: var(--books-pad);
  left: auto;
  width: min(320px, calc(100vw - (var(--books-pad) * 2)));
  padding: 10px 16px 14px;
  background: var(--books-paper);
  border: 1px solid var(--books-border);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.08);
  z-index: 40;
}
.books-mobile-menu-link {
  display: block;
  padding: 12px 0;
  text-decoration: none;
  color: var(--books-text);
  font-size: 15px;
  font-weight: 400;
  border-bottom: 1px solid var(--books-border);
}
.books-mobile-menu-auth {
  padding-top: 12px;
}
.books-mobile-user-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.books-mobile-user-name {
  font-size: 13px;
  color: var(--books-text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.books-mobile-auth-btn {
  width: 100%;
  justify-content: center;
}

.books-header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.books-topbar-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--books-radius-pill);
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  color: var(--books-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.books-topbar-link:hover {
  background: var(--books-bg-alt);
  border-color: var(--books-border-strong);
  color: var(--books-primary);
  box-shadow: 0 0 0 3px rgba(14,116,144,0.12);
}

/* Copyright / policy — editorial layout; body copy = serif (--books-font-body) */
.books-nizam-marketing {
  font-family: var(--books-font-body);
  color: var(--books-text);
  line-height: 1.65;
  margin-left: calc(-1 * var(--books-pad));
  margin-right: calc(-1 * var(--books-pad));
  width: calc(100% + 2 * var(--books-pad));
  box-sizing: border-box;
  padding-bottom: 48px;
}
.books-nizam-marketing p,
.books-nizam-marketing .books-mk-band-intro,
.books-mk-page-stats-item,
.books-mk-key-strip-item span {
  font-family: var(--books-font-body);
}
.books-nizam-marketing h1,
.books-nizam-marketing h2,
.books-nizam-marketing h3 {
  font-family: var(--books-font-display);
}
.books-mk-page-hero-premium {
  padding: 32px 0 80px;
  position: relative;
}
.books-mk-hero-top {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--books-pad);
  box-sizing: border-box;
  text-align: left;
}
.books-mk-hero-top .books-mk-back {
  margin-bottom: 0;
}
.books-mk-hero-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px var(--books-pad) 0;
  position: relative;
  z-index: 1;
  text-align: center;
}
.books-mk-hero-content::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 120%;
  background: radial-gradient(ellipse 50% 50%, rgba(47, 150, 150, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.books-mk-back {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--books-primary);
  text-decoration: none;
  transition: opacity 0.2s;
  font-family: var(--books-font-body);
}
.books-mk-back:hover { opacity: 0.85; text-decoration: underline; }
.books-mk-kicker {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--books-accent-soft);
  color: var(--books-accent-dark);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  margin: 0 0 20px;
  font-family: var(--books-font-body);
}
.books-mk-page-hero-premium h1 {
  font-size: clamp(2.75rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin: 0 0 20px;
  color: var(--books-text);
  font-weight: 400;
  position: relative;
}
.books-mk-hero-lead {
  font-size: 1.2rem;
  line-height: 1.7;
  max-width: 36rem;
  margin: 0 auto 28px;
  color: var(--books-text-muted);
  position: relative;
}
.books-mk-trust-line {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--books-border);
  font-size: 0.95rem;
  color: var(--books-text-muted);
  letter-spacing: 0.01em;
  position: relative;
}
.books-mk-page-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 28px 0 0;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}
.books-mk-page-stats-item {
  font-size: 0.95rem;
  color: var(--books-text-muted);
  font-weight: 500;
}
.books-mk-page-stats-item strong {
  display: block;
  font-family: var(--books-font-display);
  font-size: 1.25rem;
  color: var(--books-accent-dark);
  margin-bottom: 6px;
  font-weight: 400;
}
.books-mk-section-band {
  padding: 56px 0;
  background: linear-gradient(180deg, var(--books-bg-alt) 0%, var(--books-bg) 100%);
  border-top: 1px solid var(--books-border);
  border-bottom: 1px solid var(--books-border);
}
.books-mk-section-band-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--books-pad);
  box-sizing: border-box;
}
.books-mk-band-head {
  text-align: left;
  margin-bottom: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--books-border);
}
.books-mk-features-title {
  font-family: var(--books-font-display);
  font-size: clamp(1.45rem, 3vw, 1.7rem);
  font-weight: 400;
  margin: 0 0 10px;
  color: var(--books-text);
  letter-spacing: -0.02em;
}
.books-mk-band-intro {
  margin: 0;
  font-size: 1.05rem;
  color: var(--books-text-muted);
  line-height: 1.65;
  max-width: 42rem;
}
.books-mk-chapter-list {
  padding: 8px 0 0;
}
.books-mk-chapter {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 22px 20px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--books-border);
}
.books-mk-chapter:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.books-mk-chapter-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--books-accent-soft) 0%, rgba(47, 150, 150, 0.12) 100%);
  color: var(--books-accent-dark);
  font-family: var(--books-font-display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(47, 150, 150, 0.1);
}
.books-mk-chapter-body h3 {
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0 0 10px;
  color: var(--books-text);
  letter-spacing: -0.01em;
}
.books-mk-chapter-body p {
  margin: 0;
  color: var(--books-text-muted);
  font-size: 1.02rem;
  line-height: 1.75;
}
.books-mk-features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--books-pad) 48px;
  box-sizing: border-box;
}
.books-mk-features-editorial {
  padding-top: 8px;
}
.books-mk-prose-stack {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  margin-bottom: 12px;
}
.books-mk-features-editorial .books-mk-highlight-box,
.books-mk-features-editorial .books-mk-key-strip,
.books-mk-features-editorial > .books-mk-cta-block {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.books-mk-prose-block {
  padding: 40px 0;
  border-bottom: 1px solid var(--books-border);
}
.books-mk-prose-block:first-child {
  padding-top: 32px;
}
.books-mk-prose-block:last-of-type {
  border-bottom: none;
}
.books-mk-prose-block h2 {
  font-size: 1.35rem;
  margin: 0 0 14px;
  color: var(--books-text);
  letter-spacing: -0.02em;
  font-weight: 400;
}
.books-mk-prose-block p {
  margin: 0;
  color: var(--books-text-muted);
  line-height: 1.8;
  font-size: 1.05rem;
}
.books-mk-highlight-box {
  position: relative;
  margin: 40px 0;
  padding: 36px 36px 40px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, var(--books-paper) 40%),
    linear-gradient(135deg, var(--books-accent-soft) 0%, rgba(231, 246, 245, 0.35) 45%, var(--books-paper) 100%);
  border: 1px solid rgba(47, 150, 150, 0.16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 12px 40px rgba(15, 23, 42, 0.06),
    0 4px 16px rgba(47, 150, 150, 0.06);
  overflow: hidden;
}
.books-mk-highlight-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--books-primary), var(--books-primary-hover), var(--books-primary));
  opacity: 0.9;
}
.books-mk-highlight-box-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.books-mk-highlight-ornament {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: 2px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--books-accent-soft), rgba(47, 150, 150, 0.12));
  color: var(--books-accent-dark);
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(47, 150, 150, 0.12);
}
.books-mk-highlight-box h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--books-text);
}
.books-mk-highlight-intro {
  margin: 0 0 18px;
  color: var(--books-text-muted);
  line-height: 1.65;
  font-size: 1.02rem;
  font-family: var(--books-font-body);
}
.books-mk-commitment-quote {
  position: relative;
  margin: 0 0 22px;
  padding: 22px 24px 24px 26px;
  border-radius: 16px;
  background: var(--books-paper);
  border: 1px solid var(--books-border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.books-mk-commitment-quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--books-primary), var(--books-primary-hover));
  opacity: 0.95;
}
.books-mk-commitment-quote p {
  margin: 0;
  padding-left: 18px;
  color: var(--books-text);
  font-size: 1.08rem;
  line-height: 1.78;
  font-weight: 500;
  font-family: var(--books-font-body);
}
.books-mk-highlight-footer {
  margin: 0;
  color: var(--books-text-muted);
  line-height: 1.75;
  font-size: 1.02rem;
  font-family: var(--books-font-body);
}
.books-mk-key-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 40px 0;
  margin: 24px 0;
  border-top: 1px solid var(--books-border);
  border-bottom: 1px solid var(--books-border);
}
.books-mk-key-strip-item { text-align: center; padding: 0 8px; }
.books-mk-key-strip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--books-primary);
  margin: 0 auto 12px;
  opacity: 0.9;
}
.books-mk-key-strip-item strong {
  display: block;
  font-family: var(--books-font-display);
  font-size: 1.1rem;
  color: var(--books-text);
  margin-bottom: 4px;
  font-weight: 400;
}
.books-mk-key-strip-item span {
  font-size: 0.9375rem;
  color: var(--books-text-muted);
  line-height: 1.5;
}
.books-mk-cta-block {
  border-radius: 20px;
  padding: 48px 40px;
  background: linear-gradient(135deg, rgba(47, 150, 150, 0.08) 0%, var(--books-paper) 50%);
  border: 1px solid rgba(47, 150, 150, 0.18);
  box-shadow: 0 8px 32px rgba(47, 150, 150, 0.06);
  margin: 32px 0;
}
.books-mk-cta-block h2 {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  margin-bottom: 8px;
}
.books-mk-cta-block p {
  margin: 0;
  color: var(--books-text-muted);
  line-height: 1.75;
  font-size: 1.02rem;
  font-family: var(--books-font-body);
}
.books-mk-cta-block--narrow {
  display: inline-block;
  text-align: left;
  min-width: min(100%, 420px);
  width: 100%;
  box-sizing: border-box;
}
.books-mk-subpage-cta {
  margin-top: 48px;
  padding: 40px 0 0;
  text-align: center;
}
.books-mk-subpage-cta .books-mk-cta-block--narrow { margin-inline: auto; }
.books-mk-subpage-cta p {
  font-family: var(--books-font-body);
  color: var(--books-text-muted);
  font-size: 1.02rem;
}
.books-mk-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}
.books-mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  font-size: 1.0625rem;
  font-weight: 400;
  border-radius: 14px;
  text-decoration: none;
  color: var(--books-text);
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  transition: box-shadow 0.2s, transform 0.2s;
  font-family: var(--books-font-body);
  cursor: pointer;
}
.books-mk-btn:hover {
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(47, 150, 150, 0.12);
}
.books-mk-btn-primary {
  background: linear-gradient(180deg, var(--books-primary) 0%, var(--books-accent-dark) 100%);
  border-color: var(--books-accent-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(47, 150, 150, 0.28);
}
.books-mk-btn-primary:hover {
  color: #fff;
  box-shadow: 0 6px 20px rgba(47, 150, 150, 0.38);
}
@media (max-width: 900px) {
  .books-mk-page-stats { grid-template-columns: 1fr; gap: 16px; }
  .books-mk-key-strip { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
}
@media (max-width: 640px) {
  .books-mk-page-hero-premium { padding: 24px 0 48px; }
  .books-mk-chapter {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 22px 0;
  }
  .books-mk-chapter-num { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 12px; }
  .books-mk-prose-block { padding: 28px 0; }
  .books-mk-cta-block { padding: 32px 24px; }
  .books-mk-highlight-box { padding: 28px 22px 32px; }
  .books-mk-highlight-ornament { width: 40px; height: 40px; font-size: 1rem; }
  .books-mk-highlight-box h3 { font-size: 1.2rem; }
  .books-mk-commitment-quote { padding: 16px 16px 18px 18px; }
  .books-mk-commitment-quote p { font-size: 1.02rem; padding-left: 14px; }
}

/* Hero - Safhah cinematic landing */
.books-hero {
  position: relative;
  min-height: calc(100vh - 52px);
  border-radius: 0;
  overflow: hidden;
  margin: 0 calc(50% - 50vw) 0;
  display: block;
  text-align: left;
  background: #031012;
  border: 0;
  box-shadow: none;
}
.books-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 36%, rgba(9, 74, 76, 0.26), transparent 33%),
    linear-gradient(90deg, rgba(2, 10, 11, 0.84) 0%, rgba(2, 10, 11, 0.62) 40%, rgba(2, 10, 11, 0.08) 70%, rgba(2, 10, 11, 0.06) 100%);
  z-index: 1;
  pointer-events: none;
}
.books-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("/books/api/file/books/hero-background.png");
  background-size: auto 100%;
  background-position: right -128px;
  background-repeat: no-repeat;
  opacity: 1;
  pointer-events: none;
}
.books-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.02) 62%, rgba(0,0,0,0.26) 100%);
  z-index: 2;
  pointer-events: none;
}
.books-hero-content {
  position: relative;
  z-index: 3;
  min-height: calc(100vh - 52px);
  padding-top: clamp(92px, 12vh, 126px);
  padding-bottom: 36px;
  display: grid;
  grid-template-columns: 720px minmax(0, 1fr);
  align-content: start;
}
.books-hero-content.books-container { max-width: 1368px; padding-left: 0; padding-right: 0; }
.books-hero-copy {
  max-width: 720px;
}
.books-hero-kicker {
  margin: 0 0 20px;
  color: #e4b666;
  font-family: var(--books-font-nizam-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.books-hero-title {
  font-family: var(--books-font-display);
  font-size: clamp(4rem, 5.3vw, 4.65rem);
  font-weight: 500;
  margin: 0 0 26px;
  color: #fff8ef;
  letter-spacing: 0;
  line-height: 0.98;
  text-shadow: 0 12px 38px rgba(0,0,0,0.45);
}
.books-hero-title span {
  display: block;
}
.books-hero-title span:nth-child(2) {
  color: #c99a5b;
}
.books-hero-subtitle {
  font-family: var(--books-font-nizam-sans);
  font-size: 20px;
  color: rgba(255,250,240,0.74);
  margin: 0 0 42px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0;
}
.books-hero-storytelling,
.books-hero-notes-btn,
.books-hero-accent {
  display: none !important;
}
.books-hero-search { margin-bottom: 30px; }
.books-hero-search .books-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 72px;
  background: rgba(7, 23, 25, 0.72);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 18px 52px rgba(0,0,0,0.25);
  max-width: 616px;
  margin: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(18px);
}
.books-hero-search .books-search-wrap:focus-within {
  border-color: rgba(232,185,99,0.58);
  box-shadow: 0 0 0 3px rgba(232,185,99,0.12), 0 18px 52px rgba(0,0,0,0.25);
}
.books-hero-search .books-search-icon {
  width: 21px;
  height: 21px;
  margin-left: 26px;
  border: 2px solid rgba(255,255,255,0.78);
  border-radius: 999px;
  flex: 0 0 auto;
}
.books-hero-search .books-search-icon::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 2px;
  background: rgba(255,255,255,0.78);
  transform: translate(14px, 15px) rotate(45deg);
  border-radius: 999px;
}
.books-hero-search .books-search-input {
  height: 70px;
  padding: 0 72px 0 22px;
  color: #fffaf0;
  font-family: var(--books-font-nizam-sans);
  font-size: 17px;
}
.books-hero-search .books-search-input::placeholder {
  color: rgba(255,255,255,0.52);
}
.books-hero-search-go {
  position: absolute;
  right: 16px;
  top: 12px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ecc069, #d6a14e);
  color: #171009;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(214,161,78,0.28);
}
.books-hero-topics {
  margin-top: 26px;
}
.books-hero-topics-label {
  margin: 0 0 14px;
  color: rgba(255,255,255,0.78);
  font-family: var(--books-font-nizam-sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.books-hero-topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.books-hero-topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(5, 19, 20, 0.68);
  color: #fff7e8;
  font-family: var(--books-font-nizam-sans);
  font-size: 14px;
  cursor: pointer;
}
.books-hero-topic-chip span[aria-hidden="true"] {
  color: #e3b463;
  font-size: 0;
}
.books-hero-topic-chip span[aria-hidden="true"]::before {
  font-size: 15px;
}
.books-hero-topic-chip:nth-child(1) span[aria-hidden="true"]::before,
.books-hero-topic-chip:nth-child(5) span[aria-hidden="true"]::before { content: "□"; }
.books-hero-topic-chip:nth-child(2) span[aria-hidden="true"]::before { content: "◎"; }
.books-hero-topic-chip:nth-child(3) span[aria-hidden="true"]::before { content: "⚖"; }
.books-hero-topic-chip:nth-child(4) span[aria-hidden="true"]::before { content: "⌁"; }
}
.books-hero-topic-more {
  color: #caa05d;
  padding-right: 16px;
}
.books-hero-meta,
.books-hero .books-reading-insights {
  display: none !important;
}
.books-hero-meta-badge {
  display: inline-block;
  padding: 0;
  background: transparent;
  color: inherit;
  font-weight: 500;
  border-radius: 0;
  margin-right: 0;
}
.books-hero-meta .books-hero-meta-badge { color: inherit; }
.books-hero-stats {
  grid-column: 1 / span 2;
  align-self: end;
  width: min(1112px, calc(100vw - 2 * var(--books-pad)));
  height: 104px;
  margin-top: clamp(120px, 14vh, 150px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(8,24,25,0.78), rgba(19,25,23,0.76));
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 60px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
}
.books-hero-stat {
  min-height: 0;
  height: 104px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 54px 1fr;
  grid-template-rows: 1fr 1fr;
  column-gap: 16px;
  align-items: center;
  padding: 22px 38px;
  color: #fff8ee;
  font-family: var(--books-font-nizam-sans);
}
.books-hero-stat + .books-hero-stat {
  border-left: 1px solid rgba(255,255,255,0.12);
}
.books-hero-stat-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: #e8b866;
  font-size: 0;
}
.books-hero-stat-icon::before {
  font-size: 28px;
  line-height: 1;
}
.books-hero-stat:nth-child(1) .books-hero-stat-icon::before { content: "□"; }
.books-hero-stat:nth-child(2) .books-hero-stat-icon::before { content: "✎"; }
.books-hero-stat:nth-child(3) .books-hero-stat-icon::before { content: "⚑"; }
.books-hero-stat:nth-child(4) .books-hero-stat-icon::before { content: "◷"; }
.books-hero-stat strong {
  align-self: end;
  font-family: var(--books-font-display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}
.books-hero-stat span:last-child {
  align-self: start;
  color: rgba(255,255,255,0.78);
  font-size: 16px;
}
.books-reading-insights {
  font-size: 13px;
  color: var(--books-text-muted);
  margin: 10px 0 0;
  font-weight: 500;
  line-height: 1.5;
}
.books-reading-insights[hidden] { display: none !important; }
.books-reader-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}
.books-reader-load-more-btn {
  min-width: 220px;
}
.books-hero-review-btn { position: relative; }
.books-hero-review-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--books-primary);
  color: var(--books-paper);
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
  text-align: center;
}
.books-hero-review-badge[hidden] { display: none !important; }
.books-review-modal-list { display: flex; flex-direction: column; gap: 12px; max-height: 50vh; overflow: auto; }
.books-review-card {
  padding: 14px 16px;
  border: 1px solid var(--books-border);
  border-radius: var(--books-radius-sm);
  background: var(--books-paper);
}
.books-review-card-prompt { margin: 0 0 8px; font-weight: 400; }
.books-review-card-arabic { margin: 0 0 10px; font-size: 1.1em; line-height: 1.8; }
.books-review-card-actions { display: flex; gap: 8px; }
.books-glossary-popover {
  position: fixed;
  z-index: 12000;
  max-width: 300px;
  padding: 14px 16px 16px;
  border-radius: var(--books-radius-sm);
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.books-glossary-popover[hidden] { display: none !important; }
.books-glossary-popover-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--books-text-muted);
}
.books-glossary-popover-term { font-weight: 400; margin: 0 24px 8px 0; color: var(--books-primary); }
.books-glossary-popover-body { font-size: 14px; line-height: 1.55; color: var(--books-text); }
.books-glossary-trigger { cursor: pointer; }
.books-ayah-tappable { cursor: pointer; border-radius: 6px; transition: background 0.15s; }
.books-ayah-tappable:hover, .books-ayah-tappable:focus { background: var(--books-accent-soft); outline: none; }
.books-ayah-panel {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.books-ayah-panel[hidden] { display: none !important; }
.books-ayah-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.books-ayah-panel-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 85vh;
  overflow: auto;
  margin: 16px;
  padding: 20px;
  border-radius: var(--books-radius);
  background: var(--books-paper);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.books-ayah-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.books-ayah-panel-head h3 { margin: 0; }
.books-ayah-panel-close { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.books-ayah-panel-ref { margin: 0 0 12px; color: var(--books-text-muted); font-size: 13px; }
.books-ayah-panel-arabic { font-size: 1.35em; line-height: 2; margin-bottom: 12px; text-align: right; }
.books-ayah-panel-translation { line-height: 1.6; margin-bottom: 12px; }
.books-ayah-panel-tafsir { font-size: 14px; color: var(--books-text-muted); line-height: 1.55; }
.books-ayah-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.books-reader-hadith-grade {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
  background: var(--books-accent-soft);
  color: var(--books-primary);
}
.books-reader-hadith-grade.is-sahih { background: #e8f5e9; color: #2e7d32; }
.books-reader-hadith-grade.is-hasan { background: #fff8e1; color: #f57f17; }
.books-reader-hadith-grade.is-daif { background: #ffebee; color: #c62828; }
.books-reader-hadith-chain, .books-reader-hadith-narrator {
  margin-top: 8px;
  font-size: 13px;
  color: var(--books-text-muted);
  line-height: 1.5;
}
.books-cross-ref-book { display: block; font-size: 13px; font-weight: 400; margin-top: 6px; color: var(--books-primary); }
.books-cross-ref-author { display: block; font-size: 12px; color: var(--books-text-muted); }
.books-scholar-mode .books-reader-block-ref,
.books-scholar-mode .books-reader-bib-entry,
.books-scholar-mode .books-reader-source-citation,
.books-scholar-mode .books-reader-hadith-grade,
.books-scholar-mode .books-reader-hadith-chain {
  outline: 1px dashed var(--books-border-strong);
  outline-offset: 3px;
  border-radius: 4px;
}
.books-ayah-panel-tafsir-label { display: block; font-size: 12px; color: var(--books-text-muted); margin: 8px 0 4px; }
.books-ayah-panel-tafsir-select { width: 100%; margin-bottom: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--books-border); font-family: inherit; }
.books-btn-hero {
  padding: 12px 22px;
  border-radius: var(--books-radius-sm);
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}
.books-btn-hero:first-child {
  background: var(--books-primary);
  color: var(--books-paper);
  border-color: var(--books-primary);
}
.books-btn-hero:first-child:hover { background: var(--books-primary-hover); border-color: var(--books-primary-hover); }
.books-btn-hero-ghost {
  background: var(--books-paper);
  color: var(--books-text);
  border: 1px solid var(--books-border);
}
.books-btn-hero-ghost:hover { border-color: var(--books-primary); color: var(--books-primary); }
@media (max-width: 640px) {
  .books-hero {
    min-height: auto;
    margin: 0 calc(50% - 50vw) 32px;
    margin-bottom: 32px;
    border-radius: 0;
  }
  .books-hero-content {
    min-height: auto;
    display: block;
    padding: 54px 18px 28px;
    text-align: left;
  }
  .books-hero-title {
    font-size: clamp(3rem, 15vw, 4.1rem);
    margin-bottom: 20px;
    line-height: 0.98;
    letter-spacing: 0;
  }
  .books-hero-subtitle {
    font-size: 17px;
    margin: 0 0 28px;
    max-width: 32ch;
  }
  .books-hero-search { margin-bottom: 24px; }
  .books-hero-search .books-search-wrap {
    max-width: 100%;
    height: 62px;
    border-radius: 16px;
  }
  .books-hero-search .books-search-input {
    height: 60px;
    font-size: 15px;
    padding-right: 64px;
  }
  .books-hero-search-go {
    width: 42px;
    height: 42px;
    top: 10px;
    right: 10px;
    font-size: 24px;
  }
  .books-hero-topic-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .books-hero-topic-chip {
    flex: 0 0 auto;
  }
  .books-hero-stats {
    width: 100%;
    margin-top: 36px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .books-hero-stat {
    min-height: 92px;
    padding: 18px 16px;
    grid-template-columns: 42px 1fr;
    column-gap: 12px;
  }
  .books-hero-stat:nth-child(odd) {
    border-left: 0;
  }
  .books-hero-stat:nth-child(n+3) {
    border-top: 1px solid rgba(255,255,255,0.12);
  }
  .books-hero-stat-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  .books-hero-stat strong {
    font-size: 22px;
  }
  .books-hero-stat span:last-child {
    font-size: 13px;
  }
  .books-hero-meta { margin-top: 8px; width: 100%; text-align: left; }
  .books-hero-meta-badge {
    font-size: 13px;
  }
  .books-tags-section { margin-bottom: 28px; padding: 20px 4px; border-radius: 16px; }
  .books-shelves-heading, .books-tags-heading, .books-filters-heading { margin-bottom: 12px; }
  .books-filters-heading, .books-tags-heading { padding-top: 18px; margin-top: 18px; }
  .books-shelves, .books-filter-chips { gap: 8px; }
  .books-shelf { padding: 10px 16px; font-size: 14px; }
  .books-filter-chip { padding: 9px 14px; font-size: 13px; }
  .books-collections-wrap { margin-top: 4px; }
  .books-collections-select { min-width: 140px; }
}
@media (max-width: 640px) {
  .books-header {
    position: relative;
    overflow: visible;
  }
  .books-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0 10px;
  }
  .books-logo {
    justify-content: flex-start;
    min-width: 0;
    gap: 10px;
  }
  .books-logo-img {
    width: 44px;
    height: 44px;
  }
  .books-header-nav,
  .books-header-auth {
    display: none !important;
  }
  .books-logo-title {
    font-size: 1.08rem;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .books-mobile-menu-btn {
    display: inline-flex !important;
    flex-direction: column;
    flex-shrink: 0;
  }
  .books-mobile-menu {
    display: block !important;
  }
  .books-mobile-menu[hidden] {
    display: none !important;
  }
  .books-btn-signin,
  .books-btn-signout {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 999px;
  }
}
/* Notes modal (library-level) */
.books-notes-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
}
.books-notes-modal[hidden] { display: none !important; }
.books-notes-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(4px);
}
.books-notes-modal-content {
  position: relative;
  width: 100%; max-width: 420px; max-height: 85vh;
  background: var(--books-paper);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
  padding: 24px;
  display: flex; flex-direction: column;
}
.books-notes-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.books-notes-modal-header h2 {
  margin: 0; font-size: 1.35rem; font-weight: 400;
  color: var(--books-text);
}
.books-notes-modal-actions {
  display: flex; align-items: center; gap: 8px;
}
.books-notes-export-btn {
  font-size: 0.85rem; padding: 6px 12px;
}
.books-collection-name-content { max-width: 420px; }
.books-collection-name-label {
  display: block; font-size: 0.9rem; font-weight: 400;
  margin-bottom: 8px; color: var(--books-text);
}
.books-collection-name-input {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border: 1px solid var(--books-border);
  border-radius: var(--books-radius-sm); font-size: 1rem;
  margin-bottom: 16px;
}
.books-collection-name-actions {
  display: flex; justify-content: flex-end; gap: 10px;
}
.books-reader-block-wrap { display: block; }
.books-notes-modal-close {
  width: 36px; height: 36px; border: none; border-radius: 10px;
  background: var(--books-bg-alt); font-size: 22px; line-height: 1;
  cursor: pointer; color: var(--books-text-muted);
  transition: background 0.2s, color 0.2s;
}
.books-notes-modal-close:hover { background: var(--books-border); color: var(--books-text); }
.books-notes-modal-hint {
  font-size: 13px; color: var(--books-text-muted);
  margin: 0 0 16px; line-height: 1.5;
}
.books-notes-modal-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.books-notes-modal-list a {
  display: block; padding: 14px 16px;
  background: var(--books-bg-alt); border-radius: 12px;
  color: var(--books-text); text-decoration: none;
  font-weight: 400; font-size: 14px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.books-notes-modal-list a:hover {
  background: var(--books-accent-soft);
  border-color: var(--books-primary);
}
.books-notes-modal-empty {
  font-size: 14px; color: var(--books-text-muted);
  text-align: center; padding: 24px 16px;
  margin: 0;
}

/* Mobile — reader and overall layout */
@media (max-width: 767px) {
  .books-reader-scroll { padding-top: 128px; }
  .books-reader-header-row {
    padding: 12px var(--books-pad) 10px;
    gap: 10px;
  }
  .books-reader-title { font-size: 15px; }
  .books-reader-back, .books-reader-menu-btn,
  .books-reader-font-btn, .books-reader-bookmark, .books-reader-goto-bookmark,
  .books-reader-toc-btn, .books-reader-annotations {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .books-reader-bookmark, .books-reader-goto-bookmark { min-width: auto; }
  .books-reader-nav-bar {
    flex-direction: row;
    padding: 10px var(--books-pad);
    gap: 8px;
  }
  .books-reader-nav-bar .books-reader-nav-prev,
  .books-reader-nav-bar .books-reader-nav-next,
  .books-reader-nav-bar .books-reader-mark-complete {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
  }
  .books-reader-content { padding: 24px 0 80px; }
  .books-detail-hero-title { font-size: 1.55rem; word-wrap: break-word; overflow-wrap: break-word; }
  .books-similar-card-cover { aspect-ratio: 16 / 10; }
  .books-detail-hero { border-radius: 14px; max-width: 100%; }
  .books-detail-cta-row { gap: 12px; }
  .books-detail-primary-cta { width: 100%; }
  .books-detail-progress-row { max-width: none; flex: 1 1 100%; }
  .books-similar-list { gap: 12px; }
  .books-similar-card { flex: 0 0 148px; }
}
@media (max-width: 480px) {
  :root { --books-pad: 16px; }
  .books-reader-header-row { flex-wrap: wrap; }
  .books-btn-signin { padding: 10px 14px; font-size: 13px; }
  .books-user-name { max-width: 120px; }
  .books-detail-hero-title { font-size: 1.4rem; }
  .books-detail-about-copy p { font-size: 0.98rem; }
}
.books-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: var(--books-radius-pill);
  font-size: 15px;
  font-weight: 400;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.books-btn:hover { transform: translateY(-1px); }
.books-btn:active { transform: translateY(0); }
.books-btn-primary {
  background: linear-gradient(135deg, var(--books-primary) 0%, var(--books-primary-hover) 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(47,150,150,0.28);
}
.books-btn-primary:hover { box-shadow: 0 12px 32px rgba(47,150,150,0.34); }
.books-btn-secondary {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
}
.books-btn-secondary:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); color: #fff; }

/* Search (shared) */
.books-search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--books-surface);
  border: 1px solid var(--books-border);
  border-radius: 14px;
  box-shadow: var(--books-shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.books-search-wrap:focus-within {
  border-color: var(--books-primary);
  box-shadow: 0 0 0 3px rgba(30,91,191,0.15);
}
.books-search-icon { padding: 0 14px; color: var(--books-text-muted); font-size: 18px; }
.books-search-input {
  flex: 1;
  border: none;
  padding: 14px 12px 14px 0;
  font-size: 15px;
  font-family: var(--books-font-display);
  background: transparent;
}
.books-search-input::placeholder { color: var(--books-text-muted); }
.books-search-clear {
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 20px;
  cursor: pointer;
  color: var(--books-text-muted);
  line-height: 1;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.books-search-clear:hover { color: var(--books-text); background: var(--books-bg-alt); }

/* Shelves and tags — serif, refined card */
.books-tags-section {
  margin-bottom: 36px;
  padding: 28px 24px;
  background: var(--books-paper);
  border: 1px solid var(--books-border);
  border-radius: 20px;
  box-shadow: 0 2px 16px rgba(15,23,42,0.04);
  min-width: 0;
  overflow: hidden;
}
.books-shelves-heading, .books-tags-heading, .books-filters-heading {
  font-family: var(--books-font-display);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--books-text-muted);
  margin: 0 0 14px;
}
.books-shelves-heading { margin-top: 0; }
.books-filters-heading { margin: 22px 0 14px; padding-top: 22px; border-top: 1px solid var(--books-border); }
.books-tags-heading { margin: 22px 0 14px; padding-top: 22px; border-top: 1px solid var(--books-border); }
.books-shelves {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
  min-width: 0;
}
.books-shelf {
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  font-family: var(--books-font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--books-text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.books-shelf:hover {
  background: var(--books-bg-alt);
  color: var(--books-text);
  border-color: var(--books-border-strong);
}
.books-shelf.is-selected {
  background: var(--books-primary);
  border-color: var(--books-primary);
  color: var(--books-paper);
  box-shadow: 0 2px 8px rgba(47,150,150,0.25);
}
.books-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
  min-width: 0;
}
.books-filter-chip {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  font-family: var(--books-font-display);
  font-size: 14px;
  font-weight: 400;
  color: var(--books-text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.books-filter-chip:hover {
  background: var(--books-bg-alt);
  color: var(--books-text);
  border-color: var(--books-border-strong);
}
.books-filter-chip.is-selected {
  background: var(--books-accent-soft);
  color: var(--books-primary);
  border-color: var(--books-primary);
  box-shadow: 0 2px 6px rgba(47,150,150,0.15);
}
.books-collections-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.books-collections-label {
  font-family: var(--books-font-display);
  font-size: 14px;
  font-weight: 400;
  color: var(--books-text-muted);
}
.books-collections-select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  font-family: var(--books-font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--books-text);
  min-width: 160px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.books-collections-select:hover { border-color: var(--books-border-strong); }
.books-collections-select:focus { outline: none; border-color: var(--books-primary); }
.books-detail-collection-wrap { position: relative; }
.books-btn-outline { padding: 10px 18px; border: 1px solid var(--books-border); background: var(--books-paper); color: var(--books-text); border-radius: var(--books-radius-pill); font-family: inherit; font-size: 14px; font-weight: 400; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.books-btn-outline:hover { background: var(--books-bg-alt); border-color: var(--books-primary); color: var(--books-primary); }
.books-collection-menu { position: absolute; top: 100%; left: 0; margin-top: 6px; min-width: 180px; background: var(--books-paper); border: 1px solid var(--books-border); border-radius: var(--books-radius-sm); box-shadow: var(--books-shadow-lg); z-index: 50; overflow: hidden; }
.books-collection-menu-item { display: block; width: 100%; padding: 12px 16px; border: none; background: none; font-family: var(--books-font-display); font-size: 14px; text-align: left; color: var(--books-text); cursor: pointer; transition: background 0.15s; }
.books-collection-menu-item:hover { background: var(--books-bg-alt); }
.books-search-wrap-with-suggestions { position: relative; }
.books-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--books-paper);
  border: 1px solid var(--books-border);
  border-radius: var(--books-radius-sm);
  box-shadow: var(--books-shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 60;
}
.books-search-suggestions[hidden] { display: none !important; }
.books-search-suggestion {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  font-family: var(--books-font-display);
  font-size: 14px;
  text-align: left;
  color: var(--books-text);
  cursor: pointer;
  transition: background 0.15s;
}
.books-search-suggestion:hover, .books-search-suggestion:focus { background: var(--books-bg-alt); outline: none; }
.books-search-suggestion-sublabel { font-size: 12px; color: var(--books-text-muted); margin-top: 2px; }
.books-last-synced { font-size: 12px; color: var(--books-text-muted); margin-left: 8px; }
.books-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.books-card-badge {
  font-family: var(--books-font-display);
  padding: 5px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 400;
  background: var(--books-bg-alt);
  color: var(--books-text-muted);
  border: 1px solid var(--books-border);
}
.books-card-badge.difficulty { background: var(--books-accent-soft); color: var(--books-primary); border-color: var(--books-primary); }
.books-card-badge.rating { background: #FEF3C7; color: #92400E; border-color: #F59E0B; }
.books-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.books-tag {
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  font-family: var(--books-font-display);
  font-size: 14px;
  font-weight: 400;
  color: var(--books-text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.books-tag:hover {
  background: var(--books-bg-alt);
  color: var(--books-text);
  border-color: var(--books-border-strong);
}
.books-tag.is-selected {
  background: var(--books-accent-soft);
  color: var(--books-primary);
  border-color: var(--books-primary);
  box-shadow: 0 2px 6px rgba(47,150,150,0.15);
}

/* Grid */
.books-grid-section { margin-bottom: 72px; }
.books-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.books-grid-section .books-section-heading {
  font-family: var(--books-font-display);
  font-size: 26px;
  font-weight: 400;
  margin: 0;
  color: var(--books-dark);
  letter-spacing: 0.01em;
}
.books-section-sub {
  font-family: var(--books-font-display);
  font-size: 15px;
  color: var(--books-text-muted);
  margin: 0;
  font-weight: 500;
}
.books-section-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}
.books-sort-label {
  font-family: var(--books-font-display);
  font-size: 14px;
  color: var(--books-text-muted);
  font-weight: 400;
}
.books-sort-select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--books-border);
  background: var(--books-paper);
  font-family: var(--books-font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--books-text);
  cursor: pointer;
  transition: border-color 0.2s;
}
.books-sort-select:hover { border-color: var(--books-border-strong); }
.books-sort-select:focus { outline: none; border-color: var(--books-primary); }
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px;
}
@media (min-width: 600px) {
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (min-width: 900px) {
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
.books-card {
  background: var(--books-paper);
  border-radius: 20px;
  border: 1px solid var(--books-border);
  box-shadow: var(--books-shadow);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  animation: books-card-in 0.5s ease backwards;
}
@keyframes books-card-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.books-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--books-shadow-lg);
  border-color: var(--books-border-strong);
}
.books-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, #f7fafc 0%, #edf4f6 100%);
  overflow: hidden;
}
.books-card-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.books-card:hover .books-card-cover img { transform: scale(1.04); }
.books-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1c2331 0%, #2d3748 100%);
  color: rgba(255,254,251,0.4);
}
.books-card-cover-placeholder svg { width: 48px; height: 48px; stroke-linecap: round; stroke-linejoin: round; }
.books-card-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}
.books-card-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  height: 18px;
  min-height: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  color: var(--books-text);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15,23,42,0.12);
}
.books-card-body { padding: 22px 20px; }
.books-card-title {
  font-family: var(--books-font-display);
  font-size: 19px;
  font-weight: 400;
  margin: 0 0 8px;
  color: var(--books-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.books-card-author {
  font-family: var(--books-font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--books-text-muted);
  margin: 0 0 8px;
}
.books-card-desc {
  font-family: var(--books-font-display);
  font-size: 13px;
  color: var(--books-text-muted);
  line-height: 1.45;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.books-card-progress {
  height: 4px;
  background: var(--books-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}
.books-card-progress-bar {
  height: 100%;
  background: var(--books-primary);
  transition: width 0.2s;
}
.books-card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.books-card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  height: 18px;
  min-height: 0;
  border-radius: 999px;
  background: var(--books-bg-alt);
  border: 1px solid var(--books-border);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: var(--books-text-muted);
}

/* Skeleton loading */
.books-loading { padding: 24px 0 48px; text-align: center; }
.books-loading-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
  margin-bottom: 24px;
  max-width: 100%;
}
@media (min-width: 600px) { .books-loading-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (min-width: 900px) { .books-loading-cards { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); } }
.books-skeleton-card {
  background: var(--books-surface);
  border-radius: 20px;
  border: 1px solid var(--books-border);
  overflow: hidden;
  height: 340px;
}
.books-skeleton-card::before {
  content: '';
  display: block;
  height: 72%;
  background: linear-gradient(90deg, var(--books-bg-alt) 25%, var(--books-surface-elevated) 50%, var(--books-bg-alt) 75%);
  background-size: 200% 100%;
  animation: books-skeleton 1.2s ease-in-out infinite;
}
.books-skeleton-card::after {
  content: '';
  display: block;
  height: 28%;
  padding: 18px 16px;
  background: linear-gradient(90deg, var(--books-bg-alt) 25%, var(--books-surface-elevated) 50%, var(--books-bg-alt) 75%);
  background-size: 200% 100%;
  animation: books-skeleton 1.2s ease-in-out infinite 0.15s;
}
@keyframes books-skeleton {
  to { background-position: 200% 0; }
}
.books-loading-text { font-family: var(--books-font-display); font-size: 15px; color: var(--books-text-muted); font-weight: 400; margin: 0; }
.books-no-results {
  padding: 56px 28px;
  text-align: center;
  background: var(--books-paper);
  border-radius: 24px;
  border: 1px solid var(--books-border);
  box-shadow: var(--books-shadow);
}
.books-no-results h3 { font-family: var(--books-font-display); margin: 0 0 10px; font-size: 22px; font-weight: 400; }
.books-no-results p { font-family: var(--books-font-display); margin: 0 0 24px; color: var(--books-text-muted); font-size: 15px; line-height: 1.5; }
.books-error-hint { margin-top: 8px; margin-bottom: 20px; font-size: 14px; color: var(--books-text-muted); }
.books-empty, .books-error, .books-reader-load-error {
  padding: 56px 28px;
  text-align: center;
  background: var(--books-surface);
  border-radius: 24px;
  border: 1px solid var(--books-border);
  box-shadow: var(--books-shadow);
}
.books-reader-load-error h3 { margin: 0 0 10px; font-size: 22px; font-weight: 400; }
.books-reader-load-error p { margin: 0 0 20px; color: var(--books-text-muted); font-size: 15px; line-height: 1.5; }
.books-reader-load-error .books-btn { margin-top: 8px; }
.books-illo { width: 80px; height: 80px; margin: 0 auto 20px; color: var(--books-text-muted); opacity: 0.7; }
.books-illo svg { width: 100%; height: 100%; stroke-linecap: round; stroke-linejoin: round; }
.books-no-results, .books-error .books-error-hint {
  padding: 56px 28px;
  text-align: center;
  background: var(--books-paper);
  border-radius: 24px;
  border: 1px solid var(--books-border);
  box-shadow: var(--books-shadow);
}
.books-no-results h3, .books-error h3 { font-family: var(--books-font-display); margin: 0 0 10px; font-size: 22px; font-weight: 400; }
.books-no-results p, .books-error-hint { font-family: var(--books-font-display); margin: 0 0 24px; color: var(--books-text-muted); font-size: 15px; line-height: 1.5; }
.books-error-hint { margin-top: -16px; margin-bottom: 24px; }
.books-empty h3, .books-error h3 { font-family: var(--books-font-display); margin: 0 0 10px; font-size: 22px; font-weight: 400; }
.books-empty p, .books-error p { font-family: var(--books-font-display); margin: 0 0 24px; color: var(--books-text-muted); font-size: 15px; line-height: 1.5; }

/* Detail page — scholarly cream layout */
.books-detail-view,
#books-detail-view {
  overflow-x: hidden;
  width: 100%;
  max-width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 20px 0 72px;
  box-sizing: border-box;
  font-family: var(--books-font-display);
  color: var(--books-text);
}
body:has(#books-detail-view:not([hidden])) .books-portal,
body:has(#books-detail-view:not([hidden])),
body:has(#books-detail-view:not([hidden]))::before {
  background: #ffffff !important;
}
.books-detail-ornament { display: none !important; }
.books-detail-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.books-detail-top {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  min-width: 0;
}
.books-detail-back {
  padding: 0;
  border: none;
  background: transparent;
  font-family: var(--books-font-display);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  color: #5a6b7c;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}
.books-detail-back:hover { color: var(--books-primary); background: transparent; transform: none; }

.books-detail-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 40px 48px;
  align-items: start;
  margin-bottom: 8px;
}
.books-detail-cover-col,
.books-detail-info-col { min-width: 0; }
.books-detail-hero {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(15, 40, 50, 0.1);
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, #1e5f8a 0%, #2a6f70 35%, #c9a227 70%, #1e5f8a 100%) border-box;
  border: 2px solid transparent;
  box-sizing: border-box;
}
.books-detail-hero::before,
.books-detail-hero::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    #1e5f8a 0 10px,
    #2a6f70 10px 20px,
    #c9a227 20px 30px,
    #d4e4ef 30px 40px
  );
  opacity: 0.85;
}
.books-detail-hero::before { top: 8px; }
.books-detail-hero::after { bottom: 8px; }
.books-detail-hero-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  background: #f7f4ec;
}

.books-detail-hero-title {
  font-family: var(--books-font-display), 'Amiri', Georgia, serif;
  font-size: clamp(1.85rem, 2.6vw, 2.55rem);
  font-weight: 400 !important;
  margin: 0 0 14px;
  line-height: 1.35;
  letter-spacing: 0;
  color: #1f3d3d;
  overflow-wrap: break-word;
  word-break: break-word;
}
.books-detail-hero-title.books-detail-title-ar {
  font-family: 'Amiri', 'EB Garamond', Georgia, serif;
  font-weight: 400 !important;
  line-height: 1.55;
  text-align: right;
}
.books-detail-title-ornament {
  width: 48px;
  height: 1px;
  margin: 0 0 16px;
  position: relative;
  background: linear-gradient(90deg, transparent 0, #c9a227 18%, #c9a227 82%, transparent 100%);
}
.books-detail-title-ornament::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  background: #c9a227;
  transform: translate(-50%, -50%) rotate(45deg);
}
.books-detail-hero-title.books-detail-title-ar + .books-detail-title-ornament { margin-left: auto; }
.books-detail-hero-subtitle {
  margin: -2px 0 14px;
  font-family: var(--books-font-display);
  font-size: 1.05rem;
  font-weight: 400;
  font-style: italic;
  color: #7a8794;
  line-height: 1.4;
}
.books-detail-hero-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 400;
  color: #3d4f5f;
  font-family: var(--books-font-display);
  margin: 0 0 22px;
}
.books-detail-author-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #8a96a3;
}
.books-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 20px;
}
.books-detail-tags[hidden] { display: none !important; }
.books-detail-tags .books-tag {
  background: rgba(42, 111, 112, 0.08);
  border-color: rgba(42, 111, 112, 0.22);
  color: var(--books-primary);
  font-weight: 400;
  font-family: var(--books-font-display);
  box-shadow: none;
}

.books-detail-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0 0 8px;
  padding: 22px 0 0;
  border-top: 1px solid rgba(26, 42, 54, 0.1);
  border-bottom: none;
}
.books-detail-fact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 0 28px;
  border-right: 1px solid rgba(26, 42, 54, 0.12);
}
.books-detail-fact:first-child { padding-left: 0; }
.books-detail-fact:last-child { border-right: none; padding-right: 0; }
.books-detail-fact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: 0;
  color: #2a6f70;
  flex-shrink: 0;
}
.books-detail-fact-icon svg { width: 20px; height: 20px; }
.books-detail-fact-icon-ain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid #2a6f70;
  font-family: 'Amiri', 'EB Garamond', Georgia, serif;
  font-size: 15px;
  line-height: 1;
  color: #2a6f70;
}
.books-detail-fact-label { display: none !important; }
.books-detail-fact-text { display: flex; flex-direction: column; gap: 2px; }
.books-detail-fact-value {
  font-size: 15px;
  color: #1f3d3d;
  font-weight: 400;
  font-family: var(--books-font-display);
  line-height: 1.3;
}
.books-detail-fact-sub {
  font-size: 13px;
  color: #7a8794;
  font-weight: 400;
  font-family: var(--books-font-display);
  line-height: 1.3;
}

.books-detail-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 26px;
  margin: 0;
  padding: 26px 0 22px;
  border-top: 1px solid rgba(26, 42, 54, 0.1);
}
.books-detail-primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background: #245f60;
  color: #fff;
  text-decoration: none;
  font-family: var(--books-font-display);
  font-size: 16px;
  font-weight: 400;
  box-shadow: none;
  transition: background 0.15s;
}
.books-detail-primary-cta svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.books-detail-primary-cta:hover {
  background: #1e5051;
  color: #fff;
  transform: none;
  box-shadow: none;
}
.books-detail-progress-row {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 320px;
  margin: 0;
}
.books-detail-progress-row[hidden] { display: none !important; }
.books-detail-progress-bar {
  flex: 1 1 auto;
  height: 4px;
  min-width: 120px;
  background: rgba(36, 95, 96, 0.16);
  border: none;
  border-radius: 999px;
  overflow: hidden;
}
.books-detail-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  max-width: 100%;
  background: #245f60;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.books-detail-progress-text {
  flex: 0 0 auto;
  min-width: 6.5em;
  font-size: 15px !important;
  color: #3d4f5f !important;
  font-weight: 400 !important;
  white-space: nowrap;
  font-family: var(--books-font-display);
  line-height: 1.2;
  opacity: 1 !important;
  visibility: visible !important;
}
.books-detail-lastopened { display: none !important; }
.books-detail-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-top: 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(26, 42, 54, 0.1);
}
.books-detail-action-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  margin: 0 18px;
  background: rgba(26, 42, 54, 0.16);
  flex-shrink: 0;
}
.books-detail-collection-wrap { position: relative; }
.books-detail-text-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: #3d4f5f;
  font-family: var(--books-font-display);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}
.books-detail-text-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #7a8794;
}
.books-detail-text-action:hover { color: var(--books-primary); }
.books-detail-text-action:hover svg { color: var(--books-primary); }
.books-detail-start-link { display: none !important; }

.books-detail-about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(200px, 0.7fr);
  gap: 28px 48px;
  margin: 40px 0 8px;
  padding: 36px 0 8px;
  border-top: 1px solid rgba(26, 42, 54, 0.1);
}
.books-detail-about-copy h2 {
  margin: 0 0 14px;
  font-family: var(--books-font-display);
  font-size: 1.35rem;
  font-weight: 400 !important;
  color: #1a2a36;
  letter-spacing: 0;
}
.books-detail-about-copy p {
  margin: 0;
  color: #4a5b6c;
  line-height: 1.7;
  font-size: 1.02rem;
  font-family: var(--books-font-display);
  overflow-wrap: break-word;
}
.books-detail-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.books-trust-badge { font-size: 13px; color: #5a6b7c; }
.books-trust-badge strong { color: #1a2a36; }
.books-trust-arabic { font-weight: 400; color: var(--books-primary); }
.books-trust-note { font-size: 13px; color: #5a6b7c; font-style: italic; margin: 8px 0 0; width: 100%; }

.books-detail-about-meta {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 6px;
}
.books-detail-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.books-detail-meta-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: #8a96a3;
  flex-shrink: 0;
}
.books-detail-meta-icon svg { width: 100%; height: 100%; }
.books-detail-meta-label {
  font-size: 12px;
  color: #8a96a3;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.books-detail-meta-value {
  font-size: 15px;
  color: #1a2a36;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.books-similar {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin-top: 36px;
  padding: 28px 0 0;
  background: transparent;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(26, 42, 54, 0.1);
  box-shadow: none;
}
.books-similar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.books-similar-head h2,
#books-similar-heading {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400 !important;
  color: #1a2a36;
  font-family: var(--books-font-display);
  letter-spacing: 0;
}
.books-similar-viewall {
  font-family: var(--books-font-display);
  font-size: 15px;
  color: #5a6b7c;
  text-decoration: none;
  white-space: nowrap;
}
.books-similar-viewall:hover { color: var(--books-primary); }
.books-similar-list {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  scrollbar-width: thin;
}
.books-similar-card {
  flex: 0 0 176px;
  min-width: 0;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(26, 42, 54, 0.1);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 40, 50, 0.06);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.books-similar-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 40, 50, 0.1); }
.books-similar-card-cover {
  aspect-ratio: 16 / 10;
  background: #f3efe6;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(26, 42, 54, 0.06);
}
.books-similar-card-body { padding: 14px 14px 16px; }
.books-similar-card-title {
  font-family: var(--books-font-display);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  color: #1a2a36;
}
.books-similar-card-author { font-size: 13px; color: #7a8794; }
.books-detail-foot-back {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--books-font-display);
  font-size: 14px;
  color: #5a6b7c;
  text-decoration: none;
}
.books-detail-foot-back:hover { color: var(--books-primary); }

@media (max-width: 860px) {
  .books-detail-stage {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .books-detail-about {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 28px;
    padding-top: 28px;
  }
  .books-detail-about-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 28px;
  }
  .books-detail-hero-img { aspect-ratio: 16 / 11; }
}

/* Reader — progress bar and options bar fixed at top (only when reading a book) */
.books-reader-progress-sticky,
.books-reader-header {
  display: none !important;
}
body.books-reader-active .books-reader-progress-sticky,
body.books-reader-active .books-reader-header {
  display: block !important;
}
.books-reader-progress-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--books-bg);
  opacity: 1;
}
.books-reader-chapter-select-row {
  position: fixed;
  top: 6px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--books-bg);
  border-bottom: 1px solid var(--books-border);
  opacity: 1;
}
.books-reader-chapter-select-row[hidden] { display: none !important; }
body.books-reader-chapter-mode .books-reader-chapter-select-row { display: flex !important; }
body.books-reader-chapter-mode .books-reader-header { top: 52px; }
body.books-reader-chapter-mode .books-reader-scroll { padding-top: 184px; }
.books-reader-chapter-select {
  min-width: 220px;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--books-text);
  background: var(--books-paper);
  border: 1px solid var(--books-border);
  border-radius: 10px;
  opacity: 1;
  cursor: pointer;
}
.books-reader-header {
  position: fixed;
  top: 6px;
  left: 0;
  right: 0;
  z-index: 50;
  display: block;
  background: var(--books-bg);
  border-bottom: 1px solid var(--books-border);
  opacity: 1;
  padding: 0 var(--books-pad);
  box-sizing: border-box;
}
.books-reader-scroll {
  overflow: visible;
  padding-top: 128px;
}
.books-reader-page-viewport { position: relative; }
body.books-reader-page-mode { overflow: hidden !important; height: 100vh; }
body.books-reader-page-mode #books-reader-view { overflow: hidden !important; display: flex; flex-direction: column; height: 100vh; }
body.books-reader-page-mode .books-reader-scroll {
  overflow: hidden !important;
  flex: 1;
  min-height: 0;
  padding-top: 128px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
body.books-reader-page-mode .books-reader-page-viewport {
  overflow-y: auto !important;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
body.books-reader-page-mode .books-reader-content {
  transition: transform 0.25s ease-out;
  will-change: transform;
}
.books-reader-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0 8px;
  flex-wrap: wrap;
}
.books-reader-header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.books-reader-header-tools .books-reader-toc-wrap { margin-left: 0; }
.books-reader-tool-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75; }
.books-reader-header-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--books-text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}
.books-reader-header-tools button:hover { background: var(--books-bg-alt); color: var(--books-primary); }
.books-reader-header-tools button:hover .books-reader-tool-icon { opacity: 1; }
.books-reader-header-tools button.is-active,
.books-reader-header-tools .books-reader-bookmark.is-active,
.books-reader-header-tools .books-reader-toc-btn.is-active {
  background: var(--books-accent-soft);
  color: var(--books-primary);
}
.books-reader-header-tools button.is-active .books-reader-tool-icon { opacity: 1; }
.books-reader-header-tools button:disabled { opacity: 0.5; cursor: not-allowed; }
.books-reader-header-tools button:disabled:hover { background: transparent; color: var(--books-text-muted); }
@media (max-width: 560px) {
  .books-reader-header-tools button span:not(.books-reader-tool-icon) { display: none; }
  .books-reader-header-tools button { padding: 8px; }
}
.books-reader-back {
  padding: 10px 16px;
  border: 1px solid var(--books-border);
  border-radius: 14px;
  background: var(--books-surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  color: var(--books-text);
  transition: background 0.2s, border-color 0.2s;
}
.books-reader-back:hover { background: var(--books-surface-elevated); border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.books-reader-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.books-reader-font-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--books-bg-alt);
}
.books-reader-font-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 9px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--books-text);
  transition: background 0.2s, box-shadow 0.2s;
}
.books-reader-font-btn:hover { background: rgba(15,23,42,0.05); }
.books-reader-font-btn:active { background: var(--books-surface); box-shadow: 0 1px 2px rgba(15,23,42,0.08); }
.books-reader-line-wrap {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--books-bg-alt);
}
.books-reader-line-btn {
  padding: 7px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--books-text-muted);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.books-reader-line-btn:hover { color: var(--books-primary); }
.books-reader-line-btn.is-active { background: var(--books-surface); color: var(--books-primary); box-shadow: 0 1px 3px rgba(15,23,42,0.1), 0 1px 2px rgba(15,23,42,0.06); }
.books-reader-dark {
  padding: 8px 14px;
  border: 1px solid var(--books-border);
  border-radius: 12px;
  background: var(--books-surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--books-text);
  transition: background 0.2s, border-color 0.2s;
}
.books-reader-bookmark {
  padding: 8px 14px;
  border: 1px solid var(--books-border);
  border-radius: 12px;
  background: var(--books-surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--books-text);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.books-reader-bookmark:hover { border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-bookmark.is-active { background: var(--books-accent-soft); border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-goto-bookmark {
  padding: 8px 14px;
  border: 1px solid var(--books-border);
  border-radius: 12px;
  background: var(--books-surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--books-text);
  transition: background 0.2s, border-color 0.2s;
}
.books-reader-goto-bookmark:hover { border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-goto-bookmark:disabled { opacity: 0.6; cursor: not-allowed; }
.books-reader-goto-bookmark:disabled:hover { border-color: var(--books-border); color: var(--books-text); }
.books-reader-dark:hover { border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-dark.is-active { background: var(--books-dark); border-color: var(--books-dark); color: #fff; }
.books-reader-progress-wrap {
  height: 6px;
  background: var(--books-border);
  cursor: pointer;
  flex-shrink: 0;
}
.books-reader-time-left {
  font-size: 12px;
  font-weight: 400;
  color: var(--books-text-muted);
  white-space: nowrap;
  margin-left: auto;
  margin-right: 8px;
}
.books-reader-progress {
  height: 100%;
  width: 0%;
  min-width: 2px;
  background: var(--books-primary);
  transition: width 0.15s ease-out;
  border-radius: 0 2px 2px 0;
}
.books-reader-focus-btn {
  position: fixed; top: 12px; left: 12px; z-index: 55;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--books-border); background: var(--books-paper);
  font-size: 20px; line-height: 1; cursor: pointer;
  box-shadow: var(--books-shadow-md);
  transition: opacity 0.2s, background 0.2s;
}
.books-reader-focus-btn:hover { background: var(--books-bg-alt); }
.books-reader-menu-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--books-border);
  border-radius: 12px;
  background: var(--books-surface);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--books-text);
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}
.books-reader-menu-btn:hover { background: var(--books-bg-alt); border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-settings-page {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--books-paper);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.books-reader-settings-page[hidden] { display: none !important; }
.books-reader-settings-page:not([hidden]) { display: block !important; }
.books-reader-settings-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px var(--books-pad) calc(32px + env(safe-area-inset-bottom, 0px));
}
.books-reader-settings-head { margin-bottom: 16px; }
.books-reader-settings-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 400;
  color: var(--books-text);
  font-family: var(--books-font-display);
}
.books-reader-settings-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--books-text-muted);
}
.books-reader-settings-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 3px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--books-bg-alt);
  border-radius: 14px;
}
.books-reader-settings-tabs::-webkit-scrollbar { display: none; }
.books-reader-settings-tab {
  flex: 1 0 auto;
  padding: 9px 16px;
  border: none;
  border-radius: 11px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--books-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.books-reader-settings-tab:hover { color: var(--books-primary); }
.books-reader-settings-tab.is-active {
  background: var(--books-surface);
  color: var(--books-primary);
  box-shadow: 0 1px 3px rgba(15,23,42,0.1), 0 1px 2px rgba(15,23,42,0.06);
}
.books-reader-settings-panel { min-height: 12rem; }
.books-reader-settings-hint {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--books-text-muted);
}
.books-reader-settings-micro {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--books-text-muted);
}
.books-reader-settings-check { margin-bottom: 14px; }
.books-reader-settings-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--books-text);
  cursor: pointer;
  line-height: 1.4;
}
.books-reader-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--books-primary);
  cursor: pointer;
}
.books-reader-settings-reset {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--books-border);
  background: var(--books-bg-alt);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--books-text-muted);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.books-reader-settings-reset:hover {
  border-color: var(--books-primary);
  color: var(--books-primary);
  background: var(--books-accent-soft);
}
.books-reader-settings-value {
  font-weight: 400;
  color: var(--books-primary);
  margin-left: 6px;
}
.books-reader-font-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.books-reader-settings-section {
  margin-bottom: 18px;
}
.books-reader-settings-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--books-text-muted);
}
.books-reader-settings-section .books-reader-select { width: 100%; max-width: 100%; }
.books-reader-settings-section .books-reader-font-wrap,
.books-reader-settings-section .books-reader-line-wrap { display: inline-flex; }
.books-reader-line-wrap--scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}
.books-reader-line-wrap--scroll .books-reader-line-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.books-reader-settings-done {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 14px;
  background: var(--books-primary);
  color: var(--books-paper);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.books-reader-settings-done:hover { background: var(--books-primary-hover); }
body.books-reader-settings-open { overflow: hidden; }
body.books-reader-focus .books-reader-header { transform: translateY(-120%); opacity: 0; pointer-events: none; transition: transform 0.25s ease, opacity 0.2s; }
body.books-reader-focus .books-reader-nav-bar { transform: translateY(120%); opacity: 0; pointer-events: none; transition: transform 0.25s ease, opacity 0.2s; }
body.books-reader-focus.books-reader-at-bottom .books-reader-nav-bar { transform: translateY(0); opacity: 1; pointer-events: auto; }
body.books-reader-chapter-mode.books-reader-focus .books-reader-nav-bar { transform: translateY(0); opacity: 1; pointer-events: auto; }
body.books-reader-focus .books-reader-progress-wrap { height: 4px; }
body.books-reader-focus .books-reader-scroll { padding-top: 60px; padding-bottom: 24px; }
@media (min-width: 768px) {
  body.books-reader-focus .books-reader-scroll { padding-top: 80px; padding-bottom: 32px; }
}
.books-reader-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 10px var(--books-pad);
  background: var(--books-paper);
  border-top: 1px solid var(--books-border);
  box-shadow: 0 -4px 20px rgba(15,23,42,0.08);
}
.books-view[hidden] { display: none !important; }
.books-reader-nav-bar[hidden] { display: none !important; }
.books-reader-nav-page-wrap { display: flex; align-items: center; gap: 8px; }
.books-reader-nav-page-wrap[hidden] { display: none !important; }
.books-reader-nav-page-label { font-size: 14px; font-weight: 400; color: var(--books-text); }
.books-reader-page-input {
  width: 56px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  text-align: center;
  border: 1px solid var(--books-border);
  border-radius: 8px;
  background: var(--books-paper);
  color: var(--books-text);
}
.books-reader-nav-page-of { font-size: 14px; color: var(--books-text-muted); }
body.books-reader-page-mode.books-reader-focus .books-reader-nav-bar { transform: translateY(0); opacity: 1; pointer-events: auto; }
.books-reader-nav-bar .books-reader-nav-prev,
.books-reader-nav-bar .books-reader-nav-next {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--books-border);
  background: var(--books-surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--books-text);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.books-reader-nav-bar .books-reader-nav-prev:hover,
.books-reader-nav-bar .books-reader-nav-next:hover { background: var(--books-bg-alt); border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-nav-bar .books-reader-nav-next { background: var(--books-primary); border-color: var(--books-primary); color: var(--books-paper); }
.books-reader-nav-bar .books-reader-nav-next:hover { background: var(--books-primary-hover); border-color: var(--books-primary-hover); color: var(--books-paper); }
.books-reader-nav-bar .books-reader-mark-complete {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--books-success, #22c55e);
  background: var(--books-success, #22c55e);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.books-reader-nav-bar .books-reader-mark-complete:hover { background: #16a34a; border-color: #16a34a; opacity: 0.9; }
.books-reader-toc-wrap { position: relative; }
.books-reader-toc-btn {
  padding: 8px 16px;
  border: 1px solid var(--books-border);
  border-radius: 12px;
  background: var(--books-surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--books-text);
  transition: background 0.2s, border-color 0.2s;
}
.books-reader-toc-btn:hover { border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 11px 40px 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--books-border);
  background-color: var(--books-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--books-text);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.books-reader-select:hover { border-color: var(--books-primary); }
.books-reader-select:focus-visible {
  outline: none;
  border-color: var(--books-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--books-primary) 18%, transparent);
}
.books-reader-select::-ms-expand { display: none; }
.books-reader-annotations {
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--books-border);
  background: var(--books-surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--books-text);
}
.books-reader-annotations:hover { border-color: var(--books-primary); color: var(--books-primary); }
.books-reader-toc-btn.is-active {
  background: var(--books-accent-soft);
  border-color: var(--books-primary);
  color: var(--books-primary);
}
.books-reader-search-panel {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--books-surface);
  border-bottom: 1px solid var(--books-border);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.brs-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--books-border);
}
.brs-icon {
  font-size: 18px;
  color: var(--books-text-muted);
  flex-shrink: 0;
}
.brs-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--books-border);
  border-radius: 12px;
  background: var(--books-paper);
  font-family: inherit;
  font-size: 15px;
  color: var(--books-text);
}
.brs-input:focus {
  outline: none;
  border-color: var(--books-primary);
  box-shadow: 0 0 0 3px var(--books-accent-soft);
}
.brs-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--books-text-muted);
  white-space: nowrap;
}
.brs-close {
  padding: 6px 12px;
  border: 1px solid var(--books-border);
  border-radius: 10px;
  background: var(--books-surface);
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--books-text-muted);
}
.brs-close:hover { border-color: var(--books-primary); color: var(--books-primary); }
.brs-results {
  max-height: min(40vh, 320px);
  overflow-y: auto;
}
.brs-result {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  color: var(--books-text);
}
.brs-result:hover { background: var(--books-bg-alt); }
.brs-ch {
  display: block;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--books-text-muted);
  margin-bottom: 4px;
}
.brs-snip mark {
  background: rgba(234, 179, 8, 0.45);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.books-reader-search-hit {
  outline: 2px solid var(--books-primary);
  outline-offset: 3px;
  border-radius: 4px;
}
.books-reader-tts-bar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--books-border);
  border-radius: 16px;
  background: var(--books-surface);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
}
.brt-btn {
  padding: 8px 12px;
  border: 1px solid var(--books-border);
  border-radius: 10px;
  background: var(--books-paper);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  color: var(--books-text);
}
.brt-btn:hover { border-color: var(--books-primary); color: var(--books-primary); }
.brt-stop { font-weight: 400; }
.brt-rate-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--books-text-muted);
}
.brt-rate {
  padding: 6px 8px;
  border: 1px solid var(--books-border);
  border-radius: 8px;
  background: var(--books-paper);
  font-family: inherit;
  font-size: 12px;
}
.books-reader-tts-current {
  outline: 2px solid var(--books-primary);
  outline-offset: 3px;
  border-radius: 4px;
}
.books-reader-toc {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--books-surface);
  border-radius: 16px;
  border: 1px solid var(--books-border-strong);
  box-shadow: var(--books-shadow-lg);
  padding: 10px;
  z-index: 60;
}
.books-reader-view { display: block; overflow: visible; }
.books-reader-toc .books-reader-toc-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  color: var(--books-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.books-reader-toc .books-reader-toc-item:hover { background: rgba(30,91,191,0.08); color: var(--books-primary); }
.books-reader-content {
  width: 100%;
  max-width: var(--books-reader-max-width);
  margin: 0 auto;
  padding: 48px 0 96px;
  text-align: var(--books-reader-justify);
  font-family: var(--books-reader-font);
  font-size: calc(1rem * var(--books-reader-size));
  line-height: var(--books-reader-line-height);
  letter-spacing: var(--books-reader-letter-spacing);
  word-spacing: var(--books-reader-word-spacing);
  font-weight: var(--books-reader-font-weight);
  -webkit-hyphens: var(--books-reader-hyphens);
  hyphens: var(--books-reader-hyphens);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1, "liga" 1;
  font-variant-numeric: proportional-nums;
  box-sizing: border-box;
}
.books-reader-content ::selection {
  background: color-mix(in srgb, var(--books-primary) 32%, transparent);
  color: inherit;
}
body.books-reader-dark .books-reader-content ::selection {
  background: color-mix(in srgb, var(--books-primary) 45%, transparent);
}
.books-reader-chapter { scroll-margin-top: 100px; }
.books-reader-chapter[hidden] { display: none !important; }
body.books-reader-page-mode .books-reader-page-hidden { display: none !important; }
.books-reader-chapter:first-child { padding-top: 1.25em; }
.books-reader-chapter:first-child h1 { margin-top: 0; }
.books-reader-bookmark-marker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 0 0 1em;
  border-left: 4px solid var(--books-primary);
  background: var(--books-accent-soft);
  border-radius: 0 12px 12px 0;
  font-size: 0.9em;
  font-weight: 400;
  color: var(--books-primary);
}
.books-reader-content h1 {
  font-family: var(--books-font-display);
  font-size: calc(1.85em * var(--books-reader-heading-scale));
  margin: 2.2em 0 0.6em;
  font-weight: 400;
  line-height: 1.25;
  color: var(--books-text);
  letter-spacing: -0.02em;
}
.books-reader-content h1:first-child { margin-top: 0; }
.books-reader-content h2 { font-size: calc(1.45em * var(--books-reader-heading-scale)); margin: 1.8em 0 0.5em; font-weight: 400; letter-spacing: -0.015em; }
.books-reader-content h3 { font-size: calc(1.2em * var(--books-reader-heading-scale)); margin: 1.5em 0 0.4em; font-weight: 400; }
.books-reader-content p {
  margin: 0 0 var(--books-reader-p-gap);
  orphans: 3;
  widows: 3;
}
body.books-reader-indent-paragraphs .books-reader-content p + p { text-indent: 1.35em; }
.books-reader-content .books-reader-paragraph,
.books-reader-content .books-reader-lead {
  font-family: var(--books-reader-font);
  font-size: 1.1em;
}
.books-reader-content .books-reader-lead { color: var(--books-text-muted); margin-bottom: 1.25em; }
.books-reader-content .books-reader-offline-note { font-size: 0.9em; color: var(--books-text-muted); background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.3); border-radius: 10px; padding: 10px 14px; margin-bottom: 1.5em; }
.books-reader-content .books-highlight { background: var(--books-highlight-bg); padding: 0 2px; border-radius: 2px; }
.books-reader-content blockquote {
  margin: 1.5em 0;
  padding: 1em 1.25em 1em 1.5em;
  border-left: 4px solid var(--books-primary);
  background: var(--books-surface-elevated);
  border-radius: 0 14px 14px 0;
  color: var(--books-text-muted);
  font-style: italic;
}
.books-reader-content blockquote cite { display: block; margin-top: 0.5em; font-size: 0.9em; font-style: normal; color: var(--books-text); }
.books-reader-content ul, .books-reader-content ol { margin: 0 0 1em; padding-left: 1.5em; }
.books-reader-content li { margin-bottom: 0.35em; }
.books-reader-content sup, .books-reader-content sub { font-size: 0.72em; line-height: 0; position: relative; vertical-align: baseline; }
.books-reader-content sup { bottom: 0.35em; }
.books-reader-content sub { top: 0.2em; }
.books-reader-content abbr[title] { text-decoration: underline dotted; cursor: help; text-underline-offset: 0.12em; }
.books-reader-content code, .books-reader-content kbd {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--books-bg-alt);
  border: 1px solid var(--books-border);
}
.books-reader-content pre, .books-reader-content pre code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.88em;
  line-height: 1.55;
  padding: 1em 1.1em;
  border-radius: 12px;
  overflow-x: auto;
  background: var(--books-bg-alt);
  border: 1px solid var(--books-border);
  margin: 1.25em 0;
}
.books-reader-content pre code { padding: 0; border: none; background: none; }
.books-reader-content img { max-width: 100%; height: auto; border-radius: 14px; margin: 1.25em 0; box-shadow: var(--books-shadow); transition: border-radius 0.2s ease; }
body.books-reader-img-soft .books-reader-content img { border-radius: 8px; }
body.books-reader-img-sharp .books-reader-content img { border-radius: 0; box-shadow: none; }
.books-reader-content a { color: var(--books-primary); text-underline-offset: 0.12em; }
body.books-reader-link-always .books-reader-content a { text-decoration: underline; }
.books-reader-content figure { margin: 1.5em 0; }
.books-reader-content figcaption { font-size: 0.9em; color: var(--books-text-muted); margin-top: 0.5em; text-align: center; }
.books-reader-block {
  margin: 1.5em 0;
  padding: 1.25em 1.5em;
  border-radius: 16px;
  border: 1px solid var(--books-border);
  background: var(--books-surface);
  box-shadow: var(--books-shadow);
}
.books-reader-content.blocks-compact .books-reader-block { margin: 0.6em 0; }
.books-reader-content.blocks-normal .books-reader-block { margin: 1.5em 0; }
.books-reader-content.blocks-spaced .books-reader-block { margin: 2.25em 0; }
.books-reader-block.key-takeaways { border-left: 4px solid var(--books-accent); background: var(--books-accent-soft); }
.books-reader-block.definition { border-left: 4px solid var(--books-primary); }
.books-reader-block.definition .books-reader-block-term { font-weight: 400; color: var(--books-primary); margin-bottom: 0.35em; }
.books-reader-block.small-note { font-size: 0.95em; color: var(--books-text-muted); background: var(--books-bg-alt); }
.books-reader-page-marker {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.85rem;
}
.books-reader-page-marker-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--books-text-muted);
  background: color-mix(in srgb, var(--books-bg-alt) 88%, white 12%);
  border: 1px solid var(--books-border);
}
.books-reader-block.ayah, .books-reader-block.hadith {
  border-left: 4px solid var(--books-accent);
  background: var(--books-accent-soft);
}
.books-reader-arabic {
  font-family: var(--books-font-arabic);
  font-size: calc(1.25em * var(--books-arabic-relative, 1));
  text-align: right;
  direction: rtl;
  margin-bottom: 0.6em;
  line-height: var(--books-ayah-line-height);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}
.books-reader-block.ayah .books-reader-arabic, .books-reader-block.hadith .books-reader-arabic {
  text-align: var(--books-ayah-align);
}
.books-reader-block.ayah .books-reader-arabic {
  font-family: var(--books-font-arabic-quran);
  font-size: calc(1.15em * var(--books-arabic-relative, 1));
  line-height: 2.1;
}
.books-reader-block.ayah .books-reader-translation, .books-reader-block.hadith .books-reader-translation {
  font-family: var(--books-reader-font);
  text-align: var(--books-ayah-align);
  direction: ltr;
  font-size: 1em;
  line-height: var(--books-ayah-line-height);
}
.books-reader-block.ayah .books-reader-verse-translation { line-height: var(--books-ayah-line-height); }
.books-reader-block.ayah .books-reader-verse-translation {
  min-height: 1.5em;
  display: block;
  margin-top: 0.35em;
}
.books-reader-block.ayah .books-reader-block-ref, .books-reader-block.hadith .books-reader-block-ref {
  font-family: var(--books-font-ui);
  direction: ltr;
  display: inline-flex;
  align-items: center;
  margin-top: 0.9em;
  padding: 0.28em 0.85em;
  border-radius: 999px;
  font-size: 0.76em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--books-primary);
  background: color-mix(in srgb, var(--books-primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--books-primary) 22%, transparent);
}
.books-reader-block-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.books-reader-block-actions button, .books-reader-block-actions a.books-reader-action-btn {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--books-border);
  background: var(--books-surface-elevated); font-family: inherit; font-size: 13px; font-weight: 400;
  cursor: pointer; color: var(--books-primary); text-decoration: none; transition: background 0.2s, border-color 0.2s;
}
.books-reader-block-actions button:hover, .books-reader-block-actions a.books-reader-action-btn:hover { background: var(--books-accent-soft); border-color: var(--books-primary); }
.books-reader-block details { margin-top: 0.5em; }
.books-reader-block details summary { cursor: pointer; font-weight: 400; color: var(--books-primary); list-style: none; padding-left: 1.2em; position: relative; }
.books-reader-block details summary::-webkit-details-marker { display: none; }
.books-reader-block details summary::before { content: '▶'; position: absolute; left: 0; font-size: 0.75em; transition: transform 0.2s; }
.books-reader-block details[open] summary::before { transform: rotate(90deg); }
.books-reader-block details .books-reader-block-detail-content { margin-top: 0.5em; padding-left: 1em; border-left: 2px solid var(--books-border); }
.books-reader-block.reflection { border-left: 4px solid var(--books-accent); background: var(--books-accent-soft); }
.books-reader-block.reflection .books-reader-reflection-title { font-size: 1em; font-weight: 400; margin: 0 0 0.5em; color: var(--books-primary); }
.books-reader-block.reflection .books-reader-reflection-question { margin: 0 0 0.75em; font-weight: 500; }
.books-reader-block.reflection details.books-reader-reflection-answer { margin-top: 0.5em; }
.books-reader-block.reflection details.books-reader-reflection-answer summary { font-size: 0.95em; }
.books-reader-block.step { position: relative; padding-left: 2.5em; }
.books-reader-block.step::before { content: attr(data-step); position: absolute; left: 0.5em; font-weight: 400; color: var(--books-primary); }
.books-reader-emphasis { background: var(--books-accent-soft); padding: 0.4em 0.6em; border-radius: 8px; }
.books-reader-emphasis-strong { font-weight: 400; border-left: 4px solid var(--books-accent); }
.books-reader-italicised { font-style: italic; }
.books-reader-divider { border: none; border-top: 1px solid var(--books-border); margin: 1.25em 0; }
.books-reader-section-card { border: 1px solid var(--books-border); border-radius: 12px; padding: 1em 1.25em; background: var(--books-bg-alt); }
.books-reader-section-card-title { margin: 0 0 0.5em; font-size: 1.1em; }
.books-reader-two-column { display: grid; gap: 1em; margin: 1em 0; }
@media (min-width: 600px) { .books-reader-two-column { grid-template-columns: 1fr 1fr; } }
.books-reader-timeline-item { margin-bottom: 1em; padding-left: 1em; border-left: 3px solid var(--books-accent); }
.books-reader-chapter-end-panel { background: var(--books-accent-soft); border-radius: 12px; padding: 1em; }
.books-reader-panel-actions { margin-top: 0.75em; display: flex; flex-wrap: wrap; gap: 0.5em; }
.books-reader-callout { padding: 0.75em 1em; border-radius: 10px; border-left: 4px solid var(--books-primary); background: var(--books-accent-soft); }
.books-reader-callout-warning { border-left-color: #eab308; background: rgba(234,179,8,0.12); }
.books-reader-callout-tip { border-left-color: #22c55e; background: rgba(34,197,94,0.1); }
.books-reader-callout-important { border-left-color: #ef4444; background: rgba(239,68,68,0.1); }
.books-reader-gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75em; margin-top: 0.5em; }
.books-reader-gallery-grid img { width: 100%; height: auto; border-radius: 10px; }
.books-reader-image-full-bleed { margin-left: -1em; margin-right: -1em; }
.books-reader-image-full-bleed img { width: 100%; max-width: none; }
.books-reader-table-wrap { overflow-x: auto; margin: 1em 0; }
.books-reader-table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.books-reader-table th, .books-reader-table td { border: 1px solid var(--books-border); padding: 0.5em 0.75em; text-align: left; }
.books-reader-table th { background: var(--books-bg-alt); font-weight: 400; }
.books-reader-source-citation .books-reader-citation { margin-bottom: 0.5em; font-size: 0.95em; }
.books-reader-dua .books-reader-arabic { font-family: var(--books-font-arabic); direction: rtl; }
.books-reader-arabic-rtl { font-family: var(--books-font-arabic); direction: rtl; text-align: right; }
.books-reader-checklist-list { list-style: none; padding-left: 0; }
.books-reader-checklist-list .books-reader-checkbox { margin-right: 0.5em; }
.books-reader-mcq-options { list-style: none; padding-left: 0; }
.books-reader-mcq-option { padding: 0.5em; margin: 0.25em 0; border-radius: 8px; background: var(--books-bg-alt); }
.books-reader-hadith-grade { font-size: 0.9em; color: var(--books-text-muted); margin-top: 0.25em; }
.books-reader-def-example { font-style: italic; color: var(--books-text-muted); margin-top: 0.5em; }

/* Footnote refs and footnote block */
.books-reader-fn-ref { font-size: 0.75em; vertical-align: super; line-height: 0; }
.books-reader-fn-ref a { color: var(--books-primary); text-decoration: none; font-weight: 400; padding: 0 0.15em; border-radius: 2px; }
.books-reader-fn-ref a:hover { text-decoration: underline; background: var(--books-accent-soft); }
.books-reader-footnote { font-size: 0.9em; color: var(--books-text-muted); padding: 0.75em 1em; border-left: 3px solid var(--books-primary); background: var(--books-bg-alt); border-radius: 0 10px 10px 0; margin-top: 0.5em; }
.books-reader-footnote:target { background: var(--books-accent-soft); border-left-color: var(--books-primary); }
.books-reader-footnote.books-reader-footnote-highlight { animation: books-reader-fn-highlight 0.6s ease; }
@keyframes books-reader-fn-highlight { 0% { background: var(--books-primary); color: var(--books-paper); } 100% { background: var(--books-bg-alt); color: var(--books-text-muted); } }
.books-reader-footnote-num { font-weight: 400; color: var(--books-primary); margin-right: 0.25em; }
.books-reader-footnote-back { font-size: 0.85em; margin-left: 0.5em; color: var(--books-primary); text-decoration: none; }
.books-reader-footnote-back:hover { text-decoration: underline; }
.books-reader-subheading { font-size: 1.25rem; margin: 1.25em 0 0.5em; padding-bottom: 0.35em; border-bottom: 1px solid var(--books-border); }
.books-reader-section-label { font-size: 0.75rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; color: var(--books-primary); margin-bottom: 0.5em; }
.books-reader-quote-block { text-align: center; }
.books-reader-pull-quote { font-size: 1.2rem; font-style: italic; margin: 0 0 0.5em; color: var(--books-text); }
.books-reader-quote-attribution { display: block; font-size: 0.95em; }
.books-reader-quote-source { font-size: 0.85em; color: var(--books-text-muted); }
.books-reader-epigraph {
  text-align: right;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--books-text-muted);
  padding: 1em 1.25em;
  line-height: 1.8;
}
.books-reader-dhikr .books-reader-dhikr-when { font-size: 0.9em; color: var(--books-text-muted); margin-top: 0.5em; }
.books-reader-dhikr-repeat { font-size: 0.9em; font-weight: 400; color: var(--books-primary); margin-top: 0.25em; }
.books-reader-poetry-arabic { font-style: normal; white-space: pre-wrap; }
.books-reader-poetry-translation { direction: ltr; text-align: left; margin-top: 0.5em; }
.books-reader-poetry-attribution { display: block; margin-top: 0.5em; font-size: 0.9em; }
.books-reader-ruling { background: var(--books-bg-alt); }
.books-reader-ruling-label { margin: 0 0 0.5em; }
.books-reader-ruling-evidence { margin: 0 0 0.5em; }
.books-reader-ruling-conclusion { margin: 0; }
.books-reader-biography { padding: 1em; }
.books-reader-bio-name { display: block; margin-bottom: 0.25em; }
.books-reader-bio-era { font-size: 0.9em; color: var(--books-text-muted); margin-right: 0.5em; }
.books-reader-verse-comparison { }
.books-reader-verse-comp-item { margin-bottom: 0.75em; }
.books-reader-verse-comp-label { font-size: 0.85em; font-weight: 400; color: var(--books-primary); display: block; margin-bottom: 0.25em; }
.books-reader-flashcard { perspective: 800px; cursor: pointer; min-height: 80px; }
.books-reader-flashcard-inner { position: relative; transform-style: preserve-3d; transition: transform 0.4s; }
.books-reader-flashcard.flipped .books-reader-flashcard-inner { transform: rotateY(180deg); }
.books-reader-flashcard-front, .books-reader-flashcard-back { backface-visibility: hidden; padding: 1em; border-radius: 10px; background: var(--books-surface-elevated); border: 1px solid var(--books-border); }
.books-reader-flashcard-back { position: absolute; top: 0; left: 0; right: 0; transform: rotateY(180deg); }
.books-reader-fill-blank { }
.books-reader-fill-reveal { margin-top: 0.5em; }
.books-reader-matching-pairs { display: flex; flex-direction: column; gap: 0.5em; }
.books-reader-matching-pair { display: flex; gap: 0.75em; align-items: baseline; flex-wrap: wrap; }
.books-reader-matching-left { font-weight: 400; }
.books-reader-matching-right { color: var(--books-text-muted); }
.books-reader-reflection-prompt { border-left: 4px solid var(--books-accent); background: var(--books-accent-soft); }
.books-reader-reflection-hint { font-size: 0.9em; color: var(--books-text-muted); margin-top: 0.5em; }
.books-reader-milestone { display: flex; align-items: center; gap: 0.5em; padding: 0.75em 1em; background: var(--books-accent-soft); border-radius: 12px; }
.books-reader-milestone-icon { font-size: 1.25em; }
.books-reader-learning-objective-list { margin: 0.5em 0 0; padding-left: 1.25em; }
.books-reader-related-verses-list { display: flex; flex-wrap: wrap; gap: 0.5em; margin-top: 0.5em; }
.books-reader-related-verse-ref { padding: 0.35em 0.65em; background: var(--books-bg-alt); border-radius: 8px; font-size: 0.9em; color: var(--books-primary); text-decoration: none; }
.books-reader-related-verse-ref:hover { background: var(--books-accent-soft); }
.books-reader-cross-ref-link { color: var(--books-primary); text-decoration: none; font-weight: 500; }
.books-reader-cross-ref-link:hover { text-decoration: underline; }
.books-reader-glossary-term-def { margin-top: 0.5em; padding-left: 1em; border-left: 2px solid var(--books-border); }
.books-reader-mini-toc-nav { display: flex; flex-direction: column; gap: 0.35em; margin-top: 0.5em; }
.books-reader-mini-toc-item { color: var(--books-primary); text-decoration: none; font-size: 0.95em; }
.books-reader-mini-toc-item:hover { text-decoration: underline; }
.books-reader-stat-highlight { text-align: center; padding: 1.25em; }
.books-reader-stat-number { display: block; font-size: 2.5rem; font-weight: 400; color: var(--books-primary); line-height: 1.1; }
.books-reader-stat-label { font-size: 0.95em; color: var(--books-text-muted); }
.books-reader-icon-text { display: flex; align-items: flex-start; gap: 0.75em; }
.books-reader-icon-text-icon { font-size: 1.25em; flex-shrink: 0; }
.books-reader-banner { text-align: center; padding: 0.75em 1em; border-radius: 10px; }
.books-reader-banner-warning { background: rgba(234,179,8,0.15); border: 1px solid rgba(234,179,8,0.4); }
.books-reader-banner-info { background: var(--books-accent-soft); border: 1px solid rgba(47,150,150,0.3); }
.books-reader-card-grid-inner { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75em; margin-top: 0.75em; }
@media (max-width: 480px) { .books-reader-card-grid-inner { grid-template-columns: 1fr; } }
.books-reader-card-grid-item { padding: 0.75em; background: var(--books-bg-alt); border-radius: 10px; border: 1px solid var(--books-border); }
.books-reader-card-grid-title { font-weight: 400; margin-bottom: 0.35em; }
.books-reader-accordion-item { margin-bottom: 0.5em; }
.books-reader-accordion-item summary { cursor: pointer; font-weight: 400; color: var(--books-primary); }
.books-reader-accordion-body { margin-top: 0.5em; padding-left: 1em; border-left: 2px solid var(--books-border); }
.books-reader-tab-labels { display: flex; gap: 0.25em; margin-bottom: 0.75em; flex-wrap: wrap; }
.books-reader-tab-label { padding: 0.5em 1em; border: 1px solid var(--books-border); background: var(--books-bg-alt); border-radius: 8px; font-family: inherit; font-size: 0.9em; font-weight: 400; cursor: pointer; color: var(--books-text-muted); }
.books-reader-tab-label.is-active { background: var(--books-primary); color: var(--books-paper); border-color: var(--books-primary); }
.books-reader-tab-panel { display: none; }
.books-reader-tab-panel.is-active { display: block; }
.books-reader-bib-entry { font-size: 0.95em; }
.books-reader-bib-author { font-weight: 400; margin-right: 0.35em; }
.books-reader-bib-title { font-style: italic; margin-right: 0.35em; }
.books-reader-abbreviation-key { font-size: 0.9em; display: flex; flex-wrap: wrap; gap: 0.5em 1em; }
.books-reader-abbr-item { white-space: nowrap; }
.books-reader-embed-wrap { overflow: hidden; border-radius: 12px; }
.books-reader-embed-iframe { width: 100%; height: 320px; border: none; display: block; }
.books-reader-captioned-audio { }
.books-reader-audio-transcript { margin-top: 0.5em; }
.books-reader-before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
@media (max-width: 560px) { .books-reader-before-after { grid-template-columns: 1fr; } }
.books-reader-before-after-item { padding: 0.75em; background: var(--books-bg-alt); border-radius: 10px; }
.books-reader-ba-label { font-size: 0.85em; font-weight: 400; color: var(--books-primary); display: block; margin-bottom: 0.5em; }
.books-reader-before-after-item img { max-width: 100%; height: auto; border-radius: 8px; margin-top: 0.5em; }
.books-reader-page-segment { margin: 0; }

/* Nizam night mode (reader) — full page dark, no white margins */
body.books-reader-dark { background: var(--books-dark); }
body.books-reader-dark .books-portal,
body.books-reader-dark .books-reader-view,
body.books-reader-dark .books-main,
body.books-reader-dark .books-header,
body.books-reader-dark .books-footer { background: var(--books-dark); }
body.books-reader-dark .books-header { border-bottom-color: rgba(255,255,255,0.12); }
body.books-reader-dark .books-header .books-logo { color: #e2e8f0; }
body.books-reader-dark .books-footer { border-top-color: rgba(255,255,255,0.1); color: #94a3b8; }
body.books-reader-dark .books-footer a { color: #7dd3d3; }
body.books-reader-dark .books-reader-header { background: rgba(15,23,42,0.98); border-bottom-color: rgba(255,255,255,0.1); }
body.books-reader-dark .books-reader-header-tools { border-top-color: rgba(255,255,255,0.1); }
body.books-reader-dark .books-reader-settings-tabs { background: rgba(255,255,255,0.06); }
body.books-reader-dark .books-reader-settings-tab { color: #94a3b8; }
body.books-reader-dark .books-reader-settings-tab:hover { color: #7dd3d3; }
body.books-reader-dark .books-reader-settings-tab.is-active { background: rgba(47,150,150,0.3); color: #7dd3d3; box-shadow: none; }
body.books-reader-dark .books-reader-settings-tabs { border-bottom-color: rgba(255,255,255,0.12); }
body.books-reader-dark .books-reader-settings-check-label { color: #e2e8f0; }
body.books-reader-dark .books-reader-settings-reset { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); color: #cbd5e1; }
body.books-reader-dark .books-reader-settings-reset:hover { border-color: var(--books-primary); color: #7dd3d3; }
body.books-reader-dark .books-reader-header .books-reader-title,
body.books-reader-dark .books-reader-header .books-reader-back,
body.books-reader-dark .books-reader-header .books-reader-menu-btn,
body.books-reader-dark .books-reader-header .books-reader-font-btn,
body.books-reader-dark .books-reader-header .books-reader-select { color: #e2e8f0; border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); }
body.books-reader-dark .books-reader-header-tools button { color: #94a3b8; }
body.books-reader-dark .books-reader-header-tools button:hover { background: rgba(255,255,255,0.08); color: #7dd3d3; }
body.books-reader-dark .books-reader-header-tools button.is-active { background: rgba(47,150,150,0.25); color: #7dd3d3; }
body.books-reader-dark .books-reader-settings-page { background: var(--books-dark); }
body.books-reader-dark .books-reader-settings-title,
body.books-reader-dark .books-reader-settings-label { color: #e2e8f0; }
body.books-reader-dark .books-reader-settings-sub,
body.books-reader-dark .books-reader-settings-hint { color: #94a3b8; }
body.books-reader-dark .books-reader-settings-page .books-reader-select { color: #e2e8f0; border-color: rgba(255,255,255,0.2); background-color: rgba(255,255,255,0.06); }
body.books-reader-dark .books-reader-settings-page .books-reader-select:hover { border-color: var(--books-primary); color: #7dd3d3; }
body.books-reader-dark .books-reader-font-wrap,
body.books-reader-dark .books-reader-line-wrap { background: rgba(255,255,255,0.06); }
body.books-reader-dark .books-reader-font-btn,
body.books-reader-dark .books-reader-line-btn { color: #cbd5e1; }
body.books-reader-dark .books-reader-font-btn:hover,
body.books-reader-dark .books-reader-line-btn:hover { color: #7dd3d3; }
body.books-reader-dark .books-reader-font-btn:active { background: rgba(255,255,255,0.14); }
body.books-reader-dark .books-reader-line-btn.is-active { background: rgba(47,150,150,0.3); color: #7dd3d3; box-shadow: none; }
body.books-reader-dark .books-reader-settings-done { background: var(--books-primary); color: #fff; }
body.books-reader-dark .books-reader-header .books-reader-select:hover { border-color: var(--books-primary); color: #7dd3d3; }
body.books-reader-dark .books-reader-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body.books-reader-dark .books-reader-progress-sticky { background: rgba(15,23,42,0.98); }
body.books-reader-dark .books-reader-progress-wrap { background: rgba(0,0,0,0.35); }
body.books-reader-dark .books-reader-progress { background: var(--books-primary); }
body.books-reader-dark .books-reader-chapter-select-row { background: rgba(15,23,42,0.98); border-bottom-color: rgba(255,255,255,0.1); }
body.books-reader-dark .books-reader-chapter-select { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: #e2e8f0; }
body.books-reader-dark .books-reader-nav-page-label { color: #e2e8f0; }
body.books-reader-dark .books-reader-page-input { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: #e2e8f0; }
body.books-reader-dark .books-reader-nav-page-of { color: #94a3b8; }
body.books-reader-dark .books-reader-nav-bar { background: var(--books-dark); border-top-color: rgba(255,255,255,0.1); box-shadow: 0 -4px 20px rgba(0,0,0,0.3); }
body.books-reader-dark .books-reader-nav-bar .books-reader-nav-prev { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: #e2e8f0; }
body.books-reader-dark .books-reader-nav-bar .books-reader-mark-complete { background: #22c55e; border-color: #22c55e; color: #fff; }
body.books-reader-dark .books-reader-nav-bar .books-reader-nav-prev:hover { background: rgba(47,150,150,0.2); border-color: var(--books-primary); color: #7dd3d3; }
body.books-reader-dark .books-reader-nav-bar .books-reader-nav-next { background: var(--books-primary); border-color: var(--books-primary); color: #fff; }
body.books-reader-dark .books-reader-focus-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: #e2e8f0; }
body.books-reader-dark .books-reader-content { color: #e2e8f0; }
body.books-reader-dark .books-reader-content .books-reader-block { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
body.books-reader-dark .books-reader-content .books-reader-block-actions button, body.books-reader-dark .books-reader-content .books-reader-block-actions a.books-reader-action-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: #7dd3d3; }
body.books-reader-dark .books-reader-content .books-reader-block details summary { color: #7dd3d3; }
body.books-reader-dark .books-reader-content blockquote { background: rgba(255,255,255,0.06); color: #b0b3b8; }
body.books-reader-dark .books-reader-content .books-reader-lead { color: #94a3b8; }
body.books-reader-dark .books-reader-content h1, body.books-reader-dark .books-reader-content h2, body.books-reader-dark .books-reader-content h3 { color: #f1f5f9; }
body.books-reader-dark .books-reader-bookmark-marker { background: rgba(47,150,150,0.2); border-left-color: var(--books-primary); color: #7dd3d3; }
body.books-reader-sepia { background: #F4ECD8; }
body.books-reader-sepia .books-portal, body.books-reader-sepia .books-reader-view, body.books-reader-sepia .books-main { background: #F4ECD8; }
body.books-reader-sepia .books-reader-content { color: #5C4B37; }
body.books-reader-sepia .books-reader-content .books-reader-block { background: rgba(255,248,235,0.9); border-color: #D4C4A0; }
body.books-reader-sepia .books-reader-content .books-reader-block h1, body.books-reader-sepia .books-reader-content h2, body.books-reader-sepia .books-reader-content h3 { color: #3D3226; }
body.books-reader-sepia .books-reader-content .books-highlight { background: color-mix(in srgb, var(--books-highlight-bg) 85%, #8B7355 15%); }
body.books-reader-contrast { background: #fff; color: #000; }
body.books-reader-contrast .books-reader-content { color: #000; }
body.books-reader-contrast .books-reader-content .books-reader-block { background: #fff; border: 2px solid #000; }
body.books-reader-contrast .books-reader-content h1, body.books-reader-contrast .books-reader-content h2, body.books-reader-contrast .books-reader-content h3 { color: #000; }
body.books-reader-contrast .books-reader-content .books-highlight { background: color-mix(in srgb, var(--books-highlight-bg) 92%, #000 8%); }
.books-reader-content.font-dyslexia { font-family: var(--books-reader-font); letter-spacing: var(--books-reader-letter-spacing); }

.books-onboarding {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,0.6); display: flex; align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
}
.books-onboarding[hidden] { display: none !important; }
.books-onboarding-content {
  max-width: 400px; background: var(--books-paper); padding: 32px; border-radius: 20px;
  box-shadow: var(--books-shadow-lg); border: 1px solid var(--books-border);
}
.books-onboarding-content h2 { margin: 0 0 16px; font-size: 22px; font-weight: 400; }
.books-onboarding-content p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: var(--books-text-muted); }
.books-onboarding-content kbd { padding: 2px 6px; background: var(--books-bg-alt); border-radius: 4px; font-family: monospace; font-size: 13px; }
.books-onboarding-content .books-btn { margin-top: 16px; width: 100%; justify-content: center; }

.books-selection-toolbar {
  position: fixed;
  z-index: 100;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: var(--books-dark);
  border-radius: 12px;
  box-shadow: var(--books-shadow-lg);
}
.books-selection-toolbar[hidden] { display: none !important; visibility: hidden !important; pointer-events: none !important; }
.books-selection-toolbar.is-mobile-docked {
  left: 50% !important;
  top: auto !important;
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 360px);
  justify-content: center;
}
.books-selection-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.books-selection-btn:hover { background: rgba(255,255,255,0.2); }
.books-selection-btn:nth-child(2),
.books-selection-btn:nth-child(3) {
  animation: books-selection-pulse 1.8s ease-in-out infinite;
}
@keyframes books-selection-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(47,150,150,0);
  }
  45% {
    transform: scale(1.03);
    box-shadow: 0 0 0 6px rgba(47,150,150,0.12);
  }
}
@media (prefers-reduced-motion: reduce) {
  .books-selection-btn:nth-child(2),
  .books-selection-btn:nth-child(3) {
    animation: none !important;
  }
}
.books-selection-note-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.books-selection-note-modal[hidden] { display: none !important; }
.books-selection-note-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(4px);
}
.books-selection-note-card {
  position: relative;
  width: min(100%, 420px);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--books-paper);
  border: 1px solid var(--books-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  padding: 20px;
}
.books-selection-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.books-selection-note-head h3 {
  margin: 0;
  font-family: var(--books-font-display);
  font-size: 1.3rem;
  color: var(--books-text);
}
.books-selection-note-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--books-bg-alt);
  color: var(--books-text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.books-selection-note-close:hover { background: var(--books-border); color: var(--books-text); }
.books-selection-note-label {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--books-text-muted);
}
.books-selection-note-quote {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--books-bg-alt);
  border: 1px solid var(--books-border);
  border-radius: 14px;
  color: var(--books-text);
  line-height: 1.55;
  font-size: 14px;
}
.books-selection-note-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--books-border);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--books-text);
  background: var(--books-paper);
}
.books-selection-note-input:focus {
  outline: none;
  border-color: var(--books-primary);
  box-shadow: 0 0 0 3px rgba(47,150,150,0.15);
}
.books-selection-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.books-selection-note-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--books-border);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}
.books-selection-note-btn-secondary {
  background: var(--books-paper);
  color: var(--books-text);
}
.books-selection-note-btn-primary {
  background: var(--books-primary);
  border-color: var(--books-primary);
  color: #fff;
}
@media (max-width: 640px) {
  .books-selection-toolbar {
    max-width: calc(100vw - 20px);
    gap: 8px;
    padding: 10px;
  }
  .books-selection-toolbar.is-mobile-docked {
    width: min(calc(100vw - 20px), 380px);
  }
  .books-selection-btn {
    flex: 1 1 0;
    min-height: 52px;
    padding: 12px 10px;
    font-size: 15px;
    border-radius: 14px;
    text-align: center;
    justify-content: center;
    display: inline-flex;
    align-items: center;
  }
  .books-selection-btn:nth-child(1) {
    background: rgba(255,255,255,0.14);
  }
  .books-selection-btn:nth-child(2),
  .books-selection-btn:nth-child(3) {
    background: linear-gradient(180deg, rgba(47,150,150,0.34) 0%, rgba(47,150,150,0.2) 100%);
    border: 1px solid rgba(104, 211, 211, 0.28);
  }
  .books-selection-note-modal {
    align-items: flex-end;
    padding: 12px;
  }
  .books-selection-note-card {
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: min(78vh, 680px);
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .books-selection-note-actions {
    flex-direction: column-reverse;
  }
  .books-selection-note-btn {
    width: 100%;
  }
}

.books-annotations-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100%);
  z-index: 80;
  background: var(--books-paper);
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}
.books-annotations-panel[hidden] { display: none !important; }
.books-annotations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--books-border);
}
.books-annotations-header h3 { margin: 0; font-size: 18px; font-weight: 400; }
.books-annotations-close {
  width: 36px; height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--books-bg-alt);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--books-text-muted);
}
.books-annotations-close:hover { background: var(--books-border); color: var(--books-text); }
.books-annotations-list { flex: 1; overflow-y: auto; padding: 16px; }
.books-annotation-item {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--books-bg-alt);
  border-radius: 14px;
  border-left: 4px solid var(--books-primary);
}
.books-annotation-text { font-size: 14px; line-height: 1.5; margin-bottom: 8px; color: var(--books-text); }
.books-annotation-note { font-size: 13px; color: var(--books-text-muted); font-style: italic; }
.books-annotation-meta { font-size: 12px; color: var(--books-text-muted); margin-top: 8px; }
.books-annotation-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.books-annotation-goto { font-size: 12px; color: var(--books-primary); cursor: pointer; font-weight: 400; border: none; background: none; padding: 0; }
.books-annotation-delete { font-size: 12px; color: var(--books-text-muted); cursor: pointer; border: none; background: none; padding: 0; }
.books-annotation-delete:hover { color: #dc2626; }
.books-annotations-empty { font-size: 14px; color: var(--books-text-muted); padding: 24px; text-align: center; }

/* Light library workspace — sidebar below hero, sticky after scroll */
.books-library-shell {
  width: min(1536px, calc(100vw - 56px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--books-sidebar-width) minmax(0, 1fr);
  gap: 48px;
  padding: 52px 0 96px;
  color: var(--books-text);
  box-sizing: border-box;
}
.books-library-sidebar {
  position: sticky;
  top: var(--books-header-height);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 0 0 24px;
  border: 0;
  border-radius: 0;
  background: #FBFCFD;
  box-shadow: none;
  z-index: 50;
}
@media (min-width: 1181px) {
  .books-library-sidebar {
    top: max(var(--books-header-height), calc(50vh - 184px));
    padding-top: 4px;
    border-right: 1px solid var(--books-border);
  }
  .books-library-sidebar.is-fixed-center .books-side-nav {
    position: fixed;
    top: 50vh;
    left: calc((100vw - min(1536px, calc(100vw - 56px))) / 2);
    width: var(--books-sidebar-width);
    transform: translateY(-50%);
    z-index: 50;
  }
}
@media (max-width: 1180px) {
  .books-library-shell {
    grid-template-columns: 1fr;
    gap: 30px;
    width: min(1100px, calc(100vw - 40px));
    padding: 40px 0 80px;
  }
  .books-library-sidebar {
    position: sticky;
    top: var(--books-header-height);
    transform: none;
    max-height: none;
    padding: 0 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--books-border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    overflow: visible;
  }
}
.books-library-content {
  min-width: 0;
  width: 100%;
  padding-top: 0;
}
.books-side-brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 0 6px 22px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--books-border);
}
.books-side-logo {
  width: 44px; height: 44px; object-fit: contain;
  border-radius: 12px;
  background: linear-gradient(145deg, #157f72, #0d514b);
}
.books-side-brand strong,
.books-side-user strong {
  display: block;
  font-size: 19px;
  line-height: 1.1;
  font-weight: 400;
  color: var(--books-text);
}
.books-side-brand span {
  display: block;
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  color: var(--books-text-faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
}
.books-side-user span,
.books-side-progress span {
  display: block;
  color: var(--books-text-faint);
  font-size: 12.5px;
  line-height: 1.35;
}
.books-side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.books-side-nav-label {
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--books-text-faint);
  padding: 0 12px;
  margin: 14px 0 8px;
}
.books-side-nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--books-text-muted);
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.books-side-nav-item svg {
  width: 19px; height: 19px; flex: none;
  stroke: currentColor; stroke-width: 1.7; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.85;
}
.books-side-nav-item:hover {
  background: var(--books-bg-alt);
  color: var(--books-text);
}
.books-side-nav-item.is-active {
  background: var(--books-accent-soft);
  color: var(--books-primary-hover);
  font-weight: 400;
}
.books-side-nav-item.is-active svg { opacity: 1; }
.books-side-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--books-primary);
}
.books-side-progress {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--books-border);
  border-radius: 18px;
  background: linear-gradient(170deg, #FFFFFF, #F6FAFB);
}
.books-side-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.books-side-progress p {
  margin: 0;
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--books-text-muted);
}
.books-side-progress strong {
  font-size: 26px;
  line-height: 1;
  color: var(--books-text);
  font-weight: 500;
}
.books-side-progress span { margin-top: 9px; }
.books-side-progress-bar {
  height: 6px;
  margin-top: 13px;
  border-radius: 999px;
  background: #E7EEF0;
  overflow: hidden;
}
.books-side-progress-bar i {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34a39a, #2f9696);
}
.books-side-user {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--books-border);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.books-side-user:hover {
  border-color: var(--books-border-strong);
  box-shadow: 0 6px 18px rgba(15,23,42,0.05);
}
.books-side-user strong { font-size: 14px; }
.books-side-user span {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.books-side-avatar {
  width: 38px;
  height: 38px;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #1e7b66, #0f4f49);
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 400;
}
/* Warm library atmosphere behind the landing list */
#books-list-view {
  background:
    radial-gradient(1200px 620px at 86% 360px, rgba(201,154,74,0.06), transparent 60%),
    radial-gradient(900px 520px at -6% 440px, rgba(47,150,150,0.045), transparent 60%),
    linear-gradient(180deg, #FBF9F4 0%, #FBF9F4 68%, #FFFFFF 100%);
}

/* Continue reading — personal featured card */
.books-continue {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 36px 44px;
  margin-bottom: 42px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f5450 0%, #0c3c3e 56%, #0a3133 100%);
  box-shadow: 0 30px 70px rgba(12,60,62,0.30);
}
.books-continue[hidden] { display: none; }
.books-continue::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 320px at 94% -25%, rgba(201,154,74,0.22), transparent 60%),
    radial-gradient(440px 380px at 4% 130%, rgba(47,150,150,0.30), transparent 60%);
  pointer-events: none;
}
.books-continue-cover {
  position: relative;
  z-index: 1;
  display: block;
  text-decoration: none;
}
.books-continue-book {
  width: 168px;
  height: 238px;
  border-radius: 3px 6px 6px 3px;
  overflow: hidden;
  background: linear-gradient(145deg, #16524c, #0c3a37);
  box-shadow: 2px 0 0 rgba(0,0,0,0.18), 0 26px 46px rgba(0,0,0,0.42);
  transition: transform 0.4s cubic-bezier(.2,.7,.3,1);
}
.books-continue-cover:hover .books-continue-book { transform: translateY(-5px) rotate(-1deg); }
.books-continue-book img { width: 100%; height: 100%; object-fit: cover; display: block; }
.books-continue-book-empty {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 8px, transparent 8px 16px),
    linear-gradient(145deg, #16524c, #0c3a37);
}
.books-continue-body { position: relative; z-index: 1; color: #fff; min-width: 0; }
.books-continue-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #84dccf;
}
.books-continue-kicker::before { content: ''; width: 20px; height: 1.5px; background: #84dccf; }
.books-continue-title {
  font-family: var(--books-font-display);
  font-size: clamp(1.9rem, 2.6vw, 2.2rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: #fff;
}
.books-continue-author {
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 14px;
  color: rgba(255,255,255,0.64);
  margin: 0 0 22px;
}
.books-continue-pbar {
  height: 6px;
  max-width: 440px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  overflow: hidden;
}
.books-continue-pbar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #5fcabd, #c9a24a);
  transition: width 0.6s ease;
}
.books-continue-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 11px 0 24px;
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 12.5px;
  color: rgba(255,255,255,0.66);
}
.books-continue-meta b { color: #fff; font-weight: 400; }
.books-continue-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.books-continue-resume,
.books-continue-overview {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.books-continue-resume {
  background: #fff;
  color: #0c3c3e;
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}
.books-continue-resume:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(0,0,0,0.30); }
.books-continue-resume svg { width: 15px; height: 15px; }
.books-continue-overview {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.24);
}
.books-continue-overview:hover { background: rgba(255,255,255,0.18); }

/* Browse / filter area — light & airy, no heavy card */
.books-library-content .books-tags-section {
  margin: 0 0 30px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.books-library-content .books-shelves-heading,
.books-library-content .books-tags-heading,
.books-library-content .books-filters-heading {
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  color: var(--books-text-faint);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 400;
  margin: 0 0 12px;
}
.books-library-content .books-filters-heading,
.books-library-content .books-tags-heading {
  border-top: 0;
  padding-top: 0;
  margin-top: 22px;
}
.books-library-content .books-shelves,
.books-library-content .books-filter-chips,
.books-library-content .books-tags {
  gap: 9px;
  align-items: center;
}
@media (max-width: 1180px) {
  .books-library-content .books-shelves,
  .books-library-content .books-filter-chips,
  .books-library-content .books-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .books-library-content .books-shelves::-webkit-scrollbar,
  .books-library-content .books-filter-chips::-webkit-scrollbar,
  .books-library-content .books-tags::-webkit-scrollbar { display: none; }
}
.books-library-content .books-shelf,
.books-library-content .books-filter-chip,
.books-library-content .books-tag {
  min-height: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--books-border-strong);
  font-family: var(--books-font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--books-text-muted);
  box-shadow: none;
  flex: none;
}
.books-library-content .books-collections-select,
.books-library-content .books-sort-select {
  min-height: 0;
  padding: 8px 32px 8px 14px;
  border-radius: 10px;
  background-color: #fff;
  border: 1px solid var(--books-border-strong);
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 13.5px;
  color: var(--books-text);
  box-shadow: none;
}
.books-library-content .books-shelf:hover,
.books-library-content .books-filter-chip:hover,
.books-library-content .books-tag:hover {
  background: var(--books-bg-alt);
  border-color: #C5D2DA;
  color: var(--books-text);
}
.books-library-content .books-shelf.is-selected {
  background: var(--books-primary);
  border-color: var(--books-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47,150,150,0.22);
}
.books-library-content .books-filter-chip.is-selected,
.books-library-content .books-tag.is-selected {
  background: var(--books-accent-soft);
  border-color: #BFE3E0;
  color: var(--books-primary-hover);
  font-weight: 400;
  box-shadow: none;
}
.books-library-content .books-collections-label {
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--books-text-faint);
}
.books-library-content .books-grid-section {
  margin: 0;
  padding-top: 30px;
  border-top: 1px solid var(--books-border);
}
.books-library-content .books-section-header {
  align-items: flex-end;
  margin-bottom: 26px;
}
.books-library-content .books-section-heading {
  font-size: clamp(1.9rem, 2.6vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--books-text);
}
.books-library-content .books-section-sub {
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 13.5px;
  color: var(--books-text-faint);
}
.books-library-content .books-section-controls {
  align-items: center;
  gap: 10px;
}
.books-library-content .books-sort-label {
  font-family: var(--books-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 13px;
  color: var(--books-text-faint);
  font-weight: 500;
}
.books-library-content .books-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 28px;
}
/* Premium library cards — full cover, white pill, description + progress */
.books-library-content .books-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--books-border);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(.2,.7,.3,1), box-shadow 0.28s, border-color 0.2s;
}
.books-library-content .books-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(15,23,42,0.13);
  border-color: var(--books-border-strong);
}
.books-library-content .books-card-cover {
  position: relative;
  width: 100%;
  flex: none;
  min-height: 0;
  aspect-ratio: 16 / 9;
  display: block;
  padding: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #f7fafc 0%, #edf4f6 100%);
  overflow: hidden;
}
.books-library-content .books-card-cover img,
.books-library-content .books-card-cover-placeholder {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.4s ease;
}
.books-library-content .books-card:hover .books-card-cover img {
  transform: scale(1.04);
}
.books-library-content .books-card-cover-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}
.books-library-content .books-card-cover-overlay {
  display: block;
  background: linear-gradient(180deg, rgba(0,0,0,0.04) 0%, transparent 40%, rgba(0,0,0,0.12) 100%);
}
.books-library-content .books-card-pill,
.books-shelf-track .books-card-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  right: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  height: 18px;
  min-height: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
  color: #15212E;
  border: 1px solid rgba(215,224,230,0.9);
  font-family: var(--books-font-body);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 5px rgba(15,23,42,0.12);
  z-index: 3;
}
.books-library-content .books-card-read,
.books-shelf-track .books-card-read {
  display: none;
}
.books-library-content .books-card-body {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 16px 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.books-library-content .books-card-title {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.22;
  margin-bottom: 4px;
  color: var(--books-text);
}
.books-library-content .books-card-author {
  font-family: var(--books-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--books-primary);
  margin-bottom: 8px;
}
.books-library-content .books-card-desc {
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.45;
  color: var(--books-text-muted);
  margin: 0 0 12px;
}
.books-library-content .books-card-tags,
.books-library-content .books-card-badges {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.books-library-content .books-card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--books-font-body);
  padding: 2px 10px;
  height: 18px;
  min-height: 0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  background: #FFFFFF;
  border: 1px solid #C5D2DA;
  color: #465466;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
  flex-shrink: 0;
}
.books-shelf-track .books-card-desc {
  -webkit-line-clamp: 2;
  margin-bottom: 10px;
}
.books-shelf-track .books-card-tags {
  margin-top: 10px;
  padding-top: 0;
}
.books-shelf-track .books-card-meta {
  margin-top: 10px;
  padding-top: 0;
}
.books-shelf-track .books-card-body {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 14px 16px;
}
.books-card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 14px;
}
.books-library-content .books-card-progress {
  flex: 1;
  height: 5px;
  width: auto;
  margin: 0;
  background: #E7EEF0;
  border-radius: 999px;
  overflow: hidden;
}
.books-library-content .books-card-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34a39a, #2f9696);
}
.books-card-pct {
  font-family: var(--books-font-body);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--books-primary);
  white-space: nowrap;
}
.books-detail-view,
#books-detail-view,
.books-reader-view,
.books-nizam-marketing {
  background:
    radial-gradient(circle at 86% 4%, rgba(228,182,102,0.10), transparent 28%),
    linear-gradient(180deg, #fbfcfd 0%, #fff 36%);
}
#books-detail-view {
  padding-top: 46px;
}
.books-detail-top,
.books-detail-body {
  max-width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}
.books-detail-back {
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.books-detail-body {
  padding-top: 30px;
}
.books-detail-body .books-detail-hero-title {
  font-size: clamp(2.15rem, 4vw, 3.4rem);
  font-weight: 500;
}
.books-detail-overview,
.books-detail-stat,
.books-reader-block,
.books-reader-settings-section {
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15,23,42,0.06);
}
.books-similar {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.books-detail-actions .books-btn {
  border-radius: 999px;
}
.books-reader-header,
.books-reader-progress-sticky,
.books-reader-chapter-select-row {
  background: rgba(255,255,255,0.94);
  border-color: rgba(209,220,230,0.9);
  backdrop-filter: blur(18px);
}
.books-reader-scroll {
  background:
    radial-gradient(circle at 16% 2%, rgba(228,182,102,0.10), transparent 24%),
    linear-gradient(180deg, #fbfcfd 0%, #fff 42%);
}
.books-reader-content {
  max-width: min(var(--books-reader-max-width), calc(100vw - 48px));
}
@media (max-width: 1180px) {
  .books-library-shell {
    width: min(1100px, calc(100vw - 40px));
  }
  .books-library-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    overflow: visible;
  }
  .books-side-brand {
    border-bottom: 0;
    padding: 0;
    margin: 0;
  }
  .books-side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .books-side-nav-label { display: none; }
  .books-side-nav-item { padding: 9px 12px; }
  .books-side-nav-item.is-active::before { display: none; }
  .books-side-progress { display: none; }
  .books-side-user { margin: 0 0 0 auto; }
  .books-continue { padding: 30px 34px; gap: 32px; }
  .books-continue-book { width: 140px; height: 198px; }
  .books-library-content .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .books-library-shell {
    width: 100%;
    padding: 24px var(--books-pad) 54px;
    gap: 22px;
  }
  .books-side-brand { flex: 1 1 100%; }
  .books-side-user { display: none; }
  .books-side-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .books-side-nav-item { flex: none; }
  .books-continue {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 30px 24px;
    gap: 22px;
  }
  .books-continue-kicker { justify-content: center; }
  .books-continue-pbar { margin: 0 auto; }
  .books-continue-meta { justify-content: center; }
  .books-continue-actions { justify-content: center; }
  .books-library-content .books-grid {
    grid-template-columns: 1fr;
  }
}

.books-footer {
  margin-top: auto;
  padding: 28px var(--books-pad);
  text-align: center;
  font-size: 14px;
  color: var(--books-text-muted);
  border-top: 1px solid var(--books-border);
}
.books-footer a { color: var(--books-primary); text-decoration: none; font-weight: 400; }
.books-footer a:hover { text-decoration: underline; }

/* =====================================================================
   DARK LIBRARY LANDING — continues the cinematic hero (mockup-matched)
   Scoped to #books-list-view so detail/reader/marketing stay light.
   ===================================================================== */
#books-list-view {
  --dk-text: #15212E;
  --dk-muted: #5C6B79;
  --dk-faint: #8B99A5;
  --dk-gold: #A9772A;
  --dk-teal: #2F9696;
  --dk-teal-deep: #237E7E;
  --dk-panel: #FFFFFF;
  --dk-panel-2: #F1F5F7;
  --dk-border: #E7EDF1;
  --dk-border-2: #D7E0E6;
  --dk-soft: #ECF6F5;
  background:
    radial-gradient(1100px 620px at 86% 160px, rgba(201,154,74,0.06), transparent 60%),
    radial-gradient(950px 560px at 0% 400px, rgba(47,150,150,0.05), transparent 62%),
    linear-gradient(180deg, #F6F9FA 0%, #FBFCFD 100%);
}
#books-list-view .books-library-shell { color: var(--dk-text); }

/* ---- sidebar (light) ---- */
#books-list-view .books-side-brand { border-bottom-color: var(--dk-border); }
#books-list-view .books-side-brand strong { color: var(--dk-text); }
#books-list-view .books-side-brand span { color: var(--dk-faint); }
#books-list-view .books-side-logo { box-shadow: 0 8px 20px rgba(13,79,73,0.28); }
#books-list-view .books-side-nav-label { color: var(--dk-faint); }
#books-list-view .books-side-nav-item { color: var(--dk-muted); }
#books-list-view .books-side-nav-item svg { color: var(--dk-gold); opacity: 0.92; }
#books-list-view .books-side-nav-item:hover { background: var(--dk-panel-2); color: var(--dk-text); }
#books-list-view .books-side-nav-item.is-active { background: var(--dk-soft); color: var(--dk-teal-deep); }
#books-list-view .books-side-nav-item.is-active::before { background: var(--dk-teal); }
#books-list-view .books-side-nav-item.is-active svg { color: var(--dk-teal-deep); opacity: 1; }
#books-list-view .books-side-progress {
  background: linear-gradient(170deg, #FFFFFF, #F6FAFB);
  border-color: var(--dk-border);
  box-shadow: 0 8px 26px rgba(20,33,44,0.04);
}
#books-list-view .books-side-progress p { color: var(--dk-muted); }
#books-list-view .books-side-progress strong { color: var(--dk-text); }
#books-list-view .books-side-progress span { color: var(--dk-faint); }
#books-list-view .books-side-progress-bar { background: #E7EEF0; }
#books-list-view .books-side-user { background: var(--dk-panel); border-color: var(--dk-border); }
#books-list-view .books-side-user:hover { border-color: var(--dk-border-2); box-shadow: 0 8px 22px rgba(20,33,44,0.06); }
#books-list-view .books-side-user strong { color: var(--dk-text); }
#books-list-view .books-side-user span { color: var(--dk-faint); }

/* ---- horizontal shelves (Continue Reading / Recently Added) ---- */
#books-list-view .books-shelf-section { margin: 0 0 30px; }
#books-list-view .books-shelf-section[hidden] { display: none; }
#books-list-view #books-shelf-continue { margin-bottom: 22px; }
.books-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
#books-list-view .books-shelf-title {
  font-family: var(--books-font-display);
  font-size: clamp(1.4rem, 1.9vw, 1.65rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--dk-text);
  margin: 0;
}
.books-shelf-viewall {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--dk-gold);
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.books-shelf-viewall span { font-size: 16px; line-height: 1; }
.books-shelf-viewall:hover { background: var(--dk-panel-2); color: #8A5F1F; }
.books-shelf-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 280px);
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding: 2px 2px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(20,33,44,0.18) transparent;
}
#books-shelf-continue-track {
  justify-content: center;
}
.books-shelf-track::-webkit-scrollbar { height: 8px; }
.books-shelf-track::-webkit-scrollbar-track { background: transparent; }
.books-shelf-track::-webkit-scrollbar-thumb { background: rgba(20,33,44,0.16); border-radius: 999px; }
.books-shelf-track::-webkit-scrollbar-thumb:hover { background: rgba(20,33,44,0.28); }
.books-shelf-track .books-card {
  scroll-snap-align: start;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.books-shelf-track .books-card-cover {
  width: 100%;
  flex: none;
  aspect-ratio: 16 / 9;
  min-height: 0;
}
#books-shelf-recent {
  position: relative;
  margin-top: 0;
  padding: 0 0 12px;
}
#books-shelf-recent .books-shelf-head {
  position: relative;
  justify-content: center;
  margin-bottom: 10px;
  min-height: 36px;
}
#books-shelf-recent .books-shelf-title {
  font-size: clamp(1.8rem, 2.6vw, 2.35rem);
  text-align: center;
}
#books-shelf-recent .books-shelf-viewall {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.books-carousel-frame {
  position: relative;
  perspective: 1200px;
  isolation: isolate;
  padding: 10px 58px 24px;
}
.books-carousel-frame::before,
.books-carousel-frame::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 18px;
  width: 92px;
  z-index: 3;
  pointer-events: none;
}
.books-carousel-frame::before {
  left: 0;
  background: linear-gradient(90deg, #FBFCFD 8%, rgba(251,252,253,0));
}
.books-carousel-frame::after {
  right: 0;
  background: linear-gradient(270deg, #FBFCFD 8%, rgba(251,252,253,0));
}
#books-shelf-recent .books-carousel-track {
  display: flex;
  grid-auto-flow: unset;
  grid-auto-columns: unset;
  gap: 34px;
  align-items: center;
  overflow-x: hidden;
  overflow-y: visible;
  scroll-snap-type: none;
  scroll-behavior: smooth;
  padding: 24px calc(50% - 155px) 34px;
  scrollbar-width: none;
}
#books-shelf-recent .books-carousel-track::-webkit-scrollbar {
  display: none;
}
#books-shelf-recent .books-carousel-track .books-card {
  flex: 0 0 310px;
  width: 310px;
  transform-origin: center center;
  transform: translateY(18px) scale(0.84);
  opacity: 0.58;
  filter: saturate(0.8);
  box-shadow: 0 12px 28px rgba(20,33,44,0.08);
  transition:
    transform 0.55s cubic-bezier(.2,.75,.2,1),
    opacity 0.45s ease,
    filter 0.45s ease,
    box-shadow 0.55s ease,
    border-color 0.35s ease;
}
#books-shelf-recent .books-carousel-track .books-card.is-carousel-near {
  transform: translateY(10px) scale(0.9) rotateY(0.6deg);
  opacity: 0.82;
  filter: saturate(0.95);
  box-shadow: 0 22px 42px rgba(20,33,44,0.12);
}
#books-shelf-recent .books-carousel-track .books-card.is-carousel-active {
  transform: translateY(-12px) scale(1.16);
  opacity: 1;
  filter: saturate(1.08);
  border-color: rgba(217,182,121,0.5);
  box-shadow:
    0 38px 86px rgba(20,33,44,0.22),
    0 16px 34px rgba(47,150,150,0.16),
    0 0 0 1px rgba(255,255,255,0.9) inset;
  z-index: 2;
}
#books-shelf-recent .books-carousel-track .books-card.is-carousel-active .books-card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(240px 110px at 50% 0%, rgba(255,255,255,0.24), transparent 65%),
    linear-gradient(180deg, rgba(217,182,121,0.12), transparent 45%);
  pointer-events: none;
}
#books-shelf-recent .books-carousel-track .books-card.is-carousel-far {
  pointer-events: none;
}
.books-carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215,224,230,0.95);
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  color: var(--dk-text);
  box-shadow: 0 18px 38px rgba(20,33,44,0.13);
  backdrop-filter: blur(12px);
  font-family: var(--books-font-display);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.books-carousel-btn:hover {
  background: #FFFFFF;
  color: var(--dk-gold);
  box-shadow: 0 22px 46px rgba(20,33,44,0.18);
}
.books-carousel-btn:active {
  transform: translateY(-50%) scale(0.96);
}
.books-carousel-btn-prev { left: 4px; }
.books-carousel-btn-next { right: 4px; }
@media (max-width: 900px) {
  #books-shelf-recent .books-shelf-head {
    justify-content: space-between;
  }
  #books-shelf-recent .books-shelf-title {
    text-align: left;
  }
  #books-shelf-recent .books-shelf-viewall {
    position: static;
    transform: none;
  }
  .books-carousel-frame {
    padding-left: 46px;
    padding-right: 46px;
  }
  #books-shelf-recent .books-carousel-track {
    gap: 22px;
    padding-left: calc(50% - 135px);
    padding-right: calc(50% - 135px);
  }
  #books-shelf-recent .books-carousel-track .books-card {
    flex-basis: 270px;
    width: 270px;
  }
}
@media (max-width: 560px) {
  .books-carousel-frame {
    padding-left: 36px;
    padding-right: 36px;
  }
  .books-carousel-btn {
    width: 38px;
    height: 38px;
    font-size: 25px;
  }
  #books-shelf-recent .books-carousel-track {
    padding-left: calc(50% - 122px);
    padding-right: calc(50% - 122px);
  }
  #books-shelf-recent .books-carousel-track .books-card {
    flex-basis: 244px;
    width: 244px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #books-shelf-recent .books-carousel-track,
  #books-shelf-recent .books-carousel-track .books-card,
  .books-carousel-btn {
    scroll-behavior: auto;
    transition: none;
  }
}

/* ---- browse + filters (dark) ---- */
#books-list-view .books-library-content .books-shelves-heading,
#books-list-view .books-library-content .books-tags-heading,
#books-list-view .books-library-content .books-filters-heading { color: var(--dk-faint); }
#books-list-view .books-library-content .books-shelf,
#books-list-view .books-library-content .books-filter-chip,
#books-list-view .books-library-content .books-tag {
  background: var(--dk-panel);
  border-color: var(--dk-border);
  color: var(--dk-muted);
}
#books-list-view .books-library-content .books-shelf:hover,
#books-list-view .books-library-content .books-filter-chip:hover,
#books-list-view .books-library-content .books-tag:hover {
  background: var(--dk-panel-2);
  border-color: var(--dk-border-2);
  color: var(--dk-text);
}
#books-list-view .books-library-content .books-shelf.is-selected {
  background: var(--dk-teal-deep);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(47,150,150,0.32);
}
#books-list-view .books-library-content .books-filter-chip.is-selected,
#books-list-view .books-library-content .books-tag.is-selected {
  background: rgba(217,182,121,0.16);
  border-color: rgba(217,182,121,0.42);
  color: var(--dk-gold);
}
#books-list-view .books-library-content .books-collections-label,
#books-list-view .books-library-content .books-sort-label { color: var(--dk-faint); }
#books-list-view .books-library-content .books-collections-select,
#books-list-view .books-library-content .books-sort-select {
  background-color: var(--dk-panel);
  border-color: var(--dk-border);
  color: var(--dk-text);
}

/* ---- section header (dark) ---- */
#books-list-view .books-library-content .books-grid-section { border-top-color: var(--dk-border); }
#books-list-view .books-library-content .books-section-heading { color: var(--dk-text); }
#books-list-view .books-library-content .books-section-sub { color: var(--dk-faint); }

/* ---- cards (premium) — used by both grid and shelves ---- */
#books-list-view .books-library-content .books-card {
  background: var(--dk-panel);
  border-color: var(--dk-border);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
#books-list-view .books-library-content .books-card:hover {
  box-shadow: 0 24px 50px rgba(15,23,42,0.13);
  border-color: var(--dk-border-2);
}
#books-list-view .books-library-content .books-card-cover,
#books-list-view .books-shelf-track .books-card-cover {
  background: linear-gradient(180deg, #f7fafc 0%, #edf4f6 100%);
  border: 0;
  width: 100%;
  flex: none;
  min-height: 0;
  aspect-ratio: 16 / 9;
  padding: 0;
}
#books-list-view .books-library-content .books-card-cover img,
#books-list-view .books-shelf-track .books-card-cover img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}
#books-list-view .books-library-content .books-card:hover .books-card-cover,
#books-list-view .books-shelf-track .books-card:hover .books-card-cover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}
#books-list-view .books-library-sidebar {
  background: linear-gradient(180deg, #F6F9FA 0%, #FBFCFD 100%);
}
#books-list-view .books-card-pill,
#books-list-view .books-shelf-track .books-card-pill {
  top: 8px;
  left: 8px;
  padding: 2px 10px;
  height: 18px;
  min-height: 0;
  font-size: 9.5px;
  background: rgba(255,255,255,0.94);
  color: #15212E;
  border: 1px solid rgba(215,224,230,0.9);
  box-shadow: 0 1px 5px rgba(15,23,42,0.12);
}
#books-list-view .books-library-content .books-card-tag,
#books-list-view .books-shelf-track .books-card-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  height: 18px;
  min-height: 0;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  background: #FFFFFF;
  border: 1px solid #C5D2DA;
  color: #465466;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
}
#books-list-view .books-library-content .books-card-title { color: var(--dk-text); }
#books-list-view .books-library-content .books-card-author { color: var(--dk-teal); }
#books-list-view .books-library-content .books-card-desc { color: var(--dk-muted); }
#books-list-view .books-library-content .books-card-progress { background: #E7EEF0; }
#books-list-view .books-card-pct { color: var(--dk-teal); }

/* ---- empty / loading / error states (dark) ---- */
#books-list-view .books-empty h3,
#books-list-view .books-no-results h3,
#books-list-view .books-error h3 { color: var(--dk-text); }
#books-list-view .books-empty p,
#books-list-view .books-no-results p,
#books-list-view .books-error p { color: var(--dk-muted); }
#books-list-view .books-illo { color: var(--dk-faint); }
#books-list-view .books-skeleton-card { background: var(--dk-panel); border-color: var(--dk-border); }
#books-list-view .books-loading-text { color: var(--dk-muted); }

/* =====================================================================
   ROUTED SUB-PAGES (Notes / Highlights / Collections / Review / Settings)
   ===================================================================== */
#books-list-view .books-page[hidden] { display: none !important; }
#books-list-view .books-page { animation: books-page-in 0.34s cubic-bezier(.2,.7,.3,1); }
@keyframes books-page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#books-list-view .books-side-nav-item { position: relative; }
.books-side-nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 400;
  color: #0a1413;
  background: var(--dk-gold);
}
.books-side-nav-badge[hidden] { display: none; }

/* page header */
.books-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
#books-list-view .books-page-title {
  font-family: var(--books-font-display);
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1;
  margin: 0 0 8px;
  color: var(--dk-text);
}
#books-list-view .books-page-sub {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 14px;
  color: var(--dk-faint);
  margin: 0;
  max-width: 60ch;
}
.books-page-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--dk-border-2);
  background: var(--dk-panel);
  color: var(--dk-text);
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.books-page-action:hover { background: var(--dk-panel-2); border-color: var(--dk-border-2); }
.books-page-count {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 13px;
  color: var(--dk-faint);
  margin: 0 0 20px;
}

/* home → browse CTA */
.books-home-browse {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.books-home-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--dk-border-2);
  background: var(--dk-panel);
  color: var(--dk-text);
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 14.5px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.books-home-browse-btn:hover { background: var(--dk-panel-2); border-color: var(--dk-border-2); transform: translateY(-2px); }
.books-home-browse-btn span { color: var(--dk-gold); font-size: 17px; }

/* Homepage refresh: larger library-style shelves, full sidebar, no bold weights */
#books-list-view,
#books-list-view * {
  font-family: var(--books-font-body);
  font-weight: 400 !important;
  letter-spacing: 0;
}
@media (min-width: 1181px) {
  .books-library-sidebar {
    top: calc(var(--books-header-height) + 18px);
    min-height: calc(100vh - var(--books-header-height) - 36px);
    padding: 4px 18px 18px 0;
    justify-content: flex-start;
  }
  .books-library-sidebar.is-fixed-center .books-side-nav {
    position: static;
    width: 100%;
    transform: none;
  }
}
.books-side-panel,
.books-side-mini-card {
  width: calc(100% - 12px);
  margin-top: 14px;
  border: 1px solid var(--dk-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 10px 28px rgba(20,33,44,0.045);
}
.books-side-panel {
  padding: 15px 14px;
}
.books-side-panel-kicker {
  margin: 0 0 10px;
  color: var(--dk-gold);
  font-size: 12px;
  text-transform: uppercase;
}
.books-side-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.books-side-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(169,119,42,0.28);
  color: var(--dk-muted);
  background: rgba(217,182,121,0.10);
  font-size: 12px;
  line-height: 1;
}
.books-side-panel-copy,
.books-side-panel-quote p {
  margin: 12px 0 0;
  color: var(--dk-muted);
  font-size: 13px;
  line-height: 1.45;
}
.books-side-panel-quote {
  background: linear-gradient(180deg, rgba(236,246,245,0.8), rgba(255,255,255,0.88));
}
.books-side-panel-quote p {
  margin: 0;
  color: var(--dk-text);
}
.books-side-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  color: var(--dk-text);
  cursor: pointer;
}
.books-side-mini-card i {
  color: var(--dk-gold);
  font-style: normal;
}
#books-list-view .books-shelf-section {
  margin-bottom: 42px;
}
#books-list-view .books-shelf-title {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.04;
}
.books-shelf-kicker,
.books-shelf-intro {
  margin: 0;
  color: var(--dk-faint);
  font-size: 13px;
  line-height: 1.5;
}
.books-shelf-kicker {
  color: var(--dk-gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.books-shelf-intro {
  max-width: 52ch;
  margin: -6px 0 18px;
}
.books-shelf-track {
  grid-auto-columns: minmax(340px, 390px);
  gap: 30px;
  padding-bottom: 18px;
}
#books-shelf-continue-track {
  justify-content: start;
}
#books-list-view .books-shelf-track .books-card {
  background: var(--dk-panel);
  border: 1px solid var(--dk-border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(20,33,44,0.075);
  overflow: hidden;
}
#books-list-view .books-shelf-track .books-card-cover {
  aspect-ratio: 16 / 9;
}
#books-list-view .books-shelf-track .books-card-body {
  padding: 18px 18px 20px;
}
#books-list-view .books-shelf-track .books-card-title {
  font-size: 23px;
  line-height: 1.16;
}
#books-list-view .books-shelf-track .books-card-author {
  font-size: 15px;
}
#books-list-view .books-shelf-track .books-card-desc {
  font-size: 14px;
  line-height: 1.48;
}
#books-shelf-recent .books-shelf-head {
  justify-content: space-between;
  text-align: left;
  margin-bottom: 10px;
}
#books-shelf-recent .books-shelf-title {
  text-align: left;
}
.books-carousel-frame {
  padding: 0;
  perspective: none;
}
.books-carousel-frame::before,
.books-carousel-frame::after,
.books-carousel-btn {
  display: none;
}
#books-shelf-recent .books-carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(340px, 390px);
  gap: 30px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding: 2px 2px 18px;
  scrollbar-width: thin;
}
#books-shelf-recent .books-carousel-track .books-card,
#books-shelf-recent .books-carousel-track .books-card.is-carousel-near,
#books-shelf-recent .books-carousel-track .books-card.is-carousel-active,
#books-shelf-recent .books-carousel-track .books-card.is-carousel-far {
  flex: none;
  width: 100%;
  opacity: 1;
  filter: none;
  transform: none;
  pointer-events: auto;
  border-color: var(--dk-border);
  box-shadow: 0 12px 30px rgba(20,33,44,0.075);
}
#books-shelf-recent .books-carousel-track .books-card.is-carousel-active .books-card-cover::after {
  display: none;
}
.books-home-study-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0 20px;
  padding: 18px;
  border: 1px solid var(--dk-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.74);
}
.books-home-study-chip {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--dk-border-2);
  border-radius: 999px;
  background: #fff;
  color: var(--dk-muted);
  cursor: pointer;
}
.books-home-study-chip:hover {
  background: var(--dk-panel-2);
  color: var(--dk-text);
}
@media (max-width: 1180px) {
  .books-side-panel,
  .books-side-mini-card {
    display: none;
  }
}
@media (max-width: 700px) {
  .books-shelf-track,
  #books-shelf-recent .books-carousel-track {
    grid-auto-columns: minmax(282px, 86vw);
  }
  #books-list-view .books-shelf-track .books-card-title {
    font-size: 21px;
  }
  .books-home-study-strip {
    padding: 14px;
  }
}

/* empty states */
.books-page-empty {
  text-align: center;
  padding: 64px 24px;
  border: 1px dashed var(--dk-border-2);
  border-radius: 22px;
  background: var(--dk-panel);
}
.books-page-empty-icon {
  width: 58px; height: 58px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 16px;
  font-size: 26px;
  color: var(--dk-gold);
  background: rgba(217,182,121,0.12);
}
#books-list-view .books-page-empty h3 {
  font-family: var(--books-font-display);
  font-size: 24px; font-weight: 500;
  color: var(--dk-text);
  margin: 0 0 8px;
}
#books-list-view .books-page-empty p {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 14px; color: var(--dk-muted);
  margin: 0 auto; max-width: 46ch; line-height: 1.6;
}

/* notes + highlights groups */
.books-anno-group {
  border: 1px solid var(--dk-border);
  border-radius: 18px;
  background: var(--dk-panel);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.books-anno-group-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 16px;
  padding-bottom: 14px; border-bottom: 1px solid var(--dk-border);
}
.books-anno-group-head h3 {
  font-family: var(--books-font-display);
  font-size: 20px; font-weight: 400; color: var(--dk-text); margin: 0;
}
.books-anno-group-head span {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 12.5px; color: var(--dk-faint);
}
.books-anno-open {
  flex: none;
  border: 0; background: none; cursor: pointer;
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 13px; font-weight: 400; color: var(--dk-gold);
  padding: 6px 10px; border-radius: 8px; transition: background 0.18s;
}
.books-anno-open:hover { background: var(--dk-panel-2); }
.books-anno {
  margin: 0 0 12px; padding: 2px 0 2px 16px;
  border-left: 2px solid rgba(217,182,121,0.5);
}
.books-anno:last-child { margin-bottom: 0; }
.books-anno-text {
  font-family: var(--books-font-display);
  font-size: 16px; line-height: 1.55; color: var(--dk-text); margin: 0;
}
.books-anno-note {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 13.5px; color: var(--dk-muted); margin: 8px 0 0; line-height: 1.5;
}
.books-anno-note span {
  display: inline-block; margin-right: 8px;
  font-size: 10px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dk-teal);
}

/* collections grid */
.books-collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.books-coll-card {
  text-align: left; cursor: pointer;
  border: 1px solid var(--dk-border);
  border-radius: 18px;
  background: var(--dk-panel);
  padding: 22px;
  transition: transform 0.25s cubic-bezier(.2,.7,.3,1), box-shadow 0.25s, border-color 0.2s;
}
.books-coll-card:hover {
  transform: translateY(-4px);
  border-color: var(--dk-border-2);
  box-shadow: 0 22px 44px rgba(20,33,44,0.12);
}
.books-coll-stack {
  position: relative; height: 96px; margin-bottom: 18px;
}
.books-coll-stack img, .books-coll-cover-blank {
  position: absolute; top: 0;
  left: calc(var(--i) * 30px);
  width: 70px; height: 96px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--dk-border-2);
  box-shadow: 0 8px 18px rgba(20,33,44,0.18);
  background: linear-gradient(160deg, #1c2331, #2d3748);
  z-index: calc(4 - var(--i));
}
.books-coll-meta strong {
  display: block;
  font-family: var(--books-font-display);
  font-size: 19px; font-weight: 400; color: var(--dk-text); margin-bottom: 2px;
}
.books-coll-meta span {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 12.5px; color: var(--dk-faint);
}

/* review queue */
.books-review-summary {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 26px 30px; margin-bottom: 30px;
  border: 1px solid var(--dk-border);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(47,150,150,0.16), var(--dk-panel));
}
.books-review-stat { display: flex; flex-direction: column; }
.books-review-stat strong {
  font-family: var(--books-font-display);
  font-size: 38px; font-weight: 500; line-height: 1; color: var(--dk-text);
}
.books-review-stat span {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 12.5px; color: var(--dk-faint); margin-top: 5px;
}
.books-review-start {
  margin-left: auto;
  padding: 13px 28px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 14.5px; font-weight: 400;
  color: #06201d;
  background: linear-gradient(135deg, #5fcabd, #2f9696);
  box-shadow: 0 12px 26px rgba(47,150,150,0.32);
  transition: transform 0.2s, box-shadow 0.2s;
}
.books-review-start:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(47,150,150,0.4); }
.books-review-start:disabled { background: var(--dk-panel-2); color: var(--dk-faint); cursor: default; box-shadow: none; }
.books-review-upcoming-title {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 11.5px; font-weight: 400; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--dk-faint); margin: 0 0 14px;
}
.books-review-list { list-style: none; margin: 0; padding: 0; }
.books-review-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 18px; margin-bottom: 10px;
  border: 1px solid var(--dk-border); border-radius: 14px;
  background: var(--dk-panel);
}
.books-review-item-text {
  font-family: var(--books-font-display);
  font-size: 15.5px; color: var(--dk-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.books-review-item-due {
  flex: none;
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 12px; color: var(--dk-faint);
}

/* settings */
.books-set-card {
  border: 1px solid var(--dk-border); border-radius: 18px;
  background: var(--dk-panel); padding: 22px 26px; margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}
.books-set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: 100%;
}
.books-set-row h3 {
  font-family: var(--books-font-display);
  font-size: 18px; font-weight: 400; color: var(--dk-text); margin: 0 0 4px;
}
.books-set-row p {
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 13px; color: var(--dk-faint); margin: 0; max-width: 44ch;
}
.books-set-seg {
  display: inline-flex; padding: 4px; gap: 2px;
  border: 1px solid var(--dk-border); border-radius: 999px; background: #EEF3F5;
  flex: 0 0 auto;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}
.books-set-font-size {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border: 1px solid var(--dk-border);
  border-radius: 999px;
  background: #EEF3F5;
  flex: 0 0 auto;
  margin-left: auto;
}
.books-set-opt {
  border: 0; background: none; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 13px; font-weight: 400; color: var(--dk-muted);
  transition: background 0.18s, color 0.18s;
}
.books-set-opt.is-on { background: var(--dk-teal-deep); color: #fff; }
.books-set-btn {
  padding: 10px 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--dk-border-2); background: var(--dk-panel-2); color: var(--dk-text);
  font-family: var(--books-font-ui, system-ui, sans-serif); font-size: 13.5px; font-weight: 400;
  transition: background 0.18s, border-color 0.18s;
  flex: 0 0 auto;
  margin-left: auto;
}
.books-set-btn:hover { background: rgba(255,255,255,0.12); }
.books-set-btn-danger { color: #C0392B; border-color: rgba(192,57,43,0.32); }
.books-set-btn-danger:hover { background: rgba(192,57,43,0.08); }

.books-settings-layout {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding-right: 48px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
#books-page-settings .books-page-head {
  padding-right: 48px;
  box-sizing: border-box;
}
.books-set-section-title {
  font-family: var(--books-font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dk-faint);
  margin: 28px 0 14px;
  padding-bottom: 0;
}
.books-settings-layout .books-set-section-title:first-child {
  margin-top: 4px;
}
.books-set-copy {
  flex: 0 1 280px;
  min-width: 0;
}
.books-set-font-size-val {
  min-width: 3.2em;
  text-align: center;
  font-family: var(--books-font-ui, system-ui, sans-serif);
  font-size: 13px;
  color: var(--dk-text);
}
.books-set-btn-icon {
  min-width: 40px;
  padding: 8px 12px;
  margin-left: 0;
}
@media (max-width: 1180px) {
  .books-settings-layout,
  #books-page-settings .books-page-head {
    padding-right: 0;
  }
}
@media (max-width: 640px) {
  .books-set-row {
    flex-direction: column;
    align-items: stretch;
  }
  .books-set-seg {
    justify-content: flex-start;
    margin-left: 0;
  }
  .books-set-font-size {
    align-self: flex-start;
    margin-left: 0;
  }
  .books-set-btn {
    margin-left: 0;
    align-self: flex-start;
  }
}

@media (max-width: 700px) {
  .books-page-head { align-items: flex-start; }
  .books-review-summary { gap: 20px; }
  .books-review-start { margin-left: 0; width: 100%; }
}

/* =====================================================================
   Qawl-style parchment shell — topbar, heroes, doors, tabbar, footer
   ===================================================================== */
.books-wrap { width: min(1180px, calc(100% - 56px)); margin: 0 auto; }
.books-wrap-narrow { width: min(640px, calc(100% - 48px)); }
.books-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.books-row-head h2 { margin: 0; font-size: 1.42rem; letter-spacing: -.02em; font-weight: 400; }
.books-row-head a { color: var(--books-teal); font-size: .95rem; text-decoration: none; }
.books-row-head a:hover { color: var(--books-primary-hover); }

body, body * { font-family: var(--books-font-body); font-weight: 400; }
.books-reader-arabic, [lang="ar"] { font-family: var(--books-font-arabic); }
button, input, textarea, select { font: inherit; }
body { font-size: 17px; line-height: 1.5; color: var(--books-ink); }

.books-header {
  position: sticky; top: 0; z-index: 80;
  background: #fff;
  border-bottom: 1px solid rgba(28,35,40,.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  min-height: 76px;
  color: #1c2328;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
}
body.books-home-landing .books-header {
  position: fixed;
  display: block;
  top: 0; left: 0; right: 0;
  z-index: 80;
  background: #fff;
  border-bottom: 1px solid rgba(28,35,40,.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  min-height: 76px;
}
body.books-home-landing,
body.books-home-landing .books-portal,
body.books-home-landing .books-main,
body.books-home-landing #books-list-view {
  overflow-x: clip;
  overflow-y: visible;
  height: auto;
  max-height: none;
}
body.books-home-landing .books-header.is-open {
  background: #fff;
  border-bottom: 1px solid rgba(28,35,40,.06);
}
.books-header-inner {
  display: flex;
  align-items: center;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 76px;
  padding: 16px 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 24px;
  max-width: none;
}
body.books-home-landing .books-header-inner {
  display: flex;
  align-items: center;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 76px;
  padding: 16px 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 24px;
}
.books-logo {
  display: flex; align-items: center; gap: 12px;
  color: #1c2328; text-decoration: none;
  flex: 0 0 auto; font-weight: 400;
}
.books-logo-title {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 1.22rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: #1c2328;
}
.books-logo-img {
  width: 52px; height: 52px; border-radius: 0;
  object-fit: contain; flex: 0 0 auto; display: block;
  background: transparent;
}
.books-header-nav {
  display: flex; align-items: center; gap: 22px;
  margin: 0 0 0 auto; padding: 0;
  overflow: auto; flex: 0 1 auto;
}
.books-header-auth {
  display: flex; align-items: center; gap: 10px;
  margin-left: 0 !important; flex: 0 0 auto;
}
.books-header-nav a,
.books-btn-signin,
.books-account-btn {
  display: inline-flex; align-items: center;
  min-height: 38px; padding: 8px 2px;
  border: 0; border-radius: 0; background: transparent;
  color: #5a656d;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: .98rem; font-weight: 400;
  border-bottom: 1.5px solid transparent;
  text-decoration: none; box-shadow: none; cursor: pointer;
}
body.books-signed-in .books-btn-signin,
.books-btn-signin[hidden] { display: none !important; }
body:not(.books-signed-in) #books-user-wrap,
.books-account[hidden],
#books-user-wrap[hidden] { display: none !important; }
body.books-signed-in #books-user-wrap {
  display: inline-flex !important;
  align-items: center;
  gap: 12px;
}
.books-header-nav a.on {
  color: #2a6f70;
  font-weight: 400;
  border-bottom-color: #2a6f70;
  padding-bottom: 5px;
}
.books-header-nav a:hover,
.books-btn-signin:hover,
.books-account-btn:hover { color: #1c2328; background: transparent; }
.books-btn-signin {
  justify-content: center;
}
.books-account { position: relative; display: inline-flex; align-items: center; gap: 12px; }
.books-account-btn {
  max-width: 200px;
}
.books-user-name {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .98rem;
  font-weight: 400;
  color: #5a656d;
}
.books-header-auth .books-btn-signout {
  display: inline-flex; align-items: center;
  min-height: 38px; padding: 8px 2px;
  border: 0; border-radius: 0; background: transparent;
  color: #5a656d;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: .98rem; font-weight: 400;
  text-decoration: none; cursor: pointer;
  box-shadow: none;
}
.books-header-auth .books-btn-signout:hover { color: #1c2328; background: transparent; }
.books-header .books-logo-title,
.books-header .books-header-nav a,
.books-header .books-btn-signin,
.books-header .books-account-btn,
.books-header .books-user-name,
.books-header .books-btn-signout {
  font-weight: 400 !important;
}
.books-myreads-body {
  padding: 0 0 72px;
  max-width: none;
}
.books-myreads-dash {
  display: grid;
  gap: 22px;
}
.books-myreads-stage {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  min-height: 280px;
  color: #1c2328;
  background-color: #f3eee4;
  background-image: url("/books/api/file/books/maktabah-hero-background.png");
  background-size: cover;
  background-position: center;
  border: 0;
  box-shadow: 0 22px 50px rgba(28,35,40,.08);
}
.books-myreads-stage-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(255,251,244,.94) 0%, rgba(255,251,244,.78) 42%, rgba(255,251,244,.35) 100%),
    radial-gradient(80% 90% at 100% 0%, rgba(42,111,112,.12), transparent 55%);
}
.books-myreads-stage-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, .75fr);
  gap: 24px;
  align-items: end;
  padding: 36px 34px 32px;
}
.books-myreads-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #5f6c74;
  font-size: .84rem;
  font-weight: 500;
  letter-spacing: .02em;
}
.books-myreads-kicker::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: #2a6f70;
}
.books-myreads-stage h1,
.books-myreads-start h2,
.books-myreads-focus-copy h2,
.books-myreads-rooms-wrap h2,
.books-myreads-passages h2 {
  margin: 0;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-weight: 500;
  letter-spacing: -.02em;
  color: #1c2328;
}
.books-myreads-stage h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.25rem);
  line-height: 1.1;
  max-width: 14ch;
}
.books-myreads-lead {
  margin: 12px 0 0;
  max-width: 36ch;
  color: #556067;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.45;
}
.books-myreads-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.books-myreads-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
}
.books-myreads-cta-primary {
  background: #2a6f70;
  color: #fff;
  border: 1px solid #2a6f70;
}
.books-myreads-cta-primary:hover { background: #245f60; color: #fff; }
.books-myreads-cta-ghost {
  background: rgba(255,255,255,.78);
  color: #2a6f70;
  border: 1.5px solid rgba(42,111,112,.55);
}
.books-myreads-cta-ghost:hover { background: #fff; color: #245f60; }
.books-myreads-passport {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(28,35,40,.07);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(28,35,40,.06);
}
.books-myreads-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #2a6f70; color: #fff;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 1.35rem; font-weight: 600;
  flex: 0 0 auto;
}
.books-myreads-who { display: grid; gap: 2px; min-width: 0; }
.books-myreads-who strong {
  font-size: 1.02rem; font-weight: 600; color: #1c2328;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.books-myreads-who span {
  color: #6b7780; font-size: .88rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.books-myreads-passport-tag {
  margin-top: 4px !important;
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(42,111,112,.1);
  color: #2a6f70 !important;
  font-size: .74rem !important;
  font-weight: 600;
  letter-spacing: .02em;
}
.books-myreads-meter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.books-myreads-meter-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(28,35,40,.07);
  box-shadow: 0 12px 30px rgba(28,35,40,.045);
  overflow: hidden;
}
.books-myreads-meter-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: #2a6f70;
}
.books-myreads-meter-card strong {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  color: #1c2328;
}
.books-myreads-meter-card span {
  color: #1c2328;
  font-size: .95rem;
  font-weight: 600;
}
.books-myreads-meter-card small {
  color: #839098;
  font-size: .8rem;
}
.books-myreads-focus,
.books-myreads-start,
.books-myreads-passages {
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(28,35,40,.07);
  box-shadow: 0 14px 36px rgba(28,35,40,.045);
}
.books-myreads-focus {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(42,111,112,.06), rgba(255,255,255,0) 40%),
    #fff;
}
.books-myreads-focus-cover {
  width: 140px;
  height: 196px;
  border-radius: 14px;
  overflow: hidden;
  background: #e8eef0;
  box-shadow: 0 16px 34px rgba(28,35,40,.14);
}
.books-myreads-focus-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.books-myreads-focus-cover-empty {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(160deg, #d7e4e4, #f0ebe2);
}
.books-myreads-focus-copy h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  line-height: 1.2;
  max-width: 18ch;
}
.books-myreads-focus-author {
  margin: 6px 0 0;
  color: #6b7780;
  font-size: .98rem;
}
.books-myreads-focus-progress {
  display: grid;
  gap: 8px;
  margin: 16px 0 18px;
  max-width: 320px;
}
.books-myreads-focus-bar {
  height: 8px;
  border-radius: 999px;
  background: #e7ecee;
  overflow: hidden;
}
.books-myreads-focus-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a6f70, #3f9091);
}
.books-myreads-focus-progress em {
  font-style: normal;
  color: #2a6f70;
  font-size: .9rem;
  font-weight: 600;
}
.books-myreads-focus-more {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.books-myreads-start {
  display: grid;
  gap: 18px;
  background:
    radial-gradient(90% 80% at 0% 0%, rgba(201,154,53,.12), transparent 50%),
    radial-gradient(70% 70% at 100% 0%, rgba(42,111,112,.1), transparent 45%),
    #fffaf3;
}
.books-myreads-start-copy h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  line-height: 1.15;
}
.books-myreads-start-copy p {
  margin: 8px 0 0;
  max-width: 48ch;
  color: #5c686f;
  font-size: 1.02rem;
  line-height: 1.45;
}
.books-myreads-start-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.books-myreads-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}
.books-myreads-panel-head-copy { min-width: 0; }
.books-myreads-panel-head h2 {
  font-size: clamp(2.35rem, 4.2vw, 3rem);
  color: #1a4d4e;
}
.books-myreads-rooms-divider {
  display: flex;
  align-items: center;
  margin: 14px 0 28px;
}
.books-myreads-rooms-divider::before,
.books-myreads-rooms-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(28,35,40,.1);
}
.books-myreads-rooms-divider span {
  width: 7px;
  height: 7px;
  margin: 0 14px;
  transform: rotate(45deg);
  background: #c99a35;
  box-shadow: 0 0 0 1px rgba(201,154,53,.35);
}
.books-myreads-panel-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(42,111,112,.28);
  background: #fff;
  color: #2a6f70;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.books-myreads-panel-link:hover {
  background: rgba(42,111,112,.08);
  text-decoration: none;
}
.books-myreads-rooms-wrap {
  padding: 8px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.books-myreads-rooms-wrap h2 {
  font-size: clamp(2.35rem, 4.2vw, 3rem);
  color: #1a4d4e;
}
#books-list-view .books-myreads-rooms-wrap,
#books-list-view .books-myreads-rooms-wrap * {
  font-family: 'EB Garamond', Garamond, Georgia, 'Times New Roman', serif !important;
}
#books-list-view .books-myreads-room-btn,
#books-list-view .books-myreads-settings-go {
  font-family: Inter, system-ui, sans-serif !important;
}
.books-myreads-room-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.books-myreads-room-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 24px 28px 22px;
  border: 1px solid #e8e4dc;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(28,35,40,.04);
  overflow: hidden;
}
.books-myreads-room-card.tone-a,
.books-myreads-room-card.tone-b,
.books-myreads-room-card.tone-c,
.books-myreads-room-card.tone-d,
.books-myreads-room-card.tone-e {
  background: #fff;
  border-top: 1px solid #e8e4dc;
}
.books-myreads-room-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0;
  padding: 0;
}
.books-myreads-room-card-copy { min-width: 0; }
.books-myreads-room-card-topline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.books-myreads-room-card-topline h3 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.05;
  color: #1a4d4e;
}
.books-myreads-room-card-sub {
  margin: 6px 0 0;
  color: #7a8480;
  font-size: 1.02rem;
  line-height: 1.35;
}
.books-myreads-room-count {
  font-style: normal;
  font-size: .82rem;
  font-weight: 600;
  color: #6b7c86;
  line-height: 1;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef1f2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.books-myreads-room-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f8f7;
  border: 1px solid rgba(26,77,78,.18);
  color: #1a4d4e;
  flex: 0 0 auto;
}
.books-myreads-room-icon svg { width: 18px; height: 18px; }
.books-myreads-room-card-rule {
  height: 1px;
  margin: 16px 0 18px;
  background: rgba(28,35,40,.08);
}
.books-myreads-room-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 44%);
  gap: 12px;
  align-items: end;
  flex: 1;
  min-height: 0;
}
.books-myreads-room-card-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 120px;
}
.books-myreads-room-desc {
  margin: 0;
  max-width: 24ch;
  color: #3d4a4f;
  font-size: 1.06rem;
  line-height: 1.45;
}
.books-myreads-room-card-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 132px;
  padding-bottom: 2px;
  overflow: hidden;
}
.books-myreads-room-card-art::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 76px;
  height: 76px;
  background-image: radial-gradient(circle, rgba(28,35,40,.11) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: .42;
  pointer-events: none;
}
.books-myreads-room-svg {
  width: 100%;
  max-width: 180px;
  height: auto;
  position: relative;
  z-index: 1;
}
.books-myreads-room-card-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 0;
}
.books-myreads-room-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid #1a4d4e;
  background: #1a4d4e;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.books-myreads-room-btn:hover {
  background: #245f60;
  border-color: #245f60;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
.books-myreads-room-btn span { margin-left: 2px; }
.books-myreads-room-item {
  display: grid;
  gap: 3px;
  padding: 0 0 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #f0ebe3;
}
.books-myreads-room-item:last-child { padding-bottom: 0; border-bottom: 0; }
.books-myreads-room-item-meta {
  margin: 0;
  color: #2a6f70;
  font-size: .95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.books-myreads-room-item-text {
  margin: 0;
  color: #1a3c3c;
  font-size: 1.12rem;
  line-height: 1.4;
}
blockquote.books-myreads-room-item-text {
  font-size: 1.16rem;
  font-style: italic;
}
.books-myreads-room-item button {
  justify-self: start;
  border: 0; background: transparent; padding: 0;
  color: #2a6f70; font: inherit; font-size: 1rem; font-weight: 500; cursor: pointer;
}
.books-myreads-room-item button:hover { text-decoration: underline; }
.books-myreads-coll-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.books-myreads-coll-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 8px 12px; border-radius: 999px; text-decoration: none; color: inherit;
  background: #f7f4ee; border: 1px solid #ebe6dc;
}
.books-myreads-coll-chip strong { font-size: 1.05rem; font-weight: 500; color: #1a3c3c; }
.books-myreads-coll-chip span { color: #6e7876; font-size: .95rem; }
.books-myreads-review-list {
  margin: 0; padding: 0 0 0 1.05rem; display: grid; gap: 6px;
  color: #1a3c3c; font-size: 1.08rem; line-height: 1.4;
}
.books-myreads-review-list li::marker { color: #2a6f70; }
.books-myreads-settings-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 20px 24px;
  border: 1px solid #e8e4dc;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(28,35,40,.04);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.books-myreads-settings-card:hover {
  border-color: rgba(26,77,78,.22);
  box-shadow: 0 14px 32px rgba(28,35,40,.06);
  text-decoration: none;
}
.books-myreads-settings-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  min-width: 0;
  flex: 1;
}
.books-myreads-settings-copy strong { font-size: 1.35rem; font-weight: 500; color: #1a4d4e; }
.books-myreads-settings-copy em { font-style: normal; font-size: 1.02rem; color: #7a8480; }
.books-myreads-settings-go {
  margin-left: auto;
  color: #1a4d4e;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}
.books-myreads-settings-card:hover .books-myreads-settings-go { color: #245f60; }

.books-myreads-dash .books-continue-section {
  margin: 0 !important;
}

body.books-myreads-guest,
body.books-myreads-home,
body.books-myreads-guest .books-portal,
body.books-myreads-home .books-portal,
body.books-myreads-guest .books-main,
body.books-myreads-home .books-main,
body.books-myreads-guest #books-list-view,
body.books-myreads-home #books-list-view,
body.books-myreads-guest .books-library-shell,
body.books-myreads-home .books-library-shell,
body.books-myreads-guest #books-page-myreads,
body.books-myreads-home #books-page-myreads {
  background: #ffffff;
  overflow-x: clip;
  overflow-y: visible;
  height: auto;
  max-height: none;
}
body.books-myreads-guest .books-library-shell,
body.books-myreads-home .books-library-shell { padding-bottom: 40px; }
body.books-myreads-guest .books-header,
body.books-myreads-home .books-header {
  background: #fff;
  border-bottom-color: rgba(28,35,40,.06);
}
body.books-myreads-guest .books-footer { display: none; }
body.books-myreads-guest .books-myreads-body,
body.books-myreads-home .books-myreads-body {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 72px;
}
.books-myreads-guest {
  display: grid;
  gap: 40px;
}
.books-myreads-guest-hero {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 48px;
  align-items: center;
  padding: 12px 0 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.books-myreads-guest-copy { max-width: 28rem; }
.books-myreads-guest-kicker {
  margin: 0 0 14px;
  font-family: Inter, system-ui, sans-serif;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8a9190;
}
.books-myreads-guest h1 {
  margin: 0;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: clamp(2.7rem, 5.2vw, 4.15rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.06;
  color: #1a3c3c;
}
.books-myreads-guest-lead {
  margin: 16px 0 0;
  max-width: 34ch;
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.55;
  color: #6e7876;
}
.books-myreads-guest-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 26px;
}
.books-myreads-guest-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: #1a4d4e;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-size: .98rem;
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(26,77,78,.18);
  transition: background .15s ease, transform .15s ease;
}
.books-myreads-guest-cta svg { width: 17px; height: 17px; flex: 0 0 auto; }
.books-myreads-guest-cta:hover { background: #163e3f; color: #fff; transform: translateY(-1px); }
.books-myreads-guest-trust {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: .86rem;
  font-weight: 400;
  color: #8a9190;
}
.books-myreads-guest-trust svg { width: 15px; height: 15px; color: #1a4d4e; }
.books-myreads-guest-art {
  min-width: 0;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #efe8dc;
  aspect-ratio: 4 / 3;
  box-shadow: none;
}
.books-myreads-guest-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
}
.books-myreads-guest-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(28,35,40,.04);
  overflow: hidden;
}
.books-myreads-guest-features li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
  row-gap: 0;
  min-height: 0;
  padding: 16px 18px;
  border: 0;
  border-right: 1px solid rgba(28,35,40,.08);
  border-radius: 0;
  background: transparent;
}
.books-myreads-guest-features li:last-child { border-right: 0; }
.books-myreads-guest-ic {
  width: 34px;
  height: 34px;
  margin: 1px 0 0;
  border-radius: 999px;
  border: 1px solid rgba(26,77,78,.28);
  color: #1a4d4e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,.35);
}
.books-myreads-guest-ic svg { width: 16px; height: 16px; }
.books-myreads-guest-feature-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.books-myreads-guest-features strong {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: #1a3c3c;
}
.books-myreads-guest-features span {
  font-family: Inter, system-ui, sans-serif;
  font-size: .82rem;
  line-height: 1.4;
  color: #7a8480;
}
.books-myreads-guest-quote {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 44px 28px 40px;
  border: 0;
  border-radius: 18px;
  text-align: center;
  color: #fff;
  background-color: #1a4d4e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='.7' opacity='.13'%3E%3Cpath d='M36 4l8.4 20.4L66 33l-21.6 8.6L36 62l-8.4-20.4L6 33l21.6-8.6z'/%3E%3Cpath d='M36 16l5 12 12 5-12 5-5 12-5-12-12-5 12-5z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 72px 72px;
  box-shadow: none;
  outline: 0;
}
.books-myreads-guest-quotemark {
  display: block;
  margin: 0 0 4px;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 500;
  opacity: .88;
}
.books-myreads-guest-quote blockquote {
  margin: 0 auto;
  max-width: 22em;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.02em;
}
.books-myreads-guest-quote figcaption {
  margin-top: 14px;
  font-family: Inter, system-ui, sans-serif;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.78);
}
.books-myreads-home-dash {
  gap: 40px;
}
.books-myreads-home-secondary {
  text-decoration: none;
  color: #8a9190;
}
.books-myreads-home-secondary:hover { color: #1a4d4e; }
.books-myreads-home-stats li {
  align-items: center;
}
.books-myreads-home-stat-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(26,77,78,.28);
  background: rgba(255,255,255,.45);
  color: #1a4d4e;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  flex: 0 0 auto;
}
.books-myreads-home-dash .books-myreads-rooms-wrap,
.books-myreads-home-dash .books-myreads-start {
  margin: 0;
}

@media (max-width: 1100px) {
  .books-myreads-start-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .books-myreads-quotes { grid-template-columns: 1fr 1fr; }
  .books-myreads-focus-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books-myreads-guest-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 8px;
  }
  .books-myreads-guest-copy { max-width: none; }
  .books-myreads-guest-features { grid-template-columns: 1fr 1fr; }
  .books-myreads-guest-features li:nth-child(2n) { border-right: 0; }
  .books-myreads-guest-features li:nth-child(-n+2) {
    border-bottom: 1px solid rgba(28,35,40,.08);
  }
  .books-myreads-room-stack {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .books-myreads-stage-inner {
    grid-template-columns: 1fr;
    padding: 26px 18px 22px;
  }
  body.books-myreads-guest .books-myreads-body,
  body.books-myreads-home .books-myreads-body {
    width: calc(100% - 32px);
    padding: 12px 0 96px;
  }
  .books-myreads-guest { gap: 28px; }
  .books-myreads-guest-hero { gap: 20px; padding: 4px 0 0; }
  .books-myreads-guest h1 { font-size: 2.45rem; }
  .books-myreads-guest-actions { margin-top: 22px; }
  .books-myreads-guest-art { border-radius: 16px; }
  .books-myreads-guest-features { grid-template-columns: 1fr; }
  .books-myreads-guest-features li {
    border-right: 0;
    border-bottom: 1px solid rgba(28,35,40,.08);
    padding: 14px 16px;
  }
  .books-myreads-guest-features li:last-child { border-bottom: 0; }
  .books-myreads-guest-quote { padding: 36px 20px 32px; border-radius: 16px; }
  .books-myreads-passport { justify-self: start; width: 100%; }
  .books-myreads-meter { grid-template-columns: 1fr 1fr; }
  .books-myreads-focus { grid-template-columns: 1fr; }
  .books-myreads-focus-cover { width: 112px; height: 156px; }
  .books-myreads-start-rail,
  .books-myreads-quotes,
  .books-myreads-focus-more { grid-template-columns: 1fr; }
  .books-myreads-room-card { padding: 18px 16px 16px; min-height: 0; }
  .books-myreads-room-card-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .books-myreads-room-card-content { min-height: 0; }
  .books-myreads-room-card-art {
    justify-self: end;
    min-height: 110px;
    max-width: 160px;
  }
  .books-myreads-settings-card {
    flex-wrap: wrap;
    padding: 18px 16px;
  }
  .books-myreads-settings-go {
    width: 100%;
    margin-left: 56px;
  }
}
#books-page-myreads, #books-page-notes, #books-page-highlights, #books-page-collections, #books-page-review, #books-page-settings {
  padding-bottom: 48px;
}
.books-tabbar { display: none; }
.books-mobile-menu-btn {
  display: none;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid #eceff1; background: #fff; color: #1c2328; padding: 0;
  margin: 0; cursor: pointer; flex: 0 0 auto;
}
.books-mobile-menu-btn svg { width: 20px; height: 20px; display: block; }
.books-mobile-menu-btn .books-menu-close { display: none; }
.books-header.is-open .books-mobile-menu-btn .books-menu-open { display: none; }
.books-header.is-open .books-mobile-menu-btn .books-menu-close { display: block; }
.books-header.is-open .books-header-nav { display: flex; }

#books-list-view { background: #fff; }
#books-list-view > section:not(.books-hero) { max-width: none; }
.books-hero {
  position: relative; min-height: calc(100svh - 176px); min-height: calc(100dvh - 176px);
  margin: 0; border-radius: 0; overflow: clip;
  display: grid; place-items: center; text-align: center;
  padding: 64px 24px 48px;
  background-color: #fff8ee;
  background-image: url("https://qawl.org/image/hero_background.jpg");
  background-size: cover; background-position: 50% 42%; background-repeat: no-repeat;
  border: 0; box-shadow: none;
}
.books-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, rgba(255,248,238,.22) 0%, rgba(255,248,238,.06) 38%, rgba(255,248,238,.5) 100%);
}
.books-hero-bg, .books-hero-shade { display: none; }
.books-hero[hidden],
.books-search-sheet[hidden],
.books-search-dock[hidden],
.books-featured[hidden] { display: none !important; }
.books-hero-inner { position: relative; z-index: 1; width: min(720px, 90%); margin: 0 auto; }
.books-hero-cite .books-hero-inner { width: min(38ch, 90%); }
.books-hero-kicker {
  margin: 0 0 16px; color: var(--books-teal); letter-spacing: .14em;
  text-transform: uppercase; font-size: .72rem; text-shadow: none;
}
.books-hero-title {
  margin: 0; color: var(--books-ink); text-shadow: none;
  font-size: clamp(1.55rem, 2.15vw, 1.95rem); line-height: 1.38; letter-spacing: -.015em; font-weight: 400;
}
.books-hero-title span { display: inline; color: inherit; }
.books-hero-lead, .books-hero-subtitle {
  margin: 14px auto 0; max-width: none; color: var(--books-muted);
  font-size: 1.02rem; line-height: 1.55; text-shadow: none;
}
.books-hero-cite { padding: 88px 56px 132px; }
.books-hero-home {
  min-height: 100vh; min-height: 100dvh;
  height: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  place-items: unset;
  overflow: visible;
  padding: 108px 24px 48px;
  background-color: #f3eee4;
  background-image: url("/books/api/file/books/maktabah-hero-background.png");
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
}
.books-hero-home::before { display: none; }
.books-hero-home .books-hero-inner {
  width: min(920px, 100%);
  display: flex; flex-direction: column; align-items: center;
  gap: 1.35rem;
  transform-origin: center center;
  animation: booksHeroFade .8s ease both;
}
.books-hero-home .books-hero-copy {
  display: flex; flex-direction: column; align-items: center;
  gap: 1.15rem;
  will-change: transform;
  transform-origin: center center;
  width: 100%;
}
@keyframes booksHeroFade {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.books-hero-home .books-hero-hadith {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
}
.books-hero-home .books-hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0; color: #6b7780;
  font-size: .92rem; font-weight: 500;
  letter-spacing: .01em; text-transform: none;
}
.books-hero-home .books-hero-kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #2a6f70; box-shadow: none; flex: 0 0 auto;
}
.books-hero-home .books-hero-title {
  max-width: 22ch; color: #1c2328;
  background: none;
  font-size: clamp(1.45rem, 2.85vw, 2.15rem); font-weight: 600;
  line-height: 1.22; letter-spacing: -.02em;
}
.books-hero-home .books-hero-title span { color: #2a6f70; }
.books-hero-home .books-hero-attrib {
  margin: .1rem 0 .4rem; color: #7a868e; font-size: 1.05rem; font-style: normal;
}
.books-hero-home .books-hero-lead {
  display: block; margin: 0;
  color: #5c686f; font-size: 1.12rem; font-weight: 500;
}
.books-hero-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px;
}
.books-hero-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: 11px;
  font-size: 1.02rem; font-weight: 600; letter-spacing: 0;
  text-decoration: none; box-shadow: none; transform: none;
  transition: background .15s ease;
}
.books-hero-cta-primary {
  background: #2a6f70; color: #fff; border: 1px solid #2a6f70;
}
.books-hero-cta-primary:hover {
  background: #245f60; color: #fff;
  box-shadow: none; transform: none;
}
.books-hero-cta-ghost {
  background: #fff; color: #2a6f70; border: 1.5px solid #2a6f70;
}
.books-hero-cta-ghost:hover {
  background: rgba(42,111,112,.06); color: #2a6f70; transform: none;
}
.books-hero-section {
  min-height: 100vh; min-height: 100dvh;
  height: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  place-items: unset;
  overflow: visible;
  padding: 108px 24px 48px;
  background-color: #f3eee4;
  background-image: url("/books/api/file/books/maktabah-hero-background.png");
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
  text-align: center;
}
.books-hero-section::before { display: none; }
.books-hero-section .books-hero-inner {
  width: min(920px, 100%);
  display: flex; flex-direction: column; align-items: center;
  gap: 1.35rem;
  transform-origin: center center;
  animation: booksHeroFade .8s ease both;
}
.books-hero-section .books-hero-copy {
  display: flex; flex-direction: column; align-items: center;
  gap: 1.15rem;
  will-change: transform;
  transform-origin: center center;
  width: 100%;
}
.books-hero-section .books-hero-hadith {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
}
.books-hero-section .books-hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0; color: #6b7780;
  font-size: .92rem; font-weight: 500;
  letter-spacing: .01em; text-transform: none;
}
.books-hero-section .books-hero-kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #2a6f70; box-shadow: none; flex: 0 0 auto;
}
.books-hero-section .books-hero-title {
  max-width: 22ch; color: #1c2328;
  background: none;
  font-size: clamp(1.45rem, 2.85vw, 2.15rem); font-weight: 600;
  line-height: 1.22; letter-spacing: -.02em;
  margin: 0;
}
.books-hero-section .books-hero-lead {
  display: block; margin: 0;
  color: #5c686f; font-size: 1.12rem; font-weight: 500;
  max-width: 42ch;
}
.books-hero-section.books-hero-authors,
.books-hero-section.books-hero-topics,
.books-hero-section.books-hero-study {
  background-image: url("/books/api/file/books/maktabah-hero-background.png");
  background-position: center center;
}
.books-hero-section.books-hero-library {
  min-height: calc(100svh - 176px);
  min-height: calc(100dvh - 176px);
  padding: 64px 24px 48px;
  background-color: #fff;
  background-image: url("/books/api/file/books/maktabah-catalogue-background.png?v=232");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}
.books-hero-section.books-hero-library .books-hero-title {
  max-width: 16ch;
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.03em;
}
.books-hero-section.books-hero-library .books-hero-lead {
  max-width: 48rem;
  margin: .15rem 0 0;
  font-size: 1.12rem;
}
body.books-library-landing .books-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid rgba(28,35,40,.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.books-search-sheet,
.books-search-dock {
  position: relative; z-index: 5;
  background: #fff;
  padding: 28px 0 8px;
}
.books-search-dock .books-search-pill {
  width: min(640px, 100%);
  margin: 0 auto;
}
.books-search-pill {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center;
  padding: 7px 7px 7px 22px; background: #fff;
  border: 1px solid rgba(28,35,40,.06); border-radius: 999px;
  box-shadow: 0 16px 50px rgba(28,35,40,.08);
  position: relative;
}
.books-search-pill input {
  border: 0; outline: 0; background: transparent; min-width: 0;
  padding: 12px 0; color: var(--books-ink); font-size: 1.02rem; font-family: inherit;
}
.books-search-pill button[type="submit"] {
  border: 0; background: var(--books-teal); color: #fff;
  border-radius: 999px; padding: 0 22px; min-height: 46px; font: inherit;
}
.books-search-pill button[type="submit"]:hover { background: var(--books-primary-hover); }
.books-catalogue-search {
  display: flex; align-items: center; gap: 8px;
  width: min(1120px, 100%); margin: 32px auto 0;
  grid-template-columns: none;
}
.books-catalogue-search input { flex: 1; }
.books-catalogue-search .books-search-clear {
  position: static; flex: 0 0 auto;
}
.books-catalogue-search .books-search-suggestions {
  top: calc(100% + 8px); left: 18px; right: 18px;
}

.books-library-shell {
  display: block; width: 100%; max-width: none;
  padding: 0 0 88px; gap: 0; background: #fff;
}
.books-library-sidebar { display: none !important; }
.books-library-content { padding: 0; width: 100%; }
.books-home-body { padding: 8px 0 0; }
.books-featured {
  margin: 0 0 40px;
  border: 1px solid var(--books-line); border-radius: 18px;
  background: #fff; box-shadow: 0 10px 36px rgba(28,35,40,.06);
  overflow: hidden;
}
.books-featured-inner {
  display: grid;
  grid-template-columns: minmax(260px, 38%) 1px minmax(0, 1fr);
  align-items: center;
  min-height: 220px;
}
.books-featured-cover {
  display: block;
  width: calc(100% - 48px);
  margin: 24px;
  aspect-ratio: 16 / 10;
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #e8efe9, #d5e0dc);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(28, 35, 40, .10);
  align-self: center;
}
.books-featured-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 12px;
}
.books-featured-cover-empty {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background:
    repeating-linear-gradient(135deg, rgba(42,111,112,.08) 0 8px, transparent 8px 16px),
    linear-gradient(145deg, #e8efe9, #d5e0dc);
}
.books-featured-split {
  position: relative;
  width: 1px;
  background: #eceff1;
  align-self: stretch;
  min-height: 100%;
}
.books-featured-split .books-gold-star {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #fff;
  padding: 4px 0;
}
.books-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 28px 32px 28px 28px;
}
.books-featured-kicker {
  margin: 0 0 8px; color: var(--books-teal); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
}
.books-featured-body h2 {
  margin: 0; font-size: clamp(1.5rem, 2.4vw, 2.05rem); font-weight: 400; letter-spacing: -.02em; line-height: 1.2;
}
.books-featured-author { margin: 8px 0 0; color: var(--books-teal); font-size: 1.05rem; }
.books-featured-blurb {
  margin: 12px 0 0; max-width: 52ch; color: var(--books-muted); font-size: 1.02rem; line-height: 1.5;
}
.books-featured-cta {
  display: inline-flex; align-items: center; align-self: flex-start; margin-top: 18px;
  min-height: 42px; padding: 0 18px; border-radius: 10px;
  background: var(--books-teal); color: #fff; text-decoration: none; font-size: 1.02rem;
}
.books-featured-cta:hover { background: var(--books-primary-hover); color: #fff; }
.books-doors {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin: 0 0 52px;
}
.books-door {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 168px; padding: 24px 22px 20px;
  background: #fff; border: 1px solid var(--books-line); border-radius: 22px;
  text-decoration: none; color: inherit;
  box-shadow: 0 10px 28px rgba(28,35,40,.04);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.books-door:hover { transform: translateY(-3px); border-color: #d7e3e3; box-shadow: 0 16px 36px rgba(28,35,40,.08); }
.books-door-ic {
  width: 46px; height: 46px; border-radius: 50%; margin-bottom: 6px;
  display: grid; place-items: center; background: #eef5f5; color: var(--books-teal);
}
.books-door-ic svg { width: 20px; height: 20px; }
.books-door b { font-size: 1.28rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 400; }
.books-door p { margin: 0; color: var(--books-muted); font-size: .95rem; line-height: 1.4; flex: 1; }
.books-door .n { margin-top: 10px; color: var(--books-teal); font-size: .92rem; }
.books-door-photo {
  position: relative; overflow: hidden; min-height: 240px; border: 0; color: #f4f1ea;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.books-door-photo > * { position: relative; z-index: 1; }
.books-door-photo::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(12,25,41,.12) 0%, rgba(12,25,41,.62) 100%);
}
.books-door-library { background-image: url("https://qawl.org/image/lectures_hero_background.jpg"); }
.books-door-topics { background-image: url("https://qawl.org/image/hero_background.jpg"); }
.books-door-authors { background-image: url("https://qawl.org/image/scholars_hero_background.jpg"); }
.books-door-photo .books-door-ic { background: rgba(255,255,255,.16); color: #fff; }
.books-door-photo b, .books-door-photo p, .books-door-photo .n { color: #f4f1ea; }
.books-door-photo p { color: rgba(244,241,234,.82); }
.books-door-photo .n { color: #d7eceb; }
.books-door-photo:hover { border-color: transparent; box-shadow: 0 18px 40px rgba(28,35,40,.16); }
.books-topic-row, .books-index-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.books-topic-chip, .books-index-card {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 18px; border: 1px solid var(--books-line); border-radius: 18px;
  background: #fff; color: inherit; text-decoration: none; font-size: 1.05rem;
}
.books-topic-chip:hover, .books-index-card:hover { border-color: #cfd8da; }
.books-index-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; padding: 28px 0 64px; }
.books-index-card { display: block; min-height: 120px; padding: 22px 18px; }
.books-index-card b { display: block; font-size: 1.18rem; font-weight: 400; margin: 0 0 6px; }
.books-index-card span { color: var(--books-muted); font-size: .95rem; }

.books-page-head-text { display: none; }
.books-page-head { padding: 18px 0 0; width: min(1180px, calc(100% - 56px)); margin: 0 auto; }
.books-page-body { width: min(1180px, calc(100% - 56px)); margin: 0 auto; padding-bottom: 64px; }
#books-page-notes, #books-page-highlights, #books-page-collections, #books-page-review, #books-page-settings {
  padding-bottom: 48px;
}
.books-catalogue { padding-bottom: 48px; }
.books-reminder {
  position: relative; overflow: hidden; border-radius: 0;
  width: 100vw; max-width: 100vw;
  margin: 48px 0 8px; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  background: #f9f7f2; padding: 108px 18% 100px; text-align: center; min-height: 440px;
  display: flex; align-items: center; justify-content: center;
}
.books-reminder-bg, .books-reminder-side {
  position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; pointer-events: none;
}
.books-reminder-bg { background-position: center; opacity: .92; }
.books-reminder-side { width: 28%; top: 0; bottom: 0; opacity: .82; }
.books-reminder-side.left { right: auto; left: 0; background-position: left center; background-size: cover; }
.books-reminder-side.right { left: auto; right: 0; background-position: right center; background-size: cover; }
.books-reminder::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38px; pointer-events: none; opacity: .28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='28' viewBox='0 0 80 28'%3E%3Cg fill='none' stroke='%23c4b48a' stroke-width='.7'%3E%3Cpath d='M0 14h80M8 6l8 8-8 8M24 6l8 8-8 8M40 6l8 8-8 8M56 6l8 8-8 8M72 6l8 8-8 8'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x; background-position: center bottom;
}
.books-reminder-inner { position: relative; z-index: 1; max-width: 36em; margin: 0 auto; }
.books-reminder-rule {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px auto 18px; max-width: 220px;
}
.books-reminder-rule::before, .books-reminder-rule::after {
  content: ""; flex: 1; height: 1px; background: #d4c4a8; opacity: .85;
}
.books-gold-star { width: 8px; height: 8px; flex: 0 0 auto; position: relative; display: inline-block; }
.books-gold-star::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  background: #c4b48a; transform: rotate(45deg);
}
.books-gold-star::after { content: none; }
.books-reminder blockquote {
  margin: 0 auto; padding: 0; border: 0; max-width: 22em;
  color: #2c3338; font-size: clamp(1.22rem, 2.1vw, 1.62rem); font-weight: 500; line-height: 1.45; letter-spacing: -.02em;
}
.books-reminder-cite {
  margin: 16px 0 0; color: #4a7c7a; font-size: 1.02rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.books-reminder-tag {
  margin: 22px auto 0; color: #8a8680; font-size: .98rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 14px; max-width: 34em;
}
.books-reminder-tag::before, .books-reminder-tag::after {
  content: ""; flex: 1; height: 1px; background: #d4c4a8; opacity: .7; max-width: 72px;
}
.books-values { margin: 96px 0 12px; padding: 8px 0 24px; background: #fff; }
.books-values-blessing {
  margin: 0 auto 40px; max-width: 22em; text-align: center;
  color: #1c2328; font-size: clamp(1.4rem, 2.3vw, 1.75rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.35;
}
.books-values-row {
  display: grid; grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr; align-items: stretch;
}
.books-value {
  text-align: center; padding: 6px 16px 4px;
  display: flex; flex-direction: column; align-items: center;
}
.books-value-ic { width: 30px; height: 30px; color: #2a6f70; display: grid; place-items: center; }
.books-value-ic svg { width: 28px; height: 28px; }
.books-value-rule {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 78px; margin: 12px 0 10px;
}
.books-value-rule::before, .books-value-rule::after { content: ""; flex: 1; height: 1px; background: #c4b48a; opacity: .9; }
.books-value b { display: block; margin: 0 0 6px; color: #1f5556; font-size: 1.16rem; font-weight: 600; letter-spacing: -.02em; }
.books-value em { color: #7a8a90; font-size: .98rem; font-style: normal; font-weight: 400; line-height: 1.4; }
.books-value-div {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 20px; align-self: stretch; padding: 6px 0;
}
.books-value-div::before, .books-value-div::after { content: ""; flex: 1; width: 1px; background: #c5d0d6; min-height: 18px; margin: 6px 0; }

/* =====================================================================
   Home discover sections (below reminder) — Maktabah-aligned
   ===================================================================== */
.books-home-discover { padding: 48px 0 0; }
.books-home-discover a { text-decoration: none; }
.books-home-split {
  height: 0; border: 0; border-top: 1px solid #d5dce0;
  margin: 64px 0 56px; width: 100%;
}
.books-home-split-before-values { margin: 72px 0 64px; }
.books-home-section { padding: 0; margin: 0; }
.books-home-section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin: 0 0 22px;
}
.books-home-section-copy { max-width: none; }
.books-home-section h2 {
  margin: 0; color: #1c2328; font-size: clamp(1.7rem, 2.4vw, 2.05rem);
  font-weight: 400; letter-spacing: -.03em; line-height: 1.15;
}
.books-home-intro { margin: 6px 0 0; color: #7a868e; font-size: 1.05rem; line-height: 1.45; font-weight: 400; }
.books-home-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px;
  color: #b89a62; font-size: .7rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase;
}
.books-home-viewall {
  display: inline-flex; align-items: center; gap: 4px; color: #2a6f70;
  font-size: 1.02rem; font-weight: 400; white-space: nowrap;
}
.books-home-viewall:hover { color: #1f5556; }

.books-collect-grid { display: grid; grid-template-columns: 1.72fr 1fr; gap: 18px; }
.books-collect {
  --books-col-wash: #f3ece0; --books-col-ink: #1c2328; --books-col-muted: #7a8680;
  --books-col-rule: #6d8f86; --books-col-meta: #2a6f70;
  position: relative; overflow: hidden; min-height: 256px; border-radius: 24px;
  padding: 32px 28px 22px; text-decoration: none; color: var(--books-col-ink);
  background: var(--books-col-wash); isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  box-shadow: 0 12px 32px rgba(28,35,40,.07); transition: transform .18s ease, box-shadow .18s ease;
}
.books-collect:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(28,35,40,.11); color: var(--books-col-ink); }
.books-collect:focus-visible { outline: 2px solid #2a6f70; outline-offset: 3px; }
.books-collect-photo {
  position: absolute; top: 0; right: 0; bottom: 0; left: 36%; z-index: 0;
  width: auto; height: 100%; max-width: none; object-fit: cover; object-position: center right;
  pointer-events: none;
}
.books-collect-grid > .books-collect:nth-child(odd) .books-collect-photo { left: 42%; }
.books-collect::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, var(--books-col-wash) 0%, var(--books-col-wash) 38%, transparent 72%);
}
.books-collect-grid > .books-collect:nth-child(odd)::after {
  background: linear-gradient(90deg, var(--books-col-wash) 0%, var(--books-col-wash) 44%, transparent 70%);
}
.books-collect-copy, .books-collect-meta { position: relative; z-index: 2; }
.books-collect-copy { max-width: 22ch; }
.books-collect-grid > .books-collect:nth-child(odd) { padding: 34px 32px 24px; }
.books-collect-grid > .books-collect:nth-child(odd) .books-collect-copy { max-width: 26ch; }
.books-collect h3 {
  margin: 0; font-size: 1.55rem; font-weight: 400; letter-spacing: -.03em; line-height: 1.18; color: var(--books-col-ink);
}
.books-collect-grid > .books-collect:nth-child(odd) h3 { font-size: clamp(1.7rem, 2.1vw, 2.05rem); }
.books-collect-rule {
  display: block; width: 28px; height: 1.5px; margin: 12px 0 10px; border-radius: 99px; background: var(--books-col-rule);
}
.books-collect p { margin: 0; color: var(--books-col-muted); font-size: 1.05rem; font-weight: 400; line-height: 1.4; max-width: 28ch; }
.books-collect-meta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: auto; align-self: flex-start;
  color: var(--books-col-meta); font-size: .92rem; font-weight: 400;
  background: rgba(255,255,255,.48); border-radius: 999px; padding: 6px 11px 6px 9px;
}
.books-collect-ic { width: 16px; height: 16px; display: grid; place-items: center; flex: 0 0 auto; }
.books-collect-ic svg { width: 16px; height: 16px; }
.books-collect.tone-lantern { --books-col-wash: #f3ece0; background: #f3ece0; }
.books-collect.tone-quran {
  --books-col-wash: #163430; --books-col-ink: #f4f1ea; --books-col-muted: rgba(244,241,234,.78);
  --books-col-rule: #c4b48a; --books-col-meta: rgba(244,241,234,.84); background: #163430; color: #f4f1ea;
}
.books-collect.tone-quran:hover { color: #f4f1ea; }
.books-collect.tone-quran .books-collect-meta,
.books-collect.tone-seerah .books-collect-meta,
.books-collect.tone-knowledge .books-collect-meta { background: rgba(255,255,255,.12); }
.books-collect.tone-lake { --books-col-wash: #e6eef1; background: #e6eef1; }
.books-collect.tone-plant { --books-col-wash: #efe6d8; background: #efe6d8; }
.books-collect.tone-seerah, .books-collect.tone-knowledge {
  --books-col-wash: #1a3d3a; --books-col-ink: #f4f1ea; --books-col-muted: rgba(244,241,234,.78);
  --books-col-rule: #c4b48a; --books-col-meta: rgba(244,241,234,.84); background: #1a3d3a; color: #f4f1ea;
}

.books-popular-panel {
  border: 1px solid #e6ecef; border-radius: 22px; background: #fff;
  padding: 6px 28px; box-shadow: 0 10px 28px rgba(28,35,40,.04);
}
.books-popular-list { list-style: none; margin: 0; padding: 0; }
.books-popular-item {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 20px 0; border-bottom: 1px solid #eef2f4; text-decoration: none; color: inherit;
}
.books-popular-item:last-child { border-bottom: 0; }
.books-popular-item:hover .books-popular-title { color: #2a6f70; }
.books-popular-rank { color: #b89a62; font-size: .88rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.books-popular-body { min-width: 0; }
.books-popular-title {
  display: block; color: #1c2328; font-size: 1.06rem; line-height: 1.35; letter-spacing: -.01em;
}
.books-popular-author { display: block; margin-top: 4px; color: #7a868e; font-size: .94rem; }
.books-popular-side { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }
.books-popular-thumb {
  width: 64px; height: 42px; border-radius: 8px; overflow: hidden; background: #eef2f4;
  box-shadow: 0 6px 16px rgba(28,35,40,.08);
}
.books-popular-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.books-popular-thumb-empty { width: 100%; height: 100%; background: linear-gradient(135deg, #e8eef0, #d7e3e3); }
.books-popular-readers { color: #8a9499; font-size: .84rem; white-space: nowrap; }

.books-scholar-spotlight {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 36px; align-items: center;
  padding: 36px 38px; border: 1px solid #e6ecef; border-radius: 24px;
  background: linear-gradient(180deg, #fcfdfd 0%, #f6f8f9 100%);
  box-shadow: 0 12px 32px rgba(28,35,40,.05);
}
.books-scholar-copy { max-width: 48ch; }
.books-scholar-copy h2 {
  margin: 10px 0 0; color: #1c2328; font-size: clamp(1.55rem, 2.1vw, 1.95rem);
  font-weight: 400; letter-spacing: -.03em; line-height: 1.18;
}
.books-scholar-blurb { margin: 14px 0 0; color: #7a868e; font-size: 1.05rem; line-height: 1.5; max-width: 42ch; }
.books-scholar-foot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 22px;
}
.books-scholar-count { margin: 0; color: #7a868e; font-size: .94rem; }
.books-scholar-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 11px;
  background: #2a6f70; color: #fff; font-size: 1.02rem;
  box-shadow: 0 8px 22px rgba(42,111,112,.18);
  transition: background .15s ease, transform .15s ease;
}
.books-scholar-cta:hover { background: #245f60; color: #fff; transform: translateY(-1px); }
.books-scholar-covers {
  display: flex; flex-direction: row; gap: 12px; align-items: center; justify-content: flex-end;
  min-width: 0;
}
.books-scholar-cover {
  width: 112px; height: 70px; flex: 0 0 auto; border-radius: 10px; overflow: hidden; background: #eef2f4;
  box-shadow: 0 8px 20px rgba(28,35,40,.1); text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}
.books-scholar-cover:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(28,35,40,.14); }
.books-scholar-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.books-scholar-cover-empty { width: 100%; height: 100%; background: linear-gradient(135deg, #dfe8ea, #c5d4d6); }

.books-short-filters {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0;
}
.books-short-filter {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 16px; border: 1px solid #dbe3e6; background: #fff; color: #3d484e;
  border-radius: 999px; font: inherit; font-size: .9rem; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.books-short-filter:hover { border-color: #cfd8da; box-shadow: 0 4px 12px rgba(28,35,40,.04); }
.books-short-filter.is-active {
  background: #2a6f70; border-color: #2a6f70; color: #fff;
  box-shadow: 0 8px 18px rgba(42,111,112,.16);
}
#books-home-short.books-recent-section {
  margin: 0 !important;
}

.books-footer {
  margin-top: 48px; background: #f6f7f8; border-top: 1px solid var(--books-line);
  padding: 0; text-align: left; color: #3d484e;
}
.books-footer-spacer { height: 72px; }
.books-footer-grid {
  display: grid; grid-template-columns: minmax(240px,1.45fr) repeat(3,minmax(0,.85fr));
  gap: 36px 40px; padding: 0 0 40px;
}
.books-footer-logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.books-footer-logo img { width: 40px; height: 40px; border-radius: 10px; }
.books-footer-logo span { font-size: 1.18rem; }
.books-footer-brand p { margin: 14px 0 0; max-width: 34ch; color: var(--books-muted); line-height: 1.55; }
.books-footer h4 { margin: 4px 0 14px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--books-teal); font-weight: 400; }
.books-footer-col a { display: block; margin: 0 0 10px; font-size: 1.05rem; color: inherit; text-decoration: none; }
.books-footer-col a:hover { color: var(--books-teal); text-decoration: none; }
.books-footer-copy {
  margin: 0; padding: 16px 0 28px; border-top: 1px solid var(--books-line);
  display: flex; justify-content: space-between; gap: 12px; color: var(--books-text-faint); font-size: .92rem; flex-wrap: wrap;
}
body.books-reader-active .books-tabbar,
body.books-reader-active .books-footer,
html.books-maktabah-embed .books-tabbar,
html.books-maktabah-embed .books-footer,
html.books-maktabah-embed .books-search-sheet,
html.books-maktabah-embed .books-search-dock,
html.books-maktabah-embed .books-featured,
html.books-maktabah-embed .books-reminder,
html.books-maktabah-embed .books-values,
html.books-maktabah-embed .books-home-discover { display: none !important; }
html.books-maktabah-embed .books-hero { display: none !important; }

@media (max-width: 960px) {
  .books-doors { grid-template-columns: 1fr 1fr; }
  .books-index-grid { grid-template-columns: 1fr 1fr; }
  .books-footer-grid { grid-template-columns: 1fr 1fr; }
  .books-footer-brand { grid-column: 1 / -1; }
  .books-featured-inner { grid-template-columns: minmax(220px, 40%) 1px minmax(0, 1fr); }
  .books-featured-body { padding: 22px 24px 22px 20px; }
  .books-values-row { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .books-value-div { display: none; }
  .books-reminder { padding: 72px 16px 68px; min-height: 320px; border-radius: 0; }
  .books-reminder-side { width: 22%; opacity: .55; }
  .books-reminder blockquote { font-size: 1.16rem; }
  .books-collect-grid { grid-template-columns: 1.45fr 1fr; gap: 14px; }
  .books-collect { min-height: 228px; padding: 26px 22px 18px; border-radius: 22px; }
  .books-collect-grid > .books-collect:nth-child(odd) { padding: 28px 24px 20px; }
  .books-scholar-spotlight { grid-template-columns: 1fr; }
  .books-scholar-covers { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 820px) {
  .books-mobile-menu-btn { display: grid; place-items: center; margin-left: auto; }
  .books-header-nav {
    display: none; width: 100%; margin: 4px 0 0; padding: 6px 0 4px;
    border-top: 1px solid #eef2f4; flex-direction: column; align-items: stretch; gap: 0; overflow: visible;
  }
  .books-header.is-open .books-header-inner { flex-wrap: wrap; }
  .books-header.is-open .books-header-nav { display: flex; }
  .books-header.is-open .books-header-nav a {
    width: 100%; justify-content: flex-start;
    min-height: 44px; padding: 10px 4px !important;
    border: 0 !important; border-radius: 8px !important;
    background: transparent !important; color: #3d484e; font-weight: 400;
  }
  .books-header.is-open .books-header-nav a.on { color: #2a6f70 !important; border-bottom: 0 !important; font-weight: 400; }
  .books-header.is-open + .books-tabbar,
  body.books-nav-open .books-tabbar { display: none; }
  .books-header-inner { width: calc(100% - 28px); min-height: 56px; gap: 12px; padding: 10px 0 8px; }
  .books-header-auth { display: flex !important; margin-left: 0; }
  .books-logo-title { font-size: 1.08rem; font-weight: 400; }
  .books-btn-signin { min-height: 38px; padding: 8px 12px; font-size: .88rem; }
  .books-tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255,255,255,.96); backdrop-filter: blur(18px);
    border-top: 1px solid var(--books-line);
    box-shadow: 0 -10px 28px rgba(28,35,40,.06);
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .books-tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 48px; color: #6b767c; font-size: .62rem; letter-spacing: .02em; text-decoration: none;
  }
  .books-tabbar a.on { color: var(--books-teal); }
  .books-tabbar svg { width: 22px; height: 22px; }
  .books-hero-section {
    min-height: 0; height: auto;
    margin-top: 0;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 0 36px;
    text-align: center; justify-content: center;
    background-size: 100% 100%;
  }
  .books-hero-section .books-hero-inner {
    width: 100%; max-width: none; padding: 0 20px; box-sizing: border-box;
  }
  .books-hero-section .books-hero-copy,
  .books-hero-section .books-hero-hadith {
    width: 100%; max-width: none; align-items: center; gap: .7rem;
  }
  .books-hero-section .books-hero-title { font-size: 1.55rem; max-width: 22ch; line-height: 1.2; }
  .books-hero-section.books-hero-library {
    min-height: calc(100svh - 140px);
    min-height: calc(100dvh - 140px);
    padding: 48px 20px 36px;
    background-size: cover !important;
    background-position: center !important;
  }
  .books-hero-section.books-hero-library .books-hero-title {
    font-size: 1.85rem;
    max-width: 16ch;
    line-height: 1.18;
  }
  .books-hero-home {
    min-height: 0; height: auto;
    margin-top: 0;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 0 36px;
    text-align: center; justify-content: center;
    background-size: 100% 100%;
  }
  .books-hero-home .books-hero-inner {
    width: 100%; max-width: none; padding: 0 20px; box-sizing: border-box;
  }
  .books-hero-home .books-hero-copy,
  .books-hero-home .books-hero-hadith {
    width: 100%; max-width: none; align-items: center; gap: .7rem;
  }
  .books-hero-home .books-hero-title { font-size: 1.55rem; max-width: 22ch; line-height: 1.2; }
  .books-search-dock { padding: 20px 0 4px; }
  .books-featured-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1px auto;
    min-height: 0;
  }
  .books-featured-cover {
    width: calc(100% - 40px);
    margin: 20px;
    min-height: 0;
    aspect-ratio: 16 / 10;
    height: auto;
  }
  .books-featured-cover img,
  .books-featured-cover-empty {
    min-height: 0;
    height: 100%;
    border-radius: 12px;
  }
  .books-featured-split {
    width: auto;
    height: 1px;
    margin: 0 20px;
  }
  .books-featured-split .books-gold-star {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  .books-featured-body { padding: 20px 20px 22px; }
  .books-featured-blurb { display: none; }
  .books-reminder {
    padding: 56px 18px 52px;
    min-height: 0;
    margin-top: 32px;
  }
  .books-reminder-side, .books-reminder-bg { display: none; }
  .books-reminder blockquote { font-size: 1.1rem; }
  .books-values-row { grid-template-columns: 1fr; row-gap: 22px; }
  .books-values { margin-top: 72px; }
  .books-values-blessing { margin-bottom: 18px; font-size: 1.28rem; }
  .books-home-section { padding: 0; }
  .books-home-section-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
  .books-home-section h2 { font-size: 1.38rem; }
  .books-home-intro { font-size: .95rem; }
  .books-home-split { margin: 48px 0 40px; }
  .books-home-split-before-values { margin: 52px 0 48px; }
  .books-collect-grid { grid-template-columns: 1fr; }
  .books-collect { min-height: 210px; }
  .books-popular-panel { padding: 4px 18px; }
  .books-popular-item { grid-template-columns: 30px minmax(0, 1fr); padding: 16px 0; }
  .books-popular-side { grid-column: 2; justify-self: start; margin-top: 6px; }
  .books-popular-readers { display: none; }
  .books-scholar-spotlight { grid-template-columns: 1fr; padding: 24px 20px; }
  .books-scholar-covers { margin-top: 8px; }
  .books-doors { grid-template-columns: 1fr; }
  .books-index-grid { grid-template-columns: 1fr; }
  .books-footer { margin-top: 28px; padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .books-footer-spacer { display: none; }
  .books-library-shell { padding-bottom: 48px; }
  body.books-home-landing .books-header {
    padding-top: env(safe-area-inset-top, 0px);
    left: 0; right: 0; width: 100%;
    background: #fff;
    border-bottom: 1px solid rgba(28,35,40,.08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.books-home-landing .books-header.is-open { background: #fff; }
  body.books-home-landing .books-header-inner {
    width: 100%;
    max-width: none;
    min-height: 56px;
    padding: 10px 16px 8px;
    gap: 8px 10px;
  }
  body.books-home-landing .books-logo {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }
  body.books-home-landing .books-logo-title {
    display: block;
    font-size: 1.02rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.books-home-landing .books-header-auth { margin-left: 0 !important; }
  body.books-home-landing .books-btn-signin,
  body.books-home-landing .books-account-btn {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(42,111,112,.28) !important;
    border-radius: 999px !important;
    color: #2a6f70 !important;
  }
  body.books-home-landing .books-hero-home .books-hero-kicker { display: none; }
  body.books-home-landing .books-hero-home {
    min-height: 0;
    height: auto;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 0 36px !important;
    background-size: 100% 100% !important;
  }
  body.books-home-landing .books-hero-home .books-hero-inner {
    width: 100%;
    max-width: none;
    padding: 0 20px;
    box-sizing: border-box;
    gap: 0;
  }
  body.books-home-landing .books-hero-home .books-hero-copy {
    gap: .7rem;
  }
  body.books-home-landing .books-hero-home .books-hero-title {
    max-width: 22ch;
    font-size: 1.55rem;
    line-height: 1.2;
  }
  body.books-home-landing .books-hero-home .books-hero-attrib {
    font-size: 1.08rem;
    margin: .2rem 0 0;
  }
  body.books-home-landing .books-hero-home .books-hero-lead {
    max-width: 28ch;
    font-size: .98rem;
    margin: 0 auto;
  }
  body.books-home-landing .books-hero-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-top: 8px;
  }
  body.books-home-landing .books-hero-cta { width: 100%; min-height: 48px; }
}

/* =====================================================================
   Recently Added — mockup carousel (6 books, 2 pages, fade)
   ===================================================================== */
.books-recent-section {
  position: relative !important;
  margin: 40px 0 32px !important;
  padding: 0 !important;
}
.books-recent-section[hidden] { display: none !important; }
.books-recent-section .books-recent-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  column-gap: 40px;
  row-gap: 10px;
  align-items: center;
  margin-bottom: 28px;
}
.books-recent-section .books-recent-kicker {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #b89a62;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.books-recent-section .books-recent-kicker .books-gold-star {
  width: 7px;
  height: 7px;
}
.books-recent-section .books-recent-viewall {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  color: #1c2328;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.books-recent-section .books-recent-viewall span { margin-left: 2px; }
.books-recent-section .books-recent-viewall:hover { color: #2a6f70; }
.books-recent-section .books-recent-title {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  color: #1c2328;
  font-size: clamp(1.65rem, 2.2vw, 2rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.06;
}
.books-recent-section .books-recent-controls {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.books-recent-section .books-recent-intro {
  grid-column: 1;
  grid-row: 3;
  margin: 0;
  max-width: 48ch;
  color: #7a868e;
  font-size: .94rem;
  font-weight: 400;
  line-height: 1.45;
}
.books-recent-section .books-recent-nav-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #dde3e6;
  border-radius: 999px;
  background: #fff;
  color: #1c2328;
  padding: 0;
  cursor: pointer;
}
.books-recent-section .books-recent-nav-btn svg { width: 15px; height: 15px; }
.books-recent-section .books-recent-nav-btn:hover { border-color: #b8c4ca; color: #2a6f70; }
.books-recent-section .books-recent-page {
  min-width: 56px;
  text-align: center;
  color: #8a959c;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .05em;
}
.books-recent-section .books-recent-page b { color: #1c2328; font-weight: 600; }
.books-recent-section .books-recent-count {
  color: #8a959c;
  font-size: .82rem;
  font-weight: 400;
  white-space: nowrap;
}
.books-recent-section .books-recent-carousel {
  position: relative;
  margin: 0 0 20px;
}
.books-recent-section .books-recent-pages {
  display: grid;
  grid-template-columns: 1fr;
}
.books-recent-section .books-recent-page {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity .6s ease, visibility .6s ease;
}
.books-recent-section .books-recent-page.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}
.books-recent-section .books-recent-chip {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  border: 1px solid #e8e4dc;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(28,35,40,.04);
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.books-recent-section .books-recent-chip:hover {
  transform: translateY(-2px);
  border-color: #ddd6c8;
  box-shadow: 0 14px 32px rgba(28,35,40,.07);
}
.books-recent-section .books-recent-chip-cover {
  flex: 0 0 auto;
  height: 168px;
  background: #f5f0e8;
  overflow: hidden;
}
.books-recent-section .books-recent-chip-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.books-recent-section .books-recent-chip-cover-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #b8c0c4;
  background: linear-gradient(145deg, #f7f3ea 0%, #ebe4d6 100%);
}
.books-recent-section .books-recent-chip-cover-empty svg { width: 36px; height: 36px; opacity: .5; }
.books-recent-section .books-recent-chip-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 2px;
  padding: 14px 15px 13px;
  min-width: 0;
}
.books-recent-section .books-recent-chip-title {
  margin: 0 0 2px;
  color: #1c2328;
  font-size: .96rem;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.books-recent-section .books-recent-chip-author {
  margin: 0;
  color: #7a868e;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.books-recent-section .books-recent-chip-desc {
  margin: 4px 0 0;
  color: #9aa4ab;
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.books-recent-section .books-recent-chip-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  min-width: 0;
}
.books-recent-section .books-recent-chip-lang {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border: 1px solid #e8dfd0;
  border-radius: 999px;
  background: #faf6ef;
  color: #6b6256;
  font-size: .68rem;
  font-weight: 500;
  white-space: nowrap;
}
.books-recent-section .books-recent-chip-read {
  color: #9aa4ab;
  font-size: .68rem;
  font-weight: 400;
  white-space: nowrap;
}
.books-recent-section .books-recent-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.books-recent-section .books-recent-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.books-recent-section .books-recent-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 1px solid #c5d0d6;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, width .2s ease, border-radius .2s ease;
}
.books-recent-section .books-recent-dot.is-active {
  width: 18px;
  border-radius: 99px;
  background: #2a6f70;
  border-color: #2a6f70;
}
.books-recent-section .books-recent-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(220px, 100%);
  gap: 10px;
}
.books-recent-section .books-recent-rule::before,
.books-recent-section .books-recent-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d4c4a8;
  opacity: .85;
}
@media (max-width: 900px) {
  .books-recent-section .books-recent-head {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }
  .books-recent-section .books-recent-viewall,
  .books-recent-section .books-recent-controls {
    grid-column: 1;
    justify-self: start;
  }
  .books-recent-section .books-recent-viewall { grid-row: 2; }
  .books-recent-section .books-recent-title { grid-row: 3; }
  .books-recent-section .books-recent-controls { grid-row: 4; }
  .books-recent-section .books-recent-intro { grid-row: 5; }
  .books-recent-section .books-short-filters { grid-row: 6; }
  .books-recent-section .books-recent-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}
@media (max-width: 620px) {
  .books-recent-section .books-recent-page {
    grid-template-columns: 1fr;
  }
  .books-recent-section .books-recent-chip-cover { height: 152px; }
}
@media (prefers-reduced-motion: reduce) {
  .books-recent-section .books-recent-page,
  .books-recent-section .books-recent-chip,
  .books-recent-section .books-recent-dot {
    transition: none;
  }
}

/* =====================================================================
   Continue Reading — mockup split card with progress
   ===================================================================== */
#books-shelf-continue.books-continue-section,
#books-mr-shelf-continue.books-continue-section {
  position: relative !important;
  margin: 28px 0 36px !important;
  padding: 0 !important;
}
#books-shelf-continue.books-continue-section[hidden],
#books-mr-shelf-continue.books-continue-section[hidden] { display: none !important; }
#books-shelf-continue.books-continue-section .books-continue-head ,
#books-mr-shelf-continue.books-continue-section .books-continue-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 40px;
  row-gap: 10px;
  align-items: center;
  margin-bottom: 28px;
}
#books-shelf-continue.books-continue-section .books-continue-kicker-head ,
#books-mr-shelf-continue.books-continue-section .books-continue-kicker-head {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #b89a62;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
}
#books-shelf-continue.books-continue-section .books-continue-kicker-head .books-gold-star ,
#books-mr-shelf-continue.books-continue-section .books-continue-kicker-head .books-gold-star {
  width: 7px;
  height: 7px;
}
#books-shelf-continue.books-continue-section .books-continue-viewall ,
#books-mr-shelf-continue.books-continue-section .books-continue-viewall {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  color: #2a6f70;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(42, 111, 112, .35);
  white-space: nowrap;
}
#books-shelf-continue.books-continue-section .books-continue-viewall span ,
#books-mr-shelf-continue.books-continue-section .books-continue-viewall span { margin-left: 2px; }
#books-shelf-continue.books-continue-section .books-continue-viewall:hover ,
#books-mr-shelf-continue.books-continue-section .books-continue-viewall:hover { color: #245f60; }
#books-shelf-continue.books-continue-section .books-continue-heading ,
#books-mr-shelf-continue.books-continue-section .books-continue-heading {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  color: #1c2328;
  font-size: clamp(1.65rem, 2.2vw, 2rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.06;
}
#books-shelf-continue.books-continue-section .books-continue-card ,
#books-mr-shelf-continue.books-continue-section .books-continue-card {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) auto minmax(250px, 0.68fr);
  align-items: stretch;
  background: #fff;
  border: 1px solid #eceff1;
  border-radius: 18px;
  box-shadow: 0 10px 36px rgba(28, 35, 40, .06);
  overflow: hidden;
  min-height: 292px;
}
#books-shelf-continue.books-continue-section .books-continue-left ,
#books-mr-shelf-continue.books-continue-section .books-continue-left {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px;
  padding: 40px 36px 40px 40px;
  min-width: 0;
}
#books-shelf-continue.books-continue-section .books-continue-cover-wrap ,
#books-mr-shelf-continue.books-continue-section .books-continue-cover-wrap {
  flex: 0 0 46%;
  width: 46%;
  min-width: 240px;
  max-width: 360px;
}
#books-shelf-continue.books-continue-section .books-continue-ribbon ,
#books-mr-shelf-continue.books-continue-section .books-continue-ribbon {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 22px;
  height: 28px;
  color: #7eb8a8;
  z-index: 2;
}
#books-shelf-continue.books-continue-section .books-continue-ribbon svg ,
#books-mr-shelf-continue.books-continue-section .books-continue-ribbon svg { width: 100%; height: 100%; display: block; }
#books-shelf-continue.books-continue-section .books-continue-ribbon[hidden] ,
#books-mr-shelf-continue.books-continue-section .books-continue-ribbon[hidden] { display: none; }
#books-shelf-continue.books-continue-section .books-continue-cover ,
#books-mr-shelf-continue.books-continue-section .books-continue-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(28, 35, 40, .14);
  flex-shrink: 0;
  background: #f6f7f8;
}
#books-shelf-continue.books-continue-section .books-continue-cover img ,
#books-mr-shelf-continue.books-continue-section .books-continue-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
#books-shelf-continue.books-continue-section .books-continue-cover-empty ,
#books-mr-shelf-continue.books-continue-section .books-continue-cover-empty {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #eef5f5 0%, #f8f4ec 100%);
}
#books-shelf-continue.books-continue-section .books-continue-main ,
#books-mr-shelf-continue.books-continue-section .books-continue-main {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}
#books-shelf-continue.books-continue-section .books-continue-kicker ,
#books-mr-shelf-continue.books-continue-section .books-continue-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: #b89a62;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
#books-shelf-continue.books-continue-section .books-continue-kicker::before,,
#books-mr-shelf-continue.books-continue-section .books-continue-kicker::before,
#books-shelf-continue.books-continue-section .books-continue-kicker::after ,
#books-mr-shelf-continue.books-continue-section .books-continue-kicker::after {
  content: "";
  flex: 0 0 28px;
  height: 1px;
  background: #d4c4a8;
  opacity: .85;
}
#books-shelf-continue.books-continue-section .books-continue-title ,
#books-mr-shelf-continue.books-continue-section .books-continue-title {
  margin: 0 0 10px;
  color: #1c2328;
  font-size: clamp(1.45rem, 1.9vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.28;
  font-family: var(--books-font-arabic, 'Amiri', serif);
}
#books-shelf-continue.books-continue-section .books-continue-author ,
#books-mr-shelf-continue.books-continue-section .books-continue-author {
  margin: 0 0 18px;
  color: #2a6f70;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
}
#books-shelf-continue.books-continue-section .books-continue-divider ,
#books-mr-shelf-continue.books-continue-section .books-continue-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
  max-width: 100%;
}
#books-shelf-continue.books-continue-section .books-continue-divider::before,,
#books-mr-shelf-continue.books-continue-section .books-continue-divider::before,
#books-shelf-continue.books-continue-section .books-continue-divider::after ,
#books-mr-shelf-continue.books-continue-section .books-continue-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d4c4a8;
  opacity: .85;
}
#books-shelf-continue.books-continue-section .books-continue-divider .books-gold-star ,
#books-mr-shelf-continue.books-continue-section .books-continue-divider .books-gold-star { width: 7px; height: 7px; flex: 0 0 auto; }
#books-shelf-continue.books-continue-section .books-continue-desc ,
#books-mr-shelf-continue.books-continue-section .books-continue-desc {
  margin: 0 0 16px;
  color: #7a868e;
  font-size: .94rem;
  font-weight: 400;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#books-shelf-continue.books-continue-section .books-continue-meta-row ,
#books-mr-shelf-continue.books-continue-section .books-continue-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
#books-shelf-continue.books-continue-section .books-continue-lang ,
#books-mr-shelf-continue.books-continue-section .books-continue-lang {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f1f3f5;
  color: #5c686f;
  font-size: .78rem;
  font-weight: 500;
}
#books-shelf-continue.books-continue-section .books-continue-read ,
#books-mr-shelf-continue.books-continue-section .books-continue-read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7a868e;
  font-size: .82rem;
  font-weight: 400;
}
#books-shelf-continue.books-continue-section .books-continue-read svg ,
#books-mr-shelf-continue.books-continue-section .books-continue-read svg { width: 14px; height: 14px; flex-shrink: 0; }
#books-shelf-continue.books-continue-section .books-continue-lastopened ,
#books-mr-shelf-continue.books-continue-section .books-continue-lastopened {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #8a959c;
  font-size: .82rem;
  font-weight: 400;
}
#books-shelf-continue.books-continue-section .books-continue-lastopened svg ,
#books-mr-shelf-continue.books-continue-section .books-continue-lastopened svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .75; }
#books-shelf-continue.books-continue-section .books-continue-split ,
#books-mr-shelf-continue.books-continue-section .books-continue-split {
  position: relative;
  width: 1px;
  background: #eceff1;
  align-self: stretch;
}
#books-shelf-continue.books-continue-section .books-continue-split .books-gold-star ,
#books-mr-shelf-continue.books-continue-section .books-continue-split .books-gold-star {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #fff;
  padding: 4px 0;
}
#books-shelf-continue.books-continue-section .books-continue-right ,
#books-mr-shelf-continue.books-continue-section .books-continue-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 30px 28px 22px;
  min-width: 0;
  max-width: 360px;
}
#books-shelf-continue.books-continue-section .books-continue-progress-kicker ,
#books-mr-shelf-continue.books-continue-section .books-continue-progress-kicker {
  margin: 0 0 6px;
  color: #2a6f70;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
#books-shelf-continue.books-continue-section .books-continue-progress-head ,
#books-mr-shelf-continue.books-continue-section .books-continue-progress-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
#books-shelf-continue.books-continue-section .books-continue-pct-big ,
#books-mr-shelf-continue.books-continue-section .books-continue-pct-big {
  color: #1c2328;
  font-size: clamp(2rem, 2.8vw, 2.45rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1;
}
#books-shelf-continue.books-continue-section .books-continue-pct-sub ,
#books-mr-shelf-continue.books-continue-section .books-continue-pct-sub {
  color: #8a959c;
  font-size: .88rem;
  font-weight: 400;
}
#books-shelf-continue.books-continue-section .books-continue-pbar ,
#books-mr-shelf-continue.books-continue-section .books-continue-pbar {
  position: relative;
  height: 4px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: #eceff1;
  overflow: visible;
}
#books-shelf-continue.books-continue-section .books-continue-pbar-fill ,
#books-mr-shelf-continue.books-continue-section .books-continue-pbar-fill {
  position: relative;
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: #2a6f70;
  transition: width .35s ease;
}
#books-shelf-continue.books-continue-section .books-continue-pbar-dot ,
#books-mr-shelf-continue.books-continue-section .books-continue-pbar-dot {
  position: absolute;
  right: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  margin-right: -5px;
  border-radius: 50%;
  background: #2a6f70;
  box-shadow: 0 0 0 3px #fff;
}
#books-shelf-continue.books-continue-section .books-continue-chapter ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eceff1;
  color: inherit;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 1px 4px rgba(28, 35, 40, .04);
}
#books-shelf-continue.books-continue-section .books-continue-chapter:hover ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter:hover {
  background: #fff;
  border-color: #d7dee3;
  box-shadow: 0 4px 14px rgba(28, 35, 40, .06);
}
#books-shelf-continue.books-continue-section .books-continue-chapter-ic ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter-ic {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a6f70;
}
#books-shelf-continue.books-continue-section .books-continue-chapter-ic svg ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter-ic svg { width: 20px; height: 20px; }
#books-shelf-continue.books-continue-section .books-continue-chapter-copy ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#books-shelf-continue.books-continue-section .books-continue-chapter-num ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter-num {
  color: #8a959c;
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .02em;
}
#books-shelf-continue.books-continue-section .books-continue-chapter-title ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter-title {
  color: #1c2328;
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#books-shelf-continue.books-continue-section .books-continue-chapter-chev ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter-chev {
  flex-shrink: 0;
  color: #8a959c;
}
#books-shelf-continue.books-continue-section .books-continue-chapter-chev svg ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter-chev svg { width: 16px; height: 16px; display: block; }
#books-shelf-continue.books-continue-section .books-continue-stats ,
#books-mr-shelf-continue.books-continue-section .books-continue-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}
#books-shelf-continue.books-continue-section .books-continue-stat ,
#books-mr-shelf-continue.books-continue-section .books-continue-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
}
#books-shelf-continue.books-continue-section .books-continue-stat-ic ,
#books-mr-shelf-continue.books-continue-section .books-continue-stat-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #8a959c;
}
#books-shelf-continue.books-continue-section .books-continue-stat-ic svg ,
#books-mr-shelf-continue.books-continue-section .books-continue-stat-ic svg { width: 16px; height: 16px; }
#books-shelf-continue.books-continue-section .books-continue-stat-val ,
#books-mr-shelf-continue.books-continue-section .books-continue-stat-val {
  color: #1c2328;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.15;
}
#books-shelf-continue.books-continue-section .books-continue-stat-lbl ,
#books-mr-shelf-continue.books-continue-section .books-continue-stat-lbl {
  color: #8a959c;
  font-size: .68rem;
  font-weight: 400;
  line-height: 1.2;
}
#books-shelf-continue.books-continue-section .books-continue-actions ,
#books-mr-shelf-continue.books-continue-section .books-continue-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
#books-shelf-continue.books-continue-section .books-continue-resume ,
#books-mr-shelf-continue.books-continue-section .books-continue-resume {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: #2a6f70;
  color: #fff;
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 8px 22px rgba(42, 111, 112, .22);
}
#books-shelf-continue.books-continue-section .books-continue-resume svg ,
#books-mr-shelf-continue.books-continue-section .books-continue-resume svg { width: 17px; height: 17px; flex-shrink: 0; }
#books-shelf-continue.books-continue-section .books-continue-resume-arrow ,
#books-mr-shelf-continue.books-continue-section .books-continue-resume-arrow { width: 16px !important; height: 16px !important; margin-left: 2px; }
#books-shelf-continue.books-continue-section .books-continue-resume:hover ,
#books-mr-shelf-continue.books-continue-section .books-continue-resume:hover {
  background: #245f60;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(42, 111, 112, .28);
}
#books-shelf-continue.books-continue-section .books-continue-more ,
#books-mr-shelf-continue.books-continue-section .books-continue-more {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dce3e7;
  border-radius: 50%;
  background: #fff;
  color: #5c686f;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
#books-shelf-continue.books-continue-section .books-continue-more svg ,
#books-mr-shelf-continue.books-continue-section .books-continue-more svg { width: 18px; height: 18px; }
#books-shelf-continue.books-continue-section .books-continue-more:hover ,
#books-mr-shelf-continue.books-continue-section .books-continue-more:hover {
  border-color: #b8c4ca;
  background: #f6f7f8;
}
@media (max-width: 960px) {
  #books-shelf-continue.books-continue-section .books-continue-card ,
#books-mr-shelf-continue.books-continue-section .books-continue-card {
    grid-template-columns: 1fr;
  }
  #books-shelf-continue.books-continue-section .books-continue-split ,
#books-mr-shelf-continue.books-continue-section .books-continue-split {
    width: auto;
    height: 1px;
    margin: 0 24px;
  }
  #books-shelf-continue.books-continue-section .books-continue-split .books-gold-star ,
#books-mr-shelf-continue.books-continue-section .books-continue-split .books-gold-star {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  #books-shelf-continue.books-continue-section .books-continue-right ,
#books-mr-shelf-continue.books-continue-section .books-continue-right {
    padding-top: 24px;
  }
}
@media (max-width: 820px) {
  #books-shelf-continue.books-continue-section .books-continue-card ,
#books-mr-shelf-continue.books-continue-section .books-continue-card {
    grid-template-columns: minmax(0, 1fr) auto minmax(220px, 0.82fr);
  }
  #books-shelf-continue.books-continue-section .books-continue-left ,
#books-mr-shelf-continue.books-continue-section .books-continue-left {
    gap: 28px;
    padding: 32px 28px 32px 32px;
  }
  #books-shelf-continue.books-continue-section .books-continue-cover-wrap ,
#books-mr-shelf-continue.books-continue-section .books-continue-cover-wrap {
    flex-basis: 42%;
    width: 42%;
    min-width: 200px;
  }
  #books-shelf-continue.books-continue-section .books-continue-cover ,
#books-mr-shelf-continue.books-continue-section .books-continue-cover {
    aspect-ratio: 16 / 10;
    height: auto;
  }
}
@media (max-width: 640px) {
  #books-shelf-continue.books-continue-section .books-continue-head ,
#books-mr-shelf-continue.books-continue-section .books-continue-head {
    grid-template-columns: 1fr;
  }
  #books-shelf-continue.books-continue-section .books-continue-viewall ,
#books-mr-shelf-continue.books-continue-section .books-continue-viewall {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }
  #books-shelf-continue.books-continue-section .books-continue-heading ,
#books-mr-shelf-continue.books-continue-section .books-continue-heading { grid-row: 2; }
  #books-shelf-continue.books-continue-section .books-continue-left ,
#books-mr-shelf-continue.books-continue-section .books-continue-left {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 20px 20px;
  }
  #books-shelf-continue.books-continue-section .books-continue-cover-wrap ,
#books-mr-shelf-continue.books-continue-section .books-continue-cover-wrap {
    flex: 0 0 44%;
    width: 44%;
    min-width: 0;
    max-width: none;
  }
  #books-shelf-continue.books-continue-section .books-continue-cover ,
#books-mr-shelf-continue.books-continue-section .books-continue-cover {
    aspect-ratio: 16 / 10;
    height: auto;
  }
  #books-shelf-continue.books-continue-section .books-continue-right ,
#books-mr-shelf-continue.books-continue-section .books-continue-right {
    padding: 20px;
    max-width: none;
  }
  #books-shelf-continue.books-continue-section .books-continue-stats ,
#books-mr-shelf-continue.books-continue-section .books-continue-stats {
    gap: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #books-shelf-continue.books-continue-section .books-continue-pbar-fill,,
#books-mr-shelf-continue.books-continue-section .books-continue-pbar-fill,
  #books-shelf-continue.books-continue-section .books-continue-resume,,
#books-mr-shelf-continue.books-continue-section .books-continue-resume,
  #books-shelf-continue.books-continue-section .books-continue-chapter ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter {
    transition: none;
  }
}

/* =====================================================================
   Browse by category — Maktabah-style photo rail
   ===================================================================== */
#books-shelf-categories.books-category-section {
  position: relative;
  margin: 28px 0 36px !important;
  padding: 0 !important;
}
#books-shelf-categories.books-category-section .books-category-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
#books-shelf-categories.books-category-section .books-category-title {
  margin: 0;
  color: #1c2328;
  font-size: clamp(1.55rem, 2.1vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.08;
}
#books-shelf-categories.books-category-section .books-category-intro {
  margin: 6px 0 0;
  color: #7a868e;
  font-size: .98rem;
  font-weight: 500;
  line-height: 1.35;
}
#books-shelf-categories.books-category-section .books-category-viewall {
  color: #2a6f70;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
#books-shelf-categories.books-category-section .books-category-viewall span { margin-left: 2px; }
#books-shelf-categories.books-category-section .books-category-viewall:hover { color: #1f5556; }
#books-shelf-categories.books-category-section .books-cat-rail {
  --books-cat-show: 6;
  --books-cat-gap: 16px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
}
#books-shelf-categories.books-category-section .books-cat-rail.is-single .books-cat-rail-btn { visibility: hidden; pointer-events: none; }
#books-shelf-categories.books-category-section .books-cat-rail.is-single .books-cat-dots { display: none; }
#books-shelf-categories.books-category-section .books-cat-rail-btn {
  grid-row: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #eceff1;
  background: #fff;
  color: #2a6f70;
  box-shadow: 0 10px 24px rgba(28, 35, 40, .10);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  align-self: center;
}
#books-shelf-categories.books-category-section .books-cat-rail-btn.prev { grid-column: 1; }
#books-shelf-categories.books-category-section .books-cat-rail-btn.next { grid-column: 3; }
#books-shelf-categories.books-category-section .books-cat-rail-btn svg { width: 18px; height: 18px; }
#books-shelf-categories.books-category-section .books-cat-rail-btn:hover { border-color: #d7e3e3; color: #1f5556; }
#books-shelf-categories.books-category-section .books-cat-rail-btn:disabled { opacity: .38; cursor: default; }
#books-shelf-categories.books-category-section .books-cat-carousel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
#books-shelf-categories.books-category-section .books-cat-pages {
  display: grid;
  grid-template-columns: 1fr;
}
#books-shelf-categories.books-category-section .books-cat-page {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--books-cat-gap);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity .6s ease, visibility .6s ease;
}
#books-shelf-categories.books-category-section .books-cat-pages.is-animating .books-cat-page {
  transition: opacity .52s ease, visibility .52s ease;
}
#books-shelf-categories.books-category-section .books-cat-page.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}
#books-shelf-categories.books-category-section .books-cat-card {
  min-width: 0;
  height: 196px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 18px;
  padding: 22px 14px 18px;
  text-align: center;
  text-decoration: none;
  color: #1c2328;
  background: #fff;
  border: 1px solid #eceff1;
  box-shadow: 0 8px 24px rgba(28, 35, 40, .05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#books-shelf-categories.books-category-section .books-cat-card--quran-tafsir .books-cat-ic { background: #e8f1f5; color: #2a6678; }
#books-shelf-categories.books-category-section .books-cat-card--hadith .books-cat-ic { background: #f3ede4; color: #7a6248; }
#books-shelf-categories.books-category-section .books-cat-card--aqeedah .books-cat-ic { background: #e8f3ed; color: #2a6f58; }
#books-shelf-categories.books-category-section .books-cat-card--fiqh .books-cat-ic { background: #e9edf3; color: #4a5d78; }
#books-shelf-categories.books-category-section .books-cat-card--seerah .books-cat-ic { background: #f5ece3; color: #8a6848; }
#books-shelf-categories.books-category-section .books-cat-card--tazkiyah .books-cat-ic { background: #e7f2ef; color: #2a7568; }
#books-shelf-categories.books-category-section .books-cat-card--family .books-cat-ic { background: #f0ede8; color: #6b5e52; }
#books-shelf-categories.books-category-section .books-cat-card--children .books-cat-ic { background: #f2f0e8; color: #7a7348; }
#books-shelf-categories.books-category-section .books-cat-card--arabic .books-cat-ic { background: #eceef3; color: #4f5878; }
#books-shelf-categories.books-category-section .books-cat-card--dawah .books-cat-ic { background: #e8f0ef; color: #2a6f70; }
#books-shelf-categories.books-category-section .books-cat-card--new-muslims .books-cat-ic { background: #eaf2f0; color: #3d7a6e; }
#books-shelf-categories.books-category-section .books-cat-card--history .books-cat-ic { background: #f1ebe5; color: #806a58; }
#books-shelf-categories.books-category-section .books-cat-ic {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}
#books-shelf-categories.books-category-section .books-cat-ic svg {
  width: 26px;
  height: 26px;
  display: block;
}
#books-shelf-categories.books-category-section .books-cat-label {
  display: block;
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.28;
  color: #1c2328;
  max-width: 10em;
  letter-spacing: -.01em;
}
#books-shelf-categories.books-category-section .books-cat-card:hover {
  transform: translateY(-2px);
  border-color: #d7e3e3;
  box-shadow: 0 14px 32px rgba(28, 35, 40, .08);
  color: #1c2328;
}
#books-shelf-categories.books-category-section .books-cat-dots {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 4px;
  min-height: 10px;
}
#books-shelf-categories.books-category-section .books-cat-dot {
  width: 7px;
  height: 7px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: #d5dee3;
  cursor: pointer;
}
#books-shelf-categories.books-category-section .books-cat-dot.is-active {
  background: #2a6f70;
  width: 18px;
  border-radius: 99px;
}

/* Scholar ticker — Maktabah-style marquee */
#books-scholar-ticker.books-scholar-ticker {
  margin: 32px 0 36px;
  overflow: hidden;
  border-top: 1px solid #eef2f4;
  border-bottom: 1px solid #eef2f4;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
#books-scholar-ticker.books-scholar-ticker[hidden] { display: none !important; }
#books-scholar-ticker.books-scholar-ticker .books-scholar-ticker-track {
  display: flex;
  width: max-content;
  align-items: center;
  animation: booksScholarTicker 180s linear infinite;
}
#books-scholar-ticker.books-scholar-ticker:hover .books-scholar-ticker-track { animation-play-state: paused; }
#books-scholar-ticker.books-scholar-ticker .books-scholar-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 4px 16px 0;
  white-space: nowrap;
  color: #1f5556;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
#books-scholar-ticker.books-scholar-ticker .books-scholar-ticker-item .books-gold-star {
  margin: 0 2px 0 18px;
  opacity: .95;
  flex: 0 0 auto;
}
@keyframes booksScholarTicker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (max-width: 1100px) {
  #books-shelf-categories.books-category-section .books-cat-rail { --books-cat-show: 4; }
  #books-shelf-categories.books-category-section .books-cat-page {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  #books-shelf-categories.books-category-section .books-category-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  #books-shelf-categories.books-category-section .books-cat-rail { --books-cat-show: 2; }
  #books-shelf-categories.books-category-section .books-cat-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #books-shelf-categories.books-category-section .books-cat-card { height: 200px; }
  #books-scholar-ticker.books-scholar-ticker .books-scholar-ticker-item { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  #books-shelf-categories.books-category-section .books-cat-card,
  #books-shelf-categories.books-category-section .books-cat-page { transition: none; }
  #books-scholar-ticker.books-scholar-ticker .books-scholar-ticker-track { animation: none; }
  #books-shelf-continue.books-continue-section .books-continue-pbar-fill,,
#books-mr-shelf-continue.books-continue-section .books-continue-pbar-fill,
  #books-shelf-continue.books-continue-section .books-continue-resume,,
#books-mr-shelf-continue.books-continue-section .books-continue-resume,
  #books-shelf-continue.books-continue-section .books-continue-chapter ,
#books-mr-shelf-continue.books-continue-section .books-continue-chapter { transition: none; }
}

/* Qawl-style scholars pages (Authors) */
body.books-qawl-scholars-active #books-section-hero { display: none !important; }
body.books-qawl-scholars-active .books-page.books-qawl-scholars { padding: 0; margin: 0; max-width: none; }
body.books-qawl-scholars-active .books-library-shell { padding-top: 0; padding-bottom: 0; background: #fff; }
.books-qawl-scholars {
  --ink: var(--books-ink);
  --muted: var(--books-muted);
  --faint: var(--books-text-faint);
  --line: var(--books-line);
  --teal: var(--books-teal);
  --teal-dark: var(--books-primary-hover);
  color: var(--ink);
  background: #fff;
}
.books-qawl-scholars a {
  color: inherit;
  text-decoration: none;
}
.books-qawl-scholars .qawl-wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.books-qawl-scholars .hero { background: #fff; border-bottom: 1px solid var(--line); }
.books-qawl-scholars .hero-home {
  min-height: calc(100svh - 176px); min-height: calc(100dvh - 176px); box-sizing: border-box;
  display: grid; place-items: center; text-align: center; padding: 64px 24px 48px;
  background-color: #fff; background-image: var(--hero-bg); background-size: cover;
  background-position: center; background-repeat: no-repeat;
}
.books-qawl-scholars .hero-inner { width: min(720px, 100%); }
.books-qawl-scholars .hero-kicker { margin: 0 0 16px; color: var(--teal); letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; }
.books-qawl-scholars .hero-home .crumb {
  margin: 0 0 14px; color: var(--muted); font-size: .92rem; letter-spacing: .02em;
}
.books-qawl-scholars .hero-home .crumb a { color: inherit; text-decoration: none; }
.books-qawl-scholars .hero-home .crumb a:hover { color: var(--teal); }
.books-qawl-scholars .hero-home h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.12; letter-spacing: -.03em; color: var(--ink); font-weight: 400; }
.books-qawl-scholars .lead { margin: 14px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.5; }
.books-qawl-scholars .search-dock { width: min(720px, 100%); margin: 28px auto 0; }
.books-qawl-scholars .search-sheet { display: none; }
.books-qawl-scholars .qawl-search {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 7px 7px 7px 22px;
  background: #fff; border: 1px solid rgba(28,35,40,.06); border-radius: 999px;
  box-shadow: 0 16px 50px rgba(28,35,40,.08); text-align: start;
}
.books-qawl-scholars .qawl-search input { border: 0; outline: 0; background: transparent; min-width: 0; padding: 12px 0; color: var(--ink); font-size: 1.02rem; }
.books-qawl-scholars .qawl-search button { border: 0; background: var(--teal); color: #fff; border-radius: 999px; padding: 0 22px; min-height: 46px; cursor: pointer; }
.books-qawl-scholars .qawl-search button:hover { background: var(--teal-dark); }
.books-qawl-scholars .section { padding: 28px 0 56px; }
.books-qawl-scholars .section-split { border-top: 1px solid var(--line); }
.books-qawl-scholars .section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.books-qawl-scholars .section-head h2 { margin: 0; font-size: 1.45rem; font-weight: 400; color: var(--ink); }
.books-qawl-scholars .section-head a { color: var(--teal); text-decoration: none; }
.books-qawl-scholars .section-head-center { display: block; text-align: center; margin-bottom: 22px; }
.books-qawl-scholars .section-head-center h2 { margin: 0; }
.books-qawl-scholars #see-all .section-head-center { margin-bottom: 40px; }
.books-qawl-scholars .rail { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.books-qawl-scholars .rail.rail-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.books-qawl-scholars .rail.rail-2 { grid-template-columns: 1fr 1fr; max-width: 720px; margin-left: auto; margin-right: auto; }
.books-qawl-scholars .school-card, .books-qawl-scholars .field-card {
  display: block; border: 1px solid var(--line); border-radius: 18px; background: #fff;
  padding: 22px 18px; min-height: 132px; transition: border-color .16s;
  color: inherit; text-decoration: none;
}
.books-qawl-scholars .school-card:hover, .books-qawl-scholars .field-card:hover { border-color: #cfd8da; }
.books-qawl-scholars .school-card b, .books-qawl-scholars .field-card b {
  display: block; font-size: 1.12rem; font-weight: 400; color: var(--ink); text-decoration: none;
}
.books-qawl-scholars .ar {
  display: block; color: var(--teal); font-size: 1.02rem; margin-top: 2px;
  text-align: right; unicode-bidi: isolate; text-decoration: none;
}
.books-qawl-scholars .meta { display: block; color: var(--muted); font-size: .92rem; margin-top: 6px; text-decoration: none; }
.books-qawl-scholars .qf-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.books-qawl-scholars .qf-person {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 220px; flex: 0 0 220px; background: #fff; border: 1px solid var(--line); border-radius: 22px;
  padding: 22px 16px 18px; box-shadow: 0 10px 28px rgba(28,35,40,.045); text-decoration: none; color: inherit;
}
.books-qawl-scholars .qf-person:hover { border-color: #d7e3e3; }
.books-qawl-scholars .qf-avatar {
  width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center;
  background: #f6f7f8; color: var(--teal); font-size: 1.85rem; overflow: hidden;
}
.books-qawl-scholars .qf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.books-qawl-scholars .qf-person b { margin-top: 12px; font-size: 1.05rem; line-height: 1.25; font-weight: 400; color: var(--ink); }
.books-qawl-scholars .qf-person .ar { text-align: center; }
.books-qawl-scholars .mono { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #f6f7f8; color: var(--teal); font-size: 1.2rem; }
.books-qawl-scholars .name-row {
  display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.books-qawl-scholars .name-row b { display: block; font-size: 1.08rem; line-height: 1.25; font-weight: 400; color: var(--ink); }
.books-qawl-scholars .name-row:hover b { color: var(--teal); }
.books-qawl-scholars .az { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 8px; }
.books-qawl-scholars .az-center { justify-content: center; }
.books-qawl-scholars .az a { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); text-decoration: none; }
.books-qawl-scholars .az a.has { color: var(--ink); background: #f6f7f8; }
.books-qawl-scholars .az a.off { opacity: .28; pointer-events: none; }
.books-qawl-scholars .az a:hover { color: var(--teal); }
.books-qawl-scholars .letter { margin: 28px 0 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); font-weight: 400; }
.books-qawl-scholars .empty { padding: 28px 0 8px; color: var(--muted); }
.books-qawl-scholars .hero-home:not(.hero-library) + .search-sheet + [data-scholar-browse],
.books-qawl-scholars .hero-home:not(.hero-library) + [data-scholar-browse],
.books-qawl-scholars .hero-home:not(.hero-library) + .search-sheet + .section,
.books-qawl-scholars .hero-home:not(.hero-library) + .section {
  margin-top: -36px; background: #fff; border-radius: 28px 28px 0 0;
  box-shadow: 0 -18px 48px rgba(28,35,40,.1); position: relative; z-index: 4; padding-top: 18px;
}
.books-qawl-scholars .sp-page { background: #fff; color: #1c2328; }
.books-qawl-scholars .sp-page .qawl-wrap { width: min(1120px, calc(100% - 64px)); }
.books-qawl-scholars .sp-hero {
  position: relative; overflow: hidden; color: #f4efe6;
  height: calc(100svh - 76px); height: calc(100dvh - 76px);
  min-height: 420px; display: flex; align-items: center;
  background-color: #1a2e26; background-image: var(--hero-bg);
  background-size: cover; background-position: center 40%;
  padding: 28px 0 36px; box-sizing: border-box;
}
.books-qawl-scholars .sp-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(16,28,24,.88) 0%, rgba(16,28,24,.62) 46%, rgba(16,28,24,.28) 100%);
}
.books-qawl-scholars .sp-hero .qawl-wrap { position: relative; z-index: 1; }
.books-qawl-scholars .sp-hero .crumb {
  color: rgba(244,239,230,.72); margin: 0 0 18px;
  font-size: .92rem; letter-spacing: .04em;
}
.books-qawl-scholars .sp-hero .crumb a {
  color: inherit; text-decoration: none;
}
.books-qawl-scholars .sp-hero .crumb a:hover { color: #e7d7b0; }
.books-qawl-scholars .sp-hero h1 { margin: 0; max-width: 16ch; font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.1; letter-spacing: -.03em; color: #f7f1e4; font-weight: 400; }
.books-qawl-scholars .sp-hero-meta { margin: 16px 0 0; color: rgba(244,239,230,.78); letter-spacing: .04em; }
.books-qawl-scholars .sp-hero-lead { margin: 20px 0 0; max-width: 54ch; color: rgba(244,239,230,.86); font-size: 1.05rem; line-height: 1.6; }
.books-qawl-scholars .sp-hero-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.books-qawl-scholars .sp-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 0; background: #c4a36a; color: #1a2e26; text-decoration: none;
}
.books-qawl-scholars .sp-btn svg { width: 16px; height: 16px; }
.books-qawl-scholars .sp-btn:hover { background: #d4b57c; color: #1a2e26; }
.books-qawl-scholars .sp-btn-ghost {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 1px solid rgba(244,239,230,.4); background: transparent; color: #f4efe6; text-decoration: none;
}
.books-qawl-scholars .sp-btn-ghost svg { width: 16px; height: 16px; }
.books-qawl-scholars .sp-btn-ghost:hover { border-color: #e7d7b0; color: #e7d7b0; }
.books-qawl-scholars .sp-stats { background: #fff; border-bottom: 1px solid #eceff1; }
.books-qawl-scholars .sp-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding: 28px 0; }
.books-qawl-scholars .sp-stat { display: flex; align-items: center; gap: 14px; padding: 4px 20px; border-left: 1px solid #eceff1; }
.books-qawl-scholars .sp-stat:first-child { border-left: 0; padding-left: 0; }
.books-qawl-scholars .sp-stat-ico { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #f4f6f6; color: #1a2e26; }
.books-qawl-scholars .sp-stat-ico svg { width: 18px; height: 18px; }
.books-qawl-scholars .sp-stat b { display: block; font-size: 1.55rem; line-height: 1.05; letter-spacing: -.03em; color: #1c2328; font-weight: 400; }
.books-qawl-scholars .sp-stat span { color: #6b7780; font-size: .9rem; }
.books-qawl-scholars .sp-tabs-wrap { background: #fff; border-bottom: 1px solid #eceff1; position: sticky; top: var(--books-header-height); z-index: 20; }
.books-qawl-scholars .sp-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 36px; padding: 4px 0 0; }
.books-qawl-scholars .sp-tabs a, .books-qawl-scholars .sp-tabs button {
  border: 0; background: transparent; color: #6b7780; padding: 16px 2px 14px;
  border-bottom: 2px solid transparent; font-size: 1.08rem; text-decoration: none; cursor: pointer;
}
.books-qawl-scholars .sp-tabs a:hover, .books-qawl-scholars .sp-tabs button:hover { color: #1c2328; }
.books-qawl-scholars .sp-tabs a.on, .books-qawl-scholars .sp-tabs button.on { color: #1c2328; border-bottom-color: #b0894f; }
.books-qawl-scholars .sp-body { padding: 28px 0 72px; background: #fff; }
.books-qawl-scholars .sp-about h2, .books-qawl-scholars .sp-panel h2, .books-qawl-scholars .sp-rail-head h2 {
  margin: 0 0 14px; font-size: clamp(1.55rem, 2.2vw, 1.95rem); color: #1c2328; letter-spacing: -.03em; font-weight: 400;
}
.books-qawl-scholars .sp-about p, .books-qawl-scholars .sp-panel p { margin: 0 0 14px; color: #4a555c; font-size: 1.05rem; line-height: 1.7; }
.books-qawl-scholars .sp-intro { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.82fr); gap: 40px 56px; align-items: start; }
.books-qawl-scholars .sp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 18px; margin: 8px 0 18px; max-width: 72ch; }
.books-qawl-scholars .sp-facts div { padding: 10px 0; border-top: 1px solid #eceff1; }
.books-qawl-scholars .sp-facts span { display: block; color: #8a959c; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.books-qawl-scholars .sp-facts b { display: block; margin-top: 4px; font-size: .98rem; font-weight: 600; }
.books-qawl-scholars .sp-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.books-qawl-scholars .sp-cats a { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: #eef3f0; color: #1a2e26; font-size: .88rem; font-weight: 600; text-decoration: none; }
.books-qawl-scholars .sp-cats a:hover { background: #1a2e26; color: #e7d7b0; }
.books-qawl-scholars .sp-quote {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: center;
  margin: 8px 0 8px; padding: 18px 20px; border-radius: 14px; background: #f7f6f3; border: 0; border-left: 3px solid #b0894f;
}
.books-qawl-scholars .sp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.books-qawl-scholars .sp-field {
  display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 16px; align-items: start;
  padding: 18px; border-radius: 16px; background: #fff; border: 1px solid #eceff1;
  box-shadow: 0 8px 24px rgba(28,35,40,.035);
}
.books-qawl-scholars .sp-field-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #1a2e26; color: #e7d7b0; }
.books-qawl-scholars .sp-field b { display: block; margin: 2px 0 6px; font-size: 1.08rem; font-weight: 400; }
.books-qawl-scholars .sp-field span { color: #6b7780; font-size: .95rem; line-height: 1.5; }
.books-qawl-scholars .sp-block { margin-top: 40px; }
.books-qawl-scholars .sp-section { margin-top: 48px; }
.books-qawl-scholars .sp-rail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0 0 22px; }
.books-qawl-scholars .sp-rail-head a { color: #b0894f; font-size: .98rem; text-decoration: none; }
.books-qawl-scholars .books-scholar-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.books-qawl-scholars .books-scholar-works-grid .books-card {
  margin: 0;
  border: 1px solid #eceff1;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(28,35,40,.04);
  cursor: pointer;
}
.books-qawl-scholars .books-scholar-works-grid .books-card-cover {
  height: 148px;
  background: #f4f6f7;
}
.books-qawl-scholars .books-scholar-works-grid .books-card-cover img,
.books-qawl-scholars .books-scholar-works-grid .books-card-cover-placeholder {
  width: 100%; height: 100%; object-fit: cover;
}
.books-qawl-scholars .books-scholar-works-grid .books-card-body { padding: 16px 16px 18px; }
.books-qawl-scholars .books-scholar-works-grid .books-card-title {
  margin: 0 0 4px; font-size: 1.12rem; line-height: 1.28; font-weight: 600; color: #1c2328;
}
.books-qawl-scholars .books-scholar-works-grid .books-card-author {
  margin: 0; color: #6b7780; font-size: .92rem;
}
.books-qawl-scholars .books-scholar-works-grid .books-card-desc,
.books-qawl-scholars .books-scholar-works-grid .books-card-meta,
.books-qawl-scholars .books-scholar-works-grid .books-card-read,
.books-qawl-scholars .books-scholar-works-grid .books-card-cover-overlay {
  display: none;
}
.books-qawl-scholars .sp-timeline { list-style: none; margin: 0; padding: 4px 0 0; }
.books-qawl-scholars .sp-timeline li { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 18px; padding: 0 0 26px; position: relative; }
.books-qawl-scholars .sp-timeline time { color: #b0894f; font-size: .95rem; }
.books-qawl-scholars .sp-timeline span { color: #4a555c; line-height: 1.55; }
.books-qawl-scholars .sp-empty { color: #6b7780; }
@media (max-width: 900px) {
  .books-qawl-scholars .qawl-wrap, .books-qawl-scholars .sp-page .qawl-wrap { width: calc(100% - 32px); }
  .books-qawl-scholars .rail.rail-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .books-qawl-scholars .sp-intro { grid-template-columns: 1fr; }
  .books-qawl-scholars .sp-fields { grid-template-columns: 1fr; }
  .books-qawl-scholars .name-row { grid-template-columns: 40px minmax(0,1fr); }
  .books-qawl-scholars .name-row .meta { grid-column: 2; }
}
@media (max-width: 640px) {
  .books-qawl-scholars .hero-home {
    position: relative;
    min-height: 100svh; min-height: 100dvh;
    margin-top: calc(var(--books-header-height, 78px) * -1 + 22px);
    display: flex; align-items: center; justify-content: center;
    padding: 84px 20px calc(108px + env(safe-area-inset-bottom, 0px));
    background-size: cover;
    background-position: 50% 42%;
    overflow: hidden;
  }
  .books-qawl-scholars .hero-home::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: linear-gradient(180deg, rgba(255,248,238,.42) 0%, rgba(255,248,238,.08) 38%, rgba(255,248,238,.16) 58%, rgba(255,248,238,.78) 100%);
  }
  .books-qawl-scholars .hero-inner { position: relative; z-index: 1; width: 100%; }
  .books-qawl-scholars .hero-home h1 { font-size: 2.05rem; line-height: 1.15; letter-spacing: -.02em; }
  .books-qawl-scholars .hero-scholars .search-dock { display: none; }
  .books-qawl-scholars .search-sheet { display: block; position: relative; z-index: 5; margin-top: -44px; background: #fff; border-radius: 32px 32px 0 0; box-shadow: 0 -18px 48px rgba(28,35,40,.08); padding: 24px 0 22px; }
  .books-qawl-scholars .rail.rail-2, .books-qawl-scholars .rail.rail-4 { grid-template-columns: 1fr; }
  .books-qawl-scholars .qf-person { width: auto; flex: 1 1 calc(50% - 20px); min-width: 160px; }
  .books-qawl-scholars .sp-hero {
    height: auto; max-height: none;
    min-height: 100svh; min-height: 100dvh;
    margin-top: calc(var(--books-header-height, 78px) * -1 + 22px);
    padding: 92px 0 calc(100px + env(safe-area-inset-bottom, 0px));
    align-items: flex-end;
    background-position: 8% 46%;
  }
  .books-qawl-scholars .sp-hero-lead { display: none; }
  .books-qawl-scholars .sp-hero-acts { flex-direction: column; align-items: stretch; gap: 8px; }
}

/* =====================================================================
   Books library — Maktabah catalogue chrome + book chips
   ===================================================================== */
.books-catpage {
  background: #fff;
  color: #1c2328;
  padding: 0 0 64px;
}
.books-cat-wrap {
  width: min(1360px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0;
}
.books-cat-search-dock {
  position: relative;
  z-index: 8;
  margin: 27px auto 5px;
  max-width: 1120px;
}
.books-cat-search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid rgba(28,35,40,.06);
  border-radius: 999px;
  padding: 7px 7px 7px 22px;
  box-shadow: 0 16px 50px rgba(28,35,40,.10);
  position: relative;
}
.books-cat-search-pill .mk-search-ic {
  width: 20px; height: 20px; color: #8a959c; flex: 0 0 auto; display: grid; place-items: center;
}
.books-cat-search-pill .mk-search-ic svg { width: 18px; height: 18px; }
.books-cat-search-pill input {
  flex: 1; border: 0; outline: none; background: transparent; min-width: 0;
  font: inherit; font-size: 1.08rem; color: #1c2328; padding: 12px 4px;
}
.books-cat-search-pill input::placeholder { color: #9aa4ab; }
.books-cat-search-pill .mk-search-go {
  border: 0; background: #2a6f70; color: #fff; border-radius: 12px;
  min-height: 42px; padding: 0 18px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.books-cat-search-pill .books-search-clear {
  border: 0; background: transparent; color: #8a959c; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; line-height: 1;
}
.books-cat-search-pill .books-search-suggestions {
  position: absolute; left: 18px; right: 18px; top: calc(100% + 8px);
  z-index: 30; background: #fff; border: 1px solid #eceff1; border-radius: 16px;
  box-shadow: 0 18px 40px rgba(28,35,40,.12); max-height: 320px; overflow: auto;
}
.books-cat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0,1fr);
  gap: 22px;
  align-items: start;
  padding: 40px 0 48px;
}
.books-catpage .mk-filters {
  background: #fff; border: 1px solid #eceff1; border-radius: 22px; padding: 18px 18px 10px;
  box-shadow: 0 10px 28px rgba(28,35,40,.045); position: sticky; top: calc(var(--books-header-height) + 24px);
}
.books-cat-main {
  background: #fff; border: 1px solid #eceff1; border-radius: 22px; padding: 26px 26px 20px;
  box-shadow: 0 10px 28px rgba(28,35,40,.045);
}
.books-catpage .mk-filters-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 12px;
}
.books-catpage .mk-filters-top h2 { margin: 0; font-size: 1.18rem; font-weight: 600; letter-spacing: -.02em; }
.books-catpage .mk-filters-clear {
  border: 0; background: transparent; color: #2a6f70; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: .92rem; font-weight: 500; padding: 0;
}
.books-catpage .mk-filters-clear svg { width: 14px; height: 14px; }
.books-catpage .mk-filter { border-top: 1px solid #eef2f4; }
.books-catpage .mk-filter-head {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent;
  padding: 13px 8px; cursor: pointer; font: inherit; font-size: 1rem; font-weight: 500;
  color: #1c2328; text-align: left;
}
.books-catpage .mk-filter-ic { width: 16px; height: 16px; color: #2a6f70; display: grid; place-items: center; flex: 0 0 auto; }
.books-catpage .mk-filter-ic svg { width: 16px; height: 16px; }
.books-catpage .mk-filter-caret { margin-left: auto; width: 14px; height: 14px; color: #8a959c; transition: transform .16s ease; }
.books-catpage .mk-filter-caret svg { width: 14px; height: 14px; }
.books-catpage .mk-filter.open .mk-filter-caret { transform: rotate(180deg); }
.books-catpage .mk-filter-body { display: none; padding: 0 8px 12px; }
.books-catpage .mk-filter.open .mk-filter-body { display: block; }
.books-catpage .mk-filter-scroll { max-height: 220px; overflow: auto; }
.books-catpage .mk-check {
  display: flex; align-items: center; gap: 10px; padding: 7px 0; margin: 0;
  color: #3d484e; font-size: .95rem; cursor: pointer; font-weight: 500;
}
.books-catpage .mk-check input { accent-color: #2a6f70; width: 15px; height: 15px; flex: 0 0 auto; }
.books-catpage .mk-check .n { margin-left: auto; color: #8a959c; font-size: .78rem; font-weight: 500; }
.books-catpage .mk-filter-empty { color: #8a959c; font-size: .92rem; padding: 4px 0 8px; }
.books-catpage .mk-cat-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 0 0 24px; padding: 4px 0 22px; border-bottom: 1px solid #eef2f4;
}
.books-catpage .mk-cat-head h2 {
  margin: 0; font-size: clamp(1.2rem,1.7vw,1.45rem); font-weight: 600; letter-spacing: -.02em;
  color: #1c2328; line-height: 1.3; padding-top: .08em;
}
.books-cat-lead { margin: 6px 0 0; color: #7a868e; font-size: .98rem; font-weight: 500; }
.books-catpage .mk-cat-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.books-catpage .mk-cat-sort { display: flex; align-items: center; gap: 8px; color: #7a868e; font-size: .95rem; }
.books-catpage .mk-cat-select {
  appearance: none; -webkit-appearance: none; min-height: 40px; min-width: 132px;
  border: 1px solid #eceff1; border-radius: 11px; background: #fff; color: #1c2328;
  font: inherit; font-size: .98rem; font-weight: 500; padding: 8px 34px 8px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%232a6f70' stroke-width='1.4' d='M1.5 1.5L6 6l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.books-catpage .mk-cat-views {
  display: inline-flex; border: 1px solid #eceff1; border-radius: 12px; overflow: hidden; background: #fff;
}
.books-catpage .mk-cat-view {
  border: 0; background: transparent; color: #7a868e; cursor: pointer; min-width: 40px; min-height: 40px;
  display: grid; place-items: center; padding: 0 11px;
}
.books-catpage .mk-cat-view svg { width: 16px; height: 16px; }
.books-catpage .mk-cat-view.on { color: #2a6f70; box-shadow: inset 0 0 0 1.5px #2a6f70; border-radius: 11px; background: #fff; }

/* 3-col grid matching Maktabah catalogue tile width */
.books-cat-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.books-cat-grid.is-list { grid-template-columns: 1fr; gap: 12px; }
.books-cat-grid > .mk-cat-empty,
.books-cat-grid > .books-no-results,
.books-cat-grid > .books-empty { grid-column: 1 / -1; }

/* Longer chips + Maktabah title size (1.12rem) */
.books-cat-grid .books-card {
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(28,35,40,.045);
  animation: none;
  min-width: 0;
  min-height: 292px;
}
.books-cat-grid .books-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(28,35,40,.08);
}
.books-cat-grid .books-card-cover {
  aspect-ratio: 16 / 10;
}
.books-cat-grid .books-card-cover-placeholder svg { width: 36px; height: 36px; }
.books-cat-grid .books-card-pill,
.books-cat-grid .books-card-tags,
.books-cat-grid .books-card-badges,
.books-cat-grid .books-card-tag,
.books-cat-grid .books-card-badge { display: none !important; }
.books-cat-grid .books-card-read {
  font-size: 11px; padding: 6px 10px;
}
.books-cat-grid .books-card-body {
  padding: 18px 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 148px;
}
.books-cat-grid .books-card-title {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.22;
  letter-spacing: -.01em;
  color: #1c2328;
  -webkit-line-clamp: 3;
}
.books-cat-grid .books-card-author {
  font-size: .95rem;
  font-weight: 500;
  margin: 0 0 8px;
  color: #7a868e;
}
.books-cat-grid .books-card-desc {
  font-size: .92rem;
  line-height: 1.45;
  margin: 0;
  color: #7a868e;
  -webkit-line-clamp: 2;
}
.books-cat-grid .books-card-meta { margin-top: auto; padding-top: 10px; }
.books-cat-grid .books-card-pct { font-size: 11px; }

/* List view: horizontal chip row */
.books-cat-grid.is-list .books-card {
  flex-direction: row;
  align-items: stretch;
  min-height: 128px;
}
.books-cat-grid.is-list .books-card-cover {
  width: 148px;
  flex: 0 0 148px;
  aspect-ratio: auto;
  min-height: 128px;
}
.books-cat-grid.is-list .books-card-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
}
.books-cat-grid.is-list .books-card-desc { -webkit-line-clamp: 1; margin-bottom: 0; }
.books-cat-grid.is-list .books-card-title { -webkit-line-clamp: 2; }

.books-catpage .mk-cat-empty {
  padding: 56px 16px 72px; text-align: center; grid-column: 1 / -1;
}
.books-catpage .mk-cat-empty h3 { margin: 0 0 8px; font-size: 1.45rem; font-weight: 600; color: #1c2328; }
.books-catpage .mk-cat-empty p { margin: 0 auto 18px; max-width: 42ch; color: #7a868e; font-size: 1.05rem; }
.books-catpage .mk-pager {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 40px 0 8px; position: relative; min-height: 42px;
}
.books-catpage .mk-pager-btn {
  min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid #eceff1; border-radius: 10px;
  background: #fff; color: #5a656d; font: inherit; font-size: .95rem; cursor: pointer;
}
.books-catpage .mk-pager-btn.on { border-color: #2a6f70; color: #2a6f70; font-weight: 600; }
.books-catpage .mk-pager-btn:disabled { opacity: .4; cursor: default; }
.books-catpage .mk-pager-meta { position: absolute; right: 0; color: #8a959c; font-size: .92rem; }
.books-catpage .books-loading-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
@media (max-width: 1100px) {
  .books-cat-wrap { width: calc(100% - 48px); }
}
@media (max-width: 900px) {
  .books-cat-layout { grid-template-columns: 1fr; gap: 22px; padding: 32px 0 36px; }
  .books-catpage .mk-filters { position: static; }
  .books-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books-catpage .books-loading-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books-catpage .mk-pager-meta { position: static; width: 100%; text-align: center; margin-top: 10px; }
}
@media (max-width: 620px) {
  .books-cat-wrap { width: calc(100% - 32px); }
  .books-cat-grid { grid-template-columns: 1fr; }
  .books-catpage .books-loading-cards { grid-template-columns: 1fr; }
  .books-cat-search-dock { margin: 18px auto 5px; }
  .books-cat-main { padding: 20px 16px 16px; border-radius: 18px; }
  .books-cat-grid.is-list .books-card-cover { width: 112px; flex-basis: 112px; min-height: 96px; }
}
/* Detail info mockup polish (safe appendix) */
.books-detail-hero::before,
.books-detail-hero::after { display: none !important; }
.books-detail-hero {
  border-radius: 8px;
  border: 1px solid rgba(26, 42, 54, 0.08);
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 40, 50, 0.1);
}
.books-detail-hero-img { aspect-ratio: 16 / 10 !important; }
.books-detail-hero-subtitle {
  margin: 0 0 22px;
  font-style: normal;
  color: #6b7a86;
}
.books-detail-hero-author {
  gap: 12px;
  padding: 0 0 22px;
  margin: 0;
  color: #2f4a4a;
}
.books-detail-author-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(42, 111, 112, 0.28);
  color: #2a6f70;
  flex-shrink: 0;
}
.books-detail-author-icon { width: 14px; height: 14px; color: inherit; }
.books-detail-facts {
  gap: 0;
  margin: 0 0 8px;
  padding: 22px 0 0;
  border-top: 1px solid rgba(26, 42, 54, 0.1);
  border-bottom: none;
}
.books-detail-fact {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0 28px;
  margin: 0;
  border-right: 1px solid rgba(26, 42, 54, 0.12);
}
.books-detail-fact:first-child { padding-left: 0; }
.books-detail-fact:last-child { border-right: none; padding-right: 0; }
.books-detail-fact-icon {
  width: 28px;
  height: 28px;
  margin-top: 0;
  color: #2a6f70;
  align-items: center;
  justify-content: center;
}
.books-detail-fact-icon svg { width: 20px; height: 20px; }
.books-detail-fact-icon-ain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid #2a6f70;
  font-family: 'Amiri', 'EB Garamond', Georgia, serif;
  font-size: 15px;
  line-height: 1;
  color: #2a6f70;
}
.books-detail-fact-label { display: none !important; }
.books-detail-fact-text { display: flex; flex-direction: column; gap: 2px; }
.books-detail-fact-value { font-weight: 400; color: #1f3d3d; }
.books-detail-fact-sub {
  font-size: 13px;
  color: #7a8794;
  font-weight: 400;
  font-family: var(--books-font-display);
  line-height: 1.3;
}
.books-detail-cta-row {
  margin: 0;
  padding: 26px 0 22px;
  border-top: 1px solid rgba(26, 42, 54, 0.1);
}
.books-detail-primary-cta {
  border-radius: 999px;
  font-weight: 400;
  box-shadow: none;
  min-height: 48px;
  padding: 0 28px;
}
.books-detail-primary-cta:hover { transform: none; box-shadow: none; }
.books-detail-progress-row {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  max-width: 320px;
}
.books-detail-progress-bar { min-width: 100px; }
.books-detail-lastopened { display: none !important; }
.books-detail-secondary-actions {
  gap: 0;
  margin-top: 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(26, 42, 54, 0.1);
}
.books-detail-action-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  margin: 0 18px;
  background: rgba(26, 42, 54, 0.16);
}
.books-detail-text-action svg { color: #2a6f70; }
.books-detail-start-link { margin-left: auto; opacity: 0.55; font-size: 14px; }
.books-similar-card-cover { aspect-ratio: 16 / 10 !important; }
.books-similar-card-title { font-weight: 400 !important; }
#books-detail-view,
body:has(#books-detail-view:not([hidden])) {
  background: #ffffff !important;
}

/* Detail page: white bg + similar carousel (homepage style) */
#books-detail-view,
body:has(#books-detail-view:not([hidden])),
body:has(#books-detail-view:not([hidden]))::before,
body:has(#books-detail-view:not([hidden])) .books-portal {
  background: #ffffff !important;
}
#books-detail-view .books-similar-section {
  margin-top: 48px;
  padding-top: 8px;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
#books-detail-view .books-similar-section[hidden] { display: none !important; }
#books-detail-view .books-similar-section .books-recent-head {
  margin-bottom: 22px;
}
#books-detail-view .books-similar-section .books-recent-title {
  font-weight: 400 !important;
}
#books-detail-view .books-similar-section .books-recent-page b {
  font-weight: 400;
}

/* Detail mockup lock v223 */
#books-detail-view,
body:has(#books-detail-view:not([hidden])),
body:has(#books-detail-view:not([hidden]))::before,
body:has(#books-detail-view:not([hidden])) .books-portal {
  background: #ffffff !important;
}
.books-detail-title-ornament {
  display: block !important;
  width: 52px;
  height: 1px;
  margin: 0 0 18px;
  background: #c9a227;
  position: relative;
}
.books-detail-title-ornament::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  background: #c9a227;
  transform: translate(-50%, -50%) rotate(45deg);
}
.books-detail-hero-title.books-detail-title-ar + .books-detail-title-ornament { margin-left: auto; }
.books-detail-fact { flex-direction: column !important; }
.books-detail-progress-text { display: inline-block !important; }
#books-detail-view .books-similar-section {
  display: block;
  margin-top: 56px;
  padding-top: 12px;
  background: transparent !important;
  box-shadow: none !important;
}
#books-detail-view .books-similar-section[hidden] { display: none !important; }

/* Detail white + progress v225 */
#books-detail-view,
body:has(#books-detail-view:not([hidden])),
body:has(#books-detail-view:not([hidden]))::before,
body:has(#books-detail-view:not([hidden])) .books-portal,
body:has(#books-detail-view:not([hidden])) .books-footer,
body:has(#books-detail-view:not([hidden])) .books-site-footer {
  background: #ffffff !important;
}
#books-detail-view .books-detail-progress-row:not([hidden]) {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center;
  gap: 8px !important;
  min-width: 160px;
  max-width: 240px;
  flex: 1 1 180px;
}
#books-detail-view .books-detail-progress-text {
  display: block !important;
  color: #3d4f5f !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  opacity: 1 !important;
  visibility: visible !important;
  order: 0;
}
#books-detail-view .books-detail-progress-bar {
  width: 100%;
  min-width: 140px;
  height: 4px !important;
  background: rgba(36, 95, 96, 0.18) !important;
}
#books-detail-view .books-detail-progress-fill {
  display: block !important;
  height: 100% !important;
  max-width: 100% !important;
  background: #245f60 !important;
}



/* Reader chrome v226 */


/* Centered title */
.books-reader-header-top {
  display: grid !important;
  grid-template-columns: minmax(72px, 1fr) minmax(0, 2.4fr) minmax(72px, 1fr);
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap !important;
}
.books-reader-header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.books-reader-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.books-reader-title {
  flex: none !important;
  grid-column: 2;
  text-align: center !important;
  justify-self: center;
  max-width: 100%;
  font-size: 16px !important;
  font-weight: 400 !important;
}
.books-reader-time-left {
  margin-left: 0 !important;
  font-size: 12px;
  white-space: nowrap;
}

/* White reading surface */
#books-reader-view,
#books-reader-view .books-reader-scroll,
#books-reader-view .books-reader-page-viewport,
#books-reader-view .books-reader-content {
  background: #ffffff !important;
}
body:has(#books-reader-view:not([hidden])) {
  background: #ffffff !important;
}

/* Shared side panels */
.books-reader-side-panel,
.books-annotations-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  z-index: 90;
  background: #ffffff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
}
.books-reader-side-panel[hidden],
.books-annotations-panel[hidden] { display: none !important; }
.books-reader-toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px 24px;
}
.books-reader-toc-item {
  display: block;
  width: 100%;
  text-align: start;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--books-text);
  cursor: pointer;
  line-height: 1.4;
}
.books-reader-toc-item:hover,
.books-reader-toc-item.is-active {
  background: rgba(36, 95, 96, 0.08);
  border-color: rgba(36, 95, 96, 0.18);
  color: #245f60;
}

/* Search sidebar body */
.books-search-panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 24px;
  min-height: 0;
  flex: 1;
}
.books-search-field-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--books-text-muted);
}
.books-search-bar { padding: 0; border: none; gap: 0; }
.books-search-bar .brs-input { width: 100%; }
.books-search-advanced {
  border: 1px solid var(--books-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fafafa;
}
.books-search-advanced summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--books-text);
  font-weight: 500;
}
.books-search-adv-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--books-text);
}
.books-search-count {
  font-size: 13px;
  color: var(--books-text-muted);
  padding: 0 2px;
}
.books-search-results {
  flex: 1;
  max-height: none !important;
  overflow-y: auto;
  border-top: 1px solid var(--books-border);
  margin: 0 -4px;
  padding-top: 8px;
}
.books-reader-search-panel { display: none !important; }

/* Settings centered modal */
.books-reader-settings-page {
  position: fixed !important;
  inset: 0 !important;
  z-index: 120 !important;
  background: transparent !important;
  overflow: hidden !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.books-reader-settings-page:not([hidden]) {
  display: flex !important;
}
.books-reader-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}
.books-reader-settings-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.books-reader-settings-inner {
  max-width: none !important;
  margin: 0 !important;
  padding: 22px 22px 18px !important;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.books-reader-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px !important;
}
.books-reader-settings-title { font-size: 20px !important; }
.books-reader-settings-sub { font-size: 13px !important; }
.books-reader-settings-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  flex-shrink: 0;
}
.books-reader-settings-close:hover { background: #e5e7eb; color: #0f172a; }
.books-reader-settings-tabs {
  margin-bottom: 16px !important;
  background: #f3f4f6 !important;
}
.books-reader-settings-section {
  margin-bottom: 12px !important;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
}
.books-reader-settings-panel { min-height: 0 !important; }
.books-reader-settings-done {
  margin-top: 8px;
  border-radius: 12px !important;
}
.books-reader-select,
.books-reader-font-btn,
.books-reader-line-btn {
  border-radius: 10px;
}

/* Bookmark marker at position */
.books-reader-bookmark-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(36, 95, 96, 0.12);
  color: #245f60;
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
}
.books-reader-bookmark-marker.is-floating {
  position: absolute;
  z-index: 5;
  left: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Reader progress % chip */
.books-reader-progress-wrap {
  position: relative;
}
.books-reader-progress-pct {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--books-text-muted);
  background: rgba(255,255,255,0.9);
  padding: 1px 6px;
  border-radius: 999px;
  pointer-events: none;
}


/* Reader polish v228 */
/* Larger chrome, non-pill tools */
.books-reader-header {
  top: 3px !important;
  padding: 0 20px !important;
  background: #ffffff !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: none !important;
}
.books-reader-header-top {
  display: grid !important;
  grid-template-columns: minmax(88px, 1fr) minmax(0, 2.6fr) minmax(88px, 1fr);
  align-items: center;
  gap: 12px !important;
  padding: 12px 0 10px !important;
  flex-wrap: nowrap !important;
}
.books-reader-header-left,
.books-reader-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.books-reader-header-left { justify-content: flex-start; }
.books-reader-header-right { justify-content: flex-end; }
.books-reader-back,
.books-reader-menu-btn {
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 12px !important;
  font-size: 20px !important;
  background: #fff !important;
}
.books-reader-title {
  grid-column: 2;
  justify-self: center;
  text-align: center !important;
  flex: none !important;
  max-width: 100%;
  margin: 0 !important;
  font-size: clamp(17px, 2.1vw, 22px) !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  color: #1a2a36 !important;
}
.books-reader-time-left {
  margin: 0 !important;
  font-size: 13px !important;
  color: #5a6b7c !important;
}

/* Flat tool links (no pills / no tray) */
.books-reader-header-tools {
  justify-content: center !important;
  gap: 4px 10px !important;
  padding: 8px 0 12px !important;
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  background: transparent !important;
  width: auto !important;
  margin: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 0 !important;
}
.books-reader-header-tools button {
  padding: 8px 10px !important;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: #5a6b7c !important;
  gap: 7px !important;
}
.books-reader-header-tools button:hover {
  background: rgba(36, 95, 96, 0.06) !important;
  color: #245f60 !important;
}
.books-reader-header-tools button.is-active {
  background: rgba(36, 95, 96, 0.1) !important;
  color: #245f60 !important;
  box-shadow: none !important;
}
.books-reader-header-tools .books-reader-tool-icon {
  width: 17px !important;
  height: 17px !important;
}
.books-reader-goto-bookmark { display: inline-flex !important; }

/* Progress */
.books-reader-progress-wrap.books-reader-progress-sticky,
.books-reader-progress-wrap {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 55 !important;
  height: 3px !important;
  background: rgba(36, 95, 96, 0.14) !important;
}
.books-reader-progress {
  height: 100% !important;
  background: #245f60 !important;
  border-radius: 0 !important;
  min-width: 0 !important;
}
.books-reader-progress-pct {
  position: fixed !important;
  top: 14px !important;
  right: 64px !important;
  z-index: 56 !important;
  transform: none !important;
  font-size: 12px !important;
  font-weight: 500;
  color: #245f60 !important;
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid rgba(36, 95, 96, 0.18);
  padding: 2px 8px !important;
  border-radius: 999px;
  pointer-events: none;
}

/* White reading surface + spacing */
.books-reader-scroll {
  padding-top: 132px !important;
  padding-bottom: 96px !important;
  background: #ffffff !important;
}
body.books-reader-page-mode .books-reader-scroll { padding-top: 132px !important; }
#books-reader-view,
#books-reader-view .books-reader-scroll,
#books-reader-view .books-reader-page-viewport,
#books-reader-view .books-reader-content,
body:has(#books-reader-view:not([hidden])) {
  background: #ffffff !important;
}
.books-reader-content {
  max-width: min(740px, calc(100% - 48px)) !important;
  padding: 32px 0 80px !important;
  background: #ffffff !important;
}

/* Arabic RTL */
.books-reader-content[dir="rtl"],
.books-reader-content.books-reader-is-arabic {
  direction: rtl !important;
  text-align: right !important;
}
.books-reader-content[dir="rtl"] h1,
.books-reader-content[dir="rtl"] h2,
.books-reader-content[dir="rtl"] h3,
.books-reader-content.books-reader-is-arabic h1,
.books-reader-content.books-reader-is-arabic h2,
.books-reader-content.books-reader-is-arabic h3 {
  text-align: center;
}
.books-reader-content[dir="rtl"] ul,
.books-reader-content[dir="rtl"] ol,
.books-reader-content.books-reader-is-arabic ul,
.books-reader-content.books-reader-is-arabic ol {
  padding-right: 1.5em;
  padding-left: 0;
}
.books-reader-toc-list[dir="rtl"] .books-reader-toc-item,
.books-search-panel-body[dir="rtl"] .brs-result,
.books-search-panel-body[dir="rtl"] .brs-input {
  text-align: right;
  direction: rtl;
}

/* Chapters list like search results */
.books-reader-toc-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 8px 0 24px !important;
}
.books-reader-toc-item {
  display: block !important;
  width: 100% !important;
  text-align: inherit;
  padding: 14px 20px !important;
  margin: 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-family: inherit;
  font-size: 15px !important;
  line-height: 1.45 !important;
  color: var(--books-text);
  cursor: pointer;
}
.books-reader-toc-item:hover,
.books-reader-toc-item.is-active {
  background: rgba(36, 95, 96, 0.06) !important;
  color: #245f60 !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

/* Search advanced layout */
.books-search-panel-body { gap: 14px !important; }
.books-search-advanced {
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  background: #f7f8f8 !important;
}
.books-search-advanced > summary {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #245f60 !important;
  cursor: pointer;
}
.books-search-adv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.books-search-adv-opt {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  margin: 0 !important;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 13px !important;
}
.books-search-adv-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.books-search-adv-label {
  font-size: 12px;
  color: #5a6b7c;
  font-weight: 500;
}
.books-search-adv-select {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
}
.brs-result {
  padding: 14px 8px 14px 4px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

/* Bookmark marker inline */
.books-reader-bookmark-marker {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 10px 0 !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  border-left: none !important;
  background: rgba(36, 95, 96, 0.12) !important;
  color: #245f60 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  width: fit-content;
  position: static !important;
  transform: none !important;
}
.books-reader-bookmark-marker.is-floating {
  position: static !important;
}

/* Settings modal cleaner */
.books-reader-settings-page:not([hidden]) {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px !important;
}
.books-reader-settings-dialog {
  width: min(480px, 100%) !important;
  max-height: min(780px, calc(100vh - 40px)) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  background: #fff !important;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25) !important;
  display: flex;
  flex-direction: column;
}
.books-reader-settings-inner {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.books-reader-settings-head {
  padding: 18px 20px 12px !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.books-reader-settings-title { font-size: 18px !important; margin: 0 0 4px !important; }
.books-reader-settings-sub { font-size: 13px !important; }
.books-reader-settings-tabs {
  margin: 12px 16px 0 !important;
  padding: 3px !important;
  background: #eef1f1 !important;
  border-radius: 12px !important;
  flex-shrink: 0;
}
.books-reader-settings-tab {
  padding: 8px 10px !important;
  font-size: 12.5px !important;
  border-radius: 9px !important;
}
.books-reader-settings-panel {
  padding: 12px 16px 8px !important;
  overflow-y: auto;
  flex: 1;
  min-height: 0 !important;
}
.books-reader-settings-section {
  margin-bottom: 8px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.07) !important;
  background: #fff !important;
  box-shadow: none !important;
}
.books-reader-settings-label {
  font-size: 12px !important;
  margin-bottom: 6px !important;
  color: #5a6b7c !important;
}
.books-reader-select {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f8fafa;
  font-family: inherit;
  font-size: 14px;
}
.books-reader-font-wrap,
.books-reader-line-wrap {
  background: #f8fafa !important;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px !important;
  padding: 3px;
}
.books-reader-font-btn,
.books-reader-line-btn {
  border-radius: 8px !important;
  padding: 7px 11px !important;
  font-size: 13px !important;
  background: transparent !important;
}
.books-reader-line-btn.is-active {
  background: #245f60 !important;
  color: #fff !important;
}
.books-reader-settings-more {
  margin: 4px 0 10px !important;
  padding: 8px 10px !important;
  border: 1px dashed rgba(15, 23, 42, 0.14) !important;
  border-radius: 12px !important;
  background: #fafbfb !important;
}
.books-reader-settings-more > summary {
  color: #245f60 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
}
.books-reader-settings-done {
  margin: 0 !important;
  border-radius: 0 !important;
  min-height: 48px;
  flex-shrink: 0;
}

/* Bottom nav */
.books-reader-nav-bar {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  background: #ffffff !important;
  gap: 12px !important;
}
.books-reader-nav-bar .books-reader-nav-prev,
.books-reader-nav-bar .books-reader-nav-next {
  min-height: 42px;
  padding: 0 18px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
}

/* TTS bar */
.books-reader-tts-bar {
  position: fixed !important;
  left: 50% !important;
  transform: translateX(-50%);
  bottom: 72px !important;
  z-index: 70 !important;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}



/* Settings redesign v229 */


.books-reader-settings-dialog {
  width: min(440px, calc(100vw - 24px)) !important;
  max-height: min(860px, calc(100vh - 28px)) !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28) !important;
}
.books-reader-settings-inner {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0;
  max-height: min(860px, calc(100vh - 28px));
  overflow: hidden !important;
  padding: 0 !important;
}
.books-reader-settings-head {
  padding: 20px 20px 14px !important;
  border-bottom: none !important;
}
.books-reader-settings-title {
  font-size: 20px !important;
  letter-spacing: -0.02em;
  color: #163033 !important;
}
.books-reader-settings-sub {
  color: #6b7c86 !important;
  font-size: 13px !important;
}
.books-reader-settings-close {
  width: 34px !important;
  height: 34px !important;
  border-radius: 999px !important;
  background: #f1f4f4 !important;
  border: none !important;
}

.rs-preview {
  margin: 0 16px 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7faf9 0%, #eef5f3 100%);
  border: 1px solid rgba(36, 95, 96, 0.12);
  display: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.rs-preview.is-on,
.rs-preview:not([hidden]) {
  display: block;
}
.rs-preview.is-on {
  opacity: 1;
  transform: translateY(0);
}
.rs-preview[hidden] {
  display: none !important;
  opacity: 0 !important;
}
.rs-preview-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7c86;
}
.rs-preview-sample {
  margin: 0;
  color: #1a2a36;
  font-size: 1.05rem;
  line-height: 1.7;
}
.rs-preview-ar {
  margin-top: 10px !important;
  font-family: 'Amiri', 'EB Garamond', Georgia, serif;
  font-size: 1.2rem;
  color: #245f60;
}

.books-reader-settings-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px !important;
  margin: 0 16px 8px !important;
  padding: 4px !important;
  background: #eef2f2 !important;
  border-radius: 14px !important;
  overflow: visible !important;
}
.books-reader-settings-tab {
  flex: none !important;
  border-radius: 10px !important;
  padding: 10px 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #61727a !important;
  background: transparent !important;
  box-shadow: none !important;
}
.books-reader-settings-tab.is-active {
  background: #fff !important;
  color: #245f60 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1) !important;
}

.books-reader-settings-panel {
  padding: 8px 16px 12px !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
.books-reader-settings-section { display: none !important; }

.rs-group {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 16px;
  background: #fbfcfc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.rs-group-tight { padding: 8px 10px; }
.rs-group-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7c86;
}
.rs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}
.rs-group > .rs-row:first-of-type { border-top: none; padding-top: 0; }
.rs-row-copy { min-width: 0; flex: 1; }
.rs-row-label { font-size: 14px; color: #1f3336; font-weight: 500; }
.rs-row-hint { font-size: 12px; color: #7a8790; margin-top: 2px; }

.rs-native-select { position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 1px !important; height: 1px !important; }
.rs-inline-select {
  width: auto;
  min-width: 128px;
  max-width: 58%;
  min-height: 36px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  font-size: 13px;
  padding: 6px 10px;
}

.rs-theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.rs-theme {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  color: #5a6b7c;
}
.rs-theme.is-on {
  border-color: #245f60;
  box-shadow: 0 0 0 2px rgba(36, 95, 96, 0.18);
  color: #245f60;
}
.rs-theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}
.rs-theme-light { background: #ffffff; }
.rs-theme-sepia { background: #f3e7d3; }
.rs-theme-dark { background: #1b2428; }
.rs-theme-auto { background: linear-gradient(135deg, #fff 50%, #1b2428 50%); }

.rs-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rs-chip {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: #31474c;
  font-family: inherit;
}
.rs-chip.is-on {
  background: #245f60;
  border-color: #245f60;
  color: #fff;
}

.rs-stepper,
.rs-seg {
  display: inline-flex !important;
  background: #fff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 12px !important;
  padding: 3px !important;
  gap: 2px;
}
.rs-seg { width: 100%; }
.rs-seg .books-reader-line-btn { flex: 1; }
.rs-seg-sm { width: auto; max-width: 100%; }
.books-reader-font-btn,
.books-reader-line-btn {
  border: none !important;
  background: transparent !important;
  border-radius: 9px !important;
  min-height: 34px;
  color: #31474c !important;
}
.books-reader-line-btn.is-active {
  background: #245f60 !important;
  color: #fff !important;
}

.rs-mode-grid {
  display: grid;
  gap: 8px;
}
.rs-mode {
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}
.rs-mode strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #163033;
  margin-bottom: 2px;
}
.rs-mode span {
  display: block;
  font-size: 12px;
  color: #6b7c86;
}
.rs-mode.is-on {
  border-color: #245f60;
  background: rgba(36, 95, 96, 0.06);
  box-shadow: inset 0 0 0 1px rgba(36, 95, 96, 0.18);
}
.rs-mode.is-on strong { color: #245f60; }

.rs-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: #1f3336;
  cursor: pointer;
}
.rs-secondary-btn {
  width: 100%;
  margin-top: 8px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #245f60;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.rs-secondary-btn:hover { background: rgba(36, 95, 96, 0.06); }

.books-reader-settings-more {
  margin: 0 0 8px !important;
  padding: 10px 12px !important;
  border: 1px dashed rgba(15, 23, 42, 0.14) !important;
  border-radius: 14px !important;
  background: #fff !important;
}
.books-reader-settings-more > summary {
  color: #245f60 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  list-style: none;
}
.books-reader-settings-more > summary::-webkit-details-marker { display: none; }

.books-reader-settings-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  flex-shrink: 0;
}
.books-reader-settings-done {
  width: 100% !important;
  min-height: 46px !important;
  border-radius: 14px !important;
  margin: 0 !important;
  font-size: 15px !important;
  letter-spacing: 0.02em;
}



/* Bookmark toast v230 */

.books-reader-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: #1f3d3d;
  color: #fff;
  font-size: 14px;
  font-family: var(--books-font-display), Georgia, serif;
  box-shadow: 0 10px 30px rgba(15,23,42,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.books-reader-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.books-reader-bookmark-marker {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 12px 0 !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  background: #245f60 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  width: fit-content;
  position: static !important;
  box-shadow: 0 6px 18px rgba(36,95,96,0.28);
}
.books-reader-header-tools .books-reader-bookmark.is-active {
  color: #245f60 !important;
  background: rgba(36,95,96,0.12) !important;
}

/* Textbook page surface + colours from reference v236 */
:root {
  --books-reader-max-width: 880px;
  --books-reader-gutter: #fafafa;
  --books-reader-page: #ffffff;
  --books-reader-page-pad-x: clamp(52px, 7.5vw, 96px);
}
body:has(#books-reader-view:not([hidden])) {
  background: var(--books-reader-gutter) !important;
}
#books-reader-view,
#books-reader-view .books-reader-scroll,
#books-reader-view .books-reader-page-viewport {
  background: var(--books-reader-gutter) !important;
}
/* Full-width pure white chrome (header + tools) */
#books-reader-view .books-reader-header,
#books-reader-view .books-reader-progress-sticky,
#books-reader-view .books-reader-chapter-select-row {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.06) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
#books-reader-view .books-reader-header-tools {
  background: #ffffff !important;
  border-top-color: rgba(15, 23, 42, 0.06) !important;
}
#books-reader-view .books-reader-nav-bar {
  background: #ffffff !important;
  border-top-color: rgba(15, 23, 42, 0.06) !important;
  box-shadow: none !important;
}
#books-reader-view .books-reader-scroll {
  padding-bottom: 0 !important;
}
#books-reader-view .books-reader-content,
.books-reader-content {
  width: 100% !important;
  max-width: min(var(--books-reader-max-width), calc(100vw - 48px)) !important;
  background: var(--books-reader-page) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
  transition: max-width 0.18s ease;
  /* Fill down to the bottom bar so no grey strip shows under the page */
  min-height: calc(100vh - 132px);
  padding: clamp(32px, 4.5vw, 56px) var(--books-reader-page-pad-x) calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  border-radius: 0;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.035),
    0 1px 2px rgba(15, 23, 42, 0.02),
    0 6px 22px rgba(15, 23, 42, 0.04) !important;
}
body.books-reader-page-mode #books-reader-view .books-reader-scroll {
  padding-bottom: 0 !important;
}
body.books-reader-page-mode #books-reader-view .books-reader-page-viewport {
  background: var(--books-reader-gutter) !important;
}
body.books-reader-page-mode #books-reader-view .books-reader-content {
  min-height: calc(100vh - 132px - 64px) !important;
  margin-bottom: 0 !important;
}
@media (min-width: 900px) {
  #books-reader-view .books-reader-content,
  .books-reader-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}
@media (max-width: 640px) {
  #books-reader-view .books-reader-content,
  .books-reader-content {
    max-width: min(var(--books-reader-max-width), calc(100vw - 24px)) !important;
    --books-reader-page-pad-x: 28px;
    padding-left: 28px !important;
    padding-right: 28px !important;
    min-height: calc(100vh - 120px);
  }
}
body.books-reader-sepia {
  --books-reader-gutter: #f3eadc;
  --books-reader-page: #fffdf8;
}
body.books-reader-sepia:has(#books-reader-view:not([hidden])),
body.books-reader-sepia #books-reader-view,
body.books-reader-sepia #books-reader-view .books-reader-scroll,
body.books-reader-sepia #books-reader-view .books-reader-page-viewport {
  background: var(--books-reader-gutter) !important;
}
body.books-reader-sepia #books-reader-view .books-reader-header,
body.books-reader-sepia #books-reader-view .books-reader-progress-sticky,
body.books-reader-sepia #books-reader-view .books-reader-chapter-select-row,
body.books-reader-sepia #books-reader-view .books-reader-header-tools {
  background: #fffdf8 !important;
}
body.books-reader-sepia #books-reader-view .books-reader-nav-bar {
  background: #fffdf8 !important;
}
body.books-reader-dark {
  --books-reader-gutter: #0b1220;
  --books-reader-page: #151d2c;
}
body.books-reader-dark:has(#books-reader-view:not([hidden])),
body.books-reader-dark #books-reader-view,
body.books-reader-dark #books-reader-view .books-reader-scroll,
body.books-reader-dark #books-reader-view .books-reader-page-viewport {
  background: var(--books-reader-gutter) !important;
}
body.books-reader-dark #books-reader-view .books-reader-header,
body.books-reader-dark #books-reader-view .books-reader-progress-sticky,
body.books-reader-dark #books-reader-view .books-reader-chapter-select-row,
body.books-reader-dark #books-reader-view .books-reader-header-tools {
  background: #151d2c !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
body.books-reader-dark #books-reader-view .books-reader-nav-bar {
  background: #151d2c !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
body.books-reader-dark #books-reader-view .books-reader-content {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 10px 32px rgba(0, 0, 0, 0.35) !important;
}
body.books-reader-contrast {
  --books-reader-gutter: #f0f0f0;
  --books-reader-page: #ffffff;
}

/* Progress % + settings no-overlap v238 */
#books-reader-view .books-reader-header-top {
  grid-template-columns: minmax(56px, 1fr) minmax(0, 2.2fr) minmax(132px, 1fr) !important;
}
#books-reader-view .books-reader-header-right {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  min-width: 0;
}
#books-reader-view .books-reader-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  max-width: 110px;
  line-height: 1.15;
}
#books-reader-view .books-reader-progress-pct,
.books-reader-progress-pct {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  transform: none !important;
  z-index: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(36, 95, 96, 0.18) !important;
  background: rgba(36, 95, 96, 0.08) !important;
  color: #245f60 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  pointer-events: none;
}
#books-reader-view .books-reader-progress-pct[hidden] {
  display: none !important;
}
#books-reader-view .books-reader-time-left {
  margin: 0 !important;
  font-size: 11px !important;
  color: #5a6b7c !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#books-reader-view .books-reader-menu-btn {
  flex-shrink: 0 !important;
  position: relative;
  z-index: 1;
}
#books-reader-view .books-reader-progress-wrap > .books-reader-progress-pct {
  display: none !important;
}

/* Ayah panel redesign + Nizam teal scrollbar v240 */
.books-ayah-panel {
  position: fixed !important;
  inset: 0 !important;
  z-index: 13000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px 16px !important;
  box-sizing: border-box !important;
}
.books-ayah-panel[hidden] { display: none !important; }
.books-ayah-panel-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.42) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.books-ayah-panel-card {
  position: relative !important;
  z-index: 1;
  width: min(560px, 100%) !important;
  max-height: min(88vh, 760px) !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 22px !important;
  background: #ffffff !important;
  border: 1px solid rgba(36, 95, 96, 0.12) !important;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.22),
    0 2px 8px rgba(15, 23, 42, 0.06) !important;
}
.books-ayah-panel-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin: 0 !important;
  padding: 20px 22px 16px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  background: linear-gradient(180deg, #f7fbfb 0%, #ffffff 100%) !important;
}
.books-ayah-panel-head-copy { min-width: 0; flex: 1; }
.books-ayah-panel-kicker {
  margin: 0 0 4px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #245f60 !important;
}
.books-ayah-panel-head h3,
#books-ayah-panel-title {
  margin: 0 !important;
  font-family: var(--books-font-display), 'EB Garamond', Georgia, serif !important;
  font-size: 1.55rem !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  color: #1a2a36 !important;
}
.books-ayah-panel-ref {
  margin: 6px 0 0 !important;
  color: #6b7c86 !important;
  font-size: 13px !important;
  font-family: var(--books-font-display), Georgia, serif !important;
}
.books-ayah-panel-close {
  flex-shrink: 0 !important;
  width: 40px !important;
  height: 40px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #1a2a36 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s !important;
}
.books-ayah-panel-close:hover {
  background: rgba(36, 95, 96, 0.08) !important;
  border-color: rgba(36, 95, 96, 0.28) !important;
  color: #245f60 !important;
}
.books-ayah-panel-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 18px 22px 8px !important;
  overscroll-behavior: contain;
  /* Nizam translucent teal scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(35, 143, 146, 0.38) transparent;
}
.books-ayah-panel-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.books-ayah-panel-body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}
.books-ayah-panel-body::-webkit-scrollbar-thumb {
  background: rgba(35, 143, 146, 0.32);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.books-ayah-panel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(35, 143, 146, 0.48);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.books-ayah-panel-arabic {
  margin: 0 0 18px !important;
  padding: 16px 18px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  font-family: 'Amiri', 'Amiri Quran', 'EB Garamond', Georgia, serif !important;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem) !important;
  line-height: 1.95 !important;
  text-align: center !important;
  color: #1a2a36 !important;
}
.books-ayah-panel-section {
  margin: 0 0 8px !important;
  padding: 14px 16px 16px !important;
  border-radius: 16px !important;
  background: #f8fafb !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
}
.books-ayah-panel-tafsir-label {
  display: block !important;
  margin: 0 0 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: #6b7c86 !important;
}
.books-ayah-panel-tafsir-select {
  width: 100% !important;
  margin: 0 0 12px !important;
  padding: 11px 14px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(36, 95, 96, 0.2) !important;
  background: #ffffff !important;
  color: #1a2a36 !important;
  font-family: var(--books-font-display), Georgia, serif !important;
  font-size: 15px !important;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23245f60' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px !important;
}
.books-ayah-panel-tafsir-select:focus {
  outline: none !important;
  border-color: #245f60 !important;
  box-shadow: 0 0 0 3px rgba(36, 95, 96, 0.16) !important;
}
.books-ayah-panel-translation {
  margin: 0 !important;
  font-family: var(--books-font-display), Georgia, serif !important;
  font-size: 1.05rem !important;
  line-height: 1.65 !important;
  color: #1a2a36 !important;
}
.books-ayah-panel-tafsir {
  margin: 12px 0 0 !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #5a6b7c !important;
}
.books-ayah-panel-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 14px 22px 18px !important;
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
  background: #ffffff !important;
}
.books-ayah-panel-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 42px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s !important;
}
.books-ayah-panel-btn-ghost {
  border: 1px solid rgba(36, 95, 96, 0.22) !important;
  background: #ffffff !important;
  color: #245f60 !important;
}
.books-ayah-panel-btn-ghost:hover {
  background: rgba(36, 95, 96, 0.07) !important;
  border-color: rgba(36, 95, 96, 0.4) !important;
}
.books-ayah-panel-btn-primary {
  border: 1px solid transparent !important;
  background: #245f60 !important;
  color: #ffffff !important;
  margin-left: auto !important;
}
.books-ayah-panel-btn-primary:hover {
  background: #1d4e4f !important;
}
@media (max-width: 640px) {
  .books-ayah-panel {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .books-ayah-panel-card {
    width: 100% !important;
    max-height: 90vh !important;
    border-radius: 22px 22px 0 0 !important;
  }
  .books-ayah-panel-btn-primary {
    width: 100% !important;
    margin-left: 0 !important;
    order: -1;
  }
}

/* Verse + hadith card redesign v244 */
.books-reader-block.ayah,
.books-reader-block.hadith {
  background: #ffffff !important;
  border: 1px solid #2f3438 !important;
  border-left: 1px solid #2f3438 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  padding: 1.35em 1.4em 1.15em !important;
  margin: 1.75em 0 !important;
}
.books-reader-block.ayah .books-reader-arabic,
.books-reader-block.hadith .books-reader-arabic {
  text-align: center !important;
  direction: rtl !important;
  margin: 0 0 1em !important;
  padding: 0.15em 0.25em 1em !important;
  border-bottom: 1px solid rgba(47, 52, 56, 0.18) !important;
  font-size: calc(1.2em * var(--books-arabic-relative, 1)) !important;
  line-height: 2 !important;
  color: #111 !important;
  background: transparent !important;
}
.books-reader-block.ayah .books-reader-ayah-foot,
.books-reader-block.hadith .books-reader-ayah-foot {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 1rem 1.25rem !important;
  margin: 0 !important;
  padding-top: 0.15em !important;
  direction: ltr !important; /* keep translation left / citation right even in RTL books */
}
.books-reader-block.ayah .books-reader-translation,
.books-reader-block.ayah .books-reader-verse-translation,
.books-reader-block.hadith .books-reader-translation {
  flex: 1 1 auto !important;
  order: 1 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  direction: ltr !important;
  font-family: var(--books-font-display), 'EB Garamond', Georgia, serif !important;
  font-style: italic !important;
  font-size: 1.02em !important;
  line-height: 1.55 !important;
  color: #1a1a1a !important;
  background: transparent !important;
}
.books-reader-block.ayah .books-reader-block-ref,
.books-reader-block.hadith .books-reader-block-ref {
  flex: 0 0 auto !important;
  order: 2 !important;
  align-self: flex-start !important;
  margin: 0.15em 0 0 auto !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #c5a07d !important;
  font-family: var(--books-font-display), Georgia, serif !important;
  font-size: 0.72em !important;
  font-weight: 500 !important;
  font-style: normal !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  line-height: 1.3 !important;
  display: block !important;
}
.books-scholar-mode .books-reader-block.ayah .books-reader-block-ref,
.books-scholar-mode .books-reader-block.hadith .books-reader-block-ref {
  outline: none !important;
  border: none !important;
  border-radius: 0 !important;
}
.books-reader-block.ayah .books-reader-tafsir,
.books-reader-block.hadith .books-reader-hadith-commentary,
.books-reader-block.hadith .books-reader-hadith-chain,
.books-reader-block.hadith .books-reader-hadith-narrator {
  margin: 0.9em 0 0 !important;
  padding-top: 0.75em !important;
  border-top: 1px solid rgba(47, 52, 56, 0.12) !important;
  font-size: 0.92em !important;
  color: #5a6b7c !important;
}
.books-reader-block.hadith .books-reader-hadith-grade {
  margin-top: 0.75em !important;
}
.books-reader-block.ayah .books-reader-block-actions,
.books-reader-block.hadith .books-reader-block-actions {
  margin-top: 0.85em !important;
}
@media (max-width: 640px) {
  .books-reader-block.ayah .books-reader-ayah-foot,
  .books-reader-block.hadith .books-reader-ayah-foot {
    flex-direction: column !important;
    gap: 0.65rem !important;
  }
  .books-reader-block.ayah .books-reader-block-ref,
  .books-reader-block.hadith .books-reader-block-ref {
    align-self: flex-end !important;
  }
}
body.books-reader-dark .books-reader-block.ayah,
body.books-reader-dark .books-reader-block.hadith {
  background: #151d2c !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}
body.books-reader-dark .books-reader-block.ayah .books-reader-arabic,
body.books-reader-dark .books-reader-block.hadith .books-reader-arabic {
  color: #f1f5f9 !important;
  border-bottom-color: rgba(255, 255, 255, 0.14) !important;
}
body.books-reader-dark .books-reader-block.ayah .books-reader-translation,
body.books-reader-dark .books-reader-block.ayah .books-reader-verse-translation,
body.books-reader-dark .books-reader-block.hadith .books-reader-translation {
  color: #e2e8f0 !important;
}
body.books-reader-dark .books-reader-block.ayah .books-reader-block-ref,
body.books-reader-dark .books-reader-block.hadith .books-reader-block-ref {
  color: #d4b896 !important;
}
body.books-reader-sepia .books-reader-block.ayah,
body.books-reader-sepia .books-reader-block.hadith {
  background: #fffdf8 !important;
  border-color: #5c4b37 !important;
}
body.books-reader-sepia .books-reader-block.ayah .books-reader-block-ref,
body.books-reader-sepia .books-reader-block.hadith .books-reader-block-ref {
  color: #b08968 !important;
}

/* Advanced search sidebar redesign v248 */
.books-search-panel-body {
  gap: 16px !important;
  padding: 18px 20px 24px !important;
}
.books-search-field-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  color: #6b7c86 !important;
  margin: 0 0 2px !important;
}
.books-search-bar {
  padding: 0 !important;
  border: none !important;
}
.books-search-bar .brs-input {
  min-height: 46px !important;
  padding: 12px 14px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(36, 95, 96, 0.18) !important;
  background: #ffffff !important;
  font-size: 15px !important;
}
.books-search-bar .brs-input:focus {
  border-color: #245f60 !important;
  box-shadow: 0 0 0 3px rgba(36, 95, 96, 0.14) !important;
}
.books-search-advanced {
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
.books-search-advanced-summary {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 0 0 10px !important;
  margin: 0 !important;
  list-style: none !important;
  cursor: pointer !important;
  user-select: none;
}
.books-search-advanced-summary::-webkit-details-marker { display: none !important; }
.books-search-advanced-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  color: #245f60 !important;
}
.books-search-advanced-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #245f60;
  border-bottom: 1.5px solid #245f60;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
  margin-top: -2px;
}
.books-search-advanced[open] .books-search-advanced-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}
.books-search-advanced-inner {
  padding: 12px 14px 14px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid rgba(36, 95, 96, 0.1) !important;
}
.books-search-adv-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.books-search-adv-list li {
  margin: 0 !important;
  padding: 0 !important;
}
.books-search-adv-list li + li {
  border-top: 1px solid rgba(36, 95, 96, 0.08);
}
.books-search-adv-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 11px 2px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  color: #1a2a36 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}
.books-search-adv-text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}
.books-search-adv-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0 !important;
  accent-color: #245f60;
  cursor: pointer;
}
.books-search-adv-scope {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(36, 95, 96, 0.1) !important;
}
.books-search-adv-scope-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: #6b7c86 !important;
}
.books-search-adv-select {
  width: 100% !important;
  min-height: 42px !important;
  padding: 10px 36px 10px 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(36, 95, 96, 0.18) !important;
  background: #ffffff !important;
  color: #1a2a36 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23245f60' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.books-search-adv-select:focus {
  outline: none !important;
  border-color: #245f60 !important;
  box-shadow: 0 0 0 3px rgba(36, 95, 96, 0.14) !important;
}
.books-search-panel-body[dir="rtl"] .books-search-adv-select {
  padding: 10px 12px 10px 36px !important;
  background-position: left 12px center;
}
.books-search-count {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #6b7c86 !important;
  padding: 0 2px !important;
}
.books-search-results {
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  padding-top: 10px !important;
  margin: 0 !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(35, 143, 146, 0.38) transparent;
}
.books-search-results::-webkit-scrollbar { width: 8px; }
.books-search-results::-webkit-scrollbar-thumb {
  background: rgba(35, 143, 146, 0.32);
  border-radius: 999px;
}

/* MyReads room pages v252 */
body.books-room-active,
body.books-room-active .books-portal,
body.books-room-active .books-main,
body.books-room-active #books-list-view,
body.books-room-active .books-library-shell,
body.books-room-active .books-library-content {
  background: #fff !important;
}
.books-room-page {
  padding: 8px 0 72px;
}
.books-room-shell {
  width: min(920px, calc(100% - 48px));
  margin: 0 auto;
}
.books-room-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 0;
  margin: 0 0 14px;
}
.books-room-toolbar[hidden] { display: none !important; }
.books-room-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #e8e4dc;
  background: #fff;
  color: #1a4d4e;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.books-room-action:hover {
  border-color: rgba(26,77,78,.28);
  background: #f8fbfb;
}
.books-room-panel {
  border: 1px solid #ebe7df;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(28,35,40,.03);
  overflow: hidden;
}
.books-room-panel.is-empty {
  border-style: dashed;
  border-color: #e8e4dc;
  box-shadow: none;
}
.books-room-panel-body {
  min-height: 360px;
}
.books-room-panel.is-filled .books-room-panel-body {
  min-height: 0;
}
.books-room-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 360px;
  padding: 56px 32px;
}
.books-room-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #f3e8dc;
  color: #8a5a32;
}
.books-room-empty-icon svg {
  width: 22px;
  height: 22px;
}
.books-room-empty h3 {
  margin: 0 0 10px;
  font-family: 'EB Garamond', Garamond, Georgia, serif !important;
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -.02em;
  color: #1a4d4e;
}
.books-room-empty p {
  margin: 0;
  max-width: 42ch;
  font-family: 'EB Garamond', Garamond, Georgia, serif !important;
  font-size: 1.06rem;
  line-height: 1.55;
  color: #6e7876;
}
.books-room-filled {
  padding: 28px 30px 32px;
}
.books-room-count {
  margin: 0 0 22px;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8a9190;
}
.books-room-group {
  border: 1px solid #ebe7df;
  border-radius: 18px;
  background: #fff;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.books-room-group:last-child { margin-bottom: 0; }
.books-room-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(28,35,40,.08);
}
.books-room-group-copy { min-width: 0; }
.books-room-group-copy h3 {
  margin: 0;
  font-family: 'EB Garamond', Garamond, Georgia, serif !important;
  font-size: 1.35rem;
  font-weight: 500;
  color: #1a4d4e;
}
.books-room-group-copy span {
  display: block;
  margin-top: 4px;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .82rem;
  color: #8a9190;
}
.books-room-open {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #1a4d4e;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}
.books-room-open:hover { color: #245f60; }
.books-room-item {
  margin: 0 0 14px;
  padding: 0 0 0 16px;
  border-left: 2px solid rgba(201,154,53,.45);
}
.books-room-item:last-child { margin-bottom: 0; }
.books-room-item-quote {
  margin: 0;
  font-family: 'EB Garamond', Garamond, Georgia, serif !important;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #1c2328;
}
.books-room-item-note {
  margin: 10px 0 0;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .92rem;
  line-height: 1.5;
  color: #5c686f;
}
.books-room-item-note span {
  display: inline-block;
  margin-right: 8px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1a4d4e;
}
.books-room-collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.books-room-coll-card {
  text-align: left;
  cursor: pointer;
  border: 1px solid #ebe7df;
  border-radius: 18px;
  background: #fff;
  padding: 20px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.books-room-coll-card:hover {
  transform: translateY(-3px);
  border-color: rgba(26,77,78,.2);
  box-shadow: 0 16px 34px rgba(28,35,40,.08);
}
.books-room-coll-stack {
  position: relative;
  height: 92px;
  margin-bottom: 16px;
}
.books-room-coll-stack img,
.books-room-coll-blank {
  position: absolute;
  top: 0;
  left: calc(var(--i) * 28px);
  width: 66px;
  height: 92px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e8e4dc;
  box-shadow: 0 8px 18px rgba(28,35,40,.12);
  background: linear-gradient(160deg, #d7e4e4, #eef5f5);
  z-index: calc(4 - var(--i));
}
.books-room-coll-meta strong {
  display: block;
  font-family: 'EB Garamond', Garamond, Georgia, serif !important;
  font-size: 1.2rem;
  font-weight: 500;
  color: #1a4d4e;
  margin-bottom: 2px;
}
.books-room-coll-meta span {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .82rem;
  color: #8a9190;
}
.books-room-review-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 22px 24px;
  margin-bottom: 24px;
  border: 1px solid #ebe7df;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(26,77,78,.06), #fff 55%);
}
.books-room-review-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.books-room-review-stat strong {
  font-family: 'EB Garamond', Garamond, Georgia, serif !important;
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1;
  color: #1a4d4e;
}
.books-room-review-stat span {
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8a9190;
}
.books-room-review-start {
  margin-left: auto;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid #1a4d4e;
  border-radius: 11px;
  background: #1a4d4e;
  color: #fff;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.books-room-review-start:hover:not(:disabled) {
  background: #245f60;
  border-color: #245f60;
  transform: translateY(-1px);
}
.books-room-review-start:disabled {
  background: #eef1f2;
  border-color: #e8ecef;
  color: #8a9190;
  cursor: default;
}
.books-room-review-label {
  margin: 0 0 12px;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a9190;
}
.books-room-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.books-room-review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #ebe7df;
  border-radius: 14px;
  background: #fff;
}
.books-room-review-text {
  min-width: 0;
  font-family: 'EB Garamond', Garamond, Georgia, serif !important;
  font-size: 1.02rem;
  color: #1c2328;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.books-room-review-due {
  flex: 0 0 auto;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: .78rem;
  color: #8a9190;
}
.books-room-settings {
  padding: 8px 28px 28px;
}
.books-room-settings .books-settings-layout {
  padding-right: 0;
}
.books-room-settings .books-set-card {
  border-color: #ebe7df;
  border-radius: 16px;
  background: #fff;
}
.books-room-settings .books-set-section-title {
  color: #8a9190;
  font-family: Inter, system-ui, sans-serif !important;
}
.books-room-settings .books-set-copy h3 {
  font-family: 'EB Garamond', Garamond, Georgia, serif !important;
  color: #1a4d4e;
}
.books-room-settings .books-set-btn {
  border-radius: 10px;
  font-family: Inter, system-ui, sans-serif !important;
}
@media (max-width: 760px) {
  .books-room-shell { width: calc(100% - 32px); }
  .books-room-filled { padding: 22px 18px 26px; }
  .books-room-empty { padding: 48px 22px; min-height: 320px; }
  .books-room-group { padding: 18px 16px; }
  .books-room-group-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .books-room-review-start { margin-left: 0; width: 100%; }
  .books-room-settings { padding: 4px 18px 22px; }
}

/* Reader side gutter overlay v253 */
#books-reader-view .books-reader-page-viewport {
  position: relative !important;
  isolation: isolate;
}
.books-reader-gutter-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/books/api/file/books/reader-side-overlay.png?v=253");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
#books-reader-view .books-reader-content {
  position: relative !important;
  z-index: 1 !important;
}
body.books-reader-dark .books-reader-gutter-overlay {
  opacity: 0.55;
  mix-blend-mode: screen;
}
body.books-reader-sepia .books-reader-gutter-overlay {
  opacity: 0.92;
}

