/* Innebygd i arbeidsvinduet på «Kroppens oppbygning og funksjon» (?embed=1).
   Rammen tilpasser seg innholdets høyde, så her brukes faste høyder i stedet for vh/dvh.
   Skjermhøyde inne i rammen er rammens egen høyde og ville fått rammen til å vokse i en løkke. */
.resource-embedded .site-header,.resource-embedded .site-footer,.resource-embedded .back-link,.resource-embedded .lab-heading,.resource-embedded .lab-tabs,.resource-embedded .atlas-heading,.resource-embedded .atlas-help,.resource-embedded .atlas-sources,.resource-embedded .energy-heading,.resource-embedded .source-notes{display:none!important}
.resource-embedded body{background:#f2f6f7}.resource-embedded .site-main{padding:14px 14px 18px!important;margin:0;max-width:none;min-height:0}.resource-embedded .mlab,.resource-embedded .atlas-app{max-width:none;margin:0}
.resource-embedded [data-system],.resource-embedded .atlas-status,.resource-embedded #atlas-status,.resource-embedded .atlas-intro,.resource-embedded .lab-insight,.resource-embedded .page-title,.resource-embedded .intro-copy,.resource-embedded .atlas-app>.atlas-help{display:none}
.resource-embedded .intro{margin:8px 0}.resource-embedded .intro h1{font-size:28px}

/* Bevegelseslab */
.resource-embedded .lab-layout{gap:18px}
.resource-embedded .anatomical-figure{height:660px;min-height:0}
.resource-embedded .lesson-panel,.resource-embedded .joint-panel,.resource-embedded .lab-layout>.lab-quiz{max-height:860px;min-height:0}
.resource-embedded .lab-result-list{max-height:420px}
.resource-embedded .work-meter{max-height:none}

/* Anatomi i 3D */
.resource-embedded .atlas-layout{height:auto;min-height:0}.resource-embedded .atlas-stage{min-height:0}
.resource-embedded #atlas-canvas{height:700px;max-height:none;min-height:0}
.resource-embedded .atlas-info{max-height:820px;overflow:auto}

/* Energi i bevegelse */
.resource-embedded #energy-canvas{height:600px;max-height:none;min-height:0}
.resource-embedded .energy-stage{height:auto;min-height:0}
.resource-embedded .energy-copy{max-height:700px;overflow:auto;padding:18px}
.resource-embedded .energy-steps{margin:6px 0}.resource-embedded .energy-player{margin:6px 0;padding:8px}.resource-embedded .energy-transport{margin-bottom:4px}.resource-embedded .energy-extra{font-size:13px}

/* Navneoppgaver */
.resource-embedded .practice .word-bank{max-height:360px;overflow:auto}.resource-embedded .practice .check-area{position:sticky;bottom:0;background:#f1f5f6;padding:10px 0}

/* Dialoger legges i den synlige delen av rammen (--hub-top/--hub-vh settes av body-hub.js). */
.resource-embedded dialog[open]{position:absolute;top:calc(var(--hub-top,0px) + 24px);bottom:auto;margin:0 auto;max-height:calc(var(--hub-vh,800px) - 48px)}

@media(max-width:900px){.resource-embedded .anatomical-figure{height:460px}.resource-embedded .lesson-panel,.resource-embedded .joint-panel,.resource-embedded .lab-layout>.lab-quiz{max-height:none}.resource-embedded .atlas-controls{flex-wrap:wrap}.resource-embedded #atlas-canvas{height:480px}.resource-embedded .atlas-info{max-height:none}.resource-embedded #energy-canvas{height:420px}.resource-embedded .energy-copy{max-height:none}}
@media(max-width:480px){.resource-embedded .site-main{padding:8px 8px 14px!important}.resource-embedded .anatomical-figure{height:400px}.resource-embedded #atlas-canvas{height:420px}}

/* Fullskjerm (fokusmodus, se resource-embed.js). Knappen på 3D-vinduet: */
.fs-button{position:absolute;right:10px;bottom:10px;z-index:12;border:1px solid #b9ccd2;background:rgba(255,255,255,.94);color:#173949;border-radius:8px;padding:8px 12px;font:inherit;font-size:13px;font-weight:700;line-height:1;white-space:nowrap;cursor:pointer;box-shadow:0 2px 8px #142c3c1f}.fs-button:hover{background:#fff}
.focus-mode .fs-button{display:none}

/* Figuren fyller skjermen; panelet ligger til høyre og åpnes med «☰ Meny». */
html.focus-mode.focus-stage,html.focus-mode.focus-stage body{overflow:hidden;height:100%}
/* Sider uten 3D-figur (navneoppgavene) rulles som vanlig, med plass til panelet og knappene. */
html.focus-mode:not(.focus-stage) body{padding-bottom:76px}html.focus-mode.drawer-open:not(.focus-stage) body{padding-right:var(--drawer-w,420px)}
.focus-mode{--stage-right:0px}.focus-mode.drawer-open{--stage-right:var(--drawer-w,420px)}
.focus-mode :is(.lab-layout,.atlas-layout,.energy-layout){position:fixed!important;inset:0;z-index:900;display:block!important;margin:0!important;height:auto!important;min-height:0!important;background:#eef3f4}
.focus-mode .mobile-panels{display:none!important}
.focus-mode :is(.lab-layout>.anatomy-stage,.atlas-stage,.energy-stage){position:absolute!important;top:0;left:0;bottom:0;right:var(--stage-right);display:flex!important;flex-direction:column;height:auto!important;min-height:0!important;margin:0;border:0!important;border-radius:0!important;box-shadow:none}
.focus-mode .lab-layout>.anatomy-stage>:is(.anatomy-topline,.anatomy-help){display:none}
/* Lagvalg og fargeforklaring nederst gir plass til Avslutt (venstre) og Meny (høyre). */
.focus-mode .lab-layout>.anatomy-stage>:is(.anatomy-layerbar,.anatomy-key){padding-left:350px!important;padding-right:150px!important}
.focus-mode .lab-layout>.anatomy-stage .figure-wrap{flex:1;min-height:0;display:flex;flex-direction:column}
.focus-mode .lab-layout>.anatomy-stage .anatomical-figure{flex:1;height:auto!important;min-height:0!important;max-height:none!important}
.focus-mode :is(#atlas-canvas,#energy-canvas){flex:1;height:100%!important;min-height:0!important;max-height:none!important}
/* Panelet: alt i oppsettet som ikke er figuren. */
.focus-mode :is(.lab-layout>:not(.anatomy-stage):not(.mobile-panels),.atlas-info,.energy-copy){position:absolute!important;top:0;right:0;bottom:0;width:var(--drawer-w,420px);box-sizing:border-box;display:none!important;max-height:none!important;min-height:0!important;height:auto!important;margin:0!important;overflow:auto!important;border:0!important;border-left:1px solid #d4e0e4!important;border-radius:0!important;background:#fff;padding:calc(var(--focus-top,0px) + var(--focus-head,0px) + 16px) 18px 70px!important;box-shadow:-8px 0 24px #142c3c14}
.focus-mode.drawer-open :is(.lab-layout>:not(.anatomy-stage):not(.mobile-panels),.atlas-info,.energy-copy){display:block!important}
.focus-mode .lesson-panel .lesson-content{overflow:visible;max-height:none}
/* Egen verktøylinje (frittstående Bevegelseslab og Anatomi i 3D) øverst i panelet. */
.focus-mode :is(.lab-tabs,.atlas-controls){display:none!important}
.focus-mode.drawer-open:not(.resource-embedded) .lab-tabs,.focus-mode.drawer-open .atlas-controls{display:flex!important;flex-wrap:wrap;gap:8px;position:fixed;top:var(--focus-top,0px);right:0;z-index:950;width:var(--drawer-w,420px);box-sizing:border-box;margin:0;padding:12px 16px;background:#fff;border-left:1px solid #d4e0e4;border-bottom:1px solid #e1e9ec}
.focus-mode.drawer-open.resource-embedded .atlas-controls [data-system]{display:none}
.focus-mode .lab-tabs label,.focus-mode .lab-tabs .activity-groups{width:100%}
.focus-mode .atlas-selection{left:350px!important;right:150px!important;width:auto!important;max-width:none!important}
/* Energi: avspillingsknappene flyter nederst midt på figuren, bildeteksten øverst. */
.focus-mode .energy-steps{display:none}
.focus-mode .energy-caption{top:12px!important;bottom:auto!important;left:12px!important;right:290px!important;width:auto!important}
.focus-mode .energy-player{position:fixed;z-index:940;bottom:14px;left:calc((100% - var(--stage-right)) / 2);transform:translateX(-50%);margin:0;padding:8px 10px;background:rgba(255,255,255,.95);border:1px solid #cddbe0;border-radius:10px;box-shadow:0 4px 16px #142c3c26}
.focus-mode .energy-player .energy-extra{display:none}
/* Knappene: avslutt nede til venstre, meny nede til høyre på figuren. */
.focus-controls button{position:fixed;z-index:960;bottom:14px;border:1px solid #b9ccd2;background:rgba(255,255,255,.96);color:#173949;border-radius:9px;padding:11px 15px;font:inherit;font-size:14px;font-weight:700;line-height:1;white-space:nowrap;cursor:pointer;box-shadow:0 3px 12px #142c3c24}
.focus-controls .focus-exit{left:14px}
.focus-controls .focus-lang{position:fixed;z-index:960;bottom:14px;left:190px;display:flex;border:1px solid #b9ccd2;border-radius:9px;overflow:hidden;box-shadow:0 3px 12px #142c3c24;background:#fff}
.focus-controls .focus-lang button{position:static;box-shadow:none;border:0;border-radius:0;padding:11px 14px}
.focus-controls .focus-lang button[aria-pressed=true]{background:#173949;color:#fff}
.focus-controls .focus-menu{right:calc(var(--stage-right) + 14px);background:#173949;color:#fff;border-color:#173949}
.focus-controls button:hover{filter:brightness(.97)}
/* Mobil: panelet dekker hele skjermen; figuren får all plass (lagvalg og måler ligger i vanlig visning). */
@media(max-width:699px){.focus-mode.drawer-open{--stage-right:0px}.focus-controls .focus-menu{right:14px}.focus-mode.drawer-open .focus-controls .focus-exit{display:none}.focus-mode .lab-layout>.anatomy-stage>:is(.anatomy-layerbar,.anatomy-key,.work-slot){display:none!important}.focus-mode .atlas-selection{left:12px!important;right:12px!important;bottom:72px!important}.focus-mode .energy-player{bottom:72px;max-width:calc(100% - 24px)}.focus-mode .energy-caption{right:12px!important;top:62px!important}.focus-controls button{padding:10px 13px;font-size:13px}.focus-controls .focus-lang{left:14px;bottom:66px}.focus-mode.drawer-open .focus-controls .focus-lang{display:none}}
/* Energi har ingen anatomiske navn; språkvalget skjules der. */
.focus-mode:has(.energy-layout) .focus-lang{display:none}
