:root{--ink:#21372e;--muted:#738077;--green:#286347;--green-dark:#1c4d35;--paper:#f5f6f2;--line:#e0e6dd;--accent:#dcec9e;--radius:22px}
*{box-sizing:border-box}html{min-height:100%;font-size:16px}body{margin:0;background:var(--paper);color:var(--ink);font-family:Inter,"Segoe UI",Arial,sans-serif;line-height:1.6;font-size:15px}button,input,select,textarea{font:inherit}a{color:var(--green)}button,a,input,select,textarea{touch-action:manipulation}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #8aa54b;outline-offset:4px}button{cursor:pointer}button:disabled{cursor:default;opacity:.38}a:hover{color:var(--green-dark)}
.site-header{border-bottom:1px solid var(--line);background:rgba(255,255,255,.8)}.site-header-inner{max-width:1560px;margin:auto;min-height:92px;padding:20px 48px;display:flex;align-items:center;gap:64px}.wordmark{display:flex;align-items:center;gap:12px;color:var(--ink);font-size:25px;font-weight:750;letter-spacing:-1px;text-decoration:none!important}.brand-symbol{display:grid;place-items:center;background:var(--green);color:white;border-radius:13px;width:43px;height:43px;font-size:28px;letter-spacing:-3px;padding-right:3px}.brand-light{font-weight:400}.primary-nav{display:flex;gap:32px;align-self:stretch;align-items:center}.primary-nav a{font-weight:600;color:var(--muted);text-decoration:none}.primary-nav .nav-current{color:var(--green)}.account-menu{margin-left:auto;display:flex;align-items:center;gap:26px;font-size:13px}.account-name{max-width:160px;overflow:hidden;text-overflow:ellipsis;font-weight:600}.logout-link{color:var(--muted);text-decoration:none}.logout-link span{margin-left:10px}
.study-heading{max-width:1464px;margin:58px auto 34px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;gap:20px}.eyebrow{font-size:10px;letter-spacing:1.8px;font-weight:750;color:var(--muted);margin:0 0 16px}.study-heading h1{font-size:clamp(27px,2.9vw,44px);font-weight:650;letter-spacing:-1.8px;line-height:1.2;margin:0 0 15px;color:var(--ink)}.study-heading h1>span{color:#8caa4c}.page-description{color:var(--muted);font-size:14px;margin:0}.language-pair{display:flex;align-items:center;gap:16px;font-size:12px;font-weight:650;background:#fff;border:1px solid var(--line);border-radius:30px;padding:11px 20px;white-space:nowrap}.language-pair span:nth-child(2){color:#8d9d87}
.study-tabs{max-width:1416px;margin:0 auto 28px;display:flex;gap:8px;border-bottom:1px solid var(--line);padding-bottom:16px}.study-tab{display:flex;align-items:center;gap:13px;border:0;background:transparent;border-radius:10px;padding:11px 19px;color:var(--muted);font-size:13px;font-weight:600;min-height:44px;white-space:nowrap}.study-tab:hover{background:#eaf0e6}.study-tab.is-active{background:var(--green);color:white}.tab-count{font-size:11px;border-radius:6px;padding:1px 7px;background:#e5eade;color:#75816d}.is-active .tab-count{background:rgba(255,255,255,.17);color:white}
.learning-page .wrap{min-height:0;margin:0}.learning-page .wrap>.container{width:auto;max-width:1464px;padding:0 24px;margin:0 auto}.learning-page .wrap>.container>.row{margin:0;display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:36px;align-items:start}.learning-page .wrap>.container>.row>.col-sm-9{width:auto;float:none;padding:0;min-width:0}.study-workspace{width:100%}.session-toolbar{display:flex;align-items:center;justify-content:space-between;margin:2px 0 18px;font-size:12px;color:var(--muted);gap:15px}.session-label{display:flex;gap:9px;align-items:center}.status-dot{display:inline-block;width:6px;height:6px;background:#8da358;border-radius:50%}#card-progress{font-variant-numeric:tabular-nums;font-size:11px;color:var(--muted)}.study-form{margin:0}.study-workspace #container{margin:0;width:100%;padding:0;position:relative;perspective:1600px;min-height:0}.study-workspace .card{position:relative;float:none;margin:0;width:100%;height:auto;background:transparent;border:0;box-shadow:none;transform:none!important}.card-rotator{display:grid;min-height:405px;transform-style:preserve-3d;transition:transform .6s cubic-bezier(.2,.7,.2,1)}.card.flip .card-rotator{transform:rotateY(180deg)}.study-workspace .card-face{grid-area:1/1;position:relative;inset:auto;width:100%;height:auto;min-width:0;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:28px 36px;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:0 12px 30px -24px #34513955;overflow:hidden;transform:none}.study-workspace .back{transform:rotateY(180deg);background:#f0f4e9;border-color:#d4dfc8}.face-topline{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:35px;font-size:10px;color:#899386}.language-label{letter-spacing:2px;font-weight:700}.card-side-label{font-size:11px}.word-content{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:32px 0 25px;min-width:0}.word-type{text-transform:lowercase;color:#8d9988;font-size:12px;margin:0 0 12px}.word-content h2{font-size:clamp(32px,3.4vw,56px);font-weight:600;letter-spacing:-1.5px;line-height:1.2;color:var(--ink);margin:0;overflow-wrap:anywhere}.word-example{font-size:15px;line-height:1.7;max-width:550px;color:var(--muted);margin:22px 0 0;overflow-wrap:anywhere}.transcription{font-size:15px;color:#819078;letter-spacing:1px;margin:10px 0 0}.card-hint{text-align:center;font-size:11px;color:#97a08f;margin:12px 0 0}.pronounce{display:flex;align-items:center;gap:8px;border:0;background:#e4ecd9;border-radius:8px;padding:8px 11px;color:var(--green);font-size:11px;min-height:35px}.pronounce:hover{background:#d9e5c9}.card-actions{display:flex;justify-content:space-between;gap:16px;margin-top:18px}.study-workspace .backward,.study-workspace .forward{position:static;float:none;width:auto;margin:0;padding:12px 18px;border-radius:10px;border:1px solid var(--line);background:#fff;color:var(--muted);font-size:12px;min-height:46px;box-shadow:none}.study-workspace .forward{background:#e6eecf;border-color:#d9e4bb;color:#4c6230;font-weight:600}.card-actions span{font-size:17px;margin:0 4px}.study-workspace .forward:hover:not(:disabled){background:#dbe9b5}.study-workspace .backward:hover:not(:disabled){background:#edf1e8}.study-controls{display:flex;align-items:center;justify-content:center;gap:20px;margin:30px 0 18px}.study-controls .card-nav{position:static;width:48px;height:48px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);font-size:22px;padding:0;box-shadow:none}.card-nav:hover{background:#e7eddf}.flip-button{display:flex;align-items:center;justify-content:center;gap:12px;border:0;border-radius:12px;background:var(--green);color:#fff;padding:15px 25px;min-height:52px;font-weight:600;font-size:13px;box-shadow:0 6px 12px -8px var(--green)}.flip-button:hover{background:var(--green-dark)}.flip-button>span{font-size:23px;line-height:1}.flip-button kbd{background:#ffffff20;color:#dce8df;box-shadow:none;font-size:9px;font-weight:400;padding:3px 5px}.keyboard-hint{font-size:10px;color:#9ba593;text-align:center;margin:0}.keyboard-hint kbd{background:transparent;border:1px solid var(--line);box-shadow:none;color:#84917d;border-radius:4px;margin-right:3px;padding:1px 4px}.keyboard-hint>span{margin:0 12px}.empty-state{background:#fff;padding:75px 25px;text-align:center;border:1px solid var(--line);border-radius:var(--radius);min-height:405px}.empty-icon{display:grid;place-items:center;width:65px;height:65px;background:#e6efcf;color:var(--green);border-radius:50%;font-size:28px;margin:0 auto 25px}.empty-state h2{font-size:24px}.empty-state p{color:var(--muted)}
.study-sidebar{min-width:0;padding-top:0}.progress-panel{background:#eaf0df;border:1px solid #dfe7d1;border-radius:18px;padding:24px;margin-bottom:24px}.progress-panel .eyebrow{font-size:9px;margin-bottom:16px;color:#7e8c69}.progress-panel h2{font-size:23px;letter-spacing:-.7px;margin:0 0 8px;font-weight:600}.progress-panel>p:not(.eyebrow){color:#869378;font-size:11px;margin:0}.progress-numbers{display:flex;align-items:baseline;gap:8px;margin:26px 0 12px}.progress-numbers strong{font-size:34px;line-height:1;font-weight:600;letter-spacing:-1px}.progress-numbers span{font-size:10px;color:#839073}.learning-progress{height:6px;overflow:hidden;background:#d8e1c8;border-radius:10px}.learning-progress>span{display:block;background:#759544;height:100%;border-radius:10px}.progress-caption{display:flex;justify-content:space-between;color:#8a967b;font-size:9px;margin-top:9px}.collection-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.collection-heading h2{font-size:13px;font-weight:650;margin:0}.collection-heading>span{font-size:10px;color:#9aa38f}.word-collection{background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px}.word-stage{border-bottom:1px solid #edf0e8}.word-stage:last-child{border-bottom:0}.word-stage summary{display:flex;align-items:center;gap:10px;padding:14px 0;cursor:pointer;list-style:none;font-size:11px;font-weight:500;min-height:48px}.word-stage summary::-webkit-details-marker{display:none}.stage-number{width:22px;height:22px;display:grid;place-items:center;border-radius:7px;background:#edf2e5;color:#7c9163;font-size:10px}.stage-count{margin-left:auto;color:#8e9984;font-size:10px}.stage-chevron{color:#a5ad9c;transition:transform .2s}.word-stage[open] .stage-chevron{transform:rotate(180deg)}.stage-words{display:flex;flex-wrap:wrap;gap:6px;max-height:170px;overflow:auto;padding:0 0 16px;scrollbar-width:thin;scrollbar-color:#ced7c5 transparent}.stage-words>span{display:inline-block;padding:4px 8px;font-size:10px;border-radius:5px;background:#f3f5ee;color:#89927f;overflow-wrap:anywhere;max-width:100%}.stage-empty{font-size:11px;color:var(--muted);margin:0}.study-note{font-size:11px;line-height:1.7;color:#96a08b;display:flex;gap:10px;padding:18px 8px;margin:0}.study-note>span{font-size:18px;color:#9aaf72}.learning-page #push{display:none}.learning-page #footer{position:static;height:auto;min-height:0;background:transparent;border:0;margin:55px 0 0;padding:24px}.learning-page #footer p{font-size:10px;letter-spacing:.3px;color:#a0a894;margin:0}.learning-page #footer .container{width:auto}.learning-page #footer span{padding:0 10px}
/* Keep the existing editor and account forms, with the same visual language. */
.navbar-default{background:#fff;border-color:var(--line);border-radius:0}.navbar-brand{font-weight:600;color:var(--green)!important}.btn-primary,.btn-success{background:var(--green);border-color:var(--green)}.btn-primary:hover,.btn-success:hover{background:var(--green-dark);border-color:var(--green-dark)}.form-control{border-color:var(--line);border-radius:9px;min-height:44px;box-shadow:none}.form-control:focus{border-color:#8da767;box-shadow:0 0 0 3px #b8d08d33}.table{background:#fff}.table-responsive{border-radius:12px}.modal-content{border-radius:18px;border-color:var(--line);box-shadow:0 24px 80px #21372e22}.modal-header{border-color:var(--line)}
.auth-page{background:radial-gradient(ellipse at 15% 15%,#e5edd8,transparent 50%),var(--paper)!important;min-height:100vh;color:var(--ink)!important;font-family:Inter,"Segoe UI",Arial,sans-serif}.auth-brand{display:block;text-align:center;font-size:32px;letter-spacing:-1px;color:var(--green);font-weight:700;text-decoration:none!important;padding:42px 20px 25px}.auth-brand>span{font-weight:400}.auth-brand small{display:block;font-size:11px;letter-spacing:1.5px;margin-top:8px;color:var(--muted);font-weight:400}.auth-page input:not([type=checkbox]):not([type=submit]):not([type=button]){max-width:100%;border-radius:9px!important;border:1px solid var(--line)!important;min-height:48px;background:white!important;color:var(--ink)!important;padding:12px 15px;box-shadow:none!important}.auth-page .btn-login,.auth-page input[type=submit],.auth-page button[type=submit]{background:var(--green)!important;color:white!important;border:0!important;border-radius:9px!important;min-height:48px}.auth-page .login,.auth-page #login,.auth-page .login-form,.auth-page .registration,.auth-page .reg-form{max-width:460px;width:calc(100% - 32px);margin:20px auto;border-radius:20px;background:#fff;padding:35px;border:1px solid var(--line);box-shadow:0 20px 60px -35px #29483555}.auth-page form{max-width:440px;margin-left:auto;margin-right:auto}.auth-page h1,.auth-page h2{color:var(--ink);font-weight:600;letter-spacing:-.7px}.auth-page a{color:var(--green)}.auth-page img{max-width:100%}
@media(min-width:1900px){.site-header-inner{max-width:1720px}.study-heading,.learning-page .wrap>.container{max-width:1624px}.study-tabs{max-width:1576px}.learning-page .wrap>.container>.row{grid-template-columns:minmax(0,1fr) 360px;gap:48px}.study-heading{margin-top:78px}.card-rotator{min-height:470px}.card-face{padding:36px 44px}.word-content h2{font-size:64px}.word-example{font-size:18px}.study-sidebar{font-size:16px}.progress-panel{padding:28px}.word-stage summary{font-size:13px}.stage-words>span{font-size:12px}.study-controls{margin-top:38px}}
@media(max-width:1199px){.site-header-inner{padding:18px 28px;gap:36px}.study-heading{margin-top:40px}.study-tabs{margin-left:24px;margin-right:24px}.learning-page .wrap>.container>.row{grid-template-columns:minmax(0,1fr) 280px;gap:24px}.study-workspace .card-face{padding:24px}.card-rotator{min-height:390px}.word-collection,.progress-panel{padding:20px}}
@media(max-width:900px){.learning-page .wrap>.container>.row{grid-template-columns:minmax(0,1fr)}.study-sidebar{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:20px}.progress-panel{margin:0}.study-note{grid-column:1/-1;padding:0 8px}.word-collection{min-width:0}.card-rotator{min-height:390px}.study-heading h1{font-size:34px}.learning-page #footer{margin-top:25px}.auth-page .container{max-width:100%;padding-left:16px;padding-right:16px}}
@media(max-width:540px){.site-header-inner{min-height:74px;padding:15px 18px;gap:16px}.wordmark{font-size:21px;gap:8px}.brand-symbol{width:34px;height:34px;border-radius:10px;font-size:24px}.primary-nav{display:none}.account-menu{gap:10px;font-size:11px}.account-name{max-width:75px}.logout-link span{display:none}.study-heading{margin:30px 0 24px;padding:0 20px;align-items:flex-start}.study-heading .eyebrow{font-size:8px;letter-spacing:1.2px;margin-bottom:12px}.study-heading h1{font-size:29px;letter-spacing:-1.2px;max-width:300px}.page-description{font-size:12px;max-width:270px}.language-pair{display:none}.study-tabs{margin:0 16px 24px;padding-bottom:12px;gap:4px;overflow-x:auto;scrollbar-width:none}.study-tabs::-webkit-scrollbar{display:none}.study-tab{flex:1;justify-content:center;padding:10px 9px;gap:6px;font-size:10px}.tab-count{font-size:9px;padding:1px 5px}.learning-page .wrap>.container{padding:0 16px}.session-toolbar{font-size:10px;margin-bottom:14px}.card-rotator{min-height:340px}.study-workspace .card-face{padding:20px;border-radius:18px}.face-topline{font-size:8px}.card-side-label{font-size:9px}.language-label{letter-spacing:1.6px}.word-content{padding:30px 0 25px}.word-content h2{font-size:36px;letter-spacing:-1px}.word-example{font-size:13px;margin-top:20px}.word-type{font-size:10px}.card-hint{font-size:9px}.card-actions{gap:10px;margin-top:12px}.study-workspace .backward,.study-workspace .forward{flex:1;font-size:10px;padding:10px 8px}.card-actions span{font-size:14px;margin:0 2px}.study-controls{gap:14px;margin-top:24px}.study-controls .card-nav{width:44px;height:44px;font-size:20px;flex-shrink:0}.flip-button{flex:1;max-width:240px;padding:13px 10px;font-size:12px;gap:8px}.flip-button kbd{display:none}.keyboard-hint{display:none}.study-sidebar{grid-template-columns:1fr;margin-top:24px;gap:16px}.progress-panel{padding:22px}.progress-panel h2{font-size:23px}.progress-numbers{margin-top:20px}.word-collection{padding:20px 22px}.word-stage summary{font-size:12px}.stage-words>span{font-size:11px}.study-note{font-size:10px}.auth-brand{padding-top:30px}.auth-page form{width:100%;max-width:100%}.auth-page .login,.auth-page #login,.auth-page .login-form,.auth-page .registration,.auth-page .reg-form{padding:24px;max-width:calc(100% - 32px)}.modal-dialog{margin:12px}.table-responsive{overflow-x:auto}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.auth-page #login.auth-card{position:static;transform:none;height:auto;max-width:460px;width:calc(100% - 32px);margin:40px auto 70px;padding:36px}.auth-card h1{font-size:29px;margin:0 0 10px;text-align:left;color:var(--ink)!important}.auth-card .eyebrow{font-size:9px;color:var(--muted)!important;margin:0 0 14px}.auth-card .auth-description{font-size:12px;color:var(--muted);margin:0 0 25px}.auth-card form{width:100%;margin:0}.auth-card label{display:block;position:static;color:var(--ink)!important;font-size:12px;font-weight:500;margin:16px 0 7px;text-align:left}.auth-card input:not([type=checkbox]){display:block;width:100%;margin:0;height:48px}.auth-card .remember-row{display:flex;align-items:center;gap:9px;font-size:11px;color:var(--muted)!important;margin:18px 0}.auth-card input[type=checkbox]{position:static;float:none;margin:0;width:16px;height:16px;accent-color:var(--green)}.auth-card .btn-login{width:100%;margin:6px 0 0;font-size:13px;font-weight:600;display:flex;align-items:center;justify-content:space-between;padding:13px 18px}.auth-card .auth-register{text-align:center;font-size:12px;color:var(--muted);margin:23px 0 0}.auth-card .auth-register a{font-size:12px;color:var(--green)!important;font-weight:600}.auth-page .modal{color:var(--ink)}@media(max-width:540px){.auth-page #login.auth-card{margin:20px auto 40px;padding:28px 24px}.auth-card h1{font-size:26px}}

.learning-page .wrap>.container>.row::before,.learning-page .wrap>.container>.row::after{display:none}.study-workspace #container{height:auto!important}.study-controls .card-nav{flex:0 0 48px}.study-controls #btn-flip{width:auto;height:auto;line-height:1.4;margin:0}.study-workspace .card{min-height:0}.word-type,.card-hint,.card-side-label{color:#75836e}.stage-words>span{color:#6c7e5e}.keyboard-hint{color:#7b8871}@media(max-width:540px){.study-controls .card-nav{flex-basis:44px}.study-controls #btn-flip{flex:1}}

.study-controls #btn-flip{background:var(--green);color:white;border:0}.study-controls #btn-flip:hover{background:var(--green-dark)}

.editor-page .col-sm-9{background:#fff;border:1px solid var(--line);border-radius:18px;padding:28px!important}.editor-page .col-sm-9>.row{margin:0}.editor-page .col-sm-9 h2{font-size:24px;margin:25px 0 22px}.editor-page .col-sm-9 form .col-md-6{width:100%;margin:0;padding:0}.editor-page .col-sm-9 form{max-width:none}.editor-page .form-group{margin-bottom:20px}.editor-page label{font-size:12px;font-weight:600}.editor-page textarea{min-height:95px}.editor-page button[type=submit],.editor-page input[type=submit]{min-height:46px;border-radius:9px}.editor-page .modal .row{display:block}.editor-page .table{font-size:13px}.editor-page hr{border-color:var(--line)}@media(max-width:540px){.site-header-inner{flex-wrap:wrap;row-gap:10px}.primary-nav{display:flex;order:3;flex-basis:100%;gap:22px;font-size:11px;border-top:1px solid var(--line);padding-top:10px}.primary-nav:not(:has(a:nth-child(2))){display:none}.editor-page .col-sm-9{padding:20px!important}}

.auth-page #registration{max-width:480px;width:calc(100% - 32px);padding:32px;margin:15px auto 55px;background:white;border:1px solid var(--line);border-radius:20px;box-shadow:0 20px 60px -35px #29483555}.auth-page #registration form{width:100%;max-width:none}.auth-page #registration input:not([type=checkbox]):not([type=hidden]){font-size:13px!important;padding:12px!important;height:48px!important;margin:0!important;width:100%}.auth-page #registration input[type=hidden]{display:none}.auth-page #registration .btn-login{font-size:13px!important;min-height:48px!important;height:auto!important}.verification-row{display:flex;align-items:center;gap:12px;margin-bottom:22px}.verification-row>input{min-width:0;flex:1}.verification-row>img{flex:0 0 110px;max-width:110px}.registration-result{padding:14px;border-radius:9px;background:#f0f4e8;font-size:13px;margin:15px 0;color:var(--ink)}@media(max-width:540px){.auth-page #registration{padding:26px 22px}.auth-page #registration h1{font-size:25px}.auth-page #registration input{font-size:16px!important}.auth-page input:not([type=checkbox]){font-size:16px!important}}

/* Color themes. The preference is shared by all account and learning pages. */
:root{--ink:#172343;--muted:#596886;--green:#5b3fda;--green-dark:#4428ba;--paper:#eef2fc;--line:#d6def0;--accent:#ffcf40;--surface:#fff;color-scheme:light}
html[data-theme="dark"]{--ink:#f0f3ff;--muted:#aab8d5;--green:#8066ff;--green-dark:#694de5;--paper:#101526;--line:#34415e;--accent:#ffcc3d;--surface:#1c253b;color-scheme:dark}
body{background:var(--paper);color:var(--ink)}
.brand-mark,.study-tab.is-active{background:var(--green);color:#fff}
.study-tab.is-active .tab-count{background:#ffffff26;color:#fff}
.eyebrow,.brand-name,.auth-page h1{color:var(--ink)}
.study-workspace .card-face{border-top:5px solid #8066ff}
.study-workspace .card-face.back{border-top-color:#00bca5}
.study-tab:nth-child(2){border-bottom:3px solid #00bca5}.study-tab:nth-child(3){border-bottom:3px solid #ffaf32}.study-tab:nth-child(4){border-bottom:3px solid #f35c95}
html[data-theme="dark"] .language-pair,html[data-theme="dark"] .study-workspace .card-face,html[data-theme="dark"] .study-workspace .backward,html[data-theme="dark"] .study-workspace .forward,html[data-theme="dark"] .study-controls .card-nav,html[data-theme="dark"] .flip-button kbd,html[data-theme="dark"] .empty-state,html[data-theme="dark"] .word-collection,html[data-theme="dark"] .navbar-default,html[data-theme="dark"] .table,html[data-theme="dark"] .auth-page form,html[data-theme="dark"] .editor-page .col-sm-9{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea,html[data-theme="dark"] .modal-content{background:#141d30;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .study-tab{color:var(--ink)}
html[data-theme="dark"] .study-tab.is-active{background:var(--green)}
html[data-theme="dark"] .word-chip,html[data-theme="dark"] .tab-count,html[data-theme="dark"] .language-pair span:nth-child(2){background:#303b58;color:#e7ecff}
html[data-theme="dark"] .text-muted,html[data-theme="dark"] label{color:var(--muted)}
.theme-toggle{position:fixed;right:20px;bottom:20px;z-index:1050;display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:30px;padding:11px 17px;background:var(--surface);color:var(--ink);box-shadow:0 4px 20px #0003;font:600 14px/1.4 inherit;cursor:pointer}
.theme-toggle:hover{border-color:var(--green)}.theme-toggle:focus-visible{outline:3px solid #ffaf32;outline-offset:3px}
body{padding-bottom:76px}
@media(max-width:600px){.theme-toggle{right:12px;bottom:12px;padding:10px 14px}}

:root{--soft:#e6eaff}html[data-theme="dark"]{--soft:#293551}
.auth-page{background:radial-gradient(ellipse at top left,#6950d530,transparent 55%),var(--paper)}
.auth-page .auth-card{background:var(--surface);color:var(--ink);border-color:var(--line)}
.auth-page .auth-card input:not([type="checkbox"]){background:var(--paper);color:var(--ink);border-color:var(--line)}
.auth-page .auth-card label{color:var(--ink)}
html[data-theme="dark"] .word-content h2,html[data-theme="dark"] .word-example,html[data-theme="dark"] .study-heading h1,html[data-theme="dark"] .auth-card h1{color:var(--ink)}
html[data-theme="dark"] .session-toolbar,html[data-theme="dark"] .study-summary,html[data-theme="dark"] .progress-summary,html[data-theme="dark"] .card-hint,html[data-theme="dark"] .pronounce{background:var(--soft);color:var(--ink)}

.auth-page #login.auth-card{background:var(--surface);color:var(--ink);border-color:var(--line)}
.auth-page #login.auth-card input:not([type="checkbox"]){background:var(--paper);color:var(--ink);border-color:var(--line)}

.auth-page{background:radial-gradient(ellipse at top left,#6950d530,transparent 55%),var(--paper)!important}
.auth-page #login.auth-card input:not([type="checkbox"]){background:var(--paper)!important;color:var(--ink)!important}

/* Sidebar contrast in both themes. */
.study-sidebar .stage-words>span{background:#e4ebf7;color:#243652;border:1px solid #cad6e9}
.study-sidebar .stage-count,.study-sidebar .stage-chevron,.study-sidebar .collection-heading>span{color:#53647c}
.study-sidebar .progress-panel{background:#e1ecfa;color:#20344f}
.study-sidebar .progress-panel h2,.study-sidebar .progress-numbers strong{color:#182e4b}
.study-sidebar .progress-panel p,.study-sidebar .progress-panel .eyebrow,.study-sidebar .progress-numbers span,.study-sidebar .progress-caption{color:#425c7a}
html[data-theme="dark"] .study-sidebar .stage-words>span{background:#303e59;color:#f0f4ff;border-color:#4a5b79}
html[data-theme="dark"] .study-sidebar .stage-count,html[data-theme="dark"] .study-sidebar .stage-chevron,html[data-theme="dark"] .study-sidebar .collection-heading>span{color:#bdcce2}
html[data-theme="dark"] .study-sidebar .progress-panel{background:#23354d;color:#f0f4ff}
html[data-theme="dark"] .study-sidebar .progress-panel h2,html[data-theme="dark"] .study-sidebar .progress-numbers strong{color:#fff}
html[data-theme="dark"] .study-sidebar .progress-panel p,html[data-theme="dark"] .study-sidebar .progress-panel .eyebrow,html[data-theme="dark"] .study-sidebar .progress-numbers span,html[data-theme="dark"] .study-sidebar .progress-caption{color:#c3d2e7}
