/* Explicit night palette: graphite surfaces, soft lavender, readable secondary text. */
.theme-toggle{width:38px;height:38px;display:grid;place-items:center;border:1px solid #e9e1f2;border-radius:50%;background:#faf7fe;color:#9580aa;flex-shrink:0}.theme-toggle:hover{background:#eee5fc;color:#8054c4}.theme-toggle svg{width:19px;height:19px}.focus-theme-actions{display:flex;align-items:center;gap:14px;margin-left:auto}
html[data-theme="dark"]{color-scheme:dark;--purple:#b79aff;--ink:#ece7f5;--muted:#b0a6bf;--line:#37303f;--wash:#221d2c;--green:#9ad1b6;--night-bg:#141219;--night-surface:#1d1924;--night-raised:#26202f;--night-lilac:#30243f;--night-border:#40344f;--night-quiet:#a89bb9}
html[data-theme="dark"] body{background:var(--night-bg);color:var(--ink)}
html[data-theme="dark"] :is(input,textarea,select,dialog){color:var(--ink);background:var(--night-surface);border-color:var(--night-border)}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#a398b2}
html[data-theme="dark"] header{background:var(--night-bg);border-color:var(--line)}
html[data-theme="dark"] :is(nav button,.help,.focus-title,.outline,.eyebrow,.footer,.topicnum,.course .coursehead span:first-child){color:#afa1bf}
html[data-theme="dark"] nav button.active{color:var(--purple)}
html[data-theme="dark"] :is(.theme-toggle,.avatar,.number,.icon){background:#2a2138;border-color:#40324f;color:#c3a6ff}
html[data-theme="dark"] .theme-toggle:hover{background:#382949}
html[data-theme="dark"] :is(.primary,.send-button){background:#8052d4;color:#fff;box-shadow:none}
html[data-theme="dark"] :is(.primary:hover,.send-button:hover){background:#9466e5}
html[data-theme="dark"] :is(.secondary,.mode-switch,.rule-tabs button,.starter-row button,.route-links button,.voice-button,.drawer .chips button){background:var(--night-raised);border-color:var(--night-border);color:#d1c1e3}
html[data-theme="dark"] :is(.secondary:hover,.starter-row button:hover,.route-links button:hover,.voice-button:hover){background:#352840;border-color:#7b5a9e}
html[data-theme="dark"] :is(.pill,.filters .active,.rule-tabs button.active){background:#352747;border-color:#5b407c;color:#d0b8ff}
html[data-theme="dark"] :is(.hero,.side,.panel,.course,.quick,.task-preview,.voice-response){background:var(--night-surface);border-color:var(--line)}
html[data-theme="dark"] :is(.row:hover,.quick:hover){background:#221c2d;border-color:#57416e}
html[data-theme="dark"] :is(.hint,.reply,.voice-transcript){background:#2a2038;border-color:#9368cd;color:#cfbddf}
html[data-theme="dark"] :is(.hero .preview,.composer,.studio-composer,.fullchat .composer,.drawer,dialog){background:var(--night-surface);border-color:var(--night-border);box-shadow:none}
html[data-theme="dark"] :is(.composer input,.studio-composer textarea){background:transparent;color:var(--ink)}
html[data-theme="dark"] :is(.placeholder,.plan-empty){border-color:#564262;color:#b9a8cc}
html[data-theme="dark"] .board{border-color:var(--line);background-color:#19161f;background-image:linear-gradient(#b79aff0c 1px,transparent 1px),linear-gradient(90deg,#b79aff0c 1px,transparent 1px)}
html[data-theme="dark"] .board p{color:#c1b3d0}
html[data-theme="dark"] mark{background:#3d2b57;color:#e0ceff}
html[data-theme="dark"] .letter{background:#292033;border-color:#55416c;color:#e8dcf5}
html[data-theme="dark"] .letter:disabled{background:transparent;border-color:transparent;color:#b7a8c6}
html[data-theme="dark"] .letter.selected{background:#50356e;border-color:#a376d9;color:#f0e3ff}
html[data-theme="dark"] .wrong{color:#efb394}
html[data-theme="dark"] .mini-progress span{background:#35293f}
html[data-theme="dark"] .mini-progress .done{background:var(--purple)}
html[data-theme="dark"] .drawer-shade,html[data-theme="dark"] dialog::backdrop{background:#08060db3}
html[data-theme="dark"] .chat-history{background:#1b1722;border-color:#32293e}
html[data-theme="dark"] :is(.new-chat,.history-mobile){background:#292132;border-color:#4a365e;color:#d0b8ed}
html[data-theme="dark"] :is(.new-chat:hover,.thread:hover){background:#2a2036}
html[data-theme="dark"] .thread.active{background:#352647;color:#dec7ff}
html[data-theme="dark"] :is(.thread-date,.history-label,.history-bottom,.chat-toolbar,.studio-welcome>p,.composer-tip,.studio-disclaimer,.dictation-status){color:#aa9ab9}
html[data-theme="dark"] .history-bottom{border-color:#382b46}
html[data-theme="dark"] .status-dot{background:#ad84e7}
html[data-theme="dark"] .tutor-sign{background:#292035;border-color:#453154;color:#c8aaff}
html[data-theme="dark"] .starter-row button span{color:#c2a1ff}
html[data-theme="dark"] .studio-composer:focus-within{border-color:#a67bd7;box-shadow:0 0 0 3px #ac78e512}
html[data-theme="dark"] .studio-log .message.user{background:#30213e;color:#eddefb}
html[data-theme="dark"] .message.assistant{background:#201a2a;border-color:#362a45}
html[data-theme="dark"] .studio-log .message.assistant{background:transparent;border:0}
html[data-theme="dark"] .studio-composer.is-recording{background:#2c1d2b;border-color:#b279a0}
html[data-theme="dark"] .voice-button.recording{background:#4c2943;border-color:#a36b91;color:#ffb6d5}
html[data-theme="dark"] .recording-label{color:#e4a5c8}
html[data-theme="dark"] .plan-switch{background:#241e2d}
html[data-theme="dark"] .plan-switch button{color:#b0a0c0}
html[data-theme="dark"] .plan-switch button.active{background:#3a2a4c;color:#e0caff;box-shadow:none}
html[data-theme="dark"] .plan-overview{background:#211a2b;border-color:#3c2d4b}
html[data-theme="dark"] :is(.plan-overview p,.plan-progress-count,.plan-monthnav button,.calendar-weekdays span,.calendar-date,.plan-key,.plan-daydate span,.map-caption p,.route-content>small,.route-finish p){color:#b1a0c1}
html[data-theme="dark"] .plan-progress{background:#3a2b49}
html[data-theme="dark"] .plan-monthnav button{border-color:#483557}
html[data-theme="dark"] .calendar-day{background:#1d1923;border-color:#342a40}
html[data-theme="dark"] .calendar-day.off-month{background:#18151e;opacity:.6}
html[data-theme="dark"] :is(.calendar-day.is-today,.plan-dayrow.today){border-color:#9871c6;box-shadow:0 0 0 2px #a372dc0d}
html[data-theme="dark"] .is-today .calendar-date b{background:#8352c3;color:white}
html[data-theme="dark"] :is(.calendar-date small,.calendar-rest){color:#a691b8}
html[data-theme="dark"] .plan-activity{background:#2d213b;border-color:#453052;color:#d8bfef}
html[data-theme="dark"] .plan-activity.practice{background:#1f302d;border-color:#344d47;color:#b3d5c9}
html[data-theme="dark"] .plan-activity:hover{border-color:#a27bc3;filter:none}
html[data-theme="dark"] .plan-activity.done{opacity:.8}
html[data-theme="dark"] .plan-dayrow{background:#1c1822;border-color:#362b42}
html[data-theme="dark"] .plan-dayrow.today{background:#251b30}
html[data-theme="dark"] .plan-map{background-color:#18141e;background-image:radial-gradient(circle,#3a2c49 1px,transparent 1px);border-color:#382b43}
html[data-theme="dark"] .route-stage svg path{stroke:#695080}
html[data-theme="dark"] .route-stage:before{border-color:#695080}
html[data-theme="dark"] .route-circle{border-color:#1a1521;background:#382847;color:#d8c0ed;box-shadow:0 0 0 1px #62497a}
html[data-theme="dark"] .route-stop.current .route-circle{background:#9260d8;color:white;box-shadow:0 0 0 7px #33223f}
html[data-theme="dark"] .route-stop.complete .route-circle{background:#426b5b;color:#d5f4e3;box-shadow:0 0 0 1px #638e7c}
html[data-theme="dark"] .route-stage .route-content{background:#221a2c;border-color:#453251}
html[data-theme="dark"] .route-stage>.route-stop.current .route-content{background:#30203f;border-color:#7a549e}
html[data-theme="dark"] :is(.home-date,.home-today-caption,.home-card-foot,.home-card-foot button,.home-task-note,.home-chat-caption){color:#b0a0bf}
html[data-theme="dark"] .home-card{background:#211a2b;border-color:#3a2d47}
html[data-theme="dark"] .home-card:nth-child(2){background:#1d1924}
html[data-theme="dark"] .home-card:nth-child(3){background:#201b27}
html[data-theme="dark"] .home-card-top>button{background:#2b2235;border-color:#493357;color:#c5abdd}
html[data-theme="dark"] .home-agenda-item{background:#2b2136;border-color:#493354;color:#dfc9f3}
html[data-theme="dark"] .home-agenda-item:hover{background:#362640;border-color:#936db2}
html[data-theme="dark"] .home-agenda-index{background:#3e2b52;color:#d3b3ed}
html[data-theme="dark"] :is(.home-agenda-item small,.home-agenda-item>span:last-child,.home-no-plan p){color:#b8a1cb}
html[data-theme="dark"] .home-agenda-item.done{opacity:.8}
html[data-theme="dark"] :is(.home-no-plan span,.home-no-plan strong){color:#c2a6da}
html[data-theme="dark"] .home-task{background:#27202f;border-color:#403047;color:#c3acd5}
html[data-theme="dark"] .home-task.available{background:#3b2850;border-color:#614379;color:#e2c8fb}
html[data-theme="dark"] .home-task:hover{background:#473057;border-color:#a77cc7;color:#f1defe}
html[data-theme="dark"] .home-analysis-symbol{background:#2b2335;border-color:#493950;color:#b79aca}
html[data-theme="dark"] .home-analysis-placeholder h3{color:#c5aed7}
html[data-theme="dark"] .home-analysis-placeholder p{color:#ad9abd}
html[data-theme="dark"] .home-chat-launch{background:#211a2b;border-color:#51405f}
html[data-theme="dark"] .home-chat-launch:hover{border-color:#a17abd}
html[data-theme="dark"] .home-chat-placeholder{color:#bba6cd}
html[data-theme="dark"] [style*="color:#b6a6c6"]{color:#c8acd9!important}

/* Two-position theme switch. */
.theme-toggle{width:60px;height:32px;display:flex;align-items:center;position:relative;padding:3px;border-radius:20px;background:#eae2f4;border:1px solid #e1d4ee;cursor:pointer}
.theme-toggle:hover{background:#e3d6f3}
.theme-switch-knob{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#fff;color:#9b7abd;box-shadow:0 1px 4px #42265b1c;transform:translateX(0);flex-shrink:0}
.theme-toggle .theme-switch-knob svg{width:15px;height:15px}
html[data-theme="dark"] .theme-toggle{background:#63458b;border-color:#8363ac;color:#ecdfff}
html[data-theme="dark"] .theme-toggle:hover{background:#74529c}
html[data-theme="dark"] .theme-switch-knob{background:#e9dbfa;color:#63438b;transform:translateX(28px);box-shadow:0 1px 4px #100b1933}
