*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;font-family:Arial,Helvetica,sans-serif;background:#071923;color:#f7fbfc}button{font:inherit;cursor:pointer}.app{height:100%}header{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 22px;background:#061720;border-bottom:1px solid #234653}.brand{display:flex;align-items:center}.brand>span{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:#0c2b3a;border:1px solid #2d5869;color:#2fe0bf;font-weight:900;margin-right:8px}.brand>b{font-size:20px}.brand>em{font-style:normal;font-size:7px;letter-spacing:.15em;color:#6d8792;border-left:1px solid #294653;margin-left:12px;padding-left:12px}.status{font-size:8px;color:#839ca6}.status i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#2fe0bf;margin-right:6px}main{height:calc(100vh - 68px);display:grid;grid-template-columns:1fr 360px}.viewer{position:relative;overflow:hidden;background:radial-gradient(circle at 50% 42%,#173f50,#071923 68%)}#canvasWrap{position:absolute;inset:0}.scene-title{position:absolute;left:24px;top:20px;max-width:440px;pointer-events:none}.scene-title small{font-size:8px;letter-spacing:.15em;color:#2fe0bf;font-weight:900}.scene-title h1{font-size:24px;margin:5px 0}.scene-title p{font-size:9px;color:#7f98a3}.view-controls{position:absolute;left:22px;bottom:22px;display:flex;gap:7px}.view-controls button,.mode button{border:1px solid #315563;background:#0a2330cc;color:#a4b8c0;border-radius:8px;padding:8px 10px;font-size:8px}.mode{position:absolute;right:20px;top:20px;border:1px solid #315563;border-radius:10px;padding:3px;background:#071c27cc}.mode button{border:0;background:transparent}.mode button.active{background:#164153;color:#fff}.labels span{position:absolute;border:1px solid #456d7c;background:#061b27dd;border-radius:7px;padding:6px 8px;font-size:8px;color:#d1e3e9;pointer-events:none}.l-panel{left:46%;top:29%}.l-locator{left:30%;top:44%}.l-rest{left:55%;top:57%}.l-clamp{right:12%;top:38%}.instruction{background:#0a2430;border-left:1px solid #294f5d;padding:24px 20px;overflow:auto}.eyebrow,.cue-title{font-size:7px;letter-spacing:.15em;color:#2fe0bf;font-weight:900}.instruction h2{font-size:27px;line-height:1.08;margin:7px 0}.lede{font-size:10px;line-height:1.55;color:#8fa7b1}.asset-list{display:grid;gap:7px;margin:18px 0}.asset-list>div{display:grid;grid-template-columns:10px 1fr;gap:8px;align-items:center;border:1px solid #294f5d;border-radius:9px;padding:8px;background:#0b2936}.asset-list i{width:8px;height:8px;border-radius:50%}.panel-dot{background:#a9c4d3}.rest-dot{background:#567b91}.locator-dot{background:#2fe0bf}.clamp-dot{background:#f2b84c}.structure-dot{background:#3e6173}.asset-list b,.asset-list small{display:block}.asset-list b{font-size:9px}.asset-list small{font-size:7px;color:#718b96;margin-top:2px}.cue-title{margin:17px 0 8px}.cue-stack{display:grid;gap:6px}.cue{display:grid;grid-template-columns:28px 1fr;gap:7px;border:1px solid #294f5d;border-radius:9px;background:#0a2330;color:#839ca6;padding:8px;text-align:left}.cue span{grid-row:1/3;width:26px;height:26px;display:grid;place-items:center;border:1px solid #365e6c;border-radius:7px;font-size:7px}.cue b{font-size:9px;color:#c9d9df}.cue small{font-size:7px}.cue.active{border-color:#3d8174;background:#10343b}.cue.active span{background:#2fe0bf;color:#05221b}.principle{margin-top:18px;border:1px solid #3a7469;border-radius:11px;background:#10363d;padding:13px}.principle small,.principle b{display:block}.principle small{font-size:6px;color:#2fe0bf}.principle b{font-size:16px;margin:5px 0}.principle p{font-size:8px;color:#88a0aa;line-height:1.5}.toast{position:fixed;right:380px;bottom:18px;border:1px solid #377065;border-radius:9px;background:#08242cfa;padding:9px 11px;transform:translateY(90px);opacity:0;transition:.3s}.toast.show{transform:none;opacity:1}.toast b,.toast span{display:block}.toast b{font-size:7px;color:#2fe0bf}.toast span{font-size:6px;color:#8da5af}@media(max-width:900px){header .brand em,.status{display:none}main{grid-template-columns:1fr}.instruction{position:absolute;right:12px;bottom:12px;width:min(340px,calc(100% - 24px));max-height:46vh;border:1px solid #294f5d;border-radius:14px;box-shadow:0 25px 70px #0008}.scene-title{left:14px;top:12px}.mode{right:12px;top:12px}.toast{right:12px}}
.hide{display:none!important}
.loading-overlay,.error-overlay{
 position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;
 gap:9px;background:radial-gradient(circle at 50% 45%,rgba(16,55,69,.96),rgba(7,25,35,.985));
 pointer-events:none;
}
.loading-overlay b,.error-overlay b{font-size:15px}
.loading-overlay span,.error-overlay span{font-size:10px;color:#9eb2bb;max-width:540px;text-align:center}
.loader-ring{width:38px;height:38px;border-radius:50%;border:3px solid #294f5d;border-top-color:#2fe0bf;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.error-overlay{background:rgba(31,16,18,.97);pointer-events:auto}
.error-overlay b{color:#ffb9ad}

.narration-box{margin-top:16px;border:1px solid #315d6c;border-radius:11px;background:#0b2c38;padding:13px}
.narration-box small,.narration-box b{display:block}
.narration-box small{font-size:6px;color:#2fe0bf;letter-spacing:.12em}
.narration-box b{font-size:11px;margin:5px 0;color:#e4f1f5}
.narration-box p{font-size:9px;line-height:1.55;color:#9db0b8;margin:0}
.labels span{font-size:9px!important;font-weight:700;box-shadow:0 8px 22px rgba(0,0,0,.25)}

/* P2.4 v0.4 — high-contrast 3D palette + camera-tracked labels */
.viewer{background:radial-gradient(circle at 50% 42%,#284d60,#0a1f2a 72%)}
.labels{position:absolute;inset:0;pointer-events:none;z-index:12}
.tracked-label{
 position:absolute!important;
 left:0!important;right:auto!important;top:0!important;bottom:auto!important;
 display:flex;align-items:center;gap:6px;
 padding:7px 9px!important;
 border:1px solid rgba(255,255,255,.32)!important;
 background:rgba(5,23,32,.94)!important;
 color:#f4fbfd!important;
 border-radius:8px!important;
 font-size:10px!important;
 font-weight:800!important;
 box-shadow:0 8px 24px rgba(0,0,0,.35)!important;
 white-space:nowrap;
 will-change:transform;
}
.tracked-label i{
 width:7px;height:7px;border-radius:50%;background:#2fe0bf;display:block;flex:none;
}
#labelPanel i{background:#8ed8ff}
#labelLocator i{background:#35f0a8}
#labelRest i{background:#4ea5ff}
#labelClamp i{background:#ffd166}
#labelStructure i{background:#b2bec7}

/* P2.4 v0.5 — single-focus labeling + explicit front/rear orientation */
.tracked-label{display:none!important}
.focus-label{
 position:absolute;left:0;top:0;display:none;align-items:center;gap:7px;
 padding:8px 10px;border:1px solid rgba(255,255,255,.34);
 background:rgba(5,23,32,.96);color:#f8fcfd;border-radius:9px;
 font-size:11px;font-weight:800;box-shadow:0 10px 30px rgba(0,0,0,.38);
 white-space:nowrap;will-change:transform
}
.focus-label i{width:8px;height:8px;border-radius:50%;display:block}
.orientation-widget{
 position:absolute;left:22px;top:110px;z-index:13;
 border:1px solid #315563;background:rgba(6,25,35,.92);border-radius:10px;padding:9px 11px;
 min-width:165px
}
.orientation-widget small{display:block;font-size:6px;letter-spacing:.12em;color:#6d8792}
.orientation-widget div{display:flex;align-items:center;gap:8px;margin:5px 0}
.orientation-widget div span{font-size:13px;font-weight:900;color:#fff}
.orientation-widget div i{font-style:normal;color:#2fe0bf;font-size:14px}
.orientation-widget b{font-size:7px;color:#819aa5;font-weight:600}
.view-controls button:first-child,.view-controls button:nth-child(2),.view-controls button:nth-child(3){
 min-width:78px
}

/* ===== P2.4 Increment 2 ===== */
.learning-modes{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin:16px 0 12px}
.learning-modes button{border:1px solid #315563;background:#09222e;color:#849ba5;border-radius:8px;padding:9px 5px;font-size:7px;font-weight:800}
.learning-modes button.active{background:#174555;border-color:#3b6f80;color:#fff}
.asset-explorer,.practice-panel{border:1px solid #315563;background:#0a2733;border-radius:11px;padding:13px;margin:10px 0}
.asset-explorer>small,.practice-panel>small{font-size:6px;color:#2fc6a7;letter-spacing:.12em;font-weight:900}
.asset-explorer h3,.practice-panel h3{font-size:16px;margin:5px 0 6px}
.asset-explorer p,.practice-panel p{font-size:8px;line-height:1.5;color:#91a5ad}
.asset-buttons{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:10px 0}
.asset-buttons button{border:1px solid #345866;background:#0c303d;color:#b8c8ce;border-radius:7px;padding:8px 6px;font-size:7px}
.asset-buttons button.active{border-color:#2fc6a7;color:#fff;background:#124139}
.return-btn{width:100%;border:0;border-radius:8px;padding:9px;background:#2fc6a7;color:#05221b;font-size:8px;font-weight:900}
.practice-progress{display:flex;justify-content:space-between;border-top:1px solid #294b57;border-bottom:1px solid #294b57;padding:8px 0;margin:10px 0}
.practice-progress span,.practice-progress b{font-size:7px}
.practice-progress span{color:#7f98a2}.practice-progress b{color:#dbe8ec}
.practice-feedback{min-height:48px;border-radius:8px;background:#071d27;padding:9px;font-size:8px;line-height:1.5;color:#91a6ae;margin-bottom:8px}
.practice-feedback.correct{border:1px solid #287b66;color:#8ce0c8}
.practice-feedback.wrong{border:1px solid #98584b;color:#ffc1b4}
.practice-scene-badge{position:absolute;top:20px;left:50%;transform:translateX(-50%);z-index:14;border:1px solid #b98734;background:#251d0dcc;border-radius:10px;padding:8px 12px;text-align:center}
.practice-scene-badge small,.practice-scene-badge b{display:block}.practice-scene-badge small{font-size:6px;color:#f1b955;letter-spacing:.12em}.practice-scene-badge b{font-size:9px;margin-top:3px}

/* Integrated embed mode: remove duplicate shell chrome and maximize 3D canvas */
body.embed-mode header{display:none!important}
body.embed-mode .app{height:100vh}
body.embed-mode main{
  height:100vh!important;
  grid-template-columns:minmax(0,1fr) 330px;
}
body.embed-mode .viewer{min-width:0}
body.embed-mode .instruction{
  padding:16px 14px;
  border-left:1px solid #315563;
}
body.embed-mode .instruction h2{font-size:22px}
body.embed-mode .lede{font-size:9px}
body.embed-mode .asset-list{margin:11px 0}
body.embed-mode .asset-list>div{padding:6px}
body.embed-mode .learning-modes{margin:10px 0 8px}
body.embed-mode .cue-stack{gap:4px}
body.embed-mode .cue{padding:6px}
body.embed-mode .narration-box{margin-top:10px;padding:9px}
body.embed-mode .principle{margin-top:10px;padding:9px}
body.embed-mode .scene-title{top:54px;left:18px}
body.embed-mode .scene-title h1{font-size:20px}
body.embed-mode .orientation-widget{top:126px;left:18px}
body.embed-mode .mode{top:12px;right:12px}
body.embed-mode .view-controls{left:18px;bottom:58px}
body.embed-mode .toast{right:350px}

@media(max-width:1100px){
  body.embed-mode main{grid-template-columns:minmax(0,1fr) 300px}
  body.embed-mode .instruction{padding:13px 11px}
  body.embed-mode .asset-list{display:none}
  body.embed-mode .scene-title p{display:none}
}
@media(max-width:820px){
  body.embed-mode main{grid-template-columns:1fr}
  body.embed-mode .instruction{
    position:absolute;z-index:20;right:8px;bottom:54px;width:min(320px,calc(100% - 16px));
    max-height:46vh;border:1px solid #315563;border-radius:12px;background:#0a2430ee
  }
}

.asset-tip{margin-top:7px;font-size:7px;line-height:1.45;color:#728b96;text-align:center}

/* P2.4 v0.4 — dedicated isolated Asset Explorer renderer */
.asset-viewer-overlay{
 position:absolute;z-index:40;inset:10px 340px 10px 10px;
 border:1px solid #315563;border-radius:13px;background:#071923;
 box-shadow:0 26px 80px #0008;overflow:hidden
}
.asset-viewer-head{
 height:46px;display:flex;align-items:center;justify-content:space-between;
 padding:0 12px;background:#081f2a;border-bottom:1px solid #315563
}
.asset-viewer-head small,.asset-viewer-head b{display:block}
.asset-viewer-head small{font-size:6px;color:#2fe0bf;letter-spacing:.12em}
.asset-viewer-head b{font-size:10px;margin-top:2px}
.asset-viewer-head button{border:0;background:transparent;color:#b9c9cf;font-size:22px}
.asset-viewer-overlay iframe{width:100%;height:calc(100% - 46px);border:0;background:#071923}
body.embed-mode .asset-viewer-overlay{right:340px}
@media(max-width:1100px){body.embed-mode .asset-viewer-overlay{right:310px}}
@media(max-width:820px){body.embed-mode .asset-viewer-overlay{right:10px;bottom:54px}}
