:root{font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;color:#182d42;background:#f1f5f9;font-size:16px}*{box-sizing:border-box}body{margin:0}header{height:86px;border-bottom:1px solid #dce4ec;display:flex;align-items:center;justify-content:space-between;padding:0 6vw;background:white}.brand{font-size:26px;font-weight:800;color:#153d60;text-decoration:none}.brand span{font-size:12px;letter-spacing:3px;margin-left:14px;color:#547085}button,select,input{font:inherit}button{border:1px solid #c7d5df;background:white;color:#244a67;padding:11px 18px;border-radius:9px;cursor:pointer}button:hover{background:#eaf3fa}button:disabled{opacity:.4;cursor:default}button:focus-visible,select:focus-visible{outline:3px solid #edac3f;outline-offset:3px}main{max-width:1180px;margin:42px auto;display:grid;grid-template-columns:255px 1fr;gap:45px;padding:0 24px}aside h1{font-size:25px;line-height:1.5;margin:10px 0}aside>p{color:#627587}.eyebrow{font-size:13px;letter-spacing:2px}label{display:block;font-size:14px;color:#506478;margin:22px 0 12px}select{display:block;width:100%;margin-top:8px;padding:11px;border:1px solid #c7d5df;border-radius:8px;background:white;color:#203e56}aside>button{width:100%;margin-top:12px}.stats{margin-top:30px;border-top:1px solid #d5e0e9;padding-top:24px}.stats strong{font-size:32px;display:block;color:#145a88}.stats span{font-size:14px;color:#627587}progress{width:100%;height:8px;margin:14px 0;accent-color:#187cb0}.note{font-size:13px;line-height:1.8;color:#697b8a}.topline{display:flex;justify-content:space-between;font-size:14px;color:#627587;margin:0 0 18px}article{background:white;border:1px solid #dce5ec;border-radius:20px;box-shadow:0 14px 40px #173f5b08;text-align:center;padding:32px 38px;min-height:390px;border-top:5px solid #1779a7}.tag{display:inline-block;font-size:13px;padding:5px 11px;color:#476a83;background:#edf4f8;border-radius:20px}h2#word{font-family:Georgia,serif;font-size:clamp(36px,6vw,62px);font-weight:500;margin:22px 0 8px;overflow-wrap:anywhere}#ipa{font-family:"Segoe UI",sans-serif;color:#60788c;margin:0;line-height:1.7}#pos{color:#627587;font-size:14px}.sound{border:0;color:#1176a7;background:#edf7fc;margin:4px 0 22px}.reveal{display:block;margin:0 auto;border-style:dashed;width:100%;padding:18px}#meaning{font-size:21px;line-height:1.6;font-weight:500}.example{text-align:left;background:#f4f7fa;border-left:3px solid #d3a748;padding:12px 20px;border-radius:4px}.example p{line-height:1.7}.example p:first-child{font-size:18px}.example p:nth-child(2){color:#697b8a}.example button{padding:7px 12px;font-size:14px}.ratings{display:grid;grid-template-columns:1fr 1fr;gap:15px;margin-top:20px}.ratings button{padding:17px}.primary{background:#116e9e;color:white;border-color:#116e9e}.primary:hover{background:#0d587f}.navigation{display:flex;justify-content:space-between;margin:18px 0}.navigation button{border:none;background:transparent}.settings{border-top:1px solid #d5e0e9;padding:18px 0}.settings summary{cursor:pointer;color:#526e84;font-size:14px}.settingsGrid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:14px}.settingsGrid label{min-width:0}.settingsGrid button{align-self:end}dialog{width:min(680px,94vw);border:0;border-radius:16px;padding:28px;color:#203e56;max-height:90vh;overflow:auto}dialog::backdrop{background:#0d263b88}.dialogHead{display:flex;align-items:center;justify-content:space-between}dialog p{line-height:1.7}input[type=file]{max-width:100%;margin:20px 0}#previewRows{background:#eff5f9;padding:15px;line-height:1.8;margin:15px 0;white-space:pre-wrap;overflow-wrap:anywhere}hr{border:0;border-top:1px solid #dce5ec;margin:25px 0}#message{position:fixed;bottom:15px;left:50%;transform:translateX(-50%);background:#183c56;color:white;border-radius:10px;padding:12px 20px;max-width:90vw;z-index:9}#message:empty{display:none}[hidden]{display:none!important}@media(max-width:750px){header{height:70px;padding:0 20px}main{display:block;margin:20px auto;padding:0 16px}aside{margin-bottom:25px}aside h1{font-size:22px}aside label{display:inline-block;width:48%;margin:10px 1% 5px}aside label:first-of-type{width:98%}.stats{margin-top:18px;padding-top:12px}.stats strong{display:inline;font-size:24px;margin-right:8px}.stats progress{margin:8px 0}article{padding:25px 20px;min-height:360px}.settingsGrid{grid-template-columns:1fr 1fr}.settingsGrid label:first-child{grid-column:1/-1}.topline{font-size:13px}}
@media(max-width:750px){main{display:flex;flex-direction:column;gap:24px}.study{order:0}aside{order:1;border-top:1px solid #d5e0e9;padding-top:14px}#message{width:calc(100% - 32px);text-align:center}}

.scope{margin-top:24px}.scope>p:first-child{font-size:14px;color:#506478;margin-bottom:10px}#filters{display:grid;gap:10px}#filters button{width:100%;text-align:left;padding:13px 15px}#filters button[aria-pressed="true"]{background:#116e9e;color:white;border-color:#116e9e}#exportHard{width:100%;margin-top:14px;border-color:#116e9e;color:#116e9e}@media(max-width:750px){aside label{width:100%;margin:10px 0}}

/* Learning controls */
#hard{background:#e5e7eb;border-color:#aeb8c3;color:#374151;font-weight:600}
#hard:hover:not(:disabled){background:#d5dae1;border-color:#8793a1}
#reveal{background:#e1f0fb;border:1px solid #8dbad7;color:#154f75;font-weight:600}
#reveal:hover{background:#cce5f6}
.settings{background:#fff;border:1px solid #b9cfdf;border-radius:12px;padding:0;overflow:hidden;box-shadow:0 3px 12px #173f5b06}
.settings summary{font-size:17px;font-weight:700;color:#174d70;background:#e5f0f8;padding:17px 20px;min-height:54px}
.settings summary:hover{background:#d6e8f5}
.settings summary:focus-visible{outline:3px solid #edac3f;outline-offset:-3px}
.settings[open] summary{border-bottom:1px solid #b9cfdf}
.settingsGrid{padding:0 20px 16px}.settings>.note{padding:0 20px 12px;margin-top:0}
aside h1{overflow-wrap:break-word}main>*{min-width:0}

/* v4: navigation, counts and card export */
.navigation button{background:#fff;border:1px solid #b8cbd9;border-radius:9px;padding:12px 24px;min-width:128px;min-height:46px;font-weight:600;color:#244a67}
.navigation button:hover:not(:disabled){background:#e1f0fb;border-color:#1779a7}
.navigation button:disabled{background:#edf0f3;color:#778493;opacity:.65}
.card-tools{display:flex;justify-content:flex-end;margin:-12px -16px 14px;min-height:40px}
#card #exportHard{width:auto;margin:0;padding:9px 13px;font-size:14px;min-height:40px;background:#edf7fc;border-color:#9cbfd5;color:#155377}
#card #exportHard:hover:not(:disabled){background:#d8ecf9}
#card #exportHard:disabled{opacity:.55;cursor:not-allowed}
#filters button[data-filter="known"],#filters button[data-filter="hard"]{display:flex;align-items:center;justify-content:space-between;gap:8px}
.filter-count{min-width:30px;padding:2px 8px;border-radius:14px;background:#e6eef5;color:#244a67;text-align:center;font-size:13px;font-weight:700;flex-shrink:0}
#filters button[aria-pressed="true"] .filter-count{background:#ffffff26;color:#fff}
@media(max-width:750px){.card-tools{margin:-8px -4px 14px}.navigation button{min-width:112px;padding:12px 16px}}

#filters button{display:flex;align-items:center;justify-content:space-between;gap:8px}

#resetLearning{background:#fff7f5;color:#9b382b;border:1px solid #dba99f;margin-top:12px;min-height:44px}#resetLearning:hover{background:#fce9e4;border-color:#b85f50}

.brand{display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px}
.brand span{font:inherit;letter-spacing:normal;margin:0;color:inherit;text-transform:none}
.header-actions{display:flex;gap:10px;align-items:center;flex-shrink:0}
header{height:auto;min-height:86px;gap:18px;padding-top:16px;padding-bottom:16px;flex-wrap:wrap}
#themeToggle{min-height:44px}
html[data-theme="dark"]{color-scheme:dark;background:#111c29;color:#e4edf5}
html[data-theme="dark"] body{background:#111c29;color:#e4edf5}
html[data-theme="dark"] header,html[data-theme="dark"] article,html[data-theme="dark"] dialog,html[data-theme="dark"] .settings{background:#1b2a3b;color:#e4edf5;border-color:#41546a}
html[data-theme="dark"] .brand{color:#edf5fc}
html[data-theme="dark"] button,html[data-theme="dark"] select,html[data-theme="dark"] .cefr-navigation a{background:#25384c;color:#e4edf5;border-color:#526982}
html[data-theme="dark"] button:hover:not(:disabled),html[data-theme="dark"] .cefr-navigation a:hover{background:#324b65}
html[data-theme="dark"] .primary,html[data-theme="dark"] #filters button[aria-pressed="true"],html[data-theme="dark"] .cefr-navigation a[aria-current="page"]{background:#176b98;color:#fff;border-color:#4b9dcb}
html[data-theme="dark"] #hard{background:#374151;color:#f1f5f9;border-color:#718096}
html[data-theme="dark"] #hard:hover:not(:disabled){background:#465268}
html[data-theme="dark"] #reveal,html[data-theme="dark"] #card #exportHard,html[data-theme="dark"] .sound{background:#214761;color:#d4edff;border-color:#5383a2}
html[data-theme="dark"] #reveal:hover,html[data-theme="dark"] #card #exportHard:hover:not(:disabled){background:#2a5978}
html[data-theme="dark"] .settings summary{background:#25425a;color:#e0f1ff;border-color:#526982}
html[data-theme="dark"] .settings summary:hover{background:#31536f}
html[data-theme="dark"] .example,html[data-theme="dark"] #previewRows{background:#22364a;color:#e4edf5}
html[data-theme="dark"] .note,html[data-theme="dark"] aside>p,html[data-theme="dark"] label,html[data-theme="dark"] .topline,html[data-theme="dark"] #ipa,html[data-theme="dark"] #pos,html[data-theme="dark"] .example p:nth-child(2),html[data-theme="dark"] .scope>p:first-child{color:#b7c9d9}
html[data-theme="dark"] .tag,html[data-theme="dark"] .filter-count{background:#314b61;color:#dceeff}
html[data-theme="dark"] #resetLearning{background:#443039;color:#ffd1c8;border-color:#a97171}
html[data-theme="dark"] #resetLearning:hover{background:#593b42}
html[data-theme="dark"] .navigation button:disabled{background:#202e3e;color:#a1adba}
html[data-theme="dark"] hr,html[data-theme="dark"] aside{border-color:#41546a}
@media(max-width:750px){header{padding:14px 16px}.brand{font-size:22px;gap:4px 12px}.header-actions{flex-wrap:wrap}.header-actions button{padding:10px 12px}}

.brand span{font-style:italic}
