/* Thème utilisateur indépendant du thème de l'administration. */
.design-site .site-nav .theme-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0 0 0 .35rem;
    padding: 0;
    flex: 0 0 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color_muted);
}
.design-site .site-nav .theme-toggle:hover { background: var(--color_soft); color: var(--color_primary); }
.design-site .site-nav .theme-toggle:focus-visible { outline: 2px solid var(--color_primary); outline-offset: 2px; }
.design-site .theme-icon { display: block; }
.design-site .theme-icon[hidden] { display: none; }
html[data-color-theme="dark"] {
    color-scheme: dark;
    --brand-green: #a4d7b4;
    --brand-hover: #d0edda;
    --brand-charcoal: #eceeeb;
    --brand-sage: #3e4944;
    --brand-soft: #282e2c;
    --brand-paper: #16191b;
    --brand-border: #4b5352;
    --brand-muted: #bdc4c1;
    --brand-stone: #303536;
    --color_primary: #a4d7b4;
    --color_on_primary: #12251a;
    --color_surface: #222729;
    --color_background: #16191b;
    --color_text: #eceeeb;
    --color_muted: #bdc4c1;
    --color_border: #4b5352;
    --color_soft: #282e2c;
    --color_secondary_soft: #303536;
    --color_hover: #d0edda;
    --color_reader: #101315;
    --color_error: #ffb6bb;
    --paper_color: #16191b;
    --ink: #eceeeb;
    --main_background: #16191b;
    --main_dot: rgba(215, 222, 218, .045);
}
html[data-color-theme="dark"] .design-site :is(.panel, .site-nav, .site-footer, .navigation-links, .pack-card, .subject-card, .resource-card, .sample-sheet, .landing-closing, .resume-card, .checkout-summary, .empty-state, .contact-help, .dashboard-metrics > div, .benefit-grid article, .cover-pages span, .course-sidebar, .auth-card) {
    background: var(--color_surface); color: var(--color_text); border-color: var(--color_border);
}
html[data-color-theme="dark"] .design-site main > :is(article, form) { background: var(--color_surface); color: var(--color_text); }
html[data-color-theme="dark"] .design-site :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
    background: #191e20; color: var(--color_text); border-color: #839b8d;
}
html[data-color-theme="dark"] .design-site input::placeholder,
html[data-color-theme="dark"] .design-site textarea::placeholder { color: #a9bcb0; opacity: 1; }
html[data-color-theme="dark"] .design-site :is(button, a.action),
html[data-color-theme="dark"] .design-site :is(.landing-closing, .resume-card) a.action {
    background: var(--color_primary); border-color: var(--color_primary); color: var(--color_on_primary) !important;
}
html[data-color-theme="dark"] .design-site :is(button, a.action):hover { background: var(--color_hover); border-color: var(--color_hover); }
html[data-color-theme="dark"] .design-site .site-nav a.nav-account { background: var(--color_soft); color: var(--color_primary); }
/* Le mélange éclaircir conserve les pixels clairs du logo et absorbe son fond noir. */
.design-site .site-brand picture { display: block; line-height: 0; }
html[data-color-theme="dark"] .design-site .site-brand { background: transparent; padding: 0; border-radius: 0; }
html[data-color-theme="dark"] .design-site .brand-logo { mix-blend-mode: lighten; }
html[data-color-theme="dark"] .design-site :is(.pack-cover, .resource-art, .workspace-label, .sample-equation, .access-note) { background: var(--color_soft); color: var(--color_primary); }
html[data-color-theme="dark"] .design-site :is(.hero, .auth-intro) { color: var(--color_text); }
html[data-color-theme="dark"] .design-site :is(.hero p, .auth-intro p, .auth-intro li) { color: var(--color_muted); }
html[data-color-theme="dark"] .design-site :is(.errorlist, .feedback-error) { background: #42262a; color: #ffc2c7; border-color: #ffb6bb; }
html[data-color-theme="dark"] .design-site :is(.feedback-success, .purchase-confirmed) { background: #223d2b; color: #c3efcd; }
html[data-color-theme="dark"] .design-site .password-rules { color: #f3cb89; }
html[data-color-theme="dark"] .design-site .password-rules .is-valid { color: #a4d7b4; }
html[data-color-theme="dark"] .design-site #quiz-options label,
html[data-color-theme="dark"] .design-site #quiz-feedback { background: var(--color_surface); color: var(--color_text); }
html[data-color-theme="dark"] .design-site #pdf-pages canvas { background: white; color-scheme: light; }
html[data-color-theme="dark"] .design-site :focus-visible { outline-color: #c6ecd2; }
html[data-color-theme="dark"] .design-site ::selection { background: #a4d7b4; color: #12251a; }
html[data-color-theme="dark"] .design-site :is(.study-card, .library-filters, .media-reader, .faq-list details, .catalog-filters) { background: var(--color_surface); color: var(--color_text); }
html[data-color-theme="dark"] .design-site .resource-card:hover { background: var(--color_soft); }
html[data-color-theme="dark"] .design-site #pdf-pages { background: var(--color_reader); }
html[data-color-theme="dark"] .design-site .action.secondary { background: var(--color_surface); color: var(--color_primary) !important; border-color: var(--color_primary); }
html[data-color-theme="dark"] .design-site .pack-formats li::before,
html[data-color-theme="dark"] .design-site .resource-status.is-completed { color: #a4d7b4; }
html[data-color-theme="dark"] .design-site .access-badge { background: #223d2b; color: #c3efcd !important; }

/* Papier et bureau distincts : accents de marque limités aux repères utiles. */
html[data-color-theme="dark"] .public-site .hero-workspace { background: #202728; }
html[data-color-theme="dark"] .public-site .sample-sheet {
    background: #303536; border-color: #626c68;
    box-shadow: 10px 12px 0 #414a45, 0 20px 40px #0003;
}
html[data-color-theme="dark"] .public-site .sample-sheet:hover,
html[data-color-theme="dark"] .public-site .sample-sheet:focus-visible { box-shadow: 7px 9px 0 #414a45, 0 16px 30px #0003; }
html[data-color-theme="dark"] .public-site .sample-equation { background-color: #252b2c; color: #e4e7df; }
html[data-color-theme="dark"] .public-site .workspace-label { background: #454c43; color: #f0eee3; }
