/* Step one only: the live chase scene fills the whole fixed teaching window. */
#guidePanel.immersive-guide[open]:is([data-phase='calibrate'],[data-phase='steer']){display:block}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-header{position:absolute;z-index:6;inset:0 0 auto;padding:22px 28px;background:none;border:0;pointer-events:none}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-topline{display:contents}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) :is(.lesson-heading,#guideStepCount){display:none}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-stepper{width:240px;max-width:calc(100% - 90px);margin:0 auto;gap:0}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-stepper li:last-child{flex:0 0 34px}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) #guideBack{top:50%;right:18px;transform:translateY(-50%);background:#20172e66;pointer-events:auto}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-stage{position:absolute;inset:0;height:auto;width:100%;border-radius:inherit}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-shade{background:linear-gradient(180deg,#151027ac,transparent 105px),linear-gradient(0deg,#20172ef5,#20172ec9 100px,transparent 225px)}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{left:28px;right:calc(56px + var(--guide-action-width,154px));bottom:26px;top:auto;width:auto}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-footer{position:absolute;inset:auto 0 0;z-index:5;padding:18px 28px 24px;background:none;border:0;pointer-events:none}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-footer button{pointer-events:auto}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) #guideSteerCue{display:none}
#guidePanel.immersive-guide[data-phase='calibrate'] #guideCameraSlot{width:224px;right:22px;top:auto;bottom:var(--lesson-copy-space,140px);border-color:#d5aed18c;box-shadow:0 8px 30px #110c2833;transform:none}
#guidePanel.immersive-guide[data-phase='steer'] #guideCameraSlot{width:184px;right:22px;top:auto;bottom:var(--lesson-copy-space,140px)}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraFeed{aspect-ratio:4/3}
#guidePanel[data-phase='calibrate'] #guideCameraSlot::after{content:none}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-recovery{top:90px;bottom:auto;max-height:calc(100% - 225px)}
.lesson-hand-target{position:absolute;inset:0;z-index:2;pointer-events:none;background:linear-gradient(0deg,#1a122dbd,transparent 75%);overflow:hidden}
.hand-target-corners{position:absolute;inset:13px 13px 51px;border:1px solid #f3d4aa4f;border-radius:10px;box-shadow:inset 0 0 20px #edd5fd08}
.hand-target-corners::before,.hand-target-corners::after{content:'';position:absolute;inset:-1px;border:2px solid transparent;border-radius:10px;border-top-color:#f5d8ab;border-bottom-color:#f5d8ab;opacity:.65;clip-path:polygon(0 0,15% 0,15% 10%,85% 10%,85% 0,100% 0,100% 100%,85% 100%,85% 90%,15% 90%,15% 100%,0 100%)}
.hand-target-art{position:absolute;top:9px;left:8px;width:calc(100% - 16px);height:calc(100% - 57px);stroke:#ffe0af;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round;overflow:visible;filter:drop-shadow(0 2px 5px #180c24aa)}
.hand-target-palm{fill:#ffdfb115;transform-box:fill-box;transform-origin:center}
.hand-target-palm-line{stroke:#f0d1a46b;stroke-width:1.2}
.hand-target-track{stroke:#f5d5a236;stroke-width:1;stroke-dasharray:2 4}
.hand-target-arrows{stroke:#ffe0af;stroke-width:2}
.hand-target-check{display:none;stroke:#e0edcb;stroke-width:4}
.hand-target-prompt{position:absolute;left:5px;right:5px;bottom:31px;text-align:center;color:#fff0da;font:400 11px/1.4 Poppins,sans-serif;text-shadow:0 1px 5px #10061f}
.hand-target-scan{position:absolute;left:17px;right:17px;top:17px;height:2px;background:#e4c5ff;box-shadow:0 0 9px #cf9bfa,0 5px 12px #b784ed5c;opacity:0}
.hand-target-side{display:none;position:absolute;top:38%;width:23px;height:23px;border:1px solid #ead0f044;border-radius:7px;background:#25173299;color:#f3d0a4;text-align:center;font:400 16px/21px Poppins,sans-serif}
.hand-target-left{left:10px}.hand-target-right{right:10px}
.hand-target-side b{display:none;font:500 13px/21px Poppins,sans-serif}
.hand-target-side.is-done{font-size:0;background:#ae8ac7;color:#2c1939;border-color:#efd9fc}
.hand-target-side.is-done b{display:inline}
#guideHandProgress{position:absolute;z-index:5;left:0;bottom:0;width:100%;height:3px;margin:0;border:0;border-radius:0;appearance:none;background:#e0c6f020;color:#d9b0fa}
#guideHandProgress::-webkit-progress-bar{background:#e0c6f020}
#guideHandProgress::-webkit-progress-value{background:#d9b0fa}
#guideHandProgress::-moz-progress-bar{background:#d9b0fa}
#guidePanel[data-tracking='waiting'] .hand-target-palm{animation:hand-entry-place 2.6s ease-in-out infinite}
#guidePanel:is([data-tracking='waiting'],[data-tracking='scanning']) :is(.hand-target-track,.hand-target-arrows){display:none}
#guidePanel[data-tracking='scanning'] .hand-target-palm{opacity:.28;animation:none}
#guidePanel[data-tracking='scanning'] .hand-target-scan{animation:hand-entry-scan 1.4s ease-in-out infinite alternate}
#guidePanel[data-tracking='scanning'] .hand-target-corners{border-color:#d9b0fa}
#guidePanel[data-tracking='steering'] .hand-target-palm{animation:hand-entry-steer 2.8s ease-in-out infinite;opacity:.7}
#guidePanel[data-tracking='steering'] .hand-target-arrows{opacity:.55}
#guidePanel:is([data-tracking='steering'],[data-tracking='ready']) .hand-target-side{display:block}
#guidePanel[data-tracking='ready'] :is(.hand-target-palm,.hand-target-track,.hand-target-arrows){display:none}
#guidePanel[data-tracking='ready'] .hand-target-check{display:block}
#guidePanel[data-tracking='ready'] .hand-target-corners{border-color:#d6e2bd88}
#guidePanel:is([data-tracking='connecting'],[data-tracking='unavailable']) .lesson-hand-target{display:none}
#guidePanel:is([data-tracking='waiting'],[data-tracking='scanning']) #guideCameraFeed{filter:brightness(.75)}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraSlot .guide-camera-top{z-index:3;bottom:9px}
#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraSlot #guideLiveStatus{font-size:10px;background:#20162ecc;padding:2px 5px}
@keyframes hand-entry-place{0%,100%{opacity:.3;transform:translateY(8px) scale(.94)}35%,75%{opacity:.85;transform:translateY(0) scale(1)}}
@keyframes hand-entry-scan{from{opacity:.5;top:18px}to{opacity:.85;top:calc(100% - 57px)}}
@keyframes hand-entry-steer{0%,100%{transform:translateX(-24px) rotate(-5deg)}50%{transform:translateX(24px) rotate(5deg)}}
@media(max-width:700px){
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-header{padding:19px 20px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-stepper{width:210px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) #guideBack{right:11px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{left:20px;right:20px;bottom:92px;width:auto}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-footer{padding:14px 20px 24px}
 #guidePanel.immersive-guide[data-phase='calibrate'] #guideCameraSlot{width:164px;right:16px;bottom:var(--lesson-copy-space,205px)}
 #guidePanel.immersive-guide[data-phase='steer'] #guideCameraSlot{width:144px;right:16px;bottom:var(--lesson-copy-space,205px)}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraSlot #guideLiveStatus{font-size:9px}
 .hand-target-prompt{font-size:10px;bottom:29px}.hand-target-corners{inset:10px 10px 48px}.hand-target-art{top:6px;height:calc(100% - 50px)}
 .hand-target-side{top:30%;width:21px;height:21px;font-size:14px;line-height:19px}.hand-target-side b{line-height:19px}
 .hand-target-left{left:6px}.hand-target-right{right:6px}
}
@media(max-width:350px){
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-header{padding:17px 15px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-stepper{width:185px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{left:16px;right:16px;bottom:88px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy h2{font-size:28px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-footer{padding-left:16px;padding-right:16px}
}
@media(max-height:600px){
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-header{padding-top:14px;padding-bottom:14px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-stepper{width:210px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-stepper li:last-child{flex-basis:30px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{bottom:22px}
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-footer{padding-bottom:20px}
 #guidePanel.immersive-guide[data-phase='calibrate'] #guideCameraSlot{width:178px}
 #guidePanel.immersive-guide[data-phase='steer'] #guideCameraSlot{width:150px}
}
@media(max-height:600px) and (max-width:700px){
 #guidePanel:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{bottom:80px}
 #guidePanel.immersive-guide[data-phase='calibrate'] #guideCameraSlot{width:146px}
 #guidePanel.immersive-guide[data-phase='steer'] #guideCameraSlot{width:132px}
}
@media(pointer:coarse){#guidePanel:is([data-phase='calibrate'],[data-phase='steer']) #guideBack{width:44px;height:44px;min-height:44px}}
@media(prefers-reduced-motion:reduce){#guidePanel .lesson-hand-target *{animation:none!important;transition:none!important}#guidePanel[data-tracking='scanning'] .hand-target-scan{opacity:.7;top:40%}}

/* Explain -> activate -> place -> practice, in the same camera frame. */
#guidePanel[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{right:374px;bottom:26px}
#guidePanel[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) .lesson-footer{display:none}
#guidePanel.immersive-guide[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraSlot{width:320px;right:28px;bottom:26px;border:1px solid #d5aed18c;border-radius:18px;background:#251b36;box-shadow:0 12px 40px #100a2940,inset 0 1px 0 #f4dcff15;overflow:hidden;transition:border-color .3s,box-shadow .3s}
#guidePanel[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraFeed{aspect-ratio:4/3}
#guidePanel[data-input='camera'] #guideCameraActivate{position:absolute;z-index:5;left:50%;bottom:19px;display:flex;align-items:center;justify-content:center;width:max-content;min-height:48px;margin:0;padding:11px 25px;border:1px solid #ead2ff;border-radius:10px;background:linear-gradient(180deg,#dabcf2,#b28bd2);color:#352140;box-shadow:0 4px 0 #69457f,inset 0 1px 0 #fff0ff99;font:400 22px/1.1 Creepster,Georgia,serif;letter-spacing:.02em;text-shadow:none;transform:translateX(-50%);white-space:nowrap}
#guidePanel #guideCameraActivate::before,#guidePanel #guideCameraActivate::after{content:none}
#guidePanel #guideCameraActivate:hover{filter:brightness(1.1)}
#guidePanel #guideCameraActivate:active{transform:translate(-50%,2px);box-shadow:0 2px 0 #69457f}
#guidePanel[data-tracking='intro'] #guideCameraFeed{visibility:hidden}
#guidePanel[data-tracking='intro'] .lesson-hand-target{background:radial-gradient(ellipse at 50% 28%,#9b70be35,transparent 65%),linear-gradient(145deg,#352544,#1c172d)}
#guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-corners{inset:17px 17px 82px;border-color:#e5c8f029}
#guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-art{top:12px;height:calc(100% - 84px);stroke-width:1.45}
#guidePanel[data-tracking='intro'] .hand-target-palm{transform:translateX(var(--hand-demo-x,0px));fill:#f6d6a81a;filter:drop-shadow(0 0 8px #e7beee30)}
#guidePanel[data-tracking='intro'] .hand-target-track{stroke:#f5d5a25c}
#guidePanel[data-tracking='intro'] :is(.guide-camera-top,.hand-target-prompt){display:none}
#guidePanel[data-input='camera'] .hand-target-prompt{font-size:13px;bottom:39px;left:12px;right:12px}
#guidePanel[data-input='camera'] .hand-target-corners{inset:18px 18px 69px}
#guidePanel[data-input='camera'] .hand-target-art{top:12px;height:calc(100% - 76px)}
#guidePanel[data-input='camera'] .hand-target-side{top:35%;width:27px;height:27px;line-height:25px}
#guidePanel[data-input='camera'] .hand-target-side b{line-height:25px}
#guidePanel[data-input='camera'] .hand-target-left{left:17px}
#guidePanel[data-input='camera'] .hand-target-right{right:17px}
#guidePanel[data-input='camera'] #guideCameraSlot #guideLiveStatus{font-size:11px;padding:3px 7px}
#guidePanel[data-tracking='waiting'] .hand-target-palm{fill:#ffe6c009;opacity:.35}
#guidePanel[data-tracking='steering'] .hand-target-palm{opacity:.22}
#guidePanel.immersive-guide[data-tracking='scanning'] #guideCameraSlot{border-color:#dcc3ff;box-shadow:0 0 0 3px #c398ee12,0 10px 35px #110a2930}
#guidePanel.immersive-guide[data-tracking='ready'] #guideCameraSlot{border-color:#cfdfb7}
#guidePanel[data-tracking='ready'] .hand-target-prompt{color:#e4edcd}
@media(max-width:700px){
 #guidePanel[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{left:20px;right:20px;bottom:calc(var(--hand-feed-height,210px) + 52px)}
 #guidePanel.immersive-guide[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraSlot{width:min(280px,calc(100% - 40px));right:50%;bottom:26px;transform:translateX(50%);border-radius:15px}
 #guidePanel[data-input='camera'] .hand-target-prompt{font-size:12px}
 #guidePanel[data-input='camera'] #guideCameraSlot #guideLiveStatus{font-size:10px}
 #guidePanel[data-input='camera'] #guideCameraActivate{font-size:21px;min-height:46px;bottom:16px}
}
@media(max-height:600px) and (min-width:701px){
 #guidePanel.immersive-guide[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraSlot{width:272px;right:26px;bottom:max(var(--lesson-copy-space,120px),22%)}
 #guidePanel[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{right:324px;bottom:21px}
}
@media(max-height:600px) and (max-width:700px){
 #guidePanel.immersive-guide[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) #guideCameraSlot{width:min(210px,calc(100% - 40px));bottom:20px}
 #guidePanel[data-input='camera']:is([data-phase='calibrate'],[data-phase='steer']) .lesson-copy{bottom:calc(var(--hand-feed-height,158px) + 40px)}
 #guidePanel[data-input='camera'] #guideCameraActivate{font-size:19px;min-height:43px;padding:10px 18px;bottom:13px}
 #guidePanel[data-input='camera'] .hand-target-prompt{font-size:10px;bottom:32px}
 #guidePanel[data-input='camera'] .hand-target-corners{inset:12px 12px 56px}
 #guidePanel[data-input='camera'] .hand-target-art{height:calc(100% - 60px)}
 #guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-art{height:calc(100% - 70px)}
 #guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-corners{inset:12px 12px 66px}
 #guidePanel[data-input='camera'] #guideCameraSlot #guideLiveStatus{font-size:9px}
}

/* The camera shares the bottom band with the explanation; phones stack it. */
#guidePanel .hand-intro-copy{position:absolute;z-index:3;top:21px;left:22px;right:22px;margin:0;color:#f3e5ee;text-align:center;font:400 13px/1.65 Poppins,sans-serif;text-wrap:balance;pointer-events:none}
#guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-corners{display:none}
#guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-art{top:77px;left:50%;width:144px;height:73px;transform:translateX(-50%);stroke-width:1.6}
#guidePanel[data-input='camera'][data-tracking='ready'] #guideCameraSlot .guide-camera-top,#guidePanel[data-tracking='ready'] .hand-target-side{display:none}
#guidePanel[data-input='camera'][data-tracking='ready'] .hand-target-art{top:17px;height:calc(100% - 108px)}
#guidePanel[data-input='camera'][data-tracking='ready'] .hand-target-prompt{bottom:80px}
#guidePanel .lesson-stage,#guidePanel .lesson-footer{transition:opacity .16s ease}
#guidePanel[data-transition='out'] :is(.lesson-stage,.lesson-footer){opacity:0;pointer-events:none}
#guidePanel[data-transition='in'] :is(.lesson-stage,.lesson-footer){animation:lesson-step-enter .24s ease both}
#guidePanel .step-node{transition:background .2s,color .2s,border-color .2s,box-shadow .2s}
@keyframes lesson-step-enter{from{opacity:0}to{opacity:1}}
@media(max-width:700px){
 #guidePanel .hand-intro-copy{top:15px;left:16px;right:16px;font-size:12px}
 #guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-art{top:61px;width:132px;height:65px}
 #guidePanel[data-input='camera'][data-tracking='ready'] .hand-target-prompt{bottom:75px}
}
@media(max-height:600px) and (min-width:701px){
 #guidePanel .hand-intro-copy{top:15px;left:18px;right:18px;font-size:12px}
 #guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-art{top:59px;height:63px}
}
@media(max-height:600px) and (max-width:700px){
 #guidePanel .hand-intro-copy{top:11px;left:12px;right:12px;font-size:11px;line-height:1.5}
 #guidePanel[data-input='camera'][data-tracking='intro'] .hand-target-art{top:47px;width:110px;height:40px}
 #guidePanel[data-input='camera'][data-tracking='ready'] .hand-target-art{top:7px;height:calc(100% - 91px)}
 #guidePanel[data-input='camera'][data-tracking='ready'] .hand-target-prompt{bottom:64px}
}
@media(prefers-reduced-motion:reduce){#guidePanel .lesson-stage,#guidePanel .lesson-footer,#guidePanel .step-node{transition:none!important;animation:none!important}}
