/* IBR shared appearance system. Dark mode uses high-contrast neutral surfaces. */
html[data-appearance="dark"] {
  color-scheme: dark;
  --ibr-bg: #0b1120;
  --ibr-surface: #111827;
  --ibr-surface-raised: #1f2937;
  --ibr-text: #f3f4f6;
  --ibr-muted: #cbd5e1;
  --ibr-border: #475569;
  --ibr-link: #93c5fd;
  --ibr-header: #071d4a;
}

/* Remove light page canvases, gradients and inline background declarations. */
html[data-appearance="dark"] body,
html[data-appearance="dark"] .page-wrapper,
html[data-appearance="dark"] #protected-content,
html[data-appearance="dark"] main,
html[data-appearance="dark"] .settings-shell,
html[data-appearance="dark"] .members-shell,
html[data-appearance="dark"] .container,
html[data-appearance="dark"] section,
html[data-appearance="dark"] .content,
html[data-appearance="dark"] .panel,
html[data-appearance="dark"] .panel-head,
html[data-appearance="dark"] .panel-body,
html[data-appearance="dark"] .card,
html[data-appearance="dark"] .settings-card,
html[data-appearance="dark"] .auth-shell,
html[data-appearance="dark"] .modal,
html[data-appearance="dark"] .modal-content,
html[data-appearance="dark"] .message,
html[data-appearance="dark"] .message-card,
html[data-appearance="dark"] .post-card,
html[data-appearance="dark"] .listing-card,
html[data-appearance="dark"] .resource-card,
html[data-appearance="dark"] .member-guide-card,
html[data-appearance="dark"] .security-note,
html[data-appearance="dark"] .mfa-panel,
html[data-appearance="dark"] .resource-footer,
html[data-appearance="dark"] footer,
html[data-appearance="dark"] .site-footer,
html[data-appearance="dark"] .footer,
html[data-appearance="dark"] .footer-content,
html[data-appearance="dark"] .footer-inner,
html[data-appearance="dark"] .footer-bottom,
html[data-appearance="dark"] .footer-links,
html[data-appearance="dark"] .cookie-banner,
html[data-appearance="dark"] .notice,
html[data-appearance="dark"] [class*="footer"] {
  background: var(--ibr-surface) !important;
  background-image: none !important;
  color: var(--ibr-text) !important;
  border-color: var(--ibr-border) !important;
  box-shadow: none;
}

/* Global readable text, including text with page-specific inline colours. */
html[data-appearance="dark"] body,
html[data-appearance="dark"] h1,
html[data-appearance="dark"] h2,
html[data-appearance="dark"] h3,
html[data-appearance="dark"] h4,
html[data-appearance="dark"] h5,
html[data-appearance="dark"] h6,
html[data-appearance="dark"] p,
html[data-appearance="dark"] li,
html[data-appearance="dark"] label,
html[data-appearance="dark"] strong,
html[data-appearance="dark"] b,
html[data-appearance="dark"] small,
html[data-appearance="dark"] dt,
html[data-appearance="dark"] dd,
html[data-appearance="dark"] blockquote,
html[data-appearance="dark"] figcaption,
html[data-appearance="dark"] legend,
html[data-appearance="dark"] summary,
html[data-appearance="dark"] address,
html[data-appearance="dark"] .muted,
html[data-appearance="dark"] .text-muted,
html[data-appearance="dark"] .settings-label,
html[data-appearance="dark"] .settings-value,
html[data-appearance="dark"] .status-note,
html[data-appearance="dark"] td,
html[data-appearance="dark"] th,
html[data-appearance="dark"] footer *,
html[data-appearance="dark"] [class*="footer"] * {
  color: var(--ibr-text) !important;
}

/* Common nested surfaces often missed by page-level selectors. */
html[data-appearance="dark"] .settings-row,
html[data-appearance="dark"] .member-commercial-links,
html[data-appearance="dark"] .list-group-item,
html[data-appearance="dark"] .dropdown-menu,
html[data-appearance="dark"] .dropdown-item,
html[data-appearance="dark"] .popover,
html[data-appearance="dark"] .tooltip-inner,
html[data-appearance="dark"] .table,
html[data-appearance="dark"] table,
html[data-appearance="dark"] tr,
html[data-appearance="dark"] th,
html[data-appearance="dark"] td,
html[data-appearance="dark"] hr,
html[data-appearance="dark"] fieldset {
  background-color: var(--ibr-surface) !important;
  border-color: var(--ibr-border) !important;
}
html[data-appearance="dark"] .settings-row { border-bottom-color: var(--ibr-border) !important; }

/* Form controls retain a distinct surface and legible placeholder text. */
html[data-appearance="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-appearance="dark"] textarea,
html[data-appearance="dark"] select,
html[data-appearance="dark"] option,
html[data-appearance="dark"] .form-control {
  background-color: var(--ibr-surface-raised) !important;
  color: #f9fafb !important;
  border-color: #64748b !important;
}
html[data-appearance="dark"] input::placeholder,
html[data-appearance="dark"] textarea::placeholder { color: #cbd5e1 !important; opacity: 1; }
html[data-appearance="dark"] input[type="checkbox"],
html[data-appearance="dark"] input[type="radio"] { accent-color: #60a5fa; }

/* Header and navigation use the site's established dark royal-blue palette. */
html[data-appearance="dark"] .resource-nav,
html[data-appearance="dark"] .site-header,
html[data-appearance="dark"] header {
  background: var(--ibr-header) !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: #1e3a8a !important;
}
html[data-appearance="dark"] .sidebar-menu-shell,
html[data-appearance="dark"] nav[aria-label] {
  background: var(--ibr-surface) !important;
  border-color: var(--ibr-border) !important;
}
html[data-appearance="dark"] .sidebar-menu-link { color: var(--ibr-text) !important; }
html[data-appearance="dark"] .sidebar-menu-link:hover,
html[data-appearance="dark"] .sidebar-menu-link:focus-visible {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

/* Links remain distinguishable; preserve explicit button semantics and contrast. */
html[data-appearance="dark"] a:not(.btn):not(.sidebar-menu-link):not(.button) {
  color: var(--ibr-link) !important;
}
html[data-appearance="dark"] .btn-primary,
html[data-appearance="dark"] button.btn-primary,
html[data-appearance="dark"] .guide-action.btn-primary {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
}
html[data-appearance="dark"] .btn-outline,
html[data-appearance="dark"] .guide-action.btn-outline {
  background: #111827 !important;
  color: #bfdbfe !important;
  border-color: #60a5fa !important;
}
html[data-appearance="dark"] button:not(.btn-primary):not(.btn-outline),
html[data-appearance="dark"] input[type="button"],
html[data-appearance="dark"] input[type="submit"] {
  color: var(--ibr-text);
}

/* Keep meaningful status colours and images intact. */
html[data-appearance="dark"] .error,
html[data-appearance="dark"] [role="alert"] { color: #fecaca !important; }
html[data-appearance="dark"] .success,
html[data-appearance="dark"] [data-status="success"] { color: #86efac !important; }
html[data-appearance="dark"] img,
html[data-appearance="dark"] canvas,
html[data-appearance="dark"] video { filter: none; }
html[data-appearance="dark"] :focus-visible { outline-color: #93c5fd; }
html[data-appearance="dark"] ::selection { background: #1d4ed8; color: #ffffff; }
@media (prefers-reduced-motion: reduce) {
  html[data-appearance="dark"] * { scroll-behavior: auto !important; }
}

/* Insights Archive: its 20 dynamically rendered cards and nested metadata/tags. */
html[data-appearance="dark"] #insightsList .insight-card,
html[data-appearance="dark"] #substackList .insight-card,
html[data-appearance="dark"] .insights-shell .insight-card {
  background: #111827 !important;
  background-image: none !important;
  color: #f3f4f6 !important;
  border: 1px solid #475569 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22) !important;
}
html[data-appearance="dark"] .insights-synopsis,
html[data-appearance="dark"] .insights-synopsis p,
html[data-appearance="dark"] .insights-synopsis h1,
html[data-appearance="dark"] #insightsList .insight-card h2,
html[data-appearance="dark"] #substackList .insight-card h2,
html[data-appearance="dark"] .insight-card .insight-snippet {
  color: #f3f4f6 !important;
}
html[data-appearance="dark"] .insight-card .insight-meta,
html[data-appearance="dark"] .insights-status {
  color: #cbd5e1 !important;
}
html[data-appearance="dark"] .insight-card .insight-tag {
  background: #334155 !important;
  color: #f8fafc !important;
  border: 1px solid #64748b !important;
}
html[data-appearance="dark"] .insight-card .insight-tag.priority {
  background: #1e3a8a !important;
  color: #dbeafe !important;
  border-color: #3b82f6 !important;
}
html[data-appearance="dark"] .insight-card .insight-link {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border: 1px solid #60a5fa !important;
}
html[data-appearance="dark"] .insight-card .insight-link:hover,
html[data-appearance="dark"] .insight-card .insight-link:focus-visible {
  background: #1e40af !important;
  color: #ffffff !important;
}
html[data-appearance="dark"] .insights-divider {
  border-top-color: #475569 !important;
}


/* Requested dark-mode finishing pass: settings notice, payments, directory, contact and mailbox. */
html[data-appearance="dark"] #settingsShell [role="note"] {
  background: #1f2937 !important;
  color: #e5e7eb !important;
  border-color: #64748b !important;
}
html[data-appearance="dark"] .directory-title,
html[data-appearance="dark"] .directory-header,
html[data-appearance="dark"] .directory-intro,
html[data-appearance="dark"] .directory-field,
html[data-appearance="dark"] .directory-status,
html[data-appearance="dark"] .directory-count,
html[data-appearance="dark"] .directory-counts,
html[data-appearance="dark"] .filter-count,
html[data-appearance="dark"] .results-count,
html[data-appearance="dark"] .directory-controls,
html[data-appearance="dark"] .directory-search,
html[data-appearance="dark"] .directory-grid .profile-card,
html[data-appearance="dark"] .profile-card .profile-card-body,
html[data-appearance="dark"] .profile-card .profile-details,
html[data-appearance="dark"] .profile-card .profile-actions {
  background: #111827 !important;
  background-image: none !important;
  color: #f3f4f6 !important;
  border-color: #475569 !important;
}
html[data-appearance="dark"] .directory-search input,
html[data-appearance="dark"] .directory-field select,
html[data-appearance="dark"] .directory-controls button,
html[data-appearance="dark"] .directory-controls .btn,
html[data-appearance="dark"] .directory-grid .profile-card button,
html[data-appearance="dark"] .directory-grid .profile-card a,
html[data-appearance="dark"] .message-member-btn {
  background: #1f2937 !important;
  color: #dbeafe !important;
  border-color: #60a5fa !important;
}
html[data-appearance="dark"] .directory-controls button:hover,
html[data-appearance="dark"] .directory-controls .btn:hover,
html[data-appearance="dark"] .directory-grid .profile-card button:hover,
html[data-appearance="dark"] .directory-grid .profile-card a:hover,
html[data-appearance="dark"] .message-member-btn:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}
html[data-appearance="dark"] .directory-grid .profile-card .online-status,
html[data-appearance="dark"] .directory-grid .profile-card .offline-status {
  background: transparent !important;
}
html[data-appearance="dark"] .note,
html[data-appearance="dark"] p.note,
html[data-appearance="dark"] .what-happens-next {
  background: #111827 !important;
  color: #f3f4f6 !important;
  border: 1px solid #475569 !important;
  border-radius: 12px;
  padding: 1rem;
}
html[data-appearance="dark"] .mail-layout,
html[data-appearance="dark"] .mail-sidebar,
html[data-appearance="dark"] .mail-column,
html[data-appearance="dark"] .mail-list,
html[data-appearance="dark"] .mail-list-panel,
html[data-appearance="dark"] .mailbox-column,
html[data-appearance="dark"] .thread-body,
html[data-appearance="dark"] .message-starter,
html[data-appearance="dark"] .pinned-list,
html[data-appearance="dark"] .recipient-notice,
html[data-appearance="dark"] .notification,
html[data-appearance="dark"] .new-message-notice,
html[data-appearance="dark"] .mail-notice,
html[data-appearance="dark"] .conversation-list,
html[data-appearance="dark"] .conversation-item,
html[data-appearance="dark"] .thread-panel {
  background: #111827 !important;
  background-image: none !important;
  color: #f3f4f6 !important;
  border-color: #475569 !important;
}
html[data-appearance="dark"] .mail-layout button:not(.btn-primary):not(.btn-outline),
html[data-appearance="dark"] .mail-layout .btn:not(.btn-primary):not(.btn-outline),
html[data-appearance="dark"] .mail-layout .member-select,
html[data-appearance="dark"] .mail-layout input,
html[data-appearance="dark"] .mail-layout textarea,
html[data-appearance="dark"] .mail-layout select {
  background: #1f2937 !important;
  color: #f3f4f6 !important;
  border-color: #64748b !important;
}
html[data-appearance="dark"] .profile-feed-panel .feed-refresh,
html[data-appearance="dark"] .profile-feed-panel #togglePrivateLikes,
html[data-appearance="dark"] .profile-feed-panel #closePrivateLikes,
html[data-appearance="dark"] .profile-feed-panel a.feed-refresh[href="/posts.html"] {
  background: #111827 !important;
  color: #bfdbfe !important;
  border: 1px solid #60a5fa !important;
  border-radius: 8px;
  font-weight: 700;
}
html[data-appearance="dark"] .profile-feed-panel .feed-refresh:hover,
html[data-appearance="dark"] .profile-feed-panel .feed-refresh:focus-visible {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}
/* Payment page uses its own inline component palette; override its hard-coded light surfaces. */
html[data-appearance="dark"] {
  --payment-bg: #0b1120;
  --payment-ink: #f3f4f6;
  --payment-muted: #cbd5e1;
  --payment-green: #1d4ed8;
  --payment-light: #3b82f6;
  --payment-line: #475569;
}
html[data-appearance="dark"] body:has(.payment-card) {
  background: #0b1120 !important;
  color: #f3f4f6 !important;
}
html[data-appearance="dark"] .payment-header,
html[data-appearance="dark"] .payment-card,
html[data-appearance="dark"] .stripe-box,
html[data-appearance="dark"] .payment-footer,
html[data-appearance="dark"] .payment-footer .cookie-bar {
  background: #111827 !important;
  background-image: none !important;
  color: #f3f4f6 !important;
  border-color: #475569 !important;
}
html[data-appearance="dark"] .payment-kicker {
  background: #1e3a8a !important;
  color: #dbeafe !important;
  border-color: #3b82f6 !important;
}
html[data-appearance="dark"] .payment-nav a,
html[data-appearance="dark"] .payment-footer .cookie-actions button {
  background: #1f2937 !important;
  color: #dbeafe !important;
  border-color: #64748b !important;
}
html[data-appearance="dark"] .payment-nav a[aria-current="page"],
html[data-appearance="dark"] .payment-button {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
}
html[data-appearance="dark"] .payment-footer a,
html[data-appearance="dark"] .payment-footer .cookie-bar a,
html[data-appearance="dark"] .payment-footer .footer-links a {
  color: #bfdbfe !important;
}

/* Mailbox-specific surfaces and unread/new-message indicators. */
html[data-appearance="dark"] .mail-shell,
html[data-appearance="dark"] .panel-box,
html[data-appearance="dark"] .conversation-search-wrap,
html[data-appearance="dark"] .conversation-item,
html[data-appearance="dark"] .thread,
html[data-appearance="dark"] .compose,
html[data-appearance="dark"] .pinned-strip,
html[data-appearance="dark"] .pinned-chip,
html[data-appearance="dark"] .login-card,
html[data-appearance="dark"] .emoji-picker,
html[data-appearance="dark"] .attachment-item {
  background: #111827 !important;
  background-image: none !important;
  color: #f3f4f6 !important;
  border-color: #475569 !important;
}
html[data-appearance="dark"] .conversation-item:hover,
html[data-appearance="dark"] .conversation-item.active,
html[data-appearance="dark"] .conversation-star:hover,
html[data-appearance="dark"] .attachment-control:hover {
  background: #1e3a8a !important;
  color: #ffffff !important;
}
html[data-appearance="dark"] .conversation-name,
html[data-appearance="dark"] .compose-label,
html[data-appearance="dark"] .login-card h2,
html[data-appearance="dark"] .message-body,
html[data-appearance="dark"] .pinned-strip strong {
  color: #f3f4f6 !important;
}
html[data-appearance="dark"] .conversation-preview,
html[data-appearance="dark"] .message-meta,
html[data-appearance="dark"] .recipient-notice,
html[data-appearance="dark"] .attachment-hint,
html[data-appearance="dark"] .attachment-pending,
html[data-appearance="dark"] .login-card p,
html[data-appearance="dark"] .empty,
html[data-appearance="dark"] .status {
  color: #cbd5e1 !important;
}
html[data-appearance="dark"] .conversation-search,
html[data-appearance="dark"] .member-select,
html[data-appearance="dark"] .compose textarea,
html[data-appearance="dark"] .attachment-control,
html[data-appearance="dark"] .format-toggle,
html[data-appearance="dark"] .emoji-choice,
html[data-appearance="dark"] .anonymise-message-btn {
  background: #1f2937 !important;
  color: #f3f4f6 !important;
  border-color: #64748b !important;
}
html[data-appearance="dark"] .message,
html[data-appearance="dark"] .message.incoming {
  background: #1f2937 !important;
  color: #f3f4f6 !important;
  border-color: #475569 !important;
}
html[data-appearance="dark"] .message.outgoing {
  background: #172554 !important;
  color: #eff6ff !important;
  border-color: #3b82f6 !important;
}
html[data-appearance="dark"] .unread-filter-btn,
html[data-appearance="dark"] .mail-unread-indicator {
  background: #1f2937 !important;
  color: #dbeafe !important;
  border-color: #64748b !important;
}
html[data-appearance="dark"] .unread-filter-btn[aria-pressed="true"] {
  background: #14532d !important;
  color: #dcfce7 !important;
  border-color: #22c55e !important;
}
html[data-appearance="dark"] .mail-unread-indicator.has-unread,
html[data-appearance="dark"] .conversation-item.has-unread,
html[data-appearance="dark"] .message.is-unread,
html[data-appearance="dark"] .message-unread-label {
  background: #422006 !important;
  color: #fef3c7 !important;
  border-color: #f59e0b !important;
}
html[data-appearance="dark"] .unread-filter-count {
  background: #14532d !important;
  color: #dcfce7 !important;
}


/* Profile feed: make Like/Delete match the outlined "Your Likes" control. */
html[data-appearance="dark"] .profile-feed-panel .post-like-button,
html[data-appearance="dark"] .profile-feed-panel .post-delete-button,
html[data-appearance="dark"] .profile-feed-panel .post-action-button,
html[data-appearance="dark"] .profile-feed-panel .reply-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .45rem .7rem;
  border: 1px solid #60a5fa !important;
  border-radius: 8px;
  background: #111827 !important;
  color: #bfdbfe !important;
  font-weight: 700;
  text-decoration: none;
}
html[data-appearance="dark"] .profile-feed-panel .post-like-button.is-liked {
  background: #172554 !important;
  color: #dbeafe !important;
  border-color: #818cf8 !important;
}
html[data-appearance="dark"] .profile-feed-panel .post-like-button:hover,
html[data-appearance="dark"] .profile-feed-panel .post-delete-button:hover,
html[data-appearance="dark"] .profile-feed-panel .post-action-button:hover,
html[data-appearance="dark"] .profile-feed-panel .reply-delete:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border-color: #93c5fd !important;
}
/* Profile feed PDF and attachment preview surfaces. */
html[data-appearance="dark"] .profile-feed-panel .post-attachments,
html[data-appearance="dark"] .profile-feed-panel .post-attachment,
html[data-appearance="dark"] .profile-feed-panel .post-attachment-pdf,
html[data-appearance="dark"] .profile-feed-panel .attachment-title,
html[data-appearance="dark"] .profile-feed-panel .pdf-preview,
html[data-appearance="dark"] .profile-feed-panel .post-image-preview,
html[data-appearance="dark"] .profile-feed-panel .post-url-preview {
  background: #111827 !important;
  background-image: none !important;
  color: #f3f4f6 !important;
  border-color: #475569 !important;
}
html[data-appearance="dark"] .profile-feed-panel .pdf-preview {
  background-color: #1f2937 !important;
  border: 1px solid #475569 !important;
  color-scheme: dark;
}
html[data-appearance="dark"] .profile-feed-panel .attachment-open-link,
html[data-appearance="dark"] .profile-feed-panel .post-url-preview-title {
  color: #bfdbfe !important;
}
/* Social Feed: every page-level control, composer action, search/filter button and attachment area. */
html[data-appearance="dark"] .posts-shell .feed-refresh,
html[data-appearance="dark"] .posts-shell .post-action-button,
html[data-appearance="dark"] .posts-shell .format-button,
html[data-appearance="dark"] .posts-shell .composer-publish-actions button,
html[data-appearance="dark"] .posts-shell .post-search-button,
html[data-appearance="dark"] .posts-shell button:not(.primary-post-button),
html[data-appearance="dark"] .posts-shell input[type="button"],
html[data-appearance="dark"] .posts-shell input[type="submit"] {
  background: #111827 !important;
  color: #bfdbfe !important;
  border: 1px solid #60a5fa !important;
  border-radius: 8px;
  font-weight: 700;
}
html[data-appearance="dark"] .posts-shell .primary-post-button,
html[data-appearance="dark"] .posts-shell button[type="submit"] {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border: 1px solid #60a5fa !important;
}
html[data-appearance="dark"] .posts-shell button:hover,
html[data-appearance="dark"] .posts-shell button:focus-visible,
html[data-appearance="dark"] .posts-shell .feed-refresh:hover,
html[data-appearance="dark"] .posts-shell .format-button:hover,
html[data-appearance="dark"] .posts-shell .post-action-button:hover {
  background: #1e40af !important;
  color: #ffffff !important;
  border-color: #93c5fd !important;
}
html[data-appearance="dark"] .posts-shell .attachment-picker,
html[data-appearance="dark"] .posts-shell .selected-files,
html[data-appearance="dark"] .posts-shell .post-attachment,
html[data-appearance="dark"] .posts-shell .post-attachment-pdf,
html[data-appearance="dark"] .posts-shell .attachment-title,
html[data-appearance="dark"] .posts-shell .pdf-preview,
html[data-appearance="dark"] .posts-shell .post-image-preview,
html[data-appearance="dark"] .posts-shell .post-url-preview,
html[data-appearance="dark"] .posts-shell .post-reply,
html[data-appearance="dark"] .posts-shell .empty-feed {
  background: #111827 !important;
  background-image: none !important;
  color: #f3f4f6 !important;
  border-color: #475569 !important;
}
html[data-appearance="dark"] .posts-shell .attachment-picker {
  display: inline-flex;
  align-items: center;
  border: 1px solid #60a5fa !important;
  color: #bfdbfe !important;
  cursor: pointer;
}
html[data-appearance="dark"] .posts-shell .attachment-picker:hover,
html[data-appearance="dark"] .posts-shell .attachment-picker:focus-within {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}
html[data-appearance="dark"] .posts-shell .post-textarea,
html[data-appearance="dark"] .posts-shell .reply-textarea,
html[data-appearance="dark"] .posts-shell .post-editor,
html[data-appearance="dark"] .posts-shell #postSearchInput,
html[data-appearance="dark"] .posts-shell input:not([type="file"]):not([type="checkbox"]):not([type="radio"]) {
  background: #1f2937 !important;
  color: #f3f4f6 !important;
  border-color: #64748b !important;
}
html[data-appearance="dark"] .posts-shell .post-body,
html[data-appearance="dark"] .posts-shell .reply-body,
html[data-appearance="dark"] .posts-shell .post-author-name,
html[data-appearance="dark"] .posts-shell .post-url-preview-title {
  color: #f3f4f6 !important;
}
html[data-appearance="dark"] .posts-shell .post-time,
html[data-appearance="dark"] .posts-shell .post-private-author,
html[data-appearance="dark"] .posts-shell .character-count,
html[data-appearance="dark"] .posts-shell .selected-files,
html[data-appearance="dark"] .posts-shell .attachment-title,
html[data-appearance="dark"] .posts-shell .post-url-preview-domain,
html[data-appearance="dark"] .posts-shell .post-url-preview-description {
  color: #cbd5e1 !important;
}
html[data-appearance="dark"] .posts-shell .emoji-picker,
html[data-appearance="dark"] .posts-shell .emoji-choice {
  background: #1f2937 !important;
  color: #f3f4f6 !important;
  border-color: #64748b !important;
}
html[data-appearance="dark"] .posts-shell .status-message {
  background: #172554 !important;
  color: #dbeafe !important;
  border-color: #3b82f6 !important;
}
html[data-appearance="dark"] .posts-shell .status-message.error {
  background: #450a0a !important;
  color: #fecaca !important;
  border-color: #b91c1c !important;
}


/* Final production header pass: one solid royal-blue header across all root pages,
   overriding older transparent/test palettes and responsive header variants. */
.resource-nav,
.site-header,
header.resource-nav,
header.site-header {
  background: #0B2A6F !important;
  background-color: #0B2A6F !important;
  background-image: none !important;
  border-bottom-color: #0B2A6F !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html[data-appearance="dark"] .resource-nav,
html[data-appearance="dark"] .site-header,
html[data-appearance="dark"] header.resource-nav,
html[data-appearance="dark"] header.site-header,
html[data-appearance="dark"] header {
  background: #0B2A6F !important;
  background-color: #0B2A6F !important;
  background-image: none !important;
  border-bottom-color: #0B2A6F !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* The signed-in identity line in the Social Feed composer needs readable contrast. */
html[data-appearance="dark"] .posts-shell .composer-name,
html[data-appearance="dark"] #composeHeading {
  color: #F3F4F6 !important;
}


/* Fix header banding in dark mode: shared .container surfaces must remain transparent inside the royal-blue header. */
html[data-appearance="dark"] .resource-nav,
html[data-appearance="dark"] .site-header,
html[data-appearance="dark"] .resource-nav > .container,
html[data-appearance="dark"] .resource-nav .container-nav,
html[data-appearance="dark"] .resource-nav .user-menu,
html[data-appearance="dark"] .resource-nav .logo,
html[data-appearance="dark"] .site-header > .container,
html[data-appearance="dark"] .site-header .header-row,
html[data-appearance="dark"] .site-header .nav-links {
  background: #071D4A !important;
  background-color: #071D4A !important;
  background-image: none !important;
  border-color: #071D4A !important;
  box-shadow: none !important;
}
/* Header controls retain their own intentional button/chip styling; the bar behind them stays uninterrupted. */
html[data-appearance="dark"] .resource-nav .auth-profile-chip,
html[data-appearance="dark"] .site-header .auth-profile-chip {
  background: transparent !important;
}

/* Seamless blended production header palette */
/* Blend the two established royal blues on the header itself; all nested wrappers stay transparent so no seams or bands appear. */
.resource-nav,
.site-header,
header.resource-nav,
header.site-header,
html[data-appearance="dark"] .resource-nav,
html[data-appearance="dark"] .site-header,
html[data-appearance="dark"] header.resource-nav,
html[data-appearance="dark"] header.site-header,
html[data-appearance="dark"] header {
  background: linear-gradient(115deg, #071D4A 0%, #0B2A6F 52%, #071D4A 100%) !important;
  background-color: #071D4A !important;
  background-repeat: no-repeat !important;
  border-bottom-color: #071D4A !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html[data-appearance="dark"] .resource-nav > .container,
html[data-appearance="dark"] .resource-nav .container-nav,
html[data-appearance="dark"] .resource-nav .user-menu,
html[data-appearance="dark"] .resource-nav .logo,
html[data-appearance="dark"] .site-header > .container,
html[data-appearance="dark"] .site-header .header-row,
html[data-appearance="dark"] .site-header .nav-links,
.resource-nav > .container,
.resource-nav .container-nav,
.resource-nav .user-menu,
.resource-nav .logo,
.site-header > .container,
.site-header .header-row,
.site-header .nav-links {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}


/* Member Directory: production dark surfaces and matching heading/control contrast. */
html[data-appearance="dark"] body:has(.directory-shell),
html[data-appearance="dark"] body:has(.directory-shell) .page-wrapper { background:#111827 !important; color:#e5e7eb !important; }
html[data-appearance="dark"] .directory-title { color:#f8fafc !important; padding:.15rem 0 !important; margin:0 0 .65rem !important; }
html[data-appearance="dark"] .directory-intro,
html[data-appearance="dark"] .directory-summary,
html[data-appearance="dark"] .directory-pagination { color:#cbd5e1 !important; }
html[data-appearance="dark"] .directory-search,
html[data-appearance="dark"] .directory-controls,
html[data-appearance="dark"] .directory-pagination { background:#111827 !important; border-color:#334155 !important; }
html[data-appearance="dark"] .directory-search input { background:transparent !important; color:#f8fafc !important; }
html[data-appearance="dark"] .directory-search input::placeholder { color:#94a3b8 !important; }
html[data-appearance="dark"] .directory-field { color:#cbd5e1 !important; }
html[data-appearance="dark"] .directory-field select,
html[data-appearance="dark"] .directory-pagination select { background:#111827 !important; color:#e5e7eb !important; border-color:#475569 !important; }
html[data-appearance="dark"] .directory-grid .profile-card,
html[data-appearance="dark"] .directory-stat,
html[data-appearance="dark"] .directory-auth-prompt { background:#111827 !important; color:#e5e7eb !important; border-color:#334155 !important; box-shadow:0 8px 28px rgba(0,0,0,.28) !important; }
html[data-appearance="dark"] .directory-grid .profile-card .name { color:#7dd3fc !important; }
html[data-appearance="dark"] .directory-grid .profile-card .bio,
html[data-appearance="dark"] .directory-grid .profile-card .bio-empty { color:#cbd5e1 !important; }
html[data-appearance="dark"] .directory-grid .profile-card .bio a { color:#7dd3fc !important; }
html[data-appearance="dark"] .directory-stat strong,
html[data-appearance="dark"] .directory-empty strong,
html[data-appearance="dark"] .directory-auth-prompt h2 { color:#f8fafc !important; }
html[data-appearance="dark"] .directory-stat span,
html[data-appearance="dark"] .directory-auth-prompt p { color:#94a3b8 !important; }
html[data-appearance="dark"] .directory-empty { color:#cbd5e1 !important; background:#111827 !important; border-color:#475569 !important; }
html[data-appearance="dark"] .member-badge { background:#1e293b !important; color:#cbd5e1 !important; border-color:#475569 !important; }
html[data-appearance="dark"] .member-badge.identity-verified { background:#123524 !important; color:#bbf7d0 !important; border-color:#166534 !important; }
html[data-appearance="dark"] .member-badge.email-listed { background:#172554 !important; color:#bfdbfe !important; border-color:#1d4ed8 !important; }
html[data-appearance="dark"] .directory-tool-btn { background:#172338 !important; color:#e2e8f0 !important; border-color:#475569 !important; }
html[data-appearance="dark"] .directory-tool-btn:hover,
html[data-appearance="dark"] .directory-tool-btn:focus-visible { background:#1e3a5f !important; color:#f8fafc !important; border-color:#38bdf8 !important; }
html[data-appearance="dark"] .directory-tool-btn[aria-pressed="true"] { background:#075985 !important; border-color:#0284c7 !important; color:#fff !important; }
html[data-appearance="dark"] .member-action,
html[data-appearance="dark"] .message-member-btn { background:#172338 !important; color:#7dd3fc !important; border-color:#0369a1 !important; }
html[data-appearance="dark"] .member-action.primary { background:#075985 !important; color:#fff !important; border-color:#0369a1 !important; }
html[data-appearance="dark"] .member-action:hover,
html[data-appearance="dark"] .member-action:focus-visible,
html[data-appearance="dark"] .message-member-btn:hover,
html[data-appearance="dark"] .message-member-btn:focus-visible { background:#0369a1 !important; color:#fff !important; border-color:#0284c7 !important; }
html[data-appearance="dark"] .directory-loading { color:#cbd5e1 !important; }
html[data-appearance="dark"] .directory-loading-mark span { background:#38bdf8 !important; }
html[data-appearance="dark"] .sidebar-menu-shell { background:#0f1b2d !important; border-color:#334155 !important; box-shadow:0 10px 24px rgba(0,0,0,.35) !important; }
html[data-appearance="dark"] .sidebar-menu-link { color:#e2e8f0 !important; }
html[data-appearance="dark"] .sidebar-menu-link:hover,
html[data-appearance="dark"] .sidebar-menu-link:focus-visible { background:#1d4ed8 !important; color:#fff !important; }
