/* All rules are scoped to the new inner-page root. Homepage selectors are intentionally absent. */
#lesson-flow{--lf-color:#f0a8b0;--lf-level:0;position:fixed;inset:0;z-index:30;box-sizing:border-box;border:3px solid var(--lf-color);border-radius:12px;background:#fff;overflow:hidden;color:#493e47;font-family:inherit;display:flex;flex-direction:column}
#lesson-flow *{box-sizing:border-box}
#lesson-flow button{font:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#lesson-flow .lf-close{position:absolute;z-index:4;top:max(10px,env(safe-area-inset-top));left:12px;width:40px;height:40px;border:0;border-radius:50%;background:#fffffff0;box-shadow:0 2px 12px #70525d16;color:#76616b;font-size:30px;line-height:1}
#lesson-flow .lf-movie{position:absolute;inset:0;background:#fff8fa}
#lesson-flow .lf-movie[hidden],#lesson-flow .lf-video-tools[hidden]{display:none}
#lesson-flow .lf-media{display:block;width:100%;height:100%;object-fit:contain;background:#fff8fa}
#lesson-flow .lf-video-tools{position:absolute;z-index:3;right:12px;bottom:max(12px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:10px;max-width:calc(100% - 24px);flex-direction:row-reverse}
#lesson-flow .lf-video-tools button{width:42px;height:42px;border:0;border-radius:50%;background:#ffffffe8;color:#805564;box-shadow:0 2px 12px #70525d16}
#lesson-flow .lf-video-status:not(:empty){background:#fffffff2;border-radius:14px;padding:10px 14px;font-size:14px}
#lesson-flow .lf-content{display:flex;flex:1;min-height:0;flex-direction:column;padding:calc(env(safe-area-inset-top) + 16px) 28px max(18px,env(safe-area-inset-bottom))}
#lesson-flow[data-stage=video] .lf-content{display:none}
#lesson-flow .lf-head{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:42px;padding-left:42px;font-size:14px;color:#a78794}
#lesson-flow .lf-lesson{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;width:100%;max-width:720px;margin:0 auto;overflow:auto;overscroll-behavior:contain}
#lesson-flow .lf-prompt{position:relative;background:#fff9fb;border:2px solid #f5dbe4;border-radius:24px;padding:22px 26px;width:min(100%,660px);flex-shrink:0}
#lesson-flow .lf-prompt:after{content:"";position:absolute;left:calc(50% - 9px);bottom:-11px;width:18px;height:18px;background:#fff9fb;border-right:2px solid #f5dbe4;border-bottom:2px solid #f5dbe4;transform:rotate(45deg)}
#lesson-flow .lf-prompt h1{font-size:clamp(26px,4.5vw,40px);line-height:1.25;letter-spacing:.2px;margin:0;overflow-wrap:anywhere;color:#493e47}
#lesson-flow .lf-prompt p{margin:12px 0 0;color:#907c86;font-size:17px;line-height:1.45}
#lesson-flow .lf-ipa{margin-top:12px;font-size:22px;color:#a47b90}
#lesson-flow .lf-actor{position:relative;display:flex;align-items:center;justify-content:center;min-height:100px;flex:0 1 280px;width:min(70vw,300px);padding-top:8px}
#lesson-flow .lf-mascot{display:block;object-fit:contain;width:100%;height:100%;max-height:290px}
#lesson-flow .lf-speaking{position:absolute;right:-5px;bottom:26%;display:none;gap:4px;align-items:center;height:24px}
#lesson-flow .lf-speaking i{width:4px;border-radius:4px;background:var(--lf-color);height:12px;animation:lf-voice .65s infinite alternate}
#lesson-flow .lf-speaking i:nth-child(2){animation-delay:.2s}
#lesson-flow .lf-speaking i:nth-child(3){animation-delay:.4s}
#lesson-flow[data-phase=demo] .lf-speaking{display:flex}
#lesson-flow .lf-status{flex-shrink:0;margin:0;min-height:25px;font-size:16px;line-height:1.5;color:#947d89}
#lesson-flow .lf-word-parts{font-size:25px;color:#cf799d;font-weight:700;min-height:0}
#lesson-flow .lf-word-parts:empty{display:none}
#lesson-flow .lf-controls{flex-shrink:0;display:grid;grid-template-columns:1fr 82px 1fr;align-items:center;justify-items:center;gap:12px;padding-top:16px;max-width:460px;width:100%;margin:0 auto}
#lesson-flow .lf-link{background:none;border:0;padding:12px 6px;color:#aa718b;font-size:15px;line-height:1.4;text-decoration:none}
#lesson-flow .lf-mic{display:flex;align-items:center;justify-content:center;width:76px;height:76px;border:0;border-radius:50%;background:#e58cb1;color:#fff;box-shadow:0 5px 0 #c97297;font-size:26px;flex-shrink:0}
#lesson-flow .lf-mic svg{width:34px;height:34px;fill:currentColor;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
#lesson-flow[data-phase=listen] .lf-mic{box-shadow:0 5px 0 #c97297,0 0 0 calc(5px + var(--lf-level)*17px) #f4b9d14d}
#lesson-flow[data-phase=process] .lf-mic{opacity:.5;pointer-events:none}
#lesson-flow[data-phase=demo] .lf-mic{opacity:.65}
#lesson-flow .lf-result{max-width:640px;width:100%;font-size:16px;line-height:1.5;color:#8a6f7f}
#lesson-flow .lf-result:empty{display:none}
#lesson-flow .lf-result p{margin:4px 0}
#lesson-flow .lf-score{display:inline-flex;gap:10px;align-items:baseline;color:#7aa379;font-size:42px;line-height:1.1}
#lesson-flow[data-phase=wrong] .lf-score{color:#c78873}
#lesson-flow .lf-score small{font-size:14px;font-weight:400}
#lesson-flow .lf-celebration{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:18px;overflow:hidden}
#lesson-flow .lf-celebration .lf-mascot{height:min(44vh,370px);width:min(75vw,370px);max-height:none;z-index:1}
#lesson-flow .lf-celebration h1{font-size:32px;margin:0;color:#79566b;z-index:1}
#lesson-flow .lf-celebration p{margin:0;font-size:20px;z-index:1}
#lesson-flow .lf-celebration .lf-status{font-size:15px}
#lesson-flow .lf-confetti{position:absolute;inset:0;pointer-events:none}
#lesson-flow .lf-confetti i{position:absolute;left:calc(var(--n)*6.1%);top:-18px;width:9px;height:17px;border-radius:3px;background:#e8a6be;animation:lf-confetti 2s calc(var(--n)*-.09s) linear both}
#lesson-flow .lf-confetti i:nth-child(3n){background:#f1cf76}
#lesson-flow .lf-confetti i:nth-child(3n + 1){background:#a3cabc}
#lesson-flow .lf-consent{border:2px solid #f3d8e3;border-radius:24px;padding:26px;width:calc(100% - 32px);max-width:420px;color:#705765;background:#fff}
#lesson-flow .lf-consent::backdrop{background:#5f435d55}
#lesson-flow .lf-consent p{line-height:1.7}
#lesson-flow .lf-consent h2{margin-top:0}
#lesson-flow .lf-primary{background:#e58cb1;color:white;border:0;border-radius:14px;padding:13px 20px;display:block;width:100%;font-weight:700}
@keyframes lf-voice{to{height:22px}}
@keyframes lf-confetti{to{transform:translateY(90vh) rotate(540deg)}}
@media(max-width:520px){#lesson-flow .lf-content{padding-left:18px;padding-right:18px}#lesson-flow .lf-prompt{padding:20px 17px}#lesson-flow .lf-prompt p{font-size:16px}#lesson-flow .lf-head{font-size:13px}#lesson-flow .lf-actor{flex-basis:230px}#lesson-flow .lf-lesson{gap:12px}}
@media(max-height:700px){#lesson-flow .lf-actor{flex-basis:160px;min-height:70px}#lesson-flow .lf-prompt{padding:15px 18px}#lesson-flow .lf-lesson{gap:10px}#lesson-flow .lf-controls{padding-top:10px}#lesson-flow .lf-mic{width:62px;height:62px}#lesson-flow .lf-controls{grid-template-columns:1fr 68px 1fr}}
@media(prefers-reduced-motion:reduce){#lesson-flow .lf-speaking i,#lesson-flow .lf-confetti i{animation:none}#lesson-flow .lf-confetti{display:none}}
