/* Shared framing for the three learning areas. Keep their teaching engines independent. */
body[data-learning-area=topics]>.practice-shell-header,
body[data-learning-area=characters][data-view=home]>.practice-shell-header{display:flex;align-items:center;width:100%;max-width:1080px;min-height:62px;padding:12px 24px;margin:0 auto;border:0;gap:7px;box-sizing:border-box;flex:none}
.practice-shell-header .brand{display:flex;align-items:center;gap:9px;color:#29445b;min-width:0;text-decoration:none}
.practice-shell-header .brand>img{width:38px;height:38px;flex:none}
.practice-shell-header .brand>span{display:flex;flex-direction:column;gap:2px;min-width:0}
.practice-shell-header .brand strong{font:800 18px/1.2 system-ui,sans-serif;color:#29445b}
.practice-shell-header .brand small{font:10px/1.2 system-ui,sans-serif;color:#758799}
.practice-shell-header>#schoolLink{margin-left:auto;font-size:12px;white-space:nowrap;order:1;color:#617d91}
.practice-shell-header>#globalPinyin{order:2;margin-left:0!important}
.practice-shell-header>#topicSettingsOpen,.practice-shell-header>#openPreferences{order:3;display:grid;place-items:center;min-height:38px;height:38px;width:40px;padding:4px;border:2px solid #e4eaf0;border-bottom-width:4px;border-radius:13px;background:#fff;box-shadow:none;flex:none}
.practice-shell-header>#topicSettingsOpen img{width:27px;height:27px;object-fit:contain}
body[data-learning-area=topics] main{max-width:1080px;width:100%;padding:0 24px;margin:0 auto;box-sizing:border-box}
body[data-learning-area=topics] #home{padding:10px 0 8px;gap:14px}
body[data-learning-area=topics] .home-title{position:relative;min-height:90px;padding:18px 24px;margin:0;border:0;border-radius:22px;background:#eff8ff;display:flex;align-items:center;gap:12px;box-sizing:border-box;flex:none}
body[data-learning-area=topics] .home-title>div{min-width:0}
body[data-learning-area=topics] .home-title h1{font-size:28px;line-height:1.25;color:#29445b;font-weight:850;margin:0 0 7px}
body[data-learning-area=topics] .home-title p{font-size:13px;line-height:1.3;color:#6b88a0;margin:0;padding:0}
body[data-learning-area=topics] .home-title>.lp-badge{margin-left:auto;flex:none}
body[data-learning-area=topics] .random-topic-button{flex:none}
.practice-switcher-wrap{flex:none;width:100%;margin:0 auto}
.practice-switcher{display:flex;gap:8px;max-width:660px;width:100%;margin:0 auto;align-items:stretch}
.practice-switcher>a{display:flex;align-items:center;justify-content:center;flex:1;min-width:0;min-height:36px;padding:8px 10px;border:2px solid #e5ecf2;border-bottom-width:4px;border-radius:13px;background:#fff;color:#81909e;text-decoration:none;font-size:12px;font-weight:750;line-height:1.2;text-align:center;box-sizing:border-box}
.practice-switcher>a[aria-current=page]{border-color:#8dcbd6;background:#eaf8fa;color:#227f91}
.practice-switcher>a:hover{background:#f4f9fc}
.practice-switcher>a:focus-visible{outline:3px solid #29a888;outline-offset:2px}
#topicSwitchExtras:has(a:not([hidden])){max-width:660px;margin:4px auto 0;font-size:11px}
#topicSwitchExtras a{color:#527e9b;padding:2px 0}
body[data-learning-area=topics] #topics[data-layout=categories]{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));max-width:840px;max-height:430px;margin:auto;width:100%;gap:7px 24px;padding:4px 8px 8px;box-sizing:border-box}
body[data-learning-area=topics] .category-card{position:relative;padding:5px!important;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:18px;gap:7px;min-height:0;justify-content:center}
body[data-learning-area=topics] .category-card .level-art{width:94px;height:80px;flex:none;display:grid;place-items:center}
body[data-learning-area=topics] .category-card .level-art img{width:100%;height:100%;max-width:none;object-fit:contain}
body[data-learning-area=topics] .category-card .level-number{position:absolute;left:calc(50% - 58px);top:8px;font-size:9px;line-height:1.2;padding:2px 4px;color:#81909e;background:#fff;border:1px solid #e5ecf2;border-radius:6px}
body[data-learning-area=topics] .category-card strong{font-size:15px;line-height:1.3;font-weight:800;color:#526c82;text-align:center}
body[data-learning-area=topics] .category-card small{font-size:10px;color:#758799}
body[data-learning-area=topics] #lesson>.practice-switcher-wrap{margin:8px 0 4px}
body[data-learning-area=topics] #finish>.practice-switcher-wrap{align-self:stretch;width:100%;max-width:none;margin-bottom:8px}
body[data-learning-area=topics] .lesson-heading>.lp-badge{flex:none;margin-left:auto}
@media(max-width:800px){body[data-learning-area=topics]>.practice-shell-header,body[data-learning-area=characters][data-view=home]>.practice-shell-header{padding:9px 15px;min-height:52px}.practice-shell-header .brand strong{font-size:16px}.practice-shell-header .brand small{display:none}.practice-shell-header>#schoolLink{font-size:10px}body[data-learning-area=topics] main{padding:0 15px}body[data-learning-area=topics] #home{padding:5px 0 0;gap:11px}body[data-learning-area=topics] .home-title{min-height:80px;padding:14px 17px;border-radius:18px;gap:8px}body[data-learning-area=topics] .home-title h1{font-size:22px}body[data-learning-area=topics] .home-title p{font-size:11px}body[data-learning-area=topics] #topics[data-layout=categories]{max-width:600px;gap:8px 5px;padding:6px 3px 8px}.practice-switcher{gap:6px}.practice-switcher>a{min-height:35px;font-size:12px;padding:7px 8px}body[data-learning-area=topics] .category-card .level-art{width:70px;height:63px}body[data-learning-area=topics] .category-card strong{font-size:12px}body[data-learning-area=topics] .category-card .level-number{left:calc(50% - 43px);top:1px;font-size:8px}}
@media(max-width:600px){body[data-learning-area=topics] .category-card .level-art img{width:100%;height:100%}body[data-learning-area=topics] #topics[data-layout=categories]{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}body[data-learning-area=topics] .category-card strong{font-size:11px}.practice-switcher>a{font-size:11px;padding:7px 4px}}
@media(max-width:800px) and (max-height:700px){body[data-learning-area=topics] #home{gap:7px}body[data-learning-area=topics] .home-title{min-height:66px;padding:11px 14px}body[data-learning-area=topics] .home-title h1{font-size:20px;margin-bottom:5px}body[data-learning-area=topics] .home-title p{font-size:10px}body[data-learning-area=topics] .category-card .level-art{width:64px;height:55px}}
@media(max-height:500px) and (min-width:500px){body[data-learning-area=topics]>.practice-shell-header{min-height:40px;padding:4px 12px}body[data-learning-area=topics] #home{gap:5px;padding:0}body[data-learning-area=topics] .home-title{min-height:44px;height:44px;padding:7px 16px}body[data-learning-area=topics] .home-title h1{font-size:20px;margin:0}body[data-learning-area=topics] .home-title p{display:none}.practice-switcher>a{min-height:30px;padding:4px;font-size:11px}body[data-learning-area=topics] .category-card .level-art{width:53px;height:47px}body[data-learning-area=topics] .category-card{gap:2px}body[data-learning-area=topics] .category-card strong{font-size:11px}body[data-learning-area=topics] .category-card small{display:none}body[data-learning-area=topics] #lesson>.practice-switcher-wrap{margin:3px 0}body[data-learning-area=topics] .lesson-heading>.lp-badge{font-size:10px;padding:3px}}
