/* No browser pinch/double-tap zoom; children can still use their own pointer gestures. */
html,body{touch-action:pan-x pan-y}
button,[role="button"],.fit-pages,.reading-pages{touch-action:pan-x pan-y}
input,textarea,select,[contenteditable=true]{touch-action:manipulation;-webkit-user-select:text;user-select:text}
/* Artwork scales within the viewport. Text and touch targets retain usable sizes. */
#v-module-map,#v-workbooks{height:var(--app-height,100dvh);bottom:auto;overflow:auto}
#v-module-map .mw-map-content{flex:1;min-height:0;padding:12px 22px 14px}
#v-module-map .mw-islands{container-type:size;flex:1;min-height:0;grid-template-rows:repeat(2,minmax(0,1fr));row-gap:12px}
#v-module-map .mw-island{height:100%;min-height:0;justify-content:flex-end;padding-bottom:5px}
#v-module-map .mw-island-art{width:min(100%,calc((100cqh - 12px)/2 - 106px));height:auto;aspect-ratio:1;max-width:340px;flex:none}
#v-module-map .mw-map-heading h1{font-size:clamp(28px,3.4vw,42px)}
#v-module-map .mw-subject-name{min-height:44px;display:grid;place-items:center;font-size:clamp(24px,2.5vw,32px);line-height:1.2}
#v-workbooks .mw-picker-content{flex:1;min-height:0;max-height:100%;margin:0 auto;padding:12px 32px 18px;gap:12px}
#v-workbooks .mw-book-choices{flex:1;min-height:0;container-type:size;align-items:end}
#v-workbooks .mw-workbook{--book-height:min(340px,calc(100cqh - 245px),31vw);height:100%;display:flex;flex-direction:column;justify-content:flex-end}
#v-workbooks .mw-book-picture{height:calc(var(--book-height) + 63px);flex:none;width:100%}
#v-workbooks .mw-book-caption{width:100%;flex:none}
#v-workbooks .mw-picker-title,#v-workbooks .mw-picker-tip{flex:none}
#v-workbooks .mw-picker-title h1{font-size:clamp(28px,3.5vw,42px)}
/* A book retains all its lessons; page size follows actual rendered row heights. */
#shelf .library.paged{height:100%;max-height:100%;animation:none}
#shelf .paged [data-page-hidden]{display:none!important}
#shelf .paged .lib-index,#shelf .paged .lib-fab,#shelf .paged .lib-end{display:none!important}
#shelf .paged .lib-top{gap:8px;padding:10px 16px}
#shelf .paged .lib-title h3{font-size:25px}
#shelf .paged .lib-tools{gap:10px}
#shelf .paged .lib-seg button{min-height:44px}
#shelf .paged .lib-scroll{padding:8px 16px 12px;overflow:auto;cursor:auto;scroll-behavior:auto;scrollbar-width:auto}
#shelf .paged .lib-scroll::-webkit-scrollbar{display:initial}
#shelf .paged .lib-ch{margin-bottom:10px}
#shelf .paged .lib-chhead{position:static;padding:6px 8px;margin:0 0 6px;gap:12px;border-bottom-width:2px}
#shelf .paged .library-thumbnail{width:78px;height:58px;flex:none}
#shelf .paged .lib-chtxt b{font-size:19px;line-height:1.35}
#shelf .paged .lib-sub{margin:6px 0;padding:6px 8px 10px}
#shelf .paged .lib-sub h5{font-size:16px;margin-bottom:8px}
#shelf .paged .lib-row{min-height:96px;padding:8px 10px}
#shelf .paged .lib-row b{font-size:17px}
#shelf .paged .fit-chapters{display:flex;align-items:center;gap:10px;min-width:0}
.fit-chapters label{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-size:14px;font-weight:700}
.fit-chapters select{flex:1;min-width:0;width:0;text-overflow:ellipsis}
.fit-chapters select,.fit-chapters button,.fit-pages button{min-height:44px;min-width:44px;padding:6px 10px;font:700 15px var(--f-body);border:3px solid var(--ink);border-radius:12px;background:#fff9e9;color:var(--ink);cursor:pointer}
.fit-chapters button{background:#ffdc64;flex:none}
.fit-pages{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 16px 12px;border-top:2px solid #e3d6ba;background:#fff0cd;flex:none}
.fit-pages span{font:700 14px var(--f-body);text-align:center;font-variant-numeric:tabular-nums}
.fit-pages button{background:#ffdc64;box-shadow:0 3px 0 var(--ink)}
.fit-pages button:disabled{opacity:.45;cursor:default;box-shadow:none}
/* Keep navigation above the browser's bottom bar on iPad. */
.shelf{padding-bottom:max(12px,env(safe-area-inset-bottom));height:var(--app-height,100dvh);bottom:auto}
@media(max-width:700px){
 #v-module-map .mw-map-content{padding:10px 12px 12px;min-height:0;flex:1}
 #v-module-map .mw-map-heading{margin-bottom:8px}
 #v-module-map .mw-map-heading p{font-size:14px;margin-top:4px}
 #v-module-map .mw-islands{grid-template-rows:repeat(3,minmax(0,1fr));row-gap:7px;flex:1}
 #v-module-map .mw-island-art{width:min(100%,calc((100cqh - 14px)/3 - 85px));max-width:200px}
 #v-module-map .mw-subject-name{font-size:24px;min-width:100px;padding:3px 12px}
 #v-module-map .mw-subject-language{margin-top:4px}
 #v-module-map .mw-subject-status{padding:1px 6px;margin-top:0}
 #v-workbooks .mw-picker-content{padding:12px 14px 18px;gap:12px}
 #v-workbooks .mw-workbook{--book-height:min(232px,calc(100cqh - 225px),46vw)}
 #v-workbooks .mw-book-picture{height:calc(var(--book-height) + 44px)}
 #shelf .paged .library-header{padding:6px 10px;gap:8px}
 #shelf .paged .lib-top{padding:8px 10px;gap:7px}
 #shelf .paged .lib-title{gap:4px}
 #shelf .paged .lib-title h3{font-size:22px}
 #shelf .paged .lib-tools{flex-wrap:wrap;gap:6px}
 #shelf .paged .lib-search{flex-basis:100%;min-height:44px}
 #shelf .paged .lib-scroll{padding:6px 10px 10px}
 #shelf .paged .lib-sub{padding:6px}
 #shelf .paged .lib-row{min-height:96px}
 #shelf .paged .lib-chhead{gap:8px}
 #shelf .paged .lib-chtxt b{font-size:17px}
 #shelf .paged .lib-chhead .library-thumbnail{width:60px;height:48px}
 .fit-chapters select,.fit-chapters button,.fit-pages button{font-size:14px;padding:5px 8px}
 .fit-pages{padding:8px 10px 12px}.fit-pages span{font-size:12px}
}
@media(max-height:600px) and (min-width:701px){
 #v-module-map .mw-islands{grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:12px}
 #v-module-map .mw-island:nth-child(n){grid-column:auto}
 #v-module-map .mw-island-art{width:min(100%,calc(100cqh - 96px))}
 #v-module-map .mw-subject-name{font-size:21px;min-width:90px;padding:3px 10px}
 #v-module-map .mw-map-heading h1,#v-workbooks .mw-picker-title h1{font-size:26px}
 #v-workbooks .mw-workbook{--book-height:min(180px,calc(100cqh - 85px),22vw);display:grid;grid-template-columns:40% 60%;align-items:center}
 #v-workbooks .mw-book-caption{padding:10px}.mw-book-caption>small{font-size:12px}
 #v-workbooks .mw-book-caption>b{font-size:21px}
 #shelf .paged .lib-top{gap:4px;padding-top:6px;padding-bottom:6px}
 #shelf .paged .lib-water-key{display:none}
}
#shelf .paged .lib-seg button{min-width:44px}
#backMap{min-height:44px;min-width:44px}
/* The original five islands use the same two-row / three-row fit as the module map. */
#v-map{height:var(--app-height,100dvh);bottom:auto}
#worldWrap{overflow:auto;top:calc(var(--hudH) + 65px);bottom:12px;padding:0 18px}
#world{width:100%;height:100%;min-height:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:14px 24px;container-type:size}
#world .isle{position:relative;left:auto;top:auto;transform:none;animation:none;width:100%;height:100%;grid-column:span 2;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;padding-bottom:7px}
#world .isle:nth-child(4){grid-column:2/span 2}#world .isle:nth-child(5){grid-column:4/span 2}
#world .isle .land{width:min(100%,calc((100cqh - 14px)/2 - 88px));max-width:290px;aspect-ratio:1;flex:none}
#world .isle .land svg{width:100%;height:100%;object-fit:contain}
#world .isle .iname{min-height:44px;display:grid;place-items:center;font-size:25px;padding:4px 18px}
#world .isle .isub{font-size:12px;line-height:1.4}#world .isle .istars{font-size:13px;line-height:1.4}
#world #mapBobo{left:auto;top:auto;right:0;bottom:0;width:70px;pointer-events:none}
/* Generous text size without the oversized 30px listening cards. */
#qarea .bk-say .bk-en{font-size:clamp(20px,2vw,24px);line-height:1.5}
#qarea .bk-say{padding:8px 12px;min-height:52px}
#qarea .bk-say .bk-zh:empty{display:none}
#qarea .bk-lines [data-reading-hidden]{display:none!important}
.reading-pages{display:flex;gap:8px;align-items:center;justify-content:space-between}
#qarea .reading-pages button{min-height:44px;min-width:44px;padding:6px 12px;font-size:16px;border:3px solid var(--ink);border-radius:12px;background:#ffdf88;color:var(--ink);cursor:pointer}
.reading-pages span{font:700 14px var(--f-body)}
#qarea .reading-pages button:disabled{opacity:.45;cursor:default}
#qarea .bk-learn.reading-paged{align-items:start}
#qarea .bk-learn.reading-paged .bk-pic{max-height:min(38vh,340px);max-width:calc(min(38vh,340px)*var(--ar))}
#qarea .bk-learn.reading-paged .bk-got{min-height:44px;margin-top:2px}
@media(max-width:700px){
 #worldWrap{top:calc(var(--hudH) + 92px);padding:0 12px;bottom:12px}
 #world{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:8px}
 #world .isle:nth-child(n){grid-column:auto}
 #world .isle:nth-child(5){grid-column:1/span 2;width:50%;justify-self:center}
 #world .isle .land{width:min(100%,calc((100cqh - 16px)/3 - 78px))}
 #world .isle .iname{font-size:23px}
 #qarea .bk-learn.reading-paged{gap:10px}
 #qarea .bk-learn.reading-paged .bk-pic{max-height:min(25vh,200px);max-width:calc(min(25vh,200px)*var(--ar))}
}
@media(max-height:600px) and (min-width:701px){
 #world{grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:minmax(0,1fr)}
 #world .isle:nth-child(n){grid-column:auto}
 #world .isle .land{width:min(100%,calc(100cqh - 88px))}
}
/* Focus keeps its own English book design and year selection, with measured chapter pages. */
#v-focus{height:var(--app-height,100dvh);bottom:auto}
.fx-card.focus-paged{height:100%}
.focus-paged [data-focus-page-hidden]{display:none!important}
.focus-paged .fx-body{padding:12px 18px 14px;min-height:0;overflow:auto;overflow-x:hidden;scroll-behavior:auto}
.focus-paged .fx-unit{overflow:visible}
.focus-paged .fx-secs{overflow:visible;min-width:0}
.focus-paged .study-group{max-width:100%;box-sizing:border-box}
.focus-paged .fx-bookhead{gap:10px}.focus-paged .fx-bookthumb{height:58px;width:44px}
.focus-paged .fx-bookhead h2{font-size:25px}.focus-paged .fx-bookhead p{font-size:14px}
.focus-paged .fx-yearbar{margin:10px 0;gap:8px}.focus-paged .fx-yearbar button{min-height:44px}
.focus-paged .fx-foldall,.focus-paged .fx-chev,.focus-paged .fx-year-section>h3{display:none}
.focus-paged .fx-year-scope{margin:8px 0;font-size:13px}
.focus-paged .fx-source-scope{margin:8px 0;font-size:13px;line-height:1.4}
.focus-paged .fx-unit .fx-uhead{cursor:default;opacity:1;color:var(--ink);gap:8px;padding:8px 10px}
.focus-paged .fx-uhead>div{min-width:0}.focus-paged .fx-uhead b{font-size:18px;line-height:1.35}
.focus-paged .fx-uhead .fx-ubar{width:75px}
.focus-paged .fx-uno{width:36px;height:36px;font-size:19px}
.focus-paged .fx-secs{padding:8px;gap:8px}
.focus-paged .fx-sec{padding:8px;gap:8px}.focus-paged .fx-sec .fx-hex{width:36px;height:36px;font-size:19px}
.focus-paged .fx-unit,.focus-paged .fx-extra{border-width:3px}
.focus-paged .fx-extra{margin:8px 0;padding:8px}
.focus-paged .fx-overview{margin:8px 0;padding:0;border:0}
.focus-paged .fx-overview>p{font-size:13px;margin:5px 0}
.focus-paged .fx-upcoming>summary{pointer-events:none;list-style:none;font-size:14px}
.focus-paged .fit-chapters select{font-family:inherit}
@media(max-width:600px){
 .focus-paged .fx-body{padding:8px 10px}
 .focus-paged .fx-bookhead h2{font-size:22px}
 .focus-paged .fx-yearbar{margin:7px 0}
 .focus-paged .fx-uhead .fx-ubar{display:none}
 .focus-paged .fx-go{font-size:14px;min-height:44px}
 .focus-paged .fx-headrow{padding:6px 10px}
}
#grades .gbtn{min-height:44px;min-width:44px}
@media(prefers-reduced-motion:reduce){#grades .gbtn{animation:none}}
.focus-paged .fx-overview>h4{font-size:18px;margin:6px 0 2px}
.focus-paged .fx-overview>p{font-size:12px;line-height:1.4;margin:2px 0 6px}
.focus-paged .fx-source-scope{font-size:12px;line-height:1.4;padding:6px 8px;margin:6px 0}
.focus-paged .fx-year-scope{margin:6px 0;font-size:12px}
