/* Application theme. Public pages keep their existing light-only presentation. */
@media screen {
  html[data-izi-surface="app"] .appearance-settings {margin-top:22px;padding:16px 20px;border:1px solid #ded8cc;border-radius:16px;background:#fffaf2;color:#102a42}
  html[data-izi-surface="app"] .appearance-settings summary {min-height:44px;display:flex;align-items:center;gap:10px;font-weight:700;cursor:pointer;color:#20536d}
  html[data-izi-surface="app"] .appearance-settings summary::before {content:'◐';font-size:21px;line-height:1}
  html[data-izi-surface="app"] .appearance-settings fieldset {margin:6px 0 0;padding:0;border:0}
  html[data-izi-surface="app"] .appearance-settings legend {margin-bottom:10px;font-size:14px;font-weight:700}
  html[data-izi-surface="app"] .appearance-options {display:flex;flex-wrap:wrap;gap:8px}
  html[data-izi-surface="app"] .appearance-options label {display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid #c4cdcf;border-radius:10px;background:#fffdfa;font-size:14px;font-weight:600;cursor:pointer}
  html[data-izi-surface="app"] .appearance-options label:has(input:checked) {border-color:#d67521;background:#fff0df}
  html[data-izi-surface="app"] .appearance-options input {width:18px;height:18px;min-height:18px;margin:0;accent-color:#277b55}
  html[data-izi-surface="app"] .appearance-settings p {margin:10px 0 0;font-size:13px;color:#566779}
  html[data-izi-surface="app"] .appearance-settings :is(summary,input):focus-visible {outline:3px solid #21658e;outline-offset:3px}

  html[data-izi-surface="app"][data-izi-theme="dark"] {
    color-scheme:dark;
    --ui-ink:#edf4f8;
    --ui-muted:#b1c1ce;
    --ui-paper:#17283a;
    --ui-background:#0e1928;
    --ui-line:#354b5d;
    --ui-green:#86d6a7;
    --ui-orange:#ff9b43;
    --ui-blue:#9acded;
    --account-action-bg:var(--ui-orange);
    --account-action-line:#e48a37;
    --account-action-ink:#102434;
    --ui-activity:#91cfff;
    --ui-step-done:#6387a6;
    --dark-info:#1b344b;
    --dark-info-line:#476b89;
    --dark-info-ink:#d7ebfa;
    --ui-shadow:0 10px 28px #00000024;
    --dark-inset:#101f2d;
    --dark-raised:#1c3042;
    --dark-border:#3b5366;
    --dark-success:#173a33;
    --dark-warning:#493321;
    --dark-error:#482a2b;
    --erasure-accent:#ffb5a7;
    --erasure-accent-surface:var(--dark-error);
    --erasure-account-surface:var(--dark-inset);
    --erasure-finance-surface:var(--dark-warning);
    --erasure-finance-line:#926b42;
    --erasure-finance-ink:#ffe1b9;
    background:var(--ui-background);
  }
  html[data-izi-surface="app"][data-izi-theme="dark"] :is(input,textarea,select,button) {color-scheme:dark}
  html[data-izi-surface="app"][data-izi-theme="dark"] body,
  html[data-izi-surface="app"][data-izi-theme="dark"] body:not(.pricing-page):not(.legal-page):not(.public-page),
  html[data-izi-surface="app"][data-izi-theme="dark"] body:has(#app.workspace),
  html[data-izi-surface="app"][data-izi-theme="dark"] body#account-page#account-page#account-page,
  html[data-izi-surface="app"][data-izi-theme="dark"] body.access-page {
    background:#0e1928; color:var(--ui-ink);
  }
  html[data-izi-surface="app"][data-izi-theme="dark"] body::before,
  html[data-izi-surface="app"][data-izi-theme="dark"] body::after,
  html[data-izi-surface="app"][data-izi-theme="dark"] body:not(.pricing-page):not(.legal-page):not(.public-page)::before,
  html[data-izi-surface="app"][data-izi-theme="dark"] body:not(.pricing-page):not(.legal-page):not(.public-page)::after {content:none}
  /* These shells are visible before the normal workspace/account views mount. */
  html[data-izi-surface="app"][data-izi-theme="dark"] #app.app--landing {background:var(--ui-background);color:var(--ui-ink)}
  html[data-izi-surface="app"][data-izi-theme="dark"] #appFooter {display:none}
  html[data-izi-surface="app"][data-izi-theme="dark"] #app .account-prerender {background:var(--ui-background);color:var(--ui-ink)}
  html[data-izi-surface="app"][data-izi-theme="dark"] #app :is(.builder-loading,.initial-account-loading,.account-loading),
  html[data-izi-surface="app"][data-izi-theme="dark"] #account-page .account-loading {background:var(--ui-paper);border-color:var(--ui-line);color:var(--ui-ink)}
  html[data-izi-surface="app"][data-izi-theme="dark"] #app :is(.builder-prerender h1,.builder-loading h2,.initial-account-intro h1) {color:var(--ui-ink)}
  html[data-izi-surface="app"][data-izi-theme="dark"] #app :is(.builder-prerender .ui-description,.builder-loading p,.initial-account-intro>p,.initial-account-intro .initial-account-eyebrow),
  html[data-izi-surface="app"][data-izi-theme="dark"] #account-page .account-loading p {color:var(--ui-muted)}
  html[data-izi-surface="app"][data-izi-theme="dark"] #app .initial-account-intro h1 em {color:#ffb365}
  html[data-izi-surface="app"][data-izi-theme="dark"] #app .initial-placeholder {background:#2b4050}
  html[data-izi-surface="app"][data-izi-theme="dark"] .account-loading__mark {border-color:#526b7c;border-top-color:var(--ui-activity)}
  html[data-izi-surface="app"][data-izi-theme="dark"] body #account-header.app-header {background:linear-gradient(110deg,#07111e,#10283b);border-bottom:1px solid #2b4052}
  html[data-izi-theme="dark"] .appearance-settings {background:#17283a;border-color:#354b5d;color:#edf4f8}
  html[data-izi-theme="dark"] .appearance-settings summary {color:#9acded}
  html[data-izi-theme="dark"] .appearance-options label {background:#101f2d;border-color:#526b7c;color:#edf4f8}
  html[data-izi-theme="dark"] .appearance-options label:has(input:checked) {background:#413022;border-color:#f6a154;color:#fff1df}
  html[data-izi-theme="dark"] .appearance-settings p {color:#b1c1ce}
  html[data-izi-theme="dark"] .appearance-settings :is(summary,input):focus-visible {outline-color:#ffbd70}
  html[data-izi-surface="app"][data-izi-theme="dark"] body #account-header .account-menu-panel {background:#1c3042;border-color:#405a6b;color:#edf4f8}
  html[data-izi-surface="app"][data-izi-theme="dark"] body #account-header .account-menu-panel :is(a,button) {color:#edf4f8}
  html[data-izi-surface="app"][data-izi-theme="dark"] body #account-header .account-menu-panel :is(a,button):hover {background:#304b5b}
  html[data-izi-surface="app"][data-izi-theme="dark"] body #account-header .account-menu-rule {border-color:#405668}
  html[data-izi-surface="app"][data-izi-theme="dark"] body #account-header :is(.brand,.topbar-nav a,.account-login) {color:#fffaf2}

  html[data-izi-theme="dark"] #app.workspace :is(.card:not(.solve-form--work):not(.teacher-results-card):not(.quote-card:has(.builder-price-card)),.builder-source,.ready-link-card,.history-entry),
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(.card,.account-b-identity,.account-b-security,.account-b-help,.wallet-summary,.wallet-b-heading,.wallet-buy-modes,.wallet-disclosure) {
    background:var(--ui-paper);border-color:var(--ui-line);color:var(--ui-ink);box-shadow:var(--ui-shadow);
  }
  html[data-izi-theme="dark"] #app.workspace :is(.history-hero-card,.score-card) {color:#fff9ed}
  html[data-izi-theme="dark"] #app.workspace :is(.history-hero h1,.history-hero p,.score-copy h2) {color:#fff9ed}
  html[data-izi-theme="dark"] #app.workspace :is(.builder-side>.paper,.ready-link-card--private,.aside-box,.solve-side,.teacher-aside .aside-box,.history-entry[data-status="expired"]),
  html[data-izi-theme="dark"] #account-page :is(.account-b-help,#invoice-fields,#annual-invoice-fields) {background:var(--dark-inset);border-color:var(--ui-line);color:var(--ui-ink)}
  html[data-izi-theme="dark"] #app.workspace :is(.builder-upload-drop:not(.has-files),.empty,.teacher-empty) {background:var(--dark-info);border-color:var(--dark-info-line);color:var(--ui-ink)}
  html[data-izi-theme="dark"] #app.workspace .builder-upload-drop.has-files {background:none}
  html[data-izi-theme="dark"] #app.workspace .upload-option {background:var(--dark-raised);border-color:var(--dark-border);color:var(--ui-ink)}

  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page,body.access-page) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),textarea,select) {
    background:#0e1c29;border-color:#587082;color:var(--ui-ink);caret-color:#ffb365;
  }
  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page,body.access-page) :is(input,textarea)::placeholder {color:#a6b6c5;opacity:1}
  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page,body.access-page) :is(input[type=checkbox],input[type=radio]) {accent-color:var(--ui-orange)}
  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page,body.access-page) :is(button,a,input,select,textarea,summary):focus-visible {outline:3px solid #ffbd70;outline-offset:3px}
  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page,body.access-page) :is(.btn.secondary,.btn:not(.primary):not(.danger):not(.ghost)) {background:#203548;border-color:#526b7c;color:#edf4f8}
  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page,body.access-page) .btn.primary {background:var(--ui-orange);border-color:#e48a37;color:#102434}
  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page,body.access-page) .btn.primary:hover:not(:disabled) {background:#ffb36c;color:#102434}
  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page,body.access-page) :is(.btn.ghost,a:not(.btn),summary) {color:var(--ui-blue)}
  html[data-izi-theme="dark"] :is(#app.workspace,body#account-page) :is(.btn.danger,[data-revoke-key],.account-b-erasure) {color:#ffaaa0}

  html[data-izi-theme="dark"] #app.workspace :is(.builder-option-card,.answer-choice,.study-answer,.compact-task,.chapter-links a,.stat-tile,.teacher-answer-pair>div,.answer-cell,.solution-step,.parent-note,.figure,.answer-bank,.solve-answer-grid>div,.teacher-empty,.identity-ticket,.fake-link,.ready-link-card .copy-row,.ready-link-card .link-input,.history-entry__meta>span),
  html[data-izi-theme="dark"] #account-page :is(.account-key-list>li,.account-device-list>li,.annual-offer>span,.annual-audience label) {background:var(--dark-inset);border-color:var(--dark-border);color:var(--ui-ink)}
  html[data-izi-theme="dark"] #app.workspace :is(.builder-option input:checked+.builder-option-card,.answer-choice:has(input:checked),.study-answer:has(input:checked)),
  html[data-izi-theme="dark"] #account-page :is(.annual-offer input:checked+span,.annual-audience label:has(input:checked),.presets .btn[aria-pressed=true]) {background:#413022;border-color:#f6a154;color:#fff1df}
  html[data-izi-theme="dark"] #app.workspace :is(.ready-share-actions,.answer-bank span,.teacher-answer-pair>div:last-child,.answer-cell.expected,.solve-answer-grid>div:last-child,.teacher-summary-preview,.teacher-review-score-preview,.identity-strip,.teacher-comment),
  html[data-izi-theme="dark"] #account-page :is(#annual-offer-summary .money-row,.quote:not(.is-error)) {background:var(--dark-info);border-color:var(--dark-info-line);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] #app.workspace :is(.feedback-toggle:hover,.answer-choice:hover,.result-task>summary:hover,.person-row:hover) {background:#294655;color:#fff}
  html[data-izi-theme="dark"] #app.workspace :is(.builder-step-bars i,.skeleton,.solve-progress,.analysis-row .progress-meter) {background:#33495a}

  html[data-izi-theme="dark"] #app.workspace :is(.notice,.access-session-notice),
  html[data-izi-theme="dark"] #account-page :is(.access-session-notice,.topup-receipt .notice.blue) {background:#1b384b;border-color:#4c7185;color:#d3ebf7}
  html[data-izi-theme="dark"] #app.workspace :is(.notice.warn,.builder-session-notice,.quote-material-warning,.history-resume,.history-active-card,.visibility-note,.solve-submit-bar__copy.warn),
  html[data-izi-theme="dark"] #account-page :is(.wallet-sandbox,.topup-receipt .notice.warn) {background:var(--dark-warning);border-color:#926b42;color:#ffe1b9}
  html[data-izi-theme="dark"] #app.workspace :is(.builder-session-notice__icon,.history-active-card .feature-icon) {background:#74552f;color:#ffe2ae}
  html[data-izi-theme="dark"] #app.workspace :is(.notice.error,.access-key-error,.email-code-error,.danger-zone),
  html[data-izi-theme="dark"] #account-page :is(.access-key-error,.email-code-error) {background:var(--dark-error);border-color:#975957;color:#ffd1c9}
  html[data-izi-theme="dark"] #app.workspace :is(.notice.ok,.notice.success,.funding-result-notice,.published-note) {background:var(--dark-success);border-color:#457662;color:#cff4dd}
  html[data-izi-theme="dark"] #account-page #annual-purchase-detail > .notice.ok {background:var(--dark-success);border-color:#457662;color:#cff4dd}
  html[data-izi-theme="dark"] .system-message {--message-bg:#1b384b;--message-ink:#d4ebf6;--message-border:#4c7185}
  html[data-izi-theme="dark"] .system-message button:hover {background:var(--dark-inset)}
  html[data-izi-theme="dark"] #app.workspace .solve-field-error {color:#ffd1c9}
  html[data-izi-theme="dark"] .system-message--success {--message-bg:#173a33;--message-ink:#cff4dd;--message-border:#457662}
  html[data-izi-theme="dark"] .system-message--warn {--message-bg:#493321;--message-ink:#ffe1b9;--message-border:#926b42}
  html[data-izi-theme="dark"] .system-message--error {--message-bg:#482a2b;--message-ink:#ffd1c9;--message-border:#975957}

  html[data-izi-theme="dark"] #app.workspace :is(.pill,.points,.history-status.muted,.account-device-state,.teacher-review-state),
  html[data-izi-theme="dark"] #account-page :is(.account-device-state,.wallet-topup-icon,.account-setting-icon) {background:#2b4050;color:#d4e0e7}
  html[data-izi-theme="dark"] #app.workspace :is(.pill.ok,.history-status,.builder-price-badge,.subject-mark,.question-index b,.task-summary-row .num,.avatar,.compact-task>span:first-child,.teacher-review-task__head .task-number),
  html[data-izi-theme="dark"] #account-page :is(.account-b-badge,.account-b-section-title>span,.wallet-b-icon,.wallet-works-icon,.wallet-topup-icon.is-paid,.account-device-state.is-active) {background:var(--dark-info);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] #app.workspace :is(.pill.warn,.history-status.info,.builder-source-kind--photo,.task-summary-row.missing .num,.person-row.needs-review .avatar),
  html[data-izi-theme="dark"] #account-page :is(.account-b-avatar,.wallet-history-heading-icon,.wallet-topup-icon.is-pending,.wallet-topup-icon.is-expired) {background:#503925;color:#ffdaa9}

  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(.account-intro h1,.account-b-section-title h2,.account-b-help h2,.account-setting>summary,.wallet-b-heading h2,.wallet-summary strong,.access-card h2,.access-card label,.wallet-buy-modes .btn[aria-pressed=true]) {color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(.account-eyebrow,.account-intro p:not(.account-eyebrow),.account-b-identity p,.account-b-section-title p,.account-setting-title small,.account-setting-body,.account-setting-body p,.account-b-help p,.account-b-aside>p,.account-help,.wallet-summary small,.annual-offer small,.key-last-used) {color:var(--ui-muted)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(.account-work-return a,.access-back-link a,.access-signup-link .account-inline,.account-setting-body details summary) {color:var(--ui-blue)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(.account-help,.account-setting,.account-b-erasure,.wallet-buy-modes,.wallet-disclosure,.access-signup-link) {border-color:var(--ui-line)}
  html[data-izi-theme="dark"] #account-page .email-code-panel {background:#1c3445;border-color:#466074;color:var(--ui-ink)}
  html[data-izi-theme="dark"] body.wallet-page:not(#account-page) .access-wrap {color:var(--ui-ink)}
  html[data-izi-theme="dark"] body.wallet-page:not(#account-page) .access-wrap :is(h1,h2,h3,p,dt,dd) {color:var(--ui-ink)}
  html[data-izi-theme="dark"] body.wallet-page:not(#account-page) .access-card {background:var(--ui-paper);border:1px solid var(--ui-line);border-radius:16px;color:var(--ui-ink)}
  html[data-izi-theme="dark"] body.wallet-page:not(#account-page) .access-card #refresh {margin-top:10px}
  html[data-izi-theme="dark"] #app.workspace :is(.study-footer,.builder-notes-disclosure,.builder-upload-help) {border-color:var(--ui-line)}
  /* Account and wallet have older, high-specificity standalone selectors. */
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),textarea,select) {background:#0e1c29;border-color:#587082;color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.btn.secondary,.btn:not(.primary):not(.danger):not(.ghost)) {background:#203548;border-color:#526b7c;color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.presets .btn[aria-pressed=true],.annual-offer input:checked+span,.annual-audience label:has(input:checked)) {background:#413022;border-color:#f6a154;color:#fff1df}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.wallet-buy-modes .btn,.wallet-buy-modes .btn[aria-pressed=true]) {background:transparent;color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page .wallet-sandbox strong {color:#ffe1b9}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.wallet-summary,.wallet-b-heading,.wallet-buy-modes,.wallet-side .wallet-disclosure,.card,.account-b-identity,.account-b-security,.account-b-help) {background:var(--ui-paper);border-color:var(--ui-line);color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.account-b-help,#invoice-fields,#annual-invoice-fields) {background:var(--dark-inset)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.wallet-b-icon,.wallet-works-icon,.account-b-badge,.account-b-section-title>span,.wallet-topup-icon.is-paid) {background:var(--dark-info);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.annual-offer>span,.annual-audience label,.account-key-list>li,.account-device-list>li) {background:var(--dark-inset);border-color:var(--dark-border);color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(#annual-offer-summary .money-row,.quote:not(.is-error)) {background:var(--dark-info);border-color:var(--dark-info-line);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] #app.workspace :is(.history-empty__icon,.history-empty .feature-icon) {background:var(--dark-info);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] :is(.shared-footer,.study-footer) :is(a,p,span) {color:#b1c1ce}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page {
    --account-ink:#edf4f8;--account-muted:#b1c1ce;--account-paper:#17283a;color:var(--ui-ink);
  }
  html[data-izi-theme="dark"] #app.workspace #account-page:not(.access-inline):not(.wallet-inline) {background:var(--ui-background);color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :where(h1,h2,h3,h4,strong,b,label,legend) {color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :where(p,small,.wallet-summary__label,.access-method-divider,.wallet-entry-meta,.wallet-entry-credits,.amount-control>span) {color:var(--ui-muted)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(.btn.primary,.btn.primary :is(strong,span)) {background:var(--account-action-bg);border-color:var(--account-action-line);color:var(--account-action-ink)}
  html[data-izi-theme="dark"] #account-page .btn.primary:disabled {--account-action-bg:#664b38;--account-action-line:#86654a;--account-action-ink:#f7e5d3}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page .btn.primary :is(strong,span) {background:transparent;border:0}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(.wallet-b-explain,.wallet-panel-link,.access-signup-link .account-inline) {color:var(--ui-blue)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(.wallet-b-bottom,.access-method-divider::before,.access-method-divider::after) {border-color:var(--ui-line)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page #wallet-content#wallet-content .wallet-buy-modes .btn {background:transparent;border:0;border-bottom:3px solid transparent;color:var(--ui-muted);box-shadow:none}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page #wallet-content#wallet-content .wallet-buy-modes .btn[aria-pressed=true] {background:transparent;border-bottom-color:#ff9b43;color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page #wallet-topup-panel#wallet-topup-panel .presets .btn[aria-pressed=true] {background:#413022;border-color:#f6a154;color:#fff1df}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page #wallet-content#wallet-content .btn.primary:disabled {opacity:1;background:#664b38;border-color:#86654a;color:#f7e5d3;box-shadow:none}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(#topup-form,#annual-form) .check input[type=checkbox] {background:#0e1c29;border-color:#8ba9ba}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(#topup-form,#annual-form) .check input[type=checkbox]:checked {background:var(--ui-orange);border-color:var(--ui-orange)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page :is(#topup-form,#annual-form) .check input[type=checkbox]:checked::after {border-color:#102434}
  html[data-izi-theme="dark"] #account-page :is(.btn.primary,#annual-code-form>.btn):hover:not(:disabled) {--account-action-bg:#ffb36c}
  html[data-izi-theme="dark"] #account-page .annual-code-list > li {background:var(--dark-inset);color:var(--ui-ink);border-color:var(--dark-border)}
  html[data-izi-theme="dark"] #account-page .annual-code-scroll-hint {color:var(--ui-muted)}
  html[data-izi-theme="dark"] #account-page .funding-code-preview #annual-cancel-preview {color:var(--ui-blue)}
  /* Populated wallet history and notices retain high-specificity light styles. */
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.wallet-topup-copy .wallet-entry-title,.wallet-topup-price,.wallet-credit-definitions dt) {color:var(--ui-ink)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.wallet-topup-copy .wallet-entry-meta,.wallet-topup-copy .wallet-entry-credits,.wallet-credit-definitions dd) {color:var(--ui-muted)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page :is(.wallet-current-set,.wallet-account-hint) {background:#1b384b;border-color:#4c7185;color:#d3ebf7}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page .wallet-entry-list>li {border-color:var(--ui-line)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page .wallet-entry-arrow {color:var(--ui-muted)}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page .wallet-disclosure>summary:hover {background:#294655;color:#fff}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page .wallet-history-heading-icon {background:#503925;color:#ffdaa9}
  html[data-izi-theme="dark"] :is(body#account-page,#app.workspace #account-page)#account-page#account-page .wallet-works-icon {background:var(--dark-info);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] #app.workspace .note-strip {background:#203b49;color:#d3e8f1}
  html[data-izi-theme="dark"] #app.workspace .builder-step-bars i.active {background:var(--ui-activity)}
  html[data-izi-theme="dark"] #app.workspace .builder-step-bars i.done {background:var(--ui-step-done)}
  html[data-izi-theme="dark"] body #account-header#account-header :is(.brand,.topbar-nav a,.account-login) {color:#fffaf2}
  html[data-izi-theme="dark"] body #appFooter a {color:#a9d7f2}
  html[data-izi-theme="dark"] #app.workspace :is(.phase-card,.share-section,.share-section.private,.teacher-title>.icon-button) {background:#17283a;border-color:#354b5d;color:#edf4f8}
  html[data-izi-theme="dark"] #app.workspace :is(.phase-number-label,.phase-foot,.share-section p,.share-instructions,.privacy-line) {color:#b1c1ce}
  html[data-izi-theme="dark"] #app.workspace :is(.feature-icon,.flow-strip b,.mini-guide b) {background:var(--dark-info);color:var(--ui-activity);border-color:var(--dark-info-line)}
  html[data-izi-theme="dark"] #app.workspace :is(.flow-strip .active b,.mini-guide .active b) {background:#315d69;color:#fff}
  html[data-izi-theme="dark"] #app.workspace :is(.badge,.badge.gray) {background:var(--dark-info);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] #app.workspace .teacher-title>.icon-button {background:#203548;color:#edf4f8}
  html[data-izi-theme="dark"] #app.workspace :is(.phase-count span,.phase-foot) {color:#b1c1ce}
  html[data-izi-theme="dark"] #app.workspace .phase-card .progress-meter {background:#354b5d}
  html[data-izi-theme="dark"] #app.workspace :is(.question-card,.paper) {border-color:#354b5d}
  html[data-izi-theme="dark"] #app.workspace :is(.study-numbers button,.task-dot:not(.answered)) {background:#203548;border-color:#526b7c;color:#edf4f8}
  html[data-izi-theme="dark"] #app.workspace .study-numbers button.is-answered {background:#203f35;border-color:#548973;color:#e4f7eb}
  html[data-izi-theme="dark"] #app.workspace :is(.study-numbers button[aria-current],.task-dot.current) {background:#264c69;border-color:#8ecbf0;color:#fff}
  html[data-izi-theme="dark"] #app.workspace .ready-set-meta .chip {background:#2a4050;border-color:#496171;color:#edf4f8}
  html[data-izi-theme="dark"] #app.workspace .history-action-remove {color:var(--ui-muted)}
  html[data-izi-theme="dark"] #app.workspace .history-entry__actions>.btn.btn.secondary.history-action-reuse {background:transparent;border-color:transparent;color:var(--ui-blue);box-shadow:none}
  html[data-izi-theme="dark"] #app.workspace .modal-counter,
  html[data-izi-theme="dark"] #app.workspace[data-study-page=review] .solve-submit-bar__copy:not(.warn) {
    background:var(--dark-info); border:1px solid var(--dark-info-line); color:var(--dark-info-ink);
  }
  html[data-izi-theme="dark"] #app.workspace .study-dialog .icon-button {display:grid;place-items:center;min-width:44px;min-height:44px;padding:0;background:var(--dark-inset);color:var(--ui-ink);border:1px solid var(--dark-border);border-radius:10px}
  html[data-izi-theme="dark"] #app.workspace .task-summary-row:not(.missing) > .ui-icon {color:var(--ui-activity)}
  html[data-izi-theme="dark"] #app.workspace .spinner {border-color:var(--dark-info-line);border-top-color:var(--ui-activity)}
  html[data-izi-theme="dark"] #app.workspace .builder-progress-meter > span {background:var(--ui-activity)}
  html[data-izi-theme="dark"] #app.workspace .axis-rows .current {color:var(--ui-activity)}
  html[data-izi-theme="dark"] #app.workspace .axis-rows .done {color:var(--ui-muted)}
  html[data-izi-theme="dark"] #app.workspace .axis-rows .done .ui-icon {color:var(--ui-step-done)}
  html[data-izi-theme="dark"] #app.workspace .teacher-main .phase-card .progress-meter > span {background:var(--ui-activity)}
  html[data-izi-theme="dark"] #app.workspace :is(.task-summary-row,.solution,.summary-list>div,.builder-price-card .price-description,.quote-card:has(.builder-price-card)>details) {border-color:var(--ui-line)}
  html[data-izi-theme="dark"] #app.workspace :is(.study-answer,.answer-choice) .option-letter {color:var(--ui-muted)}
  html[data-izi-theme="dark"] #app.workspace .builder-card--status .work-status__bar {background:#607989}
  html[data-izi-theme="dark"] #app.workspace .builder-card--status .work-status__bar span {background:var(--dark-info-ink)}
  html[data-izi-theme="dark"] #app.workspace :is(.score-next,.teacher-result-row--expanded .teacher-review-state) {background:var(--dark-info);border-color:var(--dark-info-line);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] #app.workspace .celebration {background:#1d3a36;border-color:#426e5c;color:#e5f7ed}
  html[data-izi-theme="dark"] #app.workspace .celebration :is(h3,p) {color:#e5f7ed}
  html[data-izi-theme="dark"] #app.workspace .result-feedback {color:var(--ui-muted)}
  html[data-izi-theme="dark"] #app.workspace .filter-chip:not(.current) {background:#203548;border-color:#526b7c;color:#edf4f8}
  html[data-izi-theme="dark"] #app.workspace .result-task {border-color:var(--dark-border)}
  html[data-izi-theme="dark"] #app.workspace .teacher-review-task[open] .teacher-task-heading {background:#503925;color:#ffdaa9}
  html[data-izi-theme="dark"] #app.workspace .teacher-review-task[open] .teacher-task-heading.is-correct {background:var(--dark-success);color:#cff4dd}
  html[data-izi-theme="dark"] #app.workspace .result-task .result-number {background:var(--dark-success);color:#cff4dd}
  html[data-izi-theme="dark"] #app.workspace .result-task.partial .result-number {background:#503925;color:#ffdaa9}
  html[data-izi-theme="dark"] #app.workspace .result-task.incorrect .result-number {background:#482a2b;color:#ffd1c9}
  html[data-izi-theme="dark"] #app.workspace .result-task.partial .result-headline {color:#ffdaa9}
  html[data-izi-theme="dark"] #app.workspace .result-task.incorrect .result-headline {color:#ffd1c9}
  html[data-izi-theme="dark"] .workspace-footer a,
  html[data-izi-theme="dark"] .workspace-footer a strong {color:#a9d7f2}
  html[data-izi-theme="dark"] :is(#app.workspace dialog,#account-operation-confirmation) {background:#17283a;border-color:#506a7b;color:#edf4f8;box-shadow:0 20px 64px #0009}
  html[data-izi-theme="dark"] :is(#app.workspace dialog,#account-operation-confirmation)::backdrop {background:#020a13c9}
  html[data-izi-theme="dark"] #account-operation-confirmation :is(h2,label,strong) {color:#edf4f8}
  html[data-izi-theme="dark"] #account-operation-confirmation p {color:#b1c1ce}
  html[data-izi-theme="dark"] #account-operation-confirmation .account-confirmation-icon {background:var(--dark-info);color:var(--dark-info-ink)}
  html[data-izi-theme="dark"] #account-operation-confirmation :is(input,.btn.secondary) {background:#0e1c29;border-color:#587082;color:#edf4f8}
  html[data-izi-theme="dark"] #account-operation-confirmation :is(.account-confirmation-cancel,.account-confirmation-top button) {color:#a9d7f2;border-color:#587082}
  html[data-izi-theme="dark"] #account-operation-confirmation [role=alert] {background:#482a2b;border-color:#975957;color:#ffd1c9}
}

html[data-izi-theme="dark"] #app.workspace[data-builder-access-stage]:not([data-builder-access-stage=""]) .builder-price-card {
  background: var(--dark-inset);
  color: var(--ui-ink);
  border-color: var(--dark-border);
}
html[data-izi-theme="dark"] #app.workspace #account-page.wallet-inline :is(.funding-offer,.funding-audience > label):has(input:checked) {
  background: #413022;
  border-color: #f6a154;
  color: #fff1df;
}

@media print {
  html[data-izi-surface="app"] [data-theme-settings] {display:none!important}
  html[data-izi-surface="app"][data-izi-theme="dark"],
  html[data-izi-surface="app"][data-izi-theme="dark"] :is(input,textarea,select,button) {color-scheme:only light}
}
