/* Loaded by the shared appearance control when a member or Discover page is dark. */
:root {
  color-scheme: dark;
  --paper: var(--theme-bg);
  --canvas: var(--theme-bg);
  --ink: var(--theme-ink);
  --ink-soft: var(--theme-muted);
  --muted: var(--theme-muted);
  --muted-dark: var(--theme-muted);
  --surface: var(--theme-surface);
  --surface-soft: var(--theme-raised);
  --soft: var(--theme-raised);
  --line: var(--theme-line);
  --line-dark: var(--theme-line);
  --green: #a4ce9b;
  --accent-dark: var(--theme-accent);
  --capsule-track: var(--theme-raised);
  --capsule-active: var(--theme-ink);
  --capsule-active-text: var(--theme-bg);
  --auth-ink: var(--theme-ink);
  --auth-muted: var(--theme-muted);
  --auth-canvas: var(--theme-bg);
  --auth-surface: var(--theme-surface);
  --auth-line: var(--theme-line);
  --member-error: #ffafa5;
  --auth-error: var(--member-error);
  --review-ink: var(--theme-ink);
  --review-muted: var(--theme-muted);
  --review-line: var(--theme-line);
  --review-wash: var(--theme-surface);
  --review-accent: var(--theme-accent);
}

html, body {
  background-color: var(--theme-bg);
  color: var(--theme-ink);
}

body.spr-compact-home {
  --compact-page: var(--theme-bg);
  --compact-ink: var(--theme-ink);
  --compact-muted: var(--theme-muted);
  --compact-surface: var(--theme-surface);
  --compact-soft: var(--theme-raised);
  --compact-line: var(--theme-line);
  --compact-hover: rgb(255 255 255 / 9%);
  --compact-dock: rgb(35 37 32 / 96%);
  --compact-selected: #484d43;
  --compact-focus: var(--theme-accent);
}

body.profile-page { --ink: var(--theme-ink); --muted: var(--theme-muted); --line: var(--theme-line); }

.mobile-avatar i { background: var(--theme-ink); border-color: var(--theme-surface); }
.mobile-avatar i::after { border-color: var(--theme-bg); }

/* Search, Discover cards, account sheets and the floating bottom navigation. */
.feed-header, .feed-session-menu, .bottom-nav, .feed-footer,
.spr-compact-home .compact-card-more, .feed-account.account-icon-control,
.pinned-owner-video, .feed-search-prompt, .feed-kind-badge, .feed-empty-state,
.feed-empty-actions a, .interest-onboarding, .interest-option span, .interest-actions button,
.search-sheet header button, .menu-sheet header button, .search-results > a,
.universal-search, .menu-profile > span, .menu-profile a, .workspace-menu > a,
.menu-directory, .discover-node {
  background-color: var(--theme-surface);
  border-color: var(--theme-line);
  color: var(--theme-ink);
}
.session-menu-person > span, .workspace-menu > a > span, .feed-search-prompt kbd,
.for-you-heading h2, .feed-profile-avatar, .feed-account.account-icon-control:hover {
  background: var(--theme-raised);
  color: var(--theme-ink);
}
.feed-tag, .feed-kicker, .for-you-heading p, .interest-kicker, .interest-status,
.discover-onboard-link, .feed-empty-copy small, .search-sheet header p, .menu-sheet header p,
.menu-profile small, .workspace-menu i, .menu-directory-groups strong { color: var(--theme-muted); }
.feed-author > span, .result-avatar, .preview-business-mark { background-color: var(--theme-raised); color: var(--theme-accent); }
.feed-media-person.is-text-card, .feed-media-business.is-text-card { color: #181a17; }
.spr-compact-home .feed-image.is-text-card { color: white; }
.interest-option input:checked + span, .interest-actions .interest-save, .menu-sheet footer a {
  background: var(--theme-ink); color: var(--theme-bg);
}

/* Authentication, account review, profile forms, business editor and Studio controls. */
.auth-field input, .auth-interest-option, .subdomain-field,
.review-header nav :is(a,button), .review-business-card, .review-social :is(input,select),
.review-social-actions button, .editor-header, .profile-action, .profile-photo-row button,
.field-grid :is(input,select,textarea), .prefixed-input, .suffixed-input,
.profile-business-picker select, .profile-link-control input[readonly],
.personal-resource-grid :is(input:not([type=checkbox]),textarea,select),
.personal-form-heading button, .personal-resource-item, .personal-resource-item button,
.personal-mention-suggestions :is(button,p), .studio-item, .studio-item button, .quiet-button,
.studio-field-grid :is(input:not([type=checkbox]),textarea,select),
.authority-fields :is(input,select,textarea), .repeat-field :is(input,select,textarea),
.authority-suggestion button, .form-actions, .authority-actions {
  background-color: var(--theme-surface); color: var(--theme-ink); border-color: var(--theme-line);
}
.auth-page .compact-menu-toggle, .auth-page .compact-menu-links a { color: var(--theme-ink); border-color: var(--theme-line); }
.auth-page .compact-menu-toggle:hover, .auth-password-toggle:hover, .auth-interest-option:hover,
.profile-action:hover, .review-header nav :is(a,button):hover,
.personal-mention-suggestions button:is(:hover,:focus-visible) { background: var(--theme-raised); color: var(--theme-ink); }
.auth-interest-option:has(input:checked), .review-social-actions .review-social-save,
.profile-action.profile-action-primary, .profile-link-control button, .profile-access > a,
.auth-header nav a:last-child, .auth-page .compact-header-actions .feed-account.is-guest {
  background: var(--theme-ink); color: var(--theme-bg); border-color: var(--theme-ink);
}
.auth-submit:hover, .save-button:hover, .profile-action.profile-action-primary:hover {
  background: var(--theme-accent); color: var(--theme-bg); border-color: var(--theme-accent);
}
.profile-toggle button > span, .form-heading > span, .save-state, .profile-photo-row,
.cover-uploader, .identity-clarifier, .onboarding-consent, .personal-resource-form,
.personal-resource-list > p, .personal-mention-chip, .personal-mention-chip button,
.profile-toast, .review-business-image, .review-business-image span, .review-list-icon,
.domain-field i, .image-preview, .preview-logo, .preview-links a, .studio-empty,
.authority-readiness-track, .authority-suggestion, .authority-approval,
.form-section .portfolio-section-options label > span {
  background-color: var(--theme-raised); color: var(--theme-ink); border-color: var(--theme-line);
}
.profile-toggle button[aria-selected=true] small { color: var(--theme-bg); }
.profile-toggle button[aria-selected=true] > span { color: var(--theme-bg); background: rgb(0 0 0 / 10%); }
.auth-field input::placeholder, .auth-legal, .profile-title h1 em, .profile-preview blockquote,
.preview-about p, .preview-socials > span, .authority-suggestion p, .authority-approval p:not(.eyebrow) { color: var(--theme-muted); }
.review-status, .auth-kicker, .auth-status.is-success, .profile-kicker, .form-heading p,
.profile-preview > p, .onboarding-domain-preview > p { color: var(--theme-accent); }
.form-section :is(input:not([type=checkbox],[type=radio],[type=file],[type=color]),textarea,select) {
  background-color: var(--theme-surface); color: var(--theme-ink); border-color: var(--theme-line);
}

/* Publishing, rich text editor, link and media pickers. */
.editor-canvas > textarea, .editor-cover-dropzone, .editor-add-media, .editor-media-item,
.editor-settings-card :is(input,select,textarea), .editor-mention-suggestions, .editor-form-actions,
.editor-section-title > :is(label,span), .editor-photo-actions > :is(label,button),
.image-adjuster, .image-adjuster-close, .image-ratio-options button, .image-fit-options button,
.image-adjuster-footer, .ckeditor-wrap, .article-link-dialog, sparlab-article-tools button, .article-link-dialog button {
  background-color: var(--theme-surface); color: var(--theme-ink); border-color: var(--theme-line);
}
#editor-excerpt, #editor-body, .ckeditor-wrap .ck-content { color: var(--theme-ink); }
.editor-cover-dropzone.is-dragging, .editor-add-media > span, .editor-mention-chip, .editor-preview-link,
.editor-mention-option:is(:hover,[aria-selected=true]), .editor-mention-chip button:is(:hover,:focus-visible),
.editor-media-actions button, .schema-ready, .ckeditor-wrap .ck-content blockquote {
  background-color: var(--theme-raised); color: var(--theme-ink);
}
.image-ratio-options button.is-selected, .image-fit-options button.is-selected,
.article-link-dialog button[type=submit] { background: var(--theme-ink); color: var(--theme-bg); }
.ckeditor-wrap {
  --ck-color-base-background: var(--theme-surface);
  --ck-color-base-foreground: var(--theme-raised);
  --ck-color-base-border: var(--theme-line);
  --ck-color-base-text: var(--theme-ink);
  --ck-color-text: var(--theme-ink);
  --ck-color-toolbar-background: var(--theme-raised);
  --ck-color-panel-background: var(--theme-surface);
  --ck-color-input-background: var(--theme-surface);
  --ck-color-input-text: var(--theme-ink);
  --ck-color-button-default-hover-background: var(--theme-raised);
  --ck-color-button-on-background: var(--theme-raised);
  --ck-color-button-on-color: var(--theme-accent);
}
.ckeditor-wrap .ck.ck-toolbar, .ckeditor-wrap .ck.ck-editor__editable { background: var(--theme-surface) !important; color: var(--theme-ink); }

/* Workspace navigation, dashboards, cards with literal legacy colours and dialogs. */
.sidebar, .sidebar .brand-row, .recommendation-card { background: var(--theme-surface); color: var(--theme-ink); }
.workspace-switcher, .workspace-copy select option, .nav-item:hover { background-color: var(--theme-raised); color: var(--theme-ink); }
.nav-item.is-active .nav-badge, .nav-item.is-active .nav-count { color: var(--theme-bg); }
.primary-action:hover, .secondary-action:hover, .recommendation-card .primary-action,
.community-link, .recap-card-action button, .business-search-form button, .identity-grid .connect-button,
.confirm-dialog button[value=confirm], .journey-step.is-current > span, .switch input:checked + span {
  background-color: var(--theme-ink); color: var(--theme-bg);
}
.recommendation-card .primary-action:hover, .community-link:is(:hover,:focus-visible),
.recap-card-action button:is(:hover,:focus-visible) { background: var(--theme-accent); color: var(--theme-bg); }
.switch input:checked + span::after { background-color: var(--theme-bg); }
.workspace-account-menu, .workspace-empty, .recap-dialog, .recap-dialog input[type=email],
.confirm-dialog, .confirm-dialog button, .toast, .gallery-dropzone, .gallery-caption input,
.gallery-manager-item, .gallery-empty, .article-form :is(textarea,select), .composer-media, .add-media-button,
.article-media-item, .spar-panel, .spar-suggestion, .conversation-list, .conversation-search,
.circle-card, .email-preview-card, .email-window, .ai-answer, body #message-recipient,
body .conversation-list > input, .conversation-list select {
  background-color: var(--theme-surface); color: var(--theme-ink); border-color: var(--theme-line);
}
.table-head, .table-row:not(.table-head):hover, .modal-insight, .public-pages-note,
.command-results button:hover, .composer-options button, .composer-media-heading > span,
.add-media-button > span, .draft-state, .draft-state-lilac, .spar-suggestion:hover,
.conversation-item:is(:hover,.is-active), .message.received, .message.sent, .discovery-note,
.email-window-top, .email-highlight, .automation-strip, .automation-status,
.settings-avatar, .recap-actions > button:first-child, .recap-close, .confirm-symbol,
.workspace-menu-person > span, .workspace-account-menu nav a > span,
.week-grid span, .trend-pill, .streak-badge, .opportunity-count, .score-ring, .graph-stage,
.graph-canvas-large, .icon-lime, .icon-lilac, .icon-peach, .icon-muted, .icon-cite, .icon-link, .icon-topic {
  background-color: var(--theme-raised); color: var(--theme-ink); border-color: var(--theme-line);
}
.briefing { color: #181a17; }
.command-search, kbd, .public-pages-note > p, .spar-panel > p, .discovery-note,
.automation-status p:not(.eyebrow), .email-body > p, .email-body > small,
.settings-nav span, .spar-suggestion small { color: var(--theme-muted); }
.settings-nav a.is-active span, .settings-nav a:hover span { color: var(--theme-bg); }
.identity-clarifier > :is(span,i,b), .potential-score span, .automation-status-metric span { color: var(--theme-muted); }
.onboarding-consent > span, .new-draft-card button > span, .recommendation-label,
.avatar, .entity-mini, .symbol-lime, .gallery-upload-icon, .profile-toast i,
.business-result-title h3 i, .business-empty-state > span { color: var(--theme-bg); }
.avatar-dark, .node-symbol, .entity-company, .topic-bubble b, .automation-icon,
.automation-status-icon, .identity-grid > div > span, .journey-step.is-done > span {
  background-color: var(--theme-raised); color: var(--theme-ink);
}
.chart-tooltip, .chart-tooltip::after { background: var(--theme-raised); }
.chart-tooltip span { color: var(--theme-muted); }
.library-tabs button.is-active span, .content-gap-card .primary-action,
.audience-card .primary-action, .recap-card-points span::before { color: var(--theme-bg); }
.sidebar .brand { background: transparent; }
.workspace-copy small, .workspace-copy > span { color: var(--theme-muted); }
.command-search kbd, .mobile-avatar, .mobile-avatar:hover, .mobile-avatar[aria-expanded=true] {
  background-color: var(--theme-raised); color: var(--theme-ink); border-color: var(--theme-line);
}
.profile-photo-row > span, .preview-avatar { color: var(--theme-bg); border-color: var(--theme-line); }

/* Invitation responses, warnings and validation stay distinguishable in dark mode. */
a.spr-notification-bell, .spr-invite-actions button, .spr-inbox [data-more-notifications] {
  background: var(--theme-surface); color: var(--theme-ink); border-color: var(--theme-line);
}
.spr-invitation, .spr-invite-access li { border-color: var(--theme-line); }
.spr-invite-kind, .spr-invitation-copy p, .spr-notification-empty,
.spr-invite-access li, .spr-inbox [role=status] { color: var(--theme-muted); }
.spr-unread-label, body:has(.spr-inbox:target) .settings-nav a[href="#notifications"] {
  background: var(--theme-raised); color: var(--theme-ink);
}
.spr-notification-bell span, .spr-invite-actions .spr-invite-accept {
  background: var(--theme-accent); color: var(--theme-bg); border-color: var(--theme-accent);
}
.session-logout, .workspace-menu-logout, .review-social-feedback,
.studio-item button:is([data-action=delete],[data-action=revoke]),
.personal-resource-item button[data-personal-action=delete], .personal-resource-actions p.is-error,
.personal-resource-list > p.is-error, .form-actions p.is-error, .studio-actions p.is-error,
.studio-empty.is-error, .editor-media-actions button.is-remove, .gallery-upload-actions .is-error {
  color: var(--member-error);
}
.session-logout:hover, .workspace-menu-logout:hover, .toast.is-error, .profile-toast.is-error,
.editor-media-actions button.is-remove, .personal-resource-list > p.is-error, .studio-empty.is-error {
  background-color: #402c29; border-color: #8e5b54;
}
:is(input,textarea)::placeholder { color: var(--theme-muted); }
:is(a,button,input,select,textarea,[tabindex]):focus-visible { outline-color: var(--theme-accent); }
