/*
 * BSOURIA V208 — final global dark-mode override.
 *
 * This stylesheet is deliberately loaded from the footer after all page,
 * module and admin styles. It removes remaining light surfaces from dark mode
 * while leaving light mode, images, videos and downloadable documents intact.
 */

html[data-theme="dark"] {
  color-scheme: dark;
  --v208-page: #06130e;
  --v208-surface: #0d2018;
  --v208-surface-2: #122a20;
  --v208-surface-3: #18382b;
  --v208-border: #315443;
  --v208-border-strong: #4a755f;
  --v208-text: #e9fff3;
  --v208-muted: #afcdbd;
  --v208-green: #19a968;
  --v208-green-light: #8ce8b7;
  --v208-warning-bg: #382f16;
  --v208-warning-border: #755f2b;
  --v208-warning-text: #f2d57d;
  --v208-danger-bg: #3b1d1c;
  --v208-danger-border: #77423e;
  --v208-danger-text: #ffb8b2;
}

/* =========================================================
   PAGE ROOTS
   ========================================================= */

html[data-theme="dark"] body,
html[data-theme="dark"] main,
html[data-theme="dark"] .page,
html[data-theme="dark"] .page-shell,
html[data-theme="dark"] .admin-app,
html[data-theme="dark"] .admin-main,
html[data-theme="dark"] .admin-content-wrap {
  background: var(--v208-page) !important;
  color: var(--v208-text) !important;
}

/* =========================================================
   EXACT INLINE LIGHT BACKGROUNDS
   Catches page-specific inline styles that escaped older audits.
   ========================================================= */

html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, nav, header,
  table, thead, tbody, tfoot, tr, td, th, details, summary, label
)[style*="background:#fff"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, nav, header,
  table, thead, tbody, tfoot, tr, td, th, details, summary, label
)[style*="background: #fff"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, nav, header,
  table, thead, tbody, tfoot, tr, td, th, details, summary, label
)[style*="background:white"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, nav, header,
  table, thead, tbody, tfoot, tr, td, th, details, summary, label
)[style*="background: white"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, nav, header,
  table, thead, tbody, tfoot, tr, td, th, details, summary, label
)[style*="background-color:#fff"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, nav, header,
  table, thead, tbody, tfoot, tr, td, th, details, summary, label
)[style*="background-color: #fff"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, nav, header,
  table, thead, tbody, tfoot, tr, td, th, details, summary, label
)[style*="rgb(255, 255, 255)"] {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* Pale grey/green inline boxes that look white in dark mode. */
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, table, td, th, details, summary
)[style*="background:#f"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, table, td, th, details, summary
)[style*="background: #f"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, table, td, th, details, summary
)[style*="background-color:#f"],
html[data-theme="dark"] body :is(
  div, section, article, aside, form, fieldset, table, td, th, details, summary
)[style*="background-color: #f"] {
  background: var(--v208-surface-2) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* =========================================================
   COMMON CARDS, PANELS, BOXES AND MODALS
   ========================================================= */

html[data-theme="dark"] body :is(
  .card,
  .panel,
  .box,
  .modal,
  .modal-content,
  .dialog,
  .dropdown,
  .dropdown-menu,
  .popover,
  .tooltip-box,
  .drawer,
  .sheet,
  .form-wrap,
  .form-card,
  .content-card,
  .section-card,
  .summary-card,
  .metric-card,
  .stat-card,
  .filter-card,
  .search-card,
  .sidebar-box,
  .empty,
  .empty-state,
  .pro-empty,
  .upload-box,
  .price-box,
  .searchbar,
  .blog-search,
  .hero-search,
  .faq-list details
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* =========================================================
   EMAIL ADMIN PAGE — EXACT SCREENSHOT FIX
   ========================================================= */

html[data-theme="dark"] body :is(
  .email-status-card,
  .email-section,
  .email-toggle,
  .email-channel
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body .email-warning {
  background: var(--v208-warning-bg) !important;
  border-color: var(--v208-warning-border) !important;
  color: var(--v208-warning-text) !important;
  -webkit-text-fill-color: var(--v208-warning-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body .email-warning * {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

html[data-theme="dark"] body .email-good {
  background: #123823 !important;
  border-color: #36714e !important;
  color: #96e8ba !important;
  -webkit-text-fill-color: #96e8ba !important;
}

html[data-theme="dark"] body :is(
  .email-code,
  .code-box,
  .copy-box,
  .readonly-box,
  pre,
  code
) {
  background: #091811 !important;
  border-color: var(--v208-border) !important;
  color: #bce7d0 !important;
  -webkit-text-fill-color: #bce7d0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body :is(
  .email-code,
  .code-box,
  .copy-box,
  .readonly-box
) * {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

/* =========================================================
   BUTTONS, TABS, PILLS AND COUNTERS
   ========================================================= */

html[data-theme="dark"] body :is(
  .btn:not(.primary):not(.danger):not(.warning),
  .admin-btn:not(.primary):not(.danger):not(.warning),
  button:not(.primary):not(.danger):not(.warning):not([data-remove-item]),
  input[type="button"],
  input[type="reset"],
  .tab,
  .settings-tab,
  .chip:not(.active),
  .pill:not(.active),
  .pagination a,
  .pagination span,
  .seo-pagination a,
  .seo-pagination span,
  .bd-outline-btn,
  .bd-back-categories,
  .bd-filter-reset,
  .language-current,
  .user-profile-toggle,
  .user-notification-toggle,
  .theme-toggle,
  .admin-menu,
  .admin-back-link,
  .social-auth-google
) {
  background: var(--v208-surface-2) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  -webkit-text-fill-color: var(--v208-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body :is(
  .btn:not(.primary):not(.danger):not(.warning),
  .admin-btn:not(.primary):not(.danger):not(.warning),
  button:not(.primary):not(.danger):not(.warning):not([data-remove-item]),
  input[type="button"],
  input[type="reset"],
  .tab,
  .settings-tab,
  .chip:not(.active),
  .pill:not(.active),
  .pagination a,
  .pagination span,
  .seo-pagination a,
  .seo-pagination span,
  .bd-outline-btn,
  .bd-back-categories,
  .bd-filter-reset,
  .language-current,
  .user-profile-toggle,
  .user-notification-toggle,
  .theme-toggle,
  .admin-menu,
  .admin-back-link,
  .social-auth-google
):hover {
  background: var(--v208-surface-3) !important;
  border-color: var(--v208-border-strong) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html[data-theme="dark"] body :is(
  .btn.primary,
  .admin-btn.primary,
  button.primary,
  input[type="submit"]
) {
  background: #0d8754 !important;
  border-color: #25ac70 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body :is(
  .btn.danger,
  .admin-btn.danger,
  button.danger
) {
  background: #7d302d !important;
  border-color: #a64a44 !important;
  color: #ffd5d1 !important;
  -webkit-text-fill-color: #ffd5d1 !important;
}

html[data-theme="dark"] body :is(
  .badge,
  .tag,
  .status,
  .featured,
  .article-category,
  .language-label,
  .bd-result-count,
  .online-mini-badge,
  .admin-sidebar nav a b
) {
  background: var(--v208-surface-3) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-green-light) !important;
  -webkit-text-fill-color: var(--v208-green-light) !important;
  box-shadow: none !important;
}

/* =========================================================
   FORM CONTROLS
   ========================================================= */

html[data-theme="dark"] body :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea
) {
  background: #081710 !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  -webkit-text-fill-color: var(--v208-text) !important;
  box-shadow: none !important;
  color-scheme: dark !important;
}

html[data-theme="dark"] body :is(input, textarea)::placeholder {
  color: #789384 !important;
  -webkit-text-fill-color: #789384 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] body select option {
  background: #0b1b14 !important;
  color: var(--v208-text) !important;
}

html[data-theme="dark"] body :is(input, select, textarea):disabled {
  background: #15261e !important;
  border-color: #304b3e !important;
  color: #789183 !important;
  -webkit-text-fill-color: #789183 !important;
  opacity: 1 !important;
}

/* White custom checkbox/radio tiles. */
html[data-theme="dark"] body input[type="checkbox"]:not([hidden]),
html[data-theme="dark"] body input[type="radio"]:not([hidden]) {
  background-color: #081710 !important;
  border-color: #557563 !important;
  accent-color: var(--v208-green) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body input[type="checkbox"]:checked,
html[data-theme="dark"] body input[type="radio"]:checked {
  background-color: #0e8b56 !important;
  border-color: #4dd18e !important;
}

/* =========================================================
   HEADER, MENUS, PANELS, COOKIE AND POPUPS
   ========================================================= */

html[data-theme="dark"] body :is(
  .topbar,
  .header-utility-group,
  .language-menu,
  .user-profile-panel,
  .user-notification-panel,
  .mobile-menu-panel,
  .mobile-language-panel,
  .mobile-user-panel,
  .cookie-consent,
  .maintenance,
  .welcome-popup-card,
  .welcome-popup-dialog
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body :is(
  .language-menu a:hover,
  .language-menu a.is-active,
  .user-notification-item:hover,
  .user-notification-item.unread,
  .notification-page-item.unread,
  .conversation-row.unread,
  .user-profile-panel-foot,
  .user-notification-foot
) {
  background: var(--v208-surface-2) !important;
  color: var(--v208-text) !important;
}

/* =========================================================
   PUBLIC HOME AND WELCOME PAGES
   ========================================================= */

html[data-theme="dark"] body :is(
  .home-eyebrow-v35,
  .home-search-v35,
  .home-benefits-grid-v35,
  .home-opportunity-card-v35,
  .home-opportunity-media-v35,
  .home-opportunity-badge-v35,
  .home-categories-v35,
  .home-category-grid-v35 a,
  .home-keywords-v35 a,
  .home-steps-flow-v35 > div > span,
  .home-outline-btn-v35,
  .bsv44-eyebrow,
  .bsv44-search,
  .bsv44-tail a,
  .bsv44-media,
  .bsv44-strip,
  .ws-sector-explorer-v45,
  .ws-sector-shell,
  .ws-sector-card,
  .ws-floating-card,
  .ws-soft,
  .ws-feature,
  .ws-content-card,
  .ws-business,
  .ws-business-logo,
  .ws-reasons > div,
  .ws-steps > div,
  .ws-resource-card,
  .ws-external-card,
  .ws-faq-list details,
  .ws-pathway-card,
  .ws-pathway-icon
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* =========================================================
   BUSINESS DIRECTORY AND BUSINESS DETAIL
   ========================================================= */

html[data-theme="dark"] body :is(
  .bd-card,
  .bd-category-card,
  .bd-filter,
  .bd-filter-bar,
  .bd-search,
  .bd-stat,
  .bd-trust-card,
  .business-card,
  .business-details,
  .business-sidebar,
  .business-review-card,
  .business-review-form,
  .business-contact-card,
  .review-score,
  .review-item
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* =========================================================
   ARTICLES, BLOG AND ENGAGEMENT
   ========================================================= */

html[data-theme="dark"] body :is(
  .blog-card,
  .blog-card-image,
  .article-action,
  .article-stat,
  .article-rating,
  .article-comment,
  .article-login-note,
  .article-share-options,
  .article-comment-icon,
  .article-note,
  .article-checklist,
  .article-sources,
  .article-toc,
  .article-related-card,
  .article-related-mark,
  .main-article-content blockquote
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body :is(
  .article-action:hover,
  .article-share-options a:hover,
  .article-share-options button:hover,
  .article-toc a:hover
) {
  background: var(--v208-surface-3) !important;
}

/* =========================================================
   PROFILE, ACCOUNT, DASHBOARD, SECURITY AND MESSAGES
   ========================================================= */

html[data-theme="dark"] body :is(
  .profile-hub-card,
  .profile-hub-checklist a,
  .profile-hub-complete,
  .profile-hub-badges span,
  .profile-hub-progress > div:last-child,
  .user-profile-panel-identity em,
  .user-profile-progress > div:last-child,
  .user-profile-menu-group > a > i,
  .security-card,
  .security-details > div,
  .expiry-decision-card,
  .expiry-decision-facts > div,
  .delete-account-card,
  .delete-account-warning,
  .account-danger-card,
  .profile-delete-link,
  .photo-canvas-wrap,
  .ai-photo-helper,
  .ai-panel,
  .ai-card,
  .conversation-row,
  .message-card,
  .notification-page-item
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* =========================================================
   CV BUILDER AND PREVIEWS
   ========================================================= */

html[data-theme="dark"] body :is(
  .cvb-page-v64,
  .cvb-progress-v64,
  .cvb-language-tab-v64,
  .cvb-preview-v64,
  .cvb65-page,
  .cvb65-language-tab,
  .cvb65-repeat-card,
  .cvb65-add-item,
  .cvb65-preview-sheet,
  .cvb65-templates span,
  .cvb65-preview-link,
  .cvb73-template-paper,
  .cvb73-template-card,
  .home-cv-sheet-v64,
  .home-cv-sheet-v73,
  .home-cv-features-v64 span
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body :is(
  .cvb-section-title-v64 > b,
  .cvb65-step-head > b,
  .cvb65-step-head > strong
) {
  background: var(--v208-surface-3) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-green-light) !important;
  -webkit-text-fill-color: var(--v208-green-light) !important;
}

/* =========================================================
   CONTACT, LEGAL, AI AND PARTICIPATION
   ========================================================= */

html[data-theme="dark"] body :is(
  .contact-card,
  .contact-form,
  .contact-mode-card,
  .contact-mode-option,
  .contact-side-card,
  .contact-form-head,
  .report-emergency-note,
  .report-confirm,
  .terms-meta-card,
  .terms-role-grid article,
  .terms-toc,
  .terms-document,
  .terms-document-intro,
  .participate-value-grid article,
  .participate-role-grid article,
  .participate-steps li,
  .participate-roles-section,
  .online-monitor-note,
  .online-tech-details > div
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* =========================================================
   ADMIN — COMPLETE FINAL LAYER
   ========================================================= */

html[data-theme="dark"] body :is(
  .admin-top,
  .admin-card,
  .admin-table-card,
  .admin-document-viewer,
  .admin-blog-row,
  .admin-overview-card,
  .admin-notification-panel,
  .admin-detail-card,
  .admin-user-summary,
  .admin-long-value,
  .admin-document-list > article,
  .admin-activity-list article,
  .admin-social-preview-card,
  .admin-info-grid > div,
  .admin-review-main,
  .admin-review-sidebar,
  .settings-card,
  .settings-tabs,
  .settings-language-grid > div,
  .settings-check,
  .settings-sticky-save,
  .settings-save-state,
  .seo-page-editor,
  .newsletter-stat,
  .campaign-composer,
  .simple-article-row,
  .simple-empty
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body :is(
  .admin-table th,
  .admin-storage-table th
) {
  background: #091811 !important;
  color: var(--v208-muted) !important;
  border-color: var(--v208-border) !important;
}

html[data-theme="dark"] body :is(
  .admin-table td,
  .admin-storage-table td
) {
  background: var(--v208-surface) !important;
  color: var(--v208-text) !important;
  border-color: var(--v208-border) !important;
}

html[data-theme="dark"] body .admin-table tbody tr:hover td {
  background: var(--v208-surface-3) !important;
}

html[data-theme="dark"] body :is(
  .admin-notification-head > span,
  .admin-attention-total,
  .admin-overview-icon,
  .admin-health-list > div,
  .admin-health-list > div > span,
  .simple-article-thumb,
  .admin-blog-thumb
) {
  background: var(--v208-surface-3) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-green-light) !important;
  -webkit-text-fill-color: var(--v208-green-light) !important;
}

html[data-theme="dark"] body :is(
  .campaign-test-note,
  .settings-note,
  .admin-review-note,
  .admin-inline-notice.warning
) {
  background: var(--v208-warning-bg) !important;
  border-color: var(--v208-warning-border) !important;
  color: var(--v208-warning-text) !important;
}

html[data-theme="dark"] body :is(
  .settings-error,
  .admin-alert.error,
  .admin-alert.is-error
) {
  background: var(--v208-danger-bg) !important;
  border-color: var(--v208-danger-border) !important;
  color: var(--v208-danger-text) !important;
}

/* =========================================================
   TEXT INSIDE CONVERTED SURFACES
   ========================================================= */

html[data-theme="dark"] body :is(
  .card,
  .panel,
  .box,
  .email-section,
  .email-status-card,
  .admin-card,
  .settings-card,
  .contact-card,
  .business-card,
  .blog-card,
  .article-comment,
  .profile-hub-card,
  .security-card,
  .ws-feature
) :is(h1, h2, h3, h4, h5, h6, strong, b, label) {
  color: var(--v208-text) !important;
  -webkit-text-fill-color: var(--v208-text) !important;
}

html[data-theme="dark"] body :is(
  .card,
  .panel,
  .box,
  .email-section,
  .email-status-card,
  .admin-card,
  .settings-card,
  .contact-card,
  .business-card,
  .blog-card,
  .article-comment,
  .profile-hub-card,
  .security-card,
  .ws-feature
) :is(p, small, span:not(.status):not(.badge):not(.tag)) {
  color: var(--v208-muted) !important;
  -webkit-text-fill-color: var(--v208-muted) !important;
}

/* Keep links and primary CTA text readable. */
html[data-theme="dark"] body a {
  text-decoration-color: currentColor;
}

html[data-theme="dark"] body a:not(.btn):not(.admin-btn):not(.primary) {
  color: #8ce8b7;
}

html[data-theme="dark"] body :is(.primary, .danger, .warning) * {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

/* =========================================================
   DO NOT ALTER REAL MEDIA
   ========================================================= */

html[data-theme="dark"] body :is(
  img,
  picture,
  video,
  canvas,
  svg,
  iframe
) {
  filter: none !important;
}

/* Print remains white and clean. */
@media print {
  html[data-theme="dark"] body,
  html[data-theme="dark"] body * {
    color-scheme: light !important;
  }
}

/* =========================================================
   BSOURIA V209 — PARTICIPATE PAGE DARK-MODE BADGES
   Keep small pills / number blocks dark instead of pale white.
   ========================================================= */
html[data-theme="dark"] body .participate-section-head > span,
html[data-theme="dark"] body .participate-value-grid article > span,
html[data-theme="dark"] body .participate-steps li > b {
  background: var(--v208-surface-3) !important;
  border: 1px solid var(--v208-border) !important;
  color: var(--v208-green-light) !important;
  -webkit-text-fill-color: var(--v208-green-light) !important;
  box-shadow: none !important;
}

/* =========================================================
   BSOURIA V210 — REMOVE REMAINING WHITE SURFACES IN DARK MODE
   Focused on dashboard, profile, opportunity editor, account,
   CV builder and about page surfaces visible in the current UI.
   Light mode is intentionally untouched.
   ========================================================= */

/* Dashboard */
html[data-theme="dark"] body :is(
  .dashboard-cv-card-v64,
  .dashboard-profile-card,
  .dashboard-section-card,
  .dashboard-item,
  .business-dashboard-item,
  .business-dashboard-section,
  .stats-grid .stat,
  .dashboard-list .empty
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* Public profile */
html[data-theme="dark"] body .public-profile-hero {
  background: linear-gradient(180deg,var(--v208-page),#082018) !important;
  border-color: var(--v208-border) !important;
}
html[data-theme="dark"] body :is(
  .public-profile-card,
  .public-profile-section,
  .public-profile-primary,
  .public-profile-sidebar,
  .contact-box,
  .trust-box,
  .social-box,
  .compact-empty
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* Create / edit opportunity */
html[data-theme="dark"] body :is(
  .opportunity-form-shell,
  .opportunity-form-intro,
  .form-section,
  .language-editor,
  .language-panel,
  .opportunity-language-body,
  .opportunity-language-main,
  .opportunity-mini-guide,
  .opportunity-mini-item,
  .modern-upload,
  .review-note,
  .form-submit-bar
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body :is(
  .opportunity-mini-icon,
  .opportunity-mini-mark,
  .form-section-number,
  .optional-label
) {
  background: var(--v208-surface-3) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-green-light) !important;
  -webkit-text-fill-color: var(--v208-green-light) !important;
}

/* Account / personal profile editor */
html[data-theme="dark"] body :is(
  .profile-command-card,
  .profile-section-card,
  .profile-sidebar-v2,
  .profile-nav-card,
  .profile-review-panel,
  .profile-checklist-card,
  .profile-photo-editor-v2,
  .verification-card,
  .verification-dropzone,
  .cv-dropzone,
  .document-item,
  .privacy-toggle,
  .profile-savebar,
  .profile-metric-grid > *,
  .profile-command-main
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body :is(
  .profile-nav-icon,
  .metric-icon,
  .verification-dropzone-icon,
  .document-icon,
  .cv-file-icon,
  .profile-status-chip
) {
  background: var(--v208-surface-3) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-green-light) !important;
  -webkit-text-fill-color: var(--v208-green-light) !important;
}

/* CV builder */
html[data-theme="dark"] body :is(
  .cvb65-hero,
  .cvb65-main,
  .cvb65-side,
  .cvb65-side-card,
  .cvb65-step,
  .cvb65-language-panel,
  .cvb65-repeat-card,
  .cvb65-live-preview,
  .cvb65-preview-sheet,
  .cvb73-template-gallery,
  .cvb73-template-card,
  .cvb73-template-paper,
  .cvb73-template-option
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body .cvb73-template-paper :is(div,span) {
  border-color: var(--v208-border) !important;
}

/* About page CTA / remaining light cards */
html[data-theme="dark"] body :is(
  .about-cta-card,
  .about-vision-card,
  .about-pillar-grid > *,
  .about-success-grid > *,
  .about-mini-metrics > *,
  .about-global-grid > *
) {
  background: var(--v208-surface) !important;
  border-color: var(--v208-border) !important;
  color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* Alerts / notices: remove white bars while preserving semantic colors. */
html[data-theme="dark"] body .alert:not(.error):not(.danger):not(.warning) {
  background: #123823 !important;
  border-color: #36714e !important;
  color: #a9e8c4 !important;
  -webkit-text-fill-color: #a9e8c4 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body .alert:not(.error):not(.danger):not(.warning) * {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

/* Catch common pale utility surfaces used by these pages. */
html[data-theme="dark"] body :is(
  .profile-page,
  .profile-shell,
  .profile-content,
  .opportunity-form-page,
  .cvb65-page,
  .about-cta
) {
  border-color: var(--v208-border) !important;
}

/* Keep standard secondary/action buttons dark green instead of white. */
html[data-theme="dark"] body :is(
  .btn.secondary,
  .profile-action-btn,
  .profile-upload-button,
  .cvb65-add-item,
  .cvb65-preview-link
) {
  background: var(--v208-surface-3) !important;
  border-color: var(--v208-border-strong) !important;
  color: var(--v208-text) !important;
  -webkit-text-fill-color: var(--v208-text) !important;
  box-shadow: none !important;
}

/* =========================================================
   BSOURIA V211 — BLOG DARK MODE REPAIR
   Surgical fix only for the blog search and category controls.
   ========================================================= */
html[data-theme="dark"] body .blog-search {
  background: var(--v208-surface) !important;
  border: 1px solid var(--v208-border) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body .blog-search input {
  background: #081710 !important;
  border: 1px solid var(--v208-border) !important;
  color: var(--v208-text) !important;
  -webkit-text-fill-color: var(--v208-text) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body .blog-search input::placeholder {
  color: var(--v208-muted) !important;
  -webkit-text-fill-color: var(--v208-muted) !important;
  opacity: .9 !important;
}
html[data-theme="dark"] body .blog-search .btn.primary {
  background: #0d8754 !important;
  border-color: #25ac70 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html[data-theme="dark"] body .blog-categories .category-pills {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  flex-wrap: wrap !important;
  overflow: visible !important;
  padding-bottom: 8px !important;
}
html[data-theme="dark"] body .blog-categories .category-pills a,
html[data-theme="dark"] body .blog-categories .category-pills a:link,
html[data-theme="dark"] body .blog-categories .category-pills a:visited {
  background: var(--v208-surface-2) !important;
  border: 1px solid var(--v208-border) !important;
  color: var(--v208-muted) !important;
  -webkit-text-fill-color: var(--v208-muted) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body .blog-categories .category-pills a:hover,
html[data-theme="dark"] body .blog-categories .category-pills a:focus,
html[data-theme="dark"] body .blog-categories .category-pills a:focus-visible,
html[data-theme="dark"] body .blog-categories .category-pills a.active {
  background: #0d8754 !important;
  border-color: #25ac70 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
@media (max-width: 760px) {
  html[data-theme="dark"] body .blog-categories .category-pills {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--v208-border-strong) var(--v208-surface);
  }
  html[data-theme="dark"] body .blog-categories .category-pills::-webkit-scrollbar {
    height: 6px;
  }
  html[data-theme="dark"] body .blog-categories .category-pills::-webkit-scrollbar-track {
    background: var(--v208-surface) !important;
  }
  html[data-theme="dark"] body .blog-categories .category-pills::-webkit-scrollbar-thumb {
    background: var(--v208-border-strong) !important;
    border-radius: 999px;
  }
}


/* BSOURIA_ARABIC_MOBILE_STABLE_FINAL_V2 */
@media (max-width:700px) {
    html,
    html body {
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        margin:0 !important;
        overflow-x:hidden !important;
    }

    html[lang="ar"] body .topbar,
    html[lang="ar"] body .topbar .container.nav {
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        margin:0 auto !important;
        box-sizing:border-box !important;
        overflow:hidden !important;
    }

    html[lang="ar"] body .topbar .container.nav {
        padding-inline:16px !important;
    }

    html[lang="ar"] body .topbar .brand-logo {
        position:static !important;
        width:auto !important;
        max-width:125px !important;
        flex:0 0 auto !important;
        margin:0 !important;
        transform:none !important;
    }

    html[lang="ar"] body .topbar .brand-logo-image,
    html[lang="ar"] body .topbar .brand-logo img,
    html[lang="ar"] body .topbar .brand-logo svg {
        display:block !important;
        position:static !important;
        width:auto !important;
        max-width:125px !important;
        height:42px !important;
        margin:0 !important;
        transform:none !important;
        object-fit:contain !important;
    }

    html[lang="ar"] body main {
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        margin:0 !important;
        overflow:hidden !important;
        box-sizing:border-box !important;
    }

    html[lang="ar"] body .container.detail.opportunity-detail-v4 {
        position:relative !important;
        inset:auto !important;
        width:calc(100% - 24px) !important;
        max-width:calc(100% - 24px) !important;
        min-width:0 !important;
        margin:16px auto !important;
        transform:none !important;
        box-sizing:border-box !important;
    }

    html[lang="ar"] body .opportunity-detail-v4 > .detail-main,
    html[lang="ar"] body .opportunity-detail-v4 > .opportunity-directory-sidebar {
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
        margin-inline:auto !important;
        transform:none !important;
        box-sizing:border-box !important;
    }
}
/* BSOURIA_ARABIC_MOBILE_LOGO_SIZE_POSITION_V3 */
@media (max-width:700px) {
    html[lang="ar"] body .topbar .container.nav {
        padding-right:6px !important;
        padding-left:16px !important;
    }

    html[lang="ar"] body .topbar .brand-logo {
        max-width:145px !important;
    }

    html[lang="ar"] body .topbar .brand-logo-image,
    html[lang="ar"] body .topbar .brand-logo img,
    html[lang="ar"] body .topbar .brand-logo svg {
        width:auto !important;
        height:48px !important;
        max-width:145px !important;
        transform:none !important;
    }
}

/* REMOVE MARK UNDER ARABIC MOBILE LOGO */
@media (max-width:700px) {
    html[lang="ar"] .topbar .brand-logo::before,
    html[lang="ar"] .topbar .brand-logo::after {
        display:none !important;
        content:none !important;
    }

    html[lang="ar"] .topbar .brand-logo {
        border:0 !important;
        box-shadow:none !important;
        text-decoration:none !important;
    }
}

/* CROP BOTTOM MARK FROM ARABIC MOBILE LOGO */
@media (max-width:700px) {
    html[lang="ar"] body .topbar .brand-logo-image {
        clip-path:inset(0 0 7px 0) !important;
    }
}

/* BSOURIA ARABIC LOGOS — LIGHT AND DARK */
html[lang="ar"][data-theme="light"] .topbar .brand-logo-image {
    content:url("/assets/images/bsouria-logo-ar-light.png?v=2") !important;
}

html[lang="ar"][data-theme="dark"] .topbar .brand-logo-image {
    content:url("/assets/images/bsouria-logo-ar-dark.png?v=2") !important;
}

html[lang="ar"] .topbar .brand-logo-image {
    clip-path:none !important;
    transform:none !important;
    object-fit:contain !important;
}

@media (max-width:700px) {
    html[lang="ar"] .topbar .container.nav {
        padding-right:8px !important;
        padding-left:16px !important;
        overflow:hidden !important;
    }

    html[lang="ar"] .topbar .brand-logo {
        width:144px !important;
        max-width:144px !important;
        transform:none !important;
    }

    html[lang="ar"] .topbar .brand-logo-image {
        display:block !important;
        width:144px !important;
        max-width:144px !important;
        height:48px !important;
        margin:0 !important;
        transform:none !important;
    }
}

/* EMERGENCY RESTORE ORIGINAL LOGO */
html[lang="ar"] .topbar .brand-logo-image {
    content:normal !important;
    clip-path:none !important;
    transform:none !important;
}

/* FORCE RESTORE ORIGINAL ARABIC LOGO */
html[lang="ar"][data-theme="light"] body .topbar .brand-logo-image,
html[lang="ar"][data-theme="dark"] body .topbar .brand-logo-image {
    content:normal !important;
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    clip-path:none !important;
    transform:none !important;
    object-fit:contain !important;
}

@media (max-width:700px) {
    html[lang="ar"][data-theme="light"] body .topbar .brand-logo-image,
    html[lang="ar"][data-theme="dark"] body .topbar .brand-logo-image {
        width:auto !important;
        max-width:144px !important;
        height:48px !important;
    }
}

/* REMOVE GREEN SPOT FROM ARABIC MOBILE LOGO */
@media (max-width:700px) {
    html[lang="ar"][data-theme="light"] body .topbar .brand-logo-image,
    html[lang="ar"][data-theme="dark"] body .topbar .brand-logo-image {
        clip-path:inset(0 0 8px 0) !important;
    }
}

/* BSOURIA ARABIC LOGO LAYER FIX — FINAL */
html[lang="ar"][data-theme="light"] body .topbar .brand-logo-light {
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    content:normal !important;
}

html[lang="ar"][data-theme="light"] body .topbar .brand-logo-dark {
    display:none !important;
}

html[lang="ar"][data-theme="dark"] body .topbar .brand-logo-light {
    display:none !important;
}

html[lang="ar"][data-theme="dark"] body .topbar .brand-logo-dark {
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    content:normal !important;
}

@media (max-width:700px) {
    html[lang="ar"] body .topbar .brand-logo-images {
        display:block !important;
        position:relative !important;
        width:144px !important;
        height:48px !important;
        overflow:hidden !important;
    }

    html[lang="ar"] body .topbar .brand-logo-image {
        position:static !important;
        width:144px !important;
        max-width:144px !important;
        height:48px !important;
        margin:0 !important;
        object-fit:contain !important;
        clip-path:none !important;
        transform:none !important;
    }
}
