/* ==========================================================================
   BẢN ĐỒ ĂN UỐNG LÀNH BỤNG CHO NGƯỜI TRÀO NGƯỢC — EBOOK #2
   Luminous Emerald Sage × Warm Ivory Cream × Champagne Gold
   Optimized for Vietnamese readability (women 40–55) + Print PDF
   ========================================================================== */

:root {
  --emerald-deep: #093628;
  --emerald-main: #146C43;
  --emerald-mid: #238659;
  --emerald-soft: #E8F5EE;
  --emerald-border: #BCE2CE;

  --gold-main: #B8862B;
  --gold-light: #E8D5A7;
  --gold-bg: #FCF8EE;

  --cream-bg: #FAF7F0;
  --surface: #FFFFFF;
  --surface-soft: #F4F7F4;

  --text-heading: #0D2B20;
  --text-main: #243830;
  --text-muted: #5A7066;

  --danger-bg: #FEF2F2;
  --danger-border: #FECACA;
  --danger-text: #B91C1C;

  --warn-bg: #FFFBEB;
  --warn-border: #FDE68A;
  --warn-text: #92400E;

  --zalo-blue: #0068FF;
  --zalo-navy: #0B3D2E;

  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-base: 17px;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-card: 0 8px 28px rgba(9, 54, 40, 0.06);
  --shadow-elevated: 0 20px 50px rgba(9, 54, 40, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: var(--font-size-base); }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--cream-bg);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.print-only { display: none; }
img { max-width: 100%; height: auto; }

.ico {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.ico-lg { width: 22px; height: 22px; }

/* ================= LEAD GATE VIEW ================= */
.gate-wrapper {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(20, 108, 67, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(184, 134, 43, 0.12) 0%, transparent 45%),
    var(--cream-bg);
  padding: 20px 14px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gate-shell {
  width: 100%;
  max-width: 1040px;
}

.gate-card {
  background: var(--surface);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  border: 1px solid rgba(184, 134, 43, 0.22);
  display: grid;
  grid-template-columns: 1fr;
}

.gate-hero {
  position: relative;
  padding: 30px 22px 28px;
  color: #FFFFFF;
  background:
    linear-gradient(150deg, rgba(9, 54, 40, 0.90) 0%, rgba(20, 108, 67, 0.80) 56%, rgba(15, 76, 54, 0.92) 100%),
    url('images/ebook-cover-art.jpg') center/cover no-repeat;
  overflow: hidden;
}

.gate-hero::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(232, 213, 167, 0.34);
  border-radius: 18px;
  pointer-events: none;
}

.gate-hero-content { position: relative; z-index: 2; }

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.14);
  border: 1px solid rgba(232, 213, 167, 0.45);
  color: #F6E6BC;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  margin-bottom: 18px;
}

.gate-book-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

/* Luxury 3D Emerald Hardcover Mockup */
.book-mockup {
  width: 112px;
  min-width: 112px;
  height: 156px;
  border-radius: 4px 12px 12px 4px;
  background:
    linear-gradient(155deg, rgba(9, 54, 40, 0.76) 0%, rgba(20, 108, 67, 0.52) 55%, rgba(9, 54, 40, 0.88) 100%),
    url('images/ebook-cover-art.jpg') center/cover no-repeat;
  border: 1px solid rgba(232, 213, 167, 0.65);
  box-shadow:
    -6px 12px 24px rgba(0, 0, 0, 0.38),
    inset 7px 0 12px rgba(255, 255, 255, 0.22),
    inset -2px 0 6px rgba(0, 0, 0, 0.3);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transform: perspective(600px) rotateY(-8deg);
  transition: transform 0.35s ease;
}

.book-mockup:hover {
  transform: perspective(600px) rotateY(-2deg) translateY(-3px);
}

.book-mockup::before {
  content: "";
  position: absolute;
  left: 6px; top: 0; bottom: 0; width: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.book-kicker {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #F6E6BC;
}

.book-title-mini {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  line-height: 1.26;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.book-author-mini {
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #D1FAE5;
  border-top: 1px solid rgba(232, 213, 167, 0.4);
  padding-top: 5px;
}

.gate-hero h1 {
  font-family: var(--font-serif);
  font-size: 1.56rem;
  line-height: 1.28;
  margin: 0 0 8px;
  color: #FFFFFF;
}

.gate-sub {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.58;
  color: #E6F4EC;
}

.gate-highlights {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}

.gate-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.89rem;
  line-height: 1.5;
  color: #F3FAF6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(232, 213, 167, 0.2);
  padding: 10px 12px;
  border-radius: 12px;
}

.gate-highlights .check-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(232, 213, 167, 0.22);
  color: #F6E6BC;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.gate-author-bar {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(232, 213, 167, 0.25);
  font-size: 0.82rem;
  color: #DDF3E6;
}

.gate-author-bar strong { color: #F6E6BC; }

/* Gate Form Panel */
.gate-form-panel {
  padding: 28px 22px 30px;
  background: #FFFFFF;
}

.gate-form-panel h2 {
  font-family: var(--font-serif);
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--emerald-deep);
}

.gate-form-desc {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.req-star { color: #DC2626; }

.form-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1.5px solid #D5E2DA;
  background: #FCFDFB;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text-heading);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-input:focus {
  outline: none;
  border-color: var(--emerald-main);
  box-shadow: 0 0 0 3px rgba(20, 108, 67, 0.12);
  background: #FFFFFF;
}

.form-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.btn-primary {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--emerald-deep) 0%, var(--emerald-main) 55%, var(--emerald-mid) 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(20, 108, 67, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(20, 108, 67, 0.34);
}
.btn-primary:disabled { opacity: 0.72; cursor: wait; }

.form-privacy {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* Gate Proof Strip */
.gate-proof {
  margin-top: 22px;
  background: #FFFFFF;
  border: 1px solid var(--emerald-border);
  border-radius: 20px;
  padding: 20px 18px;
  box-shadow: var(--shadow-card);
}

.gate-proof-head {
  text-align: center;
  margin-bottom: 14px;
}

.gate-proof-head span {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald-main);
}

.gate-proof-head h3 {
  font-family: var(--font-serif);
  margin: 4px 0 0;
  font-size: 1.12rem;
  color: var(--emerald-deep);
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.proof-card {
  background: var(--gold-bg);
  border: 1px solid #EFE4C8;
  border-radius: 14px;
  padding: 14px 15px;
}

.proof-stars {
  color: #D97706;
  font-size: 0.82rem;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.proof-quote {
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-heading);
  font-style: italic;
}

.proof-who {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--emerald-main);
}

.proof-disclaimer {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* ================= READER TOPBAR & DRAWER ================= */
.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--emerald-border);
}

.progress-track {
  height: 3.5px;
  background: var(--emerald-soft);
  width: 100%;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--emerald-main), var(--gold-main));
  transition: width 0.12s linear;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.btn-menu-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--emerald-border);
  background: var(--surface);
  color: var(--emerald-deep);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-menu-icon:hover { background: var(--emerald-soft); }

.topbar-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--emerald-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* Music Toggle Button */
.btn-music-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--emerald-border);
  background: var(--emerald-soft);
  color: var(--emerald-deep);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-music-top.is-playing,
.btn-music-welcome.is-playing {
  background: linear-gradient(135deg, var(--emerald-deep) 0%, var(--emerald-main) 100%);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(20, 108, 67, 0.28);
}

.music-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}

.btn-music-top.is-playing .music-ico { display: none; }
.btn-music-top.is-playing .music-bars { display: inline-flex; }

.music-bars span {
  width: 2.5px;
  background: #F6E6BC;
  border-radius: 2px;
  animation: musicBarBounce 0.9s ease-in-out infinite;
}
.music-bars span:nth-child(1) { height: 6px; animation-delay: 0s; }
.music-bars span:nth-child(2) { height: 12px; animation-delay: 0.2s; }
.music-bars span:nth-child(3) { height: 8px; animation-delay: 0.4s; }

@keyframes musicBarBounce {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

.font-controls-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.font-controls-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.font-controls {
  display: inline-flex;
  background: var(--surface-soft);
  border-radius: 9px;
  padding: 2px;
  border: 1px solid var(--emerald-border);
}
.font-btn {
  border: none;
  background: transparent;
  color: var(--emerald-deep);
  font-weight: 700;
  font-family: inherit;
  height: 30px;
  min-width: 30px;
  padding: 0 7px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.78rem;
}
.font-btn.active {
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-download-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  background: var(--emerald-deep);
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0 11px;
  border-radius: 9px;
  white-space: nowrap;
}
.btn-download-top:hover { background: var(--emerald-main); }

@media (max-width: 520px) {
  .btn-music-top .music-label, .font-controls-label { display: none; }
  .btn-music-top { padding: 0 9px; }
}

/* Slide-out Drawer */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(9, 54, 40, 0.42);
  z-index: 90;
  backdrop-filter: blur(2px);
}
.toc-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(320px, 86vw);
  background: #FFFFFF;
  z-index: 100;
  box-shadow: 8px 0 32px rgba(9, 54, 40, 0.2);
  display: flex; flex-direction: column;
  padding: 18px 16px 24px;
  overflow-y: auto;
}
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--emerald-border);
}
.drawer-header h3 {
  font-family: var(--font-serif);
  margin: 0; font-size: 1.05rem;
  color: var(--emerald-deep);
}
.btn-close-drawer {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--emerald-border);
  background: var(--cream-bg);
  color: var(--emerald-deep);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.drawer-links { display: grid; gap: 5px; }
.drawer-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px;
  text-decoration: none; color: var(--text-main);
  font-size: 0.89rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.drawer-links a:hover, .drawer-links a.active {
  background: var(--emerald-soft);
  color: var(--emerald-deep);
  font-weight: 700;
}
.drawer-num {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--cream-bg); color: var(--emerald-deep);
  font-size: 0.72rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drawer-links a.active .drawer-num {
  background: var(--emerald-main);
  color: #FFFFFF;
}

/* ================= READER WORKSPACE ================= */
.reader-workspace {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 14px 72px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

.desktop-sidebar { display: none; }
.reader-container { max-width: 800px; margin: 0 auto; width: 100%; }

.welcome-banner {
  background: #FFFFFF;
  border: 1px solid var(--emerald-border);
  border-left: 4px solid var(--emerald-main);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-card);
}
.welcome-banner p { margin: 0; font-size: 0.92rem; color: var(--text-heading); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.btn-pdf-large {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--emerald-deep); color: #FFFFFF;
  text-decoration: none; font-weight: 700; font-size: 0.88rem;
  padding: 10px 15px; border-radius: 10px;
}
.btn-toc-inline {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--emerald-soft); color: var(--emerald-deep);
  border: 1px solid var(--emerald-border);
  font-family: inherit; font-weight: 700; font-size: 0.88rem;
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
.btn-share-gift {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--gold-bg); color: #8A5D12;
  border: 1px solid var(--gold-light);
  font-family: inherit; font-weight: 700; font-size: 0.88rem;
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
}

/* Luminous Emerald Cover Hero inside Reader */
.ebook-cover {
  background:
    linear-gradient(148deg, rgba(9, 54, 40, 0.88) 0%, rgba(20, 108, 67, 0.78) 54%, rgba(9, 54, 40, 0.92) 100%),
    url('images/ebook-cover-art.jpg') center/cover no-repeat;
  color: #FFFFFF;
  border-radius: 26px;
  padding: 36px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-elevated);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 213, 167, 0.45);
}
.ebook-cover::after {
  content: "";
  position: absolute; inset: 11px;
  border: 1px solid rgba(232, 213, 167, 0.3);
  border-radius: 18px; pointer-events: none;
}
.ebook-cover-inner { position: relative; z-index: 2; }
.cover-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.76rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #F6E6BC; margin-bottom: 10px;
}
.ebook-cover h1 {
  font-family: var(--font-serif);
  margin: 0 0 10px;
  font-size: 1.72rem; line-height: 1.26; font-weight: 700;
}
.ebook-cover .cover-sub {
  margin: 0 0 20px; font-size: 0.98rem;
  color: #E3F5EC; line-height: 1.6;
}
.cover-for-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(232, 213, 167, 0.3);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  backdrop-filter: blur(6px);
}
.cover-for-box p { margin: 0 0 8px; font-weight: 700; font-size: 0.92rem; color: #F6E6BC; }
.cover-for-box ul { margin: 0; padding-left: 20px; font-size: 0.9rem; line-height: 1.62; color: #F8FAFC; }
.cover-for-box li { margin-bottom: 5px; }
.cover-author {
  margin: 0; font-size: 0.86rem; color: #D1FAE5;
  padding-top: 14px; border-top: 1px solid rgba(232, 213, 167, 0.25);
}

/* ================= CARDS & EDITORIAL SECTIONS ================= */
.section-card {
  background: var(--surface);
  border: 1px solid #E3ECE6;
  border-radius: var(--radius-xl);
  padding: 26px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

/* Sacred "Lưu Ý Quan Trọng Trước Khi Đọc" Luxury Framed Letter */
.preface-card {
  background: linear-gradient(180deg, #FFFDF7 0%, #FCF8EE 100%);
  border: 1.5px solid var(--gold-light);
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  margin-bottom: 24px;
  box-shadow: 0 12px 32px rgba(184, 134, 43, 0.09);
  position: relative;
}

.preface-seal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--emerald-deep);
  color: #F6E6BC;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.preface-card h2 {
  font-family: var(--font-serif);
  margin: 0 0 14px;
  font-size: 1.38rem;
  color: var(--emerald-deep);
}

.preface-pledges {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.pledge-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #FFFFFF;
  border: 1px solid #EFE4C8;
  border-radius: 14px;
  padding: 14px 15px;
}

.pledge-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--emerald-soft);
  color: var(--emerald-deep);
  font-weight: 800;
  font-size: 0.84rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.chapter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #EAF0EC;
}

.chapter-meta {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--emerald-main);
  margin-bottom: 4px;
}

.section-card h2 {
  font-family: var(--font-serif);
  margin: 0;
  font-size: 1.38rem;
  line-height: 1.32;
  color: var(--emerald-deep);
}

.section-card h3 {
  font-family: var(--font-serif);
  color: var(--emerald-deep);
  font-size: 1.12rem;
  margin: 20px 0 10px;
}

.chapter-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold-light);
  flex-shrink: 0;
}

.pull-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.68;
  color: var(--emerald-deep);
  background: linear-gradient(135deg, var(--gold-bg) 0%, var(--emerald-soft) 100%);
  border-left: 4px solid var(--gold-main);
  padding: 16px 18px;
  border-radius: 0 14px 14px 0;
  margin: 16px 0 18px;
}

.callout {
  border-radius: 15px;
  padding: 15px 17px;
  margin: 16px 0;
  font-size: 0.94rem;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-success {
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  color: var(--emerald-deep);
}
.callout-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
}

/* Dual Perspective Box (70% Tây Y + 30% Đông Y) */
.dual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0;
}
.dual-card {
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--emerald-border);
  background: #FAFDFB;
}
.dual-card.eastern {
  background: var(--gold-bg);
  border-color: var(--gold-light);
}
.dual-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--emerald-main);
  color: #FFFFFF;
  margin-bottom: 8px;
}
.dual-card.eastern .dual-pill {
  background: var(--gold-main);
}
.dual-card h3 { margin: 0 0 8px !important; font-size: 1.05rem; }

/* Figures & Lightbox */
.figure-box {
  position: relative;
  margin: 20px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #E3ECE6;
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
}
.figure-box.zoomable { cursor: zoom-in; }
.figure-box img { width: 100%; display: block; }
.zoom-hint {
  position: absolute; top: 10px; right: 10px;
  background: rgba(9, 54, 40, 0.8);
  color: #FFFFFF;
  font-size: 0.72rem; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
  backdrop-filter: blur(4px);
}
.figure-caption {
  padding: 12px 15px;
  font-size: 0.84rem;
  color: var(--text-muted);
  background: #FAFBF9;
  border-top: 1px solid #EEF3EF;
}

/* Survey Box */
.survey-box {
  background: var(--surface-soft);
  border: 1px solid var(--emerald-border);
  border-radius: 16px;
  padding: 18px;
}
.radio-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.radio-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px;
  background: #FFFFFF; border: 1.5px solid #D5E2DA;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.radio-pill input { accent-color: var(--emerald-main); width: 17px; height: 17px; }

/* ================= INTERACTIVE TOOL #1: 2-MINUTE QUIZ ================= */
.quiz-group {
  border: 1px solid #E3ECE6;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  background: #FCFDFB;
}
.quiz-group-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.quiz-group-header h3 { margin: 0 !important; font-size: 1rem; }
.score-badge {
  background: var(--emerald-soft);
  color: var(--emerald-deep);
  font-size: 0.78rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.check-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 12px; margin-bottom: 8px;
  border-radius: 12px; border: 1.5px solid #E3ECE6;
  background: #FFFFFF; cursor: pointer; font-size: 0.93rem;
  transition: all 0.16s ease;
}
.check-item:last-child { margin-bottom: 0; }
.check-item.checked {
  background: var(--emerald-soft);
  border-color: var(--emerald-main);
}
.check-item input[type="checkbox"] {
  width: 20px; height: 20px; flex-shrink: 0;
  accent-color: var(--emerald-main); margin-top: 2px;
}

.quiz-result-box {
  background: linear-gradient(135deg, #093628 0%, #146C43 100%);
  color: #FFFFFF;
  border-radius: 18px;
  padding: 20px;
  margin-top: 16px;
}
.quiz-result-box h3 { color: #F6E6BC !important; margin: 0 0 8px !important; font-size: 1.1rem; }
.quiz-result-box p, .quiz-result-box li { color: #ECFDF5; font-size: 0.93rem; }
.quiz-result-box a { color: #F6E6BC; font-weight: 700; }

/* ================= INTERACTIVE TOOL #2: 15 TRAP-BUSTER CARDS ================= */
.food-search-wrap {
  position: relative;
  margin: 14px 0 12px;
}
.food-search-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 16px 11px 42px;
  border-radius: 13px;
  border: 1.5px solid var(--emerald-border);
  background: #FFFFFF;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text-heading);
}
.food-search-input:focus {
  outline: none;
  border-color: var(--emerald-main);
  box-shadow: 0 0 0 3px rgba(20, 108, 67, 0.12);
}
.food-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--emerald-main); pointer-events: none;
}
.food-search-status {
  font-size: 0.84rem; color: var(--text-muted); margin: 0 0 10px;
}

.filter-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 16px;
}
.filter-tab {
  min-height: 38px; padding: 6px 13px;
  border-radius: 999px;
  border: 1.5px solid #D5E2DA;
  background: #FFFFFF;
  color: var(--text-main);
  font-family: inherit; font-size: 0.84rem; font-weight: 700;
  cursor: pointer; transition: all 0.16s ease;
}
.filter-tab:hover { border-color: var(--emerald-main); }
.filter-tab.active {
  background: var(--emerald-deep);
  border-color: var(--emerald-deep);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(9, 54, 40, 0.22);
}

.trap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.trap-card {
  border: 1px solid #E3ECE6;
  border-radius: 16px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 4px 16px rgba(9, 54, 40, 0.04);
}
.trap-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px;
  background: #FAFBF9;
  border-bottom: 1px solid #EDF3EF;
}
.trap-title {
  font-family: var(--font-serif);
  font-weight: 700; font-size: 1rem;
  color: var(--emerald-deep);
  margin: 0;
}
.trap-cat-pill {
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  background: var(--gold-bg); color: #8A5D12;
  border: 1px solid var(--gold-light);
  white-space: nowrap;
}
.trap-body {
  display: grid;
  grid-template-columns: 1fr;
}
.trap-wrong, .trap-right {
  padding: 13px 16px;
  font-size: 0.9rem;
  line-height: 1.58;
}
.trap-wrong {
  background: #FFF8F8;
  border-bottom: 1px solid #FEE2E2;
}
.trap-right {
  background: #F4FBF7;
}
.trap-label-bad {
  display: inline-block; font-size: 0.74rem; font-weight: 800;
  text-transform: uppercase; color: var(--danger-text);
  margin-bottom: 4px;
}
.trap-label-good {
  display: inline-block; font-size: 0.74rem; font-weight: 800;
  text-transform: uppercase; color: var(--emerald-main);
  margin-bottom: 4px;
}

/* ================= INTERACTIVE TOOL #3: 3-2-1 MEAL BUILDER ================= */
.plate-bar {
  display: flex;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0 16px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #FFFFFF;
}
.plate-seg-3 { width: 50%; background: #B8862B; display: flex; align-items: center; justify-content: center; }
.plate-seg-2 { width: 33%; background: #146C43; display: flex; align-items: center; justify-content: center; }
.plate-seg-1 { width: 17%; background: #38A169; display: flex; align-items: center; justify-content: center; }

.builder-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0;
}
.builder-tab {
  min-height: 40px; padding: 8px 14px;
  border-radius: 11px;
  border: 1.5px solid var(--emerald-border);
  background: #FFFFFF;
  color: var(--emerald-deep);
  font-family: inherit; font-size: 0.86rem; font-weight: 700;
  cursor: pointer; transition: all 0.16s ease;
}
.builder-tab.active {
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald-main));
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 5px 14px rgba(20, 108, 67, 0.24);
}

.builder-panel {
  border: 1.5px solid var(--emerald-border);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FCF9 100%);
}
.builder-panel h3 { margin: 0 0 12px !important; }
.builder-slots {
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
.builder-slot {
  background: #FFFFFF;
  border: 1px solid #E3ECE6;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
}
.slot-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 800;
  padding: 2px 9px; border-radius: 999px; margin-bottom: 5px;
  color: #FFFFFF;
}
.slot-tag.carb { background: #B8862B; }
.slot-tag.prot { background: #146C43; }
.slot-tag.veg { background: #38A169; }
.builder-tip {
  margin-top: 12px; padding: 12px 14px;
  border-radius: 12px; background: var(--gold-bg);
  border: 1px solid var(--gold-light);
  font-size: 0.89rem; color: #6B470D;
}

/* ================= 3-DAY SAMPLE MENU TABS ================= */
.day-menu-block {
  display: grid; gap: 10px;
}
.meal-card {
  display: grid; grid-template-columns: 1fr; gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #E3ECE6;
  background: #FFFFFF;
}
.meal-time {
  font-weight: 800; font-size: 0.84rem;
  color: var(--emerald-main);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.meal-desc { font-size: 0.94rem; color: var(--text-heading); }

/* ================= CTA & ZALO BUTTONS ================= */
.cta-step {
  border: 1px solid #E3ECE6;
  border-radius: 18px;
  padding: 20px 18px;
  margin-bottom: 16px;
  background: #FFFFFF;
}
.cta-step h3 { margin: 0 0 8px !important; }

.btn-zalo-group, .btn-zalo-personal, .btn-zalo-coach {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px;
  color: #FFFFFF !important; text-decoration: none;
  font-weight: 700; font-size: 0.94rem;
  padding: 12px 18px; border-radius: 12px; text-align: center; margin-top: 8px;
}
.btn-zalo-group { background: #146C43; box-shadow: 0 5px 14px rgba(20, 108, 67, 0.24); }
.btn-zalo-personal { background: var(--zalo-blue); box-shadow: 0 5px 14px rgba(0, 104, 255, 0.24); }
.btn-zalo-coach { background: var(--emerald-deep); box-shadow: 0 5px 14px rgba(9, 54, 40, 0.26); }

.msg-preview {
  background: var(--cream-bg);
  border: 1px dashed var(--emerald-main);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.89rem;
  margin: 10px 0;
  line-height: 1.6;
  white-space: pre-line;
}
.btn-copy-msg {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 46px;
  background: var(--emerald-soft); color: var(--emerald-deep);
  border: 1.5px solid var(--emerald-border);
  font-family: inherit; font-weight: 700; font-size: 0.92rem;
  padding: 10px 16px; border-radius: 12px; cursor: pointer; margin-top: 6px;
}

/* ================= 31 ZALO FEEDBACK GALLERY ================= */
.feedback-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
  align-items: start;
}
.fb-card {
  margin: 0;
  background: #FFFFFF;
  border: 1px solid #E3ECE6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
}
.fb-card.fb-wide { grid-column: 1 / -1; }
.fb-card img { width: 100%; height: auto; display: block; background: #F8FAFC; }
.fb-card .figure-caption {
  font-weight: 600; font-size: 0.8rem; line-height: 1.45;
  padding: 9px 10px; color: var(--text-heading);
}
.fb-card .fb-tag {
  display: inline-block; font-size: 0.69rem; font-weight: 700;
  color: var(--emerald-main); background: var(--emerald-soft);
  padding: 2px 8px; border-radius: 999px; margin-bottom: 4px;
}

/* ================= FOOTER, LIGHTBOX, TOAST, BACK-TO-TOP ================= */
.footer-sign {
  text-align: center; padding: 26px 16px 10px;
  color: var(--text-muted); font-size: 0.9rem;
}
.footer-name {
  font-family: var(--font-serif);
  color: var(--emerald-deep);
  font-size: 1.08rem; font-weight: 700; margin: 8px 0 14px;
}
.social-pills {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.social-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 999px;
  background: #FFFFFF; border: 1px solid var(--emerald-border);
  color: var(--emerald-deep); text-decoration: none;
  font-size: 0.84rem; font-weight: 600;
}
.social-pill:hover { background: var(--emerald-soft); }
.music-credit { margin: 14px 0 0; font-size: 0.74rem; opacity: 0.78; }

.lightbox-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6, 30, 22, 0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(6px);
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.lightbox-img { max-width: 94vw; max-height: 80vh; border-radius: 12px; object-fit: contain; }
.lightbox-cap { color: #E6F4EC; font-size: 0.88rem; margin-top: 12px; text-align: center; max-width: 680px; }

.toast-pill {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--emerald-deep); color: #FFFFFF;
  padding: 11px 18px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 600;
  box-shadow: 0 12px 30px rgba(9, 54, 40, 0.3);
  opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 210;
  max-width: 92vw; text-align: center;
}
.toast-pill.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.back-to-top {
  position: fixed; right: 18px; bottom: 20px;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--emerald-border);
  background: rgba(255, 255, 255, 0.95); color: var(--emerald-deep);
  box-shadow: 0 6px 20px rgba(9, 54, 40, 0.16);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 55;
}
.back-to-top:hover { background: var(--emerald-deep); color: #FFFFFF; }

/* ================= DESKTOP RESPONSIVE ================= */
@media (min-width: 768px) {
  :root { --font-size-base: 18px; }
  .gate-wrapper { padding: 36px 24px 56px; }
  .gate-card { grid-template-columns: 1.15fr 0.95fr; }
  .gate-hero { padding: 40px 34px; display: flex; flex-direction: column; justify-content: center; }
  .gate-hero h1 { font-size: 1.92rem; }
  .gate-form-panel { padding: 40px 32px; display: flex; flex-direction: column; justify-content: center; }
  .book-mockup { width: 126px; min-width: 126px; height: 174px; }
  .proof-grid { grid-template-columns: repeat(3, 1fr); }
  .dual-grid { grid-template-columns: 1fr 1fr; }
  .trap-body { grid-template-columns: 1fr 1fr; }
  .trap-wrong { border-bottom: none; border-right: 1px solid #FEE2E2; }
  .builder-slots { grid-template-columns: repeat(3, 1fr); }
  .meal-card { grid-template-columns: 130px 1fr; align-items: start; }
  .section-card, .preface-card { padding: 32px 34px; }
  .ebook-cover { padding: 42px 38px; }
  .ebook-cover h1 { font-size: 2.1rem; }
  .welcome-banner { flex-direction: row; align-items: center; justify-content: space-between; }
  .feedback-gallery { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .btn-zalo-group, .btn-zalo-personal, .btn-zalo-coach, .btn-copy-msg { width: auto; padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 1080px) {
  .reader-workspace {
    grid-template-columns: 270px minmax(0, 790px);
    justify-content: center;
    padding: 28px 24px 88px;
  }
  .desktop-sidebar {
    display: block; position: sticky; top: 76px;
    background: #FFFFFF; border: 1px solid var(--emerald-border);
    border-radius: 20px; padding: 16px; box-shadow: var(--shadow-card);
    max-height: calc(100vh - 96px); overflow-y: auto;
  }
  .ring-card {
    display: flex; align-items: center; gap: 12px; padding: 14px;
    border-radius: 15px;
    background: linear-gradient(135deg, #093628 0%, #146C43 70%, #238659 100%);
    color: #FFFFFF; margin-bottom: 14px;
  }
  .ring-wrap { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
  .ring-wrap svg { transform: rotate(-90deg); }
  .ring-pct {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 0.74rem; font-weight: 800; color: #FFFFFF;
  }
  .ring-info { font-size: 0.78rem; line-height: 1.4; }
  .ring-info strong { display: block; font-size: 0.86rem; color: #F6E6BC; }
  .sidebar-nav-title {
    font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted); margin: 4px 0 8px 6px;
  }
  .sidebar-pdf-btn {
    margin-top: 14px; width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 14px; border-radius: 11px;
    background: var(--gold-bg); border: 1.5px solid var(--gold-light);
    color: var(--emerald-deep); font-weight: 700; font-size: 0.84rem; text-decoration: none;
  }
  .sidebar-pdf-btn:hover { background: var(--emerald-soft); border-color: var(--emerald-main); }
}

/* ================= PRINT STYLES (PDF) ================= */
@media print {
  .reader-topbar, .welcome-banner, .drawer-backdrop, .toc-drawer, .desktop-sidebar,
  .back-to-top, .filter-tabs, .food-search-wrap, .food-search-status, .builder-tabs,
  .zoom-hint, .lightbox-modal, .toast-pill, .btn-copy-msg, .btn-share-gift, #gate-view {
    display: none !important;
  }
  .day-menu-block.hidden, .trap-card.hidden { display: block !important; }
  .day-menu-block.hidden { display: grid !important; margin-top: 14px; }
  .print-only { display: block !important; }
  #reader-view { display: block !important; }
  .reader-workspace { display: block !important; padding: 0 !important; }
  body {
    background: #FFFFFF; font-size: 10.5pt; line-height: 1.55;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .reader-container { max-width: 100%; padding: 0; }
  .section-card, .preface-card, .figure-box, .trap-card, .cta-step, .meal-card {
    box-shadow: none; break-inside: avoid-page;
  }
  .feedback-gallery { grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important; }
  .fb-card.hidden { display: flex !important; }
  .fb-card img { max-height: 220px; object-fit: contain; }
  .fb-card.fb-wide img { max-height: 290px; }
  .fb-card .figure-caption { font-size: 8.5pt; padding: 6px 8px; }
}
