/* Viewport layout: only independent choice/text panels scroll. */
@media screen {
html,body{height:100%;overflow:hidden}body{height:100dvh;display:flex;flex-direction:column}header{height:52px;flex:0 0 52px;width:100%;padding:4px 16px}.brand img{width:36px;height:40px}.brand strong{font-size:21px}.head-actions{gap:5px}.head-actions button{padding:8px}.head-actions #saved{display:none}
main{width:100%;max-width:1600px;min-height:0;flex:1;padding:6px 14px;display:grid;grid-template-rows:40px 50px minmax(0,1fr) 34px;gap:5px}.intro{margin:0;align-items:center}.intro .eyebrow,.intro p,.intro .star{display:none}.intro h1{font-size:27px;margin:0}.age-box{display:block;margin:0}.age-box label{display:none}.age-box select{padding:7px;font-size:12px}.guide-bar{margin:0;padding:4px 10px;gap:8px;min-height:0}.guide-bar>img{height:36px;width:36px}.guide-bar>div{min-width:0;overflow:auto;max-height:42px;flex:1}.guide-bar strong{font-size:13px}.guide-bar p{font-size:11px;margin:0}.guide-bar button{font-size:11px;padding:7px}.workspace{display:grid;grid-template-columns:190px minmax(0,1fr) 245px;gap:10px;min-height:0}.palette{height:100%;align-self:stretch;min-height:0;padding:8px;display:grid;grid-template-rows:38px auto minmax(0,1fr) 36px 64px;gap:3px;overflow:hidden}.tabs{padding:0}.tabs button{font-size:11px;padding:5px}.palette-help{margin:3px 0;font-size:11px}#choices{min-height:0;overflow:auto;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;align-content:start;gap:5px}#choices .character{min-height:85px;padding:4px;font-size:10px;display:block}#choices .character img{height:60px;max-height:none;width:100%;margin:0;object-fit:contain}.catalogue-pager{margin:0}.catalogue-pager button{min-height:32px;padding:2px 12px}.creative-tools{margin:0;gap:3px}.creative-tools button{padding:6px;font-size:11px}
.director{min-width:0;min-height:0;display:grid;grid-template-rows:22px minmax(0,1fr) 28px 40px 52px 42px;gap:4px}.stage-top{margin:0}.stage-hint{display:none}.stage-wrap{min-height:0;overflow:hidden}.stage{margin:0;max-height:100%;flex-shrink:0}.stage-text{margin:0;padding:4px 8px;font-size:11px;overflow:auto}.actor-tools{margin:0;gap:3px}.actor-tools>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.actor-tools>div{display:flex;flex-shrink:0}.actor-tools button{height:36px;min-width:36px;padding:2px 6px;margin-left:3px}.timeline{margin:0;gap:4px;min-width:0;overflow-x:auto}.scene-card{padding:4px;min-width:80px}.scene-card span{font-size:10px;max-width:115px}.scene-card small{font-size:9px}.bottom-actions button{padding:6px 10px;font-size:12px}#storyMaker{grid-column:auto;margin:0;padding:10px;overflow:auto;min-height:0}#voicePrivacy{font-size:12px;line-height:1.35;background:#e2f4e9;color:#204f3d;padding:8px;border-radius:8px;margin:0 0 6px}.voice-controls{gap:4px;display:flex;flex-wrap:wrap}.voice-controls button{padding:7px;font-size:11px;min-height:36px}#tellTitle{font-size:16px;margin:8px 0}.tell-modes{gap:2px}.tell-modes button{font-size:10px;padding:6px 3px}#voiceHint,#cardsHint,#voiceFeedback,#storyPreview{font-size:12px;margin:6px 0}#sentenceCards{grid-template-columns:1fr}#sentenceCards button{font-size:12px;padding:7px}footer{margin:0;padding:0;min-height:0}footer>span{display:none}footer button,.file-button{font-size:10px;padding:7px}.idea-details{margin:8px 0}#fullInstructions{font-size:13px;line-height:1.6;white-space:pre-line}
}
@media screen and (max-width:760px){header{height:44px;flex-basis:44px;padding:2px 7px}.brand{font-size:9px;gap:3px}.brand strong{font-size:14px}.brand img{width:25px;height:30px}.head-actions button{font-size:10px;padding:6px}#sound{display:none}main{padding:4px 6px;grid-template-rows:30px minmax(0,1fr) 28px;gap:4px}.intro h1{font-size:19px;letter-spacing:-.6px}.age-box select{font-size:10px;padding:5px;max-width:135px}.guide-bar{display:none}.workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(190px,1fr) 113px 126px;gap:4px}.director{grid-row:1;grid-template-rows:18px minmax(0,1fr) 0px 36px 42px 36px;gap:2px}.stage-text{visibility:hidden;padding:0}.stage{border-radius:12px}.actor-tools button{height:34px}.scene-card{min-width:72px;padding:3px}.scene-card span{font-size:9px}.bottom-actions button{font-size:11px;padding:5px 8px}.palette{grid-row:2;padding:4px;grid-template-columns:1fr 100px;grid-template-rows:27px minmax(0,1fr);gap:3px;border-radius:12px}.tabs{grid-row:1;grid-column:1}.palette-help{display:none}#choices{grid-row:2;grid-column:1;display:flex;overflow:auto;align-items:stretch;gap:4px}#choices .character{flex:0 0 66px;min-height:0;font-size:9px;padding:2px}#choices .character img{height:36px}.catalogue-pager{grid-row:1;grid-column:2;font-size:10px;gap:2px}.catalogue-pager button{min-width:28px;min-height:26px;padding:0 5px;font-size:18px}.creative-tools{grid-row:2;grid-column:2;flex-direction:column;gap:2px}.creative-tools button{font-size:10px;padding:3px;flex:1}#storyMaker{grid-row:3;display:grid;grid-template-columns:1fr;gap:3px;padding:5px;overflow:auto}#voicePrivacy{font-size:10px;padding:4px;margin:0}.voice-controls{flex-wrap:nowrap;gap:3px}.voice-controls button{min-height:32px;font-size:10px;padding:4px 6px}#tellTitle{display:none}.tell-modes{margin:0}.tell-modes button{font-size:10px;padding:4px}#voicePane{display:none}#storyPreview,#reviewText{display:none}footer>div{width:100%;justify-content:space-between}footer button,.file-button{font-size:9px;padding:5px 3px}.stage-top{font-size:9px}.stage-top button{font-size:18px}.actor-tools{font-size:10px}#helpDialog{max-height:96dvh}.help-steps{grid-template-columns:1fr}}
@media screen and (max-height:560px) and (min-width:761px){main{grid-template-rows:30px minmax(0,1fr) 28px}.guide-bar{display:none}.workspace{grid-template-columns:155px minmax(0,1fr) 210px}.director{grid-template-rows:18px minmax(0,1fr) 22px 34px 42px 36px}.intro h1{font-size:22px}}
@media screen{#storyMaker{display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:4px;overflow:hidden}.composer-options{min-height:0;overflow:auto}}
@media screen and (max-width:760px){header{flex-direction:row;align-items:center;justify-content:space-between}.intro{flex-direction:row;align-items:center;gap:3px}.head-actions{width:auto}.composer-options{overflow:auto}.tell-modes{position:sticky;top:0;background:#f1f4ef;z-index:1}}
@media screen and (max-width:760px){header{min-height:44px;flex-wrap:nowrap}.intro{display:flex!important}.workspace{grid-template-rows:minmax(170px,1fr) 113px 154px}}
/* v3 : décor plus grand, panneau « Raconter » mieux rangé */
@media screen and (min-width:761px){#storyMaker{display:flex;flex-direction:column;gap:6px;overflow:auto}#storyMaker>*{flex:0 0 auto}#storyMaker #voicePrivacy{margin:0}#storyMaker #tellTitle{margin:0}}
@media screen and (min-width:761px) and (max-height:680px){main{grid-template-rows:34px minmax(0,1fr) 30px}.guide-bar{display:none}.intro h1{font-size:23px}.director{grid-template-rows:18px minmax(0,1fr) 0 34px 42px 36px}.stage-text{visibility:hidden;padding:0}}
@media screen and (min-width:761px) and (min-height:681px){main{grid-template-rows:44px 46px minmax(0,1fr) 30px}.guide-bar{padding:2px 10px}.director{grid-template-rows:20px minmax(0,1fr) 30px 36px 46px 42px}}
@media screen and (max-width:760px){.workspace{grid-template-rows:minmax(170px,1fr) 104px 138px}#voicePrivacy{font-size:9px;padding:3px}}

/* v4: sur petit écran, les boutons « Je raconte » ne débordent plus sur le texte quand on choisit « Je choisis » ou « J’écris » */
@media screen and (max-width:760px){.voice-controls{overflow:hidden;min-height:0}}
