#dialogueWorkshop { --stage-ink:#3d302a; --stage-accent:#8f3e2f; --stage-soft:#f8eedc; --stage-rim:#d7c4a4 }
#dialogueWorkshop[data-scene=playground] { --stage-ink:#233e31; --stage-accent:#306343; --stage-soft:#edf3dd; --stage-rim:#bfcbb0 }
.dialogue-places,.bakery-roles { min-width:0; border:0; padding:0; margin:0 }
.dialogue-places { display:flex; flex-wrap:wrap; gap:7px; align-items:center; margin:0 0 14px }
.dialogue-places legend,.bakery-roles legend { font-size:.91rem; font-weight:720; padding:0; margin-bottom:6px; color:var(--stage-ink) }
.dialogue-places button { border-radius:22px; min-height:44px; background:#fffaf1; border-color:#d8c9af; color:#554239 }
.dialogue-places button[aria-pressed=true] { background:#403c3b; color:#fff9e5; border-color:#403c3b }
.bakery { margin:0 0 26px; padding:clamp(16px,3vw,34px); border:1px solid var(--stage-rim); border-radius:24px; background:var(--stage-soft); color:var(--stage-ink); box-shadow:0 3px 0 var(--stage-rim) }
.bakery-head { margin:0 0 18px }
.bakery-head h2 { margin:0 0 4px; font-size:clamp(27px,3.4vw,44px) }
.bakery-head p { margin:0; max-width:65ch }
.dialogue-stage { display:grid; grid-template-columns:minmax(0,1.18fr) minmax(0,1fr); gap:clamp(14px,2vw,24px); align-items:stretch }
.bakery-roles { display:flex; flex-direction:column }
.dialogue-scene { position:relative; overflow:hidden; border:1px solid #584d3b57; border-radius:14px; isolation:isolate; background:#dcc9a6 }
#dialogueSceneArt { display:block; width:100%; height:auto; aspect-ratio:3/2 }
.dialogue-hotspot { position:absolute; transform:translate(-50%,-50%); border:2px solid #fffbef; background:#fcf7e9; color:#392f28; font-weight:750; border-radius:99px; min-height:44px; max-width:46%; line-height:1.15; padding:7px 13px; box-shadow:0 2px 6px #32291580; text-align:center }
.dialogue-hotspot:hover { transform:translate(-50%,-50%); background:#fff }
.dialogue-hotspot[aria-pressed=true] { color:#fff; background:#385b4b; border-color:#fff9e6 }
.dialogue-hotspot[aria-pressed=true]::before { content:'✓'; display:inline-block; margin-inline-end:.28em; font-weight:900 }
.dialogue-hotspot.is-speaking::after { content:''; position:absolute; display:block; left:50%; bottom:100%; margin-left:-7px; border:7px solid transparent; border-bottom-color:#fffbef; filter:drop-shadow(0 -1px 1px #54452e80) }
.dialogue-hotspot:focus-visible { outline:3px solid #165495; outline-offset:3px }
[data-scene=bakery] [data-speaker=shopkeeper] { left:25%; top:68% }
[data-scene=bakery] .dialogue-hotspot[data-speaker=child] { left:77%; top:83% }
[data-scene=playground] .dialogue-hotspot[data-speaker=child] { left:24%; top:70% }
[data-scene=playground] .dialogue-hotspot[data-speaker=friend] { left:70%; top:66% }
.bakery-turn { align-self:stretch; display:flex; flex-direction:column; min-width:0; padding:clamp(15px,2.1vw,25px); border:1px solid var(--stage-rim); border-radius:15px; background:#fffcf3 }
.bakery-turnhead,.bakery-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px }
.bakery-turnhead { justify-content:space-between; border-bottom:1px solid #dccfb9; padding-bottom:10px }
#bakeryCue { color:var(--stage-accent); font-weight:760 }
.bakery-turn[data-mine=true] #bakeryCue { color:#305941 }
#bakeryProgress { color:#6d5b4c; margin-inline-start:auto; font-size:.86rem }
.dialogue-turn-body { flex:1; padding:16px 0; display:flex; gap:clamp(11px,1.5vw,19px); align-items:flex-start }
.dialogue-portrait { position:relative; isolation:isolate; flex:0 0 clamp(78px,8.2vw,108px); aspect-ratio:5/4; overflow:hidden; border-radius:11px; background:var(--stage-soft); border:2px solid #fffcf3; box-shadow:0 0 0 1px var(--stage-rim) }
#dialoguePortrait { position:absolute; display:block; max-width:none; height:auto; pointer-events:none }
.dialogue-words { min-width:0 }
#bakerySpeaker { display:block; font-size:.85rem; color:#665548; font-weight:650; margin:0 0 3px }
#bakeryLine { margin:0; font-size:clamp(19px,2vw,28px); font-weight:680; line-height:1.4; color:var(--stage-ink); overflow-wrap:anywhere }
.bakery-actions button { min-height:46px; border-radius:12px }
#bakeryNext { color:#fffaf0; border-color:var(--stage-accent); background:var(--stage-accent) }
#bakeryNext:hover { filter:brightness(.92) }
#bakeryBack { margin:10px 0 -5px; color:var(--stage-ink); font-size:.90rem; border-color:transparent; background:transparent }
#bakeryBack:hover { border-color:var(--stage-rim) }
#bakeryNotice { margin:10px 0 0; color:#92372b }
#bakeryNotice:empty { display:none }
@media (max-width:830px) {
  .dialogue-stage { grid-template-columns:1fr }
  .bakery-roles,.bakery-turn { width:100% }
  .dialogue-portrait { flex-basis:clamp(76px,15vw,112px) }
}
@media (max-width:540px) {
  .bakery { padding:13px; border-radius:16px }
  .bakery-head { margin-bottom:13px }
  .dialogue-stage { gap:12px }
  .dialogue-hotspot { font-size:.88rem; padding:5px 8px }
  .bakery-turn { padding:12px }
  .bakery-actions button { flex:1 1 120px }
}
.teacher-panel { margin:0 0 26px; padding:clamp(16px,3vw,30px); background:#fffaf0; color:#3e362f; border:1px solid var(--stage-rim); border-radius:18px }
.teacher-panel h3 { margin:0 0 5px; font-size:clamp(22px,2.6vw,32px) }
.teacher-panel p { margin:0 0 13px }
.teacher-panel label { display:block; margin-bottom:5px }
.teacher-answer,.teacher-choices,.teacher-speaking { display:flex; align-items:center; flex-wrap:wrap; gap:8px }
.teacher-answer input { flex:1 1 180px; min-width:0; padding:10px 12px; min-height:45px; font:inherit; color:#392f2a; border-radius:10px; border:1px solid #c4ae90; background:#fffefb }
.teacher-answer button { background:var(--stage-accent); color:white; border-color:var(--stage-accent) }
.teacher-choices { margin:11px 0 }
.teacher-choices button { color:#354c3c; border-radius:22px; background:#eeeede; text-align:start }
.teacher-speaking small,.teacher-exchange small { color:#5f554c; font-size:.86rem }
.teacher-speaking small { flex:1 1 160px }
.teacher-exchange { margin-top:15px; border-inline-start:4px solid #709176; padding:12px 15px; border-radius:8px; background:#f0f2e8 }
.teacher-exchange strong { display:block; font-size:.86rem; color:#50604e }
.teacher-exchange p { overflow-wrap:anywhere }
.teacher-exchange small:empty { display:none }
#dialogueActivities{margin:1.3rem 0;padding:1.1rem;border-radius:18px;background:#f4f1e6;color:#263a31}
#dialogueActivities h3{margin:.15rem 0 .7rem}
#dialogueActivities .activity-menu{display:flex;flex-wrap:wrap;gap:.5rem}
#dialogueActivities button{white-space:normal;overflow-wrap:anywhere;min-height:44px;margin:.2rem;padding:.52rem .85rem}
#dialogueActivities dialog{box-sizing:border-box;width:min(94vw,32rem);max-height:85vh;max-height:85dvh;padding:0;border:1px solid #c9c8ae;border-radius:20px;background:#fffdf5;color:#26382d;box-shadow:0 1.2rem 5rem #17372b33}
#dialogueActivities dialog::backdrop{background:#172821aa}
#dialogueActivities .activity-sheet{padding:clamp(1rem,4vw,1.65rem);overflow-wrap:anywhere}
#dialogueActivities .activity-sheet h2{margin:.1rem 0 .9rem}
#dialogueActivities blockquote{margin:1rem 0;padding:.8rem;border-left:4px solid #719580;background:#f0f2df;border-radius:6px;font-weight:650}
#dialogueActivities img{width:100%;height:auto;max-height:35vh;object-fit:cover;border-radius:12px}
#dialogueActivities [data-action=close]{display:block;margin-top:1rem;background:#fff;color:#364e41;border:1px solid #8c9b88}
#dialogueActivities .syllable-beat{display:inline-block;margin-left:.4rem;color:#55775b;animation:activity-beat .48s ease-in-out 1}
@keyframes activity-beat{50%{color:#bf520b;transform:scale(1.65)}}
@media(prefers-reduced-motion:reduce){#dialogueActivities .syllable-beat{animation:none}}
