/* ==========================================================================
   LEXPREP ACADEMY — CALM, SOFT, SUBTLE 4K EDITORIAL LEARNING UI (2026)
   ========================================================================== */
:root {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --linen: #F2EFE9;
  --linen-2: #EAE5DC;
  --navy: #16263D;
  --navy-soft: #243A59;
  --ink: #1D2430;
  --body: #475467;
  --muted: #768396;
  --gold: #B08D57;
  --gold-soft: rgba(176, 141, 87, 0.14);
  --sage: #2C6E54;
  --sage-soft: rgba(44, 110, 84, 0.11);
  --rose: #B44B42;
  --rose-soft: rgba(180, 75, 66, 0.10);
  --line: rgba(22, 38, 61, 0.085);
  --line-strong: rgba(22, 38, 61, 0.16);
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --shadow-xs: 0 2px 10px rgba(22, 38, 61, 0.035);
  --shadow-sm: 0 8px 26px rgba(22, 38, 61, 0.06);
  --shadow-md: 0 18px 46px rgba(22, 38, 61, 0.08);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  background-image: radial-gradient(circle at 12% 0%, rgba(176, 141, 87, 0.07), transparent 42%),
                    radial-gradient(circle at 92% 18%, rgba(22, 38, 61, 0.04), transparent 45%);
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--navy); text-decoration: none; }

/* TOPBAR */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 20px;
  background: rgba(250, 248, 244, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1340px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(145deg, var(--navy-soft), var(--navy));
  color: #FAF8F4; display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.04em;
  box-shadow: var(--shadow-xs);
}
.brand-name { font-weight: 700; font-size: 0.96rem; color: var(--navy); line-height: 1.15; }
.brand-name span { font-weight: 500; color: var(--gold); }
.brand-sub { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.02em; }

.nav-pills {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 4px; border-radius: 999px; box-shadow: var(--shadow-xs);
  overflow-x: auto; scrollbar-width: none; min-width: 0;
}
.nav-pills::-webkit-scrollbar { display: none; }
.nav-btn {
  padding: 7px 11px; border-radius: 999px; font-size: 0.77rem; font-weight: 600;
  color: var(--body); white-space: nowrap; transition: all 0.28s var(--ease);
}
.nav-btn:hover { color: var(--navy); background: var(--linen); }
.nav-btn.active { background: var(--navy); color: #FAF8F4; box-shadow: 0 4px 14px rgba(22, 38, 61, 0.18); }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.xp-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600; color: var(--navy);
}
.xp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

.lang-switch {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--linen); border: 1px solid var(--line-strong);
}
.lang-btn {
  padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.05em; color: var(--muted); transition: all 0.25s var(--ease);
}
.lang-btn.active { background: var(--navy); color: #FAF8F4; }

/* MAIN SHELL */
.shell { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }
.panel { display: none; animation: fadeUp 0.4s var(--ease); }
.panel.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HERO CARD */
.hero-card {
  display: grid; grid-template-columns: 1.25fr 0.95fr; gap: 36px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 38px 40px; box-shadow: var(--shadow-sm); margin-bottom: 36px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line); font-size: 0.69rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--navy); margin-bottom: 18px;
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.hero-copy h1 {
  font-family: var(--serif); font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; color: var(--navy); margin-bottom: 16px;
}
.hero-copy h1 em { font-style: italic; color: var(--gold); font-weight: 500; }
.lead { font-size: 0.94rem; color: var(--body); line-height: 1.75; margin-bottom: 24px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; font-size: 0.84rem; font-weight: 600;
  transition: all 0.28s var(--ease);
}
.btn-primary { background: var(--navy); color: #FAF8F4; }
.btn-primary:hover { background: var(--navy-soft); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(22, 38, 61, 0.16); }
.btn-soft { background: var(--linen); color: var(--navy); border: 1px solid var(--line); }
.btn-soft:hover { background: var(--linen-2); }
.btn-ghost { padding: 7px 14px; font-size: 0.78rem; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--navy); background: var(--surface); }
.btn-gold { background: var(--gold); color: #FFF; }
.btn-gold:hover { filter: brightness(0.95); }

/* SCORE PANEL */
.score-panel {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px;
}
.score-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 16px;
}
.mono-tag, .mono { font-family: var(--mono); }
.mono-tag {
  font-size: 0.68rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold);
}
.score-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px;
}
.metric-val { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.metric-val span { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.metric-cap { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.76rem; font-weight: 600; color: var(--body); margin-bottom: 8px; }
.progress-track { height: 7px; border-radius: 999px; background: var(--linen-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--navy), var(--gold)); transition: width 0.5s var(--ease); }

/* SECTION HEADERS */
.section-head, .module-header {
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px;
  margin-bottom: 22px;
}
.section-kicker {
  display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
}
.section-head h2, .module-header h2 {
  font-family: var(--serif); font-size: clamp(1.65rem, 2.5vw, 2.2rem);
  font-weight: 600; color: var(--navy); line-height: 1.15;
}
.sub { font-size: 0.88rem; color: var(--body); margin-top: 6px; max-width: 680px; }

/* SUBTABS */
.subtab-bar { display: flex; flex-wrap: wrap; gap: 6px; background: var(--linen); padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.subtab {
  padding: 7px 15px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: var(--body); transition: all 0.25s var(--ease);
}
.subtab.active { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-xs); }
.subpanel { display: none; animation: fadeUp 0.35s var(--ease); }
.subpanel.active { display: block; }

/* CARDS & GRIDS */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 24px; box-shadow: var(--shadow-xs); transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.format-card { cursor: pointer; }
.format-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.format-num { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--gold); margin-bottom: 8px; }
.format-card h3 { font-family: var(--serif); font-size: 1.35rem; color: var(--navy); margin-bottom: 6px; }
.format-meta { font-size: 0.75rem; font-weight: 600; color: var(--sage); margin-bottom: 10px; }
.format-card p { font-size: 0.82rem; color: var(--body); line-height: 1.6; }

/* ROADMAP */
.roadmap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.phase-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.phase-tag { font-family: var(--mono); font-size: 0.7rem; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }
.phase-card h3 { font-family: var(--serif); font-size: 1.3rem; color: var(--navy); margin: 4px 0 14px; }
.check-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 10px;
  font-size: 0.82rem; color: var(--body); cursor: pointer; transition: background 0.2s;
}
.check-item:hover { background: var(--bg); }
.check-item input { margin-top: 3px; accent-color: var(--navy); width: 15px; height: 15px; flex-shrink: 0; }
.check-item.done span { text-decoration: line-through; color: var(--muted); }

/* READING: COMPLETE THE WORDS & PASSAGE */
.cloze-box {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 24px 26px; font-size: 1.02rem; line-height: 2.15; color: var(--ink); margin: 16px 0 20px;
}
.cloze-word { display: inline-flex; align-items: baseline; white-space: nowrap; }
.cloze-input {
  width: 78px; border: none; border-bottom: 2px solid var(--gold); background: var(--surface);
  font-family: var(--mono); font-size: 0.92rem; font-weight: 600; color: var(--navy);
  padding: 1px 6px; margin-left: 1px; border-radius: 4px 4px 0 0; outline: none; transition: all 0.2s;
}
.cloze-input:focus { border-bottom-color: var(--navy); background: #FFFDF8; }
.cloze-input.ok { border-bottom-color: var(--sage); background: var(--sage-soft); color: var(--sage); }
.cloze-input.bad { border-bottom-color: var(--rose); background: var(--rose-soft); color: var(--rose); }

.split-reading { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 22px; align-items: start; }
.passage-body {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 28px 30px; box-shadow: var(--shadow-xs); position: sticky; top: 86px;
}
.passage-body h3 { font-family: var(--serif); font-size: 1.5rem; color: var(--navy); margin-bottom: 14px; }
.passage-body p { font-size: 0.91rem; color: var(--ink); line-height: 1.82; margin-bottom: 14px; text-align: justify; }
.highlight-term { background: var(--gold-soft); padding: 1px 5px; border-radius: 4px; font-weight: 600; color: var(--navy); }

/* QUIZ QUESTIONS */
.q-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-xs);
}
.q-num { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--gold); margin-bottom: 8px; }
.q-text { font-size: 0.94rem; font-weight: 600; color: var(--navy); margin-bottom: 14px; line-height: 1.55; }
.q-options { display: grid; gap: 8px; }
.opt-btn {
  display: flex; align-items: flex-start; gap: 11px; text-align: left;
  padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--bg); font-size: 0.86rem; color: var(--ink); transition: all 0.22s var(--ease);
}
.opt-btn:hover:not(:disabled) { border-color: var(--navy); background: var(--surface); }
.opt-key {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 700; width: 24px; height: 24px;
  border-radius: 7px; background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; flex-shrink: 0; color: var(--navy);
}
.opt-btn.correct { border-color: var(--sage); background: var(--sage-soft); color: var(--sage); }
.opt-btn.correct .opt-key { background: var(--sage); color: #FFF; border-color: var(--sage); }
.opt-btn.wrong { border-color: var(--rose); background: var(--rose-soft); color: var(--rose); }
.opt-btn.wrong .opt-key { background: var(--rose); color: #FFF; border-color: var(--rose); }
.q-exp {
  margin-top: 12px; padding: 12px 15px; border-radius: var(--r-sm);
  background: var(--linen); font-size: 0.83rem; color: var(--body); line-height: 1.65;
  border-left: 3px solid var(--gold); display: none;
}
.q-exp.show { display: block; }

/* AUDIO PLAYER & VOICE STUDIO */
.audio-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  background: var(--navy); color: #FAF8F4; border-radius: var(--r-md);
  padding: 16px 20px; margin-bottom: 18px;
}
.audio-play {
  width: 42px; height: 42px; border-radius: 50%; background: var(--gold); color: #FFF;
  display: grid; place-items: center; font-size: 0.95rem; flex-shrink: 0; transition: transform 0.2s;
}
.audio-play:hover { transform: scale(1.06); }
.audio-info { flex: 1; min-width: 180px; }
.audio-title { font-weight: 600; font-size: 0.9rem; }
.audio-sub { font-size: 0.75rem; color: rgba(250, 248, 244, 0.72); }
.speed-group { display: flex; gap: 4px; }
.speed-btn {
  padding: 5px 10px; border-radius: 999px; font-family: var(--mono); font-size: 0.72rem;
  color: rgba(250, 248, 244, 0.78); border: 1px solid rgba(250, 248, 244, 0.22);
}
.speed-btn.active { background: rgba(255, 255, 255, 0.18); color: #FFF; border-color: var(--gold); }
.transcript-box {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 16px 20px; font-size: 0.86rem; color: var(--body); line-height: 1.75;
  margin-bottom: 18px; display: none;
}
.transcript-box.show { display: block; }

/* WRITING: BUILD A SENTENCE PUZZLE */
.tile-zone {
  min-height: 58px; padding: 12px; border-radius: var(--r-sm);
  background: var(--bg); border: 1.5px dashed var(--line-strong);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
}
.tile-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.word-tile {
  padding: 7px 14px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--line-strong); font-size: 0.86rem; font-weight: 600;
  color: var(--navy); box-shadow: var(--shadow-xs); transition: all 0.2s var(--ease);
}
.word-tile:hover { transform: translateY(-2px); border-color: var(--gold); }
.word-tile.placed { background: var(--navy); color: #FAF8F4; border-color: var(--navy); }
.word-tile.used { opacity: 0.35; pointer-events: none; }

/* WRITING EDITOR */
.writing-area {
  width: 100%; min-height: 170px; padding: 16px 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--bg); font-family: var(--sans);
  font-size: 0.91rem; line-height: 1.75; color: var(--ink); resize: vertical; outline: none;
}
.writing-area:focus { border-color: var(--navy); background: var(--surface); }
.editor-meta {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 10px; font-size: 0.78rem; color: var(--muted);
}

/* SPEAKING RECORDER */
.rec-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.rec-btn {
  padding: 11px 20px; border-radius: 999px; font-size: 0.84rem; font-weight: 600;
  background: var(--rose); color: #FFF; display: inline-flex; align-items: center; gap: 8px;
}
.rec-btn.recording { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(180, 75, 66, 0.35); } 50% { box-shadow: 0 0 0 10px rgba(180, 75, 66, 0); } }
.live-stt {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 16px; min-height: 64px; font-size: 0.86rem; color: var(--body); font-style: italic;
}

/* BLACK'S LAW 3D FLASHCARDS */
.lex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.flashcard {
  perspective: 1100px; height: 265px; cursor: pointer;
}
.flashcard-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.6s var(--ease); transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--r-md); padding: 22px; display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--line); box-shadow: var(--shadow-xs);
}
.fc-front { background: var(--surface); }
.fc-back { background: var(--navy); color: #FAF8F4; transform: rotateY(180deg); }
.fc-cat { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); }
.fc-term { font-family: var(--serif); font-size: 1.65rem; font-weight: 600; color: var(--navy); line-height: 1.15; }
.fc-id { font-size: 0.82rem; color: var(--body); margin-top: 6px; }
.fc-def { font-size: 0.83rem; line-height: 1.6; color: rgba(250, 248, 244, 0.92); }
.fc-ex { font-size: 0.78rem; font-style: italic; color: #E4C99A; line-height: 1.5; border-top: 1px solid rgba(255,255,255,0.14); padding-top: 10px; }
.fc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fc-icon-btn {
  padding: 5px 11px; border-radius: 999px; font-size: 0.73rem; font-weight: 600;
  background: var(--linen); color: var(--navy);
}
.fc-back .fc-icon-btn { background: rgba(255,255,255,0.14); color: #FAF8F4; }
.fc-mastered { background: var(--sage-soft) !important; color: var(--sage) !important; }

/* RESOURCES & ERROR LOG */
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.res-card h3 { font-family: var(--serif); font-size: 1.35rem; color: var(--navy); margin-bottom: 8px; }
.res-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600;
  color: var(--gold); margin-top: 10px;
}
.res-link:hover { text-decoration: underline; }
.err-item {
  padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg);
  border-left: 3px solid var(--rose); margin-bottom: 10px; font-size: 0.83rem;
}
.err-item strong { color: var(--navy); }

/* FOOTER */
.footer { border-top: 1px solid var(--line); padding: 24px 20px; font-size: 0.78rem; color: var(--muted); }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer a { color: var(--gold); font-weight: 600; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .hero-card, .split-reading, .grid-4, .roadmap-grid, .lex-grid, .res-grid, .lesson-layout, .vblock-grid { grid-template-columns: 1fr; }
  .passage-body, .lesson-sidebar { position: static; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav-pills { order: 3; width: 100%; }
  .hero-card { padding: 24px 20px; }
  .shell { padding: 20px 14px 60px; }
  .editorial-banner { height: 220px; }
}

/* ==================== NEW EDITORIAL VISUALS & STUDY MODULES ==================== */
.hero-mini-stats {
  display: inline-flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line);
}
.hms-item { font-size: 0.8rem; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
.hms-item strong { font-family: var(--serif); font-size: 1.35rem; color: var(--navy); font-weight: 700; }
.hms-sep { width: 1px; height: 20px; background: var(--line-strong); }

.hero-visual-wrap {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--linen);
}
.hero-img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  transition: transform 0.8s var(--ease);
}
.hero-visual-wrap:hover .hero-img { transform: scale(1.025); }
.hero-float-badge {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 12px; padding: 12px 15px;
  border-radius: 14px; background: rgba(250, 248, 244, 0.88);
  backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 26px rgba(22, 38, 61, 0.14);
}
.hfb-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--navy); color: #FAF8F4;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0;
}
.hfb-title { font-size: 0.84rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.hfb-title span { color: var(--gold); font-weight: 600; }
.hfb-sub { font-size: 0.73rem; color: var(--body); margin-top: 2px; }

/* EDITORIAL BANNER */
.editorial-banner {
  position: relative; height: 250px; border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 26px; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.editorial-banner.compact { height: 215px; }
.editorial-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.editorial-banner-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px 32px;
  background: linear-gradient(90deg, rgba(16, 28, 46, 0.84) 0%, rgba(16, 28, 46, 0.52) 55%, rgba(16, 28, 46, 0.16) 100%);
}
.editorial-banner-overlay h2 { font-family: var(--serif); font-size: clamp(1.65rem, 2.6vw, 2.35rem); font-weight: 600; line-height: 1.12; }

/* STUDY MODULES READER */
.lesson-layout { display: grid; grid-template-columns: 310px 1fr; gap: 24px; align-items: start; }
.lesson-sidebar {
  position: sticky; top: 86px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 6px;
}
.lesson-nav-item {
  width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px;
  border: 1px solid transparent; transition: all 0.25s var(--ease);
  display: flex; align-items: flex-start; gap: 11px;
}
.lesson-nav-item:hover { background: var(--bg); }
.lesson-nav-item.active { background: var(--navy); color: #FAF8F4; box-shadow: var(--shadow-xs); }
.ln-num {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 700; padding: 3px 7px;
  border-radius: 6px; background: var(--linen); color: var(--navy); flex-shrink: 0; margin-top: 2px;
}
.lesson-nav-item.active .ln-num { background: rgba(255,255,255,0.16); color: #E8CE9B; }
.ln-title { font-size: 0.82rem; font-weight: 600; line-height: 1.35; }
.ln-meta { font-size: 0.7rem; color: var(--muted); margin-top: 3px; }
.lesson-nav-item.active .ln-meta { color: rgba(250,248,244,0.72); }
.ln-done { color: var(--sage); font-weight: 700; }
.lesson-nav-item.active .ln-done { color: #8FE0B5; }

.lesson-reader {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 32px 36px; box-shadow: var(--shadow-xs);
}
.lesson-reader h3 {
  font-family: var(--serif); font-size: clamp(1.7rem, 2.5vw, 2.15rem);
  color: var(--navy); line-height: 1.15; margin-bottom: 8px;
}
.lesson-audio-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--line-strong);
  font-size: 0.8rem; font-weight: 600; color: var(--navy); margin: 16px 0 22px;
  transition: all 0.25s var(--ease);
}
.lesson-audio-pill:hover { border-color: var(--gold); background: var(--surface); }
.wave-bars { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 14px; }
.wave-bars span { width: 2.5px; background: var(--gold); border-radius: 2px; height: 5px; }
.wave-bars.playing span:nth-child(1) { animation: wave 0.8s infinite 0.0s; }
.wave-bars.playing span:nth-child(2) { animation: wave 0.8s infinite 0.15s; }
.wave-bars.playing span:nth-child(3) { animation: wave 0.8s infinite 0.3s; }
.wave-bars.playing span:nth-child(4) { animation: wave 0.8s infinite 0.45s; }
@keyframes wave { 0%,100% { height: 4px; } 50% { height: 14px; } }

.lesson-sec { margin-bottom: 26px; }
.lesson-sec h4 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.lesson-sec p { font-size: 0.92rem; color: var(--body); line-height: 1.8; max-width: 68ch; }

.vblock-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.vblock {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 15px 17px; border-top: 3px solid var(--gold);
}
.vblock-tag { font-family: var(--mono); font-size: 0.68rem; font-weight: 700; color: var(--gold); letter-spacing: 0.06em; }
.vblock-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--navy); margin: 3px 0 5px; }
.vblock-desc { font-size: 0.82rem; color: var(--body); line-height: 1.55; }

.compare-box {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 18px 20px; margin: 22px 0 26px;
}
.compare-title { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.compare-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--line); font-size: 0.83rem; line-height: 1.55;
}
.cmp-bad { color: var(--rose); background: var(--rose-soft); padding: 9px 12px; border-radius: 9px; }
.cmp-good { color: var(--sage); background: var(--sage-soft); padding: 9px 12px; border-radius: 9px; font-weight: 500; }

.lesson-footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 20px; border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .compare-row { grid-template-columns: 1fr; }
  .lesson-reader { padding: 22px 18px; }
}

/* ==================== LAW VIBES COLOR ACCENTS & SECTION TIPS ==================== */
:root {
  --burgundy: #7A2E3A;
  --burgundy-soft: rgba(122, 46, 58, 0.085);
  --sapphire: #1D436B;
  --sapphire-soft: rgba(29, 67, 107, 0.085);
  --emerald: #1F6852;
  --emerald-soft: rgba(31, 104, 82, 0.09);
}

.format-card { position: relative; overflow: hidden; }
.format-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--gold);
}
.format-card:nth-child(1)::before { background: linear-gradient(90deg, var(--burgundy), #B4535E); }
.format-card:nth-child(2)::before { background: linear-gradient(90deg, var(--sapphire), #3B6EA5); }
.format-card:nth-child(3)::before { background: linear-gradient(90deg, var(--gold), #D4AF6A); }
.format-card:nth-child(4)::before { background: linear-gradient(90deg, var(--emerald), #3C9478); }

.section-tip-card {
  border-radius: var(--r-md); padding: 18px 22px; margin-bottom: 22px;
  border: 1px solid var(--line); box-shadow: var(--shadow-xs);
  background: var(--surface); border-left: 4px solid var(--gold);
}
.section-tip-card.accent-burgundy { background: linear-gradient(135deg, #FFFDFC, var(--burgundy-soft)); border-left-color: var(--burgundy); }
.section-tip-card.accent-sapphire { background: linear-gradient(135deg, #FCFDFE, var(--sapphire-soft)); border-left-color: var(--sapphire); }
.section-tip-card.accent-emerald  { background: linear-gradient(135deg, #FCFEFD, var(--emerald-soft)); border-left-color: var(--emerald); }
.section-tip-card.accent-gold     { background: linear-gradient(135deg, #FFFDF9, var(--gold-soft)); border-left-color: var(--gold); }

.tip-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 700; color: var(--navy);
  letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
}
.tip-list { margin-top: 11px; padding-left: 18px; display: grid; gap: 6px; font-size: 0.84rem; color: var(--body); line-height: 1.62; }
.tip-list strong { color: var(--navy); }
.short-doc-card {
  background: linear-gradient(180deg, #FFFFFF, #FCFBF8);
  border: 1px solid var(--line-strong); border-top: 4px solid var(--burgundy);
  border-radius: var(--r-md); padding: 22px 24px; margin-bottom: 16px;
}
.short-doc-body {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 16px 18px; font-size: 0.88rem; color: var(--ink); line-height: 1.75; margin: 12px 0 18px;
}

/* ==================== PER-QUESTION TIPS & A-Z BLACK'S LAW BAR ==================== */
.q-head-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.q-head-row .q-num { margin-bottom: 0; }
.q-tip-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px;
  border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  background: var(--gold-soft); color: #8A682E; border: 1px solid rgba(176, 141, 87, 0.35);
  transition: all 0.2s var(--ease);
}
.q-tip-btn:hover { background: var(--gold); color: #FFF; border-color: var(--gold); }
.q-tip-box {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 10px;
  background: #FFFDF7; border: 1px solid rgba(176, 141, 87, 0.35);
  border-left: 3px solid var(--gold); font-size: 0.81rem; color: var(--navy); line-height: 1.55;
  display: none;
}
.q-tip-box.show { display: block; animation: fadeUp 0.25s var(--ease); }

.lex-controls {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-bottom: 12px;
}
.az-bar {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px;
}
.az-btn {
  min-width: 30px; height: 28px; padding: 0 8px; border-radius: 8px;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--body);
  transition: all 0.18s var(--ease);
}
.az-btn:hover { border-color: var(--navy); color: var(--navy); }
.az-btn.active { background: var(--navy); color: #FAF8F4; border-color: var(--navy); }
