.question{text-align:center}.visual{font-size:clamp(4rem,15vw,8rem);font-weight:950;color:#0d625d;margin:18px 0}.answers{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;max-width:480px;margin:20px auto}.answers button,.action{border:2px solid #d8e9e5;background:#fff;border-radius:16px;padding:14px;font-weight:900;cursor:pointer}.answers button.correct{border-color:#159570;background:#e4f8ef}.answers button.wrong{border-color:#df604d;background:#fff0ed}.feedback{min-height:28px;font-weight:900;color:#0d625d}.actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.action.primary{background:#0d625d;color:#fff}.close{border:0;background:#e5f1ee;width:42px;height:42px;border-radius:50%;font-size:1.4rem;cursor:pointer}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.stat{background:#dff7ef;border-radius:18px;padding:18px;text-align:center}.stat strong{display:block;font-size:2rem}.story-card{padding:24px}.story-text{text-align:start;font-size:1.08rem;line-height:1.8;max-height:42vh;overflow:auto;padding:18px;background:#f7fcfb;border-radius:18px;border:1px solid #dceee9}.story-text p:first-child{margin-top:0}.story-text p:last-child{margin-bottom:0}.story-lesson{text-align:start;margin:18px 0;padding:16px 18px;border-radius:16px;background:#fff4c7;color:#503b00}.story-lesson p{margin:.5rem 0 0;line-height:1.6}.child-speech{white-space:pre-line;min-height:1.5em;padding:10px 0;color:#154d48;font-weight:650}@media(max-width:540px){.answers,.stats{grid-template-columns:1fr}.story-card{padding:16px}.story-text{max-height:48vh}}
.lesson-intro{text-align:center;padding:18px;border:1px solid #cfe8e1;border-radius:22px;background:linear-gradient(145deg,#f2fffb,#fff9dd)}.lesson-intro p{max-width:700px;margin:12px auto 20px;font-size:1.08rem;line-height:1.75;text-align:start}.lesson-intro.complete{opacity:.7}.concept-animation,.animated-story-scene{display:flex;align-items:center;justify-content:space-around;gap:12px;min-height:120px;padding:18px;border-radius:20px;background:linear-gradient(120deg,#dff7ef,#fff4c7,#e8efff);overflow:hidden}.concept-animation span{font-size:clamp(2.3rem,8vw,4.8rem);animation:conceptFloat 2.2s ease-in-out infinite}.concept-animation span:nth-of-type(2){animation-delay:.3s}.concept-animation span:nth-of-type(3){animation-delay:.6s}.concept-animation i{width:44px;height:5px;border-radius:9px;background:#0d625d;animation:ideaFlow 1.4s ease-in-out infinite}.animated-story-scene span{font-size:clamp(2rem,7vw,4rem);animation:storyWalk 3s ease-in-out infinite}.animated-story-scene span:nth-child(2n){animation-delay:.5s}.explain-continue{margin:8px auto 2px}.question-reveal{animation:questionReveal .5s ease-out}@keyframes conceptFloat{50%{transform:translateY(-12px) scale(1.06)}}@keyframes ideaFlow{50%{transform:scaleX(.55);opacity:.45}}@keyframes storyWalk{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-14px) rotate(3deg)}}@keyframes questionReveal{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){.concept-animation span,.concept-animation i,.animated-story-scene span,.question-reveal{animation:none}}@media(max-width:540px){.concept-animation,.animated-story-scene{min-height:88px;padding:10px}.concept-animation i{width:22px}.lesson-intro{padding:12px}.lesson-intro p{font-size:1rem}}
#lessonDialog{width:min(1180px,calc(100vw - 24px));max-width:none;height:min(94dvh,900px);max-height:94dvh;padding:clamp(12px,2vw,24px);overflow:hidden}#lessonDialog[open]{display:flex;flex-direction:column}#lessonDialog .dialog-head{flex:0 0 auto;position:relative;top:auto}#lessonBody{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}.question{min-height:100%;display:grid;grid-template-rows:auto minmax(70px,1fr) auto auto auto;align-content:center;padding:clamp(6px,1.5dvh,18px)}.question h3{margin:.3rem 0}.question .visual{font-size:clamp(3rem,10dvh,6rem);margin:clamp(4px,1dvh,12px) 0}.question .answers{width:min(100%,680px);margin:clamp(6px,1.2dvh,14px) auto}.question .feedback,.question .child-speech{margin:2px 0;min-height:1.5em}.question .actions,#storyQuestionArea .actions{position:sticky;bottom:0;background:linear-gradient(#fffdf700,#fffdf7 18%);padding:12px 0 4px;z-index:1}.story-card:has(#storyQuestionArea:not([hidden])){min-height:100%;padding:8px}.story-card:has(#storyQuestionArea:not([hidden]))>.animated-story-scene,.story-card:has(#storyQuestionArea:not([hidden]))>.story-text,.story-card:has(#storyQuestionArea:not([hidden]))>.story-lesson,.story-card:has(#storyQuestionArea:not([hidden]))>.explain-continue{display:none}#storyQuestionArea:not([hidden]){min-height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;align-content:center;text-align:center}#storyQuestionArea .answers{width:min(100%,680px);margin:12px auto}@media(max-height:700px){.question .visual{font-size:clamp(2.4rem,8dvh,4rem)}.answers button,.action{padding:10px}.question{padding:2px}.question h3{font-size:1.2rem}}@media(max-width:540px){#lessonDialog{margin:0;width:100%;height:100dvh;max-height:100dvh;border-radius:0;padding:10px 12px max(10px,env(safe-area-inset-bottom));overflow:hidden}#lessonBody{overflow:auto}.question .answers,#storyQuestionArea .answers{grid-template-columns:1fr 1fr}.question .actions,#storyQuestionArea .actions{display:grid;grid-template-columns:1fr 1fr}.question .actions .primary,#storyQuestionArea .actions .primary{grid-column:1/-1}.story-card{padding:4px}}
.learning-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:16px}.knowledge-card{text-align:start;max-width:820px;margin:0 auto;padding:14px 18px;border-radius:18px;background:#fff;border:1px solid #dceee9;box-shadow:0 8px 24px #0d625d10}.knowledge-card p{margin:.55rem 0}.knowledge-card ol{margin:.5rem 0;padding-inline-start:1.4rem;line-height:1.6}.knowledge-card .age-chip{display:inline-block;padding:2px 8px;border-radius:999px;background:#e8efff;font-size:.78em;font-weight:800}.memory-hook{background:#fff4c7;padding:10px 12px;border-radius:12px}@media(max-width:540px){.learning-actions{display:grid;grid-template-columns:1fr}.knowledge-card{padding:10px 12px}.lesson-intro{min-height:100%}}

/* v39 engineering courses */
.engineering-animation{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.75rem;padding:1rem;border:1px solid var(--line,#d9e2ec);border-radius:18px;margin:.8rem 0;overflow:hidden}.engineering-animation small{grid-column:1/-1;text-align:center;opacity:.8}.electrical-animation .wire{position:relative;height:6px;background:currentColor;border-radius:99px}.electrical-animation .wire i{position:absolute;width:9px;height:9px;border-radius:50%;background:currentColor;top:-2px;animation:electronFlow 1.6s linear infinite}.electrical-animation .wire i:nth-child(2){animation-delay:.5s}.electrical-animation .wire i:nth-child(3){animation-delay:1s}.electronics-animation{grid-template-columns:auto 1fr auto 1fr auto}.electronics-animation .pulse{letter-spacing:.35rem;animation:signalPulse 1.2s ease-in-out infinite}.mechanical-animation{grid-template-columns:1fr 1fr auto}.mechanical-animation .gear{font-size:2.4rem;display:inline-block}.mechanical-animation .g1{animation:gearCW 3s linear infinite}.mechanical-animation .g2{animation:gearCCW 3s linear infinite}.lesson-voice-status{display:block;min-height:2.8rem;margin:.75rem 0;padding:.65rem .8rem;border-radius:14px;background:rgba(127,127,127,.08);white-space:pre-wrap}@keyframes electronFlow{from{left:0}to{left:calc(100% - 9px)}}@keyframes signalPulse{0%,100%{opacity:.25;transform:scale(.92)}50%{opacity:1;transform:scale(1.08)}}@keyframes gearCW{to{transform:rotate(360deg)}}@keyframes gearCCW{to{transform:rotate(-360deg)}}@media (prefers-reduced-motion:reduce){.engineering-animation *{animation:none!important}}


/* v40 live tutor + viewport hardening */
#lessonDialog{display:none;grid-template-rows:auto auto minmax(0,1fr);width:min(1200px,calc(100vw - 16px));height:min(96dvh,940px);max-height:96dvh;padding:clamp(10px,1.6vw,20px);overflow:hidden}
#lessonDialog[open]{display:grid}
#lessonDialog .dialog-head{min-width:0;padding:4px 0 8px;gap:10px}
.lesson-heading{min-width:0}.lesson-heading h2,.lesson-heading small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
.lesson-head-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.live-doubt-button{min-height:44px;border:2px solid #0d625d;border-radius:14px;background:#fff;color:#0d625d;padding:8px 13px;font:inherit;font-weight:900;cursor:pointer;white-space:nowrap}
.live-doubt-button.listening{background:#0d625d;color:#fff}
.live-voice-dock{display:flex;align-items:center;gap:10px;min-width:0;margin:0 0 8px;padding:8px 11px;border:1px solid #cfe8e1;border-radius:14px;background:#f4fcfa;line-height:1.25}
.live-dot{width:11px;height:11px;flex:0 0 11px;border-radius:50%;background:#159570;box-shadow:0 0 0 4px #15957022}
.live-voice-dock.listening .live-dot{animation:livePulse 1s ease-in-out infinite}.live-voice-dock.answering .live-dot{background:#7a4dd8;box-shadow:0 0 0 4px #7a4dd822}.live-voice-dock.paused .live-dot{background:#d78d14}.live-voice-dock.error .live-dot{background:#c64031}
.live-voice-copy{display:grid;min-width:0;gap:2px}.live-voice-copy strong,.live-voice-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.live-voice-copy small{color:#4c6d69}
#lessonBody{min-height:0;overflow:hidden}
#lessonIntro{height:100%;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;align-content:stretch;gap:6px;padding:clamp(8px,1.3vw,16px)}
#lessonIntro>.engineering-animation,#lessonIntro>.concept-animation{margin:0;min-height:clamp(68px,15dvh,128px);max-height:18dvh}
#lessonIntro>h3{margin:2px 0;font-size:clamp(1rem,2.2dvh,1.35rem)}
#knowledgeExplanation{min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:2px 4px;scrollbar-gutter:stable}
#knowledgeExplanation .knowledge-card{max-width:none;margin:0;box-shadow:none}
#lessonIntro>.lesson-voice-status{display:none}
#lessonIntro>.learning-actions{margin:0;padding-top:6px;flex:0 0 auto;position:relative;z-index:3;background:#fffdf7}
#lessonIntro>.learning-actions .action{min-height:46px}
#questionArea{height:100%;min-height:0;overflow:auto}
#questionArea .actions{bottom:0}
@keyframes livePulse{0%,100%{transform:scale(.86);opacity:.55}50%{transform:scale(1.15);opacity:1}}
@media(max-height:760px){#lessonDialog{height:98dvh;max-height:98dvh}.live-voice-dock{padding:5px 9px;margin-bottom:5px}.live-voice-copy small{display:none}#lessonIntro>.engineering-animation,#lessonIntro>.concept-animation{min-height:58px;max-height:12dvh}.engineering-animation{padding:.5rem}.knowledge-card{font-size:.94rem}.knowledge-card p{margin:.35rem 0}.lesson-intro p{line-height:1.45}}
@media(max-width:620px){#lessonDialog{margin:0;width:100%;height:100dvh;max-height:100dvh;border-radius:0;padding:8px 10px max(8px,env(safe-area-inset-bottom));grid-template-rows:auto auto minmax(0,1fr)}#lessonDialog .dialog-head{padding:2px 0 6px}.lesson-heading small{font-size:.72rem}.lesson-heading h2{font-size:1.05rem}.live-doubt-button{min-height:42px;padding:6px 9px;font-size:.88rem}.close{width:42px;height:42px}.live-voice-dock{margin-bottom:5px}.live-voice-copy strong{font-size:.9rem}.live-voice-copy small{font-size:.76rem}#lessonIntro{padding:7px;gap:4px}#lessonIntro>.engineering-animation,#lessonIntro>.concept-animation{min-height:62px;max-height:13dvh}.engineering-animation small{display:none}#knowledgeExplanation{font-size:.95rem}.knowledge-card{padding:8px 10px}.learning-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.learning-actions .action{padding:8px;font-size:.88rem}.learning-actions .primary{grid-column:1/-1;grid-row:1}.question .actions{grid-template-columns:1fr 1fr}.question .actions .primary{grid-column:1/-1}.question .visual{font-size:clamp(2.5rem,9dvh,4.8rem)}}
@media(max-width:380px){.live-doubt-button{font-size:0;width:44px;padding:0}.live-doubt-button::before{content:'🎤';font-size:1.1rem}.live-voice-copy small{display:none}.learning-actions{grid-template-columns:1fr}.learning-actions .primary{grid-column:auto;grid-row:auto}}
@media(prefers-reduced-motion:reduce){.live-voice-dock.listening .live-dot{animation:none}}


/* v44 tablet/phone/browser fit */
@media(min-width:621px) and (max-width:1180px){#lessonDialog{width:calc(100vw - 20px);height:96dvh}.learning-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.learning-actions .action{min-width:0}.engineering-animation,.concept-animation{max-width:100%;overflow:hidden}}
@media(orientation:landscape) and (max-height:620px){#lessonDialog{height:100dvh;max-height:100dvh;width:100vw;border-radius:0}.live-voice-copy small{display:none}#lessonIntro>.engineering-animation,#lessonIntro>.concept-animation{max-height:18dvh}.knowledge-card{font-size:.9rem}.learning-actions .action{min-height:42px}}
