.generated-control-icon{width:28px;height:28px;display:block;object-fit:contain;flex:none}.icon-button>.generated-control-icon,.pinyin-hint>.generated-control-icon{width:28px;height:28px}.local-pinyin-button{width:32px;height:32px;min-height:32px;padding:2px!important;border:0!important;border-radius:10px!important;background:#fff9e9!important;box-shadow:none!important;display:inline-grid;place-items:center;flex:none}.local-pinyin-button .generated-control-icon{width:27px;height:27px}.local-pinyin-button[aria-pressed=true]{background:#ffefb5!important}.local-reading.local-reading rt,.hide-pinyin .local-reading rt{display:block!important;visibility:hidden!important}.local-reading.local-reading .py{visibility:hidden!important}.local-reading.local-reading.local-show-pinyin rt,.local-reading.local-reading.local-show-pinyin .py,.hide-pinyin .local-reading.local-reading.local-show-pinyin rt{visibility:visible!important}.word-card{position:relative}.word-card>.local-pinyin-button{position:absolute;left:5px;top:5px;z-index:2}.sentence-top{display:flex;justify-content:flex-end;align-items:center;gap:6px}.open-character{position:relative}.open-character>.local-pinyin-button{position:absolute;right:calc(50% - 88px);top:10px}.detail-title>.local-pinyin-button{vertical-align:middle;margin-left:12px}.flash-tools{display:flex;gap:5px}.settings-page-tabs{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:6px 0 12px}.settings-page-tabs button{min-height:34px;border-radius:11px;font-size:13px;border:1px solid #dce7ed;background:white;color:#31546c}.settings-page-tabs [aria-pressed=true]{background:#e8f7f1;border-color:#96cbbd}.settings-pane{display:flex;flex-direction:column;gap:9px}.settings-pane[hidden]{display:none!important}.compact-language-label{font-size:13px;font-weight:650;margin:3px 0}.compact-settings dialog,#preferencesDialog,#topicPreferences{overflow:hidden!important;max-height:calc(100dvh - 20px)}#preferencesDialog .page-language,#preferencesDialog #pageLanguageLabel,#preferencesDialog .languages{display:none!important}#preferencesDialog .learning-tools{display:block}#preferencesDialog #topicsLink,#preferencesDialog #pinyinToggle,#preferencesDialog #parents,#topicPreferences #pinyin{display:none!important}#preferencesDialog .helper-control,#preferencesDialog #helperControl{display:block}#preferencesDialog .helper-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:5px 0}#preferencesDialog .scope-panel{display:flex;flex-direction:column;gap:7px}#preferencesDialog .scope-panel>*{margin-top:0!important;margin-bottom:0!important}#preferencesDialog #timerBar{font-size:11px;padding:5px;min-height:0}#preferencesDialog .lp-panel,#topicPreferences .lp-panel{margin-top:0}.lp-panel h3{margin-bottom:6px}.lp-channels>div{padding:5px 8px}#topicPreferences nav,#topicPreferences #menuLanguageLabel,#topicPreferences .topic-setting-label:has(#menuLanguageLabel){display:none!important}.topic-hanzi-return{display:flex;align-items:center;justify-content:center;min-height:34px;padding:3px 8px;font-size:13px;white-space:nowrap;color:#31546c;background:#f1f7fc;border-radius:10px}header:has(.topic-hanzi-return) #schoolLink strong{display:none!important}header:has(.topic-hanzi-return){gap:8px}.topic-card:active,.catalogue-card:active{transform:translateY(2px)}.flashcard.flipped{border-color:#b4d7cb}.local-reading.local-show-pinyin .word-reading{animation:reading-nudge .12s ease-out}@keyframes reading-nudge{from{transform:translateY(3px)}to{transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.local-reading.local-show-pinyin .word-reading{animation:none}}

.review-character>.open-character{display:block!important;position:relative;height:auto!important;min-height:165px;margin:12px 0 22px!important;text-align:center;padding:0!important}.hero-reading{display:flex;justify-content:center;align-items:center;width:100%;min-height:160px}.open-character>.lp-read{position:absolute;left:calc(50% + 72px);top:68px;max-width:100px;white-space:normal}.open-character>.local-pinyin-button{right:calc(50% - 104px);top:24px}@media(max-width:600px){.review-character>.open-character{min-height:150px;margin:8px 0 16px!important}.hero-reading{min-height:145px}.open-character>.lp-read{left:calc(50% + 58px);top:68px;max-width:94px}.open-character>.local-pinyin-button{right:calc(50% - 90px);top:25px}}

.detail-title{position:relative;display:block!important;min-height:165px}.detail-title>.local-pinyin-button{position:absolute;left:calc(50% + 66px);top:25px;margin:0}.detail-title>.lp-read{position:absolute;left:calc(50% + 66px);top:68px;max-width:100px;white-space:normal}@media(max-width:600px){.detail-title{min-height:150px}.detail-title>.local-pinyin-button,.detail-title>.lp-read{left:calc(50% + 58px);max-width:94px}}
@media(max-height:500px) and (min-width:500px){#preferencesDialog,#topicPreferences{width:min(600px,96vw)!important;padding:10px 14px!important;max-height:calc(100dvh - 12px)!important}#preferencesDialog .dialog-top{min-height:32px;margin:0}#preferencesDialog .dialog-top h2,#topicPreferences h2{font-size:18px;margin:0}#preferencesDialog .dialog-top button,#topicPreferences .topic-settings-close{width:30px;min-height:30px;height:30px;padding:2px}.settings-page-tabs{margin:4px 0 7px;gap:6px}.settings-page-tabs button{min-height:27px;padding:3px}#compactPractice.settings-pane:not([hidden]){display:grid!important;grid-template-columns:1fr 1.2fr;gap:5px 16px;align-items:start}#compactPractice .compact-language-label{grid-column:1;grid-row:1;margin:0}#compactPractice .learning-tools{grid-column:1;grid-row:2}#compactPractice #timerBar{grid-column:1;grid-row:3;flex-wrap:wrap}#compactPractice .time-visibility{grid-column:1;grid-row:4;font-size:11px;gap:4px}#compactPractice .scope-panel{grid-column:2;grid-row:1 / span 4;gap:4px}#preferencesDialog .scope-panel button{min-height:28px;padding:3px 5px;font-size:11px}#preferencesDialog .scope-panel .setting-icon{width:20px;height:20px}#preferencesDialog .scope-panel .duration-control{min-height:32px}#preferencesDialog .scope-panel input{height:30px;min-height:30px}#compactRecords.settings-pane:not([hidden]){display:grid!important;grid-template-columns:1.5fr 1fr;gap:5px 14px}#compactRecords>div:first-child{grid-column:1;grid-row:1 /span 3}#compactRecords>button{grid-column:2;min-height:32px}#topicPreferences[open]{display:grid;grid-template-columns:1fr 1fr;gap:4px 16px}#topicPreferences .topic-settings-heading{grid-column:1 /-1;margin:0;min-height:32px}#topicPreferences .tools{grid-column:1;grid-row:2 /span 3;margin:0}#topicPreferences #roundCountLabel{grid-column:2;grid-row:2;margin:0;font-size:12px}#topicPreferences .round-counts{grid-column:2;grid-row:3;margin:0}#topicPreferences #topicPointsPanel{grid-column:2;grid-row:4}#topicPreferences .lp-panel{padding:7px}#topicPreferences .lp-channels{gap:4px}#topicPreferences .lp-panel h3{font-size:13px;margin:0 0 4px}#topicPreferences .lp-panel small{font-size:9px}#topicPreferences .lp-channels>div{padding:3px 6px}#topicPreferences .round-counts button{min-height:28px;padding:3px}#preferencesDialog .helper-choice,#topicPreferences .helper-chips button{min-height:30px;padding:4px!important;font-size:11px}}
/* One page-wide switch. Hidden readings reserve their space to avoid layout jumps. */
.global-pinyin-button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:38px;min-width:38px;height:38px;min-height:38px;padding:4px;border:1px solid #e8dfc7;border-radius:12px;background:#fff9e9;box-shadow:none}.global-pinyin-button[aria-pressed=true]{background:#ffedab;border-color:#dbc16a}.global-pinyin-button img{width:29px;height:29px}.app-header>#globalPinyin{order:2}.app-header>#openPreferences{order:3}.practice-top>#globalPinyin{margin-left:auto;order:4}.practice-top>#practicePreferences{order:5}body rt{display:block!important;visibility:hidden!important}body.all-pinyin rt{visibility:visible!important}body.all-pinyin #flashcard:not(.flipped) .flash-answer rt{visibility:hidden!important}
#detail .word-reading,#reviewView .word-reading,#questionBody .word-reading,.chinese-line ruby{display:inline-flex!important;flex-direction:column-reverse!important;align-items:center!important;justify-content:center;vertical-align:bottom;position:static!important;width:max-content;max-width:100%;gap:3px}#detail .word-reading>rt,#reviewView .word-reading>rt,#questionBody .word-reading>rt,.chinese-line ruby>rt{position:static!important;align-self:stretch;text-align:center!important;min-height:1.55em;line-height:1.55!important;margin:0!important;padding:0!important;width:100%;white-space:nowrap}#detail .word-reading>.word-hanzi,#reviewView .word-reading>.word-hanzi,#questionBody .word-reading>.word-hanzi{display:inline-flex;justify-content:center;align-items:center}.word-pinyin{display:flex;align-items:center;justify-content:center;width:100%;margin:0;padding:0!important;min-height:0!important}.detail-title>.hero-reading,.hero-reading{min-height:150px}.lp-read,.local-pinyin-button{display:none!important}.flash-tools{justify-content:flex-end}.word-card .word-photo img{object-fit:contain}.app-header{gap:7px}.topic-hanzi-return{padding:3px 6px}header:has(.topic-hanzi-return){gap:6px}header:has(.topic-hanzi-return) #globalPinyin{margin-left:auto}@media(max-width:600px){.global-pinyin-button{width:33px;min-width:33px;height:33px;min-height:33px;padding:3px}.global-pinyin-button img{width:26px;height:26px}.app-header>#schoolLink{font-size:9px!important}.app-header .brand strong{font-size:15px!important}.practice-top{gap:7px}.practice-top>#globalPinyin{margin-left:0}.hero-reading{min-height:145px}}
#detail .word-reading>.word-hanzi,#reviewView .word-reading>.word-hanzi,#questionBody .word-reading>.word-hanzi{width:100%}#detail .word-hanzi>.char-sound,#reviewView .word-hanzi>.char-sound,#questionBody .word-hanzi>.char-sound{flex:1 1 0;min-width:0;text-align:center}.word-pinyin>span{display:block;flex:1 1 0;min-width:0;text-align:center;white-space:nowrap}
