.tcb-theme-toggle {
    box-sizing: border-box;
    order: 4;
    flex: none;
    display: inline-grid;
    grid-template-columns: repeat(2, 30px);
    border: 1px solid #9baaa1;
    border-radius: 999px;
    padding: 3px;
    margin: 0;
    background: #edf1ed;
    color: #466158;
    cursor: pointer;
    align-self: center;
}
.tcb-theme-toggle span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}
.tcb-theme-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tcb-theme-toggle .tcb-theme-sun {
    background: #fffaf0;
    color: #984b12;
    box-shadow: 0 1px 3px #15211c30;
}
.tcb-theme-toggle:focus-visible {
    outline: 2px solid #2780b0;
    outline-offset: 3px;
}
.site-header:has(> .tcb-theme-toggle) { column-gap: clamp(8px, 1.2vw, 20px); }
.tcb-search-content > .tcb-theme-toggle { float: right; margin-left: 8px; }
body > .top > .top-inner:has(> .tcb-theme-toggle) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
@media (max-width: 460px) {
    .site-header:has(> .tcb-theme-toggle) { flex-wrap: wrap; }
}

html[data-tcb-theme="dark"] {
    color-scheme: dark;
    --ink: #eef4ee;
    --paper: #253930;
    --sand: #1d2d25;
    --forest: #28634e;
    --forest-deep: #19372b;
    --blue: #78c9ed;
    --wood: #dc9d68;
    --line: #a9d2ba55;
    --tcb-muted: #c1d5c8;
    --tcb-panel: #2b4337;
    --tcb-mint: #afe5ca;
    --tcb-green-hover: #35735a;
    --tcb-gold: #f0bf58;
    --card: var(--tcb-panel);
    --muted: var(--tcb-muted);
    background: var(--sand);
    color: var(--ink);
}
[data-tcb-theme="dark"] body,
[data-tcb-theme="dark"] .tcb-search-page { background: var(--sand); color: var(--ink); }
[data-tcb-theme="dark"] .site-header,
[data-tcb-theme="dark"] .home-page .side-nav,
[data-tcb-theme="dark"] .tcb-search-strip { background: var(--paper); border-color: var(--line); }
[data-tcb-theme="dark"] :is(.resource-menu, .mobile-nav nav, .progression-stage, .duration-details,
    .competency-route, .formation-diagram, .stage-map, .nav-tab:not(.is-current):not(.nav-tab-home),
    .tcb-search-results a, .tcb-search-form input) {
    background: var(--tcb-panel);
    color: var(--ink);
    border-color: var(--line);
}
[data-tcb-theme="dark"] .stage-form { border-color: var(--line); }
[data-tcb-theme="dark"] :is(.brand small, .resource-menu a small, .side-nav p, .hero-lead, .intro-copy p,
    .section-heading > p, .domain-grid p, .domain-grid article > span, .study-index, .formation-card > p:not(.section-number),
    .duration-detail p span, .competency-grid small, .competency-grid em, .progression-intro-copy > p:last-child,
    .progression-stats span, .year-pills span:not(.is-active), .year-pills a:not(.is-active), .progression-legend,
    .progression-stage-header p, .progression-group-title small, .progression-resource.is-disabled,
    .progression-resource.is-disabled small, .stage-resource-disabled, .tcb-search-results span) { color: var(--tcb-muted); }
[data-tcb-theme="dark"] .site-header .resource-menu > p { background: var(--forest); color: var(--ink); }
[data-tcb-theme="dark"] .site-header .resource-menu > .resource-private-heading,
[data-tcb-theme="dark"] .resource-private-heading small { background: #503b2c; color: #ffdab6; }
[data-tcb-theme="dark"] .resource-menu .resource-private-link { background: #332a24; }
[data-tcb-theme="dark"] .resource-menu .resource-private-link:is(:hover, :focus-visible) { background: #4b3528; }
[data-tcb-theme="dark"] :is(.tcb-search-content > a, .section-number, .text-link,
    .footer-kicker, .side-nav a:hover, .tcb-search-results a:hover strong) { color: var(--tcb-mint); }
[data-tcb-theme="dark"] .tcb-search-form button { background: var(--forest); border-color: var(--forest); }
[data-tcb-theme="dark"] :is(.tcb-search-form button, .button-primary, .nav-tab.is-current):hover {
    background: var(--tcb-green-hover);
    border-color: var(--tcb-green-hover);
}
[data-tcb-theme="dark"] :is(.resource-nav summary, .button-quiet):is(:hover, :focus-visible) {
    background: var(--forest);
    border-color: var(--tcb-mint);
    color: var(--ink);
}
[data-tcb-theme="dark"] :is(.tcb-theme-toggle, .tcb-search-form input, .tcb-search-form button):focus-visible {
    outline-color: var(--tcb-mint);
}
[data-tcb-theme="dark"] .official-documents { background: var(--forest); }
[data-tcb-theme="dark"] .progression-resource { border-color: var(--line); }
[data-tcb-theme="dark"] .competency-grid li > span { border-color: var(--tcb-panel); color: #0e252e; }
[data-tcb-theme="dark"] .nav-tab-home,
[data-tcb-theme="dark"] .hero-stat,
[data-tcb-theme="dark"] .official-document-list > a:is(:hover, :focus-visible) { color: #201710; }
[data-tcb-theme="dark"] .top { background: var(--forest-deep); }
[data-tcb-theme="dark"] :is(.crumbs, .crumbs a, .main .back) { color: var(--tcb-mint); }
[data-tcb-theme="dark"] .toolbar .search { background: var(--tcb-panel); border-color: var(--line); }
[data-tcb-theme="dark"] .year-pills a:not(.is-active):is(:hover, :focus-visible) { background: var(--tcb-panel); }
[data-tcb-theme="dark"] .nav-tab-home:is(:hover, :focus-visible) { color: #fff; }
[data-tcb-theme="dark"] .site-header .desktop-nav .nav-tab-contact {
    color: var(--tcb-gold);
    border-color: #f0bf5880;
}
[data-tcb-theme="dark"] .site-header .desktop-nav .nav-tab-contact:is(:hover, :focus-visible) {
    background: var(--tcb-gold);
    border-color: var(--tcb-gold);
    color: #251d10;
}
[data-tcb-theme="dark"] .mobile-nav nav .mobile-contact-link { color: var(--tcb-gold); }
[data-tcb-theme="dark"] .brand-school img[src*="logo-deschaux-transparent.png"] {
    filter: invert(.92) hue-rotate(180deg);
}
[data-tcb-theme="dark"] .tcb-theme-toggle { background: var(--sand); border-color: #80a592; color: #b2c9bd; }
[data-tcb-theme="dark"] .tcb-theme-toggle .tcb-theme-sun { background: transparent; color: inherit; box-shadow: none; }
[data-tcb-theme="dark"] .tcb-theme-toggle .tcb-theme-moon { background: var(--forest); color: var(--tcb-mint); }
