/* Desktop, tablet and phone layouts share the same lessons and saved progress. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:130px}
.mobile-brand-row{flex-shrink:0}.mobile-menu-toggle{display:none}
main,#content,.learningGrid>*{min-width:0}
input,select,textarea{max-width:100%}
button,.sources summary{touch-action:manipulation}
button:focus-visible,a:focus-visible{outline-offset:3px}
#heading{scroll-margin-top:120px}
#toast{transform:translateX(-50%);max-width:calc(100vw - 32px);bottom:calc(20px + env(safe-area-inset-bottom));text-align:center}
dialog{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}
.sources a{overflow-wrap:anywhere}
@media (max-width:1179px){
 .site-sidebar{position:sticky;inset:auto;top:0;z-index:10;width:100%;padding:14px max(24px,env(safe-area-inset-left));border-right:0;border-bottom:1px solid var(--line);gap:12px}
 .site-sidebar .brand{font-size:20px}.site-sidebar .brand b{font-size:25px;padding:0 11px}.site-sidebar .brand small{font-size:9px}
 .site-sidebar .sidelabel,.site-sidebar .sidebottom{display:none}
 .site-sidebar>nav{display:flex;flex-wrap:nowrap;gap:6px;margin:0;overflow-x:auto;overflow-y:hidden;flex-shrink:0;scrollbar-width:thin;padding-bottom:3px}
 .site-sidebar nav button{width:auto;flex:0 0 auto;min-height:44px;margin:0;padding:10px 13px;gap:8px;white-space:nowrap}
 .site-sidebar nav button span,.gameview .site-sidebar nav button span{font-size:13px}
 .site-sidebar nav i{display:none}
 main{margin-left:0;padding:30px max(24px,env(safe-area-inset-left)) 24px}
 .stats .statIcon{display:grid}.stats>div{min-width:0;padding:16px}
 .learningGrid{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:18px}
 .word-speaker{width:44px;height:44px;flex-basis:44px;padding:10px}
 .icon{width:44px;height:44px;flex-shrink:0}
 .outline,.textbutton,.columnToggle,.cardwritebuttons button,.writingactions button,.sentence-link,.grammar-categories button,.grammar-shortcuts button,.grammar-bookmark{min-height:44px}
 input,select,textarea,.gamesettings select,.sentence-settings select,.sentence-navigation select,.grammar-toolbar select,.grammar-toolbar input[type=search]{font-size:16px;min-height:44px}
 .grammar-categories button,.grammar-shortcuts button{font-size:12px}
 .grammar-card-meta,.grammar-expand{font-size:11px}
 .grammar-usage p,.grammar-example-pin,.grammar-example-vi,.grammar-meaning,.grammar-caution p{font-size:14px}
 .grammar-toolbar>label{font-size:12px}
 .grammar-saved{min-height:44px}
 .grammar-saved input{min-height:0}
 .gamehud{flex-wrap:wrap;gap:16px;padding:16px}
 .gamehud small{font-size:10px}.gamehud .outline{font-size:12px}
 .rainanswer input{font-size:16px;min-width:0}
 .fallword .word-speaker{width:32px;height:32px;min-height:32px;padding:7px}
 .fallword small{padding-right:30px}
 .sentence-tile{min-height:44px}
 .writingchoices button{min-height:44px}
 .toolbar{flex-wrap:wrap}.toolbar #search{flex:1 1 260px;min-width:0}
 footer{gap:12px;flex-wrap:wrap}
}
@media (min-width:768px) and (max-width:899px){
 .learningGrid{grid-template-columns:1fr}.grammar-cards{grid-template-columns:1fr}
 .stats{grid-template-columns:repeat(4,minmax(0,1fr))}.stats>div{padding:14px 12px;gap:8px}.stats .statIcon{display:none}
 .sentence-settings{grid-template-columns:1fr 1fr}.sentence-settings label:nth-child(2){grid-column:1/-1;grid-row:1}
}
@media (max-width:767px){
 html{scroll-padding-top:90px}
 .site-sidebar{padding:10px max(16px,env(safe-area-inset-left));gap:0}
 .mobile-brand-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
 .site-sidebar .brand{font-size:18px;gap:9px}.site-sidebar .brand b{font-size:25px}.site-sidebar .brand small{letter-spacing:2px;font-size:8px}
 .mobile-menu-toggle{display:flex;align-items:center;gap:7px;background:#edf3e9;border:1px solid #dce5d5;border-radius:9px;color:var(--green);min-height:44px;padding:9px 12px;font-size:13px;flex-shrink:0}
 .site-sidebar>nav{display:none}
 .site-sidebar.menu-open>nav{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:12px 0 2px;max-height:calc(100dvh - 85px);overflow-y:auto}
 .site-sidebar nav button{white-space:normal;text-align:left;justify-content:flex-start;padding:10px;min-width:0}
 .site-sidebar nav button span,.gameview .site-sidebar nav button span{font-size:13px}
 main{padding:24px max(16px,env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom))}
 header{flex-wrap:wrap;align-items:flex-start;gap:14px}header>div{min-width:0}h1{font-size:26px;line-height:1.35}
 header p{font-size:14px;line-height:1.8}.eyebrow{font-size:10px;letter-spacing:1.2px}
 .stats{grid-template-columns:1fr 1fr;gap:10px}.stats>div{padding:14px 12px;gap:10px}.stats .statIcon{display:grid;width:34px;height:38px;flex-shrink:0}.stats small{font-size:11px}
 .levelsectionhead{flex-direction:column;align-items:flex-start;gap:8px}.levelsectionhead h2{font-size:21px}
 .levelcards{gap:8px}.levelcard{padding:14px 10px}.leveltitle{font-size:14px}.levelcard>strong{font-size:25px}.leveldesc,.levelmeta{font-size:10px}.levelnote{font-size:12px;line-height:1.8}
 .learningGrid{grid-template-columns:1fr}.flashwrap,.details{padding:20px 16px}.details p{font-size:14px}.example .pin,.example .vi{font-size:13px;overflow-wrap:anywhere}
 .flashnav{gap:8px}.rating{gap:8px}.rating button{padding:12px 8px;font-size:13px}
 .sectiontop{flex-wrap:wrap;align-items:flex-start}.catalogHint{max-width:none;font-size:12px}
 .toolbar{gap:10px}.toolbar #search{flex-basis:100%;width:100%}.toolbar select{flex:1 1 130px;max-width:100%}
 .columncontrols{gap:6px}.columncontrols>span{flex-basis:100%;font-size:12px}.columnToggle{font-size:12px}
 .writingsection{padding:20px 16px}.writingworkspace{grid-template-columns:1fr}.writingboard{margin:auto}.writingactions{justify-content:center}.writingstatus{max-width:none;text-align:center}
 .writinghead{align-items:flex-start}.writinghead h2{font-size:20px}.writinghead p,.writingtips{font-size:12px}.writingword{font-size:28px}
 .grammar-intro h2,.sentence-intro h2,.gameintro h2{font-size:25px;line-height:1.5}.grammar-intro p,.sentence-intro p,.gameintro p{font-size:13px}
 .grammar-cards{grid-template-columns:1fr}.grammar-toolbar{padding:16px;gap:12px}.grammar-toolbar>label:nth-child(2){flex-basis:100%}.grammar-toolbar select{min-width:0}.grammar-toolbar>.grammar-saved{font-size:13px}
 .grammar-card summary{padding:18px}.grammar-body{padding:0 18px 18px}.grammar-formula{font-size:17px}.grammar-card h3{font-size:18px}
 .grammar-result-count,.grammar-shortcuts>span{font-size:12px}
 .sentence-settings{grid-template-columns:1fr;gap:12px}.sentence-settings label:nth-child(2){grid-column:auto;grid-row:auto}
 .sentence-layout{grid-template-columns:minmax(0,1fr)}.sentence-notes{display:none}.sentence-card{padding:20px 16px}
 .sentence-card-top{flex-wrap:wrap;gap:8px}.sentence-cue p{font-size:15px;overflow-wrap:anywhere}.sentence-prompt{overflow-wrap:anywhere}
 .sentence-tile{max-width:100%;overflow-wrap:anywhere}.sentence-actions{flex-wrap:wrap}.sentence-navigation{flex-wrap:wrap;gap:12px}.sentence-navigation label{order:3;width:100%;font-size:12px;justify-content:center}
 .sentence-navigation select{max-width:100%}.sentence-progress{font-size:12px;flex-wrap:wrap}
 .gamesettings{display:grid;grid-template-columns:1fr 1fr;gap:12px}.gamesettings label{font-size:12px}.gamesettings .primary{min-height:46px}
 .gamehud{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:14px}.gamehud>div{min-width:0}.gamehud strong{font-size:23px}.gamehud small{font-size:10px;letter-spacing:0}.gamehud .outline{min-height:44px;white-space:normal}.gamebest{display:none}
 .rainstage{height:clamp(270px,44svh,360px)}.fallword{padding:8px 5px}.fallword small{font-size:10px;line-height:1.5}.fallword strong{overflow-wrap:anywhere}
 .rainanswer>div{flex-wrap:wrap}.rainanswer input{width:100%;flex-basis:100%}.rainanswer button{min-height:44px;font-size:13px}
 .rainreview>div{grid-template-columns:minmax(0,1fr);gap:4px}.rainreview b{flex-wrap:wrap}
 .bottomBanner{padding:16px;gap:12px}.bottomBanner p{font-size:12px}.bottomBanner span{display:none}
 dialog{padding:20px;width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}.formgrid{grid-template-columns:1fr}.dialoghead h2{font-size:21px}
 footer{font-size:9px;letter-spacing:1px}
}
@media (max-width:600px){
 .tablewrap{border:0;border-radius:0;background:transparent;overflow:visible}
 .vocabtable,.vocabtable:where(.hide-han,.hide-pin,.hide-meaning){display:block;min-width:0;width:100%}
 .vocabtable thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .vocabtable tbody{display:grid;gap:12px}.vocabtable tr{display:block;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px 16px}
 .vocabtable td{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;gap:8px;border:0;padding:6px 0;font-size:14px;overflow-wrap:anywhere}
 .vocabtable td::before{content:attr(data-label);font-size:11px;color:#8b9882}
 .vocabtable td:first-child{width:auto;font-size:11px;padding:0 0 7px;color:#8b9882;border-bottom:1px solid #edf0e7;margin-bottom:6px}
 .vocabtable td[colspan]{display:block;padding:12px 0}.vocabtable td[colspan]::before{content:none}
 .vocabtable .tablepin{white-space:normal}.vocabtable .wordlink{min-width:0;min-height:44px;white-space:normal;overflow-wrap:anywhere;font-size:29px}
 .vocabtable .typetag{font-size:12px;max-width:none}.vocabtable .word-type-audio{justify-content:space-between;width:100%}.vocabtable .memory{font-size:12px}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
