/* ==========================================================================
   Stylish English — Lesson View + Mobile layout + Chunky UI (css/lesson-view.css)
   When a lesson is opened, <body> gets .lesson-view and the lesson card
   (.lesson-card.rm-open) is shown alone, full width, with a sticky
   "Back to Curriculum" bar on top and Previous / Next buttons at the bottom.
   The bar and buttons are created by app.js (lvEnsureNav) and are hidden
   in the normal curriculum grid.
   Load order: app.min.css -> tokens.css -> voice-ui.css -> curriculum.css -> lesson-view.css
   ========================================================================== */

/* The injected bars never show inside the grid */
.lv-topbar,
.lv-bottom { display: none; }

/* 1. Hide the whole curriculum screen except the open lesson --------------- */
body.lesson-view #dashboard-header-bar,
body.lesson-view #se-breadcrumb-bar,
body.lesson-view #hero-welcome,
body.lesson-view #hero-banner,
body.lesson-view .month-view-title,
body.lesson-view .rm-zone-header,
body.lesson-view .rm-boss-gate,
body.lesson-view .rm-gate-content,
body.lesson-view .rm-path .lesson-card:not(.rm-open),
body.lesson-view .site-footer,
body.lesson-view .landing-footer { display: none !important; }

/* app.min.css gives <body> overflow-x:hidden, which turns <body> into its own
   (non-scrolling) scroll container and breaks position:sticky. <html> already
   clips horizontal overflow, so the lesson view can safely release <body>. */
body.lesson-view { overflow: visible !important; margin: 0; }

/* 2. Single-column, centered reading layout --------------------------------- */
body.lesson-view .main-container {
  max-width: 920px;
  margin-inline: auto;
  padding: 0 0 40px;
}
/* the grid screen reserves space for the fixed header bar — not needed here */
body.lesson-view .view-platform { padding-top: 0 !important; }

body.lesson-view .rm-months-grid,
body.lesson-view .rm-zone.zone-active .rm-zone-body,
body.lesson-view .rm-path {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0;
}

/* 3. The lesson itself: full width, no tile chrome --------------------------- */
body.lesson-view .rm-path .lesson-card.rm-open {
  display: block;
  /* overflow must be visible, otherwise the sticky top bar cannot stick
     (app.min.css sets .lesson-card { overflow: hidden !important }) */
  overflow: visible !important;
  animation: none;
  transform: none;
  border: 0;
  border-radius: 0;
  background: var(--vf-bg);
  min-height: 100vh;
  min-height: 100dvh;
  /* keeps the last buttons clear of the floating voice bar */
  padding-bottom: 110px;
}
body.lesson-view .lesson-card.rm-open .rm-toggle { display: none !important; }
body.lesson-view .lesson-card.rm-open .lesson-header {
  cursor: default;
  padding: 26px 20px 22px;
  border-radius: 0;
}
body.lesson-view .lesson-card.rm-open .lesson-title-ar {
  font-family: var(--vf-font-head);
  font-size: clamp(22px, 5vw, 28px);
  line-height: 1.5;
}
body.lesson-view .lesson-card.rm-open .lesson-goal {
  font-size: 15px;
  line-height: 1.8;
}
body.lesson-view .lesson-card.rm-open .lesson-body {
  padding: 22px 20px 10px;
  animation: none;
}
@media (min-width: 720px) {
  body.lesson-view .rm-path .lesson-card.rm-open {
    margin-top: 12px !important;
    border: 1px solid var(--vf-border);
    border-radius: var(--vf-radius-lg);
    min-height: calc(100vh - 24px);
  }
  body.lesson-view .lesson-card.rm-open .lesson-header { padding: 30px 32px 24px; }
  body.lesson-view .lesson-card.rm-open .lesson-body { padding: 26px 32px 10px; }
}

/* 4. Top bar: Back to Curriculum + position -------------------------------- */
body.lesson-view .lesson-card.rm-open .lv-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 20px 0;
  background: rgba(11, 11, 20, 0.96);
  border-bottom: 1px solid var(--vf-border);
}
@media (min-width: 720px) {
  body.lesson-view .lesson-card.rm-open .lv-topbar {
    padding: 12px 24px 0;
    border-radius: var(--vf-radius-lg) var(--vf-radius-lg) 0 0;
  }
}
.lv-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--vf-border-strong);
  background: rgba(139, 92, 246, 0.16);
  color: #f1e5ff;
  font-family: var(--vf-font-ar);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--vf-fast) var(--vf-ease), transform var(--vf-fast) var(--vf-ease);
}
.lv-back:hover { background: rgba(139, 92, 246, 0.3); }
.lv-back:active { transform: scale(0.97); }
.lv-arrow { font-size: 18px; line-height: 1; }
.lv-count {
  margin-inline-start: auto;
  color: var(--vf-text-2);
  font-family: var(--vf-font-ar);
  font-size: 14px;
  font-weight: 700;
}
.lv-track {
  flex-basis: 100%;
  height: 3px;
  margin: 2px -20px 0;
  background: rgba(255, 255, 255, 0.06);
}
.lv-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--vf-accent), var(--vf-listen));
  border-radius: 0 3px 3px 0;
}

/* 5. Bottom bar: Previous / Next lesson ------------------------------------- */
body.lesson-view .lesson-card.rm-open .lv-bottom {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 20px 20px 0;
}
@media (min-width: 720px) {
  body.lesson-view .lesson-card.rm-open .lv-bottom { padding: 24px 32px 0; }
}
.lv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 18px;
  border-radius: 16px;
  font-family: var(--vf-font-ar);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  cursor: pointer;
  transition: transform var(--vf-fast) var(--vf-ease), background var(--vf-fast) var(--vf-ease);
}
.lv-btn:active { transform: scale(0.98); }
.lv-prev {
  flex: 0 0 auto;
  border: 1.5px solid var(--vf-border-strong);
  background: transparent;
  color: var(--vf-text-2);
}
.lv-prev:hover { background: rgba(255, 255, 255, 0.05); }
.lv-next {
  flex: 1 1 auto;
  justify-content: space-between;
  border: 0;
  background: linear-gradient(135deg, #7c3aed, var(--vf-accent));
  color: #fff;
  box-shadow: 0 10px 28px -12px var(--vf-accent-glow);
}
.lv-next:hover { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.lv-next-text { display: flex; flex-direction: column; align-items: flex-start; text-align: start; min-width: 0; }
.lv-next-text small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}
.lv-finish { justify-content: center; }
.lv-finish .lv-next-text { align-items: center; text-align: center; }
@media (max-width: 420px) {
  body.lesson-view .lesson-card.rm-open .lv-bottom { flex-direction: column-reverse; }
  .lv-prev { justify-content: center; min-height: 48px; }
}

/* 6. Clear focus ring for keyboard users ------------------------------------ */
.lv-back:focus-visible,
.lv-btn:focus-visible { outline: 2px solid var(--vf-listen); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .lv-back, .lv-btn { transition: none; }
}


/* ==========================================================================
   CHUNKY UI — Duolingo-style "physical" buttons and cards (all screen sizes)
   ----------------------------------------------------------------------------
   * No neon glow, no blurred halos: every control is a solid face with a hard,
     solid "edge" shadow underneath:   box-shadow: 0 4px 0 <darker colour>
   * Pressing (:active) pushes the face down by exactly the edge height and the
     edge disappears, so it feels like a real button being pressed:
       transform: translateY(4px);  box-shadow: 0 0 0 <edge>;
   * Rounder corners everywhere (buttons 20px, cards 24px).
   Colours come from three variables set per group:
       --ck-face (top colour)   --ck-edge (hard shadow)   --ck-bd (border)
   app.min.css / curriculum.css contain many older rules, some with
   !important, so the rules below use !important on the visual properties.
   ========================================================================== */
:root {
  --ck-depth: 4px;
  --ck-violet: #8b5cf6;
  --ck-violet-edge: #5b2fc4;
  --ck-surface: #1d1d31;
  --ck-surface-edge: #07070d;
  --ck-border: rgba(255, 255, 255, 0.12);
  --ck-green: #34d399;
  --ck-green-edge: #1c8a64;
  --ck-amber: #fbbf24;
  --ck-amber-edge: #8a6208;
  --ck-r-btn: 20px;
  --ck-r-card: 24px;
}

/* 1. Colour groups ------------------------------------------------------------ */
/* primary actions (violet) */
body .se-continue-btn,
body #hero-start-btn,
body .lv-next,
body .vf-start-btn,
body .se-dash-practice-cta,
body .se-auth-btn-primary,
body button.bg-purple-600 {
  --ck-face: var(--ck-violet);
  --ck-edge: var(--ck-violet-edge);
  --ck-bd: var(--ck-violet);
  --ck-text: #ffffff;
}
/* "complete lesson" / finish = success green */
body .se-complete-btn:not(:disabled):not(.se-complete-btn-done),
body .lv-finish {
  --ck-face: var(--ck-green);
  --ck-edge: var(--ck-green-edge);
  --ck-bd: var(--ck-green);
  --ck-text: #04271b;
}
/* secondary actions (dark face) */
body .se-dashboard-btn,
body .lv-back,
body .lv-prev,
body .smart-back-btn,
body .se-auth-trigger,
body .rm-gate-btn,
body .ai-mode-btn,
body .vf-scenario,
body .vf-tone,
body .se-auth-btn-secondary,
body .se-auth-btn-google,
body a[href="#features"],
body .rm-path .lesson-card:not(.rm-open),
body .rm-zone-header,
body .curriculum-card-item,
body .quiz-option {
  --ck-face: var(--ck-surface);
  --ck-edge: var(--ck-surface-edge);
  --ck-bd: var(--ck-border);
  --ck-text: var(--vf-text);
}
/* completed lesson tile / current lesson tile */
body .rm-path .lesson-card.lesson-done:not(.rm-open) {
  --ck-edge: #0f3d2e;
  --ck-bd: rgba(52, 211, 153, 0.75);
}
body .rm-path .lesson-card.is-current-lesson:not(.rm-open) {
  --ck-edge: var(--ck-amber-edge);
  --ck-bd: var(--ck-amber);
}
/* small controls get a slightly thinner edge */
body .smart-back-btn,
body .se-auth-trigger,
body .lv-back,
body .vf-scenario,
body .vf-tone,
body .ai-mode-btn { --ck-depth: 3px; }

/* 2. The chunky look: solid face + hard edge, no glow ------------------------- */
body .se-continue-btn,
body #hero-start-btn,
body .lv-next,
body .vf-start-btn,
body .se-dash-practice-cta,
body .se-auth-btn-primary,
body button.bg-purple-600,
body .se-complete-btn:not(:disabled):not(.se-complete-btn-done),
body .se-dashboard-btn,
body .lv-back,
body .lv-prev,
body .smart-back-btn,
body .se-auth-trigger,
body .rm-gate-btn,
body .ai-mode-btn,
body .vf-scenario,
body .vf-tone,
body .se-auth-btn-secondary,
body .se-auth-btn-google,
body a[href="#features"],
body .rm-path .lesson-card:not(.rm-open),
body .rm-zone-header,
body .curriculum-card-item,
body .quiz-option:not(.opt-locked) {
  background: var(--ck-face) !important;
  color: var(--ck-text) !important;
  border: 2px solid var(--ck-bd) !important;
  box-shadow: 0 var(--ck-depth) 0 var(--ck-edge) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  text-shadow: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 90ms ease, box-shadow 90ms ease, background-color 150ms ease, filter 150ms ease !important;
}

/* 3. Press physics ---------------------------------------------------------------- */
@media (hover: hover) {
  body .se-continue-btn:hover,
  body #hero-start-btn:hover,
  body .lv-next:hover,
  body .vf-start-btn:hover,
  body .se-dash-practice-cta:hover,
  body .se-auth-btn-primary:hover,
  body button.bg-purple-600:hover,
  body .se-complete-btn:not(:disabled):not(.se-complete-btn-done):hover,
  body .se-dashboard-btn:hover,
  body .lv-back:hover,
  body .lv-prev:hover,
  body .smart-back-btn:hover,
  body .se-auth-trigger:hover,
  body .rm-gate-btn:hover,
  body .ai-mode-btn:hover,
  body .vf-scenario:hover,
  body .vf-tone:hover,
  body .se-auth-btn-secondary:hover,
  body .se-auth-btn-google:hover,
  body a[href="#features"]:hover,
  body .rm-path .lesson-card:not(.rm-open):hover,
  body .rm-zone-header:hover,
  body .curriculum-card-item:hover,
  body .quiz-option:not(.opt-locked):hover {
    transform: none !important;
    filter: brightness(1.1);
  }
}
body .se-continue-btn:active,
body #hero-start-btn:active,
body .lv-next:active,
body .vf-start-btn:active,
body .se-dash-practice-cta:active,
body .se-auth-btn-primary:active,
body button.bg-purple-600:active,
body .se-complete-btn:not(:disabled):not(.se-complete-btn-done):active,
body .se-dashboard-btn:active,
body .lv-back:active,
body .lv-prev:active,
body .smart-back-btn:active,
body .se-auth-trigger:active,
body .rm-gate-btn:active,
body .ai-mode-btn:active,
body .vf-scenario:active,
body .vf-tone:active,
body .se-auth-btn-secondary:active,
body .se-auth-btn-google:active,
body a[href="#features"]:active,
body .rm-path .lesson-card:not(.rm-open):active,
body .rm-zone-header:active,
body .curriculum-card-item:active,
body .quiz-option:not(.opt-locked):active {
  transform: translateY(var(--ck-depth)) !important;
  box-shadow: 0 0 0 var(--ck-edge) !important;
  filter: none;
}
/* keyboard focus: a clear ring instead of a glow */
body .se-continue-btn:focus-visible,
body #hero-start-btn:focus-visible,
body .lv-next:focus-visible,
body .lv-prev:focus-visible,
body .lv-back:focus-visible,
body .se-dashboard-btn:focus-visible,
body .se-complete-btn:focus-visible,
body .rm-zone-header:focus-visible,
body .curriculum-card-item:focus-visible,
body .rm-path .lesson-card:focus-visible,
body .quiz-option:focus-visible {
  outline: 3px solid var(--vf-listen);
  outline-offset: 3px;
}

/* 4. Rounder corners ------------------------------------------------------------------ */
body .se-continue-btn,
body #hero-start-btn,
body .lv-next,
body .lv-prev,
body .vf-start-btn,
body .se-dash-practice-cta,
body .se-auth-btn,
body button.bg-purple-600,
body .se-complete-btn,
body .se-dashboard-btn,
body .rm-gate-btn,
body a[href="#features"] { border-radius: var(--ck-r-btn) !important; }
body .lv-back,
body .smart-back-btn { border-radius: 16px !important; }
body .vf-scenario,
body .vf-tone,
body .ai-mode-btn { border-radius: 14px !important; }
body .rm-path .lesson-card:not(.rm-open),
body .rm-zone-header,
body .curriculum-card-item { border-radius: var(--ck-r-card) !important; }
body .quiz-option { border-radius: 18px !important; }

/* 5. Per-component details ---------------------------------------------------------------- */
/* landing hero button: bigger, sturdier edge; the animated neon halo is removed */
body #hero-start-btn { --ck-depth: 5px; }
body #hero-start-btn::before,
body #hero-start-btn::after { display: none !important; animation: none !important; }

/* lesson tiles: solid number badge instead of a glowing gradient */
body .lesson-number-badge,
body .rm-path .lesson-number-badge {
  background: var(--ck-violet) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 3px 0 var(--ck-violet-edge) !important;
}
body .rm-path .lesson-card:hover .lesson-number-badge { background: var(--ck-violet) !important; color: #fff !important; }
body .rm-path .lesson-card.lesson-done .lesson-number-badge {
  background: var(--ck-green) !important;
  color: #04271b !important;
  box-shadow: 0 3px 0 var(--ck-green-edge) !important;
}
body .rm-path .lesson-card.is-current-lesson::before { box-shadow: none !important; }
body .rm-zone-progress-badge { box-shadow: none !important; }
/* header pills (desktop): flat chips, no neon halo */
body .current-lesson-pill,
body .nav-progress-pill,
body .xp-counter-pill {
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-width: 2px;
}

/* quiz answers (the most-pressed buttons in the app) */
body .quiz-option { padding-block: 14px; font-weight: 600; }
body .quiz-option.opt-correct {
  --ck-edge: #14604a;
  background: #10382b !important;
  border: 2px solid var(--ck-green) !important;
  color: #c4f7e1 !important;
  box-shadow: 0 var(--ck-depth) 0 var(--ck-edge) !important;
  transform: none !important;
}
body .quiz-option.opt-wrong {
  --ck-edge: #6b4d06;
  background: #35280a !important;
  border: 2px solid var(--ck-amber) !important;
  color: #fde7a1 !important;
  box-shadow: 0 var(--ck-depth) 0 var(--ck-edge) !important;
  transform: none !important;
}
body .quiz-option.opt-locked:not(.opt-correct):not(.opt-wrong) {
  background: var(--ck-surface) !important;
  border: 2px solid var(--ck-border) !important;
  box-shadow: 0 var(--ck-depth) 0 var(--ck-surface-edge) !important;
  opacity: 0.6;
}

/* finished "complete lesson" button: flat, calm (not pressable) */
body .se-complete-btn:disabled,
body .se-complete-btn-done {
  background: rgba(52, 211, 153, 0.14) !important;
  border: 2px solid rgba(52, 211, 153, 0.45) !important;
  color: #a7f3d0 !important;
  box-shadow: none !important;
  border-radius: var(--ck-r-btn) !important;
  opacity: 1;
}

/* floating buttons: solid, no halo */
body .wa-float-btn {
  box-shadow: 0 4px 0 #14803f !important;
  transition: transform 90ms ease, box-shadow 90ms ease !important;
}
body .wa-float-btn:hover { transform: none !important; }
body .wa-float-btn:active { transform: translateY(4px) !important; box-shadow: 0 0 0 #14803f !important; }
body #vf-orb { box-shadow: 0 4px 0 #2a1664 !important; }
body #vf-orb:active { transform: translateY(4px); box-shadow: 0 0 0 #2a1664 !important; }

/* static cards: same solid edge, no glow, no press */
body .welcome-card,
body .quiz-block,
body .story-card,
body .exam-card,
body .scoreboard-card,
body .cover-card {
  box-shadow: 0 var(--ck-depth) 0 rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: var(--ck-r-card);
}
body .alert { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35) !important; border-radius: 18px; }
body .welcome-card:hover { transform: none !important; }
body .rm-path .lesson-card.rm-open { box-shadow: 0 var(--ck-depth) 0 rgba(0, 0, 0, 0.45) !important; }

/* touch devices: fast taps, no grey flash */
body .rm-path .lesson-card,
body .rm-zone-header,
body .curriculum-card-item,
body .quiz-option { touch-action: manipulation; }

@media (prefers-reduced-motion: reduce) {
  body .se-continue-btn,
  body #hero-start-btn,
  body .lv-next,
  body .lv-prev,
  body .se-dashboard-btn,
  body .rm-path .lesson-card,
  body .rm-zone-header,
  body .quiz-option { transition: none !important; }
}

/* ==========================================================================
   TOP BAR (all screen sizes) — Duolingo-style: icons + numbers, one line
   [back] ............ [streak] [progress] [XP] [profile]
   No long text: the labels stay in the page for screen readers / tooltips.
   ========================================================================== */
body.in-platform { margin: 0; padding-inline: 0; }

body.in-platform .dashboard-header-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px !important;
  padding: 8px max(20px, calc((100vw - 1080px) / 2)) !important;
  padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  background: var(--vf-bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--vf-border) !important;
  box-shadow: none !important;
}
body.in-platform .dashboard-status-row {
  display: flex !important;
  flex: 0 1 auto;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-end;
  gap: 4px !important;
  min-width: 0;
}
/* back button: arrow + short label on wide screens (icon only on phones) */
body.in-platform .smart-back-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px !important;
  gap: 8px;
}
/* stat chips: icon + bold number, no frame */
body.in-platform .hdr-chip,
body.in-platform .xp-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 8px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: var(--vf-font-en);
  font-size: 15px !important;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  direction: ltr;
}
body.in-platform .hdr-chip .ic,
body.in-platform .xp-counter-pill .ic { width: 20px; height: 20px; font-size: 20px !important; }
body.in-platform .hdr-streak { color: #fb923c; }
body.in-platform .hdr-progress { color: var(--vf-listen); }
body.in-platform .xp-counter-pill { color: var(--vf-meaning); cursor: pointer; }
body.in-platform .xp-counter-pill .xp-label { display: none; }
/* profile / login: round icon button (the text is visually hidden) */
body.in-platform .se-auth-trigger {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-height: 0;
  margin-inline-start: 4px;
  padding: 0 !important;
  justify-content: center;
  border-radius: 50% !important;
}
body.in-platform .se-auth-trigger .ic { width: 20px; height: 20px; font-size: 20px !important; }
body.in-platform .se-auth-trigger.se-auth-signed-in { --ck-bd: rgba(52, 211, 153, 0.7); color: var(--vf-success) !important; }
body.in-platform #se-auth-status-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* page content starts right below the slim bar */
body.in-platform .view-platform { padding-top: calc(60px + env(safe-area-inset-top, 0px)) !important; }

/* tablets: same generous side margins */
@media (min-width: 641px) and (max-width: 1024px) {
  body.in-platform .main-container { padding-inline: 24px !important; }
}

/* ==========================================================================
   MOBILE LAYOUT (phones, <= 640px) — spacing and arrangement only.
   The look (colours, edges, press) comes from the CHUNKY UI section above.
   ========================================================================== */
@media (max-width: 640px) {
  /* A. TOP BAR on phones: back button becomes icon-only */
  body.in-platform .dashboard-header-bar { padding-inline: 20px !important; }
  body.in-platform .smart-back-btn {
    width: 44px;
    height: 44px;
    padding: 0 !important;
    justify-content: center;
    gap: 0;
  }
  body.in-platform .smart-back-btn .smart-back-arrow { width: 22px; height: 22px; font-size: 22px; }
  body.in-platform #smart-back-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* B. SPACING: 20px side margins, nothing touches the screen edge ------------------ */
  body.in-platform .main-container { padding: 24px 20px 96px !important; box-sizing: border-box; }
  body.in-platform .rm-months-grid { gap: 18px; }

  /* C. WELCOME CARD ------------------------------------------------------------------- */
  body.in-platform #hero-welcome {
    padding: 32px 20px 26px !important;
    margin: 0 0 26px !important;
    background: var(--vf-surface) !important;
    border: 2px solid var(--vf-border) !important;
    animation: none;
  }
  body.in-platform #hero-welcome .hero-welcome-row { gap: 28px !important; }
  body.in-platform #hero-welcome .hero-avatar-text-row { flex-direction: column; align-items: center; gap: 16px; width: 100%; }
  body.in-platform #hero-welcome .hero-avatar-wrap {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 0 #3d1b86 !important;
    border-width: 2px !important;
  }
  body.in-platform #hero-welcome .hero-avatar-wrap::before { display: none; }
  body.in-platform #hero-welcome .hero-avatar-wrap .text-6xl { font-size: 30px !important; }
  body.in-platform #hero-welcome .hero-text-col {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  body.in-platform #hero-welcome .hero-text-col > div { display: none !important; }
  body.in-platform #hero-welcome .hero-text-col h2 {
    font-family: var(--vf-font-head) !important;
    font-size: 22px !important;
    line-height: 1.5 !important;
    margin: 0 !important;
  }
  body.in-platform #hero-welcome .hero-text-col h2 .ic { display: none; }
  body.in-platform #hero-welcome .hero-text-col p {
    font-size: 15px !important;
    line-height: 1.8 !important;
    margin: 0 !important;
    color: var(--vf-text-2) !important;
    opacity: 1 !important;
  }

  /* D. ACTION BUTTONS: thick, with room for the 4px edge ------------------------------- */
  body.in-platform #hero-welcome .hero-btn-row { gap: 18px !important; margin: 0; }
  body.in-platform #hero-welcome .hero-btn-row .se-continue-btn,
  body.in-platform #hero-welcome .hero-btn-row .se-dashboard-btn {
    min-height: 58px;
    padding: 0 20px !important;
    font-family: var(--vf-font-ar);
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1.4;
    gap: 10px;
  }
  body.in-platform #hero-welcome .hero-btn-row .ic { font-size: 22px !important; }

  /* E. MONTH CARDS: [icon] [title ........] [progress] [chevron] / [subtitle] ------------- */
  body.in-platform:not(.month-view) .rm-zone-header {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    height: auto !important;
    min-height: 0 !important;
    padding: 16px !important;
    margin: 0 !important;
    text-align: start;
    font-size: 18px !important;
    line-height: 1.4;
  }
  body.in-platform:not(.month-view) .rm-zone-header::before { display: none; }
  body.in-platform:not(.month-view) .rm-zone-header .rm-zone-icon { grid-column: 1; grid-row: 1; font-size: 24px; }
  body.in-platform:not(.month-view) .rm-zone-header > span:not(.rm-zone-chevron):not(.rm-zone-progress-badge) {
    grid-column: 2;
    grid-row: 1;
    font-family: var(--vf-font-head);
    font-weight: 800;
  }
  body.in-platform:not(.month-view) .rm-zone-header .rm-zone-progress-badge {
    grid-column: 3;
    grid-row: 1;
    margin: 0 !important;
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  body.in-platform:not(.month-view) .rm-zone-header .rm-zone-chevron { grid-column: 4; grid-row: 1; width: 28px; height: 28px; font-size: 11px; }
  body.in-platform:not(.month-view) .rm-zone-header small {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.7;
    opacity: 0.75;
    text-wrap: balance;
  }
  /* lesson tiles in the 2-column grid: room for the edge between rows */
  body.in-platform .rm-path { gap: 14px; }
}

/* very narrow phones (<= 360px) */
@media (max-width: 360px) {
  body.in-platform .dashboard-header-bar { padding-inline: 16px !important; gap: 4px !important; }
  body.in-platform .hdr-chip,
  body.in-platform .xp-counter-pill { flex: 0 0 auto; padding: 0 3px !important; font-size: 13px !important; gap: 3px; overflow: visible !important; }
  body.in-platform .hdr-chip .ic,
  body.in-platform .xp-counter-pill .ic { width: 17px; height: 17px; font-size: 17px !important; }
  body.in-platform .se-auth-trigger { width: 36px; height: 36px; }
  body.in-platform .main-container { padding-inline: 20px !important; }
  body.in-platform #hero-welcome { padding: 28px 16px 22px !important; }
  body.in-platform #hero-welcome .hero-text-col h2 { font-size: 20px !important; }
  body.in-platform #hero-welcome .hero-btn-row .se-continue-btn,
  body.in-platform #hero-welcome .hero-btn-row .se-dashboard-btn { font-size: 14px !important; padding: 0 12px !important; gap: 8px; }
  body.in-platform:not(.month-view) .rm-zone-header { padding: 14px !important; column-gap: 8px; }
  body.in-platform:not(.month-view) .rm-zone-header > span:not(.rm-zone-chevron):not(.rm-zone-progress-badge) { font-size: 17px; white-space: nowrap; }
  body.in-platform:not(.month-view) .rm-zone-header .rm-zone-progress-badge { font-size: 11px; padding: 3px 8px; }
  body.in-platform:not(.month-view) .rm-zone-header .rm-zone-chevron { width: 24px; height: 24px; }
}


/* ==========================================================================
   WINDING LEARNING PATH (Duolingo-style map)
   The 12 lessons of a month are round nodes flowing down the page in a snake.
   Geometry (keep in sync with the SVG track below):
     --path-h  = height of one lesson slot (160px)
     --path-cy = distance from the top of a slot to the centre of its node (72px)
     the zigzag repeats every 8 nodes: 0, +36, +56, +36, 0, -36, -56, -36 (px)
   No HTML structure changes: the existing .lesson-header is the tappable node.
   ========================================================================== */
body.in-platform .rm-path {
  --path-h: 160px;
  --path-cy: 72px;
  --node: 72px;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 0 !important;
  grid-template-columns: none !important;
  position: relative;
  padding: 8px 0 24px;
  isolation: isolate;
}
/* the dotted track behind the nodes: starts at the first node, ends at the last */
body.in-platform .rm-path::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  width: 200px;
  margin-left: -100px;
  top: calc(8px + var(--path-cy));
  bottom: calc(24px + var(--path-h) - var(--path-cy));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='1280' viewBox='0 0 200 1280'%3E%3Cpath d='M64 -88 C64 -8 100 -8 100 72 C100 152 136 152 136 232 C136 312 156 312 156 392 C156 472 136 472 136 552 C136 632 100 632 100 712 C100 792 64 792 64 872 C64 952 44 952 44 1032 C44 1112 64 1112 64 1192 C64 1272 100 1272 100 1352 C100 1432 136 1432 136 1512' fill='none' stroke='%23a78bfa' stroke-opacity='.4' stroke-width='10' stroke-linecap='round' stroke-dasharray='1 18'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-position: 0 calc(var(--path-cy) * -1);
  background-size: 200px 1280px;
  pointer-events: none;
}

/* one slot per lesson, shifted sideways to make the snake */
body.in-platform .rm-path .lesson-card:not(.rm-open) {
  --off: 0px;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 150px;
  height: var(--path-h);
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: translateX(var(--off)) !important;
  transition: none !important;
  text-align: center;
}
body.in-platform .rm-path .lesson-card:not(.rm-open):nth-child(8n+2) { --off: 36px; }
body.in-platform .rm-path .lesson-card:not(.rm-open):nth-child(8n+3) { --off: 56px; }
body.in-platform .rm-path .lesson-card:not(.rm-open):nth-child(8n+4) { --off: 36px; }
body.in-platform .rm-path .lesson-card:not(.rm-open):nth-child(8n+6) { --off: -36px; }
body.in-platform .rm-path .lesson-card:not(.rm-open):nth-child(8n+7) { --off: -56px; }
body.in-platform .rm-path .lesson-card:not(.rm-open):nth-child(8n+8) { --off: -36px; }
/* the card itself never moves or glows on hover/press: only its node does */
body.in-platform .rm-path .lesson-card:not(.rm-open):hover,
body.in-platform .rm-path .lesson-card:not(.rm-open):active {
  transform: translateX(var(--off)) !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
body.in-platform .rm-path .lesson-card:not(.rm-open):focus-visible { outline: none; }

/* the tappable area: node on top, title underneath */
body.in-platform .rm-path .lesson-card:not(.rm-open) .lesson-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: calc(var(--path-cy) - var(--node) / 2) 0 0 !important;
  background: none !important;
  border: 0 !important;
  -webkit-tap-highlight-color: transparent;
}
body.in-platform .rm-path .lesson-card:not(.rm-open) .lesson-level-badge,
body.in-platform .rm-path .lesson-card:not(.rm-open) .lesson-title-en,
body.in-platform .rm-path .lesson-card:not(.rm-open) .lesson-goal,
body.in-platform .rm-path .lesson-card:not(.rm-open) .rm-toggle { display: none !important; }

/* the node: chunky round button with a number (or a check when done) */
body.in-platform .rm-path .lesson-card:not(.rm-open) .lesson-number-badge {
  --node-face: var(--ck-violet);
  --node-edge: var(--ck-violet-edge);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  align-self: center !important;
  margin: 0 !important;
  width: var(--node) !important;
  height: var(--node) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: var(--node-face) !important;
  box-shadow: 0 6px 0 var(--node-edge), inset 0 0 0 4px rgba(255, 255, 255, 0.16) !important;
  color: transparent !important;          /* hides the "LESSON 01" text */
  font-size: 0 !important;
  letter-spacing: 0;
  transition: transform 90ms ease, box-shadow 90ms ease !important;
}
body.in-platform .rm-path .lesson-card:not(.rm-open) .lesson-number-badge::before {
  content: attr(data-n);
  color: #fff;
  font-family: var(--vf-font-en);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
body.in-platform .rm-path .lesson-card.lesson-done:not(.rm-open) .lesson-number-badge {
  --node-face: var(--ck-green);
  --node-edge: var(--ck-green-edge);
}
body.in-platform .rm-path .lesson-card.lesson-done:not(.rm-open) .lesson-number-badge::before {
  content: "✓";
  color: #04271b;
  font-size: 32px;
}
/* old corner check mark is replaced by the node itself */
body.in-platform .rm-path .lesson-card.lesson-done:not(.rm-open)::after { display: none !important; }

/* the lesson title */
body.in-platform .rm-path .lesson-card:not(.rm-open) .lesson-title-ar {
  display: block !important;
  align-self: center !important;
  box-sizing: border-box;
  width: auto !important;
  max-width: 150px;
  max-height: 42px;
  overflow: hidden;
  margin: 0 auto !important;
  padding: 0 !important;
  font-family: var(--vf-font-head);
  font-size: 14px !important;
  font-weight: 800;
  line-height: 1.45;
  color: var(--vf-text) !important;
  text-align: center;
  text-wrap: balance;
}
body.in-platform .rm-path .lesson-card.lesson-done:not(.rm-open) .lesson-title-ar { color: var(--vf-text-2) !important; }

/* press: the node sinks into its edge, like every other chunky button */
body.in-platform .rm-path .lesson-card:not(.rm-open):hover .lesson-number-badge { filter: brightness(1.08); }
body.in-platform .rm-path .lesson-card:not(.rm-open):active .lesson-number-badge {
  transform: translateY(6px) !important;
  box-shadow: 0 0 0 var(--node-edge), inset 0 0 0 4px rgba(255, 255, 255, 0.16) !important;
  animation: none !important;
}
body.in-platform .rm-path .lesson-card:not(.rm-open):focus-visible .lesson-number-badge {
  outline: 3px solid var(--vf-listen);
  outline-offset: 4px;
}

/* CURRENT lesson: amber node that floats, with a "start here" bubble */
body.in-platform .rm-path .lesson-card.is-current-lesson:not(.rm-open) .lesson-number-badge {
  --node-face: var(--ck-amber);
  --node-edge: var(--ck-amber-edge);
  animation: pathFloat 1.8s ease-in-out infinite;
}
body.in-platform .rm-path .lesson-card.is-current-lesson:not(.rm-open) .lesson-number-badge::before { color: #3b2300; }
body.in-platform .rm-path .lesson-card.is-current-lesson:not(.rm-open)::before {
  content: "ابدأ من هنا";
  display: block !important;
  position: absolute;
  z-index: 2;
  top: 0 !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  inset-inline-start: auto !important;
  width: auto !important;
  height: auto !important;
  translate: -50% 0;
  padding: 5px 12px !important;
  border-radius: 12px;
  opacity: 1 !important;
  background: #fff !important;
  color: #b45309 !important;
  font-family: var(--vf-font-ar);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35) !important;
  animation: pathBubble 1.8s ease-in-out infinite;
  pointer-events: none;
}
body.in-platform .rm-path .lesson-card.is-current-lesson:not(.rm-open)::after {
  content: "";
  display: block !important;
  position: absolute;
  z-index: 2;
  top: 29px;
  left: 50%;
  translate: -50% 0;
  opacity: 1 !important;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 2px;
  rotate: 45deg;
  animation: pathBubble 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pathFloat  { 0%, 100% { transform: translateY(0); }  50% { transform: translateY(-5px); } }
@keyframes pathBubble { 0%, 100% { margin-top: 0; }             50% { margin-top: -5px; } }

@media (prefers-reduced-motion: reduce) {
  body.in-platform .rm-path .lesson-card.is-current-lesson:not(.rm-open) .lesson-number-badge,
  body.in-platform .rm-path .lesson-card.is-current-lesson:not(.rm-open)::before,
  body.in-platform .rm-path .lesson-card.is-current-lesson:not(.rm-open)::after { animation: none !important; }
}
