/* Shared appearance tokens; lesson imagery and game feedback keep their meaning. */
:root {
  --primary:#704260; --primary-2:#815271; --primary-3:#eee4ec;
  --bg:#f8f6f8; --surface:#fff; --surface-2:#f0ebf0;
  --ink:#28232d; --muted:#706976; --line:#e7dfe7;
  --gold:var(--primary); --gold-soft:var(--primary-3); --navy:var(--primary);
  --button-ink:#fff; --glass:rgba(255,255,255,.82); --glass-border:rgba(218,205,217,.7);
  --shadow-sm:0 10px 30px rgba(57,36,51,.045); --shadow-lg:0 24px 64px rgba(57,36,51,.14);
  --success:#2c6b4e; --success-soft:#eaf4ee; --danger:#9b4759; --danger-soft:#f8eaf0;
  --hero:#623c57; --hero-ink:#fff; --hero-muted:#eee0ea;
}
:root[data-theme="dark"] {
  --primary:#d8b0cc; --primary-2:#e8c7df; --primary-3:#34283b;
  --bg:#13151e; --surface:#20242f; --surface-2:#292d3b;
  --ink:#f2eef4; --muted:#b3adbd; --line:#3c3e4d;
  --button-ink:#2b1a28; --glass:rgba(32,36,47,.88); --glass-border:rgba(92,91,111,.46);
  --shadow-sm:0 12px 28px rgba(0,0,0,.12); --shadow-lg:0 24px 64px rgba(0,0,0,.36);
  --success:#a0dfc0; --success-soft:#19392c; --danger:#f2b2c0; --danger-soft:#41242f;
  --hero:#44273c; --hero-ink:#fff; --hero-muted:#e6ccde;
}
body,body.is-game { background:var(--bg); color:var(--ink); }
::selection { background:var(--primary-3); color:var(--ink); }
input,textarea,select { accent-color:var(--primary); }
.btn,.btn--gold,.btn:hover,.btn--gold:hover,.discovery-start { background:var(--primary); color:var(--button-ink); }
.btn--ghost,.btn--soft,.btn--ghost:hover,.btn--soft:hover { background:var(--primary-3); color:var(--primary); }
.btn--danger { background:var(--danger); color:var(--button-ink); }
.eyebrow,.link-btn,.xp,.profile-curiosity { color:var(--primary); }
.home-brand,.discovery-brand,.discovery-card h2,.personal-section-heading h2,.home-continue-card h3,.personal-action h3,.learning-collection-row h3 { color:var(--ink); }
.discovery-intro>span,.discovery-intro p,.discovery-card p,.discovery-card__meta small,.personal-section-heading>div>span,.home-continue-card p,.home-continue-card__footer small,.discovery-loader,.reader__lead,.reader__body,.extra-disclosure__inner p,.reader-attention p { color:var(--muted); }
.course-card,.catalog-card,.ranked-card,.mode-card,.domain-card,.stat-card,.settings-list,.weekly-card,.extra-disclosure,.discovery-card,.home-continue-card,.personal-action,.learning-collection-row,.profile-identity-card,.modal,.exam-card,.exam-hub .mini-exam-card,.review-option,.exam-page .quiz-option,.auth-card,.choice,.quiz-question { background:var(--surface); border-color:var(--line); color:var(--ink); }
.glass-surface,.extra-disclosure { background:var(--glass); border-color:var(--glass-border); box-shadow:var(--shadow-sm); }
.discovery-card { box-shadow:var(--shadow-sm); }
.home-action-card--review,.home-collection-card { background:var(--surface); color:var(--ink); border-color:var(--line); box-shadow:var(--shadow-sm); }
.home-action-card--review p,.home-collection-card p,.home-collection-card div>span { color:var(--muted); }
.home-action-card--review small,.home-action-card--review strong,.home-collection-card small { color:var(--primary); }
.home-continue-card__body>span { color:var(--primary); }
.home-action-card__icon { background:var(--primary-3); color:var(--primary); }
.learning-progress { background:var(--surface-2); }
.learning-progress>span { background:var(--primary); }
.profile-weekly__totals strong { color:var(--ink); }
.discovery-card__image { background:var(--surface-2); border-color:var(--line); }
.icon-btn,.search,.chip,.streak-pill { background:var(--surface); color:var(--muted); border-color:var(--line); }
.icon-btn--dark { background:rgba(22,16,24,.6); color:white; }
.icon-btn--active,.discovery-bookmark.is-saved,.chip.is-active { background:var(--primary); border-color:var(--primary); color:var(--button-ink); }
.label--solid,.label--gold,.discovery-card__meta>span,.saved-lessons__count,.saved-lessons__empty-icon,.saved-lesson__remove,.simple-identity .avatar,.settings-row__icon,.profile-weekly__head>strong,.domain-symbol { background:var(--primary-3); color:var(--primary); border-color:var(--line); }
.saved-lesson__remove:hover { background:var(--surface-2); }
.mini-progress,.reader-linear-progress,.featured-progress>span,.home-inline-progress,.exam-progress,.exam-page .quiz-option__letter,.review-option>span,.profile-weekly__chart i,.daily-stops span,.daily-question-dots span { background:var(--surface-2); }
.mini-progress span,.reader-linear-progress span,.featured-progress i,.home-inline-progress i,.exam-progress>span,.profile-weekly__chart .is-active i,.daily-stops .is-filled,.daily-question-dots .is-done { background:var(--primary); }
.profile-weekly__totals span,.profile-achievement__seal,.saved-lessons__empty { background:var(--surface); color:var(--muted); }
.profile-weekly__totals strong,.simple-domains strong,.exam-top strong,.exam-page .quiz-question { color:var(--ink); }
.profile-weekly__chart { border-color:var(--line); }
.profile-weekly__chart .is-active span,.profile-weekly__head>strong small { color:var(--primary); }
.profile-tabs button[aria-selected="true"] { background:var(--primary); color:var(--button-ink); }
.profile-tabs button[aria-selected="true"]>span { background:var(--surface); color:var(--primary); }
.reader-head { background:var(--bg); }
.reader-close,.reward-close,.reader__figure,.reader__figure figcaption { background:var(--surface); color:var(--muted); border-color:var(--line); }
.lesson-xp-card { background:var(--surface); border-color:var(--line); }
.lesson-xp-card__bar { background:var(--surface-2); }
.lesson-complete-cover>span { color:var(--button-ink); }
.lesson-complete-note { background:var(--primary-3); color:var(--primary); }
.learning-feature__footer,.collection-page-title p { color:var(--muted); }
.reader-actions--sticky { background:linear-gradient(180deg,transparent,var(--bg) 28%); }
.placement-invite,.mode-hero,.knowledge-overview,.game-profile-hero { background:var(--hero); color:var(--hero-ink); }
.placement-invite p,.mode-hero p,.knowledge-overview p { color:var(--hero-muted); }
.bottom-nav { background:var(--glass); border-color:var(--glass-border); box-shadow:inset 0 1px 0 var(--glass-border),var(--shadow-sm); }
.bottom-nav .nav-item { color:var(--ink); }
.bottom-nav .nav-item.is-active { background:var(--primary-3); color:var(--primary); }
.bottom-nav .nav-item:hover { background:var(--surface-2); }
.modal-backdrop { background:rgba(12,10,17,.58); }
.toast { background:var(--ink); color:var(--bg); }
.feedback-field textarea,.feedback-field select,.notification-time input { background:var(--surface-2); color:var(--ink); border-color:var(--line); }
.notification-time,.notification-master,.notification-option,.notification-consent__verse,.notification-consent__mark { background:var(--surface-2); border-color:var(--line); color:var(--ink); }
.notification-center__intro,.notification-center__note,.notification-option small,.notification-master small { color:var(--muted); }
.exam-hub-intro,.daily-review-card,.question-prompt-card,.daily-orbit { background:var(--surface); border-color:var(--line); color:var(--ink); }
.daily-orbit { box-shadow:0 0 0 12px var(--bg),0 0 0 13px var(--line); }
.exam-hub-intro h2,.exam-hub-badge,.exam-count,.exam-meta>span:first-child,.question-prompt-card>small { color:var(--primary); }
.exam-hub-intro p,.exam-meta,.exam-hint,.exam-upcoming summary { color:var(--muted); }
.exam-hub-badge,.exam-count,.question-prompt-card>small,.exam-upcoming summary span { background:var(--primary-3); border-color:var(--line); }
.review-option:not(:disabled):hover,.exam-page .quiz-option:not(:disabled):hover { background:var(--surface-2); border-color:var(--primary); }
.exam-page .quiz-option.is-selected { background:var(--primary-3); border-color:var(--primary); box-shadow:0 0 0 1px var(--primary); }
.exam-page .quiz-option.is-selected .quiz-option__letter { background:var(--primary); color:var(--button-ink); }
.exam-page .quiz-option.is-correct,.daily-question .review-option.is-correct,.review-option.is-correct,.answer-feedback--correct { background:var(--success-soft); border-color:var(--success); color:var(--success); }
.exam-page .quiz-option.is-wrong,.review-option.is-wrong,.answer-feedback--wrong { background:var(--danger-soft); border-color:var(--danger); color:var(--danger); }
.exam-page .quiz-option.is-muted { background:var(--surface); color:var(--muted); }
.exam-top small,.exam-page .quiz-option__letter { color:var(--primary); }
.daily-orbit>span { color:var(--button-ink); }
.daily-question .review-option>span { background:var(--surface-2); color:var(--primary); }
.review-option strong,.quiz-option strong { color:inherit; }

/* Settings follows a compact, rounded-card rhythm in either appearance. */
.settings-refresh { max-width:680px; padding:10px 0 30px; }
.settings-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0 0 34px; }
.settings-header h1 { font-size:clamp(34px,5vw,44px); font-weight:650; letter-spacing:-.035em; margin:0; }
.settings-header p { margin:9px 0 0; font-size:12px; color:var(--muted); }
.settings-header .icon-btn { width:48px; height:48px; border:1px solid var(--line); border-radius:50%; background:var(--surface); flex:none; }
.preference-group { margin:0 0 29px; }
.preference-group>h2 { margin:0 5px 12px; font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.12em; }
.preference-tile { display:flex; width:100%; min-width:0; min-height:82px; align-items:center; gap:14px; padding:16px 20px; border:1px solid var(--line); border-radius:25px; background:var(--surface); color:var(--ink); text-align:left; font:inherit; cursor:pointer; box-shadow:var(--shadow-sm); }
.preference-tile__icon { display:grid; place-items:center; width:43px; height:43px; border-radius:50%; background:var(--primary-3); color:var(--primary); flex:none; }
.preference-tile__icon .icon { width:22px; height:22px; }
.preference-tile__copy { display:grid; gap:5px; flex:1; min-width:0; }
.preference-tile__copy strong { font-size:15px; font-weight:550; line-height:1.35; overflow-wrap:anywhere; }
.preference-tile__copy small { font-size:11px; line-height:1.5; color:var(--muted); }
.preference-tile>.icon { color:var(--muted); flex:none; width:16px; }
.preference-tile__trailing { color:var(--primary); font-size:13px; flex:none; font-variant-numeric:tabular-nums; }
.preference-stack { display:grid; gap:10px; }
.language-trigger { display:flex; align-items:center; gap:12px; padding:13px 20px; margin:4px auto 0; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--ink); font:inherit; font-size:15px; cursor:pointer; }
.language-trigger__arrows { color:var(--muted); font-size:14px; line-height:.55; }
.language-flag { width:28px; height:20px; border-radius:4px; flex:none; display:block; }
.appearance-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:5px; gap:5px; background:var(--surface-2); border:1px solid var(--line); border-radius:22px; }
.appearance-options button { display:grid; place-items:center; align-content:center; gap:9px; min-height:78px; padding:12px 5px; border:1px solid transparent; border-radius:18px; background:none; color:var(--muted); font:inherit; font-size:12px; cursor:pointer; }
.appearance-options button[aria-pressed="true"] { background:var(--surface); border-color:var(--line); color:var(--ink); box-shadow:var(--shadow-sm); }
.appearance-options .icon { width:24px; height:24px; }
.preference-note { margin:10px 6px 0; font-size:10px; line-height:1.6; color:var(--muted); }
.preference-privacy { padding:0 20px; background:var(--surface); border:1px solid var(--line); border-radius:25px; }
.preference-privacy>summary { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:70px; cursor:pointer; list-style:none; font-size:14px; }
.preference-privacy>summary::-webkit-details-marker { display:none; }
.preference-privacy[open]>summary .icon { transform:rotate(90deg); }
.preference-privacy>a,.preference-danger { display:flex; width:100%; justify-content:space-between; align-items:center; min-height:54px; gap:16px; border:0; border-top:1px solid var(--line); background:none; color:var(--muted); font:inherit; font-size:12px; text-align:left; cursor:pointer; }
.preference-danger { color:var(--danger); }
.settings-refresh .settings-signout { margin:5px auto 20px; background:none; color:var(--muted); }
.settings-refresh .settings-about { color:var(--primary); letter-spacing:.15em; font-size:13px; }
.settings-about>span { display:block; margin-top:10px; color:var(--muted); font-size:10px; letter-spacing:0; }
.language-list { display:grid; gap:12px; }
.language-list button { display:flex; align-items:center; gap:16px; width:100%; min-height:80px; padding:15px; border:1px solid var(--line); border-radius:20px; background:var(--surface-2); color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.language-list button>span:nth-child(2) { display:grid; gap:5px; flex:1; }
.language-list strong { font-size:16px; font-weight:600; }
.language-list small { font-size:12px; color:var(--muted); }
.language-list em { padding:6px 9px; border-radius:8px; background:var(--primary-3); color:var(--primary); font-size:11px; font-style:normal; }
.language-list .icon { color:var(--primary); }
.language-soon-mark { display:grid; place-items:center; margin:20px auto; width:80px; height:80px; border-radius:25px; background:var(--primary-3); color:var(--primary); font-size:32px; font-family:Georgia,serif; }
.preference-tile:focus-visible,.language-trigger:focus-visible,.appearance-options button:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }

/* Dark adaptations of legacy fixed-color surfaces, without image filters. */
[data-theme="dark"] .learning-feature__body,[data-theme="dark"] .learning-collection-detail,[data-theme="dark"] .game-distribution,[data-theme="dark"] .game-badges-panel,[data-theme="dark"] .game-badge,[data-theme="dark"] .product-tour-card,[data-theme="dark"] .reader-attention,[data-theme="dark"] .auth-panel,[data-theme="dark"] .auth-layout,[data-theme="dark"] .onboarding__body { background:var(--surface); color:var(--ink); border-color:var(--line); }
[data-theme="dark"] .learning-feature h2,[data-theme="dark"] .learning-collection-detail h1,[data-theme="dark"] .personal-action h3,[data-theme="dark"] .game-panel-title h3,[data-theme="dark"] .game-badge strong,[data-theme="dark"] .game-distribution footer strong,[data-theme="dark"] .game-bars>div>strong,[data-theme="dark"] .auth-card h1,[data-theme="dark"] .profile-achievement h3 { color:var(--ink); }
[data-theme="dark"] .learning-feature p,[data-theme="dark"] .learning-collection-row p,[data-theme="dark"] .personal-action p,[data-theme="dark"] .game-badge small,[data-theme="dark"] .game-distribution footer,[data-theme="dark"] .auth-card__intro,[data-theme="dark"] .auth-legal,[data-theme="dark"] .profile-achievement p { color:var(--muted); }
[data-theme="dark"] .learning-feature,[data-theme="dark"] .profile-achievement,[data-theme="dark"] .game-badge.is-earned { background:var(--surface); border-color:var(--line); }
[data-theme="dark"] .game-bars i,[data-theme="dark"] .game-badge>span,[data-theme="dark"] .game-panel-title>strong,[data-theme="dark"] .lesson-complete-note { background:var(--primary-3); color:var(--primary); }
[data-theme="dark"] .auth-google { background:var(--surface-2); border-color:var(--line); color:var(--ink); }
[data-theme="dark"] .auth-trust__item,[data-theme="dark"] .auth-card__badge { background:var(--surface-2); border-color:var(--line); color:var(--muted); }
[data-theme="dark"] .review-recall-chart,[data-theme="dark"] .review-promise,[data-theme="dark"] .review-memory-visual { background:var(--surface); border-color:var(--line); }
[data-theme="dark"] .profile-achievement.is-unlocked { background:var(--surface); border-color:var(--line); }
@media(max-width:480px) { .settings-refresh { padding-top:0; } .settings-header { margin-bottom:28px; } .preference-tile { padding:14px; gap:12px; border-radius:23px; } .preference-tile__copy strong { font-size:14px; } .preference-group { margin-bottom:27px; } }
@media(prefers-reduced-motion:no-preference) { .preference-tile,.language-trigger,.appearance-options button { transition:background .18s,border-color .18s,color .18s; } .preference-tile:hover { border-color:var(--primary); } }
