/* Optional palettes apply only in dark mode. */
html[data-theme="dark"]{--theme-bg:#101c1a;--theme-surface:#1b2c28;--theme-soft:#24372e;--theme-border:#344741;--theme-accent:#8ac9a8;--theme-action:#347a5c;--theme-text:#e8f0ec;--theme-muted:#b2c2bb}
html[data-theme="dark"][data-dark-color="ocean"]{--theme-bg:#101b29;--theme-surface:#192b3e;--theme-soft:#20394e;--theme-border:#385369;--theme-accent:#94d4f5;--theme-action:#245879;--theme-text:#e9f3fa;--theme-muted:#b7cbdc}
html[data-theme="dark"][data-dark-color="violet"]{--theme-bg:#1b1729;--theme-surface:#2a243c;--theme-soft:#362d4b;--theme-border:#514564;--theme-accent:#d1b8fa;--theme-action:#624388;--theme-text:#f2ecfa;--theme-muted:#cbbfdb}
html[data-theme="dark"][data-dark-color="amber"]{--theme-bg:#211b14;--theme-surface:#30281e;--theme-soft:#403426;--theme-border:#5b4c38;--theme-accent:#f1ce8e;--theme-action:#76572a;--theme-text:#f7f0e4;--theme-muted:#d4c7b1}
html[data-theme="dark"][data-dark-color]{--cream:var(--theme-bg);--surface:var(--theme-surface);--soft:var(--theme-soft);--line:var(--theme-border);--green:var(--theme-accent);--ink:var(--theme-text);--muted:var(--theme-muted)}
html[data-theme="dark"][data-dark-color] :is(.header,.teacher-card,.float-note,.subject,.ava-panel,.enrol-form,.teacher-profile-dialog){background:var(--theme-surface);color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] :is(.contact,.ribbon,.subject.large,.teacher-search,.teacher-shortlist,.planner-summary){background:var(--theme-soft);color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] :is(.journey,.ava-head){background:var(--theme-bg)}
html[data-theme="dark"][data-dark-color] .button:not(.gold){background:var(--theme-action)}
.theme-colors-toggle{width:40px;height:40px;flex-shrink:0;display:inline-grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);cursor:pointer}
.theme-colors-toggle[hidden],.theme-colors-panel[hidden]{display:none}
.theme-colors-panel{position:fixed;z-index:1400;width:min(260px,calc(100vw - 24px));padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:0 12px 40px #0005}
.theme-colors-panel>strong{display:block;font-size:14px;margin-bottom:12px}
.theme-color-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.theme-color-options button{display:flex;align-items:center;gap:7px;min-height:44px;padding:8px;border:1px solid var(--line);border-radius:9px;background:transparent;color:var(--ink);font:13px Arial,sans-serif;cursor:pointer}
.theme-color-options button[aria-pressed="true"]{border-color:var(--green);background:var(--soft)}
.theme-color-swatch{width:16px;height:16px;flex-shrink:0;border-radius:50%;background:#8ac9a8}
[data-color="ocean"] .theme-color-swatch{background:#94d4f5}[data-color="violet"] .theme-color-swatch{background:#d1b8fa}[data-color="amber"] .theme-color-swatch{background:#f1ce8e}
.theme-color-check{visibility:hidden;margin-left:auto}.theme-color-options [aria-pressed="true"] .theme-color-check{visibility:visible}

/* Use the original transparent logo silhouette against every dark palette. */
.theme-brand-logo{display:none}
html[data-theme="dark"][data-dark-color] .header .brand :is(.logo-light,.logo-dark){display:none}
html[data-theme="dark"][data-dark-color] .theme-brand-logo{display:block;flex-shrink:0;width:80px;height:80px;background:var(--theme-accent);mask:url('../images/logo-light.webp') center/contain no-repeat;-webkit-mask:url('../images/logo-light.webp') center/contain no-repeat}
@media(max-width:650px){html[data-theme="dark"][data-dark-color] .theme-brand-logo{width:56px;height:56px}}
/* Shared surfaces and controls, including initially hidden panels. */
html[data-theme="dark"][data-dark-color] :is(.guide-preview,#parent-student-guide,.curricula-card,#compare.teacher-comparison,.skip,.payment-section){background:var(--theme-surface);border-color:var(--theme-border);color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] :is(.note-icon,.initials,.qualification-status,.teacher-new-badge,.pill){background:var(--theme-soft);color:var(--theme-accent);border-color:var(--theme-border)}
html[data-theme="dark"][data-dark-color] .teacher-tools :is(.subject-toggle,.subject-nav button){background:var(--theme-soft);border-color:var(--theme-border);color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] .teacher-tools .subject-nav button[aria-pressed="true"]{background:var(--theme-action);border-color:var(--theme-accent);color:#fff}
html[data-theme="dark"][data-dark-color] :is(.comparison-selectors select,.enrol-form input,.enrol-form select,.enrol-form textarea,.planner-form input,.planner-form select,.compare-scroll-cue){background-color:var(--theme-bg);border-color:var(--theme-border);color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] :is(.enrol-form,.planner-summary,.planner-summary-bottom,.teacher-card dl div,.guide-independence,.curricula-card .guide-independence,.currency-column){border-color:var(--theme-border)}
html[data-theme="dark"][data-dark-color] :is(.curricula-card h2,.guide-intro h1,.guide-preview h2,#parent-student-guide h2){color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] :is(.curricula-intro>p:last-child,.curricula-frameworks h3,.curricula-card .guide-independence,.summary-lead,.planner-summary dt,.planner-summary>.planner-note){color:var(--theme-muted)}
html[data-theme="dark"][data-dark-color] :is(.curricula-card .eyebrow,.enrol-planning-help a,.ava-panel .ava-profile a){color:var(--theme-accent)}
html[data-theme="dark"][data-dark-color] :is(.enrol-form,.planner-form) :is(input,textarea)::placeholder{color:var(--theme-muted)}
html[data-theme="dark"][data-dark-color] .ava-launch{background:var(--theme-surface);color:var(--theme-text);box-shadow:0 8px 30px #0003}
html[data-theme="dark"][data-dark-color] .ava-orb{color:#30250f}
html[data-theme="dark"][data-dark-color] .ava-head{background:var(--theme-soft);color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] .ava-panel :is(.ava-message,.ava-profile){background:var(--theme-soft);color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] .ava-panel .ava-message.user{background:var(--theme-action);color:#fff}
html[data-theme="dark"][data-dark-color] .ava-form button{background:var(--theme-action);color:#fff}
html[data-theme="dark"][data-dark-color] .button:not(.gold):hover{background:var(--theme-action);filter:brightness(1.08)}
html[data-theme="dark"][data-dark-color] .ava-mobile-dock .ava-launch{background:var(--theme-soft);color:var(--theme-text);border-color:var(--theme-border)}
html[data-theme="dark"][data-dark-color] :is(thead,caption){background:var(--theme-soft);color:var(--theme-text)}
html[data-theme="dark"][data-dark-color] tbody tr:nth-child(2n){background:var(--theme-bg)}
html[data-theme="dark"][data-dark-color] :is(.journey p,.footer .footer-independence){color:var(--theme-muted)}
html[data-theme="dark"][data-dark-color] .curricula-card .nationals-label{color:#232a31}
html[data-theme="dark"][data-dark-color] .currency-coin.coin-rupee{color:#493b20}
html[data-theme="dark"][data-dark-color] .teams-live-dot{background:var(--theme-action)}
html[data-theme="dark"][data-dark-color] .teams-whiteboard strong{color:#30343b}
html[data-theme="dark"][data-dark-color] .currency-progress-ring{stroke:var(--theme-accent)}
html[data-theme="dark"][data-dark-color] .academy-page-loader{background:var(--theme-bg)}
html[data-theme="dark"][data-dark-color] .ava-form-assistant.ava-form-open{background:color-mix(in srgb,var(--theme-bg) 65%,transparent)}
html[data-theme="dark"][data-dark-color] .benefits article{border-top-color:var(--theme-accent)}
html[data-theme="dark"][data-dark-color] .teams-board strong{color:#30343b}
html[data-theme="dark"][data-dark-color] .currency-column{animation-name:palette-selected-lift}
html[data-theme="dark"][data-dark-color] .tuition-destination{animation-name:palette-arrival}
@keyframes palette-selected-lift{0%,33.33%,100%{transform:translateY(0);border-color:var(--theme-border);box-shadow:0 10px 22px #0001}5%,27%{transform:translateY(-6px);border-color:var(--theme-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-accent) 25%,transparent),0 14px 22px #0002}}
@keyframes palette-arrival{0%,78%,100%{box-shadow:0 0 0 0 transparent;border-color:var(--theme-border)}86%{box-shadow:0 0 0 5px color-mix(in srgb,var(--theme-accent) 14%,transparent);border-color:var(--theme-accent)}95%{box-shadow:0 0 0 9px transparent;border-color:var(--theme-border)}}
html[data-theme="dark"][data-dark-color] .header #main-navigation .nav-contact::before{background:var(--theme-action)}
html[data-theme="dark"][data-dark-color] .header #main-navigation .nav-contact:hover{border-color:var(--theme-accent)}
html[data-theme="dark"][data-dark-color] .academy-loading-spinner{border-color:var(--theme-accent) var(--theme-border) var(--theme-border)}
@media(min-width:651px){html[data-theme="dark"][data-dark-color] .theme-brand-logo{width:60px;height:60px}}
@media(max-width:650px){html[data-theme="dark"][data-dark-color] .theme-brand-logo{width:54px;height:54px}}
@media(max-width:360px){html[data-theme="dark"][data-dark-color] .theme-brand-logo{width:44px;height:44px}}
