/* Final responsive safeguards: Tamil glyphs keep their full line box. */
*,*::before,*::after{box-sizing:border-box}
.screen,.card,.form,.setting,.row2,.tiles,.tile,.hero-text,.guide-text,.learn-grid>*{min-width:0}
.screen.parent{height:auto!important;max-height:none!important;overflow:visible!important;padding-bottom:max(24px,env(safe-area-inset-bottom))}
.parent>.card{min-width:0;height:auto!important;max-height:none!important;overflow:visible!important}
.parent h2,.parent h3,.parent p,.parent label,.parent .note,.account-card{overflow-wrap:anywhere;line-height:1.65}
.parent .row-between,.parent .actions,.parent .legend{flex-wrap:wrap;gap:12px}
.parent-tabs{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr));gap:8px}
.parent-tabs .btn{width:100%;white-space:normal;line-height:1.65;padding:8px 12px;height:auto}
.letter-strength{display:flex;flex-wrap:wrap;align-items:stretch;gap:10px}
.parent .letter-strength .ls{width:auto;min-width:72px;height:auto;min-height:64px;padding:10px 14px;font-size:1.35rem;line-height:1.8;flex:0 0 auto;max-width:100%;text-align:center;white-space:normal;overflow-wrap:anywhere;transform:none}
.parent .letter-strength .ls.wide{font-size:1rem;flex:0 1 auto;min-width:90px;line-height:1.8}
.parent .legend .ls{width:auto;height:auto;min-width:32px;min-height:32px;padding:3px 7px;line-height:1.7}
.parent .setting{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,min(46%,360px));align-items:center;gap:12px}
.parent .setting select,.parent input:not([type=checkbox]),.parent .setting>div{width:100%;min-width:0;max-width:100%}
select{max-width:100%;text-overflow:ellipsis}
.parent .setting select{font:inherit;font-size:.9rem;min-height:44px;padding:8px;white-space:normal}
.parent .setting input[type=checkbox]{justify-self:end}
.parent .stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(115px,100%),1fr))}
.stats>div{min-width:0;height:auto}.stats small{display:block;overflow-wrap:anywhere;line-height:1.6}
.parent .actions .btn{height:auto;white-space:normal;line-height:1.65;max-width:100%}
.screen.home .tile{grid-template-columns:auto minmax(0,1fr);align-items:center}
.screen.home .tile-icon{transform:none!important;rotate:0deg!important;width:auto!important;min-width:64px;max-width:100%;height:auto!important;min-height:64px;aspect-ratio:auto;font-size:1.25rem!important;line-height:1.8;padding:8px 12px;white-space:nowrap;align-self:center}
.tile b,.tile small{min-width:0;overflow-wrap:anywhere;line-height:1.6}
.start-screen,.account-screen,.licence-screen{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
.account-form,.licence-card{width:min(100%,780px);min-width:0;height:auto!important;max-height:none!important}
.form input:not([type=checkbox]):not([type=radio]),.form select{min-width:0;max-width:100%}
.check{align-items:flex-start}.check input{flex-shrink:0}.check span{min-width:0;overflow-wrap:anywhere;line-height:1.65}
.t-wrap,.t-auth,.t-class{min-width:0;max-width:100%}.t-top,.t-class .actions{flex-wrap:wrap}.t-table-wrap{max-width:100%;overflow-x:auto}.t-table th,.t-table td{line-height:1.6}.t-grid{grid-template-columns:repeat(auto-fit,minmax(min(270px,100%),1fr))}
@media(orientation:landscape) and (max-height:520px){
.screen.parent{padding:10px 16px 24px}.parent>.card{padding:16px}.parent-tabs .btn{font-size:.8rem;min-height:40px}.parent .letter-strength .ls{min-width:64px;min-height:58px;font-size:1.2rem;padding:7px 12px}
.screen.home .tile{padding:10px 14px;min-height:80px}.screen.home .tile-icon{min-width:52px;min-height:52px;padding:5px 9px;font-size:1.1rem!important}
.account-screen,.start-screen{padding:12px 18px}.account-form{padding:16px}.account-screen h1,.start-screen h1{font-size:1.3rem;line-height:1.6;margin:8px 0}.t-wrap{padding:12px}.t-top{margin-bottom:12px;padding-bottom:12px}
}
@media(max-width:600px){.parent .setting{grid-template-columns:1fr}.parent .setting select{width:100%}.parent .setting input[type=checkbox]{justify-self:start}.parent-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Login and entry pages: viewport-based composition, Tamil-safe line heights. */
.start-screen .who-en,.account-screen h1 .who-en{display:none}
.screen.start-screen{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;align-content:center;justify-items:center;gap:12px;width:100%;max-width:1200px;margin:auto;padding:24px;min-height:100dvh!important}
.start-screen .logo{width:clamp(60px,13dvh,108px);margin:0}
.start-screen h1{margin:0;font-size:clamp(1.1rem,2.4vw,2rem);line-height:1.65}
.start-screen .who-grid{width:min(100%,920px);margin:0;align-self:center;gap:20px}
.start-screen .who-card{min-width:0;padding:20px 12px;gap:10px;border:2px solid #e0d5ef;border-radius:30px;background:#fffefb;box-shadow:0 6px 0 #d7cbe9;transition:transform .18s,border-color .18s}
.start-screen .who-card:hover{transform:translateY(-4px);border-color:#9b80c8}
.start-screen .who-icon{display:block;width:min(20dvh,150px);height:min(20dvh,150px);object-fit:contain}
.start-screen .who-card b{font-size:clamp(1rem,2vw,1.65rem);line-height:1.75;text-align:center}
.start-screen .who-note{margin:0;padding:8px 14px;font-size:.85rem;line-height:1.6}
.start-screen .who-note .btn{min-height:36px;padding:5px 12px;font-size:.85rem}
.screen.account-screen{display:grid;grid-template-columns:minmax(200px,.8fr) minmax(0,1.2fr);grid-template-rows:auto auto;align-content:center;align-items:center;gap:12px 48px;max-width:1120px;width:100%;margin:auto;padding:32px;min-height:100dvh!important}
.account-screen>.logo{grid-column:1;grid-row:1;width:90px;align-self:end;margin:0 auto}
.account-screen>h1{grid-column:1;grid-row:2;align-self:start;margin:0;text-align:center;font-size:clamp(1.2rem,2.2vw,1.8rem);line-height:1.8}
.account-screen>h1::after{content:'';display:block;width:min(24dvh,210px);aspect-ratio:1;margin:18px auto 0;background:url('../assets/cartoon/role-parent.webp') center/contain no-repeat}
.account-screen>.account-form{grid-column:2;grid-row:1/3;width:100%;margin:0;padding:26px;display:grid;gap:12px;border:1px solid #ded5ed;border-radius:28px;box-shadow:0 8px 0 #ddd3ed,0 18px 45px #5142640c}
.account-form label{display:grid;gap:6px;text-align:left;line-height:1.5;font-size:.9rem}
.account-form input:not([type=checkbox]),.t-auth input{display:block;width:100%;min-width:0;min-height:46px;height:46px;border:2px solid #ded6ec;border-radius:14px;padding:9px 12px;background:#faf8ff;font:inherit;outline-offset:3px}
.account-form .check{display:flex;gap:8px;font-size:.76rem;line-height:1.5}
.account-form .check input{width:18px;height:18px;min-height:18px;margin:2px 0 0}
.account-form .btn{min-height:46px;height:auto;padding:8px 14px;font-size:1rem;line-height:1.6;border-radius:16px}
.account-form p{margin:0;line-height:1.6;font-size:.8rem;text-align:center}.account-form .hint{color:#7c718d}.account-form .account-links a{text-decoration:underline;text-underline-offset:3px}
.account-screen .corner{position:fixed;top:14px;left:14px;z-index:2;width:38px;height:38px;background:#fffdf8;border:1px solid #e1d7ed}
/* Teacher auth reuses a split shell; signed-in teacher screens are unaffected. */
.t-wrap:has(.t-auth){display:grid;grid-template-columns:minmax(200px,.8fr) minmax(0,1.2fr);align-items:center;align-content:center;gap:48px;width:100%;max-width:1120px;min-height:100dvh;padding:32px;margin:auto}
.t-wrap:has(.t-auth)>.t-top{display:flex;flex-direction:column;text-align:center;justify-content:center;padding:0;margin:0;border:0;gap:14px}
.t-wrap:has(.t-auth)>.t-top img{width:90px}.t-wrap:has(.t-auth)>.t-top h1{font-size:clamp(1.2rem,2.2vw,1.8rem);line-height:1.8}.t-wrap:has(.t-auth)>.t-top small{display:none}
.t-wrap:has(.t-auth)>.t-top::after{content:'';display:block;width:min(24dvh,210px);aspect-ratio:1;background:url('../assets/cartoon/role-teacher.webp') center/contain no-repeat}
.t-wrap .t-auth{width:100%;max-width:none;margin:0;padding:26px;border:1px solid #ded5ed;border-radius:28px;box-shadow:0 8px 0 #ddd3ed,0 18px 45px #5142640c;display:grid;gap:14px;background:#fffefb}
.t-auth .tabs{padding:4px;background:#f0eaf9;border-radius:16px;gap:5px;margin:0}.t-auth .tabs button{font-size:.85rem;min-height:42px;padding:7px;border:0;border-radius:12px;box-shadow:none;line-height:1.5}.t-auth .tabs button.on{background:#6a548f}
.t-auth form{display:grid;gap:12px}.t-auth label{display:grid;gap:6px;font-size:.9rem;line-height:1.6}.t-auth .btn.primary{width:100%;border-radius:16px;min-height:46px;padding:8px;font-size:1rem;line-height:1.6}.t-auth p{font-size:.8rem;line-height:1.6;margin:0}.t-auth .link{border:0;background:none;padding:0;color:#6a548f;text-decoration:underline;font:inherit}
/* Today CTA: equal outer columns keep the wrapping lesson caption exactly centred. */
.screen.home .btn.today{display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;align-content:center;align-items:center;justify-items:center;text-align:center;width:100%;max-width:none;position:relative;padding:12px 48px!important;gap:3px;min-height:92px;isolation:isolate}
.screen.home .btn.today .today-ta{grid-column:1;grid-row:1;line-height:1.5;font-size:clamp(1.2rem,3dvh,1.9rem);text-align:center;margin:0}
.screen.home .btn.today small{grid-column:1;grid-row:2;align-self:center;justify-self:center;text-align:center;line-height:1.65;width:100%;max-width:100%;margin:0;white-space:normal;overflow-wrap:anywhere;font-size:clamp(.75rem,1.7dvh,1rem)}
.screen.home .btn.today .today-en{grid-column:1;position:static;line-height:1.4;font-size:.75rem}
.screen.home .btn.today::after{position:absolute;right:14px;top:50%;transform:translateY(-50%);width:24px;margin:0;line-height:1;text-align:center;font-size:1.5rem}
@media(orientation:landscape){
.screen.home{height:calc(100dvh - 72px);display:grid;grid-template-rows:minmax(0,1fr) auto;align-content:stretch;padding:14px 20px 20px;gap:14px;min-height:0}
.screen.home .hero{height:100%!important;min-height:0!important;padding:18px 28px!important;gap:28px;align-items:center;overflow:visible!important}
.screen.home .hero-text{display:flex;flex-direction:column;justify-content:center;align-items:stretch;gap:8px!important;min-width:0;width:auto;flex:1}
.screen.home .mascot{width:min(28%,240px);height:min(100%,260px);min-height:0;flex:none}.screen.home .mascot .companion{width:100%;height:100%;object-fit:contain}
.screen.home .bubble{font-size:clamp(1.1rem,3dvh,1.9rem);line-height:1.65!important}.screen.home .hero-subtitle{margin:0;line-height:1.6}.screen.home .tiles{min-height:0}.screen.home .tile{min-height:85px}
.screen.start-screen{height:100dvh!important;min-height:0!important;grid-template-rows:auto auto minmax(0,1fr) auto;gap:8px;padding:16px 24px}
.screen.account-screen{height:100dvh!important;min-height:0!important}
}
@media(orientation:landscape) and (max-height:540px){
.screen.account-screen,.t-wrap:has(.t-auth){padding:12px 24px;gap:12px 28px;grid-template-columns:minmax(160px,.65fr) minmax(0,1.35fr)}
.account-screen>.logo,.t-wrap:has(.t-auth)>.t-top img{width:58px}.account-screen>h1,.t-wrap:has(.t-auth)>.t-top h1{font-size:1.05rem;line-height:1.7}.account-screen>h1::after,.t-wrap:has(.t-auth)>.t-top::after{width:25dvh;margin:6px auto 0}
.account-screen>.account-form,.t-wrap .t-auth{padding:14px 18px;gap:8px;border-radius:22px}.account-form label,.t-auth label{font-size:.78rem;gap:3px}.account-form input:not([type=checkbox]),.t-auth input{height:36px;min-height:36px;padding:5px 10px;border-radius:11px}.account-form .btn,.t-auth .btn.primary{min-height:36px;padding:5px 10px;font-size:.85rem}.account-form p,.t-auth p{font-size:.7rem;line-height:1.5}.t-auth form{gap:7px}.t-auth .tabs button{min-height:34px;font-size:.74rem}.account-form:has([name=name]),.t-auth form:has([name=school]){grid-template-columns:repeat(2,minmax(0,1fr))}.account-form:has([name=name])>p,.account-form:has([name=name])>.check,.account-form:has([name=name])>.btn,.t-auth form:has([name=school])>p,.t-auth form:has([name=school])>.btn{grid-column:1/-1}.account-form .check{font-size:.67rem;line-height:1.45}
.screen.start-screen{gap:5px;padding:10px 22px}.start-screen .logo{width:48px}.start-screen h1{font-size:1.05rem}.start-screen .who-card{padding:10px;gap:4px;border-radius:22px}.start-screen .who-icon{width:24dvh;height:24dvh}.start-screen .who-card b{font-size:1rem}.start-screen .who-grid{gap:12px}.start-screen>.hint{margin:0;font-size:.7rem}
.screen.home{height:calc(100dvh - 58px);padding:8px 12px 14px;gap:10px}.screen.home .hero{padding:10px 20px!important;gap:18px}.screen.home .hero-text{gap:4px!important}.screen.home .adventure-kicker,.screen.home .hero-subtitle{display:none!important}.screen.home .btn.today{min-height:66px;padding:7px 40px!important;gap:0}.screen.home .btn.today small{font-size:.72rem}.screen.home .btn.today .today-ta{font-size:1.1rem}.screen.home .tile{min-height:70px;padding:8px 12px}.screen.home .tile b{font-size:.9rem}.screen.home .tile small{font-size:.7rem}.screen.home .sticker{width:26px;height:26px}.screen.home .tile-icon{min-width:44px;min-height:44px;font-size:1rem!important}
}
@media(orientation:portrait){.screen.account-screen,.t-wrap:has(.t-auth){grid-template-columns:1fr;gap:12px;min-height:100dvh;padding:24px}.account-screen>.logo,.account-screen>h1,.account-screen>.account-form{grid-column:1;grid-row:auto}.account-screen>h1::after,.t-wrap:has(.t-auth)>.t-top::after{display:none}.account-screen>.logo{width:64px}.screen.start-screen{min-height:100dvh!important}.start-screen .who-grid{gap:8px}.start-screen .who-card{padding:12px 5px}.start-screen .who-icon{width:20vw;height:20vw}.start-screen .who-card b{font-size:.85rem}}
/* A focused field must remain reachable when a mobile keyboard reduces the viewport. */
@media(max-height:280px){.screen.account-screen,.t-wrap:has(.t-auth),.screen.start-screen{height:auto!important;min-height:100dvh!important;align-content:start}.account-screen>h1::after,.t-wrap:has(.t-auth)>.t-top::after{display:none}}

/* Consent checkbox follows the first line; never stretches to form-field width. */
label.check,.form label.check,.compact-setup .form label.check,.account-form label.check{display:flex!important;flex-direction:row!important;align-items:flex-start!important;justify-content:flex-start;gap:10px!important;width:100%;text-align:left;line-height:1.65}
label.check>input[type=checkbox],.form label.check>input[type=checkbox]{display:block!important;flex:0 0 18px!important;width:18px!important;min-width:18px!important;max-width:18px!important;height:18px!important;min-height:18px!important;padding:0!important;margin:3px 0 0!important;align-self:flex-start}
label.check>span,.form label.check>span{display:block;flex:1 1 auto;min-width:0;width:auto!important;text-align:left;line-height:1.65;overflow-wrap:anywhere}
/* Explicit areas override earlier flex-direction/order/width rules. */
@media(orientation:landscape){
.screen.home .hero{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(120px,28%);grid-template-areas:"copy mascot";justify-content:stretch!important;align-items:center!important;gap:clamp(18px,4vw,64px)!important;padding-left:clamp(22px,4vw,64px)!important;padding-right:clamp(22px,3vw,48px)!important}
.screen.home .hero>.hero-text{grid-area:copy;order:0!important;justify-self:stretch;align-self:center;width:100%!important;max-width:none!important;margin:0!important;transform:none!important;position:static!important;text-align:left}
.screen.home .hero>.mascot{grid-area:mascot;order:0!important;justify-self:end;width:100%!important;max-width:260px;height:auto!important;aspect-ratio:1;margin:0!important;align-self:center}
.screen.home .hero .bubble,.screen.home .hero .adventure-kicker,.screen.home .hero .hero-subtitle{text-align:left;width:100%;margin-left:0!important}
.screen.home .hero .btn.today{margin-left:0!important;margin-right:0!important;width:100%!important;max-width:none!important}
}

/* Separate family entrance; teacher portal is reached directly at /teacher. */
.start-screen .who-grid{grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,740px);gap:24px}
.start-screen .who-icon{width:clamp(100px,24dvh,200px);height:clamp(100px,24dvh,200px);object-fit:cover;border-radius:28px;border:4px solid #fffaf0;box-shadow:0 5px 18px #55416b12}
.account-screen>h1::after,.t-wrap:has(.t-auth)>.t-top::after{border-radius:30px;background-size:cover;box-shadow:0 5px 18px #55416b12}
@media(orientation:landscape) and (max-height:540px){.start-screen .who-icon{width:26dvh;height:26dvh;border-radius:20px}.start-screen .who-grid{gap:18px;max-width:650px}}
@media(orientation:portrait){.start-screen .who-icon{width:28vw;height:28vw;max-width:180px;max-height:180px}.start-screen .who-grid{gap:14px}}

/* Role count follows the authenticated session. */
.start-screen .who-grid[data-role-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr));width:min(100%,1000px)}
.start-screen .who-grid[data-role-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,740px)}
.start-screen .who-grid[data-role-count="1"]{grid-template-columns:minmax(0,1fr);width:min(100%,340px)}
.start-screen .role-signout{justify-self:center;min-height:36px;padding:5px 20px;font-size:.85rem}
.start-screen:has(.role-signout){grid-template-rows:auto auto minmax(0,1fr) auto auto auto}
@media(orientation:landscape) and (max-height:540px){.start-screen:has(.role-signout) .who-icon{width:21dvh;height:21dvh}.start-screen:has(.role-signout) .who-card{padding:7px 10px}.start-screen .role-signout{min-height:30px;padding:3px 16px}}
/* Colourful reference header: consistent alignment and larger brand mark. */
:root{--app-header-height:88px}
.topbar{height:var(--app-header-height);min-height:var(--app-header-height);display:flex;align-items:center;gap:12px;padding:8px max(20px,calc((100% - 1400px)/2));background:#fffefb;border-bottom:2px solid #e7def3;box-shadow:0 3px 0 #e9e0f7;flex-wrap:nowrap}
.topbar>a:has(.brand-mini){display:flex;align-items:center;justify-content:center;flex:none;align-self:stretch;padding:0 5px}
.topbar .brand-mini{display:block;width:68px;height:68px;max-height:100%;object-fit:contain}
.topbar .who{min-width:0;display:flex;align-items:center;gap:10px;padding:7px 16px 7px 8px;border-radius:24px;background:#eee6fc;color:#493467;font-weight:700;line-height:1.6}
.topbar .who .avatar{background:#ffefba;border:2px solid #edcf84;display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:50%;overflow:hidden}
.topbar .who .friend-portrait{width:44px;height:44px}
.topbar .pill{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:8px 16px;border-radius:20px;background:#fbebbc;color:#78531d;line-height:1.5;font-size:1rem;white-space:nowrap;flex:none}
.topbar .icon-btn{display:inline-flex;align-items:center;justify-content:center;flex:none;width:48px;height:48px;border-radius:18px;background:#ede4f7;border:2px solid #e0d1ed;box-shadow:0 4px 0 #d2c2e1;font-size:1.2rem;line-height:1}
.topbar .voice-toggle{background:#e9e0f4;border-color:#ddceeb;color:#76518f}.topbar .help-btn{background:#fff0c8;border-color:#efdaab;color:#936521;box-shadow:0 4px 0 #e5c995}.topbar a[href="#/parent"]{background:#e9f3e5;border-color:#dce9d4;box-shadow:0 4px 0 #cbdcbc}
.topbar .who b,.topbar .who strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}
.start-screen .logo{width:clamp(80px,16dvh,126px)}
.account-screen>.logo,.t-wrap:has(.t-auth)>.t-top img{width:106px}
@media(orientation:landscape){
.screen.home,.screen.learn,.screen.session{height:calc(100dvh - var(--app-header-height))}
}
@media(orientation:landscape) and (max-height:540px){
:root{--app-header-height:64px}
.topbar{padding:4px 12px;gap:8px}.topbar .brand-mini{width:52px;height:52px}.topbar .who{padding:4px 10px 4px 5px;border-radius:18px;gap:6px;font-size:.85rem}.topbar .who .avatar{width:38px;height:38px}.topbar .who .friend-portrait{width:34px;height:34px}.topbar .pill{min-height:38px;border-radius:15px;padding:5px 10px;font-size:.85rem}.topbar .icon-btn{width:38px;height:38px;border-radius:14px;font-size:1rem}.topbar .who b,.topbar .who strong{max-width:120px}
.screen.home,.screen.learn,.screen.session{height:calc(100dvh - var(--app-header-height))}
.start-screen .logo{width:62px}.account-screen>.logo,.t-wrap:has(.t-auth)>.t-top img{width:70px}
}
@media(max-width:600px){.topbar{gap:5px;padding-left:8px;padding-right:8px}.topbar .who{gap:4px;padding-right:7px}.topbar .pill{padding:5px 8px}.topbar .who b,.topbar .who strong{max-width:75px}}
/* Compact question tiles: override legacy square aspect ratios and intrinsic row sizing. */
@media(orientation:landscape){
.screen.session{min-height:0;box-sizing:border-box;grid-template-rows:auto minmax(0,1fr);padding-top:10px;padding-bottom:18px;gap:10px 24px;align-content:stretch}
.screen.session>.guide{align-self:start;min-height:42px;padding:6px 12px}
.screen.session>.choices{width:min(100%,530px);height:100%;max-height:min(52dvh,300px);min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);align-content:stretch;align-self:center;justify-self:center;gap:14px}
.screen.session>.choices .choice{aspect-ratio:auto!important;width:100%;height:100%;min-height:0!important;max-height:100%;padding:8px 14px;line-height:1.65;font-size:clamp(1.7rem,6dvh,3.3rem);border-radius:22px;overflow:visible}
.screen.session>.choices .choice [data-fit]{line-height:1.65!important;max-width:100%;text-align:center}
.screen.session>.choices.words{max-height:min(48dvh,270px)}
.screen.session>.choices.words .choice{font-size:clamp(.9rem,2.8dvh,1.5rem);overflow-wrap:anywhere}
.screen.session>.cue.speaker{width:clamp(80px,21dvh,145px);height:clamp(80px,21dvh,145px);font-size:clamp(2.2rem,7dvh,4rem);padding:8px;border-radius:28px}
}
@media(orientation:landscape) and (max-height:440px){
.screen.session{padding:7px 12px 14px;gap:8px 18px}.screen.session>.guide{min-height:36px;padding:4px 10px}.screen.session>.choices{max-height:calc(100dvh - var(--app-header-height) - 78px);gap:10px}.screen.session>.choices .choice{padding:5px 10px;border-radius:18px;font-size:clamp(1.5rem,7dvh,2.3rem)}.screen.session>.choices.words .choice{font-size:clamp(.8rem,3dvh,1.1rem)}.screen.session>.cue.speaker{width:22dvh;height:22dvh;min-width:64px;min-height:64px;font-size:2.2rem}
}

/* Two answers need one row, not an empty second row above the vertical centre. */
@media(orientation:landscape){
.screen.session>.cue{grid-column:1;grid-row:2;align-self:center;justify-self:center}
.screen.session>.choices{grid-column:2;grid-row:2;align-self:center;grid-template-rows:minmax(0,1fr);height:clamp(86px,24dvh,160px);max-height:100%}
.screen.session>.choices:has(>.choice:nth-child(3)){grid-template-rows:repeat(2,minmax(0,1fr));height:min(52dvh,300px);max-height:100%}
.screen.session>.choices.words{height:clamp(74px,22dvh,140px);max-height:100%}
.screen.session>.choices.words:has(>.choice:nth-child(3)){height:min(48dvh,270px)}
}
@media(orientation:landscape) and (max-height:440px){
.screen.session>.choices:has(>.choice:nth-child(3)){height:calc(100dvh - var(--app-header-height) - 78px);max-height:100%}
}

/* Guided அ fits existing square tracing hosts without adding height. */
.trace-host.guided-trace-host{display:grid;grid-template-rows:minmax(0,1fr) auto;aspect-ratio:1;min-height:0;gap:4px}
.guided-trace-host .guided-trace-canvas{width:100%!important;height:100%!important;min-height:0;display:block;touch-action:none;user-select:none;aspect-ratio:auto;border-radius:20px;object-fit:contain}
.guided-trace-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;line-height:1.5}
.guided-trace-status{font-size:.68rem;line-height:1.5;min-width:0;color:#6e567f}
.guided-trace-demo{flex:none;font:inherit;font-size:.68rem;padding:5px 8px;min-height:32px;border:1px solid #dfd2ec;border-radius:10px;background:#fff4d4;color:#6e5424;touch-action:manipulation}
.guided-trace-demo:disabled{opacity:.5}
.guided-trace-host .trace-hand{display:none}

/* Bundle Tamil font locally so online/offline letter shapes stay consistent. */
@font-face{font-family:'Arumpon Tamil';src:url('../assets/fonts/noto-sans-tamil.ttf') format('truetype');font-weight:100 900;font-style:normal;font-display:swap}
:root{--font:'Baloo 2','Arumpon Tamil','Noto Sans Tamil',system-ui,sans-serif}
body,button,input,select,textarea{font-family:var(--font)}
/* Give the guided board its own flexible row; its toolbar must not overlap actions. */
.trace-wrap:has(.guided-trace-host){display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;align-items:stretch!important;justify-items:stretch;gap:8px;min-height:0}
.trace-wrap:has(.guided-trace-host)>.guide{margin:0!important;position:static!important;align-self:start}
.trace-wrap .trace-host.guided-trace-host{width:100%!important;max-width:none!important;height:100%!important;min-height:0;aspect-ratio:auto!important;align-self:stretch;justify-self:stretch;grid-template-rows:minmax(0,1fr) auto;gap:6px}
.guided-trace-host .guided-trace-canvas{width:100%!important;height:100%!important;max-height:100%;min-height:0;overflow:hidden;display:block;align-self:stretch}
.guided-trace-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:2px 4px;min-width:0}
.guided-trace-status{display:block;min-width:0;text-align:left;line-height:1.6;font-size:.72rem;overflow-wrap:anywhere}
.guided-trace-demo{max-width:100%;min-height:36px;margin:0;line-height:1.6;padding:5px 10px;font-size:.72rem;white-space:normal}
.trace-wrap:has(.guided-trace-host)>.actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;margin:0!important;align-self:end}
.trace-wrap:has(.guided-trace-host)>.actions .btn{width:100%;height:auto;min-height:38px;white-space:normal;line-height:1.6;padding:6px 10px;font-size:.85rem}
@media(orientation:landscape){
.learn-grid>.trace-wrap:has(.guided-trace-host){height:100%;padding:10px;gap:8px}
.session .trace-solo:has(.guided-trace-host){display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr);align-items:stretch;gap:16px;min-height:0}
.session .trace-solo>.trace-host.guided-trace-host{width:100%!important;max-width:none!important;height:100%!important;aspect-ratio:auto!important;min-height:0;grid-template-rows:minmax(0,1fr) auto}
.session .trace-solo>.actions{align-self:center;max-width:180px}
}
@media(orientation:landscape) and (max-height:500px){
.learn-grid>.trace-wrap:has(.guided-trace-host){padding:6px;gap:5px}.guided-trace-status{font-size:.64rem;line-height:1.5}.guided-trace-demo{min-height:30px;font-size:.65rem;padding:4px 7px}.guided-trace-toolbar{gap:6px;padding:0}.trace-wrap:has(.guided-trace-host)>.actions{gap:8px}.trace-wrap:has(.guided-trace-host)>.actions .btn{min-height:32px;padding:4px 8px;font-size:.75rem;line-height:1.6}
}
@media(orientation:portrait){.trace-wrap .trace-host.guided-trace-host{height:340px!important}.session .trace-solo>.trace-host.guided-trace-host{height:340px!important;width:100%!important;aspect-ratio:auto!important}}

/* 2026-10-19 plans: Level 1-only note on the path (inside the h1, so the path grid keeps its rows) */
.garden-path h1 .plan-note{display:block;margin-top:2px;font-size:.55em;font-weight:600;color:#7a4b12}
.licence-screen .plan-child{border-top:1px solid rgba(0,0,0,.08);padding-top:10px;margin-top:10px}
.licence-screen .plan-child h2{display:flex;align-items:center;gap:8px;font-size:1.05rem;margin:0 0 4px}
.licence-screen .plan-child .avatar{width:36px;height:36px;display:inline-block}
.lease-screen{gap:14px}
.lease-screen .logo{width:110px;height:auto;max-height:110px;object-fit:contain}
.lease-screen .note{max-width:560px;text-align:center}

/* 2026-10-19 demo mode */
.demo-banner{position:fixed;left:50%;bottom:10px;transform:translateX(-50%);z-index:900;display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:center;max-width:calc(100vw - 24px);padding:6px 8px 6px 14px;border-radius:999px;background:#3b2a4f;color:#fff;font-size:.85rem;box-shadow:0 4px 14px rgba(0,0,0,.18)}
.demo-banner b{color:#ffd76a}
.demo-banner .btn.small{padding:4px 12px;min-height:0;font-size:.8rem;background:#fff;color:#3b2a4f;border-radius:999px}
.start-screen .try-demo{margin-top:6px}
.demo-banner[hidden]{display:none}
@media (max-height:520px){.demo-banner{left:8px;transform:none;bottom:6px;gap:6px;padding:3px 3px 3px 10px;font-size:.72rem;flex-wrap:nowrap}.demo-banner span{display:none}.demo-banner .btn.small{padding:2px 10px;font-size:.72rem}}

/* 2026-10-19 teacher class code: copy / share buttons */
.t-detail p:has(.t-code-big){display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px 10px}
.t-code-actions{display:flex;flex-wrap:wrap;gap:8px;flex-basis:100%;justify-content:flex-end}
.t-code-actions .btn.small{padding:6px 12px;font-size:.85rem}
