/* Theme bridge for editorial, discovery and category surfaces. */
:root {
  --cf-page-bg: var(--cf-color-canvas);
  --cf-card-bg: var(--cf-color-surface);
  --cf-card-muted: var(--cf-color-surface-muted);
  --cf-ink: var(--cf-color-text);
  --cf-ink-muted: var(--cf-color-text-muted);
  --cf-line: var(--cf-color-border);
  --cf-brand: var(--cf-color-primary);
}

/* App-specific design systems map into the same site palette. */
html[data-theme] {
  --resource-red: var(--primary);
  --resource-ink: var(--text);
  --resource-muted: var(--muted);
  --resource-line: var(--border);
  --resource-surface: var(--surface);
  --resource-canvas: var(--bg);
}
html[data-theme] .education-hub {
  --eh-red: var(--primary);
  --eh-ink: var(--text);
  --eh-muted: var(--muted);
  --eh-line: var(--border);
  --eh-surface: var(--surface);
  --eh-canvas: var(--bg);
  background: var(--bg) !important;
  color: var(--text) !important;
}
html[data-theme] .gh-page {
  --gh-brand: var(--primary); --gh-brand-hover: var(--primary-hover);
  --gh-brand-light: var(--primary-soft); --gh-brand-border: var(--border); --gh-brand-ring: var(--focus);
  --gh-ink: var(--text); --gh-ink-secondary: var(--muted); --gh-muted: var(--muted); --gh-subtle: var(--muted);
  --gh-paper: var(--surface); --gh-canvas: var(--bg); --gh-tint: var(--surface-2); --gh-code-bg: var(--surface-2);
  --gh-line: var(--border); --gh-line-subtle: var(--border); --gh-line-strong: var(--border-strong);
  --gh-green: var(--success); --gh-green-soft: var(--primary-soft); --gh-amber: var(--warning); --gh-amber-soft: var(--primary-soft);
  --gh-blue: var(--accent); --gh-blue-soft: var(--primary-soft); --gh-purple: var(--accent); --gh-purple-soft: var(--primary-soft);
  background: var(--bg) !important; color: var(--text) !important;
}
html[data-theme] .bp-page {
  --bp-brand: var(--primary); --bp-brand-hover: var(--primary-hover);
  --bp-brand-light: var(--primary-soft); --bp-brand-border: var(--border); --bp-brand-ring: var(--focus);
  --bp-ink: var(--text); --bp-ink-secondary: var(--muted); --bp-muted: var(--muted); --bp-subtle: var(--muted);
  --bp-paper: var(--surface); --bp-canvas: var(--bg); --bp-tint: var(--surface-2); --bp-code-bg: var(--surface-2);
  --bp-line: var(--border); --bp-line-subtle: var(--border); --bp-line-strong: var(--border-strong);
  --bp-green: var(--success); --bp-green-soft: var(--primary-soft); --bp-amber: var(--warning); --bp-amber-soft: var(--primary-soft);
  --bp-blue: var(--accent); --bp-blue-soft: var(--primary-soft); --bp-purple: var(--accent); --bp-purple-soft: var(--primary-soft);
  background: var(--bg) !important; color: var(--text) !important;
}
html[data-theme] .ns-page {
  --cf-brand: var(--primary); --cf-brand-hover: var(--primary-hover); --cf-brand-light: var(--primary-soft);
  --cf-brand-soft: var(--primary-soft); --cf-brand-border: var(--border); --cf-brand-ring: var(--focus);
  --cf-ink: var(--text); --cf-ink-secondary: var(--muted); --cf-muted: var(--muted); --cf-subtle: var(--muted);
  --cf-paper: var(--surface); --cf-canvas: var(--bg); --cf-tint: var(--surface-2); --cf-tint-hover: var(--surface-raised);
  --cf-line: var(--border); --cf-line-strong: var(--border-strong);
  --cf-amber: var(--warning); --cf-amber-soft: var(--primary-soft); --cf-green: var(--success); --cf-green-soft: var(--primary-soft);
  --cf-blue: var(--accent); --cf-blue-soft: var(--primary-soft);
  background: var(--bg) !important; color: var(--text) !important;
}

/* Homepage design system aliases. */
.hp-v3 {
  --cf-bg: var(--cf-color-canvas) !important;
  --cf-surface: var(--cf-color-surface) !important;
  --cf-surface-2: var(--cf-color-surface-muted) !important;
  --cf-ink: var(--cf-color-text) !important;
  --cf-muted: var(--cf-color-text-muted) !important;
  --cf-soft: var(--cf-color-text-subtle) !important;
  --cf-border: var(--cf-color-border) !important;
  --cf-red: var(--cf-color-primary) !important;
  --cf-red-deep: var(--cf-color-primary-hover) !important;
  --cf-amber: var(--cf-color-warning) !important;
  --cf-teal: var(--cf-color-accent) !important;
  --cf-blue: var(--cf-color-accent) !important;
  --cf-purple: var(--cf-color-accent) !important;
  background: var(--cf-color-canvas) !important;
  color: var(--cf-color-text) !important;
  font-family: var(--cf-font-sans) !important;
}
.hp-v3 :where(.hp-section,.hp-board-card,.hp-rail-card,.hp-hub-card,.hp-track-card,.hp-featured-card,.hp-faq-item,.cf-close-card,.hp-fcard) {
  border-color: var(--cf-color-border) !important;
  background-color: var(--cf-color-surface) !important;
  color: var(--cf-color-text) !important;
}
.hp-v3 :where(h1,h2,h3,h4,strong,.hp-feed-title,.hp-fcard h3,.hp-track-link) { color: var(--cf-color-text); }
.hp-v3 :where(p,.hp-sec-sub,.hp-fcard-foot,.hp-feed-dl,.hp-metric span) { color: var(--cf-color-text-muted); }
.hp-v3 :where(a,button):focus-visible { outline: 3px solid var(--cf-focus-ring); outline-offset: 3px; }
.hp-v3 .hp-hero-v3 {
  background: radial-gradient(ellipse at 86% 8%, color-mix(in srgb, var(--cf-color-primary) 14%, transparent), transparent 50%), var(--cf-color-canvas) !important;
  border-color: var(--cf-color-border) !important;
}
.hp-v3 :where(.hp-chip-strip a,.hp-track-filter-btn,.hp-tab-btn,.hp-search-v3,.hp-finder-card) {
  border-color: var(--cf-color-border) !important;
  background-color: var(--cf-color-surface) !important;
  color: var(--cf-color-text) !important;
}
.hp-v3 :where(.hp-search-v3 button,.hp-find-submit,.hp-cta-pri,.hp-join-link) {
  border-color: var(--cf-color-primary) !important;
  background: var(--cf-color-primary) !important;
  color: #fff !important;
}

/* Category and search surfaces share the same theme tokens. */
#cf-category-main {
  --cf-cat-bg: var(--cf-color-canvas) !important;
  --cf-cat-surface: var(--cf-color-surface) !important;
  --cf-cat-surface-alt: var(--cf-color-surface-muted) !important;
  --cf-cat-ink: var(--cf-color-text) !important;
  --cf-cat-ink-2: var(--cf-color-text-muted) !important;
  --cf-cat-muted: var(--cf-color-text-subtle) !important;
  --cf-cat-border: var(--cf-color-border) !important;
  background: var(--cf-color-canvas) !important;
  color: var(--cf-color-text) !important;
}
#cf-category-main .cf-cat-hero { background: var(--cf-color-canvas) !important; color: var(--cf-color-text) !important; }
#cf-category-main :where(.cf-opp-card,.cf-track-card,.cf-cat-faq) {
  border-color: var(--cf-color-border) !important;
  background-color: var(--cf-color-surface) !important;
  color: var(--cf-color-text) !important;
}
:root, .sr-shell {
  --sr-surface: var(--cf-color-surface) !important;
  --sr-surface-alt: var(--cf-color-surface-muted) !important;
  --sr-hero-bg: var(--cf-color-canvas) !important;
  --sr-border: var(--cf-color-border) !important;
  --sr-border-strong: var(--cf-color-border-strong) !important;
  --sr-text: var(--cf-color-text) !important;
  --sr-muted: var(--cf-color-text-muted) !important;
  --sr-subtle: var(--cf-color-text-subtle) !important;
  --sr-accent: var(--cf-color-primary) !important;
  --sr-accent-hover: var(--cf-color-primary-hover) !important;
  --sr-accent-soft: var(--cf-color-primary-soft) !important;
  color: var(--cf-color-text);
}
.sr-shell :where(.sr-card,.sr-widget,.sr-filter-panel,.sr-empty-state) {
  border-color: var(--cf-color-border) !important;
  background-color: var(--cf-color-surface) !important;
  color: var(--cf-color-text) !important;
}

/* Long-form post template, including legacy inline author and related cards. */
.post-wrap,.post-content-area,.page-wrap .main-col,.author-box,.list-card,.inline-link-strip {
  border-color: var(--cf-color-border) !important;
  background-color: var(--cf-color-surface) !important;
  color: var(--cf-color-text) !important;
}
.post-wrap :where(h1,h2,h3,h4,strong),.post-content-area :where(p,li,td,th,blockquote) { color: var(--cf-color-text); }
.post-wrap :where(.post-meta-bar,.post-content-area),.list-card-meta { color: var(--cf-color-text-muted); }
.post-wrap a:not(.card-cat),.post-breadcrumb a { color: var(--cf-color-primary); }
.post-content-area :where(table,th,td,blockquote,pre,code) { border-color: var(--cf-color-border); }

@media (prefers-reduced-motion: reduce) {
  .hp-v3 *, #cf-category-main *, .sr-shell *, .post-wrap * { scroll-behavior: auto !important; }
}

/* Shared chrome and legacy homepage widgets follow the registry palette too. */
:root {
  --cf-shell-red: var(--primary) !important;
  --cf-shell-ink: var(--text) !important;
  --cf-shell-muted: var(--muted) !important;
  --cf-shell-line: var(--border) !important;
  --cf-shell-surface: var(--surface) !important;
  --cf-shell-page: var(--bg) !important;
}
html[data-theme] body.cf-dual-nav,
html[data-theme] body,
html[data-theme] .hp-page { background-color: var(--bg); color: var(--text); }
html[data-theme] .main-header.cf-utility-bar { border-color: var(--border) !important; background: color-mix(in srgb, var(--header-bg) 96%, transparent) !important; color: var(--text) !important; }
html[data-theme] .cf-brand,
html[data-theme] .cf-utility-actions,
html[data-theme] .cf-utility-actions a { color: var(--text); }
html[data-theme] .cf-primary-nav a,
html[data-theme] .cf-global-search,
html[data-theme] .cf-global-search input,
html[data-theme] .cf-global-search kbd,
html[data-theme] .cf-bookmarks-trigger,
html[data-theme] .cf-browse-trigger,
html[data-theme] .cf-account-link,
html[data-theme] .cf-appearance-trigger { border-color: var(--border) !important; background-color: var(--surface) !important; color: var(--text) !important; }
html[data-theme] .cf-primary-nav a:hover,
html[data-theme] .cf-utility-actions a:hover,
html[data-theme] .cf-bookmarks-trigger:hover { color: var(--primary) !important; }
html[data-theme] .cf-global-search { background: var(--surface-2) !important; }
html[data-theme] .cf-global-search input::placeholder { color: var(--muted) !important; }
html[data-theme] .cf-global-search:focus-within,
html[data-theme] .cf-search-suggestions,
html[data-theme] .cf-sidebar-flyout,
html[data-theme] .cf-sidebar { border-color: var(--border) !important; background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--cf-shadow-lg); }
html[data-theme] .cf-search-suggestions a,
html[data-theme] .cf-sidebar-nav a,
html[data-theme] .cf-hub-toggle,
html[data-theme] .cf-sidebar-flyout .cf-side-link { color: var(--text) !important; }
html[data-theme] .cf-search-group,
html[data-theme] .cf-sidebar-head,
html[data-theme] .cf-sidebar-promos { border-color: var(--border) !important; }
html[data-theme] .cf-search-group-title,
html[data-theme] .cf-search-suggestions small,
html[data-theme] .cf-sidebar-nav .cf-hub-count,
html[data-theme] .cf-sidebar-nav .cf-side-count { color: var(--muted) !important; }
html[data-theme] .cf-sidebar-nav a:hover,
html[data-theme] .cf-hub-toggle:hover,
html[data-theme] .cf-sidebar-flyout .cf-side-link:hover { background: var(--surface-2) !important; color: var(--primary) !important; }
html[data-theme] .cf-sidebar-nav .is-active,
html[data-theme] .cf-sidebar-flyout .cf-side-link.is-active { background: var(--primary-soft) !important; color: var(--primary) !important; }
html[data-theme] .cf-sidebar-promo { border-color: var(--border) !important; background: var(--surface-2) !important; color: var(--text) !important; }
html[data-theme] .cf-sidebar-promo strong,
html[data-theme] .cf-sidebar-promo small { color: var(--text) !important; }
html[data-theme] .cf-sidebar-promo a { color: var(--primary) !important; }
html[data-theme] .mob-bottom-nav { border-color: var(--border) !important; background: var(--header-bg) !important; color: var(--text) !important; }
html[data-theme] .mob-nav-item { color: var(--muted) !important; }
html[data-theme] .mob-nav-item.active { color: var(--primary) !important; }
html[data-theme] .mob-nav-search { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-contrast) !important; }

/* Older desktop navigation and category ribbons remain on selected templates. */
html[data-theme] .desktop-nav .nav-link,
html[data-theme] .drop-link,
html[data-theme] .fk-cat-all-btn { color: var(--text) !important; }
html[data-theme] .desktop-nav .nav-link:hover,
html[data-theme] .drop-link:hover,
html[data-theme] .fk-cat-all-btn:hover,
html[data-theme] .fk-cat-all-btn.is-open { background: var(--primary-soft) !important; color: var(--primary) !important; }
html[data-theme] .desktop-nav ul.dropdown,
html[data-theme] .desktop-nav ul.nested-dropdown { border-color: var(--border) !important; background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--cf-shadow-lg) !important; }
html[data-theme] .nested-arrow,
html[data-theme] .fk-all-caret { color: var(--muted) !important; }
html[data-theme] .fk-cat-wrap { border-color: var(--border) !important; background: linear-gradient(180deg,var(--surface),var(--bg)) !important; color: var(--text) !important; }
html[data-theme] .fk-group-tab,
html[data-theme] .fk-cat-all-btn,
html[data-theme] .cat-nav-btn { border-color: var(--border) !important; background: var(--surface) !important; color: var(--text) !important; }
html[data-theme] .fk-group-tab em { background: var(--surface-2) !important; color: var(--muted) !important; }
html[data-theme] .fk-group-tab.is-active,
html[data-theme] .cat-nav-btn:hover { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-contrast) !important; }
html[data-theme] .fk-group-tab.is-active :where(i,em) { color: var(--primary-contrast) !important; }

html[data-theme] .hp-page,
html[data-theme] .hp-v3 { background: var(--bg) !important; color: var(--text) !important; }
html[data-theme] .hp-page,
html[data-theme] .hp-v3 { --cf-bg: var(--bg) !important; --cf-surface: var(--surface) !important; --cf-surface-2: var(--surface-2) !important; --cf-ink: var(--text) !important; --cf-muted: var(--muted) !important; --cf-soft: var(--muted) !important; --cf-border: var(--border) !important; --cf-red: var(--primary) !important; --cf-red-deep: var(--primary-hover) !important; --cf-blue: var(--accent) !important; --cf-teal: var(--accent) !important; --cf-purple: var(--accent) !important; --cf-amber: var(--warning) !important; }
html[data-theme] .hp-page :where(.hp-hero,.hp-hero-stats,.hp-category-card,.hp-card,.hp-close-card,.hp-feed-card,.hp-job-row,.hp-update-row,.hp-faq-item,.hp-finder-card,.hp-section,.hp-promo,.hp-article-card,.hp-featured-card,.hp-explore-tile,.hp-stats),
html[data-theme] .hp-v3 :where(.hp-hero,.hp-hero-stats,.hp-category-card,.hp-card,.hp-close-card,.hp-feed-card,.hp-job-row,.hp-update-row,.hp-faq-item,.hp-finder-card,.hp-section,.hp-promo,.hp-article-card,.hp-featured-card,.hp-explore-tile,.hp-stats) { border-color: var(--border) !important; background-color: var(--surface) !important; color: var(--text) !important; }
html[data-theme] .hp-page :where(h1,h2,h3,h4,strong,.hp-card-head h2,.hp-category-card strong,.hp-job-main strong,.hp-update-copy strong,.hp-featured-body h3,.hp-article-body h3,.hp-explore-tile-copy strong,.hp-promo h2),
html[data-theme] .hp-v3 :where(h1,h2,h3,h4,strong,.hp-card-head h2,.hp-category-card strong,.hp-job-main strong,.hp-update-copy strong,.hp-featured-body h3,.hp-article-body h3,.hp-explore-tile-copy strong,.hp-promo h2) { color: var(--text) !important; }
html[data-theme] .hp-page :where(p,small,.hp-category-card small,.hp-trending-chips,.hp-hero-copy>p,.hp-job-main small,.hp-update-copy small,.hp-featured-meta,.hp-article-meta,.hp-explore-tile-copy small,.hp-promo p,.hp-empty,.hp-empty-state),
html[data-theme] .hp-v3 :where(p,small,.hp-category-card small,.hp-trending-chips,.hp-hero-copy>p,.hp-job-main small,.hp-update-copy small,.hp-featured-meta,.hp-article-meta,.hp-explore-tile-copy small,.hp-promo p,.hp-empty,.hp-empty-state) { color: var(--muted) !important; }
html[data-theme] .hp-page :where(input,select,textarea,.hp-search,.hp-search-v3,.hp-filter,.hp-trending-chips a,.hp-chips span),
html[data-theme] .hp-v3 :where(input,select,textarea,.hp-search,.hp-search-v3,.hp-filter,.hp-trending-chips a,.hp-chips span) { border-color: var(--border) !important; background-color: var(--surface) !important; color: var(--text) !important; }
html[data-theme] .hp-page :where(.hp-category-icon,.hp-section-icon,.hp-head-icon,.hp-trending-chips a,.cf-home-hub-tabs button),
html[data-theme] .hp-v3 :where(.hp-category-icon,.hp-section-icon,.hp-head-icon,.hp-trending-chips a,.cf-home-hub-tabs button) { border-color: var(--border) !important; background: var(--surface-2) !important; color: var(--primary) !important; }
html[data-theme] .hp-page :where(.hp-promo,.hp-whatsapp,.hp-ai,.hp-community,.hp-hero-stats,.hp-category-icon,.hp-job-image,.hp-chips span,.hp-deadline-badge,.hp-update-icon,.hp-section-icon,.hp-featured-image,.hp-article-cover,.hp-stat),
html[data-theme] .hp-v3 :where(.hp-promo,.hp-whatsapp,.hp-ai,.hp-community,.hp-hero-stats,.hp-category-icon,.hp-job-image,.hp-chips span,.hp-deadline-badge,.hp-update-icon,.hp-section-icon,.hp-featured-image,.hp-article-cover,.hp-stat) { border-color: var(--border) !important; background-color: var(--surface-2) !important; color: var(--text) !important; }
html[data-theme] .hp-page :where(.hp-filter.is-active,.hp-promo-button,.hp-search button,.hp-find-submit,.hp-cta-pri),
html[data-theme] .hp-v3 :where(.hp-filter.is-active,.hp-promo-button,.hp-search button,.hp-find-submit,.hp-cta-pri) { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-contrast) !important; }
html[data-theme] .hp-page :where(.hp-category-icon,.hp-head-icon,.hp-trending-chips a,.cf-home-hub-tabs button),
html[data-theme] .hp-v3 :where(.hp-category-icon,.hp-head-icon,.hp-trending-chips a,.cf-home-hub-tabs button) { border-color: var(--border) !important; background: var(--surface-2) !important; color: var(--primary) !important; }
html[data-theme] .hp-page :where(.hp-search button,.hp-find-submit,.hp-cta-pri,.home-primary-action,.cf-business-link),
html[data-theme] .hp-v3 :where(.hp-search button,.hp-find-submit,.hp-cta-pri,.home-primary-action,.cf-business-link) { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-contrast) !important; }
html[data-theme] .hp-cta { background-image: linear-gradient(90deg, color-mix(in srgb, var(--cta-bg) 96%, transparent), color-mix(in srgb, var(--cta-bg) 80%, transparent)), url('../images/home/cta-bg.webp'), url('../images/home/cta-bg.svg') !important; color: var(--cta-text) !important; }
html[data-theme] .hp-cta :where(h2,p) { color: var(--cta-text) !important; }
html[data-theme] .hp-cta .hp-eyebrow { color: var(--primary) !important; }
html[data-theme] .hp-cta>a { border: 1px solid var(--primary); background: var(--primary); color: var(--primary-contrast) !important; }
/* The current homepage uses hp-cta-v3; keep its heading readable on the
   contrasting CTA band in every palette. */
html[data-theme] .hp-cta-v3 {
  border-color: var(--border) !important;
  background: var(--cta-bg) !important;
  color: var(--cta-text) !important;
}
html[data-theme] .hp-cta-v3 :where(h2,p) { color: var(--cta-text) !important; }
html[data-theme] .hp-cta-v3 .hp-cta-pri {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: var(--primary-contrast) !important;
}
html[data-theme] .hp-cta-v3 .hp-cta-sec {
  border-color: var(--border) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

/* The older opportunity dashboard and education landing page are still live. */
html[data-theme] .hd-dashboard :where(.hd-card,.hd-job-row,.hd-update-row,.hd-promo) { border-color: var(--border) !important; background-color: var(--surface) !important; color: var(--text) !important; }
html[data-theme] .hd-dashboard :where(h2,strong) { color: var(--text) !important; }
html[data-theme] .hd-dashboard :where(small,p,time,.hd-empty) { color: var(--muted) !important; }
html[data-theme] .hd-dashboard :where(.hd-head-icon,.hd-chips span,.hd-job-date,.hd-filter) { border-color: var(--border) !important; background: var(--surface-2) !important; color: var(--text) !important; }
html[data-theme] .hd-dashboard .hd-filter.is-active,
html[data-theme] .hd-dashboard .hd-promo-button { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-contrast) !important; }
html[data-theme] .education-hub :where(.education-hero,.education-card,.education-tip,.education-quick-path,.education-breadcrumb,.education-section-count,.education-secondary-link,.education-art-card) { border-color: var(--border) !important; background-color: var(--surface) !important; color: var(--text) !important; }
html[data-theme] .education-hub :where(h1,h2,h3,strong,.education-card-title) { color: var(--text) !important; }
html[data-theme] .education-hub :where(p,small,.education-card-description,.education-card-eyebrow) { color: var(--muted) !important; }
html[data-theme] .education-hub .education-primary-link { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-contrast) !important; }
html[data-theme] .education-hub .education-hero { background: radial-gradient(ellipse 80% 70% at 88% -5%,color-mix(in srgb,var(--primary) 12%,transparent),transparent 62%),linear-gradient(180deg,var(--surface),var(--bg)) !important; }
html[data-theme] .education-hub .education-art-card-check { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-contrast) !important; }
html[data-theme] #cf-trust {
  --cf-e-ink: var(--text); --cf-e-muted: var(--muted); --cf-e-surface: var(--surface); --cf-e-soft: var(--surface-2);
  --cf-e-line: var(--border); --cf-e-accent: var(--primary); --cf-e-accent-dark: var(--primary-hover); color: var(--text) !important;
}
html[data-theme] #cf-trust .cf-ed-hero { border-color: var(--border) !important; background: radial-gradient(circle at top left,color-mix(in srgb,var(--primary) 12%,transparent),transparent 34%),linear-gradient(180deg,var(--surface),var(--bg)) !important; }
html[data-theme] #cf-trust :where(.cf-ed-card,.cf-ed-panel,.cf-ed-faq,.cf-ed-stat,.cf-ed-meta-strip) { border-color: var(--border) !important; background-color: var(--surface) !important; color: var(--text) !important; }
html[data-theme] #cf-trust :where(h1,h2,h3,h4,strong) { color: var(--text) !important; }
html[data-theme] #cf-trust :where(p,small,.cf-ed-muted) { color: var(--muted) !important; }

/* Study materials, syllabus and PYQ discovery share the core surfaces too. */
html[data-theme] :where(.category-discovery-form,.category-search-field,.category-filter-field select,.syl-bc,.syl-hero,.syl-pill,.syl-cat-card,.syl-sub-card,.syl-ssub-card,.syl-topic-card,.syl-fc,.syl-mbox,.pyq-breadcrumb,.pyq-hero,.pyq-cat-card,.pyq-sub-card,.pyq-file-card,.pyq-trending-card,.pyq-stat-chip,.detail-card,.ccard,.subcard,.mcard,.sc-card,.fsurf,.aside-box,.pdf-box,.exam-directory-tools,.exam-directory-empty) { border-color: var(--border) !important; background-color: var(--surface) !important; color: var(--text) !important; }
html[data-theme] :where(.syl-hero,.pyq-hero) { background-image: radial-gradient(ellipse 80% 70% at 88% -5%,color-mix(in srgb,var(--primary) 10%,transparent),transparent 62%),linear-gradient(180deg,var(--surface),var(--bg)) !important; }
html[data-theme] :where(.category-filter-submit,.syl-search button,.pyq-dl-btn,.f-btn.is-primary) { border-color: var(--primary) !important; background: var(--primary) !important; color: var(--primary-contrast) !important; }
html[data-theme] :where(.syl-hero p,.pyq-hero-sub,.mat-desc,.ccard-name,.subcard-name,.sc-card-desc,.category-filter-total,.exam-directory-empty) { color: var(--muted) !important; }

html[data-theme] .main-footer { border-color: var(--border) !important; background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%) !important; color: var(--muted) !important; }
html[data-theme] .main-footer :where(h2,a,p,small) { color: var(--muted); }
html[data-theme] .main-footer h2 { color: var(--text) !important; }
html[data-theme] .main-footer a:hover { color: var(--primary) !important; }
html[data-theme] .cf-cookie-banner { border-color: var(--border) !important; background: var(--surface) !important; color: var(--text) !important; }
html[data-theme] .cf-cookie-banner :where(h4,p) { color: var(--text) !important; }
html[data-theme] .cf-cookie-banner p { color: var(--muted) !important; }
html[data-theme] .cf-cookie-banner a { color: var(--primary) !important; }

html[data-theme] :where(.modal-content,.dropdown-menu,.form-control,.form-select,.card,.alert) { border-color: var(--border); background-color: var(--surface); color: var(--text); }
html[data-theme] :where(.form-control,.form-select)::placeholder { color: var(--muted); }
html[data-theme] :where(.adsbygoogle,.ad-container,.ad-wrapper,[data-ad-container]) { color: var(--text); }
