
.math-lesson-path{
  --bg:#121212; --surface:#1d1d1f; --line:#3b3b40; --text:#fff; --dim:#8d8d93;
  --blue:#4a6cf7; --blue-deep:#2e48c4; --step-x:54px; --row-h:64px; --gap:70px;
}
.math-lesson-path,.math-lesson-path *{box-sizing:border-box;margin:0}
.math-lesson-path{
  background:
    radial-gradient(120% 40% at 50% 100%, rgba(74,108,247,.16), transparent 70%),
    var(--bg);
  color:var(--text); min-height:100vh;
  font-family:"Poppins","Nunito","Segoe UI",system-ui,sans-serif;
  -webkit-tap-highlight-color:transparent;
}
.me-lp-app{max-width:440px;margin:0 auto;padding:8px 16px 230px}

/* ---------- Path ---------- */
.me-lp-path{display:flex;flex-direction:column;gap:var(--gap);padding-bottom:44px}
.me-lp-row{display:flex;align-items:center;gap:20px;height:var(--row-h);
  padding-inline-start:calc(var(--step-x)*var(--offset,0))}
.me-lp-label{font-size:17px;line-height:1.35;color:var(--dim);max-width:150px;transition:color .2s}
.me-lp-row.me-lp-current .me-lp-label,.me-lp-row.me-lp-selected .me-lp-label{color:var(--text)}

/* ---------- Node ---------- */
.me-lp-node{position:relative;flex:none;width:94px;height:var(--row-h);border:0;background:none;padding:0;cursor:pointer;
  transition:transform .12s}
.me-lp-node:disabled{cursor:default}
.me-lp-node:not(:disabled):active{transform:translateY(3px) scale(.98)}
.me-lp-node svg.me-lp-disc{width:94px;height:var(--row-h);overflow:visible;display:block}
.me-lp-node:focus-visible{outline:3px solid #fff;outline-offset:6px;border-radius:50%}
.me-lp-halo{animation:pulse 2.6s ease-in-out infinite}
.me-lp-glow{opacity:0}
.me-lp-row.me-lp-current .me-lp-glow{opacity:1;animation:pulse 2.6s ease-in-out infinite}
@keyframes pulse{50%{opacity:.55}}

.me-lp-marker{position:absolute;left:50%;top:-40px;width:52px;height:58px;margin-left:-26px;pointer-events:none;
  display:none;animation:float 2.4s ease-in-out infinite;filter:drop-shadow(0 8px 10px rgba(91,135,255,.35))}
.me-lp-row.me-lp-current .me-lp-marker{display:block}
@keyframes float{50%{transform:translateY(-7px)}}
.me-lp-beam{position:absolute;left:50%;top:-12px;width:44px;height:44px;margin-left:-22px;pointer-events:none;display:none;
  background:linear-gradient(rgba(255,255,255,.28),transparent);clip-path:polygon(12% 0,88% 0,100% 100%,0 100%);opacity:.7}
.me-lp-row.me-lp-current .me-lp-beam{display:block}
.me-lp-current-light-core{transform-box:fill-box;transform-origin:center;animation:light-core 3s ease-in-out infinite}
.me-lp-current-light-column{animation:light-column 3s ease-in-out infinite}
/* Continuous transport through a stationary beam, rather than moving the whole cylinder. */
.me-lp-current-light-stream{fill:none;stroke:#eef4ff;stroke-width:1.4;stroke-linecap:round;stroke-dasharray:14 38 3 29;animation:light-stream 2.2s linear infinite;opacity:.85}
.me-lp-current-light-stream.me-lp-stream-two{animation-duration:1.7s;animation-delay:-.8s;stroke:#fff;stroke-width:1.8}
.me-lp-current-light-stream.me-lp-stream-three{animation-duration:2.5s;animation-delay:-1.3s}
.me-lp-current-light-stream.me-lp-stream-four{animation-duration:1.9s;animation-delay:-.4s;opacity:.55}
.me-lp-current-light-wave{fill:none;stroke:#e4edff;stroke-width:1;animation:light-rise 2.4s linear infinite}
.me-lp-current-light-wave.me-lp-wave-two{animation-delay:-1.2s}
@keyframes light-stream{to{stroke-dashoffset:-84}}
@keyframes light-rise{0%{transform:translateY(0);opacity:0}18%{opacity:.55}70%{opacity:.35}100%{transform:translateY(-66px);opacity:0}}
@keyframes light-core{0%,100%{opacity:.6;transform:scale(.95)}50%{opacity:.95;transform:scale(1.06)}}
@keyframes light-column{0%,100%{opacity:.65}50%{opacity:.9}}

/* ---------- Bottom sheet ---------- */
.me-lp-sheet{
  position:fixed;left:50%;bottom:calc(16px + env(safe-area-inset-bottom,0px));
  width:min(410px,calc(100% - 28px));padding:28px 18px 18px;text-align:center;z-index:10;
  background:linear-gradient(#242427,#1b1b1d);
  border:2px solid var(--line);border-radius:34px;
  box-shadow:0 -10px 40px rgba(0,0,0,.5);
  transform:translate(-50%,150%);transition:transform .32s cubic-bezier(.2,.9,.25,1.05);
}
.me-lp-sheet.me-lp-open{transform:translate(-50%,0)}
.me-lp-sheet h2{font-size:23px;font-weight:700;margin-bottom:24px}
.me-lp-btn{
  position:relative;overflow:hidden;width:100%;height:56px;border:0;border-radius:28px;cursor:pointer;
  font:inherit;font-size:18px;font-weight:600;color:#fff;
  background:linear-gradient(#5a7bff,var(--blue));
  box-shadow:0 6px 0 var(--blue-deep),0 10px 22px rgba(74,108,247,.35);
  transition:transform .08s,box-shadow .08s;
}
.me-lp-btn::before,.me-lp-btn::after{content:"";position:absolute;top:0;bottom:0;width:34px;left:62%;
  background:rgba(255,255,255,.14);transform:skewX(-28deg)}
.me-lp-btn::after{left:calc(62% + 54px);width:44px}
.me-lp-btn:active{transform:translateY(5px);box-shadow:0 1px 0 var(--blue-deep)}
.me-lp-btn:focus-visible{outline:3px solid #fff;outline-offset:3px}
.me-lp-sweep{animation:sweep 2.4s linear infinite}
@keyframes sweep{to{stroke-dashoffset:-100}}
.me-lp-sweep.me-lp-head{animation-name:sweephead}
@keyframes sweephead{from{stroke-dashoffset:-22}to{stroke-dashoffset:-122}}
.me-lp-spark{opacity:0;animation:twinkle 2.4s ease-in-out infinite}
.me-lp-spark.me-lp-s2{animation-delay:.8s}.me-lp-spark.me-lp-s3{animation-delay:1.6s}
@keyframes twinkle{0%,100%{opacity:0}30%{opacity:.95}60%{opacity:0}}
@media (prefers-reduced-motion:reduce){.me-lp-marker,.me-lp-glow,.me-lp-sweep,.me-lp-spark,.me-lp-current-light-core,.me-lp-current-light-column,.me-lp-current-light-stream,.me-lp-current-light-wave{animation:none}.me-lp-current-light-stream,.me-lp-current-light-wave{display:none}.me-lp-sheet{transition:none}}

/* Math Engine preview: keep the path, but use the platform's quieter visual rhythm. */
.math-lesson-path{--bg:#040638;--surface:#181b58;--line:rgba(255,255,255,.2);--text:#fff;--dim:rgba(255,255,255,.55);--blue:#6682ff;--blue-deep:#4053c7;--step-x:36px;--row-h:70px;--gap:44px}
.math-lesson-path{background:radial-gradient(110% 135% at 10% 8%,#0f1452 0%,#040638 45.1%,#101d3b 95.4%);font-family:ui-rounded,"Arial Rounded MT Bold",system-ui,sans-serif}
.me-lp-app{max-width:520px;min-height:100svh;padding:clamp(26px,5vw,48px) 20px 150px}
.me-lp-path{gap:var(--gap);padding-bottom:0}
.me-lp-path+.me-lp-path{margin-top:var(--gap)}
.me-lp-row{gap:18px;height:var(--row-h);padding-inline-start:min(calc(var(--step-x)*var(--offset,0)),24%)}
.me-lp-label{max-width:190px;font-size:16px;font-weight:550;line-height:1.3}
.me-lp-node{width:104px;height:var(--row-h);transition:filter .18s ease}
.me-lp-node svg.me-lp-disc{width:104px;height:var(--row-h)}
.me-lp-node:not(:disabled):hover{filter:brightness(1.12)}
.me-lp-node:not(:disabled):active{transform:none}
.me-lp-marker{top:-34px;width:42px;height:47px;margin-left:-21px;filter:drop-shadow(0 3px 6px rgba(91,135,255,.25))}
.me-lp-sheet{bottom:calc(16px + env(safe-area-inset-bottom,0px));width:min(400px,calc(100% - 28px));padding:22px 20px 20px;border:1px solid rgba(255,255,255,.24);border-radius:24px;background:linear-gradient(145deg,#252669,#151847);box-shadow:0 18px 50px rgba(0,0,0,.28)}
.me-lp-sheet h2{margin:0 0 18px;font-size:21px;line-height:1.2}
.me-lp-btn{height:52px;border-radius:14px;background:linear-gradient(100deg,#4da67e,#9062c8);box-shadow:none;font-size:16px}
.me-lp-btn::before,.me-lp-btn::after{display:none}
.me-lp-btn:hover{filter:brightness(1.08)}.me-lp-btn:active{transform:none;box-shadow:none}
@media(max-width:480px){.math-lesson-path{--step-x:24px;--gap:36px}.me-lp-app{padding:28px 16px 130px}.me-lp-row{gap:12px}.me-lp-label{max-width:150px;font-size:14px}.me-lp-node,.me-lp-node svg.me-lp-disc{width:90px;height:62px}.me-lp-marker{top:-30px;width:38px;height:42px;margin-left:-19px}}
@media(max-height:520px) and (orientation:landscape){.me-lp-app{padding-top:20px}.me-lp-sheet{right:16px;left:auto;bottom:16px;width:min(320px,40vw);transform:translateY(150%)}.me-lp-sheet.me-lp-open{transform:none}}

/* Math companion: the floating gem cycles through four raised symbols. */
.me-lp-symbol{opacity:0;transform-origin:26px 27px;filter:drop-shadow(0 1px 0 rgba(33,55,139,.5));animation:me-lp-symbol-cycle 8s cubic-bezier(.22,1,.36,1) infinite}
.me-lp-symbol-equals{animation-delay:2s}
.me-lp-symbol-times{animation-delay:4s}
.me-lp-symbol-divide{animation-delay:6s}
@keyframes me-lp-symbol-cycle{0%{opacity:0;transform:rotate(-18deg) scale(.65)}4%,20%{opacity:1;transform:rotate(0) scale(1)}25%,100%{opacity:0;transform:rotate(18deg) scale(.65)}}
@media(prefers-reduced-motion:reduce){.me-lp-symbol{animation:none;opacity:0}.me-lp-symbol-plus{opacity:1}}
.me-lp-completion-badge{position:absolute;left:50%;top:-23px;width:42px;height:47px;margin-left:-21px;overflow:visible;pointer-events:none;filter:drop-shadow(0 3px 6px rgba(95,135,255,.2));transform:rotate(-12deg);animation:me-lp-badge-float 2.4s ease-in-out infinite}
@keyframes me-lp-badge-float{50%{transform:translateY(-4px) rotate(-12deg)}}
@media(max-width:480px){.me-lp-completion-badge{top:-20px;width:38px;height:42px;margin-left:-19px}}
@media(prefers-reduced-motion:reduce){.me-lp-completion-badge{animation:none}}
/* A short, weighted swivel on interaction, followed by the idle float. */
@keyframes me-lp-hover-swivel{
  0%,100%{transform:perspective(240px) translateY(0) rotateY(0) rotateZ(var(--me-lp-tilt,-12deg))}
  28%{transform:perspective(240px) translateY(-7px) rotateY(-28deg) rotateZ(-18deg)}
  62%{transform:perspective(240px) translateY(-5px) rotateY(24deg) rotateZ(8deg)}
  82%{transform:perspective(240px) translateY(-2px) rotateY(-8deg) rotateZ(var(--me-lp-tilt,-12deg))}
}
@media(hover:hover) and (pointer:fine){
  .me-lp-node:hover:not(:disabled) .me-lp-completion-badge,.me-lp-node:focus-visible .me-lp-completion-badge{animation:me-lp-hover-swivel .9s ease-in-out,me-lp-badge-float 2.4s ease-in-out .9s infinite}
  .me-lp-node:hover:not(:disabled) .me-lp-marker,.me-lp-node:focus-visible .me-lp-marker{--me-lp-tilt:0deg;animation:me-lp-hover-swivel .9s ease-in-out,float 2.4s ease-in-out .9s infinite}
}
@media(prefers-reduced-motion:reduce){
  .me-lp-node:hover .me-lp-completion-badge,.me-lp-node:focus-visible .me-lp-completion-badge,.me-lp-node:hover .me-lp-marker,.me-lp-node:focus-visible .me-lp-marker{animation:none}
}
.me-lp-import-spark{opacity:0;animation:twinkle 2.4s ease-in-out infinite}
.me-lp-import-spark.me-lp-import-s2{animation-delay:.8s}.me-lp-import-spark.me-lp-import-s3{animation-delay:1.6s}
.me-lp-import-tg .me-lp-import-shine{animation:me-lp-import-shine 3.4s ease-in-out infinite}
@keyframes me-lp-import-shine{0%,35%{transform:translateX(0) skewX(-18deg)}80%,100%{transform:translateX(104px) skewX(-18deg)}}
.me-lp-import-tg .me-lp-import-spark{transform-box:fill-box;transform-origin:center;opacity:0;animation:me-lp-import-tw 2.2s ease-in-out infinite}
.me-lp-import-tg .me-lp-import-spark.me-lp-import-s2{animation-delay:.7s}.me-lp-import-tg .me-lp-import-spark.me-lp-import-s3{animation-delay:1.4s}
@keyframes me-lp-import-tw{0%,100%{opacity:0;transform:scale(.3)}45%{opacity:1;transform:scale(1.1)}}
.me-lp-import-pool{animation:pulse 2.6s ease-in-out infinite}
.me-lp-import-hxf{animation:me-lp-import-cardfloat 3.2s ease-in-out infinite}
@keyframes me-lp-import-cardfloat{0%,100%{transform:translateY(2px)}50%{transform:translateY(-3px)}}
.me-lp-import-hxs{transform-box:fill-box;transform-origin:center;animation:me-lp-import-cardshadow 3.2s ease-in-out infinite}
@keyframes me-lp-import-cardshadow{0%,100%{transform:scale(1.04);opacity:.45}50%{transform:scale(.88);opacity:.3}}
.me-lp-import-hxh{transform-box:fill-box;transform-origin:50% 60%;transition:transform .5s cubic-bezier(.25,.8,.3,1)}
.me-lp-node:hover .me-lp-import-hxh,.me-lp-node:focus-visible .me-lp-import-hxh{transform:translateY(-8px) scale(1.14) rotate(-4deg);transition-duration:.42s;transition-timing-function:cubic-bezier(.3,1.7,.5,1)}
.me-lp-import-hxstar{transform-box:fill-box;transform-origin:center}
.me-lp-import-hxstar{transition:transform .5s cubic-bezier(.25,.8,.3,1)}
.me-lp-node:hover .me-lp-import-hxstar{transform:scale(1.22) rotate(-10deg);transition-duration:.42s;transition-timing-function:cubic-bezier(.3,1.7,.5,1)}
@keyframes me-lp-import-starpop{0%{transform:scale(1)}40%{transform:scale(1.32) rotate(-14deg)}100%{transform:scale(1) rotate(0)}}
.me-lp-import-hxshine{opacity:0}
.me-lp-node:hover .me-lp-import-hxshine{animation:me-lp-import-hxsweep .85s ease-out}
@keyframes me-lp-import-hxsweep{0%{opacity:.9;transform:translateX(0) skewX(-18deg)}80%{opacity:.9}100%{opacity:0;transform:translateX(74px) skewX(-18deg)}}
.me-lp-import-hxsw{transform-box:fill-box;transform-origin:center;transition:transform .5s cubic-bezier(.25,.8,.3,1),opacity .5s}
.me-lp-node:hover .me-lp-import-hxsw{transform:scale(.8);opacity:.65}

@media(prefers-reduced-motion:reduce){.me-lp-import-hxf,.me-lp-import-hxs,.me-lp-import-shine,.me-lp-import-spark,.me-lp-import-pool{animation:none!important}.me-lp-import-hxh,.me-lp-import-hxstar,.me-lp-import-hxsw{transition:none!important;transform:none!important}}
/* Integration: only Zone B scrolls; the shared tutor stays unchanged. */
.me-lp-trophy-pending{filter:grayscale(1)}
.me-lp-trophy-pending .me-lp-import-spark,.me-lp-trophy-pending .me-lp-import-shine{animation:none;opacity:0}
.math-lessons-screen.has-lesson-path>.math-menu-content{display:block;min-width:0;padding:0 20px;overflow:auto}
.math-lesson-path{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:100%;background:none;color:#fff}
.math-lesson-path .me-lp-app{width:min(100%,460px);min-height:0;padding:52px 28px;margin:0 auto}
.math-lesson-path .me-lp-sheet{left:var(--lesson-path-center,50%);bottom:calc(clamp(28px,5vh,56px) + env(safe-area-inset-bottom,0px));width:var(--lesson-path-sheet-width,380px);max-width:calc(100vw - 32px);visibility:hidden;pointer-events:none}
.math-lesson-path .me-lp-sheet.open{visibility:visible;pointer-events:auto;transform:translate(-50%,0)}
.math-lesson-path .me-lp-btn{display:flex;align-items:center;justify-content:center;text-decoration:none;color:#fff}
.math-lesson-path .me-lp-sheet-close{position:absolute;top:8px;right:10px;width:30px;height:30px;border:0;border-radius:50%;background:none;color:rgba(255,255,255,.7);font:24px/1 system-ui;cursor:pointer}
.math-lesson-path .me-lp-sheet h2{padding:0 16px}
.math-lesson-path .me-lp-row{min-height:70px}
@media(max-width:480px){.math-lessons-screen.has-lesson-path>.math-menu-content{padding:0 12px}.math-lesson-path .me-lp-app{padding:40px 16px}}
@media(max-height:520px) and (orientation:landscape){.math-lesson-path .me-lp-sheet{left:var(--lesson-path-center);right:auto;transform:translate(-50%,150%)}.math-lesson-path .me-lp-sheet.open{transform:translate(-50%,0)}}
@media(max-width:600px),(max-height:520px){.math-lesson-path .me-lp-sheet{bottom:calc(20px + env(safe-area-inset-bottom,0px))}}

/* Laptop/desktop only: larger artwork and more air between lesson stops. */
@media (min-width:1024px) and (hover:hover) and (pointer:fine){
  .math-lesson-path{--row-h:89px;--gap:70px;--step-x:44px}
  .math-lesson-path .me-lp-app{width:min(100%,540px);padding:clamp(112px,16vh,160px) 28px 64px}
  .math-lesson-path .me-lp-row{gap:26px}
  .math-lesson-path .me-lp-node,.math-lesson-path .me-lp-node svg.me-lp-disc{width:132px;height:89px}
  .math-lesson-path .me-lp-marker{top:-43px;width:52px;height:58px;margin-left:-26px}
}

