/* ATOM · Editorial edition. Shared palette for the complete learning experience. */
:root {
  color-scheme:dark;
  --paper:#171918; --card:#202321; --card-raised:#272a26;
  --ink:#f1ecdf; --muted:#b4b4a8; --gold:#d4b77b; --gold-bright:#e5cc98;
  --border:#3d4038; --gold-line:#766647; --success:#a7c8af; --error:#efb0a0;
  --shadow:0 18px 56px #00000024;
  --serif:Georgia,'Times New Roman','Songti SC','STSong','Noto Serif CJK SC',serif;
  font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif;
  color:var(--ink); background:var(--paper); font-synthesis:none;
}
* { box-sizing:border-box; }
body { margin:0; min-width:280px; }
button,input { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.5; }
button:focus-visible,input:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--gold-bright); outline-offset:5px; }
::selection { background:var(--gold); color:var(--paper); }
a { color:var(--gold); }
.app-shell { min-height:100vh; }
.topbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:22px clamp(20px,3vw,48px); border-bottom:1px solid var(--border); }
.brand { display:inline-flex; align-items:center; flex:none; text-decoration:none; }
.brand img { display:block; width:146px; height:44px; object-fit:contain; }
.topbar-tools { display:flex; flex:1 1 0; min-width:0; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:10px; }
.topbar-label,.progress-caption { display:block; color:var(--muted); font-size:10px; white-space:nowrap; }
.test-entry,.all-words-entry { min-height:44px; padding:10px 13px; border:1px solid var(--border); border-radius:4px; background:transparent; color:var(--ink); font-size:12px; font-weight:600; white-space:nowrap; }
.test-entry:hover,.all-words-entry:hover { border-color:var(--gold-line); background:var(--card-raised); }
.test-entry.active { background:var(--gold); border-color:var(--gold); color:var(--paper); }
.demo-account { display:flex; align-items:center; gap:7px; min-height:44px; padding:5px 8px; border:1px solid transparent; border-radius:4px; background:transparent; color:var(--muted); font-size:11px; white-space:nowrap; }
.demo-account:hover { border-color:var(--gold-line); color:var(--gold); }
.demo-avatar { display:grid; place-items:center; width:28px; height:28px; border:1px solid var(--gold-line); border-radius:50%; color:var(--gold); font-size:11px; }
.account-overlay { position:fixed; inset:0; z-index:20; display:grid; place-items:center; padding:18px; background:#080a08d9; }
.account-panel { width:min(470px,100%); max-height:min(90vh,760px); overflow:auto; padding:clamp(22px,4vw,38px); border:1px solid var(--gold-line); border-radius:6px; background:var(--card); box-shadow:0 28px 80px #0009; }
.account-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.account-heading h2 { margin:12px 0 0; font:400 clamp(26px,5vw,34px)/1.25 var(--serif); }
.account-close { width:36px; height:36px; flex:none; border:1px solid var(--border); border-radius:3px; background:transparent; color:var(--ink); font-size:24px; }
.account-explain { margin:22px 0; color:var(--muted); font-size:13px; line-height:1.8; }
.account-explain strong { color:var(--ink); }
.account-tabs { display:flex; gap:20px; border-bottom:1px solid var(--border); }
.account-tabs button { padding:11px 2px; border:0; border-bottom:2px solid transparent; background:none; color:var(--muted); }
.account-tabs button.active { border-color:var(--gold); color:var(--gold); }
.account-form { display:grid; gap:16px; margin-top:22px; }
.account-form label { display:grid; gap:7px; color:var(--ink); font-size:12px; }
.account-form input { width:100%; min-height:45px; padding:10px 12px; border:1px solid var(--border); border-radius:3px; background:var(--paper); color:var(--ink); font-size:15px; }
.account-form input:focus { border-color:var(--gold); }
.account-form .btn { margin-top:5px; }
.account-wechat,.account-wechat-pending { display:block; margin:22px 0 0; padding-top:18px; border-top:1px solid var(--border); font-size:13px; line-height:1.7; }
.account-wechat { color:var(--gold); }
.account-wechat-pending { color:var(--muted); }
.account-logout { margin-top:6px; }
.account-hint { margin:12px 0 0; color:var(--gold); font-size:13px; }
.teacher-panel { width:min(650px,100%); }
.teacher-content { margin:24px 0; padding-top:16px; border-top:1px solid var(--border); }
.teacher-content h3 { margin:10px 0; font:400 22px/1.3 var(--serif); }
.teacher-content p { color:var(--muted); font-size:13px; line-height:1.7; }
.teacher-students { display:grid; gap:10px; margin:12px 0 0; padding:0; list-style:none; }
.teacher-student { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; padding:12px; border:1px solid var(--border); }
.teacher-student span { display:grid; gap:4px; }
.teacher-student small,.teacher-empty { color:var(--muted); font-size:12px; }
.teacher-reset-form { display:flex; flex-wrap:wrap; align-items:end; gap:10px; width:100%; }
.teacher-reset-form label { display:grid; gap:6px; flex:1 1 180px; font-size:12px; }
.teacher-reset-form input { width:100%; min-height:42px; padding:8px 10px; border:1px solid var(--border); border-radius:3px; background:var(--paper); color:var(--ink); }
.catalog-picker { position:relative; }
.catalog-picker summary { display:flex; align-items:center; gap:10px; min-width:184px; min-height:44px; padding:9px 12px; border:1px solid var(--border); border-radius:4px; cursor:pointer; list-style:none; }
.catalog-picker summary::-webkit-details-marker { display:none; }
.catalog-picker summary strong { font-size:12px; font-weight:500; white-space:nowrap; }
.catalog-picker summary > span:last-child { margin-left:auto; color:var(--gold); }
.catalog-picker[open] summary { border-color:var(--gold); }
.catalog-options { position:absolute; top:calc(100% + 8px); left:0; width:248px; padding:6px; border:1px solid var(--gold-line); border-radius:4px; background:var(--card); box-shadow:var(--shadow); z-index:3; }
.catalog-option { width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px; border:0; border-radius:2px; background:transparent; text-align:left; color:var(--ink); font-size:13px; }
.catalog-option.selected { color:var(--gold); background:#d4b77b12; }
.catalog-option:disabled { color:var(--muted); opacity:.65; cursor:default; }
.catalog-option small { font-size:10px; color:var(--muted); white-space:nowrap; }
.selected-range-count { margin-left:7px; color:var(--muted); font-size:10px; }
.catalog-ranges { position:absolute; left:calc(100% + 5px); top:-1px; width:248px; border:1px solid var(--gold-line); border-radius:4px; padding:6px; background:var(--card); box-shadow:var(--shadow); }
.catalog-ranges[hidden] { display:none; }
.catalog-range-list { max-height:min(420px,55vh); overflow-y:auto; overscroll-behavior:contain; }
.catalog-back { width:100%; border:0; border-bottom:1px solid var(--border); padding:11px 12px; margin-bottom:4px; background:transparent; color:var(--gold); text-align:left; font-size:12px; }
.catalog-option:focus-visible,.catalog-back:focus-visible { outline:2px solid var(--gold); outline-offset:-2px; }
.test-range-label { display:block; margin-top:4px; color:var(--gold); font-size:11px; }
@media (max-width:1000px) {
  .catalog-ranges { position:static; width:100%; border:0; padding:0; box-shadow:none; }
  .catalog-options.secondary-open .catalog-primary { display:none; }
}
@media (max-width:640px) {
  .catalog-picker summary strong { white-space:normal; line-height:1.4; }
  .test-mode .selected-range-count { display:block; margin-left:0; }
  .catalog-range-list { max-height:55vh; }
}
.all-progress { display:flex; flex-direction:column; gap:3px; min-width:72px; padding-left:16px; border-left:1px solid var(--border); }
.all-progress strong { color:var(--gold); font-size:15px; line-height:1.2; font-variant-numeric:tabular-nums; }
.mini-track { display:block; width:72px; height:2px; background:var(--border); overflow:hidden; margin-top:3px; }
.mini-track span { display:block; height:100%; background:var(--gold); }
.main { width:100%; max-width:1140px; min-width:0; padding:36px 32px 64px; margin:0 auto; }
.edition-heading { max-width:840px; margin:0 auto 28px; display:flex; align-items:flex-end; justify-content:space-between; gap:20px; }
.edition-kicker { display:block; color:var(--gold); font-size:10px; letter-spacing:.24em; margin-bottom:10px; }
.edition-title { margin:0; font-family:var(--serif); font-size:clamp(32px,4vw,48px); line-height:1.18; font-weight:400; letter-spacing:-.035em; }
.edition-note { color:var(--muted); font-size:11px; line-height:1.7; text-align:right; }
.edition-note span { display:block; color:var(--gold); font-size:9px; letter-spacing:.16em; }
.study-layout,.test-layout { max-width:840px; margin:0 auto; }
.study-content { min-width:0; }
.study-card,.test-card { background:var(--card); border:1px solid var(--border); border-top:2px solid var(--gold-line); border-radius:6px; box-shadow:var(--shadow); padding:clamp(24px,4vw,46px); }
.study-card { min-height:490px; }
.study-card h2 { margin:14px 0 8px; font-family:var(--serif); font-weight:400; font-size:clamp(27px,3vw,36px); line-height:1.4; }
.study-card .subtext { color:var(--muted); font-size:13px; line-height:1.75; }
.study-step-heading { display:flex; align-items:center; gap:18px; }
.study-step-number { color:var(--gold); font-family:var(--serif); font-size:48px; font-weight:400; letter-spacing:-.04em; line-height:1; }
.study-card .study-step-heading h2 { margin:0; font-size:clamp(23px,3vw,30px); }
.step-label,.test-kicker { color:var(--gold); font-size:11px; letter-spacing:.14em; line-height:1.7; }
.audio-stage { min-height:218px; display:grid; place-items:center; }
.audio-play { width:106px; height:106px; border-radius:50%; border:1px solid var(--gold); background:#d4b77b0a; color:var(--gold); font-size:29px; box-shadow:0 0 0 12px #d4b77b05,0 0 0 13px #d4b77b14; display:grid; place-items:center; padding-left:10px; transition:background .2s,box-shadow .2s; }
.audio-play:hover { background:#d4b77b1c; box-shadow:0 0 0 12px #d4b77b0a,0 0 0 13px #d4b77b38; }
.audio-caption { text-align:center; color:var(--muted); font-size:11px; margin-top:25px; letter-spacing:.04em; }
.btn { border:1px solid transparent; border-radius:4px; min-height:46px; padding:11px 20px; display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:600; font-size:13px; transition:background .15s,border-color .15s; text-decoration:none; }
.btn-primary { background:var(--gold); color:var(--paper); }
.btn-primary:hover:not(:disabled) { background:var(--gold-bright); }
.btn-outline,.btn-soft,.btn-light { border-color:var(--gold-line); color:var(--gold); background:transparent; }
.btn-outline:hover,.btn-soft:hover,.btn-light:hover { background:#d4b77b12; }
.btn-text { background:transparent; color:var(--muted); padding:9px 7px; }
.btn-text:hover { color:var(--ink); }
.btn-danger { background:#efb0a015; color:var(--error); }
.input-row { display:flex; gap:9px; }
.field { width:100%; flex:1; min-width:0; min-height:52px; border:1px solid #686b5f; background:var(--paper); color:var(--ink); border-radius:4px; padding:14px 16px; font-size:14px; }
.field::placeholder { color:var(--muted); opacity:1; }
.field:focus { border-color:var(--gold); box-shadow:0 0 0 3px #d4b77b12; }
.stage-actions { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-top:22px; }
.stage-actions .btn { min-width:136px; }
.stage-actions .btn-text { min-width:auto; }
.word-reveal { text-align:center; padding:34px 10px 28px; }
.word-reveal .word { font-family:var(--serif); font-size:clamp(40px,6vw,68px); font-weight:400; letter-spacing:-.035em; overflow-wrap:anywhere; }
.word-reveal .pron { color:var(--muted); margin-top:10px; font-size:14px; }
.answer { padding:17px 19px; background:#a7c8af08; border:1px solid #a7c8af30; border-radius:4px; margin-top:19px; font-size:14px; line-height:1.8; }
.answer b { color:var(--success); }
.answer.needs-work { background:#d4b77b08; border-color:var(--gold-line); }
.answer.needs-work b { color:var(--gold-bright); }
.answer-definition { color:var(--ink); margin-top:5px; font-size:15px; }
.answer-insight { color:var(--muted); margin-top:8px; }
.scene-visual { width:100%; max-width:420px; aspect-ratio:1; height:auto; border-radius:3px; background:var(--paper); object-fit:contain; display:block; margin:24px auto; border:1px solid var(--border); }
.scene-source { margin:-8px 0 4px; color:var(--muted); font-size:11px; line-height:1.5; overflow-wrap:anywhere; }
.scene-source a { color:inherit; text-decoration:underline; text-underline-offset:3px; }
.scene-english { font-family:var(--serif); font-size:22px; line-height:1.7; margin:15px 0 10px; }
.scene-translation { font-size:14px; color:var(--muted); line-height:1.8; }
.round-progress { margin:22px auto 0; padding:20px 0; border-top:1px solid var(--border); }
.round-progress-heading,.all-words-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.round-progress-heading strong { font-size:12px; font-weight:500; }
.round-progress-heading span,.all-words-heading span { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.round-steps { display:flex; flex-wrap:wrap; gap:8px; margin-top:15px; }
.round-step { width:31px; height:31px; display:grid; place-items:center; border:1px solid var(--border); border-radius:50%; color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.round-step.active { border-color:var(--gold); color:var(--gold); background:#d4b77b10; }
.round-step.done,.round-step.known { border-color:var(--gold); background:var(--gold); color:var(--paper); }
.all-words-panel { max-width:1080px; margin:0 auto 28px; padding:24px; background:var(--card); border:1px solid var(--border); border-radius:6px; }
.all-words-heading strong { font-family:var(--serif); font-size:23px; font-weight:400; }
.all-words-legend { display:flex; flex-wrap:wrap; gap:18px; margin:12px 0 20px; color:var(--muted); font-size:11px; }
.all-words-grid { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:7px; }
.all-word-row { display:flex; align-items:center; gap:6px; min-width:0; min-height:48px; padding:6px 8px; border:1px solid var(--border); border-radius:3px; }
.all-word-number { flex:none; width:25px; color:var(--muted); font-size:10px; font-variant-numeric:tabular-nums; }
.all-word-copy { display:flex; flex:1; flex-wrap:wrap; align-items:center; gap:6px; min-width:0; }
.all-word-text { min-width:0; max-width:100%; flex:1 0 auto; white-space:nowrap; overflow-wrap:normal; word-break:normal; font-size:13px; }
.all-word-meaning { flex:0 0 52px; min-width:0; min-height:32px; padding:5px 6px; border:1px solid var(--gold-line); border-radius:3px; color:var(--gold); font-size:11px; line-height:1.6; cursor:pointer; }
.all-word-meaning.covered { background:repeating-linear-gradient(135deg,#d4b77b16 0 3px,#202321 3px 6px); }
.all-word-meaning.revealed { flex:1 0 100%; background:transparent; color:var(--ink); text-align:left; overflow-wrap:anywhere; font-size:12px; }
.all-word-meaning-cn,.all-word-meaning-en { display:block; }
.all-word-meaning-en { margin-top:4px; color:var(--muted); font-size:11px; line-height:1.5; }
.all-word-meaning:hover { border-color:var(--gold); }
.all-word-meaning:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
.all-word-meaning[aria-disabled="true"] { opacity:.65; cursor:wait; }
.word-status { flex:none; display:grid; place-items:center; width:32px; height:32px; border:1px solid #757968; border-radius:50%; background:transparent; color:var(--gold); font-size:12px; font-weight:700; }
.word-status.known { background:var(--gold); border-color:var(--gold); color:var(--paper); }
.word-status.learned { background:#d4b77b12; border-color:var(--gold); }
.word-status:hover { outline:2px solid var(--gold-line); outline-offset:2px; }
.word-clear { flex:none; width:28px; height:36px; padding:0; border:0; background:transparent; color:var(--muted); font-size:18px; }
.word-clear:hover { color:var(--error); }
.all-words-paging { display:flex; align-items:center; justify-content:center; gap:18px; margin-top:20px; font-size:12px; color:var(--muted); }
.all-words-paging button { min-height:44px; padding:8px 12px; border:1px solid var(--border); border-radius:4px; background:transparent; color:var(--gold); }
.test-card { min-height:0; padding:20px 24px; border-top:1px solid var(--border); box-shadow:none; }
.test-kicker { margin:0 0 14px; }
.test-card h1 { margin:0 0 18px; font-family:var(--serif); font-weight:400; font-size:clamp(44px,7vw,76px); line-height:1.12; letter-spacing:-.035em; overflow-wrap:anywhere; }
.test-card h1 span { color:var(--muted); font-size:.5em; }
.test-muted { color:var(--muted); font-size:14px; line-height:1.9; }
.test-intro .btn { margin-top:14px; }
.test-result h1 { font-size:48px; margin-bottom:8px; }
.test-result .test-kicker { margin-bottom:6px; }
.test-result .test-muted { margin:8px 0 12px; line-height:1.5; }
.test-mode .main { padding-top:18px; }
.test-question { min-height:0; padding:18px 22px; border-top:1px solid var(--border); box-shadow:none; }
.test-question-head { display:flex; justify-content:space-between; gap:12px; color:var(--gold); font-size:12px; }
.test-question-head span:last-child { color:var(--muted); font-variant-numeric:tabular-nums; }
.test-track { height:3px; overflow:hidden; background:var(--border); margin:8px 0 14px; }
.test-track span { display:block; height:100%; background:var(--gold); transition:width .35s ease; }
.test-word-heading { display:flex; align-items:center; gap:16px; margin-bottom:14px; }
.test-word-copy { flex:1; min-width:0; }
.test-question h1 { margin:0; font-size:clamp(32px,4vw,52px); line-height:1.12; }
.test-pron { margin:5px 0 0; color:var(--muted); font-size:13px; line-height:1.3; overflow-wrap:anywhere; }
.test-play { flex:none; min-height:44px; border:1px solid var(--gold-line); border-radius:4px; background:transparent; color:var(--gold); padding:8px 10px; white-space:nowrap; font-size:12px; }
.test-play:hover { background:#d4b77b12; }
.test-play span { margin-right:4px; }
.test-question .input-row { max-width:none; }
.test-question .field { min-height:44px; padding:10px 12px; }
.test-question .stage-actions { margin-top:10px; gap:10px; }
.test-question .btn { min-height:44px; padding:10px 16px; }
.test-question :focus-visible { outline-offset:2px; }
.test-history,.test-live-feedback { margin-top:24px; padding:24px clamp(18px,4vw,34px); background:var(--card); border:1px solid var(--border); border-radius:6px; }
.test-history h2,.test-live-heading h2 { margin:0; font-family:var(--serif); font-size:24px; font-weight:400; }
.test-live-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.test-live-heading > span { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
.test-live-feedback { margin-top:12px; padding:14px 22px; }
.test-live-heading h2 { font-family:inherit; font-size:15px; font-weight:500; }
.test-live-feedback ol { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:20px; list-style:none; padding:0; margin:10px 0 0; }
.test-live-row { display:grid; grid-template-columns:28px minmax(0,1fr); align-items:start; gap:10px; padding:10px 0; border-top:1px solid var(--border); }
.test-live-icon { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#a7c8af14; color:var(--success); font-size:17px; }
.test-live-row.incorrect .test-live-icon { background:#efb0a014; color:var(--error); }
.test-live-row.close .test-live-icon,.test-live-row.uncertain .test-live-icon,.test-live-row.skipped .test-live-icon { background:#d4b77b14; color:var(--gold); }
.test-live-copy { min-width:0; }
.test-live-copy .test-live-heading { align-items:baseline; flex-wrap:wrap; gap:4px 10px; }
.test-live-copy .test-live-heading strong { font-family:var(--serif); font-size:20px; font-weight:400; overflow-wrap:anywhere; }
.test-live-result,.test-mark { color:var(--success); font-size:12px; white-space:nowrap; }
.test-live-result.incorrect,.test-mark.incorrect { color:var(--error); }
.test-live-result.close,.test-mark.close,.test-live-result.uncertain,.test-live-result.skipped,.test-mark.uncertain { color:var(--gold); }
.test-live-copy p { margin:4px 0 0; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.test-live-meaning { color:var(--ink); }
.test-live-answer { color:var(--muted); overflow-wrap:anywhere; }
.test-history-row { border-top:1px solid var(--border); margin-top:12px; }
.test-history-row summary { list-style:none; display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:16px 0; cursor:pointer; font-size:13px; }
.test-history-row summary::-webkit-details-marker { display:none; }
.test-history-row summary strong { margin-left:auto; color:var(--gold); }
.test-history-row summary small { color:var(--muted); }
.test-history-words { list-style:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px 20px; margin:0 0 17px; padding:0; }
.test-history-words li { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:12px; padding:6px 0; overflow-wrap:anywhere; }
.test-save-error { color:var(--error); font-size:13px; }
.test-save-error button { border:0; background:none; color:inherit; text-decoration:underline; }
.finish-card { text-align:center; display:grid; place-items:center; }
.finish-art { color:var(--gold); font-size:64px; margin:12px 0; }
.finish-title { font-family:var(--serif); font-size:34px; }
.finish-card .stage-actions { justify-content:center; }
.toast { position:fixed; right:24px; bottom:24px; background:var(--ink); color:var(--paper); padding:14px 18px; border:1px solid var(--gold); border-radius:4px; box-shadow:var(--shadow); font-size:13px; opacity:0; transform:translateY(15px); transition:.2s; pointer-events:none; z-index:10; max-width:min(340px,calc(100vw - 32px)); }
.toast.visible { opacity:1; transform:translateY(0); }

@media (max-width:640px) {
  .topbar { flex-direction:column; align-items:stretch; gap:18px; padding:18px 20px; }
  .brand { align-self:center; }.brand img { width:128px; height:39px; }
  .topbar-tools { display:grid; flex:none; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
  .catalog-picker { min-width:0; grid-column:1/-1; }
  .catalog-picker summary { min-width:0; }.catalog-options { width:min(248px,calc(100vw - 40px)); }
  .test-entry,.all-words-entry { width:100%; }.demo-account { justify-self:end; }
  .all-progress { min-width:0; padding-left:12px; flex-direction:row; flex-wrap:wrap; gap:4px 9px; align-items:baseline; }
  .all-progress .topbar-label { width:100%; }.mini-track { width:100%; }
  .main { padding:26px 16px 40px; }.edition-heading { margin-bottom:22px; gap:10px; }
  .edition-kicker { font-size:9px; letter-spacing:.15em; }.edition-note { font-size:10px; }.edition-note span { font-size:8px; }
  .study-card,.test-card { padding:25px 22px; min-height:unset; }.audio-stage { min-height:210px; }
  .stage-actions .btn { flex:1; }.stage-actions .btn-text { flex:0 1 auto; }
  .round-steps { gap:7px; }.round-step { width:28px; height:28px; }
  .all-words-panel { padding:19px 13px; }.all-words-grid { grid-template-columns:1fr; }
  .all-words-heading strong { font-size:20px; }.word-status { width:40px; height:40px; }.word-clear { width:36px; height:40px; }
  .all-word-meaning { min-height:40px; }
  .test-card { min-height:0; padding:18px 16px; }.test-question-head { font-size:11px; }.test-history-words { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .test-question { min-height:0; padding:16px; }.test-word-heading { gap:10px; }
  .test-live-feedback { padding:10px 12px; }.test-live-feedback ol { column-gap:12px; }
  .test-live-row { grid-template-columns:22px minmax(0,1fr); gap:6px; padding:8px 0; }
  .test-live-icon { width:22px; height:22px; font-size:15px; }
  .test-live-copy .test-live-heading strong { font-size:17px; }
  .test-live-result { white-space:normal; overflow-wrap:anywhere; line-height:1.4; font-size:11px; }
  .test-live-copy p { font-size:12px; }.test-history h2 { font-size:22px; }
  .test-mode .topbar { position:relative; flex-direction:row; justify-content:flex-start; gap:8px; padding:10px 16px; }
  .test-mode .brand { align-self:auto; }.test-mode .brand img { width:128px; height:39px; }
  .test-mode .topbar-tools { width:100%; flex:0 0 100%; grid-template-columns:minmax(0,1fr) auto auto; gap:6px; }
  .test-mode .catalog-picker { grid-column:auto; }.test-mode .catalog-picker summary { gap:6px; padding:8px; }
  .test-mode .catalog-picker .topbar-label { display:none; }.test-mode .catalog-picker summary strong { font-size:11px; }
  .test-mode .test-entry { padding:8px; font-size:11px; }
  .test-mode .demo-account { position:absolute; top:8px; right:16px; max-width:calc(100% - 180px); }
  .test-mode .demo-account > span:last-child { overflow:hidden; text-overflow:ellipsis; }
  .test-mode .main { padding-top:12px; }
  .scene-english { font-size:21px; }.field { font-size:16px; }.toast { right:16px; bottom:16px; }
}
@media (max-width:430px) { .all-words-grid { grid-template-columns:1fr; }.all-word-row { gap:8px; padding:5px 9px; }.all-word-number { width:28px; }.edition-title { font-size:34px; } }
@media (max-width:350px) { .main { padding-left:12px; padding-right:12px; }.study-card,.test-card { padding:23px 18px; }.edition-title { font-size:30px; }.edition-note { max-width:94px; }.study-step-number { font-size:42px; }.test-question { padding:14px; } }
@media (prefers-reduced-motion:reduce) { *,*:before,*:after { animation-duration:.01ms!important; transition-duration:.01ms!important; scroll-behavior:auto!important; } }

.test-live-definition { display:block; margin-top:3px; color:var(--muted); font-size:12px; line-height:1.4; overflow-wrap:anywhere; }

/* Learning: keep earlier contexts in place; word clicks only change visual letters. */
.linked-learning { margin-bottom:20px; border:1px solid var(--border); border-top:2px solid var(--gold-line); border-radius:6px; overflow:hidden; background:var(--card); }
.linked-learning .word-header { display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1fr) minmax(0,1.1fr); align-items:start; gap:22px; padding:20px 24px; border-bottom:1px solid var(--border); }
.linked-learning .word-header>div,.linked-learning .learning-mnemonic { min-width:0; }
.linked-learning .word-header:not(:has(.learning-mnemonic)) { grid-template-columns:minmax(0,1fr) minmax(0,2fr); }
.linked-learning .word-title { font:400 clamp(32px,3.8vw,44px)/1.15 var(--serif); letter-spacing:-.035em; margin:0; }
.linked-learning .word-tap { display:inline-flex; align-items:center; gap:16px; max-width:100%; min-height:50px; padding:1px 0 5px; background:none; border:0; color:inherit; font:inherit; letter-spacing:inherit; text-align:left; border-radius:3px; -webkit-tap-highlight-color:transparent; }
.linked-learning .word-letters { display:inline-flex; flex-wrap:nowrap; flex-shrink:0; white-space:nowrap; gap:3px; min-width:0; }
.linked-learning .letter-chunk { position:relative; color:#949d95; border-bottom:2px solid #626a6038; transition:color .25s,text-shadow .25s,border-color .25s; }
.linked-learning .letter-chunk.lit { color:#f1d298; border-bottom-color:var(--gold); text-shadow:0 0 20px #d4b77b48; }
.linked-learning .letter-chunk.just-lit { animation:atom-letter-light .45s ease-out; }
.linked-learning .word-tap-icon { font:18px/1 sans-serif; flex:none; color:var(--muted); opacity:.6; }
.linked-learning .word-tap:hover .word-tap-icon,.linked-learning .word-tap.playing .word-tap-icon { color:var(--gold); opacity:1; }
.linked-learning .word-tap.fully-lit .letter-chunk { color:#f4dbac; }
.linked-learning .letter-progress { display:inline-flex; flex-wrap:wrap; align-items:center; gap:10px; min-height:26px; margin-top:6px; }
.linked-learning .letter-dots { display:inline-flex; gap:5px; }
.linked-learning .letter-dot { display:block; width:5px; height:5px; border-radius:50%; background:#566052; transition:background .2s,box-shadow .2s; }
.linked-learning .letter-dot.lit { background:var(--gold); box-shadow:0 0 7px #d4b77b48; }
.linked-learning .letter-status { font-size:10px; color:var(--muted); font-variant-numeric:tabular-nums; }
.linked-learning .letter-reset { padding:4px 0; background:none; border:0; color:var(--muted); font-size:10px; }
.linked-learning .letter-reset:hover { color:var(--gold); }
.linked-learning .letter-reset[hidden] { display:none; }
.linked-learning .letter-hint { display:inline; font-size:10px; color:var(--muted); margin-left:8px; }
.linked-learning .letter-play:has(.fully-lit) .letter-hint { display:none; }
.linked-learning .ipa { display:inline-block; vertical-align:middle; font:14px/1.5 Georgia,serif; color:var(--muted); margin-top:8px; }
.linked-learning .meaning { font-size:16px; line-height:1.7; margin:0 0 5px; }
.linked-learning .definition { font:15px/1.6 var(--serif); color:var(--muted); margin:0; overflow-wrap:anywhere; }
.linked-learning .learning-mnemonic { margin:0; padding-left:20px; border-left:1px solid var(--border); font-size:12px; color:var(--muted); }
.linked-learning .learning-mnemonic h3 { margin:0 0 7px; font-size:11px; font-weight:500; color:var(--gold); }
.linked-learning .learning-mnemonic>div { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }
.linked-learning .context-progress { display:inline-flex; vertical-align:middle; gap:5px; margin:8px 0 0 10px; flex:none; }
.linked-learning .step { display:flex; align-items:center; justify-content:center; width:24px; height:24px; border:1px solid var(--border); border-radius:50%; color:var(--muted); font-size:10px; }
.linked-learning .step.current { color:var(--gold); border-color:var(--gold); background:#d4b77b10; }
.linked-learning .step.done { color:var(--success); border-color:#566b5c; background:#a7c8af0c; }
.linked-learning .scene { padding:26px 32px 28px; }
.linked-learning .scene+.scene { border-top:1px solid var(--border); }
.linked-learning .scene-heading { margin-bottom:18px; }
.linked-learning .scene-heading h3 { font-size:11px; font-weight:500; letter-spacing:.08em; color:var(--gold); margin:0; outline:none; }
.linked-learning .scene-body { display:grid; grid-template-columns:230px minmax(0,1fr); gap:28px; align-items:center; }
.linked-learning .scene-body.without-image { grid-template-columns:1fr; }
.linked-learning .scene-figure { margin:0; min-width:0; }
.linked-learning .scene-figure img { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:contain; border-radius:4px; background:var(--paper); border:1px solid var(--border); }
.linked-learning .scene-source { margin:8px 0 0; font-size:10px; }
.linked-learning .english { font:400 clamp(20px,2.3vw,25px)/1.55 var(--serif); margin:0; overflow-wrap:anywhere; }
.linked-learning .english mark { background:none; color:var(--gold); text-decoration:underline; text-decoration-color:var(--gold-line); text-underline-offset:5px; text-decoration-thickness:1px; }
.linked-learning .translation { margin:16px 0 18px; color:var(--muted); font-size:13px; line-height:1.9; }
.linked-learning .audio-button { display:inline-flex; align-items:center; gap:8px; min-height:40px; border:1px solid #655a43; border-radius:3px; background:transparent; color:var(--gold); padding:8px 12px; font-size:11px; }
.linked-learning .audio-button:hover,.linked-learning .audio-button.playing { background:#d4b77b14; }
.linked-learning .audio-icon { width:14px; text-align:center; }
.linked-learning .scene-actions { display:flex; justify-content:flex-end; margin-top:24px; }
@keyframes atom-letter-light { 0%{transform:translateY(0);text-shadow:0 0 0 transparent}40%{transform:translateY(-3px);text-shadow:0 0 20px #f4dbacaa}100%{transform:translateY(0)} }
@media(max-width:640px) {
  .linked-learning .word-header,.linked-learning .word-header:not(:has(.learning-mnemonic)) { grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); padding:18px 20px; gap:14px 18px; }
  .linked-learning .learning-mnemonic { grid-column:1 / -1; border-left:0; border-top:1px solid var(--border); padding:12px 0 0; display:grid; grid-template-columns:auto minmax(0,1fr); gap:12px; }
  .linked-learning .learning-mnemonic h3 { margin:2px 0 0; }
  .linked-learning .context-progress { gap:4px; }
  .linked-learning .step { width:24px; height:24px; font-size:9px; }
  .linked-learning .word-title { font-size:32px; }
  .linked-learning .word-tap { min-height:40px; gap:8px; }
  .linked-learning .word-letters { gap:2px; }
  .linked-learning .word-tap-icon { font-size:14px; }
  .linked-learning .meaning { font-size:15px; }
  .linked-learning .definition { font-size:14px; }
  .linked-learning .scene { padding:22px; }
  .linked-learning .scene-body { grid-template-columns:1fr; gap:20px; }
  .linked-learning .scene-figure { width:min(100%,230px); margin:0 auto; }
  .linked-learning .english { font-size:22px; }
  .linked-learning .scene-actions { margin-top:20px; }
  .linked-learning .scene-actions .btn { width:100%; }
}
@media(max-width:430px) {
  .linked-learning .word-header,.linked-learning .word-header:not(:has(.learning-mnemonic)) { grid-template-columns:1fr; padding:16px 18px; gap:12px; }
  .linked-learning .word-identity { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:10px; align-items:start; }
  .linked-learning .word-identity .ipa { grid-column:1; margin-top:2px; }
  .linked-learning .context-progress { grid-column:2; grid-row:1 / span 2; padding-top:8px; margin:0; }
  .linked-learning .letter-progress { display:inline-flex; margin-top:0; min-height:22px; }
  .linked-learning .letter-hint { display:inline; margin-left:8px; font-size:10px; }
  .linked-learning .word-meaning { display:grid; grid-template-columns:1fr; gap:3px; }
  .linked-learning .meaning { margin:0; }
}
@media(max-width:350px) {
  .linked-learning .word-header { padding:16px; }
  .linked-learning .scene { padding:20px 18px; }
  .linked-learning .word-title { font-size:30px; }
  .linked-learning .word-letters { gap:1px; }
  .linked-learning .english { font-size:20px; }
}
@media(prefers-reduced-motion:reduce) {
  .linked-learning .letter-chunk.just-lit { animation:none; }
  .linked-learning .letter-chunk { transition:none; }
}


/* A vocabulary label is one unbroken word, including hyphenated entries. */
.all-word-text,.word-reveal .word,.linked-learning .word-tap,.linked-learning .letter-chunk,
.test-word-copy h1,.test-live-heading strong,.test-history-words li>strong,
.student-words-table td:first-child strong,.student-test-run li strong,.student-recent li strong {
  white-space:nowrap; overflow-wrap:normal; word-break:normal; hyphens:none;
}
.word-reveal .word,.test-word-copy h1,.test-live-heading strong,.test-history-words li>strong,
.student-words-table td:first-child strong,.student-test-run li strong,.student-recent li strong { display:block; max-width:100%; }
.linked-learning .word-header.has-long-word { grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,1.05fr); }
.test-live-heading strong,.test-history-words li>strong { min-width:0; }
.student-test-run li>span:first-child,.student-recent li>span:first-child { min-width:0; flex:1; }
.linked-learning .english,.scene-english { overflow-wrap:normal; word-break:normal; hyphens:none; }
@media(max-width:640px) {
  .linked-learning .word-header.has-long-word { grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); }
}
@media(max-width:540px) {
  .test-live-feedback ol,.test-history-words { grid-template-columns:1fr; }
}
@media(max-width:430px) {
  .linked-learning .word-header.has-long-word { grid-template-columns:1fr; }
  .linked-learning .has-long-word .letter-play { grid-column:1 / -1; }
  .linked-learning .has-long-word .context-progress { grid-row:2; padding-top:0; }
  .test-word-heading { flex-wrap:wrap; }
  .test-word-copy { flex:1 0 100%; }
}
