/* public/css/ebook.css — Universal TwoGees Ebook & Micro-Guide Styling Engine */

:root {
  --tp: #6c63ff;
  --tp2: #ff6584;
}

/* ══════════════════════════════════════════
   UNIVERSAL PAGE SYSTEM
   ALL pages: exactly 390px wide
   Height: auto (content-driven)
   ══════════════════════════════════════════ */
#bookPreview, .ebook-container {
  background: #c8c8c8;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 390px;
}

.pdf-page {
  width: 390px !important;
  min-width: 390px !important;
  max-width: 390px !important;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border-top: 1px solid #e0e0e0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga" 1, "kern" 1;
  box-sizing: border-box;
}

.pdf-page p, .pdf-page h1, .pdf-page h2, .pdf-page h3, .pdf-page div {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.pdf-page:first-child {
  border-top: none;
}

/* ══════════════════════════════════════════
   FLUID READER CARD & TYPOGRAPHY SYSTEM
   Prevents canvas transform scaling and clipping.
   Zoom controls dynamically scale text, fonts, cards,
   and padding while keeping the screen viewport stable.
   ══════════════════════════════════════════ */
#renderedPagesWrap {
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  transform: none !important;
  margin-bottom: 0 !important;
}

#renderedPagesWrap .pdf-page {
  width: var(--reader-page-width, 390px) !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  zoom: var(--reader-zoom, 1);
  transition: width 0.16s ease-out, zoom 0.16s ease-out;
}

/* ── PAGE INNER — generous ebook margins ── */
.pi {
  padding: 42px 32px 30px !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.pi-tight {
  padding: 28px 28px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* ── TOP ACCENT BAR ── */
.accent-bar {
  height: 4px;
  background: linear-gradient(to right, var(--tp, #6c63ff), var(--tp2, #ff6584));
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* ══════════════════════════════════════════
   EBOOK TYPOGRAPHY — the reading system
   ══════════════════════════════════════════ */
.t-overline {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
}

.t-h1 {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.t-h2 {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}

.t-h3 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 6px;
}

.t-h4 {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 4px;
}

/* Body text has generous line-height + MAXIMUM CONTRAST */
.t-body {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.95;
  color: #050510;
  letter-spacing: 0.1px;
}

.t-body-sm {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.9;
  color: #050510;
  letter-spacing: 0.1px;
}

.t-lead {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.9;
  color: #050510;
  letter-spacing: 0.15px;
}

.t-serif {
  font-family: 'Lora', serif;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.95;
  color: #050510;
}

.t-serif-lg {
  font-family: 'Lora', serif;
  font-size: 16px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.9;
  color: #050510;
}

.t-caption {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  line-height: 1.6;
}

.t-mono {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.8;
  color: #050510;
}

/* ── SPACING BETWEEN ELEMENTS ── */
.gap-section { margin-top: 24px; }
.gap-para { margin-top: 14px; }
.gap-sm { margin-top: 8px; }

/* ── DIVIDERS ── */
.div-line {
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb 25%, #e5e7eb 75%, transparent);
  margin: 20px 0;
}
.div-thick {
  height: 2px;
  border-radius: 2px;
  margin: 18px 0;
}
.div-dots {
  text-align: center;
  color: #d1d5db;
  font-size: 13px;
  letter-spacing: 10px;
  margin: 16px 0;
  line-height: 1;
}
.div-space { margin: 16px 0; }

/* ── PULL QUOTE ── */
.pull-quote {
  border-left: 4px solid;
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 10px 10px 0;
}
.pull-quote p {
  font-family: 'Lora', serif;
  font-size: 15px;
  font-style: italic;
  line-height: 1.9;
  color: #050510;
}
.pull-quote .attr {
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: 0.3px;
}

/* ── CALLOUT / INFO BOX ── */
.callout {
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
}
.callout-icon { font-size: 20px; margin-bottom: 8px; display: block; }
.callout-title { font-size: 13px; font-weight: 900; letter-spacing: 0.5px; margin-bottom: 8px; }
.callout-body { font-size: 14px; font-weight: 400; line-height: 1.85; color: #050510; }
.cl-info { background: #eff6ff; border: 1px solid #bfdbfe; }
.cl-tip { background: #f0fdf4; border: 1px solid #bbf7d0; }
.cl-warn { background: #fefce8; border: 1px solid #fde68a; }
.cl-danger { background: #fef2f2; border: 1px solid #fecaca; }
.cl-key { background: #f5f3ff; border: 1px solid #ddd6fe; }

/* ── STEP ROWS ── */
.step-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid #f3f4f6;
}
.step-row:last-child { border-bottom: none; padding-bottom: 0; }
.step-num-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── CHECK ROWS ── */
.check-row {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid #f9fafb;
}
.check-row:last-child { border-bottom: none; padding-bottom: 0; }
.check-box {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  border: 1.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── GRID LAYOUTS ── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* ── BENTO CARD ── */
.bento-card {
  border-radius: 12px;
  padding: 16px 14px;
  border: 1px solid rgba(0,0,0,.06);
}
.bento-icon { font-size: 24px; margin-bottom: 10px; display: block; }
.bento-title { font-size: 14px; font-weight: 800; line-height: 1.35; margin-bottom: 8px; }
.bento-body { font-size: 13.5px; font-weight: 400; line-height: 1.8; color: #050510; }

/* ── STAT CARD ── */
.stat-card {
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  border: 1px solid rgba(0,0,0,.05);
}
.stat-num {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 6px;
}
.stat-label { font-size: 12px; font-weight: 800; margin-bottom: 6px; letter-spacing: 0.3px; }
.stat-desc { font-size: 12.5px; font-weight: 400; line-height: 1.6; color: #4b5563; }

/* ── CODE BLOCK ── */
.code-wrap {
  background: #1e1e2e;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}
.code-top {
  background: #181826;
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.code-body {
  padding: 18px;
  font-family: 'Fira Code', monospace;
  font-size: 10.5px;
  color: #cdd6f4;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* ── PAGE FOOTER ── */
.pg-foot {
  padding-top: 18px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

/* ── BADGE ── */
.eb-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 100px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border: 1px solid;
  margin-bottom: 12px;
}

/* ── TEMPLATE CARD ── */
.tpl-card { border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; margin-bottom: 10px; }
.tpl-head { padding: 14px 18px; font-size: 14px; font-weight: 800; color: #050510; border-bottom: 1px solid #f3f4f6; }
.tpl-body { padding: 14px 18px; font-size: 14px; font-weight: 400; line-height: 1.85; color: #050510; }

/* ── VS TABLE ── */
.vs-header { display: grid; grid-template-columns: 1fr 1fr; }
.vs-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #f3f4f6; }
.vs-cell { padding: 10px 13px; font-size: 13px; font-weight: 500; line-height: 1.6; color: #111827; }

/* ── FAQ ── */
.faq-item { border-radius: 10px; border: 1px solid; overflow: hidden; margin-bottom: 10px; }
.faq-q { padding: 12px 15px; font-size: 13px; font-weight: 800; color: #050510; }
.faq-a { padding: 12px 15px; font-size: 13px; font-weight: 400; line-height: 1.8; color: #111827; border-top: 1px solid; }

/* ── CHEATSHEET ── */
.cheat-cell { border-radius: 8px; border: 1px solid #e5e7eb; overflow: hidden; }
.cheat-label { padding: 7px 10px; font-size: 11px; font-weight: 800; border-bottom: 1px solid #e5e7eb; }
.cheat-value { padding: 8px 10px; font-size: 11px; font-family: 'Fira Code', monospace; background: #fff; color: #111827; line-height: 1.55; }
.cheat-note { padding: 5px 10px 7px; font-size: 10px; color: #6b7280; font-style: italic; background: #fafafa; border-top: 1px solid #f0f0f0; }

/* ── TIMELINE ── */
.tl-row { display: flex; gap: 0; align-items: stretch; }
.tl-left { display: flex; flex-direction: column; align-items: center; width: 30px; flex-shrink: 0; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 900; color: #fff; flex-shrink: 0; }
.tl-line { width: 2px; flex: 1; margin: 3px 0; min-height: 16px; }
.tl-content { flex: 1; padding: 0 0 18px 14px; }
.tl-title { font-size: 13px; font-weight: 800; color: #050510; margin-bottom: 5px; }
.tl-body { font-size: 13px; font-weight: 400; line-height: 1.75; color: #374151; }

/* ══════════════════════════════════════════
   INTERACTIVE STATES — card components
   Subtle lift + press so tappable content feels alive
   ══════════════════════════════════════════ */
.bento-card, .tpl-card, .stat-card, .cheat-cell, .faq-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bento-card:hover, .tpl-card:hover, .stat-card:hover, .cheat-cell:hover, .faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.bento-card:active, .tpl-card:active, .stat-card:active, .cheat-cell:active, .faq-item:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ══════════════════════════════════════════
   CLAYMORPHISM READER UI DESIGN SYSTEM
   Applies exclusively to the Reader Stage & Controls
   ══════════════════════════════════════════ */
:root {
  --clay-bg: #eaf0f8;
  --clay-surface: #edf3fb;
  --clay-surface-light: #f5f8fc;
  --clay-border: rgba(255, 255, 255, 0.85);
  --clay-text: #1e293b;
  --clay-muted: #64748b;
  --clay-primary: #6366f1;
  --clay-primary-dark: #4f46e5;
  --clay-accent: #ec4899;

  /* Pillowy Floating 3D Shadows */
  --clay-shadow-outer: 0 14px 28px rgba(155, 175, 205, 0.38), 0 4px 10px rgba(155, 175, 205, 0.2);
  --clay-shadow-sm: 0 6px 14px rgba(155, 175, 205, 0.3), 0 2px 5px rgba(155, 175, 205, 0.15);
  
  /* Tactile Inner 3D Highlight & Shadow */
  --clay-inset: inset 3px 4px 8px rgba(255, 255, 255, 0.95), inset -4px -5px 10px rgba(160, 180, 210, 0.42);
  --clay-inset-sm: inset 2px 2px 5px rgba(255, 255, 255, 0.95), inset -2px -3px 6px rgba(160, 180, 210, 0.35);
  
  /* Recessed / Pressed Depths */
  --clay-recessed: inset 5px 6px 14px rgba(150, 170, 200, 0.5), inset -5px -6px 14px rgba(255, 255, 255, 0.9);
  --clay-pressed: inset 3px 4px 8px rgba(145, 165, 195, 0.65), inset -3px -4px 8px rgba(255, 255, 255, 0.75);

  /* Primary Brand Clay Gradient & Glow */
  --clay-primary-outer: 0 10px 22px rgba(99, 102, 241, 0.38), 0 3px 8px rgba(99, 102, 241, 0.22);
  --clay-primary-inset: inset 2px 3px 6px rgba(255, 255, 255, 0.5), inset -3px -4px 8px rgba(35, 20, 120, 0.38);
}

/* Clay Card / Toolbar Frame */
.clay-card {
  background: var(--clay-surface);
  border-radius: 24px;
  box-shadow: var(--clay-shadow-outer), var(--clay-inset);
  border: 1px solid var(--clay-border);
  backdrop-filter: blur(14px);
}

/* Clay Floating Pill */
.clay-pill {
  background: var(--clay-surface);
  border-radius: 9999px;
  box-shadow: var(--clay-shadow-sm), var(--clay-inset-sm);
  border: 1px solid var(--clay-border);
}

/* Clay Button (Tactile 3D) */
.clay-btn {
  background: var(--clay-surface);
  color: var(--clay-text);
  font-weight: 800;
  border-radius: 14px;
  box-shadow: var(--clay-shadow-sm), var(--clay-inset-sm);
  border: 1px solid var(--clay-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.clay-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--clay-shadow-outer), var(--clay-inset-sm);
  color: var(--clay-primary);
}
.clay-btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: var(--clay-pressed);
}

/* Clay Primary Button (Vibrant Inflated Clay) */
.clay-btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff !important;
  font-weight: 900;
  border-radius: 14px;
  box-shadow: var(--clay-primary-outer), var(--clay-primary-inset);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.clay-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.5), var(--clay-primary-inset);
}
.clay-btn-primary:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: inset 3px 4px 10px rgba(35, 20, 120, 0.6), inset -2px -3px 6px rgba(255, 255, 255, 0.3);
}

/* Clay Track (Recessed Groove for Switchers & Progress) */
.clay-track {
  background: #e2eaf4;
  border-radius: 9999px;
  box-shadow: inset 2.5px 3.5px 7px rgba(150, 170, 200, 0.45), inset -2.5px -3.5px 7px rgba(255, 255, 255, 0.9);
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Clay Active Pill inside a Track */
.clay-track-btn {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--clay-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.clay-track-btn.active {
  background: #ffffff;
  color: var(--clay-primary);
  box-shadow: 0 3px 8px rgba(150, 170, 200, 0.35), inset 1px 2px 4px rgba(255, 255, 255, 0.95);
  font-weight: 900;
  transform: scale(1.02);
}

/* Clay Inset Stage Viewport */
.clay-stage {
  background: #e2eaf4;
  border-radius: 28px;
  box-shadow: var(--clay-recessed);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Clay Floating Navigation Pill */
.clay-nav-bar {
  background: rgba(245, 248, 253, 0.96);
  border-radius: 9999px;
  box-shadow: 0 16px 36px rgba(140, 165, 195, 0.45), var(--clay-inset);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

/* Clay Dropdown / Select */
.clay-select {
  background: var(--clay-surface);
  color: var(--clay-text);
  font-weight: 800;
  border-radius: 12px;
  box-shadow: var(--clay-shadow-sm), var(--clay-inset-sm);
  border: 1px solid var(--clay-border);
  padding: 3px 8px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}
.clay-select:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), var(--clay-inset-sm);
}

/* ══════════════════════════════════════════
   COGNITIVE FOCUS RULER & SPOTLIGHT BLUR
   ══════════════════════════════════════════ */
.reading-ruler-overlay {
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  transition: border-radius 0.2s ease;
}

.ruler-blur-curtain {
  width: 100%;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(5px) saturate(0.65);
  -webkit-backdrop-filter: blur(5px) saturate(0.65);
  transition: height 0.04s ease-out;
  pointer-events: none;
}

.ruler-top-curtain {
  border-bottom: 2.5px solid var(--tp, #6c63ff);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.ruler-bottom-curtain {
  flex: 1;
  border-top: 2.5px solid var(--tp, #6c63ff);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.18);
}

.ruler-focus-window {
  width: 100%;
  height: 96px;
  min-height: 96px;
  max-height: 96px;
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 28px rgba(108, 99, 255, 0.14);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 18px;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   GLASSMORPHISM AESTHETIC STYLE ENGINE
   ══════════════════════════════════════════ */
[data-style="glass"] {
  --glass-surface: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 16px 40px 0 rgba(31, 38, 135, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
}

[data-style="glass"] .clay-card {
  background: var(--glass-surface) !important;
  backdrop-filter: blur(20px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
}

[data-style="glass"] .clay-btn {
  background: rgba(255, 255, 255, 0.68) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
}

[data-style="glass"] .clay-btn:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(31, 38, 135, 0.16) !important;
}

[data-style="glass"] .clay-btn-primary {
  background: linear-gradient(135deg, var(--tp, #6366f1) 0%, var(--tp2, #a855f7) 100%) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4) !important;
}

[data-style="glass"] .clay-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.55) !important;
}

[data-style="glass"] .clay-stage {
  background: rgba(255, 255, 255, 0.38) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08) !important;
}

[data-style="glass"] .clay-pill {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05) !important;
}

[data-style="glass"] .clay-track {
  background: rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

[data-style="glass"] .clay-track-btn.active {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 4px 14px rgba(31, 38, 135, 0.14) !important;
  color: var(--tp, #6366f1) !important;
}

[data-style="glass"] .clay-select {
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05) !important;
}

/* ══════════════════════════════════════════
   DARK NEON GLASS AESTHETIC
   ══════════════════════════════════════════ */
[data-style="dark-glass"] .clay-card {
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

[data-style="dark-glass"] .clay-btn {
  background: rgba(30, 41, 59, 0.75) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(10px) !important;
}

[data-style="dark-glass"] .clay-stage {
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* ══════════════════════════════════════════
   TWOGEES STUDIO ELITE IMPRESSION ENGINE
   ══════════════════════════════════════════ */
.tg-cover-card {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.tg-glass-capsule {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.tg-index-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tg-index-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.tg-action-pill {
  transition: transform 0.15s ease, background 0.15s ease;
}

.tg-action-pill:hover {
  transform: translateX(2px);
}

@media print {
  .pdf-page {
    page-break-inside: avoid;
    break-inside: avoid;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ── MOBILE: auto-hide reader top bar on scroll down, reveal on scroll up ── */
@media (max-width: 639px) {
  #readerTopBar {
    transition: transform 0.25s ease, opacity 0.2s ease;
  }
  #readerTopBar.reader-chrome-hidden {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
  }
}
@media (max-width: 639px) and (prefers-reduced-motion: reduce) {
  #readerTopBar { transition: none; }
}

/* ══════════════════════════════════════════
   PUBLICATION-GRADE EDITORIAL BOOK TYPOGRAPHY
   ══════════════════════════════════════════ */

.drop-cap {
  float: left;
  font-family: 'Playfair Display', 'DM Serif Display', Georgia, serif;
  font-size: 44px;
  line-height: 0.82;
  font-weight: 900;
  margin: 5px 12px 0 0;
  color: var(--tp, #c25e2e);
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.t-book-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.88;
  color: #1e293b;
  letter-spacing: 0.12px;
  text-rendering: optimizeLegibility;
}

.t-book-lead {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.85;
  color: #0f172a;
  letter-spacing: 0.1px;
}

.running-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 7px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #94a3b8;
}

.pull-quote-book {
  position: relative;
  margin: 14px 0;
  padding: 14px 18px 14px 20px;
  background: #f8fafc;
  border-left: 3.5px solid var(--tp, #c25e2e);
  border-radius: 0 12px 12px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.pull-quote-book p {
  font-family: 'Lora', Georgia, serif;
  font-size: 13.5px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.8;
  color: #0f172a;
  margin: 0;
}

.pull-quote-book .pull-quote-author {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tp, #c25e2e);
  margin-top: 6px;
  display: block;
}

.marginalia-note {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 450;
  color: #64748b;
  line-height: 1.6;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #94a3b8;
  margin: 10px 0;
}

.editorial-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.editorial-divider::before,
.editorial-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

.editorial-divider-ornament {
  font-size: 10px;
  color: var(--tp, #c25e2e);
  opacity: 0.65;
}

/* ══════════════════════════════════════════
   INTERACTIVE READER MICRO-INTERACTIONS
   ══════════════════════════════════════════ */
.eb-check-row {
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.eb-check-row:hover {
  border-color: #cbd5e1 !important;
  background-color: #f8fafc !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04) !important;
}

.eb-check-row.is-checked {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

.eb-copy-btn {
  transition: all 0.15s ease;
}

.eb-copy-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
  transform: translateY(-1px);
}

.eb-copy-btn:active {
  transform: scale(0.96);
}

.eb-score-pill {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.eb-score-pill:hover:not(.active) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  transform: scale(1.1);
}

.eb-score-pill.active {
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(194, 94, 46, 0.35);
}

/* Custom smooth scrollbar inside 390px reader canvas */
.ebook-container::-webkit-scrollbar,
.pdf-page::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.ebook-container::-webkit-scrollbar-thumb,
.pdf-page::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

