/* Dark themes (Account → Preferences → Appearance). Active when the chosen theme is dark
   (body[data-theme-dark]) or "Match my device" at night (html.ef-dark). The theme's colours
   arrive as --ef-* variables; this file brings the older stylesheets along. */

/* Main buttons use the theme's real accent with a readable label, light or dark. */
.site-body :is(.ef-btn--primary, .ef-tabs a.is-active, .ef-post__new, .ef-newposts, .discover-new-posts, .ef-newjump, .ef-newin__item b, .nav-activity-badge) { background: var(--ef-accent, var(--ef-green)) !important; border-color: var(--ef-accent, var(--ef-green)) !important; color: var(--ef-on-accent, #fff) !important; }
.site-body :is(.ef-composer__send.space-view-btn-primary, .hub-composer__submit, .space-view-btn-primary, .elm-post-action-primary, .guest-btn-primary, .website-issue-form button[type=submit]) { background: var(--ef-accent, var(--ef-green)) !important; border-color: var(--ef-accent, var(--ef-green)) !important; color: var(--ef-on-accent, #fff) !important; }

:is(.ef-dark body, body[data-theme-dark]) { color-scheme: dark; background: var(--ef-paper) !important; color: var(--ef-text) !important; }
:is(.ef-dark, html:has(body[data-theme-dark])) { background: var(--ef-paper); }

/* Surfaces */
:is(.ef-dark body, body[data-theme-dark]) :is(.guest-public__topbar, .site-header) { background: color-mix(in srgb, var(--ef-paper) 92%, transparent) !important; border-color: var(--ef-line) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.hub-panel, .hub-composer, .hub-rail-card, .hub-left-column > *, .hub-right-column > *, .spaces-panel-card, .space-view-post-card, .space-view-focused-post, .community-context, .ef-acc-card, .ef-acc-nav, .feature-panel, .feature-stats > article, .account-you-card, .website-issue-card, .ef-error-card, .post-view-card, .elm-inline-replies, .site-notifications-panel, .site-search-results, .ef-credits__menu, .elm-post-options__menu, .social-post-gift form, .post-reaction-options, .ef-confirm, .ef-suggest, .ef-newin, .hub-feed-skeleton, .ef-interests, .ef-sort, .ef-tabs, .elm-post-share-dialog, .public-home__rail-card, .guest-public__stage > section) { background: var(--ef-card) !important; border-color: var(--ef-line) !important; color: var(--ef-text) !important; box-shadow: none; }
:is(.ef-dark body, body[data-theme-dark]) :is(.hub-panel--feed, .hub-panel--feed > .hub-panel__body) { background: transparent !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.hub-skeleton-block, .rail-skeleton, [class*="skeleton"] > span, .ef-suggest .ef-chip) { background: var(--ef-line-soft) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.ef-newin, .ef-suggest, .ef-interests, .space-view-audience-note, .ef-feed-reason) { background: var(--ef-sage) !important; border-color: var(--ef-sage-line) !important; }

/* Text */
:is(.ef-dark body, body[data-theme-dark]) :is(h1, h2, h3, h4, strong, b, .hub-panel__summary strong, .space-view-post-name, .ef-post__name, .elm-person-name, .guest-public__brand-copy span) { color: var(--ef-ink); }
:is(.ef-dark body, body[data-theme-dark]) :is(small, .hub-panel__summary small, .space-view-post-meta-row, .ef-acc-empty, .ef-post__time, .ef-post__where, .discover-section-description) { color: var(--ef-soft); }
:is(.ef-dark body, body[data-theme-dark]) :is(p, li, label, .ef-post__text, .elm-rich, .space-view-post-text, .post-comment-body) { color: var(--ef-text); }
:is(.ef-dark body, body[data-theme-dark]) a:not([class*="btn"]):not(.ef-btn):not(.ef-post__name):not(.ef-post__time):not(.ef-newin__item) { color: var(--ef-green); }
:is(.ef-dark body, body[data-theme-dark]) :is(.guest-public__nav a, .ef-tabs a:not(.is-active), .ef-acc-nav a) { color: var(--ef-soft) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.guest-public__nav a.is-active, .guest-public__nav a[aria-current], .ef-acc-nav a[aria-current]) { color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) .ef-acc-nav a[aria-current] { background: var(--ef-sage) !important; }

/* Controls */
:is(.ef-dark body, body[data-theme-dark]) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select) { background-color: var(--ef-paper) !important; border-color: var(--ef-line) !important; color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(input, textarea)::placeholder { color: var(--ef-faint) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.ef-btn:not(.ef-btn--primary):not(.ef-btn--danger), .elm-post-action:not(.elm-post-action-primary), .guest-btn-secondary, .space-view-btn:not(.space-view-btn-primary), .space-view-inline-action, .hub-composer__tools button, .ef-chip, .ef-round, .post-reaction-controls, .post-reaction-button, .ef-credits__pill, .hub-panel__chevron, .ef-composer__close, .site-back, .space-view-compose-close) { background: var(--ef-card) !important; border-color: var(--ef-line) !important; color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.ef-post__act, .ef-composer__tool) { background: transparent !important; color: var(--ef-soft) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.ef-post__act:hover, .ef-composer__tool:hover, .ef-composer__tool[aria-pressed="true"]) { background: var(--ef-sage) !important; color: var(--ef-green) !important; }
:is(.ef-dark body, body[data-theme-dark]) .ef-switch input { filter: none; }
:is(.ef-dark body, body[data-theme-dark]) :is(.ef-post, .ef-composer, .ef-timeline > *) { background: var(--ef-card); border-color: var(--ef-line); }
:is(.ef-dark body, body[data-theme-dark]) .ef-post:hover { background: var(--ef-card); border-color: var(--ef-sage-line); }
:is(.ef-dark body, body[data-theme-dark]) :is(.ef-post__media, .ef-composer__panel, .ef-hidden-note) { border-color: var(--ef-line-soft); background-color: var(--ef-paper); }
:is(.ef-dark body, body[data-theme-dark]) :is(.ef-error-card__search input) { background: var(--ef-paper) !important; }

/* Avatars with initials, badges and small pills */
:is(.ef-dark body, body[data-theme-dark]) :is(.ef-post__avatar, .ef-composer__avatar, .hub-composer__avatar, .space-view-post-avatar-fallback, .elm-avatar > span) { background: var(--ef-sage) !important; color: var(--ef-green) !important; }

/* Scrollbars and selection */
:is(.ef-dark body, body[data-theme-dark]) ::selection { background: var(--ef-sage-line); color: var(--ef-ink); }
:is(.ef-dark body, body[data-theme-dark]) * { scrollbar-color: color-mix(in srgb, var(--ef-ink) 25%, transparent) transparent; }

/* Found by scanning every page for light leftovers. Doubled classes beat the older, more specific rules. */
:is(.ef-dark body, body[data-theme-dark]) :is(.hub-space-card.hub-space-card, .hub-space-card__body, .hub-space-card__banner, .is-suggestion, .discover-creator-card.discover-creator-card, .space-view-post-card.space-view-post-card, .feature-card.vault-item-card, .feature-row.feature-row, .feature-alert.feature-alert, .account-row.account-row, .account-event, .profile-workspace.profile-workspace, .post-insights.post-insights, .messages-list-panel.messages-list-panel, .messages-list-head, .message-bubble.message-bubble, .vault-sticker-tile, .site-search-form.site-search-form, .ef-acc-stack > *, .ef-acc-id, .ef-push) { background: var(--ef-card) !important; border-color: var(--ef-line) !important; color: var(--ef-text) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.feature-row.is-unread, .message-bubble.is-mine, .message-bubble.is-own) { background: var(--ef-sage) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.site-user-avatar, .site-user-avatar-fallback, .hub-mini-row__badge.is-post, .discover-creator-avatar, .space-view-post-avatar-wrap, .community-context__avatar, .messages-avatar, .profile-editor-avatar, .profile-avatar-badge) { background-color: var(--ef-sage) !important; color: var(--ef-green) !important; border-color: var(--ef-line) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.account-row em, .account-primary-btn) { background: var(--ef-sage) !important; color: var(--ef-ink) !important; border-color: var(--ef-sage-line) !important; }
:is(.ef-dark body, body[data-theme-dark]) .ef-acc-trend { background: var(--ef-sage) !important; color: var(--ef-green) !important; }
/* The score card: a deep tint of the accent instead of the bright accent itself. */
:is(.ef-dark body, body[data-theme-dark]) .ef-acc-hero.ef-acc-hero { background: color-mix(in srgb, var(--ef-accent) 24%, var(--ef-card)) !important; color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) .ef-acc-hero :is(small, p, span, strong) { color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) .ef-acc-hero :is(.ef-acc-rank, .ef-acc-signals li, .ef-acc-trend) { background: color-mix(in srgb, var(--ef-paper) 45%, transparent) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.space-view-section-head h2, .space-view-post-name, .community-context h1, .community-context h2) { color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.community-context nav a[aria-current], .community-context .is-active, .space-view-tab.is-active) { background: var(--ef-sage) !important; color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.community-switcher > summary, details > summary) { background: transparent; }
:is(.ef-dark body, body[data-theme-dark]) .site-search-form input { background: transparent !important; border: 0 !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.elm-language-picker form, .elm-language-picker button, .insights-totals > div, .feature-panel-head > span, summary > em, .community-context__join.is-secondary, .people-search, .people-card.people-card, .people-cover, .people-profile, .places-open, .live-studio, .messages-thread-panel.messages-thread-panel, .messages-thread-head, .messages-key-sync, .messages-history-more, .messages-compose.messages-compose, .messages-contact.is-active, .hub-mini-row__badge.is-friend, .ef-play.ef-play, .account-nav-menu a, nav a[href="/account/"]) { background: var(--ef-card) !important; border-color: var(--ef-line) !important; color: var(--ef-text) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.messages-contact.is-active, .feature-row.is-unread > a, a.is-unread) { background: var(--ef-sage) !important; }
:is(.ef-dark body, body[data-theme-dark]) .people-avatar { border-color: var(--ef-card) !important; }
:is(.ef-dark body, body[data-theme-dark]) .elm-brand-logo { --elm-logo-ink: var(--ef-ink); }
:is(.ef-dark body, body[data-theme-dark]) :is(.space-view-post-card .space-view-post-name, .space-view-post-card .space-view-post-text, .space-view-section-head h2, .discover-heading h1, .discover-section-head h2, .hub-space-card__copy strong, .elm-score__signal-label) { color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.space-view-post-card .space-view-post-meta-row, .space-view-post-card .space-view-post-meta-row span) { color: var(--ef-soft) !important; }
:is(.ef-dark body, body[data-theme-dark]) .messages-thread.messages-thread { background: var(--ef-paper) !important; background-image: none !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.messages-key-sync button, .people-new-posts, .places-artwork) { background-color: var(--ef-card) !important; color: var(--ef-ink) !important; border-color: var(--ef-line) !important; }
:is(.ef-dark body, body[data-theme-dark]) .space-view-post-card .space-view-post-text :is(p, span, div, li) { color: var(--ef-ink) !important; }
/* Messages and empty states (they only show in particular moments, so the page scans missed them). */
:is(.ef-dark body, body[data-theme-dark]) :is(.spaces-message-card.spaces-message-card, .community-empty, .space-focused-empty, .hub-empty-state, .discover-empty, .feature-empty, .website-issue-notice, .app-empty, .public-home__empty, .space-inline-error) { background: var(--ef-card) !important; border-color: var(--ef-line) !important; color: var(--ef-text) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.space-view-message, .ef-acc-note, .public-home__alert, .guest-error) { background: var(--ef-sage) !important; border-color: var(--ef-sage-line) !important; color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.space-view-message.error, .ef-acc-note.is-error, .public-home__alert.is-error, .guest-error, .space-inline-error, .hub-post-card__reply-error) { background: color-mix(in srgb, #ef4444 16%, var(--ef-card)) !important; border-color: color-mix(in srgb, #ef4444 40%, var(--ef-card)) !important; color: #fecaca !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.spaces-message-card, .community-empty, .hub-empty-state, .discover-empty) :is(h2, h3, strong) { color: var(--ef-ink) !important; }
:is(.ef-dark body, body[data-theme-dark]) :is(.spaces-message-card, .community-empty, .hub-empty-state, .discover-empty) p { color: var(--ef-soft) !important; }

/* Paid post lock: the light sage box kept its colour while its text turned light. */
:is(.ef-dark body, body[data-theme-dark]) .social-paid-lock { background: color-mix(in srgb, var(--ef-accent, var(--ef-green)) 10%, var(--ef-card)) !important; border-color: var(--ef-line) !important; color: var(--ef-text) !important; }
:is(.ef-dark body, body[data-theme-dark]) .social-paid-lock strong { color: var(--ef-ink); }
:is(.ef-dark body, body[data-theme-dark]) .social-paid-lock form > a { color: var(--ef-accent, var(--ef-green)); }
