:root{color-scheme:light}
.theme-control{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;color:var(--green,#173e35);font:500 11px/1.4 system-ui,sans-serif}
.theme-control svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.theme-control select{max-width:110px;min-height:38px;border:1px solid var(--line,#dce2d2);border-radius:8px;background:var(--paper,#fffefa);color:var(--ink,#263b34);padding:7px 6px;cursor:pointer;font:inherit}
.theme-control select:focus-visible{outline:3px solid #b4935d;outline-offset:3px}
.legal-header{flex-wrap:wrap}.legal-header .theme-control{margin-left:auto}
body>.theme-control{margin:0 0 20px}
@media(max-width:1450px){.topbar-date{display:none}}
@media(max-width:640px){.topbar-right{gap:8px}.topbar .theme-control{gap:0}.topbar .theme-control svg{display:none}.topbar .theme-control select{max-width:88px;min-height:36px;font-size:10px}.topbar #accountButton{max-width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;gap:6px}.topbar .breadcrumb span,.topbar .breadcrumb b{display:none}.legal-header .theme-control{margin-left:0}}
html[data-theme=dark]{color-scheme:dark;--bg:#121c18;--paper:#1b2822;--ink:#e6ebe3;--muted:#aeb9aa;--green:#a8cfb5;--green-soft:#283e30;--gold:#d2b47b;--gold-soft:#3d3423;--line:#3b493e;--red:#efa898;--shadow:0 7px 35px #00000016}
html[data-theme=dark] body{background:var(--bg);color:var(--ink)}
html[data-theme=dark] :is(.sidebar,.topbar){background:#17231d}
html[data-theme=dark] :is(.nav-caption,.breadcrumb,.breadcrumb b,.topbar-date,.connection-note,.connection-note b,.sidebar-bottom>span,.card-kicker,.page-intro p,.atlas-top p,.challenge-card>p,.mini-time,.reward-line,.small-note,.journey-row p,.journey-stats span,.progress-label,.guest-prompt,.guest-prompt+p,.date-tile span,.lesson-meta,.learning-note p,.compact-card p,.site-footer,.site-footer a,.info-card p,.info-list li,.form-field small,.hint-box,.lesson-state,.resource-card p,.profile-head p,.stat-card span,.empty-state p,.dialog-body>p,.auth-divider,.auth-demo-note,.sources-intro p,.sources-heading>span,.source-author,.source-description,.source-domain,.sources-footnote,.sources-library-link p,.source-admin-head p,.source-admin-row p,.learning-profile>p,.daily-start p,.daily-complete p,.question-wizard-intro,.question-common summary>span,.question-wizard-actions>[data-step-caption],.publication-summary p,.publication-summary span,.usage-notice small,.usage-notice p>span,.leaderboard-intro p,.leaderboard-own-stats,.leaderboard-toolbar p,.leaderboard-footnote,.question-suggestion p,.palette-heading>span,.palette-note,.atlas-shared-seal>span:last-child,.atlas-count,.map-legend,.map-detail p){color:var(--muted)}
html[data-theme=dark] :is(.sidebar nav a,.sidebar-quote,.info-list b,.form-field label,.form-field>span,.source-publish,.level-option strong,.placement-word,.placement-item label,.question-common summary,.publication-summary strong,.leaderboard-own-stats strong,.question-suggestion .suggestion-status,.atlas-shared-seal,.atlas-callout strong){color:var(--ink)}
html[data-theme=dark] :is(.sidebar-quote em,.intro-mark,.level-option>span,.level-option b,.join-steps li>span){color:var(--gold)}
html[data-theme=dark] .sidebar nav a:hover{background:#293e30;color:var(--ink)}
html[data-theme=dark] :is(.button,.sidebar nav a.active,.filter-row button.active,.admin-tabs button.active,.question-steps li[aria-current=step],.reading-series-nav a[aria-current=page]>span){background:#345b45;border-color:#63856c;color:#f4f7f1}
html[data-theme=dark] .button:hover{background:#416f54}
html[data-theme=dark] .button-outline{background:transparent;border-color:#697c64;color:var(--green)}
html[data-theme=dark] .button-outline:hover{background:#2d4132}
html[data-theme=dark] .button-gold{background:#796135;border-color:#b1955d;color:#fff8e9}
html[data-theme=dark] .button-gold:hover{background:#8b7140}
html[data-theme=dark] :is(.soft-label,.pill,.avatar,.nav-badge,.leaderboard-rank,.leaderboard-name small){background:var(--green-soft);border-color:var(--line);color:var(--green)}
html[data-theme=dark] :is(.pill-gold,.leaderboard-rank.rank-top,.achievement,.compact-card .feature-symbol,.source-mini,.action-symbol){background:var(--gold-soft);border-color:#70603e;color:var(--gold)}
html[data-theme=dark] :is(.atlas-tabs,.date-tile,.inline-note,.learning-note,.atlas-callout,.map-detail,.sources-library-link,.level-option,.question-common,.question-steps li,.leaderboard-table thead,.reading-letter-grid>div,.reading-table caption,.reading-table thead th,.legal-table th,.note){background:#25362a;border-color:var(--line);color:var(--ink)}
html[data-theme=dark] :is(.sources-intro,.leaderboard-intro,.reading-course-intro){background:linear-gradient(115deg,#283c2e,#343122);border-color:var(--line)}
html[data-theme=dark] :is(.answer-feedback,.reset-status,.reset-status.success,.level-option.active,.level-option:hover,.question-steps li.is-complete,.publication-summary,.usage-notice,.leaderboard-self,.question-suggestion,.reading-series-nav a[aria-current=page],.legal-summary,.success .action-symbol){background:#2a4030;border-color:#668360;color:#d3e5c9}
html[data-theme=dark] :is(.answer-feedback.error,.reset-status.error,.error .action-symbol){background:#452e25;border-color:#a6785b;color:#f1c9b5}
html[data-theme=dark] :is(.form-error,.question-suggestion .suggestion-status.is-error){color:#f0ac96}
html[data-theme=dark] :is(.usage-near,.usage-high,.reading-note){background:#403621;border-color:#927944;color:#e7d19e}
html[data-theme=dark] :is(.usage-near small,.usage-high small,.reading-note p){color:#ddcba7}
html[data-theme=dark] .media-warning{background:#452e25!important;border-color:#a6785b!important;color:#f1c9b5!important}
html[data-theme=dark] :is(.form-field input,.form-field textarea,.form-field select,.answer-input-row input,.field input,.invite-result input){background:#14221a;color:var(--ink);border-color:#687b60}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#a7b59f;opacity:1}
html[data-theme=dark] :is(input[type=checkbox],input[type=radio]){accent-color:#a8cfb5}
html[data-theme=dark] :is(.filter-row button,.admin-tabs button,.atlas-select){color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.journey-stats,.atlas-bottom,.question-steps,.leaderboard-table th,.leaderboard-table td,.reading-article section+section,.reading-reader-pagination,.reading-table th,.reading-table td,.reading-table-wrap){border-color:var(--line)}
html[data-theme=dark] .progress-track{background:#39482f}
html[data-theme=dark] dialog{border-color:var(--line);box-shadow:0 25px 100px #0008}
html[data-theme=dark] dialog::backdrop{background:#07130dc9}
html[data-theme=dark] .toast{background:#294836;color:#eff5e9;border-color:#9cb18f}
html[data-theme=dark] .mobile-nav{background:#17231df5}
html[data-theme=dark] .mobile-nav a{color:var(--muted)}
html[data-theme=dark] .mobile-nav a.active{color:var(--green)}
html[data-theme=dark] :is(.color-swatch:hover,.color-swatch[aria-pressed=true]){background:#2b3d2c}
html[data-theme=dark] .palette-heading strong{color:var(--green)}
html[data-theme=dark] .district-buttons button{background:#2c3528;border-color:#8c7952;color:#e5dbbc}
html[data-theme=dark] .district-buttons button.is-owned{background:#304632;border-color:#90aa79;color:#d6e5c2}
html[data-theme=dark] .district-buttons button.is-reachable:not(.is-owned){background:#2c4430;border-color:#a5bf86;color:#d5ecc4}
/* Text exercises stay warm and legible; uploaded scans retain their own colors. */
html[data-theme=dark] .manuscript.text-manuscript{background-color:#342f21;background-image:linear-gradient(125deg,#4a402766,#161d150f);border-color:#8b7446}
html[data-theme=dark] .manuscript.text-manuscript .ottoman-word{color:#ead5a4}
html[data-theme=dark] .manuscript.text-manuscript::after{color:#cfb886}
html[data-theme=dark] .upload-preview{background:#302e21;border-color:#7a6c48}
html[data-theme=dark] .upload-preview p{color:#d1c5a2}
html[data-theme=dark] :is(.reading-course-body p,.reading-course-note,.reading-reader-heading p,.reading-article p,.reading-letter-grid span,.reading-article .reading-small,.reading-series-nav a,.reading-aside-note,.reading-figure figcaption,.reading-zoom-note,.reading-room-loading){color:var(--muted)}
html[data-theme=dark] :is(.reading-course-body>strong,.reading-article strong,.reading-letter,.reading-aside-note strong){color:#c7ddbf}
html[data-theme=dark] :is(.reading-series-nav a>span,.reading-letter-grid>div){border-color:var(--line)}
html[data-theme=dark] :is(.reading-figure-open>span,.reading-zoom-controls button){background:#2b4030;border-color:var(--line);color:var(--ink)}
html[data-theme=dark] .reading-note p{color:#ddcba7}
html[data-theme=dark] :is(.legal-article p,.legal-lead,.field label){color:#c5d0bf}
html[data-theme=dark] :is(.legal-eyebrow,.legal-links a){color:var(--green)}
html[data-theme=dark] .action-card{background:var(--paper);border-color:var(--line)}
html[data-theme=dark] :is(.back-link,body>footer){color:var(--muted)}
@media print{html[data-theme=dark]{--bg:white;--paper:white;--ink:#263b34;--muted:#657369;--green:#173e35;--line:#e3e5db}html[data-theme=dark] body{background:white;color:#263b34}.theme-control{display:none}html[data-theme=dark] .legal-article p{color:#45594e}html[data-theme=dark] .legal-summary{background:#eaf0e6;color:#263b34}}
