:root{--bg:#f5f3ec;--paper:#fffefa;--ink:#203e39;--muted:#657871;--green:#286858;--light:#e6eee3;--line:#d7dfd5;--warm:#e8bf74;--red:#a44337;--shadow:0 10px 40px #213f3610;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer}a{color:inherit;text-decoration:none}button:disabled{opacity:.5;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #c08b36;outline-offset:4px}button{border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:14px;padding:12px 16px;min-height:46px;font-weight:600}.primary{background:var(--green);color:white;border-color:var(--green)}.quiet{background:transparent;border-color:transparent}.danger{color:var(--red)}.top{display:flex;align-items:center;justify-content:space-between;max-width:1000px;margin:auto;padding:calc(18px + env(safe-area-inset-top)) 24px 18px}.brand{display:flex;gap:11px;align-items:center;font-size:11px;letter-spacing:.18em;font-weight:700}.brand small{display:block;letter-spacing:.02em;font-size:13px;font-weight:500;margin-top:3px}.seal{display:grid;place-items:center;background:var(--green);color:#fff;border-radius:13px;width:42px;height:46px;font-family:serif;font-size:30px;font-weight:400;letter-spacing:0}.connection{font-size:12px;color:var(--green);background:var(--light);padding:6px 10px;border-radius:30px}main{max-width:960px;margin:auto;padding:12px 24px calc(110px + env(safe-area-inset-bottom));min-height:75vh}h1,h2,h3,p{margin-top:0}h1,h2,.serif{font-family:Georgia,"Times New Roman",serif;font-weight:500;letter-spacing:-.035em}h1{font-size:clamp(34px,6vw,56px);line-height:1.1;margin-bottom:14px}h2{font-size:30px;line-height:1.15;margin-bottom:12px}h3{font-size:17px;line-height:1.4}.eyebrow{text-transform:uppercase;font-size:10px;letter-spacing:.19em;font-weight:750;color:var(--green);margin-bottom:12px}.muted{color:var(--muted);line-height:1.6;font-size:14px}.hero{position:relative;padding:22px 0 16px;max-width:650px}.hero p{max-width:420px}.stats{display:flex;gap:20px;font-size:12px;color:var(--muted);margin:24px 0}.stats strong{color:var(--ink);font-weight:700}.resume{background:var(--green);color:white;border-radius:22px;padding:21px 24px;display:flex;align-items:center;justify-content:space-between;gap:20px;margin:10px 0 28px;box-shadow:var(--shadow)}.resume .eyebrow{color:#c6d9c7}.resume p{margin:6px 0 0;color:#e1ece2;font-size:13px}.resume b{font-family:Georgia,serif;font-size:24px;font-weight:400}.resume .arrow{font-size:25px}.tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:5px;border:1px solid var(--line);border-radius:17px;margin:12px 0 16px}.tabs button{border:none;background:transparent;border-radius:11px;padding:11px 4px;min-height:43px;font-size:13px;white-space:nowrap}.tabs button.active{background:var(--paper);box-shadow:0 2px 7px #203e3912;color:var(--green)}.search{position:relative;margin:0 0 24px}.search input{width:100%;background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:14px 42px 14px 16px;color:var(--ink);font-size:16px}.search button{position:absolute;right:3px;top:3px;padding:5px 10px;min-height:42px;border:0;background:transparent}.section-head{display:flex;justify-content:space-between;gap:12px;align-items:baseline;margin:18px 0 12px}.section-head h2{font-size:23px;margin:0}.section-head span{font-size:12px;color:var(--muted)}.lesson-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.lesson{background:var(--paper);border:1px solid var(--line);border-radius:19px;overflow:hidden;box-shadow:0 3px 10px #203e3903}.lesson-link{display:block;padding:19px 19px 12px;min-height:127px}.lesson .meta{display:flex;gap:8px;justify-content:space-between;align-items:center;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}.lesson h3{margin-bottom:7px;font-family:Georgia,serif;font-size:21px;font-weight:500;letter-spacing:-.02em}.lesson .description{font-size:12px;color:var(--muted);margin:0}.lesson-foot{display:flex;align-items:center;justify-content:space-between;padding:0 12px 12px 19px;gap:12px}.progress-info{font-size:11px;color:var(--muted);flex:1}.track{height:3px;border-radius:10px;background:#e9ede5;margin-top:8px;overflow:hidden}.track>i{display:block;height:100%;background:var(--green)}.download{font-size:12px;white-space:nowrap;min-height:38px;padding:8px 10px;border-radius:10px}.download.saved{background:var(--light);border-color:transparent;color:var(--green)}.credit{text-align:center;color:var(--muted);font-size:11px;line-height:1.7;margin:30px auto 0;max-width:570px}.bottom{position:fixed;bottom:0;left:0;right:0;z-index:5;background:#fffefaf2;backdrop-filter:blur(15px);border-top:1px solid var(--line);display:flex;justify-content:center;gap:clamp(28px,12vw,130px);padding:10px 20px calc(10px + env(safe-area-inset-bottom))}.bottom a{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10px;position:relative;min-width:60px;color:var(--muted);padding:3px 10px}.bottom a>span{font-size:24px;line-height:1}.bottom a.active{color:var(--green);font-weight:700}.bottom i{position:absolute;top:0;right:0;border-radius:30px;background:var(--green);color:white;font-style:normal;font-size:9px;padding:2px 5px}.page-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0 0 16px}.backlink{font-size:13px;padding:10px 0;min-height:40px;display:inline-flex;align-items:center}.set-heading{margin-bottom:20px}.set-heading h1{font-size:clamp(27px,5vw,40px);margin-bottom:7px}.set-heading p{margin-bottom:0}.study{max-width:650px;margin:auto}.study-tools{display:flex;justify-content:space-between;gap:14px;align-items:center;margin:12px 0;color:var(--muted);font-size:12px}.study-tools select{background:var(--paper);border:1px solid var(--line);border-radius:10px;max-width:160px;padding:9px;font-size:16px;color:var(--ink)}.flashcard{background:var(--paper);border:1px solid var(--line);border-radius:26px;padding:22px 24px 26px;box-shadow:var(--shadow);min-height:350px;position:relative;outline-offset:3px}.card-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.card-top .eyebrow{margin:0;font-size:9px}.speed{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted)}.speed select{font-size:14px;padding:7px;border:1px solid var(--line);border-radius:9px;background:var(--paper);color:var(--ink)}.card-front{text-align:center;display:flex;align-items:center;flex-direction:column;justify-content:center;min-height:260px}.cue{font-size:47px;background:#eef1e5;border-radius:20px;width:104px;min-height:88px;display:grid;place-items:center;margin:0 auto 17px}.audio-btn{font-size:12px;padding:9px 12px;min-height:38px;border-radius:11px}.hanzi{font-family:"Kaiti SC","STKaiti","KaiTi","Noto Serif SC",serif;font-size:clamp(48px,10vw,76px);font-weight:400;line-height:1.4;overflow-wrap:anywhere;margin:17px 0 10px;max-width:100%}.hint{font-size:12px;color:var(--muted);line-height:1.5;margin:0}.card-back .word-head{text-align:center}.card-back .hanzi{font-size:43px;margin:10px 0 3px}.pinyin{font-size:20px;color:var(--green);line-height:1.5;margin:3px 0 9px}.meaning{font-size:17px;line-height:1.5;margin-bottom:8px}.note{font-size:11px;color:var(--muted);line-height:1.5}.example{border-top:1px solid var(--line);padding-top:17px;margin-top:18px}.example .zh{font-size:23px;line-height:1.7;margin:10px 0 5px}.example .py{font-size:13px;color:var(--green);line-height:1.6;margin-bottom:5px}.example .en{font-size:14px;color:var(--muted);line-height:1.6;margin:0}.card-status{font-size:11px;color:var(--green);min-height:16px;display:block;text-align:center;margin-top:8px}.card-controls{display:grid;grid-template-columns:1fr 1.4fr 1fr;gap:10px;margin:14px 0 10px}.mark-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px}.mark-controls button.selected{background:var(--light);border-color:var(--green)}.study-hint{text-align:center;font-size:11px;color:var(--muted);margin:13px 0 23px}.quiz-callout{border-radius:20px;background:#e8ede2;padding:22px;margin-top:24px;display:flex;align-items:center;justify-content:space-between;gap:20px}.quiz-callout h2{font-size:24px;margin-bottom:5px}.quiz-callout p{margin:0;font-size:12px;color:var(--muted)}.quiz-callout button{white-space:nowrap}.panel{border:1px solid var(--line);border-radius:20px;background:var(--paper);padding:24px;margin:18px 0}.panel p:last-child{margin-bottom:0}.actions{display:flex;flex-wrap:wrap;gap:9px}.quiz-word{text-align:center;font-family:"Kaiti SC","STKaiti",serif;font-size:56px;line-height:1.5;overflow-wrap:anywhere;margin:25px 0}.quiz-context{text-align:center;font-size:20px;line-height:1.6}.choices{display:grid;gap:10px}.choice{display:flex;gap:13px;text-align:left;align-items:center;padding:16px 18px;line-height:1.5;font-weight:500;font-size:15px}.choice .letter{font-size:11px;color:var(--muted);background:var(--bg);width:26px;height:26px;display:grid;place-items:center;border-radius:8px;flex-shrink:0}.choice.correct{background:var(--light);border-color:var(--green)}.choice.wrong{background:#faece8;border-color:var(--red)}.choice:disabled{opacity:1;cursor:default}.feedback{margin-top:18px;padding:18px 20px;background:var(--bg);border-radius:16px}.feedback .pinyin{font-size:19px}.feedback .audio-btn{margin-bottom:10px}.feedback .muted{font-size:13px}.quiz-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px}.score{font-family:Georgia,serif;font-size:64px;color:var(--green);margin:20px 0}.review-item{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:17px 0;border-bottom:1px solid var(--line)}.review-item:last-child{border:0}.review-item h3{margin-bottom:3px}.review-item p{margin:0;font-size:12px;color:var(--muted)}.empty{text-align:center;padding:35px 20px}.empty .symbol{font-size:40px;display:block;margin-bottom:15px}.settings-row{display:flex;gap:16px;justify-content:space-between;align-items:center;margin:18px 0}.settings-row select{font-size:16px;border:1px solid var(--line);border-radius:10px;padding:10px;max-width:180px;background:var(--paper);color:var(--ink)}.small{font-size:12px}.settings-row p{margin:3px 0 0;color:var(--muted);font-size:12px;line-height:1.5}.settings-row label{font-size:15px;font-weight:600}.settings-row input[type=checkbox]{accent-color:var(--green);width:22px;height:22px}.settings-note{font-size:12px;line-height:1.6;color:var(--muted)}.loading{padding:70px 24px;text-align:center;color:var(--muted)}.error{border:1px solid #e4b6a7;background:#fff7ed;padding:20px;border-radius:18px;line-height:1.6}.badge{font-size:10px;letter-spacing:0;text-transform:none;color:var(--green);background:var(--light);padding:4px 7px;border-radius:20px;white-space:nowrap}#toast{position:fixed;bottom:calc(95px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);background:var(--ink);color:white;border-radius:13px;padding:13px 20px;font-size:13px;max-width:90vw;width:max-content;z-index:20;box-shadow:var(--shadow);display:none}#toast.show{display:block}dialog{max-width:480px;width:calc(100% - 36px);max-height:80dvh;overflow:auto;border:1px solid var(--line);border-radius:24px;padding:30px;background:var(--paper);color:var(--ink);box-shadow:var(--shadow)}dialog::backdrop{background:#142b265c;backdrop-filter:blur(4px)}dialog .close{float:right;font-size:23px;line-height:1;border:0;background:transparent;padding:0;min-height:30px;width:30px}dialog h2{font-size:30px;margin:12px 0}dialog p,dialog li{font-size:14px;line-height:1.7;color:var(--muted)}dialog ol{padding-left:22px}.file-input{display:none}.logo-large{font-family:serif;font-size:50px;color:var(--green);margin-bottom:12px}html{scroll-behavior:smooth}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}@media(max-width:560px){.top{padding-left:20px;padding-right:20px}main{padding-left:18px;padding-right:18px}.hero{padding-top:16px}.hero p{font-size:13px}.stats{gap:14px}.lesson-grid{grid-template-columns:1fr}.lesson-link{min-height:auto;padding-top:17px}.lesson h3{font-size:22px}.resume{padding:20px}.resume b{font-size:22px}.set-heading h1{font-size:29px}.flashcard{padding:18px 19px 20px;border-radius:23px}.card-controls{gap:7px}.card-controls button,.mark-controls button{padding:11px 6px;font-size:12px}.card-top{margin-bottom:14px}.card-front{min-height:255px}.hanzi{font-size:clamp(47px,13vw,67px)}.quiz-callout{padding:20px;gap:12px}.quiz-callout h2{font-size:22px}.quiz-callout button{font-size:12px;padding:10px}.panel{padding:21px}.quiz-word{font-size:49px}.settings-row select{max-width:150px}.choice{padding:14px}.example .zh{font-size:22px}}
/* Focused study: controls stay within the visible screen. */
.pinyin,.example .py{font-weight:750}.meaning,.example .en{font-weight:700;color:#24483f}.example .py{color:#24604f}.page-actions{display:flex;align-items:center;gap:4px}.compact{padding:8px 10px;min-height:38px;font-size:12px}.word-note{font-size:11px;color:var(--muted);margin:6px 0}.word-note summary{cursor:pointer;list-style:none;text-decoration:underline;text-underline-offset:3px}.word-note p{margin:7px 0 0}.audio-btn[aria-busy]{color:var(--green);background:var(--light)}
body[data-screen=study] .top{height:calc(58px + env(safe-area-inset-top));padding:calc(5px + env(safe-area-inset-top)) 20px 5px}
body[data-screen=study] .seal{height:34px;width:32px;font-size:25px;border-radius:10px}body[data-screen=study] .brand{gap:9px;font-size:10px}body[data-screen=study] .brand small{font-size:11px}
body[data-screen=study] main{height:calc(100dvh - 58px - env(safe-area-inset-top) - 69px - env(safe-area-inset-bottom));padding:0 18px;overflow:hidden}
body[data-screen=study] .study{height:100%;display:flex;flex-direction:column;padding-bottom:127px}
body[data-screen=study] .page-bar{margin-bottom:3px;flex-shrink:0}body[data-screen=study] .set-heading{margin-bottom:3px;flex-shrink:0}body[data-screen=study] .set-heading .eyebrow{font-size:9px;margin:2px 0 5px}
body[data-screen=study] .set-heading h1{font-size:22px;line-height:1.15;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-screen=study] .study-tools{margin:7px 0 9px;flex-shrink:0}body[data-screen=study] .study-tools select{padding:6px 9px;font-size:14px}
body[data-screen=study] .flashcard{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:13px 17px 15px;border-radius:21px;-webkit-overflow-scrolling:touch}
body[data-screen=study] .card-top{margin-bottom:9px}body[data-screen=study] .card-front{min-height:210px;height:calc(100% - 43px)}body[data-screen=study] .cue{width:84px;min-height:64px;font-size:39px;margin-bottom:11px;border-radius:16px}
body[data-screen=study] .card-front .hanzi{font-size:clamp(44px,11vw,63px);line-height:1.25;margin:13px 0 8px}
body[data-screen=study] .card-back .hanzi{font-size:37px;line-height:1.25;margin:7px 0 2px}body[data-screen=study] .pinyin{font-size:20px;margin:2px 0 6px}body[data-screen=study] .meaning{font-size:16px;line-height:1.4;margin-bottom:3px}
body[data-screen=study] .example{padding-top:12px;margin-top:12px}body[data-screen=study] .example .zh{font-size:21px;line-height:1.5;margin:8px 0 4px}body[data-screen=study] .example .py{font-size:14px;line-height:1.5;margin:0 0 5px}body[data-screen=study] .example .en{font-size:14px;line-height:1.45}
.study-dock{position:fixed;z-index:4;left:50%;transform:translateX(-50%);bottom:calc(69px + env(safe-area-inset-bottom));width:calc(100% - 36px);max-width:650px;background:var(--bg);padding:8px 0 3px}
.study-dock .card-controls{margin:0 0 7px;gap:8px}.study-dock .mark-controls{gap:8px}.study-dock button{min-height:43px;padding:10px 5px;font-size:12px}.study-dock .study-hint{margin:7px 0 0;font-size:10px;line-height:1.4}
body[data-screen=study] .card-status{font-size:10px;margin-top:4px;min-height:13px}
@media(max-height:720px){body[data-screen=study] .set-heading h1{font-size:19px;-webkit-line-clamp:1}body[data-screen=study] .top{height:calc(50px + env(safe-area-inset-top))}body[data-screen=study] main{height:calc(100dvh - 50px - env(safe-area-inset-top) - 69px - env(safe-area-inset-bottom))}body[data-screen=study] .card-front{min-height:175px}body[data-screen=study] .cue{min-height:47px;width:64px;font-size:30px;margin-bottom:8px}body[data-screen=study] .card-front .hanzi{font-size:43px;margin:8px 0}body[data-screen=study] .card-top{margin-bottom:6px}}

.feedback>p{font-weight:700}
/* Study v4: lesson details are optional; examples and Quiz take priority. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body[data-screen=study] .top{display:none}
body[data-screen=study] main{height:calc(100dvh - 69px - env(safe-area-inset-bottom));padding:calc(5px + env(safe-area-inset-top)) 18px 0;overflow:hidden}
body[data-screen=study] .study{padding-bottom:157px}
.study-topline{display:grid;grid-template-columns:auto auto minmax(90px,1fr) auto;align-items:center;gap:9px;flex-shrink:0;min-height:43px;margin-bottom:7px}
.study-topline .backlink{font-size:12px;min-height:36px}.card-count{font-size:12px;color:var(--muted);white-space:nowrap}
.study-topline select{justify-self:end;width:100%;max-width:145px;padding:7px;border:1px solid var(--line);background:var(--paper);color:var(--ink);font-size:14px;border-radius:10px}
.info-button{border:0;background:transparent;font-size:22px;min-height:36px;width:30px;padding:0;font-weight:400;color:var(--green)}
body[data-screen=study] .flashcard{display:flex;flex-direction:column;overflow:hidden;padding:12px 17px}
body[data-screen=study] .card-top{flex-shrink:0;margin-bottom:8px}
body[data-screen=study] .card-front{flex:1;min-height:0;height:auto}
body[data-screen=study] .card-back{display:flex;flex-direction:column;flex:1;min-height:0}
.word-summary{flex:0 1 auto;min-height:36px;overflow-y:auto;overscroll-behavior:contain}
.word-line{display:flex;gap:15px;align-items:center}.word-line .audio-btn{flex-shrink:0}.word-label{min-width:0;flex:1;text-align:left}
body[data-screen=study] .word-line .hanzi{font-size:32px;line-height:1.25;margin:0 0 3px}
body[data-screen=study] .word-line .pinyin{font-size:18px;line-height:1.4;margin:0}
body[data-screen=study] .word-summary .meaning{font-size:15px;line-height:1.45;margin:9px 0 0;font-weight:700}
body[data-screen=study] .example{flex-shrink:0;padding-top:13px;margin-top:13px}
body[data-screen=study] .example .zh{font-size:23px;line-height:1.5;margin:9px 0 7px}
body[data-screen=study] .example .py{font-size:15px;line-height:1.5;margin-bottom:7px}
body[data-screen=study] .example .en{font-size:15px;line-height:1.5}
body[data-screen=study] .card-status{flex-shrink:0;min-height:13px;margin-top:5px}
.study-dock{padding:8px 0 5px}.quiz-dock-btn{width:100%;margin-top:7px;min-height:39px!important;padding:8px!important;font-size:13px!important}.quiz-dock-btn span{font-weight:400;opacity:.85}
@media(max-height:720px){body[data-screen=study] main{height:calc(100dvh - 69px - env(safe-area-inset-bottom))}body[data-screen=study] .word-line .hanzi{font-size:27px}body[data-screen=study] .word-line .pinyin{font-size:16px}body[data-screen=study] .word-summary .meaning{font-size:14px;line-height:1.4;margin-top:7px}body[data-screen=study] .example{padding-top:10px;margin-top:10px}body[data-screen=study] .example .zh{font-size:20px;line-height:1.4;margin:7px 0 5px}body[data-screen=study] .example .py,body[data-screen=study] .example .en{font-size:13px;line-height:1.4;margin-bottom:5px}body[data-screen=study] .audio-btn{min-height:34px;padding:7px 10px}body[data-screen=study] .card-top{margin-bottom:5px}}
/* Keep the study view focused; Library returns to the full navigation. */
body[data-screen=study] .bottom{display:none}
body[data-screen=study] main{height:calc(100dvh - env(safe-area-inset-bottom))}
body[data-screen=study] .study-dock{bottom:env(safe-area-inset-bottom)}
/* v7: larger learning text, a bundled Kai face, and thumb-friendly controls. */
@font-face{font-family:"Wen Study Kai";src:url("fonts/wen-study-kai.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
:root{--kai:"Wen Study Kai","Kaiti SC","STKaiti","KaiTi",serif}
.hanzi,.example .zh,.quiz-word,.quiz-context,[lang=zh-Hans],.seal,.logo-large{font-family:var(--kai);font-weight:400}
body[data-screen=study] .study{padding-bottom:143px}
body[data-screen=study] .flashcard{--card-scale:1;--word-size:48px;--py-size:27px;--meaning-size:23px;--example-size:31px;--reading-size:22px;--english-size:22px;padding:12px 17px;gap:0}
body[data-screen=study] .card-top{margin-bottom:6px;min-height:34px}
.card-content{flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
body[data-screen=study] .card-front,body[data-screen=study] .card-back{flex:0 0 auto;min-height:0;height:auto;width:100%;margin-block:auto}
body[data-screen=study] .card-front .cue{font-size:calc(54px * var(--card-scale));width:calc(100px * var(--card-scale));min-height:calc(84px * var(--card-scale));margin-bottom:calc(18px * var(--card-scale))}
body[data-screen=study] .card-front .hanzi{font-size:calc(clamp(76px,24vw,108px) * var(--card-scale));line-height:1.2;margin:calc(15px * var(--card-scale)) 0;max-width:100%}
body[data-screen=study] .card-front .hint{font-size:14px;max-width:285px;margin-inline:auto}
body[data-screen=study] .word-summary{flex:none;min-height:0;overflow:visible;text-align:center}
body[data-screen=study] .word-line{display:block}.word-label{text-align:center}
body[data-screen=study] .word-line .hanzi{font-size:max(28px,calc(var(--word-size) * var(--card-scale)));line-height:1.2;margin:0 0 4px}
body[data-screen=study] .word-line .pinyin{font-size:max(18px,calc(var(--py-size) * var(--card-scale)));line-height:1.3;margin:0;font-weight:750}
body[data-screen=study] .word-summary .meaning{font-size:max(15px,calc(var(--meaning-size) * var(--card-scale)));line-height:1.35;margin:8px 0 0;font-weight:700}
body[data-screen=study] .example{flex:none;padding-top:calc(16px * var(--card-scale));margin-top:calc(18px * var(--card-scale))}
body[data-screen=study] .example .zh{font-size:max(22px,calc(var(--example-size) * var(--card-scale)));line-height:1.4;margin:0 0 8px}
body[data-screen=study] .example .py{font-size:max(14px,calc(var(--reading-size) * var(--card-scale)));line-height:1.4;margin:0 0 8px;font-weight:750}
body[data-screen=study] .example .en{font-size:max(14px,calc(var(--english-size) * var(--card-scale)));line-height:1.4;margin:0;font-weight:700}
.card-audio{flex-shrink:0;padding-top:7px}.audio-actions{display:flex;justify-content:flex-end;gap:8px}
body[data-screen=study] .audio-btn{min-height:44px;padding:10px 12px;font-size:13px;white-space:nowrap}
body[data-screen=study] .card-audio .card-status{font-size:11px;min-height:14px;margin:0 0 3px;text-align:right}
.study-dock{padding:4px 0}.study-dock .card-controls{margin-bottom:5px}.study-dock button{min-height:42px;padding:8px 5px}.study-dock .quiz-dock-btn{min-height:36px!important;margin-top:5px;padding:7px!important}
body[data-screen=quiz] .top,body[data-screen=quiz] .bottom{display:none}
body[data-screen=quiz] main{height:calc(100dvh - env(safe-area-inset-bottom));min-height:0;padding:calc(5px + env(safe-area-inset-top)) 18px 8px;overflow:hidden}
.quiz-layout{--quiz-scale:1;height:100%;display:flex;flex-direction:column;min-height:0}
.quiz-topline{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;flex-shrink:0;min-height:44px;margin-bottom:3px}
.quiz-topline #leaveQuiz{padding:8px 0;min-height:40px;font-size:12px}.quiz-title{text-align:center;font-size:14px;font-weight:700}.quiz-topline .info-button{justify-self:end}
.quiz-stats{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-bottom:7px;flex-shrink:0}
.quiz-layout>.track{flex-shrink:0;margin:0 0 8px}
.quiz-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;scrollbar-width:thin}
.quiz-question{flex:0 0 auto;width:100%;margin-block:auto;padding:2px 0}
.quiz-question-label{font-size:12px;color:var(--muted);text-align:center;margin:0 0 3px}
.quiz-layout .quiz-word{font-size:calc(76px * var(--quiz-scale));line-height:1.2;margin:5px 0 15px}
.quiz-layout .quiz-context{font-size:calc(28px * var(--quiz-scale));line-height:1.4;margin:0 0 13px}
.quiz-layout .choices{gap:calc(9px * var(--quiz-scale))}
.quiz-layout .choice{font-size:max(14px,calc(21px * var(--quiz-scale)));line-height:1.35;padding:calc(13px * var(--quiz-scale)) calc(15px * var(--quiz-scale));min-height:44px;font-weight:600;gap:11px}
.quiz-layout .choice .letter{width:27px;height:27px;font-size:12px}
.quiz-dock{flex-shrink:0;padding-top:8px}
.quiz-feedback{min-height:66px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;background:var(--light);border-radius:14px;padding:9px 12px}
.quiz-feedback.is-wrong{background:#faece8}.feedback-label{font-size:12px;font-weight:700;color:var(--green);line-height:1.4}.is-wrong .feedback-label{color:var(--red)}
.quiz-feedback .pinyin{font-size:max(18px,calc(24px * var(--quiz-scale)));line-height:1.3;margin:3px 0 0;font-weight:750}
.quiz-feedback .audio-btn{min-height:44px;font-size:13px;padding:9px 11px}
.quiz-feedback.quiz-waiting{display:flex;justify-content:center;background:transparent}.quiz-waiting p{font-size:13px;color:var(--muted);margin:0}
.quiz-layout .quiz-footer{display:block;margin:8px 0 0}.quiz-footer #quizNext{width:100%;min-height:48px;font-size:16px}
@media(max-height:740px){body[data-screen=study] .flashcard{--word-size:41px;--py-size:24px;--meaning-size:20px;--example-size:27px;--reading-size:19px;--english-size:19px}body[data-screen=study] .card-front .cue{width:80px;min-height:64px;font-size:43px;margin-bottom:10px}.quiz-layout .quiz-word{font-size:calc(62px * var(--quiz-scale));margin-bottom:10px}.quiz-layout .choice{font-size:max(14px,calc(19px * var(--quiz-scale)));padding:calc(10px * var(--quiz-scale)) 12px}.quiz-feedback{min-height:60px;padding:7px 11px}}
@media(max-height:600px){body[data-screen=study] .flashcard{--word-size:36px;--py-size:21px;--meaning-size:18px;--example-size:24px;--reading-size:17px;--english-size:17px;padding:9px 14px}body[data-screen=study] .card-front .cue{width:64px;min-height:50px;font-size:35px;margin-bottom:7px}body[data-screen=study] .card-front .hint{font-size:12px}body[data-screen=study] .card-top{margin-bottom:3px;min-height:30px}body[data-screen=study] .card-audio .card-status{min-height:0;margin-bottom:2px}.quiz-layout .quiz-word{font-size:calc(52px * var(--quiz-scale));margin:2px 0 8px}.quiz-topline{min-height:38px}.quiz-layout .quiz-context{font-size:calc(23px * var(--quiz-scale));margin-bottom:8px}.quiz-feedback{min-height:57px}.quiz-dock{padding-top:6px}.quiz-layout .quiz-footer{margin-top:5px}}
.pinyin,.example .py,.meaning,.example .en,.choice>span:last-child{overflow-wrap:anywhere}
/* Compact spacing protects the full answer on unusually long, short-screen cards. */
body[data-screen=study] .dense-card .word-line .hanzi{line-height:1.1;margin-bottom:2px}
body[data-screen=study] .dense-card .word-line .pinyin{line-height:1.2}
body[data-screen=study] .dense-card .word-summary .meaning{line-height:1.2;margin-top:4px}
body[data-screen=study] .dense-card .example{padding-top:6px;margin-top:7px}
body[data-screen=study] .dense-card .example .zh,body[data-screen=study] .dense-card .example .py,body[data-screen=study] .dense-card .example .en{line-height:1.25;margin-bottom:4px}
.quiz-target{background:#e8bf7438;color:inherit;text-decoration:underline;text-decoration-color:var(--green);text-underline-offset:.15em;border-radius:3px;padding:0 2px}
