/* Bouton de bascule (visible dans les deux thèmes) */
#theme-toggle { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-inline: .25rem; border: 0; border-radius: 999px;
                background: transparent; color: inherit; font-size: 1.05rem; line-height: 1; cursor: pointer; transition: background .2s; }
#theme-toggle:hover { background: rgb(20 200 192 / .18); }
html[data-theme="dark"] .t-moon { display: none; }
html:not([data-theme="dark"]) .t-sun { display: none; }

/* ===== Thème sombre : data-theme="dark" sur <html> ===== */
html[data-theme="dark"] { color-scheme: dark; }

/* Fonds */
html[data-theme="dark"] body,
html[data-theme="dark"] .bg-paper { background-color: #07181a; color: #e4f5f3; }
html[data-theme="dark"] .bg-white { background-color: #0e2326; }
html[data-theme="dark"] :is(.bg-white\/60, .bg-white\/75, .bg-white\/80) { background-color: rgb(14 35 38 / .85); }
html[data-theme="dark"] .bg-mist { background-color: #12302f; }
html[data-theme="dark"] .bg-mist\/60 { background-color: rgb(18 48 47 / .7); }
html[data-theme="dark"] .hover\:bg-mist:hover { background-color: #12302f; }
html[data-theme="dark"] .hover\:bg-sun:hover { background-color: #ff9f1c; }
html[data-theme="dark"] a.bg-ink { box-shadow: inset 0 0 0 1px rgb(228 245 243 / .25); }

/* Textes */
html[data-theme="dark"] .text-ink { color: #e4f5f3; }
html[data-theme="dark"] .text-ink\/80 { color: rgb(228 245 243 / .8); }
html[data-theme="dark"] .text-ink\/70 { color: rgb(228 245 243 / .72); }
html[data-theme="dark"] .text-ink\/60 { color: rgb(228 245 243 / .62); }
html[data-theme="dark"] .text-ink\/50 { color: rgb(228 245 243 / .52); }
html[data-theme="dark"] :is(.bg-sun, .bg-turquoise) { color: #0d2b2e; }
html[data-theme="dark"] .text-turquoise-deep { color: #3be3da; }
html[data-theme="dark"] .text-sun-deep { color: #ffb347; }
html[data-theme="dark"] .hover\:text-turquoise-deep:hover { color: #7ff0ea; }
html[data-theme="dark"] .hover\:text-sun-deep:hover { color: #ffcf85; }

/* Contours */
html[data-theme="dark"] [class*="ring-ink/"] { --tw-ring-color: rgb(228 245 243 / .12); }
html[data-theme="dark"] [class*="border-ink/"] { border-color: rgb(228 245 243 / .1); }

/* Décors */
html[data-theme="dark"] .grid-bg { background-image: linear-gradient(to right, rgb(228 245 243 / .06) 1px, transparent 1px), linear-gradient(to bottom, rgb(228 245 243 / .06) 1px, transparent 1px); }
html[data-theme="dark"] .blob { opacity: .28; }

/* Texte des articles */
html[data-theme="dark"] .prose {
    --tw-prose-body: #cfe3e1; --tw-prose-headings: #f1fbfa; --tw-prose-lead: #b7d1cf; --tw-prose-links: #3be3da;
    --tw-prose-bold: #f1fbfa; --tw-prose-counters: #8fb3b0; --tw-prose-bullets: #5d8784; --tw-prose-hr: rgb(228 245 243 / .15);
    --tw-prose-quotes: #e4f5f3; --tw-prose-quote-borders: rgb(228 245 243 / .2); --tw-prose-captions: #8fb3b0;
    --tw-prose-code: #f1fbfa; --tw-prose-pre-code: #e4f5f3; --tw-prose-pre-bg: rgb(0 0 0 / .4);
    --tw-prose-th-borders: rgb(228 245 243 / .2); --tw-prose-td-borders: rgb(228 245 243 / .12);
}
html[data-theme="dark"] .prose a { color: #3be3da; }

/* Documents, photos */
html[data-theme="dark"] .doc-card { background: #0e2326; color: #e4f5f3; box-shadow: 0 0 0 1px rgb(228 245 243 / .1), 0 8px 24px -14px rgb(20 200 192 / .25); }
html[data-theme="dark"] .doc-icon { background: rgb(20 200 192 / .18); }
html[data-theme="dark"] .doc-actions a.alt { box-shadow: inset 0 0 0 2px #3be3da; color: #3be3da; }
html[data-theme="dark"] .doc-actions a.alt:hover { background: #3be3da; color: #07181a; }

/* Page Messagerie Matrix */
html[data-theme="dark"] .mx { color: #e4f5f3; }
html[data-theme="dark"] .mx-lead, html[data-theme="dark"] .mx-mini p { color: rgb(228 245 243 / .72); }
html[data-theme="dark"] .mx-note { color: rgb(228 245 243 / .55); }
html[data-theme="dark"] .mx-card { background: #0e2326; box-shadow: 0 0 0 1px rgb(228 245 243 / .1); }
html[data-theme="dark"] .mx-card h2 { border-bottom-color: rgb(228 245 243 / .2); }
html[data-theme="dark"] .mx-mini { background: #0b1f21; box-shadow: inset 0 0 0 1px rgb(228 245 243 / .1); }
html[data-theme="dark"] .mx-steps code { background: #12302f; }
html[data-theme="dark"] .mx-badge { color: #3be3da; }
html[data-theme="dark"] .mx-btn--ghost { box-shadow: inset 0 0 0 2px #3be3da; color: #3be3da; }
html[data-theme="dark"] .mx-btn--ghost:hover { background: #3be3da; color: #07181a; }
html[data-theme="dark"] .mx-form input[type="text"],
html[data-theme="dark"] .mx-form input[type="email"],
html[data-theme="dark"] .mx-form textarea { background: #0b1f21; color: #e4f5f3; box-shadow: inset 0 0 0 1px rgb(228 245 243 / .2); }
html[data-theme="dark"] .mx-form input:focus,
html[data-theme="dark"] .mx-form textarea:focus { background: #0e2326; box-shadow: inset 0 0 0 2px #14c8c0; }
html[data-theme="dark"] .mx-alert--ok { color: #3be3da; }
html[data-theme="dark"] .mx-alert--err { color: #ffcf85; }

/* Pages d'erreur */
html[data-theme="dark"] .err { color: #e4f5f3; }
html[data-theme="dark"] .err p { color: rgb(228 245 243 / .72); }
