/* Shared mobile encounter foundation, extracted from the approved bakery layout. */
/* Mobile composition: header → encounter scene → hand OR builder → feedback.
   Geometry follows the supplied phone references; no desktop sidebars. */
.bakery-page{background:#020f15;overflow:hidden}.bakery{--card-width:132px;--gold:#f6cf79;--cyan:#65dce2;display:grid;grid-template-rows:auto minmax(180px,1fr) auto auto;width:100%;max-width:460px;height:100dvh;min-height:0;margin:0 auto;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);overflow:hidden;background:linear-gradient(130deg,#032a31,#00151b 70%);box-shadow:0 0 60px #0008}.bakery *{min-width:0}.bakery header{padding:8px 10px 0;background:linear-gradient(#063740,#001e25)}.bakery .brand{gap:7px;height:40px;font:700 27px Georgia,serif;color:#fff1cd;white-space:nowrap;text-shadow:0 0 10px #e6c26e35}.bakery .brand .sound-mark{color:var(--gold);font-size:26px}.bakery .brand .venue{margin-left:auto;padding-left:13px;border-left:1px solid var(--cyan);font:700 20px Georgia,serif;color:#f1e9ce}.bakery button{touch-action:manipulation}.bakery button:not(.spoken-card){min-height:44px;border:1px solid #32bac7;background:linear-gradient(140deg,#12515a,#032b34);border-radius:9px;padding:6px 9px;font:600 12px/1.25 system-ui;color:#c4f7f4;box-shadow:inset 0 0 10px #32cad716}.bakery button:disabled{opacity:.45;cursor:default}.bakery #options-open{border:0;background:none;box-shadow:none;font-size:21px;width:30px;flex:none;padding:0}.bakery-hud{display:flex;align-items:center;gap:7px;height:62px;margin-top:5px;padding:6px 7px;border:1px solid #3e9399;border-radius:12px;background:linear-gradient(#07353b,#021b20);box-shadow:inset 0 0 7px #39bfc324}.bakery-hud img{width:38px;height:44px;object-fit:cover;object-position:50% 8%;border:1px solid #b99449;border-radius:7px;flex:none}.bakery-hud .identity{flex:1}.bakery-hud .identity strong{font-size:16px;display:block;line-height:1.2}.bakery-hud .identity small{font-size:10px;font-style:italic;display:block;color:var(--gold);margin-top:3px}.patience-box{border-left:1px solid #5a7f7d;padding-left:8px;flex:0 0 84px}.patience-box>span{font-size:11px;display:block}.patience-box strong{font-size:16px;display:block;line-height:1.2}#patience-meter{width:73px;height:7px;display:block;margin-top:4px}meter::-webkit-meter-bar{background:#08272c;border:1px solid #40858b;border-radius:4px}meter::-webkit-meter-optimum-value{background:linear-gradient(90deg,#f7da7f,#3ce2a0)}.beat-box{border-left:1px solid #5a7f7d;padding-left:7px;text-align:center;flex:0 0 82px}.beat-box>span{font:italic 11px Georgia,serif;white-space:nowrap}#beat-dots{display:flex;justify-content:center;gap:4px;margin-top:8px}#beat-dots span{width:7px;height:7px;border-radius:50%;border:1px solid #5a7c80}#beat-dots span.lit{background:var(--gold);border-color:#fbe7a9;box-shadow:0 0 6px #efbd45}.bakery #progression{display:flex;justify-content:space-between;gap:2px;padding:6px 2px 5px;border-bottom:1px solid #247178;font-size:7px;line-height:1.3;color:#91aeb1;text-transform:uppercase;letter-spacing:.25px}.bakery #progression span{flex:1;text-align:center;position:relative;padding-top:6px}.bakery #progression span::before{content:'';position:absolute;top:0;left:0;right:0;height:2px;background:#24434a}.bakery #progression .current{color:#92f5f5}.bakery #progression .current::before,.bakery #progression .done::before{background:#62dfe4;box-shadow:0 0 4px #4ce8eb}.objective-line{display:flex;align-items:center;gap:6px;padding:6px 8px;margin:5px 0 7px;border:1px solid #ba984d;border-radius:18px;background:linear-gradient(90deg,#54462744,#002a31);box-shadow:0 0 7px #e4c35b23;min-height:32px}.objective-line>span{color:var(--gold);font-size:22px;line-height:1}.bakery .objective{color:#eee9d6;font:italic 11px/1.3 system-ui;margin:0}.bakery-scene{position:relative;min-height:0;overflow:hidden;isolation:isolate;background:url('../bakery/assets/scene.png') 31% 55%/cover}.bakery-scene::after{content:'';position:absolute;inset:0;pointer-events:none;z-index:4;background:linear-gradient(transparent 88%,#00202799);border-block:1px solid #8b6d3a66}.baker{position:absolute;right:-2%;bottom:0;width:45%;height:79%;object-fit:cover;object-position:50% 0;z-index:1;filter:drop-shadow(-5px 0 8px #00151b);mask-image:linear-gradient(#000 93%,transparent)}.bakery .menu-sign{position:absolute;top:7%;left:2%;width:97px;min-height:174px!important;padding:7px 6px!important;display:flex;flex-direction:column;gap:5px;text-align:left;align-items:stretch;z-index:2;border:2px solid #a57739!important;border-radius:3px!important;background:linear-gradient(145deg,#172722f5,#061a1cf5)!important;color:#f6dd99!important;box-shadow:0 0 0 2px #4d3922,4px 5px 12px #0009!important;transform:rotate(2deg)}.menu-flourish{text-align:center;color:var(--gold);font:20px Georgia;line-height:.8}.menu-sign em{font:italic 16px/1.1 Georgia;text-align:center;border-bottom:1px solid #b58b42;padding-bottom:6px}.menu-sign .menu-item{display:flex;gap:4px;align-items:center;border-bottom:1px dashed #b18d4538;padding:4px 0;font:italic 11px/1.2 Georgia;color:#a7efed}.menu-sign .menu-item u{text-underline-offset:3px}.menu-sign>small{font:8px system-ui;color:#d3c6a4;text-align:center;margin-top:auto}.bakery .menu-sign:disabled{opacity:.7}.npc-dialogue{position:absolute;inset:0;z-index:3;pointer-events:none}.npc-hand{position:relative;width:100%;height:100%;pointer-events:none}.npc-unit{position:absolute;left:calc(18% + var(--index)*var(--fan-step,10%));top:calc(13% + min(var(--index),2)*3%);width:var(--card-width);height:calc(var(--card-width)*1.4);transform:rotate(calc(-3deg + min(var(--index),2)*2deg));pointer-events:auto;z-index:calc(2 + var(--index))}.npc-unit[data-total="1"]{left:27%;top:13%;transform:rotate(-2deg)}.bakery .spoken-card{--card-width:132px;width:var(--card-width);height:calc(var(--card-width)*1.4);border-radius:9px;border:1px solid #54dce1;background:linear-gradient(145deg,#073641f5,#01202af5);padding:11px 8px 8px;box-shadow:0 0 7px #27e3e537,inset 0 0 9px #1aafb824;overflow:auto;scrollbar-width:thin;scrollbar-color:#4d797b transparent}.bakery .spoken-card[data-role=npc]{background:linear-gradient(135deg,#564d31ef,#082324f5 50%,#051b20f5);border-color:#f6d680;box-shadow:0 0 8px #f7ce6566,inset 0 0 8px #eed48b25}.bakery .card-label{font:700 8px/1.3 system-ui;letter-spacing:.45px;margin-bottom:10px;min-height:13px;text-transform:uppercase}.npc-unit .card-label{padding-right:21px}.bakery .spoken-card .expression{gap:7px;flex-shrink:0}.bakery .spoken-card .chunks{display:flex;flex-direction:column;gap:1px}.bakery .spoken-card .chunk{display:block;padding:0;background:none;border-radius:0}.bakery .spoken-card .target{font-size:19px;line-height:1.2;font-weight:700;text-decoration:underline;text-decoration-color:#d8b84d;text-decoration-thickness:1px;text-underline-offset:4px;overflow-wrap:normal;word-break:normal}.bakery .spoken-card .chunk:nth-child(3n+1) .target{color:#f5d57f}.bakery .spoken-card .chunk:nth-child(3n+2) .target{color:#95ddf1}.bakery .spoken-card .chunk:nth-child(3n) .target{color:#a1e5b0}.bakery .spoken-card .translation{font:italic 13px/1.25 Georgia;margin-top:5px;padding-top:7px;border-top:1px solid #bfa5685c;color:#e2ebe4}.bakery .card-foot{font-size:8px;line-height:1.2;padding-top:8px;color:#97c5c6}.bakery .card-audio{position:absolute;top:5px;right:5px;width:29px;min-height:32px!important;padding:2px!important;border-radius:5px!important;font-size:18px!important;box-shadow:0 0 8px #00c8d433!important}.bakery .scene-controls{position:absolute;left:8px;right:8px;bottom:5px;z-index:6;display:flex;align-items:center;gap:5px;pointer-events:none}.bakery .scene-controls button{pointer-events:auto;min-height:32px!important;padding:4px 8px;font-size:10px;background:#00232be8}.bakery #begin{border-color:var(--gold);color:var(--gold);min-height:44px!important;box-shadow:0 0 8px #ffe09144}.bakery #stop-audio{margin-left:auto;width:32px}.bakery #workspace{padding:8px 8px 0;border-top:1px solid #78cfce;background:linear-gradient(#052e34,#001e25);min-height:0}.bakery .section-heading{margin:0 2px 6px}.bakery .section-heading h2{font:16px Georgia;margin:0;color:#f9e4a8}.bakery .section-heading>span{font:9px system-ui;letter-spacing:.2px}.bakery #responses{display:flex;gap:10px;padding:4px 4px 8px;margin:0;scrollbar-width:thin;scrollbar-color:#34767c transparent}.bakery[data-building=true] #workspace>.section-heading{display:none}.bakery #builder{display:flex;flex-direction:column;gap:7px;min-height:0}.learning-sequence{display:flex;justify-content:space-between;font-size:8px;color:#86b2b8;line-height:1.3;padding:0 4px}.learning-sequence .current{color:#ffe599}.target-row{display:flex;gap:5px;border:1px solid #4cbcc3;border-radius:12px;padding:6px;background:#01252e;box-shadow:inset 0 0 10px #3ac7c433;border-top-color:#efd183}.bakery .builder-target{border:0!important;box-shadow:none!important;background:none!important;padding:2px 4px!important;text-align:center;flex:1;min-height:75px!important}.builder-target strong{font-size:23px;line-height:1.12;display:block;color:#f3f4ec;font-weight:700;text-decoration:underline;text-decoration-color:#dccb7e;text-underline-offset:5px;text-decoration-thickness:1px}.builder-target small{display:block;font:italic 14px/1.2 Georgia;color:#c5d7d6;margin-top:8px}.phrase-playback{display:flex;flex-direction:column;gap:4px;flex:none;width:59px}.bakery .phrase-playback button,.focus-playback button{min-height:36px!important;padding:4px!important;font-size:11px;text-transform:uppercase}.slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0}.bakery .slots button{min-height:104px!important;text-align:center;padding:7px 4px!important;border-radius:10px;background:linear-gradient(140deg,#073b45,#012b34);overflow-wrap:anywhere;box-shadow:inset 0 0 8px #4de2e31c}.slots button strong{font-size:20px;line-height:1.15;display:block;text-decoration:underline;text-decoration-color:#e1ca7a;text-underline-offset:5px;text-decoration-thickness:1px}.slots .slot-label{text-transform:uppercase;font-size:8px;letter-spacing:.8px;display:block;margin-bottom:8px;color:#b0eff1}.slots .slot-meaning{font:italic 12px/1.15 Georgia;display:block;margin-top:8px;color:#b8d7d7}.bakery .slots button.current{border:1px solid #ffe080;background:linear-gradient(140deg,#605024,#2d2e1c);box-shadow:0 0 7px #ffd75e6b,inset 0 0 7px #f6c2494d;color:#fff3c9}.bakery .slots button.placed{border:1px solid var(--cyan);background:linear-gradient(140deg,#0e5058,#023238)}.bakery .slots button:disabled:not(.placed){opacity:.6;border-style:dashed}.builder-progress{position:relative;height:17px;display:flex;align-items:center;justify-content:center;font-size:10px;color:#e2fcf9;margin:0 4px}.builder-track{position:absolute;left:0;right:0;height:3px;border:1px solid #18b9c0;border-radius:4px;background:#072b30}.builder-track>span{display:block;height:100%;background:linear-gradient(90deg,#ffda68,#80ebdc);box-shadow:0 0 5px #69fff0}.builder-count{z-index:1;padding:2px 10px;border-radius:12px;border:1px solid #59c4c4;background:#07353a;font-size:10px;line-height:1}.builder-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:2px}.bakery .builder-actions button{min-height:61px!important;padding:7px 4px;font-size:11px;text-transform:uppercase;line-height:1.15;letter-spacing:.2px;border-radius:12px;white-space:normal;box-shadow:inset 0 0 10px #1dd7da2b,0 0 4px #1dd7da29}.bakery .builder-actions #hear{color:#fff0ac;border-color:#f7d87d;background:linear-gradient(140deg,#806328,#463719);box-shadow:inset 0 0 9px #ffd25a46,0 0 5px #f9d57266}.bakery .builder-actions #speak{border-color:#6fe8e8}.bakery #feedback{font-size:10px;line-height:1.35;color:#c9dfd7;margin:0;padding:5px 10px 7px;max-height:42px;min-height:28px;overflow:auto;background:#001e25}.bakery .settings,.bakery #played-section{display:none!important}.bakery [hidden]{display:none!important}.bakery #ending p{margin:6px 4px 14px;font-size:15px;line-height:1.5}.options-panel{font-size:14px;line-height:1.6;color:#bdd6d4}.options-panel label{display:flex;align-items:center;gap:10px;min-height:44px}.options-panel input{width:20px;height:20px;flex:none}.options-panel a{color:#6fe5e7}.bakery-page dialog{border-radius:16px;border-color:#e6c66f;box-shadow:0 0 20px #ffe08a33,0 25px 70px #000a}.bakery-page dialog .target{font-size:27px}.bakery-page dialog .gloss{font-size:15px}.bakery-page dialog .translation{font-size:21px}.bakery-page dialog::backdrop{background:#001016b8}.bakery-page #focus-content .menu-row{display:flex;justify-content:space-between;gap:8px;margin:10px 0}.bakery-page #focus-content .menu-row button{min-height:44px;border:1px solid #478e94;border-radius:7px;background:#073a42;padding:8px;color:#def4ef}.bakery-page #focus-content .menu-row button:disabled{opacity:.45}.bakery-page #focus-content button:focus-visible{outline:2px solid white}
@media(max-height:720px){.bakery{--card-width:117px;grid-template-rows:auto minmax(165px,1fr) auto auto}.bakery .brand{height:31px;font-size:24px}.bakery-hud{height:51px;margin-top:3px}.bakery-hud img{height:37px;width:32px}.bakery #progression{padding-top:3px;padding-bottom:3px;font-size:6px}.objective-line{margin:3px 0 4px;min-height:27px;padding:4px 6px}.bakery .objective{font-size:10px}.bakery .spoken-card{--card-width:117px;padding:9px 7px 6px}.bakery .spoken-card .target{font-size:17px}.bakery .spoken-card .translation{font-size:12px}.bakery .card-label{font-size:7px;margin-bottom:8px}.bakery .card-foot{font-size:7px}.bakery .menu-sign{width:81px;min-height:147px!important;gap:3px;top:5%}.menu-sign em{font-size:14px}.menu-sign .menu-item{font-size:9px;padding:3px 0}.menu-sign>small{font-size:7px}.bakery #workspace{padding-top:5px}.bakery #builder{gap:5px}.bakery .builder-target{min-height:62px!important}.builder-target strong{font-size:20px}.builder-target small{font-size:12px;margin-top:6px}.phrase-playback{width:52px}.bakery .phrase-playback button{min-height:30px!important;font-size:10px}.bakery .slots button{min-height:87px!important}.slots button strong{font-size:18px}.slots .slot-label{font-size:7px;margin-bottom:6px}.slots .slot-meaning{font-size:11px;margin-top:7px}.bakery .builder-actions button{min-height:49px!important;font-size:10px}.learning-sequence{font-size:7px}.bakery #feedback{max-height:34px;min-height:24px;font-size:9px}.bakery .scene-controls button{min-height:27px!important;font-size:9px}.bakery .scene-controls #begin{min-height:36px!important}.npc-unit{top:calc(6% + min(var(--index),2)*3%)}.npc-unit[data-total="1"]{top:6%}.baker{height:91%}}
@media(max-width:350px){.bakery header{padding-inline:7px}.bakery .brand .venue{font-size:17px;padding-left:8px}.bakery #options-open{width:23px}.bakery-hud{gap:5px;padding:5px}.bakery-hud .identity strong{font-size:14px}.bakery-hud .identity small{font-size:8px}.patience-box{flex-basis:69px;padding-left:5px}.patience-box strong{font-size:15px}.patience-box>span{font-size:10px}#patience-meter{width:59px}.beat-box{flex-basis:66px;padding-left:5px}.beat-box>span{font-size:9px}#beat-dots{gap:3px}#beat-dots span{width:6px;height:6px}.npc-unit{left:calc(17% + var(--index)*var(--fan-step,9%))}.npc-unit[data-total="1"]{left:25%}}
/* At unusually short landscape/text-scaled sizes, scroll vertically instead of hiding controls. */
@media(max-height:560px){.bakery-page{overflow:auto}.bakery{height:auto;min-height:100dvh;overflow:visible;grid-template-rows:auto 215px auto auto}}

/* Preserve the anchored composition for longer authored lines. */
.bakery #workspace{max-height:50dvh;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#2f737a transparent}.bakery .builder-actions{position:sticky;bottom:0;z-index:8;background:#00232b;padding-top:2px}.builder-actions button::before{display:block;font-size:21px;line-height:1.05;margin-bottom:4px}.builder-actions #hear::before{content:'🔊'}.builder-actions #speak::before{content:'🎙'}.builder-actions button:last-child::before{content:'⇄'}.bakery .builder-actions button{min-height:68px!important}.npc-unit .card-label{padding-right:25px}.bakery .card-audio{min-height:44px!important;width:36px;top:0;right:0;background:linear-gradient(140deg,#12515a,#032b34);border-width:1px}
@media(max-height:720px){.builder-actions button::before{font-size:16px;margin-bottom:2px}.bakery .builder-actions button{min-height:54px!important}}

/* Shared played-card inspection: raise only the layer, preserving geometry. */
.npc-unit:hover,.npc-unit:focus-within{z-index:50}.hand>.spoken-card[data-role="played"]:hover,.hand>.spoken-card[data-role="played"]:focus-visible{position:relative;z-index:50}.audio-unavailable-label{position:absolute;bottom:4px;left:5px;right:5px;font:7px/1.25 system-ui;color:#ffdfa2;background:#192827;padding:3px;border-radius:3px;pointer-events:none}.npc-unit.audio-unavailable .card-foot{visibility:hidden}

/* Pointer inspection takes precedence over a different card retaining keyboard focus. */
.npc-unit:hover{z-index:60}.hand>.spoken-card[data-role="played"]:hover{z-index:60}

.options-panel .mic-device-label{display:flex;flex-direction:column;align-items:stretch;gap:6px;margin:12px 0}.options-panel select{width:100%;min-height:44px;background:#082e36;color:#e6f7f1;border:1px solid #4a969d;border-radius:7px;padding:8px;font:14px system-ui}.mic-tools{display:flex;gap:8px}.mic-tools button{flex:1;min-height:44px;border:1px solid #50b8c1;border-radius:7px;background:#12434c;color:#d7f4ed;padding:8px}#microphone-status,#speech-readiness{font-size:13px;line-height:1.5}

/* Fixed content contract: normal cards never scroll or truncate. */
.bakery .spoken-card{overflow:visible}.bakery .spoken-card .chunks{display:block}.bakery .spoken-card .chunk{display:inline}.bakery .spoken-card .target{display:inline}.response-group{display:flex;gap:6px;flex:none;scroll-snap-align:start}.card-fit-probe{position:fixed!important;top:-20000px!important;left:0!important;visibility:hidden!important;pointer-events:none!important;z-index:-1!important}.response-group .spoken-card{flex:none}.bakery .spoken-card .card-label{margin-bottom:10px}

.bakery .spoken-card .target{overflow-wrap:normal;word-break:normal;hyphens:none}


/* Explicit ready-to-play confirmation uses the existing action-row geometry. */
.bakery .builder-actions #play-card{border-color:#93ecc9;background:linear-gradient(140deg,#14754f,#064c3d);color:#eefff4;box-shadow:inset 0 0 10px #6be3ba26,0 0 5px #53d6a83d}.builder-actions #play-card::before{content:'▷'}

/* Separate speaker lanes: cards can scroll within their own lane, never over another speaker. */
.npc-hand{position:absolute;left:6px;top:7%;width:calc(var(--card-width)*2 + 8px);height:calc(var(--card-width)*1.4 + 14px);display:grid;grid-template-columns:repeat(2,var(--card-width));gap:8px;pointer-events:none}
.speaker-hand{position:relative;display:flex;gap:6px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:thin;scrollbar-color:#4d797b transparent;padding-bottom:9px;pointer-events:auto;min-width:0}
.npc-hand[data-has-player=false] .npc-speaker{grid-column:1/-1}
.speaker-hand .npc-unit,.speaker-hand .npc-unit[data-total="1"]{position:relative;left:auto;top:auto;transform:none;flex:0 0 var(--card-width);width:var(--card-width);height:calc(var(--card-width)*1.4);scroll-snap-align:start}
.bakery .card-audio{width:22px;min-height:22px!important;height:22px;top:1px;right:1px;padding:0!important;font-size:13px!important;border-radius:4px!important}
.npc-unit .card-label{padding-right:17px}
.baker{right:-5%;width:27%;height:70%;object-position:50% 0}
.bakery .menu-sign{left:auto;right:3px;top:3%;width:72px;min-height:140px!important}
.bakery .menu-sign em{font-size:12px}.bakery .menu-sign .menu-item{font-size:9px}.bakery .menu-sign>small{font-size:7px}
.bakery .dense-card{padding:6px}.bakery .dense-card .card-label{font-size:7px;margin-bottom:3px;min-height:10px}
.bakery .dense-card .expression{gap:3px}.bakery .dense-card .target{font-size:17px;line-height:1.1}
.bakery .dense-card .translation{font-size:12px;line-height:1.12;padding-top:3px;margin-top:2px}
@media(max-height:720px){.bakery .dense-card .target{font-size:15.5px}.bakery .dense-card .translation{font-size:11px}.npc-hand{top:4%}.baker{height:73%}}

/* Keep Mateo's face above the menu sign in the reserved right-hand strip. */
.baker{right:-7%;top:3%;bottom:auto;width:25%;height:95%}.bakery .menu-sign{top:auto;bottom:38px}

.baker{right:0;width:calc(100% - (var(--card-width)*2 + 22px))}

/* One beat, two cards per speaker: slightly fanned hands with a clear speaker gap. */
.npc-hand{left:5px;top:7%;width:calc(var(--card-width)*2 + 34px);height:calc(var(--card-width)*1.4 + 20px);grid-template-columns:repeat(2,calc(var(--card-width) + 12px));gap:10px}
.speaker-hand{display:block;overflow:visible;padding:0;scroll-snap-type:none;isolation:isolate;height:calc(var(--card-width)*1.4 + 20px)}
.speaker-hand .npc-unit,.speaker-hand .npc-unit[data-total="1"]{position:absolute;left:2px;top:4px;transform:rotate(-1deg);width:var(--card-width);height:calc(var(--card-width)*1.4)}
.speaker-hand .npc-unit:nth-child(2){left:12px;top:7px;transform:rotate(1deg)}
.baker{width:max(25px,calc(100% - (var(--card-width)*2 + 46px)))}
@media(max-height:720px){.npc-hand{top:4%}}

.npc-hand{width:calc(var(--card-width)*2 + var(--player-extra,0px) + var(--npc-extra,0px) + 10px);grid-template-columns:calc(var(--card-width) + var(--player-extra,0px)) calc(var(--card-width) + var(--npc-extra,0px))}
.player-speaker{--speaker-spread:var(--player-extra,0px)}.npc-speaker{--speaker-spread:var(--npc-extra,0px)}
.speaker-hand .npc-unit:nth-child(2){left:calc(2px + var(--speaker-spread));transform:rotate(1deg)}

/* Bias the NPC hand right; show a larger portion of its rear card. */
.npc-hand[data-has-player=false]{left:auto;right:60px;width:calc(var(--card-width) + var(--npc-extra,0px));grid-template-columns:1fr}

@media(max-width:350px){.npc-hand[data-has-player=false]{right:42px}}

/* Scene avatars are secondary to language; shared token for current/future characters. */
.bakery-scene .encounter-avatar,.bakery-scene .baker{right:0;top:auto;bottom:0;width:26%;max-width:110px;height:58%;max-height:170px;object-fit:contain;object-position:right bottom}
/* Planned slots remain fixed as cards are revealed; inspection changes only stacking. */
.speaker-hand .npc-unit[data-slot="0"]{left:2px;top:4px;transform:rotate(-1deg)}
.speaker-hand .npc-unit[data-slot="1"]{left:calc(2px + var(--speaker-spread));top:7px;transform:rotate(1deg)}
.speaker-hand .expression{text-align:center}

.bakery-scene .encounter-avatar,.bakery-scene .baker{object-fit:cover;object-position:50% 0}

/* Four desktop-derived response categories; language cards keep their readable size. */
.bakery #responses.category-hand{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;overflow:visible}
.bakery .response-category{min-height:calc(var(--card-width)*1.4)!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:8px 4px!important;border-radius:9px}
.response-category strong{font-size:12px;line-height:1.25;color:#ecf8f4}.response-category span{font-size:10px;color:#b4d7d7}.response-category small{font-size:7px;line-height:1.3;letter-spacing:.3px;text-transform:uppercase;color:#71dce4}
.bakery #categories-back{min-height:28px;padding:3px 6px;font-size:10px;white-space:nowrap}
@media(max-width:350px){.response-category strong{font-size:10px}.response-category span{font-size:9px}.response-category small{font-size:6px}.bakery .response-category{gap:8px}}

/* Category cards use their actual column width for the same 5:7 silhouette. */
.bakery #responses.category-hand{align-items:start}.bakery .response-category{width:100%;height:auto;min-height:0!important;aspect-ratio:5/7;gap:6px;padding:5px 3px!important;overflow:visible}

/* Persistent inventory uses the desktop icons/data with a compact mobile header. */
.bakery .brand{font-size:20px;gap:4px}.bakery .brand .sound-mark{font-size:16px}.bakery .brand .venue{font-size:16px;padding-left:6px;margin-left:0}.bakery #options-open{width:22px}
#inventory-mount{flex:1;min-width:105px;max-width:145px;margin-left:auto}
.bakery .inventory-hud{width:100%;height:39px;min-height:39px!important;padding:3px 5px!important;display:flex;flex-direction:column;gap:3px;text-align:left;border-radius:5px;font-size:9px;line-height:1}
.inventory-hud-title{font-size:6px;letter-spacing:1px;color:#69dde7}.inventory-hud-icons{display:flex;align-items:center;gap:4px;min-width:0}.inventory-wallet{display:flex;align-items:center;gap:2px;color:#f6cf79}.inventory-wallet strong{font-size:10px}.inventory-mini{color:#617e85;opacity:.5}.inventory-mini.is-owned{color:#76e5c8;opacity:1}.inventory-wallet.is-missing{opacity:.45}
.inventory-hud svg{width:12px;height:14px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.inventory-more{font-size:8px}
.inventory-dialog{padding:15px;max-width:440px;width:calc(100% - 24px);max-height:calc(100dvh - 24px);background:#06212b;color:#e3f1f2;overflow:auto;border:1px solid #5ddce5;border-radius:12px}
.inventory-dialog header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #41656a;padding:0 0 10px}.inventory-dialog header small{font-size:8px;color:#6de6ef;letter-spacing:1px}.inventory-dialog h2{font-size:22px;margin:4px 0}.inventory-dialog button{min-height:36px;border:1px solid #426970;border-radius:6px;background:#0a303b;color:#d4e9ec;padding:7px}
.inventory-panel-body{display:grid;grid-template-columns:1.35fr 1fr;gap:10px;margin-top:12px}.inventory-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.inventory-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0}.inventory-item svg,.inventory-detail svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.inventory-item strong{font-size:11px}.inventory-item span{font-size:10px}.inventory-item:not(.is-owned){color:#879fa6}.inventory-item.is-owned{color:#75e6cb;border-color:#73cdb7}.inventory-item[aria-pressed=true]{border-color:#eaca76;background:#203d41}.inventory-detail{min-width:0;font-size:12px;line-height:1.5;padding:10px;background:#021820;border:1px solid #355b65;border-radius:6px}.inventory-detail h3{margin:5px 0;font-size:16px}.inventory-detail>strong{color:#79e8ce}.inventory-detail.is-missing{color:#92abb3}.inventory-dialog footer{position:static;background:none;text-align:right}.inventory-dialog button:focus-visible{outline:2px solid white;outline-offset:2px}
@media(max-width:350px){.bakery .brand{font-size:17px;gap:3px}.bakery .brand .venue{font-size:14px;padding-left:4px}.bakery .brand .sound-mark{font-size:13px}#inventory-mount{min-width:100px}.inventory-hud-icons{gap:2px}.inventory-hud svg{width:11px}.inventory-panel-body{grid-template-columns:1fr}.inventory-detail{min-height:90px}.inventory-item{min-height:70px}}

/* Avatar sits above played hands; an inspected card rises above the portrait. */
.npc-dialogue{z-index:auto}.speaker-hand{isolation:auto}.bakery-scene .encounter-avatar,.bakery-scene .baker{z-index:10;pointer-events:none}.bakery .scene-controls{z-index:70}.speaker-hand .npc-unit:focus-within{z-index:50}.speaker-hand .npc-unit:hover{z-index:60}

/* Compact focus playback reuses the builder's vertical Play/Slow arrangement. */
.focus-language-row{display:flex;align-items:stretch;gap:8px;min-width:0}.focus-language-row>.chunks{flex:1;min-width:0}.focus-playback{width:66px;flex:none;display:flex;flex-direction:column;gap:4px}
#focus-panel #close-panel,.focus-playback button{box-sizing:border-box;width:66px;min-width:66px;height:44px;min-height:44px}
.focus-playback button{padding:4px;border:1px solid #5d8589;border-radius:8px;background:linear-gradient(140deg,#12515a,#032b34);box-shadow:inset 0 0 10px #32cad716;color:#c4f7f4;font:600 11px system-ui;text-transform:uppercase;cursor:pointer}.focus-playback button:disabled{opacity:.45;cursor:default}.focus-playback button:focus-visible{outline:2px solid white;outline-offset:2px}
.audio-status{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Approved reference composition: left menu replaces the request hand; compact NPC fan. */
.npc-hand,.npc-hand[data-has-player=false]{left:0;right:0;top:0;width:100%;height:100%;display:block;grid-template-columns:none}
.npc-hand .player-speaker{position:absolute;left:5px;top:7.7%;width:calc(var(--card-width) + var(--player-extra));height:calc(var(--card-width)*1.4 + 20px)}
.npc-hand .npc-speaker,.npc-hand[data-has-player=false] .npc-speaker{position:absolute;left:var(--npc-anchor);top:7.7%;width:calc(var(--card-width) + var(--npc-extra));height:calc(var(--card-width)*1.4 + 20px);grid-column:auto}
.bakery .menu-sign{left:2.2%;right:auto;top:2.6%;bottom:auto;width:36.3%;min-height:0!important;aspect-ratio:207/280;padding:8px 7px!important;gap:4px;transform:rotate(-1deg);border:3px double #d0a652!important;box-shadow:0 0 0 2px #584029,4px 5px 12px #0008!important}
.bakery .menu-sign em{font-size:clamp(14px,3.9vw,20px);line-height:1.1;white-space:nowrap;padding-bottom:8px;margin-top:1px}.bakery .menu-sign .menu-item{position:relative;gap:5px;padding:7px 0;font-size:clamp(11px,3vw,15px);line-height:1.15}.menu-sign .menu-item u{flex:1}.menu-price{color:#29cbef;font:700 14px system-ui}.bakery .menu-sign>small{display:none}
@media(max-width:350px){.bakery .menu-sign{padding:5px!important;gap:2px}.bakery .menu-sign em{font-size:12px}.bakery .menu-sign .menu-item{font-size:10px;padding:5px 0;gap:3px}.menu-price{font-size:12px}.menu-flourish{font-size:16px}}
/* Keep a selected response stationary during pointer activation after horizontal scrolling. */
#responses.hand{scroll-snap-type:none;scroll-behavior:auto}
/* Full-width navigation targets remain clickable when the phone options panel wraps. */
.options-panel>a{display:flex;align-items:center;min-height:44px;padding:4px 0}

/* Approved scene-first geometry: no objective strip or builder step legend. */
.bakery .objective-line,.bakery .learning-sequence{display:none}
.bakery .speech-word-difference{color:#ff8e8e;font-weight:700;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}

/* Reserve objective space across ordinary reply/Continue copy changes. */
.bakery .objective-line{height:40px;min-height:40px}.bakery .objective{margin:0}
@media(max-height:720px){.bakery .objective-line{height:34px;min-height:34px}}
/* Temporary self-replay, shared by both quiet-mode encounter builders. */
.my-voice-row{display:flex;align-items:center;gap:6px;margin-top:5px;min-width:0}
.bakery .my-voice-row #hear-myself{flex:none;min-height:30px;padding:4px 8px;font:600 12px system-ui;border-radius:6px;white-space:nowrap}
.my-voice-row select{flex:1;min-width:0;max-width:100%;height:30px;background:#092f38;color:#d7efec;border:1px solid #3d7279;border-radius:5px;font:12px system-ui}
.my-voice-target{min-width:0;font:12px/1.3 system-ui;color:#bad2d0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.my-voice-help{font:12px/1.3 system-ui;color:#aeeaf1;min-height:30px;display:inline-flex;align-items:center}
.npc-hand .player-speaker{left:var(--player-anchor,5px)}
/* Four full response previews per view; original scene cards keep their geometry. */
.bakery #responses.compact-hand{display:grid;grid-auto-flow:column;grid-template-rows:auto;grid-auto-columns:calc((100% - 18px)/4);gap:6px;align-items:stretch;overflow-x:auto;scroll-snap-type:x mandatory}
.bakery #responses.compact-hand .response-group{display:flex;flex-direction:column;gap:0;align-items:stretch;scroll-snap-align:start}
.bakery .spoken-card.compact-response{--card-width:var(--response-card-width);width:var(--response-card-width);height:auto;min-height:calc(var(--response-card-width)*1.4);flex:1;padding:5px 4px;border-radius:8px}
.bakery .compact-response .card-label{font-size:6px;letter-spacing:.15px;min-height:8px;margin-bottom:4px}
.bakery .compact-response .expression{gap:3px}
.bakery .compact-response .target{font-size:clamp(14px,calc(var(--response-card-width)*.15),16px);line-height:1.1}
.bakery .compact-response .translation{font-size:clamp(10px,calc(var(--response-card-width)*.105),12px);line-height:1.12;padding-top:3px;margin-top:2px}
.bakery .compact-response .chunk{padding:0;background:none}
/* Guide the next builder action without moving hit areas or flashing text. */
.bakery #builder .builder-cue{--cue-rgb:255 211 105;animation:builder-attention-pulse 1.8s ease-in-out infinite}
.bakery #builder .builder-cue-play{--cue-rgb:103 239 183}
.bakery #builder #speak.builder-cue-speak{--cue-rgb:103 239 183;background:linear-gradient(145deg,#18734c,#075033);border-color:#7befb5;color:#f0fff5}
.bakery #builder #speak.builder-cue-speak-piece{--cue-rgb:255 211 105;background:linear-gradient(140deg,#806328,#463719);border-color:#f7d87d;color:#fff0ac}
.bakery #builder #hear:not(.builder-cue){background:linear-gradient(140deg,#12515a,#032b34);border-color:#32bac7;color:#c4f7f4;box-shadow:inset 0 0 10px #32cad716}
@keyframes builder-attention-pulse{
  0%,100%{border-color:rgb(var(--cue-rgb)/.7);box-shadow:inset 0 0 5px rgb(var(--cue-rgb)/.12),0 0 3px rgb(var(--cue-rgb)/.25)}
  50%{border-color:rgb(var(--cue-rgb));box-shadow:inset 0 0 10px rgb(var(--cue-rgb)/.28),0 0 14px 2px rgb(var(--cue-rgb)/.6)}
}
.bakery #builder .builder-cue:disabled{animation:none}
@media(prefers-reduced-motion:reduce){.bakery #builder .builder-cue{animation:none;border-color:rgb(var(--cue-rgb));box-shadow:inset 0 0 7px rgb(var(--cue-rgb)/.15),0 0 8px rgb(var(--cue-rgb)/.4)}}
.bakery #ending .post-encounter-review{display:block;margin:10px 0;padding:12px;border:1px solid #74dfeb;border-radius:8px;background:#10434d;color:#dffbff;text-decoration:none;font-weight:700;text-align:center}.bakery #ending .review-saving{font-size:12px;color:#abd0d5}
/* Approved desktop mobile-preview scale: 460 CSS px rendered at 575 px.
   Keep phone geometry unchanged and scale the entire encounter consistently. */
@media(min-width:700px){.bakery{zoom:1.25;height:80dvh}}
/* Physical-phone readability: larger cards, three choices per swipe view. */
@media(max-width:699px){
.bakery #npc .spoken-card{--card-width:var(--phone-scene-card-width,150px)}
.bakery #npc .spoken-card .target{font-size:21px;line-height:1.2}
.bakery #npc .spoken-card .translation{font-size:15px;line-height:1.2}
.bakery #responses.compact-hand{grid-auto-columns:calc((100% - 12px)/3)}
.bakery .compact-response .target{font-size:20px;line-height:1.15}
.bakery .compact-response .translation{font-size:14px;line-height:1.2}
.bakery .compact-response .card-label{font-size:8px;min-height:11px;margin-bottom:6px}
.bakery .spoken-card.compact-response{padding:8px 6px;border-radius:10px}
.bakery:not([data-building=true]) #workspace{min-height:28dvh;max-height:52dvh;padding-top:10px}
.bakery #responses.category-hand{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% - 12px)/3);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;align-items:stretch}
.bakery .response-category{min-height:calc((100vw - 44px)*.467)!important;scroll-snap-align:start}
.bakery .response-category strong{font-size:17px}.bakery .response-category span{font-size:13px}.bakery .response-category small{font-size:10px}
.bakery .section-heading h2{font-size:18px}
}
@media(max-width:350px){.bakery #npc .spoken-card .target{font-size:19px}.bakery #npc .spoken-card .translation{font-size:14px}.bakery .compact-response .target{font-size:19px}.bakery .compact-response .translation{font-size:13px}}

@media(max-width:699px){
/* Give a lone speaker room to fan larger cards without reserving an empty hand. */
.npc-hand[data-has-player=false]{left:8px;right:8px;width:auto}
.npc-hand[data-has-player=false] .npc-speaker{left:auto;right:0;--speaker-spread:clamp(50px,20vw,80px);width:calc(var(--card-width) + var(--speaker-spread))}
}
/* Played cards normally sit below portraits; inspected hands may rise independently. */
.bakery .bakery-scene .npc-hand{z-index:auto!important;isolation:auto!important}
.bakery .bakery-scene .encounter-avatar,.bakery .bakery-scene .baker,.bakery .bakery-scene .eavesdrop-portraits{z-index:80!important;pointer-events:none}
.bakery .scene-controls{z-index:100!important}

/* Shared played-card order. Inspection changes layers only, never geometry.
   Normal hands stay below avatars; inspection rises above avatars but below controls. */
.bakery .bakery-scene .npc-hand>.player-speaker{z-index:30!important}
.bakery .bakery-scene .npc-hand>.npc-speaker,
.bakery .bakery-scene .npc-hand>.conversation-speaker{z-index:10!important}
.bakery .bakery-scene .npc-hand>.speaker-hand:focus-within{z-index:60!important}
@media(hover:hover) and (pointer:fine){
.bakery .bakery-scene .npc-hand>.speaker-hand:hover{z-index:60!important}
}

/* Global touch inspection changes transforms/layers without resizing card content. */
.bakery #responses.card-inspection-hand{touch-action:pan-y;padding-top:14px}
.bakery .card-inspection-hand .spoken-card{user-select:none;-webkit-touch-callout:none}
.bakery #responses.card-inspection-hand .response-group{position:relative}
.bakery #responses.card-inspection-hand .response-group.is-inspected{z-index:45;transform:translateY(-8px)}
.bakery #npc.card-inspection-hand .npc-unit{touch-action:pan-y}
.bakery #npc.card-inspection-hand .npc-unit.is-inspected{z-index:70;transform:translateY(-6px) rotate(0deg)}
.bakery .bakery-scene .npc-hand>.speaker-hand:has(.is-inspected){z-index:60!important}
.bakery #npc .speaker-hand{pointer-events:none}
.bakery #npc .npc-unit{pointer-events:auto}

/* Approved roommate presentation is now the shared encounter standard. */
.bakery #responses.response-fan{display:grid;grid-auto-flow:column;grid-auto-columns:var(--fan-step);gap:0;padding:20px 8px 18px;padding-right:calc(var(--fan-card-width) - var(--fan-step) + 8px);overflow-x:auto;overflow-y:hidden;scroll-snap-type:none;isolation:isolate;align-items:stretch}
.bakery #responses.response-fan .response-group{position:relative;width:var(--fan-card-width);transform:rotate(var(--fan-angle));transform-origin:50% 100%;z-index:var(--fan-layer);scroll-snap-align:none;transition:transform 140ms ease}
.bakery #responses.response-fan .spoken-card.compact-response{width:var(--fan-card-width);--card-width:var(--fan-card-width);min-height:calc(var(--fan-card-width)*1.4);box-shadow:0 2px 7px #0009,inset 0 0 9px #1aafb824}
.bakery #responses.response-fan .response-group.is-inspected,.bakery #responses.response-fan .response-group:focus-within{z-index:30;transform:translateY(-8px) rotate(0deg)}
@media(hover:hover) and (pointer:fine){.bakery #responses.response-fan .response-group:hover{z-index:40;transform:translateY(-8px) rotate(0deg)}}
@media(prefers-reduced-motion:reduce){.bakery #responses.response-fan .response-group{transition:none}}
/* Current edited-reference geometry: stable 5:7 cards with readable exposed faces. */
.bakery #responses.response-fan .spoken-card.compact-response{height:calc(var(--fan-card-width)*1.4);min-height:calc(var(--fan-card-width)*1.4);max-height:calc(var(--fan-card-width)*1.4);flex:none}
.bakery #responses.response-fan .compact-response .target{font-size:17px;line-height:1.15}
.bakery #responses.response-fan .compact-response .translation{font-size:12px;line-height:1.2}
.bakery #responses.response-fan .compact-response.dense-card .target{font-size:16px;line-height:1.12}
.bakery #responses.response-fan .compact-response.dense-card .translation{font-size:11px;line-height:1.15}
.bakery:not(.apartment-exploration) #npc .spoken-card .target{font-size:18px;line-height:1.2}
.bakery:not(.apartment-exploration) #npc .spoken-card .translation{font-size:12px;line-height:1.2}
.bakery:not(.apartment-exploration) #npc .spoken-card.dense-card .target{font-size:16px;line-height:1.12}
.bakery:not(.apartment-exploration) #npc .spoken-card.dense-card .translation{font-size:11px;line-height:1.15}
.bakery:not(.apartment-exploration):not([data-building=true]) #workspace{margin-top:-26px}

.bakery #responses.response-fan .spoken-card{background:linear-gradient(145deg,#073641,#01202a)}
.bakery #responses.response-fan .spoken-card:disabled{opacity:1;filter:brightness(.67)}
.bakery.speaking-encounter:not(.apartment-exploration):not([data-building=true]) .bakery-scene{overflow:visible;isolation:auto}
.bakery.layered-encounter:not(.apartment-exploration):not([data-building=true]) #workspace{position:relative;z-index:20;margin-top:-26px;padding-top:0;background:transparent;border-top:0;overflow:visible;max-height:none;min-height:0}
.bakery.layered-encounter:not(.apartment-exploration):not([data-building=true]) #workspace>.section-heading{display:none}
.bakery #responses.response-fan{padding-top:14px;padding-bottom:16px}
.bakery.layered-encounter:not(.apartment-exploration):not([data-building=true]) .scene-controls{bottom:52px}
.bakery.layered-encounter .scene-controls{flex-wrap:wrap;gap:4px}
.bakery.layered-encounter .scene-controls button{min-height:40px!important;min-width:40px;box-shadow:0 1px 5px #0009}
.bakery.speaking-encounter:not(.apartment-exploration) #npc .spoken-card{overflow:visible;background:linear-gradient(145deg,#073641,#01202a)}
.bakery.speaking-encounter:not(.apartment-exploration) #npc .spoken-card[data-role=npc]{background:linear-gradient(135deg,#564d31,#082324 50%,#051b20)}
.bakery.speaking-encounter:not(.apartment-exploration) .npc-hand .speaker-hand{top:2.5%}
.bakery.speaking-encounter:not(.apartment-exploration) .npc-hand[data-has-player=false] .npc-speaker{left:var(--npc-anchor);right:auto;--speaker-spread:var(--npc-extra);width:calc(var(--card-width) + var(--npc-extra))}
.bakery.speaking-encounter:not(.apartment-exploration) .encounter-avatar{width:30%;max-width:135px;height:145px;max-height:145px;bottom:0}
.bakery.speaking-encounter #npc .player-speaker .card-label{padding-left:10px}
.bakery #responses.response-fan.is-drag-inspecting .response-group.is-inspected{transform:translateY(-12px) rotate(0deg);z-index:45}
.bakery #responses.response-fan.response-fan-five .response-group{left:-12px}
/* Inspection restores the full outside card inside the viewport. */
.bakery #responses.response-fan.response-fan-five .response-group:first-child:is(.is-inspected,:focus-within){transform:translate(12px,-8px) rotate(0deg)}
.bakery #responses.response-fan.response-fan-five .response-group:last-child:is(.is-inspected,:focus-within){transform:translate(-12px,-8px) rotate(0deg)}
@media(hover:hover) and (pointer:fine){
 .bakery #responses.response-fan.response-fan-five .response-group:first-child:hover{transform:translate(12px,-8px) rotate(0deg)}
 .bakery #responses.response-fan.response-fan-five .response-group:last-child:hover{transform:translate(-12px,-8px) rotate(0deg)}
}
body.spanish-first:not(.meaning-shown) .bakery .translation,
body.spanish-first:not(.meaning-shown) .bakery .slot-meaning,
body.spanish-first:not(.meaning-shown) .bakery .explore-line em,
body.spanish-first:not(.meaning-shown) #focus-panel .translation,
body.spanish-first:not(.meaning-shown) #focus-panel .gloss{visibility:hidden}
.bakery .scene-controls #meaning-help{font-size:10px;min-height:32px!important;padding:5px 7px;white-space:nowrap;border-color:#dac577;color:#ffe49b}

#meaning-help-focus{font-size:10px;padding:5px;min-height:32px;border:1px solid #dac577;border-radius:6px;background:#063039;color:#ffe49b}
body.spanish-first:not(.meaning-shown) .bakery .belonging-choice small{visibility:hidden}

.bakery.apartment-exploration .apartment-inline>#meaning-help{position:absolute;left:4px;top:4px;z-index:100;font-size:10px;min-height:32px;padding:4px 7px;border:1px solid #dac577;background:#063039;color:#ffe49b;border-radius:6px}

/* Completion summaries may grow; retain readable played cards above their controls. */
body.bakery-page:has(.bakery[data-complete=true]){overflow-y:auto}
.bakery.layered-encounter[data-complete=true]{height:auto;min-height:100dvh;grid-template-rows:auto minmax(calc(var(--card-width)*1.4 + 120px),40dvh) auto auto}

/* Category navigation survives the compact response heading treatment. */
.bakery.layered-encounter:not(.apartment-exploration):not([data-building=true]) #workspace>.section-heading:has(#categories-back:not([hidden])){display:flex;margin:0;padding:4px 8px}
.bakery #workspace>.section-heading:has(#categories-back:not([hidden]))>h2{font-size:14px}

/* Continue is the next action only while visible and enabled. No moving targets. */
.bakery .scene-controls #continue-reply:not([hidden]):not(:disabled){--cue-rgb:255 211 105;animation:builder-attention-pulse 1.8s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){.bakery .scene-controls #continue-reply:not([hidden]):not(:disabled){animation:none;border-color:#ffe278;box-shadow:0 0 8px #ffd36988}}

/* Shared dialogue toolbar: history + stop left, meaning at the opposite edge. */
.bakery .scene-controls{display:grid;grid-template-columns:max-content 40px minmax(0,1fr) max-content;gap:4px;align-items:end;bottom:6px;flex-wrap:nowrap}
.bakery.layered-encounter:not(.apartment-exploration):not([data-building=true]) .scene-controls{bottom:18px!important}
.bakery .scene-controls>button,.bakery .scene-controls #meaning-help{min-height:40px!important;font-size:10px;padding:5px 7px;white-space:nowrap}
.bakery .scene-controls>#dialogue-history{grid-row:2;grid-column:1}
.bakery .scene-controls>#stop-audio{grid-row:2;grid-column:2;min-width:40px;padding:5px}
.bakery .scene-controls>#meaning-help{grid-row:2;grid-column:4}
.bakery .scene-controls>#begin{grid-row:2;grid-column:1/4;justify-self:start}
.bakery .scene-controls:has(#begin:not([hidden]))>#dialogue-history{display:none}
.bakery .scene-controls>:not(#dialogue-history):not(#stop-audio):not(#meaning-help):not(#begin){grid-row:1;grid-column:1/-1;justify-self:end;pointer-events:auto}
.bakery.apartment-exploration .apartment-inline>.scene-controls{display:grid!important;position:static;order:3;width:100%;margin:4px 0;flex:none}
#focus-panel:has(.dialogue-history-panel){width:min(480px,calc(100vw - 32px));max-height:88dvh;padding:10px;background:#041b24}
#focus-panel:has(.dialogue-history-panel) .panel-header{position:sticky;top:-10px;background:#041b24;z-index:2;padding:4px 0 10px;border-bottom:0}
#focus-panel:has(.dialogue-history-panel) #focus-title{font-size:15px;letter-spacing:1px;color:#78eaff;text-transform:uppercase}
.dialogue-history-summary{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0;color:#8ad5e3;font-size:12px}
.dialogue-history-current,.dialogue-history-back{padding:8px;border:1px solid #58b4c4;border-radius:7px;background:#07313b;color:#dcfaff;min-height:36px}
.dialogue-history-list{list-style:none;padding:0;margin:0;display:grid;gap:0}
.dialogue-history-entry{position:relative;padding:10px;border:1px solid #bc9440;border-radius:9px;background:#242218;color:#ffe2a1}
.dialogue-history-entry.history-player{background:#062a35;border-color:#58d7ec;color:#b8f4ff}
.dialogue-history-speaker{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:1px;margin-bottom:6px;padding-right:30px}
.dialogue-history-language{display:block;width:100%;padding:0;border:0;background:transparent;color:inherit;text-align:left;font:inherit;font-size:18px;line-height:1.3;cursor:pointer}
.dialogue-history-translation{margin:6px 0 0;font-size:14px;line-height:1.4;font-style:italic;color:#d6dddb}
#focus-panel .dialogue-history-audio.focus-playback{position:absolute;right:8px;top:4px;display:block;margin:0;padding:0;width:28px;height:28px}
#focus-panel .dialogue-history-audio button{display:block;width:28px;height:28px;min-height:28px;margin:0;padding:0;border:0;border-radius:0;background:#0b4650;color:#baf4ff;font-size:18px;line-height:1}
.dialogue-history-audio .audio-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.dialogue-history-empty{font-size:15px;line-height:1.5}
/* Override generic lesson-control minimums inside the compact transcript only. */
#focus-panel:has(.dialogue-history-panel) #focus-content{padding:0;margin:0}
#focus-panel:has(.dialogue-history-panel) .panel-header{margin:0 0 4px}
#focus-panel .dialogue-history-panel{margin:0;padding:0}
#focus-panel .dialogue-history-audio button{box-sizing:border-box;width:28px!important;min-width:28px!important;max-width:28px;height:28px!important;min-height:28px!important;padding:0!important}

/* One ordinary encounter composition: roommate, shops, commute, park and work. */
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) .npc-hand{top:12px}
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) .npc-hand[data-has-player=false]{left:6px;right:6px;width:auto}
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) #workspace:has(.is-inspected),
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) #workspace:focus-within{z-index:50}
.bakery.speaking-encounter #npc .npc-unit:hover,.bakery.speaking-encounter #npc .npc-unit:focus-within{transform:rotate(0deg)}
/* Compact filters do not occupy response-card positions or add a legacy heading. */
.bakery .response-categories{display:flex;gap:4px;margin:0 8px 5px;overflow-x:auto;scrollbar-width:thin;touch-action:pan-x}
.bakery .response-categories .response-category{flex:1;min-width:64px;min-height:34px!important;height:auto!important;padding:4px 6px;font-size:10px;line-height:1.15;text-align:center;border-radius:7px}
.bakery .response-categories .response-category[aria-pressed=true]{border-color:#ffe096;background:#16505a;color:#ffe096;box-shadow:inset 0 -2px #ffe09655}
.bakery.layered-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) #workspace>.section-heading{display:none}

.bakery .response-categories[hidden]{display:none!important}

.bakery .response-categories .response-category{aspect-ratio:auto;height:36px!important;max-height:40px;padding:4px 6px!important;gap:0}

/* Shared prominent progression action; retain the hidden Stop node for runtime cleanup hooks. */
.bakery .scene-controls>#stop-audio{display:none!important}
.bakery .scene-controls>#continue-reply{
 grid-row:1!important;grid-column:1/-1!important;justify-self:center!important;
 min-width:132px;min-height:48px!important;padding:10px 20px!important;
 font-size:17px!important;font-weight:750;border:2px solid #ffe278;
 color:#ffe99c;background:linear-gradient(145deg,#244a48,#032b34);
}

/* Lift inspected responses into reserved headroom without resizing the hand. */
.bakery #responses.response-fan{--response-lift:36px;padding-top:42px;margin-top:-28px}
.bakery #responses.response-fan .response-group:is(.is-inspected,:focus-within){transform:translate(var(--inspect-x,0px),calc(-1 * var(--response-lift))) rotate(0deg);z-index:45}
.bakery #responses.response-fan.response-fan-five .response-group:first-child{--inspect-x:12px}
.bakery #responses.response-fan.response-fan-five .response-group:last-child{--inspect-x:-12px}
.bakery #responses.response-fan.response-fan-five .response-group:is(.is-inspected,:focus-within),
.bakery #responses.response-fan.is-drag-inspecting .response-group.is-inspected{transform:translate(var(--inspect-x,0px),calc(-1 * var(--response-lift))) rotate(0deg)}
@media(hover:hover) and (pointer:fine){
 .bakery #responses.response-fan .response-group:hover,
 .bakery #responses.response-fan.response-fan-five .response-group:hover{transform:translate(var(--inspect-x,0px),calc(-1 * var(--response-lift))) rotate(0deg);z-index:45}
}

/* Response cards may cover History/Meaning; Continue and portraits retain priority. */
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) .scene-controls{z-index:auto!important}
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) .scene-controls>button{position:relative;z-index:100}
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) .scene-controls>:is(#dialogue-history,#meaning-help){z-index:15}

/* Ordinary scene order: played cards10, avatar80, History/Meaning90,
   response hand95, Continue100. */
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) .scene-controls>:is(#dialogue-history,#meaning-help){z-index:90}
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) #workspace{z-index:95!important}

/* The live builder floats above an unchanged encounter, including on short phones. */
.bakery #builder-popup{box-sizing:border-box;width:min(450px,calc(100% - 16px));max-width:calc(100% - 16px);max-height:calc(100dvh - 24px);padding:10px;margin:auto auto 12px;inset:auto 0 0;border:1px solid #73dce0;border-radius:16px;background:linear-gradient(145deg,#07343e,#001c25);color:#dff7f5;overflow:auto;overscroll-behavior:contain;box-shadow:0 12px 40px #000a}
.bakery #builder-popup::backdrop{background:#00101938}
.bakery .builder-popup-header{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px}
.bakery .builder-popup-header h2{font:700 16px system-ui;margin:0;color:#bff5f1}
.bakery .builder-popup-header button{min-height:36px;padding:6px 10px;font-size:12px}
.bakery #builder-popup #builder{display:flex;position:relative;gap:7px}
.bakery .builder-popup-feedback{font-size:12px;line-height:1.4;margin-top:8px;min-height:2.8em}
@media(min-width:700px){.bakery #builder-popup{max-height:calc(80dvh - 24px)}}

/* Elevated cards cover utilities only where a card is actually painted.
   Empty fan headroom must not intercept taps on History or Meaning. */
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) #workspace{pointer-events:none}
.bakery.speaking-encounter:not(.apartment-exploration):not(.work-exploring):not([data-building=true]) #workspace :is(button,a,input,select,textarea){pointer-events:auto}

/* More room for complete builder labels; keep the three-slot structure intact. */
.bakery #builder-popup{width:min(450px,calc(100vw - 8px));max-width:calc(100vw - 8px);padding:6px}
.bakery #builder-popup .slots{--pb-gap:3px}
.bakery #builder-popup .slots button.slot{padding:5px 1px!important}
.bakery #builder-popup .slots .slot-label{margin-bottom:6px}
.bakery #builder-popup .slots .slot-meaning{margin-top:4px}
.bakery #builder-popup .slots strong{line-height:1.08}

/* Optional advisory pronunciation panel; shared native dialog above the builder. */
#focus-panel:has(.pronunciation-guide-panel){width:min(470px,calc(100vw - 20px));max-height:88dvh;padding:12px;background:#041b24;border:1px solid #64e1e8;border-radius:18px;color:#def7f5}
#focus-panel:has(.pronunciation-guide-panel) .panel-header{position:sticky;top:-12px;background:#041b24;z-index:2;padding:5px 0 10px;margin-bottom:8px}
#focus-panel:has(.pronunciation-guide-panel) #focus-title{font:700 20px system-ui;margin:0}
.pronunciation-guide-panel{font:14px/1.45 system-ui;overflow-wrap:normal}
.pronunciation-guide-panel h4{font-size:14px;margin:14px 0 5px}
.pronunciation-guide-panel p{margin:5px 0}
.pronunciation-guide-panel .pronunciation-word{font:700 28px/1.2 system-ui;text-align:center;margin:12px 0 4px}
.pronunciation-meaning{text-align:center;font-style:italic;color:#d2e4de}
.pronunciation-accepted{width:fit-content;margin:4px auto!important;padding:5px 12px;border-radius:20px;background:#b6f0cf;color:#06332c;font-weight:700;font-size:12px}
.pronunciation-guide-panel .pronunciation-sounds{font-size:22px;font-weight:700;text-align:center;margin:6px 0}
.pronunciation-hint-word{text-align:center;color:#9fe8ea;font-size:12px;margin-top:8px}
.pronunciation-note{font-size:12px;color:#b4d0ce;font-style:italic}
.pronunciation-tip{border:1px solid #4c9ba1;background:#0a3038;border-radius:10px;padding:8px 12px;margin:12px 0}
.pronunciation-tip h4{margin-top:0}
#focus-panel .pronunciation-audio.focus-playback{display:flex;flex-direction:row;justify-content:center;gap:8px;margin:12px 0}
#focus-panel .pronunciation-audio button{width:auto;min-width:100px;min-height:40px;padding:8px 12px}
.pronunciation-audio .audio-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.pronunciation-transcript{font-size:18px;color:#d6e6e4}
.pronunciation-footer{padding:8px;border-radius:9px;background:#123740;font-style:italic;margin-top:14px!important}
.pronunciation-back{width:100%;min-height:44px;margin-top:10px;border:1px solid #65dce2;border-radius:9px;background:#073641;color:#dcffff;font:700 15px system-ui}
.bakery #builder-popup .pronunciation-guide-open{min-height:36px;padding:5px 10px;font-size:12px;align-self:center}
#focus-panel .pronunciation-audio.focus-playback{width:100%;max-width:none}
.pronunciation-current{display:block;width:100%;margin:10px 0;border:1px solid #397681;border-radius:8px;background:#092b34;color:#beeff2;padding:8px;font:12px/1.3 system-ui;text-align:left}
.pronunciation-back{position:sticky;bottom:0;box-shadow:0 4px 8px #041b24}
.pronunciation-practice{border:1px solid #4c9ba1;border-radius:10px;padding:10px;margin:12px 0}
.pronunciation-practice>button{min-height:44px;width:100%;font-weight:700;background:#6d571e;color:#fff4ca;border:1px solid #f2d272;border-radius:9px}
.pronunciation-practice>button:disabled{opacity:.45}
.pronunciation-practice .my-voice-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:8px}
.pronunciation-practice .my-voice-row button{min-height:44px;padding:8px 12px;border:1px solid #64dce2;border-radius:8px;background:#0a343e;color:#def7f5}
.pronunciation-practice .my-voice-row button:disabled{opacity:.45}
.pronunciation-practice-status{font-size:13px;min-height:2.5em}
.pronunciation-sound-pieces{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.pronunciation-sound-pieces button{font:700 22px system-ui;min-height:44px;padding:7px 12px;border:1px solid #5bcbd3;border-radius:8px;background:#0a343e;color:#e2ffff}

.builder-slot-guides,.pronunciation-slot-nav{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.builder-slot-guides button,.pronunciation-slot-nav button{font:600 12px system-ui;min-height:34px;padding:5px 8px;border:1px solid #43848e;border-radius:7px;background:#0a3038;color:#dcffff}
.pronunciation-slot-nav button[aria-pressed=true]{border-color:#f0d278;background:#58491e}
.pronunciation-tones{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:12px 0}
.pronunciation-tone{display:flex;flex-direction:column;align-items:center;border:1px solid #43848e;border-radius:9px;padding:8px;max-width:100%}
.pronunciation-pinyin{font-size:24px;color:#ffe7a3}
.pronunciation-spoken-tone{font-size:14px;color:#bce8e9}

/* Capacity is authored by the recipe; ordinary builders stay at three. */
.bakery #builder-popup .slots{grid-template-columns:repeat(var(--primary-slot-count,3),minmax(0,1fr))}
.bakery #builder-popup .slot-pinyin{display:block;font:14px/1.25 system-ui;margin:6px 0 0;color:#fff0b9;white-space:normal;overflow-wrap:normal}
.bakery #builder-popup .builder-pinyin{font:italic 16px/1.3 system-ui;margin:6px 0 0;color:#e7f2df}

/* Preview is a sibling of the card button: no nested interactive controls. */
.bakery #responses .response-group{position:relative}
.bakery #responses .response-preview{position:absolute;top:3px;right:3px;z-index:5;width:28px;height:28px;min-width:28px;min-height:28px!important;padding:0!important;border-radius:5px;font-size:18px;line-height:1;display:grid;place-items:center;touch-action:manipulation}
.bakery #responses .response-preview:focus-visible{outline:2px solid #ffe091;outline-offset:2px}
.bakery #responses .spoken-card .card-label{padding-right:27px}

.context-practice-note{font-size:12px;color:#c5e7e4;margin:2px 4px}.bakery button.continue-supported{min-height:32px;font-size:11px;background:transparent;border-color:#43818b;box-shadow:none}

/* Quiet scrollbars on study/history/builder/writing dialogs. Scrolling stays enabled. */
.bakery-page dialog{scrollbar-width:thin;scrollbar-color:#39747b transparent;scrollbar-gutter:auto;overflow-x:hidden}
.bakery-page dialog::-webkit-scrollbar{width:4px;height:4px}
.bakery-page dialog::-webkit-scrollbar-track{background:transparent}
.bakery-page dialog::-webkit-scrollbar-thumb{background:#39747b;border-radius:8px}
.bakery-page dialog::-webkit-scrollbar-thumb:hover{background:#62a3aa}
.bakery-page dialog::-webkit-scrollbar-button{display:none;width:0;height:0}
.bakery-page dialog::-webkit-scrollbar-corner{background:transparent}

/* Hide OS chrome completely; the indicator is a background, never a layout gutter. */
.bakery-page dialog{scrollbar-width:none!important;scrollbar-gutter:auto!important}
.bakery-page dialog::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
.bakery-page dialog::-webkit-scrollbar-button{display:none!important;width:0!important;height:0!important}
.bakery-page dialog.minimal-scrollbar{background-image:linear-gradient(#518f9688,#518f9688);background-size:2px var(--dialog-thumb-height,0px);background-position:right 2px top var(--dialog-thumb-top,4px);background-repeat:no-repeat;background-attachment:scroll}

.bakery-page dialog.minimal-scrollbar{background-color:#062b34}.bakery-page dialog.minimal-scrollbar .panel-header{top:0;background-color:#062b34}
#builder #speak.is-listening{background:linear-gradient(145deg,#147c55,#07533f);border-color:#77ebaf;color:#f0fff7;box-shadow:0 0 14px #42e59b66}

/* Inspected played cards temporarily clear portraits, without moving the scene. */
.bakery .bakery-scene .npc-hand>.speaker-hand:is(:focus-within,:has(.is-inspected)){z-index:85!important}
.bakery #npc.card-inspection-hand .npc-unit.is-inspected{z-index:85}

@media(hover:hover) and (pointer:fine){.bakery .bakery-scene .npc-hand>.speaker-hand:hover{z-index:85!important}}

/* Keep self replay, status and the mode return link within narrow builders. */
.my-voice-row{flex-wrap:wrap}

.speech-engine-control{display:flex;align-items:center;gap:8px;margin:0 0 7px;font:13px system-ui;color:#bde5e7}.speech-engine-control select{flex:1;min-width:0;min-height:36px;padding:5px 7px;border:1px solid #58b8c1;border-radius:7px;background:#07313a;color:#eef8ef;font:14px system-ui}

/* Approved three-character-card beat exception: stable staggered slots, original 5:7 geometry. */
.bakery .npc-hand[data-three-cards=true] .speaker-hand{top:0!important;overflow:visible;isolation:auto}
.bakery .npc-hand[data-three-cards=true] .player-speaker{left:-8px!important}
.bakery .npc-hand[data-three-cards=true] .player-speaker>.npc-unit{top:calc(var(--card-width)*.36);transform:rotate(-2deg)}
.bakery .npc-hand[data-three-cards=true] .npc-speaker{left:0!important;width:100%!important;height:100%}
.bakery .npc-hand[data-three-cards=true] .npc-speaker>.npc-unit[data-slot="0"]{left:34%;top:calc(var(--card-width)*.37);transform:rotate(-5deg);z-index:2}
.bakery .npc-hand[data-three-cards=true] .npc-speaker>.npc-unit[data-slot="1"]{left:51.5%;top:calc(var(--card-width)*.075);transform:rotate(0deg);z-index:3}
.bakery .npc-hand[data-three-cards=true] .npc-speaker>.npc-unit[data-slot="2"]{left:65%;top:calc(var(--card-width)*.37);transform:rotate(6deg);z-index:4}
/* With no player, use the full scene for the same three-card stagger. */
.bakery .npc-hand[data-three-cards=true][data-has-player=false] .npc-speaker>.npc-unit[data-slot="0"]{left:5%}
.bakery .npc-hand[data-three-cards=true][data-has-player=false] .npc-speaker>.npc-unit[data-slot="1"]{left:33%}
.bakery .npc-hand[data-three-cards=true][data-has-player=false] .npc-speaker>.npc-unit[data-slot="2"]{left:61%}
.bakery .npc-hand[data-three-cards=true] .npc-speaker>.npc-unit:is(:has(:focus-visible),.is-inspected){transform:rotate(0deg);z-index:90}
.bakery .npc-hand[data-three-cards=true] .npc-speaker>.npc-unit[data-slot="2"]:is(:has(:focus-visible),.is-inspected){left:calc(100% - var(--card-width) - 8px)}
.bakery .npc-hand[data-three-cards=true] .player-speaker>.npc-unit:is(:has(:focus-visible),.is-inspected){transform:translateX(16px) rotate(0deg);z-index:90}
@media(hover:hover) and (pointer:fine){
 .bakery .npc-hand[data-three-cards=true] .npc-speaker>.npc-unit:hover{transform:rotate(0deg);z-index:90}
 .bakery .npc-hand[data-three-cards=true] .npc-speaker>.npc-unit[data-slot="2"]:hover{left:calc(100% - var(--card-width) - 8px)}
 .bakery .npc-hand[data-three-cards=true] .player-speaker>.npc-unit:hover{transform:translateX(16px) rotate(0deg);z-index:90}
}
.bakery #npc .npc-hand[data-three-cards=true]{--card-width:132px;--phone-scene-card-width:132px}
.bakery #npc .spoken-card[data-three-card-beat=true]{--card-width:132px;padding:10px 8px}
/* Listening encounters retain their two speaker sides, with three slots per qualifying beat. */
.bakery .conversation-speaker[data-three-cards=true]>.npc-unit[data-slot="0"]{left:2px;top:20px;transform:rotate(-5deg);z-index:2}
.bakery .conversation-speaker[data-three-cards=true]>.npc-unit[data-slot="1"]{left:calc(2px + var(--conversation-spread)*.5);top:-12px;transform:rotate(0deg);z-index:3}
.bakery .conversation-speaker[data-three-cards=true]>.npc-unit[data-slot="2"]{left:calc(2px + var(--conversation-spread));top:20px;transform:rotate(5deg);z-index:4}
.bakery .conversation-speaker[data-three-cards=true]>.npc-unit:is(:has(:focus-visible),.is-inspected){transform:rotate(0deg);z-index:90}
@media(hover:hover) and (pointer:fine){.bakery .conversation-speaker[data-three-cards=true]>.npc-unit:hover{transform:rotate(0deg);z-index:90}}
.bakery .conversation-speaker[data-three-cards=true][data-side=left]>.npc-unit:is(:has(:focus-visible),.is-inspected){transform:translateX(8px) rotate(0deg)}
@media(hover:hover) and (pointer:fine){.bakery .conversation-speaker[data-three-cards=true][data-side=left]>.npc-unit:hover{transform:translateX(8px) rotate(0deg)}}

/* Phrase Builder state changes preserve the same rows and vertical landmarks. */
.bakery #builder-popup .builder-actions{height:68px;min-height:68px;flex:none}
.bakery #builder-popup .builder-actions>button{height:68px!important;min-height:68px!important;max-height:68px;padding:5px 6px!important;overflow:auto}
.bakery #builder-popup .context-practice-note{height:30px;min-height:30px;max-height:30px;margin:0 4px;font-size:12px;line-height:15px;overflow:auto}
.bakery #builder-popup .builder-space-holder{visibility:hidden;pointer-events:none}
.bakery #builder-popup .continue-supported{height:36px;min-height:36px;max-height:36px;flex:none}
.bakery #builder-popup .builder-popup-feedback{height:4.2em;min-height:4.2em;max-height:4.2em;overflow:auto;overflow-wrap:anywhere;flex:none}
.bakery #builder-popup #builder>.my-voice-row{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:30px 24px;height:54px;min-height:54px;max-height:54px;gap:0 6px;flex:none}
.bakery #builder-popup #builder>.my-voice-row>button{grid-column:1;grid-row:1/3;align-self:center}
.bakery #builder-popup #builder>.my-voice-row>:is(.my-voice-target,select){grid-column:2;grid-row:1;max-height:30px;overflow:auto;font-size:11px;line-height:15px}
.bakery #builder-popup #builder>.my-voice-row>.my-voice-help{grid-column:2;grid-row:2;align-self:center;font-size:11px;line-height:12px}

/* Compact builder references: adjacent secondary controls, no placeholder rows. */
.bakery #builder-popup .builder-actions{height:60px;min-height:60px}
.bakery #builder-popup .builder-actions>button{height:60px!important;min-height:60px!important;max-height:60px;padding:4px 5px!important;font-size:11px;line-height:1.2}
.bakery #builder-popup .builder-actions>button::before{font-size:18px;line-height:1;margin-bottom:3px}
.bakery #builder-popup .builder-secondary-actions{display:grid;grid-template-columns:auto auto;justify-content:start;align-items:center;gap:8px;height:38px;min-height:38px;flex:none}
.bakery #builder-popup .builder-secondary-actions .my-voice-row{display:block;height:36px;min-height:36px;margin:0}
.bakery #builder-popup .builder-secondary-actions .my-voice-row>:not(button){display:none}
.bakery #builder-popup .builder-secondary-actions :is(#hear-myself,#pronunciation-guide-open){height:36px;min-height:36px;margin:0;padding:5px 8px;font-size:12px;white-space:nowrap}
.bakery #builder-popup .builder-popup-feedback{height:2.8em;min-height:2.8em;max-height:2.8em;margin-top:6px}

/* Independent ambience controls */
.ambience-toggle{font:inherit;font-size:12px;padding:6px 9px;border:1px solid #43858b;border-radius:8px;background:#07323a;color:#c7e7e6}.location-arrival nav{display:flex;align-items:center;justify-content:space-between;gap:8px}.ambience-settings{border:1px solid #43858b;border-radius:10px;padding:10px;margin:12px 0}.ambience-settings label{display:flex;align-items:center;gap:8px;margin:8px 0}.ambience-settings input[type=range]{width:140px;max-width:60%}.ambience-settings p{font-size:13px;line-height:1.4;color:#b3d3d3}

/* Inspected prompt/response cards escape hand clipping in the native top layer. */
.inspection-popover:popover-open{color:inherit;outline:0;box-shadow:none;pointer-events:auto;isolation:isolate}
.inspection-popover::backdrop{background:transparent;pointer-events:none}
.inspection-popover:popover-open>.spoken-card{max-width:none;max-height:none;box-shadow:0 5px 16px #0008!important}
.inspection-popover:popover-open>:is(.response-preview,.card-audio){visibility:visible!important;opacity:1!important;z-index:5!important}
/* Spanish Roommate full-phrase pilot. Keep the encounter visible above the builder. */
.bakery #builder-popup:has(.full-phrase-roommate)::backdrop{background:transparent;backdrop-filter:none}
.bakery #builder-popup:has(.full-phrase-roommate){height:auto!important}
.bakery #builder-popup .full-phrase-roommate .learning-sequence,
.bakery #builder-popup .full-phrase-roommate .slot-label,
.bakery #builder-popup .full-phrase-roommate .mobile-slot>span{display:none}
.bakery #builder-popup .full-phrase-roommate .slots{margin-bottom:0}
.full-phrase-roommate .roommate-primary>button{width:100%;min-height:48px;font-weight:800;background:linear-gradient(#087681,#064450);border-color:#67eef4}
.roommate-recording-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:6px}
.roommate-recording-actions>button{min-width:0;min-height:42px;padding:4px;font-size:12px;line-height:1.15}
/* Slot choices are an optional shared builder feature. No sizing changes without choices. */
#builder-popup .mobile-slot.has-slot-choices{position:relative;overflow:visible}
#builder-popup .mobile-slot.choice-open{z-index:50}
#builder-popup .slot-choice-toggle{position:absolute;top:2px;right:2px;min-width:26px;min-height:26px;padding:2px 5px;border:0;border-radius:7px;background:#073640;color:#f1d88a;font-size:18px;z-index:2}
#builder-popup .slot-choice-list{position:absolute;top:calc(100% + 5px);left:0;width:100%;box-sizing:border-box;padding:4px;overflow-y:auto;overscroll-behavior:contain;border:1px solid #e1c975;border-radius:10px;background:#042a34;box-shadow:0 7px 15px #0009;scrollbar-width:thin;scrollbar-color:#6db7bf #03242e;z-index:60}
#builder-popup .slot-choice-list[hidden]{display:none}
#builder-popup .slot-choice-option{display:block;width:100%;box-sizing:border-box;min-height:44px;margin:0 0 4px;padding:9px 3px;white-space:normal;overflow-wrap:normal;border:1px solid #3d7f8a;border-radius:7px;background:linear-gradient(145deg,#0d414d,#032832);color:#dbf0f2;font:13px/1.2 system-ui;box-shadow:inset 0 1px #c6ffff15}
#builder-popup .slot-choice-option[aria-selected=true]{border-color:#e8d07b;background:linear-gradient(140deg,#78632b,#493d20);color:#ffe9a7}
#builder-popup .slot-choice-option:focus-visible{outline:2px solid #fff1bb;outline-offset:-3px}
.builder-guide-overlay[hidden]{display:none}
.builder-guide-overlay{position:absolute;bottom:calc(100% + 8px);left:0;right:0;max-height:120px;overflow:auto;text-align:left;border:1px solid #64aeb9;border-left:3px solid #dfc674;border-radius:12px;background:#06333ded;padding:10px 12px;box-shadow:0 5px 15px #0008}
.builder-guide-overlay .airport-cue{border:0;background:transparent;padding:0}
.builder-guide-overlay .airport-cue p{font-size:13px;line-height:1.4;margin:0 0 6px}
.builder-guide-overlay .airport-cue button{font-size:11px;min-height:28px;padding:4px 7px}
.builder-guide-overlay .airport-cue small{display:block;font-size:10px;letter-spacing:1px;color:#ebd180;margin-bottom:6px}
.bakery.airport #builder-popup{overflow:visible;max-height:calc(100dvh - 154px)}
.bakery.airport #builder-popup #builder{overflow:visible}
@media(max-height:660px){.builder-guide-overlay{max-height:95px;padding:6px 9px}.builder-guide-overlay .airport-cue p{font-size:11px;line-height:1.25}.bakery.airport #builder-popup{max-height:calc(100dvh - 119px)}}
#builder-popup .mobile-slot.has-slot-choices > .slot-choice-toggle{z-index:80;inset:3px 3px auto auto;width:28px;height:28px;min-height:28px;max-height:28px}
#builder-popup .mobile-slot.has-slot-choices > .slot-choice-list{z-index:90}
/* Shared slot button sizing must not turn choice controls into teaching cards. */
.bakery #builder-popup .slots .slot-choice-toggle{width:28px!important;height:28px!important;min-height:28px!important;max-height:28px!important;padding:2px!important;line-height:24px;text-align:center}
.bakery #builder-popup .slots .slot-choice-option{height:auto!important;min-height:44px!important;max-height:none!important;padding:9px 3px!important;font-size:13px;text-align:center}
#builder-popup .builder-guide-overlay{box-sizing:border-box;max-width:100%}
