:root{color-scheme:light;--diagram-tori:#476647;--diagram-uke:#b98d71;--diagram-grid:#dde3d4;--diagram-arrow:#a4af91;--diagram-contact:#aeb99c;--hero-field:#e3e7dc;--hero-grid:#cdd2c6;--hero-ring:#c0c8b8}
html[data-theme="dark"]{color-scheme:dark;--paper:#171e1a;--white:#222b25;--ink:#e2eadc;--text:#cad5c8;--muted:#b5c1af;--line:#414e42;--green:#a8c997;--soft:#2d3b30;--orange:#dfa983;--on-accent:#17251a;--surface-alt:#1b251e;--surface-raised:#2a382d;--subtle:#aebda4;--diagram-tori:#a5c995;--diagram-uke:#dfa886;--diagram-grid:#3b4b3e;--diagram-arrow:#a9bc9d;--diagram-contact:#81977c;--hero-field:#293a2e;--hero-grid:#526557;--hero-ring:#687c69}
.theme-control{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;color:var(--ink);font-size:11px;white-space:nowrap}
.theme-icon{font-size:17px;line-height:1;color:var(--muted)}
.theme-label{font-size:10px;color:var(--muted)}
.theme-control select{font:inherit;color:var(--ink);background:var(--white);border:1px solid var(--line);border-radius:5px;padding:7px 5px;max-width:100px;cursor:pointer}
.theme-control select:focus-visible{outline:3px solid #b57958;outline-offset:3px}
.auth-header .theme-control{margin-left:auto}
@media(max-width:1050px){.header .source-top{display:none}}
@media(max-width:760px){.header{grid-template-columns:minmax(0,1fr) auto auto;column-gap:10px}.header nav{grid-column:1/4}.header .theme-control{grid-column:2;grid-row:1}.header :is(.account-menu,.account-login){grid-column:3}.theme-label{display:none}.theme-control select{font-size:10px;max-width:82px;padding:6px 3px}.theme-icon{font-size:15px}}
@media(max-width:650px){.auth-header{height:auto;min-height:82px;flex-wrap:wrap;gap:10px;padding-top:14px;padding-bottom:14px}.auth-header .header-note{display:none}.auth-header .back-link{order:3;width:100%}.auth-header .theme-control{margin-left:auto}}
@media screen{
 html[data-theme="dark"] :is(.hero h1 em,.card-jp,.detail-jp,.detail-kana,.rank-kanji,.side-note>span,.card-done .card-heading h3){color:#b2cda5}
 html[data-theme="dark"] :is(.eyebrow,.header-note,.tab small,.breadcrumb span,.hero-copy>p,.hero-bottom,.hero-bottom b,.grade-subtitle,.breadcrumb,.grade-note,.rank-caption,.side-note p,.section-label,.section-label select,.card-ru,.card-bottom,.arrow-label,.item-num,.variation,.end-note,.source-links a span,footer,.detail-body>p,.detail-section-title small,.detail-focus,.detail-source,.detail-body>.detail-caution,.reading small,.glossary-card p,.glossary-card .reading-text,.muted,.intro,.hint,.auth-bottom,.auth-footer,.field small,.secret-caption,.admin-table th,.audit-list,.nickname-counter){color:var(--muted)}
 html[data-theme="dark"] :is(.audience-switch,.account-menu>summary,.close-btn){background:var(--surface-raised);color:var(--ink);border-color:var(--line)}
 html[data-theme="dark"] .grade{color:var(--muted)}
 html[data-theme="dark"] .grade:hover{background:var(--surface-raised)}
 html[data-theme="dark"] .grade.active{background:var(--green);color:var(--on-accent)}
 html[data-theme="dark"] .grade.active .rank-jp{color:var(--on-accent)}
 html[data-theme="dark"] :is(.progress-panel,.scheme,.timer,.invite-result,.secret-box,.role-pill){background:var(--surface-raised);border-color:var(--line);color:var(--ink)}
 html[data-theme="dark"] :is(.progress-symbol,.progress-percent,.phase-header,.role-pill,.status){color:#b5d4a7;border-color:#6a8068}
 html[data-theme="dark"] .bar{background:#405144}
 html[data-theme="dark"] .bar>span{background:#aacb99}
 html[data-theme="dark"] :is(.phase,.admin-table td){border-color:var(--line)}
 html[data-theme="dark"] .phase p{color:#c4d1bc}
 html[data-theme="dark"] .scheme-legend{color:var(--muted)}
 html[data-theme="dark"] .scheme-legend i{background:var(--diagram-tori)}
 html[data-theme="dark"] .scheme-legend i.uke{background:var(--diagram-uke)}
 html[data-theme="dark"] :is(.type-badge,.term-chip,.variant-buttons button,.actions button){background:var(--surface-raised);border-color:var(--line);color:#c3d8b7}
 html[data-theme="dark"] :is(.type-badge.throw,.actions .danger){background:#45342a;border-color:#715642;color:#e7bc99}
 html[data-theme="dark"] .type-badge.control{background:#293a3b;border-color:#486160;color:#b0d0cf}
 html[data-theme="dark"] :is(.primary-btn,.primary,.variant-buttons button.active){background:var(--green);border-color:var(--green);color:var(--on-accent)}
 html[data-theme="dark"] :is(#toast,#auth-toast){background:#b4d2a2;color:#17251a}
 html[data-theme="dark"] :is(.check-btn,.empty,.progress-symbol){border-color:#788c73}
 html[data-theme="dark"] .check-btn.done{background:#9bbe8a;color:#17251a}
 html[data-theme="dark"] :is(.variant-note){background:var(--surface-raised);border-color:#859c7d;color:#c4d1bc!important}
 html[data-theme="dark"] :is(.audio-btn){background:var(--surface-raised);border-color:var(--line);color:#c3d8b7}
 html[data-theme="dark"] :is(.search input,.field input,.invite-result input){background:var(--surface-alt);border-color:var(--line);color:var(--ink)}
 html[data-theme="dark"] :is(.search input,.field input)::placeholder{color:#9ba995;opacity:1}
 html[data-theme="dark"] .account-panel{background:var(--white);border-color:var(--line);box-shadow:0 8px 30px #0008}
 html[data-theme="dark"] :is(.account-panel small,.account-panel a,.account-panel button){color:#bdcfb1}
 html[data-theme="dark"] .error{background:#462c29;color:#f4c4b3;border-color:#d39d7e}
 html[data-theme="dark"] .timer.urgent{background:#493729;color:#ecc39b;border-color:#806749}
 html[data-theme="dark"] :is(.steps,.secret-box button,.status.off){color:#c8b59a}
 html[data-theme="dark"] .steps span{border-color:var(--line)}
 html[data-theme="dark"] .steps .current{color:#c3d8b7;border-color:#a8c997}
 html[data-theme="dark"] .qr-box{background:#fff}
 html[data-theme="dark"] .invite-result input{background:var(--surface-alt)}
 html[data-theme="dark"] .hero-art circle[fill="#e3e7dc"]{fill:var(--hero-field)}
 html[data-theme="dark"] .hero-art circle[stroke="#c0c8b8"]{stroke:var(--hero-ring)}
 html[data-theme="dark"] .hero-art pattern path{stroke:var(--hero-grid)}
}
@media print{html[data-theme]{color-scheme:light;--paper:#fff;--white:#fff;--ink:#000;--muted:#555;--line:#ccc;--green:#2e4c3b}.theme-control{display:none!important}}
@media screen{html[data-theme="dark"] .next-exam{background:var(--surface-raised);border-color:#6a8068}html[data-theme="dark"] .next-exam>span,html[data-theme="dark"] .next-exam small{color:var(--muted)}html[data-theme="dark"] .grade.recommended:not(.active){border-color:#789875;color:#c6dfb9}html[data-theme="dark"] .level-field select,html[data-theme="dark"] .level-field input{background:var(--surface-alt);color:var(--ink);border-color:var(--line)}}
@media print{.next-exam,.profile-level{display:none!important}}
.language-control{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--muted,#637064)}
.language-control select{font:inherit;color:inherit;background:var(--white,#fffefa);border:1px solid var(--line,#d8ddd3);border-radius:6px;padding:7px 4px;max-width:100px}
.cookie-settings{font:inherit;color:inherit;border:0;background:none;text-decoration:underline;cursor:pointer;padding:8px}
.cookie-notice{position:fixed;z-index:1000;bottom:18px;left:18px;width:min(620px,calc(100% - 36px));padding:22px;border:1px solid var(--line,#cbd1c5);border-radius:12px;background:var(--white,#fffefa);color:var(--ink,#23372c);box-shadow:0 8px 40px #0003;max-height:75vh;overflow:auto}
.cookie-notice h2{font-size:20px;margin:0 0 10px}.cookie-notice p{font-size:14px;line-height:1.6;margin:0 0 14px}.cookie-actions{display:flex;gap:12px;flex-wrap:wrap}.cookie-actions button{font:inherit;cursor:pointer;border:1px solid #71816e;border-radius:6px;padding:10px 16px;background:transparent;color:inherit}.cookie-actions button[data-consent=accepted]{background:#2d493d;color:#fffefa}.cookie-notice #privacy-error:empty{display:none}
@media(max-width:700px){.language-control>span{display:none}.header,.auth-header{flex-wrap:wrap}.cookie-notice{padding:16px}.cookie-actions button{flex:1}.language-control{margin-left:0}}
@media print{.cookie-notice,.cookie-settings,.language-control{display:none!important}}
@media(max-width:1200px){
 .header{height:auto;min-height:106px;display:grid;grid-template-columns:minmax(80px,1fr) auto auto auto;column-gap:12px;row-gap:6px;padding-top:12px;padding-bottom:6px}
 .header .brand{grid-column:1/3;grid-row:1}
 .header .theme-control{grid-column:3;grid-row:1}
 .header :is(.account-menu,.account-login){grid-column:4;grid-row:1;margin:0}
 .header .language-control{grid-column:1;grid-row:2;justify-self:start}
 .header .language-control>span{display:none}
 .header nav{grid-column:2/5;grid-row:2;margin:0 0 0 auto;min-height:32px;align-items:stretch}
 .header .source-top{display:none}
}

.session-ttl-hint{font-size:10px;color:var(--muted);line-height:1.6;margin:0 0 12px}.account-panel{max-height:calc(100dvh - 90px);overflow-y:auto}.profile-level .level-field small{margin:0;font-size:10px}
@media(max-width:440px){
 .header{grid-template-columns:minmax(0,1fr) auto;row-gap:6px}
 .header .brand{grid-column:1;grid-row:1;min-width:0}
 .header :is(.account-menu,.account-login){grid-column:2;grid-row:1}
 .header .language-control{grid-column:1;grid-row:2}
 .header .language-control select{max-width:140px}
 .header .theme-control{grid-column:2;grid-row:2;justify-self:end}
 .header nav{grid-column:1/3;grid-row:3;justify-content:center;flex-wrap:wrap;margin:0;gap:12px}
}
