/* Le thème sombre reste celui par défaut. */
html[data-theme="light"] { color-scheme: light; }

html[data-theme="light"] body {
    --green: #16834d;
    --green-dark: #0d683a;
    --ink: #17231b;
    --muted: #5a6b60;
    --panel: rgba(255, 255, 255, .94);
    --other: #edf3ee;
    --danger: #c63e3e;
    background:
        radial-gradient(circle at 8% 0%, rgba(105, 203, 143, .24), transparent 29rem),
        radial-gradient(circle at 100% 100%, rgba(89, 158, 227, .12), transparent 30rem),
        #f2f7f3 !important;
    color: var(--ink);
}

html[data-theme="light"] .channels-panel,
html[data-theme="light"] .wiki-menu {
    background: #f7fbf7 !important;
    border-color: rgba(22, 68, 40, .14) !important;
}

html[data-theme="light"] .chat-header,
html[data-theme="light"] .conversation,
html[data-theme="light"] .news-post,
html[data-theme="light"] .editor,
html[data-theme="light"] .account-card,
html[data-theme="light"] .accounts-section,
html[data-theme="light"] .wiki-content article,
html[data-theme="light"] .box,
html[data-theme="light"] .card,
html[data-theme="light"] .question-page-card,
html[data-theme="light"] dialog {
    background: rgba(255, 255, 255, .96) !important;
    border-color: rgba(22, 68, 40, .15) !important;
    box-shadow: 0 14px 40px rgba(34, 74, 49, .09);
}

html[data-theme="light"] .message.other,
html[data-theme="light"] .forum-topic,
html[data-theme="light"] .manage-row,
html[data-theme="light"] .moderation-block,
html[data-theme="light"] .poll-card,
html[data-theme="light"] .question-card,
html[data-theme="light"] article {
    background: #f5f8f5 !important;
    border-color: rgba(22, 68, 40, .11) !important;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select,
html[data-theme="light"] .question-answer-form textarea {
    color: var(--ink) !important;
    border-color: rgba(22, 68, 40, .22) !important;
    background: #fbfdfb !important;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus {
    border-color: var(--green) !important;
    box-shadow: 0 0 0 3px rgba(22, 131, 77, .13);
}

/* Évite le texte clair sur le fond blanc des options des menus natifs. */
select option { color: #17231b; background: #ffffff; }

html[data-theme="light"] button,
html[data-theme="light"] .channel-button,
html[data-theme="light"] .back,
html[data-theme="light"] a { color: var(--ink); }

html[data-theme="light"] .channel-button,
html[data-theme="light"] .channel-row,
html[data-theme="light"] .channel-members label { background: transparent !important; }
html[data-theme="light"] .channel-row:hover,
html[data-theme="light"] .channel-row.active,
html[data-theme="light"] .channel-members label:has(input:checked) { background: rgba(22, 131, 77, .11) !important; }
html[data-theme="light"] .channel-row.active .channel-button,
html[data-theme="light"] .back,
html[data-theme="light"] .header-actions a,
html[data-theme="light"] .news-content a,
html[data-theme="light"] .markdown a { color: var(--green); }

html[data-theme="light"] button:not(.theme-toggle):not(.composer button):not(.question-page-card .question-answer-form button),
html[data-theme="light"] .header-actions a {
    border-color: rgba(22, 131, 77, .25);
    background: rgba(22, 131, 77, .07);
}
html[data-theme="light"] .composer button,
html[data-theme="light"] .question-page-card .question-answer-form button { color: #fff; background: var(--green); }
html[data-theme="light"] .composer button:hover,
html[data-theme="light"] .question-page-card .question-answer-form button:hover { background: var(--green-dark); }

html[data-theme="light"] .channel-button small { color: var(--muted); background: #e7eee8; }
html[data-theme="light"] .channel-button .unread-badge { color: #fff; background: var(--green); }
html[data-theme="light"] .reaction-palette,
html[data-theme="light"] .attachment-dialog { background: #fff; border-color: rgba(22, 68, 40, .16); }
html[data-theme="light"] .special-highlight { color: #3d3000; }

.theme-toggle { position: fixed; right: 1rem; bottom: 1rem; z-index: 9999; width: 2.7rem; height: 2.7rem; padding: 0; color: #172018; font-size: 1.15rem; cursor: pointer; border: 1px solid rgba(120,224,143,.55); border-radius: 50%; background: #fff; box-shadow: 0 8px 26px rgba(0,0,0,.2); }
html:not([data-theme="light"]) .theme-toggle { color: #f5f7f4; background: #1a241d; }
