/* Canonical composition. Change order in WORLD_LEARNING_LAYOUT, dimensions here. */
.sfi-learning-shell { --sfi-learning-width:336px; --sfi-learning-toolbar-height:62px; --sfi-safe-inset-top:78px; }
/* Header rules are carried directly from the approved prototype. */
.sfi-learning-shell .sfi-world-global-controls { position:fixed!important;left:0!important;right:0!important;top:0!important;height:62px;width:100%!important;max-width:none!important;transform:none!important;box-sizing:border-box;display:flex!important;flex-wrap:nowrap!important;gap:6px;padding:0 14px;border-bottom:1px solid var(--sfi-panel-border);background:#091019;z-index:42; }
.sfi-learning-shell .prototype-global-brand { order:-1000!important;margin:0 auto 0 0!important;flex:1 1 260px!important;width:auto!important;min-width:260px!important;max-width:360px!important;border:0!important;padding:0!important; }
.sfi-learning-shell .sfi-world-global-controls>button,.sfi-learning-shell .sfi-world-global-controls>a { flex:0 0 auto!important;white-space:nowrap!important; }
.sfi-learning-shell .sfi-world-global-controls button,.sfi-learning-shell .sfi-world-global-controls a[data-sfi-worlds-trigger] { border-radius:5px!important; }
.sfi-learning-shell .sfi-world-global-controls button[aria-expanded=true] { border-color:#bfe8fb99!important;background:#bfe8fb15!important;color:#edfaff!important; }
.sfi-learning-shell .sfi-world-global-controls .sfi-world-guide-launcher { border-radius:999px!important; }
@media(max-width:1199px) {
 .sfi-learning-shell .sfi-world-global-controls { inset:0 0 auto!important;height:62px!important;gap:6px!important;padding:8px 12px!important;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin; }
 .sfi-learning-shell .prototype-global-brand { flex:0 0 auto!important;min-width:0!important;margin:0 12px 0 0!important;white-space:nowrap; }
 .sfi-learning-shell .prototype-global-brand small,.sfi-learning-shell .prototype-global-brand i { display:none!important; }
 .sfi-learning-shell .sfi-world-global-controls button,.sfi-learning-shell .sfi-world-global-controls>a { flex:0 0 auto!important;min-width:44px!important;min-height:44px!important;width:auto!important;padding:8px 10px!important;font-size:10px!important;white-space:nowrap!important; }
 .sfi-learning-shell .sfi-world-global-controls .sfi-world-global-utility [data-sfi-control-label],.sfi-learning-shell .sfi-world-global-controls [data-sfi-control-label],.sfi-learning-shell .sfi-world-global-controls .sfi-world-guide-launcher>span:last-child { display:inline!important; }
 .sfi-learning-shell .sfi-world-guide-launchers { display:contents!important; }
 .sfi-learning-shell .sfi-world-global-controls [data-sfi-worlds-trigger] { order:-900!important; }
 .sfi-learning-shell .sfi-world-global-controls [id$=launcher-tours] { order:-800!important; }
 .sfi-learning-shell .sfi-world-global-controls [id$=launcher-ask] { order:-700!important; }
 .sfi-learning-shell .sfi-world-global-controls [data-sfi-account-control=account] { order:-600!important; }
}
.sfi-learning-panel { position:fixed; z-index:41; top:var(--sfi-learning-toolbar-height); right:0; bottom:0; width:var(--sfi-learning-width); box-sizing:border-box; display:flex; flex-direction:column; border-left:1px solid var(--sfi-panel-border); background:linear-gradient(90deg,rgba(9,16,24,.9),rgba(7,13,20,.96)); color:#e7f1f7; font:12px/1.5 system-ui,sans-serif; }
.sfi-learning-panel[hidden],.sfi-learning-module[hidden] { display:none!important; }
.sfi-learning-panel-header { flex:none; display:flex; justify-content:flex-end; padding:6px 8px; }
.sfi-learning-dismiss { min-height:32px; padding:5px 8px; border:1px solid #bfe8fb30; border-radius:5px; background:transparent; color:#b8cad6; font:10px system-ui; cursor:pointer; }
.sfi-learning-stack { display:flex; flex-direction:column; gap:10px; flex:1; min-height:0; padding:0 8px; overflow:auto; scrollbar-width:thin; }
.sfi-learning-module { position:relative; flex:0 0 auto; min-width:0; box-sizing:border-box; padding:10px; border:1px solid rgba(173,223,247,.15); border-radius:11px; background:linear-gradient(155deg,rgba(154,220,250,.065),rgba(0,0,0,.18)); box-shadow:inset 0 1px rgba(255,255,255,.035); }
.sfi-learning-module-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; border-bottom:1px solid #bfe8fb21; padding-bottom:6px; }
.sfi-learning-module-header strong { font:400 15px/1.4 Georgia,serif; }
.sfi-learning-module-body { min-width:0; }
.sfi-learning-module.is-flexible { flex:1 0 280px; display:flex; flex-direction:column; min-height:280px; }
.sfi-learning-module.is-flexible>.sfi-learning-module-body { flex:1; min-height:0; display:flex; flex-direction:column; }
[id].sfi-learning-shell .sfi-learning-guide { position:static; inset:auto; width:100%; min-width:0; margin:0; transform:none; pointer-events:auto; }
[id].sfi-learning-shell .sfi-learning-guide:not([data-tool=ask])>.sfi-world-guide-surface { display:block; max-height:none; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; background:transparent; overflow:visible; }
[id].sfi-learning-shell .sfi-learning-guide .sfi-world-guide-panel { padding:0; }
[id].sfi-learning-shell .sfi-learning-guide[data-tool=ask], [id].sfi-learning-shell .sfi-learning-guide[data-tool=ask]>.sfi-world-guide-surface { flex:1; display:flex; flex-direction:column; min-height:0; }
[id].sfi-learning-shell .sfi-learning-guide[data-tool=ask] .sfi-world-guide-panel, .sfi-learning-module .sfi-adam-ai-teacher,.sfi-learning-module .sfi-adam-ai-body { display:flex; flex:1; flex-direction:column; min-height:0; }
[id].sfi-learning-shell .sfi-learning-guide>.sfi-world-guide-surface::after { display:none; }
.sfi-learning-module .sfi-adam-ai-details { flex:1; min-height:100px; }
.sfi-learning-module .sfi-adam-ai-transcript { max-height:none; }
.sfi-learning-module .sfi-account-panel,.sfi-learning-module .sfi-comment-dialog { position:static!important; inset:auto!important; transform:none!important; width:100%!important; max-width:100%!important; max-height:none!important; margin:0!important; padding:0!important; border:0!important; box-shadow:none!important; background:transparent!important; }

.sfi-learning-module[data-learning-module=social] .sfi-account-panel>header { display:none; }
.sfi-learning-module .sfi-account-body { max-height:none; }
/* Chat scrolls inside the rail; the account modal must not trap its scroll chain. */
.sfi-learning-module[data-learning-module=social] .sfi-account-body { overflow:visible; overscroll-behavior:auto; }
.sfi-learning-module .sfi-comment-dialog form { padding:0; }
.sfi-learning-module .sfi-result-card { position:static!important; inset:auto!important; width:100%!important; margin:0!important; }
.sfi-learning-panel button:focus-visible { outline:2px solid #bfe8fb; outline-offset:2px; }
@media(min-width:1200px) {
 [id].sfi-learning-shell [id].sfi-app-panel { left:16px; top:78px; max-height:calc(100dvh - 96px); }
}
/* Landscape tablets already use a sidebar at1120px. Keep it below the
   measured toolbar instead of falling into the1200px breakpoint gap. */
@media(min-width:1120px) and (max-width:1199px) {
 [id].sfi-learning-shell [id].sfi-app-panel { left:16px;top:calc(var(--sfi-learning-toolbar-height,62px) + 16px);max-height:calc(100dvh - var(--sfi-learning-toolbar-height,62px) - 32px); }
}
/* The narrow composition keeps the full World above the learning stack. */
@media(max-width:1199px) {
 body.has-world-learning-panel { overflow-y:auto!important; }
 [id].sfi-learning-shell.has-learning-panel { overflow:visible; }
 .sfi-learning-panel { position:absolute; top:100dvh; bottom:auto; height:calc(100dvh - 62px); width:100%; border-left:0; border-top:1px solid var(--sfi-panel-border); }
 .sfi-learning-stack { width:100%; max-width:650px; box-sizing:border-box; margin:auto; }
}
.sfi-learning-stack { overflow:hidden; }
.sfi-learning-context { display:flex; flex-direction:column; gap:10px; flex:1 1 auto; min-height:0; overflow:auto; scrollbar-width:thin; }
.sfi-learning-context[hidden] { display:none; }
.sfi-learning-stack.has-flexible-module>.sfi-learning-context { flex:0 0 var(--learning-group-height,55%); max-height:none; }
.sfi-learning-stack>.is-flexible { flex:1 1 0; min-height:0; }
.sfi-learning-stack>.is-flexible .sfi-world-guide-panel { overflow:auto; scrollbar-width:thin; }
.sfi-learning-module.is-flexible>.sfi-learning-module-header { flex:none; }
.sfi-learning-reminder { position:absolute; z-index:43; right:12px; top:70px; width:min(350px,calc(100% - 24px)); }
.sfi-learning-panel { bottom:var(--sfi-learning-player-height,0px); }
.sfi-learning-lesson-box { padding:10px; margin-top:10px; border:1px solid rgba(173,223,247,.15); border-radius:11px; background:linear-gradient(155deg,rgba(154,220,250,.065),rgba(0,0,0,.18)); }
.sfi-learning-lesson-box[hidden] { display:none!important; }
.sfi-learning-lesson-box>.sfi-official-command { margin-top:8px; }
.sfi-learning-module[data-learning-module=information] { padding:0; border:0; background:none; }
.sfi-learning-module[data-learning-module=information] .sfi-result-card { box-sizing:border-box; }
.sfi-learning-context { mask-image:linear-gradient(#000 0%,#000 calc(100% - 12px),transparent); padding-bottom:12px; }
@media(max-width:1199px) {
 .sfi-learning-panel { bottom:auto; height:calc(100dvh - 62px - var(--sfi-learning-player-height,0px)); scroll-margin-top:var(--sfi-learning-toolbar-height,62px); }
}
.sfi-learning-module .sfi-adam-ai-mode-section,.sfi-learning-module .sfi-adam-ai-session-section { flex:none; }
.sfi-learning-module .sfi-adam-ai-conversation-section { display:flex; flex-direction:column; flex:1; min-height:220px; overflow:visible; }
.sfi-learning-module .sfi-adam-ai-conversation-section:has(.sfi-adam-ai-details[hidden]) { flex:none; min-height:0; }
.sfi-learning-module .sfi-adam-ai-details:not([hidden]) { display:flex; flex-direction:column; flex:1; min-height:0; }
.sfi-learning-module .sfi-adam-ai-teacher .sfi-adam-ai-transcript { flex:1; min-height:64px; max-height:none; }
.sfi-learning-module .sfi-adam-ai-form { flex:none; }
[id].sfi-learning-shell .sfi-world-3d-help { right:calc(var(--sfi-stage-right-inset,0px) + 12px); }
.sfi-learning-scroll-space { display:none; }
@media(max-width:1199px) {
 .has-learning-panel>.sfi-learning-scroll-space { display:block; position:absolute; top:100dvh; left:0; width:1px; height:calc(100dvh - 62px); pointer-events:none; }
}

.sfi-learning-module[data-learning-module=ask] { padding:0;border:0;border-radius:0;background:transparent;box-shadow:none; }
[id].sfi-learning-shell .sfi-learning-guide[data-tool=ask]>.sfi-world-guide-surface { margin:0;max-height:none;flex:1; }
[id].sfi-learning-shell .sfi-learning-guide[data-tool=ask]>.sfi-world-guide-surface::after { display:block; }
[id].sfi-learning-shell .sfi-learning-guide[data-tool=ask] .sfi-world-guide-panel { padding:0; }
.sfi-learning-guide[data-tool=ask] .sfi-world-guide-content { flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto;max-height:none; }
.sfi-learning-guide[data-tool=ask] .sfi-world-guide-header { flex:none; }
.sfi-learning-context { mask-image:none; padding-bottom:0; }
.sfi-learning-module[data-learning-module=tours] { padding:0;border:0;background:none;box-shadow:none; }
.sfi-learning-module[data-learning-module=tours]>.sfi-learning-module-header { display:none; }
.sfi-learning-panel-header { justify-content:space-between;align-items:center;padding:12px 0;margin:0 8px 8px;border-bottom:1px solid #bfe8fb21; }
.sfi-learning-panel-header strong { font:15px Georgia,serif;color:#f0f5f8; }
.sfi-learning-dismiss { min-height:30px;height:30px; }
.sfi-learning-lesson-box { position:relative;margin:0 0 10px;padding:10px;box-shadow:inset 0 1px rgba(255,255,255,.035); }
.sfi-learning-lesson-box>.sfi-learning-module-header { position:relative;display:block;padding:0 36px 10px 0;margin-bottom:10px;border-bottom:1px solid #bfe8fb21; }
.sfi-learning-lesson-box .sfi-learning-lesson-title { display:block;font:400 13px/1.4 Georgia,serif;color:#f0f5f8;margin:6px 0 0;white-space:normal; }
.sfi-learning-lesson-badge { display:inline-block;font:600 8px/1.4 system-ui;color:#b8d7e7;letter-spacing:.04em;border:1px solid #bfe8fb30;border-radius:4px;padding:3px 5px; }
.sfi-learning-lesson-box .sfi-panel-close { position:absolute;right:-5px;top:-5px;display:grid;place-items:center;width:36px;min-width:36px;height:36px;padding:0;margin:0;border:1px solid #bfe8fb25;border-radius:50%;background:#bfe8fb08;color:#b8cad6; }
.sfi-learning-lesson-box>.sfi-official-telemetry,.sfi-learning-lesson-box>.sfi-official-command { margin-top:8px; }
.sfi-learning-module .sfi-official-program-list { max-height:200px;overflow-y:auto; }

.sfi-learning-panel .sfi-world-navigation-fade { flex:0 0 18px; }

[id].sfi-learning-shell .sfi-learning-native-teacher>.sfi-learning-guide[data-tool=ask][data-open] { flex:1;min-height:0;height:100%; }

/* The shared rail supplies the available height; the former floating dock cap
   would leave the expanded conversation ending partway down a tall panel. */
[id].sfi-learning-shell .sfi-learning-panel .sfi-learning-native-teacher > .sfi-learning-guide[data-tool=ask] .sfi-world-guide-content { max-height:none; }

/* The approved teacher was isolated from World-level box sizing and close-button rules. */
.sfi-learning-native-teacher { font-size:14px; }
[id].sfi-learning-shell .sfi-learning-native-teacher .sfi-world-guide-header,
[id].sfi-learning-shell .sfi-learning-native-teacher .sfi-adam-ai-mode-section,
[id].sfi-learning-shell .sfi-learning-native-teacher .sfi-adam-ai-session-section,
[id].sfi-learning-shell .sfi-learning-native-teacher .sfi-adam-ai-conversation-section { box-sizing:content-box!important; }
:root body .sfi-learning-panel button.sfi-panel-close.sfi-panel-close { width:36px;min-width:36px;max-width:36px;height:36px;min-height:36px;max-height:36px;flex:0 0 36px;border:1px solid #bfe8fb30;border-radius:50%;background:transparent; }
:root body .sfi-learning-panel button.sfi-panel-close.sfi-panel-close::before { display:none; }
:root body .sfi-learning-lesson-box button.sfi-panel-close.sfi-panel-close { position:absolute;right:-5px;top:-5px;border-color:#bfe8fb25;background:#bfe8fb08; }

/* Keep every learning-panel scroll surface operable without visible tracks. */
[id].sfi-learning-shell .sfi-learning-panel,
[id].sfi-learning-shell .sfi-learning-panel * { scrollbar-width:none; }
[id].sfi-learning-shell .sfi-learning-panel::-webkit-scrollbar,
[id].sfi-learning-shell .sfi-learning-panel *::-webkit-scrollbar { display:none; width:0; height:0; }

/* Compact Worlds scroll the document to reach the learning panel. Hide the
   page track too, without disabling wheel, touch or keyboard scrolling. */
html:has(body.has-world-learning-panel),
body.has-world-learning-panel { scrollbar-width:none; }
html:has(body.has-world-learning-panel)::-webkit-scrollbar,
body.has-world-learning-panel::-webkit-scrollbar { display:none; width:0; height:0; }

/* Authored practice is subordinate to the selected lesson, as in the approved rail. */
.sfi-lesson-practice{margin-top:10px;min-width:0;font:12px/1.4 system-ui;color:#e7f1f7}
.sfi-lesson-practice button{font:inherit;cursor:pointer;min-height:36px;border:1px solid #bfe8fb38;border-radius:6px;background:#bfe8fb08;color:inherit;padding:7px}
.sfi-lesson-practice button:focus-visible{outline:2px solid #bfe8fb;outline-offset:2px}
.sfi-lesson-practice button:disabled{cursor:default;opacity:.45}
.sfi-lesson-practice .sfi-practice-start{width:100%;min-height:40px}
.sfi-lesson-practice .sfi-practice-start.is-ready{background:#bfe8fb20;border-color:#bfe8fb80}
.sfi-practice-heading{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.sfi-practice-heading>strong{font-size:12px}.sfi-practice-count{font-size:10px;color:#aebfcb}
.sfi-practice-heading .sfi-panel-close{margin-left:auto;flex:none}
.sfi-practice-navigation{display:flex;gap:4px;margin:7px 0;align-items:center}
.sfi-practice-navigation button:nth-child(2){flex:1}.sfi-practice-navigation button{min-width:36px}
.sfi-practice-index{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0}
.sfi-practice-index button{position:relative;min-width:36px}
.sfi-practice-index button[aria-current=true]{outline:1px solid #e4f1fa;background:#bfe8fb18}
.sfi-practice-index small,.sfi-practice-answers small{position:absolute;top:1px;right:3px;font-size:10px}
.sfi-practice-task{font-size:11px;color:#aebfcb;margin:8px 0;line-height:1.5}
.sfi-practice-question{font-size:16px;font-weight:450;line-height:1.4;margin:9px 0;color:#e7f1f7;overflow-wrap:anywhere}
.sfi-practice-question:focus{outline:none}
.sfi-practice-answers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.sfi-practice-answers button{position:relative;min-height:44px;font-size:14px;overflow-wrap:anywhere}
.sfi-practice-answers button.long-answer{font-size:12px;line-height:1.4}
.sfi-practice-answers button:disabled{opacity:1}
.sfi-practice-answers button[data-result=correct]{background:#bfe8fb1c;border-color:#d3e7f4;color:#fff}
.sfi-practice-answers button[data-result=incorrect]{border-style:dashed;border-color:#bfe8fb72;color:#d4dfe7}
.sfi-practice-feedback,.sfi-practice-summary{font-size:11px;color:#c4d8e5;margin:6px 0;line-height:1.4}
.sfi-practice-status:empty,.sfi-practice-feedback:empty{display:none}
.sfi-practice-saving{font-size:10px;color:#94a6b6;margin:9px 0 0}
.sfi-practice-heading{position:relative;padding-right:36px;min-height:36px}
:root body .sfi-learning-lesson-box .sfi-practice-heading button.sfi-panel-close.sfi-panel-close{top:0;right:0}
.sfi-lesson-practice[hidden],.sfi-lesson-practice [hidden]{display:none!important}
.sfi-learning-lesson-box .sfi-lesson-practice .sfi-practice-answers button{min-height:44px;font-size:14px}
.sfi-learning-lesson-box .sfi-lesson-practice .sfi-practice-answers button.long-answer{font-size:12px}
.sfi-practice-course-next{display:block;margin:8px 0;padding:9px;border:1px solid #bfe8fb38;border-radius:6px;color:#c3ebfc;text-align:center;text-decoration:none}
/* The rail owns scrolling; the former floating lesson dock must not cap it. */
[id].sfi-learning-shell .sfi-learning-guide[data-tool=tours]>.sfi-world-guide-surface>.sfi-world-guide-content{max-height:none;overflow:visible}

/* Account access stays in the outer corner; existing tools retain their order. */
.sfi-learning-shell .sfi-world-toolbar-tools{display:contents}
.sfi-learning-shell .sfi-world-toolbar-tools>button,.sfi-learning-shell .sfi-world-toolbar-tools>a{flex:0 0 auto!important;white-space:nowrap!important}
.sfi-learning-shell .sfi-world-global-controls>.sfi-account-navigation{order:1000!important;margin-left:8px;flex:0 0 auto}
@media(max-width:1199px){
 .sfi-learning-shell .sfi-world-global-controls{display:grid!important;grid-template-columns:minmax(0,1fr) auto;height:auto!important;min-height:62px;gap:6px 8px!important;overflow:visible;padding:8px 10px!important}
 .sfi-learning-shell .sfi-world-global-controls>.prototype-global-brand{grid-area:1/1;min-width:0!important;width:auto!important;max-width:none!important;margin:0!important;overflow:hidden}
 .sfi-learning-shell .sfi-world-global-controls>.sfi-account-navigation{grid-area:1/2;justify-self:end;margin-left:0}
 .sfi-learning-shell .sfi-world-toolbar-tools{grid-area:2/1/auto/-1;display:flex;align-items:center;justify-content:flex-start;gap:6px;min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:thin}
}
.sfi-learning-shell .sfi-world-toolbar-tools{display:flex;align-items:center;gap:6px;flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin}
@media(min-width:1200px){.sfi-learning-shell .sfi-world-global-controls>.prototype-global-brand{flex:0 1 260px!important;min-width:180px!important;max-width:260px!important}}

/* Phone AdamAI opens with voice controls; conversation text expands on request. */
@media(max-width:700px){
 .sfi-learning-panel:has(.sfi-adam-ai-details[hidden]):not(:has(.sfi-learning-context:not([hidden]))){height:auto;max-height:calc(var(--sfi-learning-visible-height,100dvh) - var(--sfi-learning-toolbar-height,62px) - 16px)}
 .sfi-learning-panel{height:calc(var(--sfi-learning-visible-height,100dvh) - var(--sfi-learning-toolbar-height,62px) - 16px);padding-bottom:env(safe-area-inset-bottom)}
 .sfi-learning-panel .sfi-learning-stack{margin:0 auto;overflow-y:auto;overscroll-behavior-y:contain}
 .sfi-learning-panel:has(.sfi-adam-ai-details[hidden]) .sfi-learning-stack>.is-flexible{flex:0 0 auto}
 .sfi-learning-module .sfi-adam-ai-conversation-section:has(.sfi-adam-ai-details:not([hidden])){min-height:180px}
 .sfi-learning-module .sfi-adam-ai.sfi-adam-ai-teacher textarea{font-size:16px!important;resize:none}
 .sfi-learning-module .sfi-adam-ai-form{padding-bottom:8px}
}

/* Keep the World in view alongside its tools at tablet and phone widths.
   A compact teacher uses its natural height; expanded tools scroll within a
   bounded surface instead of moving the entire World offscreen. */
@media(max-width:1199px) {
 body.has-world-learning-panel { overflow-y:hidden!important; }
 [id].sfi-learning-shell.has-learning-panel { overflow:hidden; }
 .has-learning-panel>.sfi-learning-scroll-space { display:none; }
 [id].sfi-learning-shell .sfi-learning-panel {
  position:fixed;top:calc(var(--sfi-learning-toolbar-height,62px) + 8px);
  right:8px;bottom:auto;width:min(336px,calc(100% - 16px));
  height:auto;max-height:min(42dvh,var(--sfi-learning-available-height,100dvh),calc(var(--sfi-learning-visible-height,100dvh) - var(--sfi-learning-toolbar-height,62px) - 24px));
  border:1px solid var(--sfi-panel-border);border-radius:12px;
  overflow:hidden;padding-bottom:env(safe-area-inset-bottom);
 }
 .sfi-learning-panel-header { flex:none;padding:6px 0;margin-bottom:4px; }
 .sfi-learning-panel .sfi-learning-stack { flex:0 1 auto;margin:0;overflow-y:auto;overscroll-behavior:contain; }
 .sfi-learning-stack.has-flexible-module>.sfi-learning-context { flex:0 0 auto; }
 .sfi-learning-stack>.is-flexible { flex:0 0 auto; }
 [id].sfi-learning-shell .sfi-learning-native-teacher>.sfi-learning-guide[data-tool=ask][data-open] { height:auto; }
 .sfi-learning-panel:has(.sfi-learning-guide[data-compact=true]):not(:has(.sfi-learning-context:not([hidden]))) .sfi-learning-panel-header { display:none; }
 .sfi-learning-module .sfi-adam-ai-conversation-section { flex:none; }
 .sfi-learning-module .sfi-adam-ai-teacher .sfi-adam-ai-transcript { max-height:160px; }
}
@media(max-width:1199px) {
 /* A single teacher needs one header. Keep the composer inside the bounded
    conversation rather than below a long, clipped transcript. */
 .sfi-learning-panel:has(.sfi-learning-guide[data-tool=ask]):not(:has(.sfi-learning-context:not([hidden]))) .sfi-learning-panel-header { display:none; }
 [id].sfi-learning-shell .sfi-learning-panel:has(.sfi-learning-guide[data-tool=ask][data-compact=false] .sfi-adam-ai-details:not([hidden])):not(:has(.sfi-learning-context:not([hidden]))) {
  height:min(42dvh,var(--sfi-learning-available-height,100dvh),calc(var(--sfi-learning-visible-height,100dvh) - var(--sfi-learning-toolbar-height,62px) - 24px));
 }
 .sfi-learning-panel:not(:has(.sfi-learning-context:not([hidden]))) .sfi-learning-stack { flex:1; }
 .sfi-learning-panel:not(:has(.sfi-learning-context:not([hidden]))) .sfi-learning-stack>.is-flexible { flex:1; }
 .sfi-learning-panel:not(:has(.sfi-learning-context:not([hidden]))) .sfi-adam-ai-conversation-section:has(.sfi-adam-ai-details:not([hidden])) { flex:1;min-height:0; }
 .sfi-learning-panel:not(:has(.sfi-learning-context:not([hidden]))) .sfi-adam-ai-details { min-height:0; }
 .sfi-learning-panel:not(:has(.sfi-learning-context:not([hidden]))) .sfi-adam-ai-teacher .sfi-adam-ai-transcript { min-height:0; }
}
/* Compact means a compact surface on desktop too, not an empty full-height rail. */
@media(min-width:1200px) {
 [id].sfi-learning-shell .sfi-learning-panel:has(.sfi-learning-guide[data-tool=ask][data-compact=true]):not(:has(.sfi-learning-context:not([hidden]))) { bottom:auto;height:auto;max-height:35dvh; }
 .sfi-learning-panel:has(.sfi-learning-guide[data-compact=true]):not(:has(.sfi-learning-context:not([hidden]))) .sfi-learning-panel-header { display:none; }
 .sfi-learning-panel:has(.sfi-learning-guide[data-compact=true]):not(:has(.sfi-learning-context:not([hidden]))) .sfi-learning-stack,
 .sfi-learning-panel:has(.sfi-learning-guide[data-compact=true]):not(:has(.sfi-learning-context:not([hidden]))) .sfi-learning-stack>.is-flexible { flex:0 1 auto; }
 [id].sfi-learning-shell .sfi-learning-native-teacher>.sfi-learning-guide[data-tool=ask][data-compact=true] { height:auto; }
}

@media(max-width:1199px) {
 /* Coexisting tools scroll above the compact voice controls, keeping both usable. */
 [id].sfi-learning-shell .sfi-learning-panel:has(.sfi-learning-guide[data-tool=ask][data-open=true]):has(.sfi-learning-context:not([hidden])) { height:min(42dvh,var(--sfi-learning-available-height,100dvh)); }
 .sfi-learning-panel:has(.sfi-learning-context:not([hidden])) .sfi-learning-stack.has-flexible-module { flex:1;overflow:hidden; }
 .sfi-learning-panel .sfi-learning-stack.has-flexible-module>.sfi-learning-context { flex:1 1 0; }
 .sfi-learning-panel:has(.sfi-learning-context:not([hidden])) .sfi-learning-stack>.is-flexible { flex:0 0 auto; }
}
@media(min-width:701px) and (max-width:1199px) and (max-height:600px) {
 /* In short landscape windows, essential voice controls share one row. */
 [id].sfi-learning-shell .sfi-learning-guide[data-tool=ask][data-compact=true]>.sfi-world-guide-surface { display:grid;grid-template-columns:150px minmax(0,1fr);align-items:center;gap:4px;padding:4px 8px; }
 [id].sfi-learning-shell .sfi-learning-guide[data-compact=true] .sfi-world-guide-header { margin:0;padding:0;border:0;gap:4px; }
 [id].sfi-learning-shell .sfi-learning-guide[data-compact=true] .sfi-world-guide-header strong { font-size:12px; }
 [id].sfi-learning-shell .sfi-learning-guide[data-compact=true] .sfi-adam-ai-session-section { padding:2px;border:0;gap:2px; }
 [id].sfi-learning-shell .sfi-learning-guide[data-compact=true] .sfi-adam-ai-teacher-controls { grid-template-columns:minmax(0,1fr) auto;gap:4px; }
 [id].sfi-learning-shell .sfi-learning-guide[data-compact=true] .sfi-adam-ai-teacher-controls>.sfi-adam-ai-visual,
 [id].sfi-learning-shell .sfi-learning-guide[data-compact=true] .sfi-adam-ai-presence-label { display:none; }
 [id].sfi-learning-shell .sfi-learning-guide[data-compact=true] .sfi-adam-ai-body { padding:0; }
 [id].sfi-learning-shell:has(.sfi-learning-guide[data-tool=ask][data-open=true][data-compact=false]) [id].sfi-app-panel { right:360px;width:auto; }
}
@media(min-width:701px) and (max-width:1199px) and (max-height:600px) {
 [id].sfi-learning-shell:has(.sfi-learning-guide[data-tool=ask][data-open=true]):has(.sfi-learning-context:not([hidden])) [id].sfi-app-panel { right:360px;width:auto; }
 [id].sfi-learning-shell .sfi-learning-panel:has(.sfi-learning-guide[data-tool=ask][data-open=true]):is(:has(.sfi-learning-guide[data-compact=false]),:has(.sfi-learning-context:not([hidden]))) {
  height:calc(var(--sfi-learning-visible-height,100dvh) - var(--sfi-learning-toolbar-height,62px) - 24px);
  max-height:calc(var(--sfi-learning-visible-height,100dvh) - var(--sfi-learning-toolbar-height,62px) - 24px);
 }
}

/* Phone tools reserve a measured top strip in the shared stage layout. */
@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel{
  top:var(--sfi-learning-toolbar-height,62px);left:0;right:0;bottom:auto;
  width:100%;height:auto;max-height:min(32dvh,var(--sfi-learning-available-height,100dvh),calc(var(--sfi-learning-visible-height,100dvh) - var(--sfi-learning-toolbar-height,62px) - 8px));
  border:0;border-bottom:1px solid var(--sfi-panel-border);border-radius:0;padding:4px 0;background:#091019;
 }
 .sfi-learning-panel .sfi-learning-panel-header,
 .sfi-learning-panel .sfi-learning-module-header{display:none!important}
 .sfi-learning-panel .sfi-world-guide-header{box-sizing:border-box;align-items:center;margin:0;padding:4px;min-height:36px}
 .sfi-learning-panel .sfi-learning-stack{padding:0 6px;gap:0;width:100%;max-width:none;flex:0 1 auto;overflow:auto}
 .sfi-learning-panel .sfi-learning-context{flex:0 1 auto!important;gap:0;padding:0;mask-image:none;overflow:visible}
 .sfi-learning-panel .sfi-learning-module{padding:0;border:0;border-radius:0;box-shadow:none;background:transparent}
 .sfi-learning-panel .sfi-learning-stack>.is-flexible{flex:0 1 auto!important;min-height:0}
 [id].sfi-learning-shell .sfi-learning-guide[data-tool=ask]>.sfi-world-guide-surface{border-radius:8px;padding:4px;margin:0;min-height:0}
 .sfi-learning-panel .sfi-adam-ai-session-section{padding:4px;gap:4px}
 .sfi-learning-panel .sfi-adam-ai-conversation-section{min-height:0!important}
 .sfi-learning-panel .sfi-adam-ai-teacher .sfi-adam-ai-transcript{max-height:160px;min-height:0}
 .sfi-learning-panel .sfi-adam-ai-details{min-height:0}
}

@media(max-width:700px){
 [id].sfi-learning-shell [id].sfi-app-panel.sfi-world-panel{
  left:0;right:0;bottom:0;top:auto;width:100%;box-sizing:border-box;
  border-radius:0;border-left:0;border-right:0;border-bottom:0;
  padding:5px max(8px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
 }
 [id].sfi-learning-shell .sfi-world-identity{margin:0 0 3px;padding:0}
 [id].sfi-learning-shell .sfi-world-identity-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
 [id].sfi-learning-shell .sfi-world-identity-copy{display:grid;min-width:0;gap:0;overflow:hidden}
 [id].sfi-learning-shell .sfi-world-identity .sfi-app-title{min-width:0;font-size:9px;line-height:1.2;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 [id].sfi-learning-shell .sfi-world-identity .sfi-app-subtitle{min-width:0;font-size:7px;line-height:1.2;margin:0;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 [id].sfi-learning-shell .sfi-world-panel-header-actions{gap:4px}
 [id].sfi-learning-shell .sfi-world-guide-launcher-icon.is-record{display:block!important;flex:0 0 13px!important;width:13px!important;min-width:13px!important;max-width:13px!important;height:13px!important;min-height:13px!important;aspect-ratio:1}
 [id].sfi-learning-shell .sfi-world-guide-launcher-icon.is-record::before{box-sizing:border-box;inset:2px auto auto 2px;width:9px;height:9px;aspect-ratio:1}
 [id].sfi-learning-shell .sfi-world-stage-status{top:var(--sfi-stage-top)}
}

/* Compact placement preserves the native tool cards, icons and status styles. */
@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:6px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-identity,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-description{display:none}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-instruments{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:6px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-narration{grid-template-columns:24px minmax(0,1fr) auto;gap:5px;min-height:44px;padding:6px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-narration-mark{grid-row:auto;width:24px;height:24px;min-width:24px;min-height:24px;aspect-ratio:1}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-narration-state{grid-column:auto;grid-row:auto;justify-self:end}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-duration{min-height:44px;padding:6px 8px;gap:3px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-state{grid-column:1;gap:3px;padding:6px 8px;align-content:center}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-command{grid-column:2;padding:6px;gap:4px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-controls{gap:5px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share-copy,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share>button{grid-column:1/-1}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share:has(.sfi-share-controls button.is-secondary:not([hidden])) .sfi-share-command{grid-column:1/-1}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-player{gap:6px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-program{padding:6px;gap:4px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-program-list{display:grid;gap:6px;max-height:none;overflow:visible;padding:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-program-option,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-program-link{min-height:36px;padding:5px 7px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-lesson-box{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:8px;margin:0;padding:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-lesson-box[hidden]{display:none}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-telemetry{grid-template-columns:20px minmax(0,1fr);gap:3px 5px;min-height:0;margin:0;padding:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-time-module{grid-column:2;min-width:0;gap:3px;padding:2px 0 0;border-left:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-player-time{font-size:13px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-command{grid-template-columns:minmax(0,1fr);gap:6px;margin:0;padding:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-player-controls{display:flex;flex-wrap:wrap;gap:4px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-official-player-controls button{flex:1;min-height:44px;padding:8px 10px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-lesson-practice{grid-column:1/-1;margin:0;padding:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-adam-ai-session-section{padding:6px;gap:6px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-comment-world{display:none}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-comment-kinds{margin:8px 0;padding:4px}
 [id].sfi-learning-shell .sfi-learning-panel #sfi-comment-hint{min-height:0;margin:4px 0 6px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-comment-dialog textarea{min-height:72px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-comment-about{margin:10px 0 8px;padding-top:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-comment-dialog footer{padding-top:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel p{margin:4px 0 8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel [data-chat-composer]{margin-top:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel textarea{min-height:64px;margin-block:4px 8px}
}

/* Phone navigation expansion preserves the active tool in a one-line strip. */
.sfi-learning-mobile-summary{display:none}
@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel.is-mobile-summary{height:44px;max-height:44px;padding:0}
 [id].sfi-learning-shell .sfi-learning-panel.is-mobile-summary>.sfi-learning-stack,
 [id].sfi-learning-shell .sfi-learning-panel.is-mobile-summary>.sfi-learning-panel-header{display:none!important}
 [id].sfi-learning-shell .sfi-learning-mobile-summary:not([hidden]){
  display:block;flex:none;width:100%;min-height:44px;padding:0 10px;border:0;border-radius:0;
  background:transparent;color:inherit;text-align:left;font:12px/1.3 system-ui;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;
 }
 [id].sfi-learning-shell:has(.sfi-learning-panel.is-mobile-summary:not([hidden])) [id].sfi-app-panel.sfi-world-panel{
  max-height:min(var(--sfi-world-panel-compact-height,48dvh),calc(100dvh - var(--sfi-learning-toolbar-height,89px) - 60px));
 }
}

@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-mobile-summary:has(.sfi-learning-record-summary){padding:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-record-summary{position:static;display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) 12px;align-items:stretch;gap:5px;width:100%;height:44px;box-sizing:border-box;padding:3px 6px;border-radius:0;border:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-record-summary .sfi-share-state,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-record-summary .sfi-share-duration{grid-column:auto;min-height:0;padding:3px 7px;gap:2px;align-content:center}
 [id].sfi-learning-shell .sfi-learning-record-summary .sfi-share-module-label{font-size:7px}
 [id].sfi-learning-shell .sfi-learning-record-summary .sfi-share-status{font-size:10px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 [id].sfi-learning-shell .sfi-learning-record-summary .sfi-share-time{font-size:14px}
 [id].sfi-learning-shell .sfi-learning-record-summary-arrow{align-self:center}
}

@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-lesson-box>.sfi-learning-module-header{display:block!important;grid-column:1/-1;margin:0;padding:0 34px 8px 0}
 [id].sfi-learning-shell .sfi-learning-lesson-box .sfi-panel-close{right:0;top:0;width:28px;min-width:28px;height:28px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-lesson-practice button{padding:8px 10px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-stack{overflow-y:auto;scrollbar-width:thin;scrollbar-color:#7893a3 #101c26}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-stack::-webkit-scrollbar{width:6px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-stack::-webkit-scrollbar-thumb{background:#7893a3;border-radius:3px}
}

@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel .sfi-world-guide-content{padding-block:0}
}

@media(max-width:700px){
 [id].sfi-learning-shell .sfi-world-global-controls>[data-sfi-worlds-trigger]{order:0!important;display:inline-flex!important;align-items:center;justify-content:center;width:28px!important;min-width:28px!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
 [id].sfi-learning-shell .sfi-world-global-controls>[data-sfi-worlds-trigger] [data-sfi-control-label]{display:none!important}
 [id].sfi-learning-shell .sfi-account-navigation>[data-account-action=login],
 [id].sfi-learning-shell .sfi-account-navigation>[data-account-action=account]{order:2}
 [id].sfi-learning-shell .sfi-account-navigation>[data-account-action=pricing]{order:1}
 [id].sfi-learning-shell .sfi-account-navigation>[data-account-action=signup]{order:3}
}

@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-native-teacher>.sfi-learning-guide[data-tool=ask][data-open=true]{margin-block:0!important}
}

/* Phone conversation content participates in the document flow, including the
   guest offer that follows it. The outer tool stack owns the scroll boundary. */
@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel .sfi-adam-ai-body{display:flex;flex-direction:column;flex:none;height:auto;min-height:0;gap:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-adam-ai-body>.sfi-adam-ai-conversation-section,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-adam-ai-body>.sfi-adam-ai-guest-offer{flex:0 0 auto;min-height:0;overflow:hidden}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-adam-ai-details:not([hidden]){flex:none;min-height:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-adam-ai-guest-offer{padding:10px;gap:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat]{gap:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-body{display:flex;flex-direction:column;gap:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-body>*{flex-shrink:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] p{margin:0;line-height:1.45}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-chat-invitation{display:grid;gap:8px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-actions,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-returning{margin:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-chat-empty{padding:4px 0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-chat-empty p{font-size:16px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-chat-empty span{margin-top:4px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-chat-log{max-height:none;overflow:visible;padding:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-account-panel[data-kind=chat] .sfi-account-chat-log:empty{display:none}
}

@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-native-teacher,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-native-teacher>.sfi-learning-guide[data-tool=ask][data-open],
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask]>.sfi-world-guide-surface,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask] .sfi-world-guide-content,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask] .sfi-world-guide-panel,
 [id].sfi-learning-shell .sfi-learning-panel .sfi-adam-ai-teacher{flex:0 0 auto;height:auto;max-height:none;overflow:visible}
}

/* Mobile refinement: fill saved-record rows and expose the single scroll area. */
@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share[data-state="created"] .sfi-share-instruments{grid-column:1;grid-template-columns:minmax(0,1fr)}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share[data-state="created"] .sfi-share-state{grid-column:2}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-share[data-state="created"] .sfi-share-command{grid-column:1/-1}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-adam-ai-microphone-toggle{box-sizing:border-box;flex:0 0 44px;width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;max-height:44px;aspect-ratio:1;padding:0;border-radius:50%}
 [id].sfi-learning-shell .sfi-learning-panel.has-more-below:not(.is-mobile-summary)::after{content:"";position:absolute;z-index:5;left:0;right:0;bottom:0;height:20px;pointer-events:none;background:linear-gradient(transparent,#091019e6)}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-practice-navigation{display:none}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-practice-index[hidden],
 [id].sfi-learning-shell .sfi-learning-panel .sfi-practice-index{display:grid!important;grid-template-columns:repeat(9,minmax(0,1fr));gap:3px;margin:5px 0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-practice-index button{min-width:0;min-height:28px;padding:3px 0;font-size:10px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-practice-answers.is-short-answers{grid-template-columns:repeat(var(--answer-count),minmax(0,1fr));gap:4px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-practice-answers.is-short-answers button{min-width:0;min-height:36px;padding:5px 2px;font-size:13px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-practice-heading{min-height:32px}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-practice-question{font-size:14px;margin:6px 0}
}

.sfi-guide-mobile-label{display:none}
@media(max-width:700px){
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask] .sfi-world-guide-header{box-sizing:border-box;align-items:center;min-height:26px;height:26px;padding:4px 2px;margin:0;gap:5px;border:0}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask] .sfi-world-guide-header strong{font-size:12px;line-height:1.2}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask] .sfi-world-guide-header button{position:static;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;flex:0 0 auto;width:max-content;min-width:0;max-width:none;height:18px;min-height:18px;max-height:18px;aspect-ratio:auto;padding:1px 6px;margin:0;border:1px solid rgba(191,232,251,.72);border-radius:999px;background:rgba(191,232,251,.16);color:rgba(255,255,255,.96);box-shadow:0 0 18px rgba(191,232,251,.08);font:700 6.5px/1 Inter,system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:.08em;text-transform:uppercase}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask] .sfi-world-guide-header button svg{display:none}
 [id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask] .sfi-world-guide-header .sfi-guide-mobile-label{display:inline;font:inherit;letter-spacing:inherit;text-transform:uppercase;color:inherit}
}

@media(max-width:700px){
 [id].sfi-learning-shell .sfi-world-global-controls{grid-template-columns:minmax(0,1fr) 28px auto!important}
 [id].sfi-learning-shell .sfi-world-global-controls>[data-sfi-worlds-trigger]{grid-area:1/2;height:32px!important;min-height:32px!important;max-height:32px!important;align-self:center}
 [id].sfi-learning-shell .sfi-world-global-controls>.sfi-account-navigation{grid-area:1/3}
}

/* Panel identity and dismissal remain separate from the tools it contains. */
.sfi-learning-panel-header { justify-content:flex-end; }
.sfi-learning-dismiss { display:grid;place-items:center;flex:none;width:28px;min-width:28px;height:28px;min-height:28px;padding:4px;border:0;background:transparent; }
.sfi-learning-reopen { position:fixed;z-index:98;right:0;top:48%;display:grid;place-items:center;width:25px;min-width:25px;height:52px;padding:4px;border:1px solid #bfe8fb55;border-right:0;border-radius:10px 0 0 10px;background:#080b10ed;color:#d4e9f5;box-shadow:-2px 0 12px #0005; }
.sfi-learning-reopen[hidden] { display:none; }
[id].sfi-learning-shell .sfi-learning-panel:has([data-learning-module]:not([hidden])) { bottom:12px;height:auto;max-height:calc(100dvh - var(--sfi-learning-toolbar-height,80px) - 24px); }
:is([id].sfi-learning-shell,body#calculator) > .sfi-learning-module.is-floating { position:fixed;z-index:100;top:calc(var(--sfi-learning-toolbar-height,70px) + 14px);right:12px;width:min(340px,calc(100vw - 24px));height:auto;min-height:0;max-height:calc(100dvh - var(--sfi-learning-toolbar-height,70px) - 28px);box-sizing:border-box;padding:8px;border:1px solid #bfe8fb44;border-radius:14px;background:#090b0ff2;box-shadow:0 10px 30px #0007;overflow:auto; }
:is([id].sfi-learning-shell,body#calculator) > .sfi-learning-module.is-floating[hidden] { display:none; }
:is([id].sfi-learning-shell,body#calculator) > .sfi-learning-module.is-floating .sfi-learning-guide { position:static;inset:auto;width:100%;height:auto!important;min-height:0;max-height:none; }
:is([id].sfi-learning-shell,body#calculator) > .sfi-learning-module.is-floating .sfi-adam-ai-details { max-height:55dvh; }

/* Float/Dock is an icon control on every host, including phone layouts. */
[id].sfi-learning-shell .sfi-learning-panel .sfi-learning-guide[data-tool=ask] .sfi-world-guide-header button.sfi-guide-float-toggle svg { display:block; }
