/* Only addition learning. Keep native scene/order/colours; reserve phase-dependent rows. */
body:has(#additionUnit1Screen:not([hidden])),body:has(#additionCarryScreen:not([hidden])),body:has(#pictureArithmeticScreen[data-op=add]:not([hidden])){overflow-anchor:none;}
#additionUnit1Screen.au:not(.au-clear):not([hidden]){height:var(--alu-available,calc(100dvh - 110px))!important;min-height:650px;max-height:none;display:grid;grid-template-rows:24px minmax(180px,1fr) 0px 48px 68px 0px 140px!important;gap:8px;padding:0 2px calc(24px + env(safe-area-inset-bottom,0px))!important;align-content:stretch;}
#additionUnit1Screen.au .au-scene{height:100%;min-height:180px;}
#additionUnit1Screen.au .au-equation{font-size:32px;line-height:48px;}
#additionUnit1Screen.au .au-controls{min-height:68px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:center;}
#additionUnit1Screen.au .au-controls:has(>.au-action){grid-template-columns:1fr;}
#additionUnit1Screen.au .au-number{margin:0;min-width:0;width:100%;min-height:60px;font-size:34px;}
#additionUnit1Screen.au .au-guide{height:140px;min-width:0;}
#additionUnit1Screen.au .au-bubble{height:140px;box-sizing:border-box;overflow-wrap:anywhere;}
#additionUnit1Screen.au .au-speech{font-size:20px;line-height:1.35;}
#additionUnit1Screen.au .au-figure{max-width:100%;}
#additionCarryScreen.carry-learning[data-phase]:not([data-phase=clear]):not([hidden]){height:var(--alu-available,calc(100dvh - 110px))!important;min-height:674px;grid-template-rows:22px 44px minmax(190px,1fr) 54px 60px 140px!important;gap:8px!important;padding:0 6px calc(24px + env(safe-area-inset-bottom,0px))!important;align-content:stretch;}
#additionCarryScreen .cl-world{height:100%;min-height:0;margin:0!important;align-self:stretch;}
#additionCarryScreen .cl-relation,#additionCarryScreen .cl-relation:empty{height:54px;min-height:54px;padding:0!important;margin:0!important;display:grid;place-items:center;}
#additionCarryScreen .cl-ten-equation{font-size:28px;line-height:1.3;margin:0;}
#additionCarryScreen .cl-actions{height:60px;min-height:60px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:stretch;}
#additionCarryScreen .cl-actions button{width:100%;min-width:0;min-height:56px;margin:0;font-size:30px;}
#additionCarryScreen .kug--banner{position:static!important;inset:auto!important;transform:none!important;grid-row:6;height:140px!important;min-height:140px;max-width:100%;width:100%;margin:0!important;align-self:end;}
#additionCarryScreen .kug-bubble{height:140px!important;min-height:140px!important;box-sizing:border-box;}
#additionCarryScreen .kug-text{font-size:20px;line-height:1.35;overflow-wrap:anywhere;word-break:normal;}
#pictureArithmeticScreen.picture-arithmetic[data-op=add]:not([data-phase=clear]){height:var(--alu-available,calc(100dvh - 110px))!important;min-height:620px;max-height:none;grid-template-rows:32px 64px minmax(190px,1fr) 56px 40px 68px!important;gap:8px;padding:0 6px calc(24px + env(safe-area-inset-bottom,0px))!important;}
#pictureArithmeticScreen[data-op=add] .pa-add-world{height:100%;min-height:190px;align-items:center;}
#pictureArithmeticScreen[data-op=add] .pa-group{height:224px!important;max-height:100%;min-height:190px;grid-template-rows:28px minmax(0,1fr);padding:8px;}
#pictureArithmeticScreen[data-op=add] .pa-objects{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,42px)!important;grid-auto-rows:42px;gap:4px;}
#pictureArithmeticScreen[data-op=add] .pa-item{height:42px;}
#pictureArithmeticScreen[data-op=add] .pa-item img{width:36px;height:36px;max-width:100%;}
#pictureArithmeticScreen[data-op=add] .pa-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;height:68px;}
#pictureArithmeticScreen[data-op=add] .pa-answer{width:100%;min-width:0;min-height:60px;}
#pictureArithmeticScreen[data-op=add] .pa-feedback{font-size:18px;line-height:1.3;min-height:40px;}
:is(#additionUnit1Screen.au .au-controls,#additionCarryScreen,#pictureArithmeticScreen[data-op=add]) button:active{transform:none!important;filter:brightness(.94);}
#additionUnit1Screen.au[data-phase=choice] .au-number,#additionCarryScreen:is([data-phase=need],[data-phase=remain],[data-phase=sum],[data-phase=original]) .cl-actions button:not(:disabled),#pictureArithmeticScreen[data-op=add][data-phase=question] .pa-answer{animation:alu-answer-glow 1.8s ease-in-out infinite;}
@keyframes alu-answer-glow{50%{box-shadow:inset 0 0 0 2px #e4bc49,0 0 7px #e4bc4933;}}
/* Two brief original vignettes stay in the existing scene and never block navigation. */
:is(#additionUnit1Screen .au-scene,#additionCarryScreen .cl-world){position:relative;}
.alu-fx{position:absolute;inset:0;z-index:25;pointer-events:none;overflow:hidden;border-radius:20px;background:radial-gradient(ellipse,#fffbeded 0%,#fffbedcc 55%,transparent 90%);}
.alu-fx img{position:absolute;width:72px;height:72px;object-fit:contain;left:calc(50% - 36px);top:calc(50% - 36px);}
.alu-fx-star{position:absolute;left:calc(50% - 20px);top:calc(50% - 66px);font-size:40px;color:#e5ac20;line-height:1;filter:drop-shadow(0 2px white);}
.alu-fx-skip{position:absolute;right:5px;bottom:5px;min-width:54px;min-height:44px;border:1px solid #bbbead;border-radius:14px;background:#fffdf4;color:#365746;font:14px Meiryo,sans-serif;pointer-events:auto;padding:4px;}
.alu-fx-kind-star .alu-fx-a{animation:alu-lift 1.4s ease-in-out both;}
.alu-fx-kind-star>.alu-fx-star{animation:alu-star-flight 1.4s ease-in-out both;}
@keyframes alu-lift{0%{transform:translateY(10px) rotate(-5deg)}16%{transform:translateY(0)}34%{transform:translateY(-8px) rotate(5deg)}55%{transform:translateY(8px) scaleY(.88)}74%{transform:translate(14px,0) rotate(-8deg)}100%{transform:none}}
@keyframes alu-star-flight{0%,16%{transform:translateY(30px) scale(.8)}34%{transform:translateY(0)}55%{transform:translate(38px,-18px) rotate(40deg)}74%{transform:translate(0,0) rotate(100deg)}100%{transform:translateY(15px) rotate(180deg)}}
.alu-fx-kind-duet .alu-fx-a{animation:alu-duet-a 1.4s ease-in-out both;}.alu-fx-kind-duet .alu-fx-b{animation:alu-duet-b 1.4s ease-in-out both;}.alu-fx-kind-duet>.alu-fx-star{animation:alu-duet-star 1.4s ease-in-out both;}
@keyframes alu-duet-a{0%{transform:translateX(-38px)}16%{transform:translate(-25px,-6px) rotate(-8deg)}34%{transform:translate(-10px,0) rotate(6deg)}55%{transform:translate(-32px,4px) rotate(-12deg)}74%,100%{transform:translate(-28px,-6px) rotate(-8deg)}}
@keyframes alu-duet-b{0%{transform:translateX(38px)}16%{transform:translate(38px,4px) rotate(8deg)}34%{transform:translate(12px,-6px) rotate(-6deg)}55%{transform:translate(25px,0) rotate(12deg)}74%,100%{transform:translate(28px,-6px) rotate(8deg)}}
@keyframes alu-duet-star{0%,55%{opacity:0;transform:scale(.5)}74%,100%{opacity:1;transform:scale(1)}}
@media(max-height:720px){#additionUnit1Screen.au:not(.au-clear):not([hidden]){min-height:530px;grid-template-rows:20px minmax(160px,1fr) 0px 40px 56px 0px 112px!important;gap:4px;padding-bottom:20px!important;}#additionUnit1Screen.au .au-scene{min-height:160px;}#additionUnit1Screen.au .au-guide,#additionUnit1Screen.au .au-bubble{height:112px;}#additionUnit1Screen.au .au-speech{font-size:18px;line-height:1.3;}#additionUnit1Screen.au .au-controls{min-height:56px;}#additionUnit1Screen.au .au-number{min-height:54px;font-size:30px;}#additionUnit1Screen.au .au-equation{font-size:30px;line-height:40px;}#additionCarryScreen.carry-learning[data-phase]:not([data-phase=clear]):not([hidden]){min-height:530px;grid-template-rows:20px 38px minmax(150px,1fr) 42px 54px 112px!important;gap:4px!important;padding-bottom:20px!important;}#additionCarryScreen .cl-actions{height:54px;min-height:54px;}#additionCarryScreen .cl-actions button{min-height:52px;font-size:28px;}#additionCarryScreen .cl-relation,#additionCarryScreen .cl-relation:empty{height:42px;min-height:42px;}#additionCarryScreen .kug--banner,#additionCarryScreen .kug-bubble{height:112px!important;min-height:112px!important;}#additionCarryScreen .kug-text{font-size:18px;line-height:1.3;}#pictureArithmeticScreen.picture-arithmetic[data-op=add]:not([data-phase=clear]){min-height:530px;grid-template-rows:28px 52px minmax(180px,1fr) 44px 36px 58px!important;gap:4px;}#pictureArithmeticScreen[data-op=add] .pa-add-world{min-height:180px;}#pictureArithmeticScreen[data-op=add] .pa-group{height:186px!important;min-height:180px;grid-template-rows:24px 1fr;padding:6px;}#pictureArithmeticScreen[data-op=add] .pa-objects{grid-template-rows:repeat(3,38px)!important;grid-auto-rows:38px;gap:2px;}#pictureArithmeticScreen[data-op=add] .pa-item{height:38px;}#pictureArithmeticScreen[data-op=add] .pa-item img{width:32px;height:32px;}#pictureArithmeticScreen[data-op=add] .pa-actions{height:58px;}#pictureArithmeticScreen[data-op=add] .pa-answer{min-height:54px;}}
@media(prefers-reduced-motion:reduce){#additionUnit1Screen.au .au-number,#additionCarryScreen .cl-actions button,#pictureArithmeticScreen[data-op=add] .pa-answer,.alu-fx *{animation:none!important;}.alu-fx-reduced .alu-fx-b{transform:translateX(35px)}.alu-fx-reduced .alu-fx-a{transform:translateX(-25px)}}

#additionUnit1Screen.au .au-friend:active{transform:translate(-50%,-50%)!important;filter:brightness(.94);}

#additionUnit1Screen.au .au-equation{display:grid;place-items:center;height:48px;min-height:48px;padding:0!important;margin:0!important;box-sizing:border-box;line-height:1.2;}
#additionUnit1Screen.au .au-controls{padding:0!important;margin:0!important;}
#additionUnit1Screen.au .au-bubble{max-height:none!important;padding:12px 38px 12px 14px;}
#additionCarryScreen .kug-bubble{padding:12px 34px 12px 12px!important;}
#additionCarryScreen .cl-actions,#additionCarryScreen .cl-actions:empty{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));padding:0!important;margin:0!important;min-height:60px;height:60px;}
@media(max-height:720px){#additionUnit1Screen.au .au-equation{height:40px;min-height:40px;}#additionCarryScreen .cl-actions,#additionCarryScreen .cl-actions:empty{height:54px;min-height:54px;}}

body:has(#pictureArithmeticScreen.picture-arithmetic[data-op=add]:not([hidden])) main{padding-bottom:0!important;}
#additionCarryScreen.carry-learning[data-phase]:not([hidden])>.kug.kug--banner{position:static!important;inset:auto!important;transform:none!important;height:140px!important;min-height:140px!important;max-height:none!important;margin:0!important;width:100%!important;}
#additionCarryScreen.carry-learning .cl-actions,#additionCarryScreen.carry-learning .cl-actions:empty{height:60px!important;min-height:60px!important;max-height:60px!important;align-items:stretch!important;}
@media(max-height:720px){#additionCarryScreen.carry-learning[data-phase]:not([hidden])>.kug.kug--banner{height:112px!important;min-height:112px!important;}#additionCarryScreen.carry-learning .cl-actions,#additionCarryScreen.carry-learning .cl-actions:empty{height:54px!important;min-height:54px!important;max-height:54px!important;}}

#additionUnit1Screen .au-guide,#additionCarryScreen.carry-learning[data-phase]:not([hidden])>.kug.kug--banner{position:relative!important;}

#additionUnit1Screen.au-clear .au-secondary:active{transform:none!important;}

@media(max-height:720px){#additionUnit1Screen.au:not(.au-clear):not([hidden]){grid-template-rows:20px minmax(160px,1fr) 0px 40px 56px 0px 110px!important;}#additionUnit1Screen.au .au-guide,#additionUnit1Screen.au .au-bubble{height:110px!important;}}

#additionUnit1Screen.au .au-bubble{min-height:0!important;}
#additionUnit1Screen.au .au-guide{grid-template-rows:minmax(0,1fr);min-height:0;}

@media(min-width:600px){#additionUnit1Screen.au .au-friend{width:88px;height:102px;}#additionUnit1Screen.au .au-figure{width:84px;height:84px;}#additionUnit1Screen.au .au-number{font-size:40px;}#additionCarryScreen .cl-frame,#additionCarryScreen .cl-tray{grid-template-rows:repeat(2,58px);}#additionCarryScreen .cl-slot img{max-width:42px;height:42px;}#additionCarryScreen h3{font-size:18px;line-height:26px;}#pictureArithmeticScreen[data-op=add] .pa-group{height:280px!important;}#pictureArithmeticScreen[data-op=add] .pa-objects{grid-template-rows:repeat(3,58px)!important;grid-auto-rows:58px;}#pictureArithmeticScreen[data-op=add] .pa-item{height:58px;}#pictureArithmeticScreen[data-op=add] .pa-item img{width:50px;height:50px;}}

/* Picture addition uses the same bottom character + speech area as the other addition lessons. */
#pictureArithmeticScreen.picture-arithmetic[data-op=add]:not([data-phase=clear]){grid-template-rows:32px minmax(190px,1fr) 56px 68px 140px!important;}
#pictureArithmeticScreen[data-op=add] .pa-guide{position:relative;display:grid;grid-template-columns:72px minmax(0,1fr);gap:10px;align-items:end;height:140px;min-width:0;}
#pictureArithmeticScreen[data-op=add] .pa-guide-character{width:66px;height:70px;object-fit:contain;align-self:end;margin-bottom:12px;}
#pictureArithmeticScreen[data-op=add] .pa-guide-bubble{height:140px;box-sizing:border-box;border:2px solid #e7d7b0;border-radius:22px;background:white;padding:14px 12px;display:flex;flex-direction:column;gap:8px;min-width:0;}
#pictureArithmeticScreen[data-op=add] .pa-guide .pa-prompt{display:block;text-align:left;padding:0;background:none;border-radius:0;font-size:20px;line-height:1.35;min-height:0;}
#pictureArithmeticScreen[data-op=add] .pa-guide .pa-feedback{display:block;text-align:left;min-height:0;font-size:17px;line-height:1.3;}

@media(max-height:720px){#pictureArithmeticScreen.picture-arithmetic[data-op=add]:not([data-phase=clear]){grid-template-rows:28px minmax(180px,1fr) 44px 58px 110px!important;min-height:530px;}#pictureArithmeticScreen[data-op=add] .pa-guide,#pictureArithmeticScreen[data-op=add] .pa-guide-bubble{height:110px;}#pictureArithmeticScreen[data-op=add] .pa-guide-bubble{padding:10px 12px;gap:5px;}#pictureArithmeticScreen[data-op=add] .pa-guide .pa-prompt{font-size:18px;}#pictureArithmeticScreen[data-op=add] .pa-group{height:180px!important;}}

@media(max-height:720px){#pictureArithmeticScreen[data-op=add] .pa-guide-character,#additionUnit1Screen.au .au-moka{width:56px;height:50px;align-self:end;margin-bottom:4px;}#additionCarryScreen .kug-character{height:54px;align-self:end;margin:0 0 4px;}#additionCarryScreen .kug-character-img{width:56px;height:50px;object-fit:contain;}}
