.appearance-controls{display:flex;align-items:center;gap:8px;margin-left:auto;flex-shrink:0}.appearance-controls .language-switch{margin:0!important}.theme-toggle{width:34px;height:34px;display:grid;place-items:center;border:1px solid #d3e1f4;border-radius:10px;background:#f3f7fe;color:#174ea6;padding:7px;cursor:pointer;flex-shrink:0}.theme-toggle:hover{background:#e2edff}.theme-toggle svg{width:18px;height:18px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round}.theme-sun{display:none}.theme-toggle:focus-visible{outline:3px solid #729fea;outline-offset:3px}
html[data-theme=dark]{color-scheme:dark;--ink:#edf3ff;--muted:#d4e0f1;--paper:#101b2b;--surface:#142238;--soft:#192d49;--line:#2b4261;--primary:#8ab8ff;--blue:#89b8ff}
html[data-theme=dark] body{background:#0b1422;color:#edf3ff}
html[data-theme=dark] :is(.site-header,.hub-sidebar,.hub-top,.site-footer,.hub-footer,.mobile-topics-bar){background:#0e1a2b;color:#d8e8ff;border-color:#263c59}
html[data-theme=dark] :is(h1,h2,h3,h4,.hub-card h3,.hub-section-heading h2,.hub-author h2){color:#e4efff}
html[data-theme=dark] :is(p,.fine,.intro,.note-hero .intro,.note-hero .meta,.three-steps p,.practice-section>p,.help,.index){color:#dce6f5}
html[data-theme=dark] :is(.hub-card,.hub-demo,.notes-sidebar,.english-shell .rail,.practice-section,.demo,.code-pane,.task-dialog,.topics-dialog,.practice-dialog,.learning-card,.experience article,.hero-companies,.editor-wrap){background:#111f33;color:#e4efff;border-color:#2a4262;box-shadow:0 10px 30px #0002}
html[data-theme=dark] :is(.notes-heading,.notes-content>.task-description,.notes-content>.lesson-intro,.note-hero,.page-intro,.dsa-welcome,.hero,.hub-feature,.notice,.project-strip){background:radial-gradient(ellipse at top right,#1b365b,transparent 65%),#111f33;color:#e6efff;border-color:#2e4a70}
html[data-theme=dark] :is(.nav-links a,.hub-nav a,.hub-brand,.hub-side-label,.hub-breadcrumb,.hub-side-bottom,.hub-card-meta,.hub-kicker,.hub-principles,.demo-result,.demo-heading){color:#e0eaff}
html[data-theme=dark] :is(.nav-links a[aria-current],.hub-nav a[aria-current],.notes-sidebar a[aria-current],.rail .topic-menu nav>a[aria-current],.topics-list a[aria-current]){background:#203d65;color:#bfdaff;border-color:#80adf5}
html[data-theme=dark] :is(.notes-sidebar a,.rail .topic-menu nav>a,.notes-sidebar nav summary,.topics-list a,.topics-list summary){color:#dceaff}
html[data-theme=dark] :is(.notes-sidebar>.notes-menu-toggle,.rail .topic-menu>summary,.language-switch,.editor-toolbar,.film-bottom,.pane-heading){background:#182e4b;color:#bcd7ff;border-color:#30486b}
html[data-theme=dark] :is(.language-switch button,.theme-toggle){background:#192e49;color:#bed9ff;border-color:#375477}
html[data-theme=dark] .language-switch button[aria-pressed=true]{background:#386abe;color:#fff}
html[data-theme=dark] .theme-moon{display:none}html[data-theme=dark] .theme-sun{display:block}
html[data-theme=dark] :is(.text-walkthrough,.complexity>div,.io-example,.reading-grid article,.three-steps article,.speak-prompt,.note-main .goal,.task-example,.example,.motion-scene,.hub-art){background:#172b46!important;border-color:#304c70!important;color:#e2edff}
html[data-theme=dark] :is(.io-grid pre,.io-output pre,.demo input,input,textarea,select,.writing,.editor,.demo-array span){background:#0e1d31;color:#e4edff;border-color:#365377}
html[data-theme=dark] :is(.eyebrow,.small-label,.io-label,.io-detail,.io-example-heading,.io-video-label,.complexity h3,.note-hero h1 em,.hub-overline,.hub-card-bottom,.hub-quiet,.hub-author>a,a[href^="https://leetcode.com/problems/"]){color:#a8ccff}
html[data-theme=dark] :is(.approach>.eyebrow,.note-hero .eyebrow,.practice-section>.small-label,.section-top .small-label,.time-pill,.hub-pill){background:#1d3758;color:#bdd8ff}
html[data-theme=dark] :is(.approach-nav a,.task-pagination-link,.answers button,.controls button,.inputs button,.complete,.card-controls button,.quiz-controls button,.reading-grid button,.editor-toolbar button,.practice-dialog button,.demo-next){background:#182f4d;color:#d6e7ff;border-color:#385578}
html[data-theme=dark] :is(button.primary,.btn.primary,.controls button.primary,.dark-button){background:#3471d3;color:#fff;border-color:#6098f0}
html[data-theme=dark] :is(.notes-sidebar a:hover,.rail .topic-menu nav>a:hover,.answers button:hover:not(:disabled),.task-pagination-link:hover,.hub-nav a:hover,.nav-links a:hover){background:#244268;color:#fff}
html[data-theme=dark] :is(.task-pagination-link,.approach,.hub-principles,.hub-card-bottom,.demo-result,.hub-collections){border-color:#2a4160}
html[data-theme=dark] #transcript{background:#13263e;border-color:#345479}html[data-theme=dark] #transcript>summary{background:#1a3556;color:#c1daff}html[data-theme=dark] #transcript .conversation-hint{color:#bed6f7}html[data-theme=dark] #transcript>summary>span[aria-hidden]{background:#12253e;border-color:#567cae}
html[data-theme=dark] .word-art span{background:#25456d;border-color:#638ac0;color:#e2eeff}html[data-theme=dark] .word-art span+span{background:#3266ad;color:#fff}html[data-theme=dark] .word-art:before{border-color:#3a5b84}
html[data-theme=dark] .hub-ml .ml-circuit{background:#13243d}html[data-theme=dark] .ml-circuit .chip-halo{fill:#284c7c}html[data-theme=dark] .ml-circuit .terminal-nodes circle{fill:#152d4e}
html[data-theme=dark] pre[data-code]{background:#101f33;color:#e0ebff}html[data-theme=dark] pre[data-code] .current{background:#29476e;border-color:#9ac5ff}
html[data-theme=dark] :is(.flashcard,.progress-box,.progress-details){background:#162d49;color:#e6efff;border-color:#3a577d}
@media(max-width:640px){.appearance-controls{gap:5px}.theme-toggle{width:31px;height:31px;padding:6px}.appearance-controls .language-switch{width:auto}}
html[data-theme=dark] :is(.practice,.practice-modal-heading,.practice-task,.practice-success){background:#14253d;color:#e6efff;border-color:#3b587d}html[data-theme=dark] :is(.practice-success span,.practice-success strong,.practice-optimal-link){color:#c5dcff}html[data-theme=dark] .practice-code-editor{background:#0e1d31}html[data-theme=dark] .practice-highlight{color:#e5efff}html[data-theme=dark] .practice-code-editor textarea{background:transparent;color:transparent;caret-color:#fff;-webkit-text-fill-color:transparent}html[data-theme=dark] .practice-line-numbers{background:#192f4b;color:#a9c9f6;border-color:#365477}html[data-theme=dark] .python-keyword{color:#d4a7ff}html[data-theme=dark] .python-builtin{color:#88c9ff}html[data-theme=dark] .python-string{color:#8cd8ac}html[data-theme=dark] .python-number{color:#ffc18a}html[data-theme=dark] .python-comment{color:#a6b7ce}html[data-theme=dark] .practice-feedback{background:#48351b;color:#ffe1af;border-color:#a9864b}
html[data-theme=dark] :is(.list-pointers,.list-order,.list-prefix,.expression,.substring-state,.array-label,.list-stack){color:#dceaff}html[data-theme=dark] :is(.chain-order,.link-table span,.task-pin,.mobile-topics-button){background:#203b5f;color:#d3e5ff;border-color:#456998}html[data-theme=dark] .task-pin strong{color:#e0ecff}html[data-theme=dark] :is(.hub-breadcrumb strong,.hub-side-bottom p span,.demo-top,.demo-pointer-row,.demo-array small,.hub-principles b,.hub-arrow){color:#aacfff}html[data-theme=dark] .demo-array .selected span{background:#326aca;color:#fff}html[data-theme=dark] :is(.english-topic-icon,.pattern-icon){stroke:#9fc6ff}html[data-theme=dark] .rail .topic-menu nav>a>span{color:#a9cbf7}html[data-theme=dark] .list-diagram{background:#ecf3ff;border-color:#43638c}
.hub-art{height:120px}
html[data-theme=dark]{--light:#1b304e}html[data-theme=dark] :is(.dialogue-line,#story,#writing,.reading-number,.note-pagination>a,.disabled-nav){background:#172b46;color:#dceaff;border-color:#385375}html[data-theme=dark] .dialogue-line.reply{background:#203d60}html[data-theme=dark] .dialogue-line strong{color:#a9ceff}html[data-theme=dark] .flashcard[aria-pressed=true]{background:#163e38;border-color:#548d7a}html[data-theme=dark] .flashcard[aria-pressed=true] #card-side{color:#a9e4ca}html[data-theme=dark] .answers .correct{background:#163e38;color:#b8efd5}html[data-theme=dark] .answers .incorrect{background:#4c2630;color:#ffd3db}

/* Keep unselected mobile topic links readable in dark mode. */
html[data-theme=dark] .topics-list a:not([aria-current=page]){background:#182e4b;color:#dceaff}html[data-theme=dark] .topics-list a:hover{background:#244268;color:#fff}
