#cook-stage{position:relative;z-index:62;color:#b88643;font-family:Arial,sans-serif}
#cook-stage [hidden]{display:none!important}
#cs-body{position:fixed;bottom:12px;width:154px;text-align:center;pointer-events:auto;will-change:transform}
#cs-person{position:relative;border:0;background:none;padding:0;width:100%;aspect-ratio:2/3;cursor:pointer;display:block}
/* Two stacked clip buffers plus a still: the next clip shows only once it is playing. */
#cs-image,#cook-stage .cs-video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 4px 3px #0003)}
#cs-caption{display:block;font-size:11px;color:#fff4e2;background:#30251cdb;border-radius:6px;padding:4px 5px;margin:3px 0;line-height:1.4}
#cs-controls{display:flex;gap:4px;justify-content:center;flex-wrap:wrap}#cs-menu{display:none;gap:4px;flex-wrap:wrap;justify-content:center}#cook-stage:is(.cs-menu-open,.cs-audible,.cs-voice-live) #cs-menu{display:flex}#cs-more{min-width:44px;font-size:17px!important;line-height:1}#cs-more[aria-expanded=true]{background:#f6e8cb!important;color:#30251c!important}
#cs-controls button{font:12px Arial,sans-serif;min-height:34px;padding:6px 9px;color:#fff4e2;background:#30251ce8;border:1px solid #ad8a56;border-radius:16px;cursor:pointer}
#cs-controls button[aria-pressed=true]{background:#f6e8cb;color:#30251c}
#cook-stage button:focus-visible{outline:3px solid #b88643;outline-offset:3px}
#cs-resume{position:fixed;right:12px;bottom:12px;z-index:70;min-height:44px;padding:8px 14px;border:1px solid #ad8a56;border-radius:16px;background:#30251c;color:#fff4e2;font:inherit;cursor:pointer}
#cs-resume[hidden]{display:none}#cs-resume:focus-visible{outline:3px solid #b88643;outline-offset:3px}
#cs-pointer{position:fixed;inset:0;width:100vw;height:100dvh;pointer-events:none;overflow:visible;opacity:.75}
#cook-stage.cs-hidden{display:none}
.cook-lesson-target{outline:2px solid #b76d23!important;outline-offset:5px}
.cook-action-target{outline:2px solid #b76d23;outline-offset:3px}
body.activity-expanded #cook-stage{display:none}body.cook-character-visible #mc-launch{display:none!important}
body.activity-expanded.cook-character-visible #mc-launch{display:flex!important}
/* Anchored in a lesson: inline slot (coding coach) or a positioned scene floor (Bad Apple). */
#cook-stage.cs-inline #cs-body{position:relative;left:auto;bottom:auto;width:100px}
/* Inline: keep the one-on-one control inside the figure column so it never covers the explanation text. */
#cook-stage.cs-inline #cs-one{right:0}
#cook-stage.cs-in-scene{position:absolute;inset:0;pointer-events:none}#cook-stage.cs-in-scene #cs-body{width:100px;position:absolute;pointer-events:auto}
:is(.cs-inline,.cs-in-scene) #cs-caption{font-size:10px}:is(.cs-inline,.cs-in-scene) #cs-controls button{font-size:11px;padding:5px 7px;min-height:32px}
.cs-footprint{position:absolute;left:0;right:0;bottom:0;height:240px;pointer-events:none;visibility:hidden}
@media(max-width:700px){#cs-body{width:100px}#cs-caption{font-size:10px}#cs-controls button{font-size:11px;min-height:32px;padding:5px 7px}
 /* Conversation open on a phone: she stands just above the conversation sheet instead of disappearing. */
 body.cook-open #cook-stage:not(.cs-anchored) #cs-body{bottom:calc(var(--mc-panel-h,0px) + 8px)}body.cook-open #cook-stage:not(.cs-anchored) #cs-caption{display:none}}
@media(prefers-reduced-motion:reduce){#cs-body{will-change:auto}}

/* A compact voice strip leaves her in the lesson or above the page controls. */
body.cook-conversing #cook-stage:not(.cs-anchored):not(.cs-frozen) #cs-body{bottom:calc(var(--mc-conversation-h,90px) + 24px)}
@media(max-width:700px){body.cook-conversing.cook-open #cook-stage:not(.cs-anchored):not(.cs-frozen) #cs-body{bottom:calc(var(--mc-panel-h,0px) + var(--mc-conversation-h,90px) + 32px)}}

body :is(#cook-stage.cs-frozen):not(.cs-anchored) #cs-body{bottom:var(--cs-frozen-bottom,12px)}

/* The same full-body character, temporarily hosted in the conversation room. */
#cook-stage.cs-one-on-one{display:flex!important;position:relative;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}
#cook-stage.cs-one-on-one #cs-body{position:relative!important;left:auto!important;bottom:auto!important;flex:none}
#cook-stage.cs-one-on-one #cs-pointer{display:none}
#mc-room #cs-person{border:0;background:none;padding:0;border-radius:0;min-height:0;box-shadow:none}
#mc-room #cs-caption{display:block;font-size:13px;max-width:30ch;margin:6px auto;color:var(--mc-ink);background:transparent}
#mc-room #cs-controls button{font-size:13px;min-height:38px;padding:7px 13px}

#cs-one{position:absolute;right:-8px;top:0;min-width:38px;min-height:38px;padding:2px;border:1px solid #ad8a56;border-radius:50%;background:#30251ce8;color:#fff4e2;font:24px/1 Arial,sans-serif;cursor:pointer}
#mc-room #cs-one{display:none}

/* The classroom has a real scrollport above the narrow-screen companion dock.
   Bottom padding alone lets mid-page controls pass behind a fixed character. */
html.cook-contained{height:100%;overflow:hidden;background:#f4e6c9 url('/brand/papyrus.png') center/600px}
html.cook-contained:has(body.wing-security){background:#172321}
html.cook-contained>body{height:calc(100dvh - var(--cs-dock-space,0px));overflow:auto;padding-bottom:0;overscroll-behavior-y:contain;scroll-padding-block:12px}
html.cook-contained>body.cook-room-modal{overflow:hidden}
body.cook-has-rail{padding-right:var(--cs-rail-width,184px)}
body{--cs-call-space:0px}
body.cook-conversing{--cs-call-space:calc(var(--mc-conversation-h,90px) + 12px)}
@media(max-width:1000px){
 body.cook-character-visible:not(.cook-open):not(.cook-one-on-one):not(.activity-expanded) > #cook-stage:not(.cs-hidden):not(.cs-anchored) #cs-body{
  display:grid;grid-template-columns:64px minmax(0,1fr) 44px;grid-template-rows:auto auto;gap:0 6px;
  align-items:center;box-sizing:border-box;width:calc(100% - 16px)!important;left:8px!important;
  bottom:calc(8px + env(safe-area-inset-bottom,0px) + var(--cs-call-space))!important;padding:8px;
  background:#f4e6c9 url('/brand/papyrus.png') center/600px;border:1px solid #ad8a56;border-radius:12px;
  text-align:left;
 }
 #cs-body{--cs-shelf-ink:#30251c}
 body.wing-security #cs-body{--cs-shelf-ink:#edf2e7}
 body.wing-security.cook-character-visible:not(.cook-open):not(.cook-one-on-one):not(.activity-expanded) > #cook-stage:not(.cs-hidden):not(.cs-anchored) #cs-body{background:#20302c;border-color:#657971}
 body.cook-character-visible:not(.cook-open):not(.cook-one-on-one):not(.activity-expanded) > #cook-stage:not(.cs-hidden):not(.cs-anchored){
  #cs-person{grid-column:1;grid-row:1/3;width:64px}
  #cs-caption{display:block;grid-column:2;grid-row:1;font-size:13px;background:none;color:var(--cs-shelf-ink);padding:0;margin:0;align-self:end}
  #cs-controls{grid-column:2;grid-row:2;justify-content:flex-start;gap:6px;align-self:start;margin-top:6px}
  #cs-controls button{font-size:12px;min-width:44px;min-height:44px;padding:6px 9px}
  #cs-one{grid-column:3;grid-row:1/3;position:static;min-width:44px;min-height:44px}
 }
}
@media(max-width:1000px) and (max-height:500px){
 body:not(.cook-open):not(.cook-one-on-one)>#cook-stage:not(.cs-anchored) #cs-body{grid-template-columns:48px minmax(0,1fr) 44px}
 body:not(.cook-open):not(.cook-one-on-one)>#cook-stage:not(.cs-anchored) #cs-person{width:48px}
}

#cs-hide{min-width:34px}#cook-stage.cs-one-on-one #cs-hide{display:none}

/* A focused phone field gets the reading space; the compact launcher stays
   available. Active speech/conversation and inline teaching keep their controls. */
@media(max-width:1000px){
 #mc-room #cs-controls button{min-width:44px;min-height:44px}
 body > #cook-stage.cs-editing{visibility:hidden}
 body.cook-editing.cook-character-visible #mc-launch{display:flex!important}
 body.cook-editing #cs-resume{display:none}
}
