/* Dark mode uses real surfaces and text colors; sponsor artwork is never filtered. */
:root { color-scheme: light; --cb-surface: #fff; --cb-canvas: #f3f7fb; --cb-ink: #103355; --cb-muted: #64788c; --cb-line: #dce7f1; }
html[data-theme="dark"] {
  color-scheme: dark;
  --cb-canvas: #0b1422; --cb-surface: #142235; --cb-raised: #1b2e44; --cb-ink: #e2ecf7; --cb-muted: #a2b5ca; --cb-line: #2c425b; --cb-accent: #89bdff;
  --text-dark: #e2ecf7; --text-medium: #a2b5ca; --text-light: #9badc1; --dark-text: #e2ecf7; --dark-text-general: #e2ecf7;
  --text-dark-general: #e2ecf7; --text-dark-secondary: #a2b5ca; --ad-location-text: #a2b5ca; --ad-time-text: #9badc1;
  --light-gray: #0f1c2d; --soft-gray: #1b2e44; --medium-gray: #2c425b; --clean-white: #142235; --bg-light: #0b1422;
  --border: #2c425b; --border-color: #2c425b; --ad-image-placeholder: #1b2e44; --primary-light: #1b3551; --lightest-blue: #1b3551;
  --dark: #e2ecf7; --dark-blue: #89bdff; --primary-dark: #084484; --professional-blue: #89bdff; --confidence-navy: #e2ecf7;
  --bs-body-bg: #0b1422; --bs-body-color: #e2ecf7; --bs-border-color: #2c425b; --bs-secondary-color: #a2b5ca; --bs-tertiary-bg: #1b2e44;
}
html[data-theme="dark"] body { background: var(--cb-canvas) !important; color: var(--cb-ink); }
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6) { color: var(--cb-ink); }
html[data-theme="dark"] a:not([class]) { color: var(--cb-accent); }
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea) { background-color: #101e30; color: var(--cb-ink); border-color: var(--cb-line); }
html[data-theme="dark"] :is(input,textarea)::placeholder { color: #91a7bf; opacity: 1; }
html[data-theme="dark"] :is(input,select,textarea):focus { border-color: #89bdff; }
html[data-theme="dark"] :is(input,select,textarea):disabled { opacity: .65; }
html[data-theme="dark"] :is(.auth-container,.ad-container,.dashboard-nav,.dashboard-content,.stat-card,.action-card,.settings-container,.settings-section,.ad-card,.blog-card,.blog-post,.blog-post-container,.post-content,.comment-section,.comments-section,.comment-form,.sidebar-widget,.error-container,.confirm-box,.report-popup-content,.message-popup-content,.messaging-msgcontainer,.conversations-list,.messages-header,.message-input-container,.message-input-area,.no-ads,.card,.modal-content,.swal2-popup) { background: var(--cb-surface); color: var(--cb-ink); border-color: var(--cb-line); }
html[data-theme="dark"] :is(.contact-section,.location-info,.fee-input-container,.toggle-container,.role-selector label,.become-tutor-section,.social-share-wrapper,.messages-scroll-container,.conversation:hover,.conversation.active,.message.received,.message-received,.bg-light,.bg-white) { background: var(--cb-raised) !important; color: var(--cb-ink); border-color: var(--cb-line); }
html[data-theme="dark"] :is(.ad-title,.contact-title,.social-share-title,.username,.detail-value,.section-title,.greeting h1,.report-popup-header h3,.swal2-title,.swal2-html-container) { color: var(--cb-ink); }
html[data-theme="dark"] :is(.ad-description,.ad-meta,.detail-label,.section-description,.hint,.last-message-time,.auth-footer,.blog-excerpt,.post-meta,.blog-meta,.text-muted) { color: var(--cb-muted) !important; }
html[data-theme="dark"] :is(.tutor-name,.auth-footer a,.read-more,.nav-item,.blog-title a) { color: var(--cb-accent); }
html[data-theme="dark"] .nav-item.active { background: #0a66c2; color: #fff; }
html[data-theme="dark"] .toggle-option { background: var(--cb-surface); color: var(--cb-ink); }
html[data-theme="dark"] .toggle-option.active { background: #0a66c2; color: #fff; }
html[data-theme="dark"] .role-selector input:checked + label { color: #a9ceff; background: #1b3551; border-color: #89bdff; }
html[data-theme="dark"] :is(table,.table) { --bs-table-bg: #142235; --bs-table-color: #e2ecf7; --bs-table-border-color: #2c425b; color: var(--cb-ink); }
html[data-theme="dark"] :is(th,td) { border-color: var(--cb-line); }
html[data-theme="dark"] .btn-header-post-ad, html[data-theme="dark"] .floating-list-button { color: #103355; }
/* Shared header and footer. */
html[data-theme="dark"] .cb-site-header.navbar { background: #101e30 !important; border-color: var(--cb-line); box-shadow: 0 4px 24px #0002; }
html[data-theme="dark"] .cb-site-header .cb-brand { color: #edf4fc; }
html[data-theme="dark"] .cb-brand-domain { color: #89bdff; }
html[data-theme="dark"] .cb-brand small { color: #9cb2ca; }
html[data-theme="dark"] :is(.cb-theme-toggle,.cb-site-header .cbk-nav-toggler) { color: #c7ddf5; background: #1b2e44; border-color: #304964; }
html[data-theme="dark"] .cb-theme-toggle:hover { background: #244363; }
html[data-theme="dark"] .cb-site-header :is(.btn-header,.cb-browse-link) { color: #c1d3e7; }
html[data-theme="dark"] .cb-site-header :is(.btn-header,.cb-browse-link):hover { background: #1b3551; color: #a7cdff; }
html[data-theme="dark"] .cb-site-header .cbk-nav-links { border-color: var(--cb-line); }
html[data-theme="dark"] .cb-site-header .icon-settings { fill: #c1d3e7; }
html[data-theme="dark"] :is(.cb-menu-lines,.cb-menu-lines::before,.cb-menu-lines::after) { background: #c1d3e7; }
html[data-theme="dark"] .cb-site-footer { background: #08111e; }
/* Homepage: override its deliberate light surfaces without altering dimensions. */
html[data-theme="dark"] .home-modern { --ink: #e2ecf7; --muted: #a2b5ca; color: var(--cb-ink); }
html[data-theme="dark"] .home-modern .eyebrow { color: #89bdff; }
html[data-theme="dark"] .home-modern .home-intro { border-color: var(--cb-line); }
html[data-theme="dark"] .home-modern .home-intro h1 span { color: #89bdff; }
html[data-theme="dark"] .home-modern .home-intro p { color: #a2b5ca; }
html[data-theme="dark"] .home-modern .intro-link { color: #b6d6ff; border-color: #304964; }
html[data-theme="dark"] .home-modern .intro-link span { color: #ffd966; }
html[data-theme="dark"] .home-modern .search-section { background: linear-gradient(120deg,#193650,#15283f); border-color: #355777; box-shadow: 0 12px 32px #0002; }
html[data-theme="dark"] .home-modern .search-caption > span:last-child { color: #b1c8e0; }
html[data-theme="dark"] .home-modern :is(.main-search-input-group,.search-filters-compact select,.toggle-filters-button,.clear-filters) { background-color: #101e30; border-color: #35506d; color: var(--cb-ink); }
html[data-theme="dark"] .home-modern .main-search-input-group input { background: transparent; color: var(--cb-ink); }
html[data-theme="dark"] .home-modern .search-filters-compact select { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="%23b6d6ff"><path d="M7 10l5 5 5-5z"/></svg>'); }
html[data-theme="dark"] .home-modern .toggle-filters-button:hover { background: #244363; }
html[data-theme="dark"] .home-modern :is(.top-slider-ads,.ad-card,.ad-card-feature,.banner-item,.results-pill) { background: var(--cb-surface); border-color: var(--cb-line); color: var(--cb-ink); }
html[data-theme="dark"] .home-modern :is(.slider-viewport,.ad-card .ad-image,.ad-card-feature .ad-image) { background: #101e30; }
html[data-theme="dark"] .home-modern .slider-buttons button { background: #213750; color: #c4deff; }
html[data-theme="dark"] .home-modern .slider-dots button::after { background: #50637a; }
html[data-theme="dark"] .home-modern .slider-dots button[aria-pressed="true"]::after { background: #89bdff; }
html[data-theme="dark"] .home-modern .ad-label { color: #9eb4cc; }
html[data-theme="dark"] .home-modern .ad-card-feature { border-color: #71612d; }
html[data-theme="dark"] .home-modern .ad-card-feature .ad-details { background: linear-gradient(#282b29,#142235); }
html[data-theme="dark"] .home-modern .ad-title { color: #a4ccff; }
html[data-theme="dark"] .home-modern .ad-price { color: #d1dfef; }
html[data-theme="dark"] .home-modern .ad-location { color: #a2b5ca; }
html[data-theme="dark"] .home-modern :is(.sponsor-strip a,.featured-open-slots a,.sidebar-empty) { background: linear-gradient(135deg,#1b3047,#142235); color: #e2ecf7; border-color: #3c5875; }
html[data-theme="dark"] .home-modern :is(.sponsor-strip a:nth-child(2),.featured-open-slots a:first-child) { background: linear-gradient(135deg,#302e21,#1b2634); border-color: #6f6034; }
html[data-theme="dark"] .home-modern .featured-open-slots a > span:last-child { color: #a4ccff; }
html[data-theme="dark"] .home-modern .featured-tag { background: #443a18; color: #ffe28a; }
html[data-theme="dark"] .home-modern .sidebar-promo { background: #17385b; }
html[data-theme="dark"] .home-modern .sidebar-promo .eyebrow { color: #b1d5ff; }
html[data-theme="dark"] .home-modern .sidebar-promo p { color: #c0d6ec; }
html[data-theme="dark"] .home-modern .pagination a { background: #142235; color: #b6d6ff; border-color: var(--cb-line); }
html[data-theme="dark"] .home-modern .pagination .active { background: #0a66c2; color: #fff; }
@media (min-width:900px) {
  html[data-theme="dark"] .home-modern .home-intro { background: radial-gradient(ellipse at 100% 0%,#203c58 0%,transparent 65%),linear-gradient(115deg,#142235,#14293e); }
  html[data-theme="dark"] .home-modern .intro-link { background: #1b3551; }
  html[data-theme="dark"] .home-modern .intro-link:hover { background: #244363; }
}
/* Static legal pages load the shared theme without requiring PHP. */
.cb-standalone-theme { position: fixed; right: 16px; bottom: 16px; z-index: 1000; }
html[data-theme="dark"] :is(.post-card,.single-post,.tutor-card,.action-btn.secondary,.btn-secondary,.view-all,.section-footer a,.message-popup,.message-input-msgcontainer) { background: var(--cb-surface); color: var(--cb-ink); border-color: var(--cb-line); }
html[data-theme="dark"] :is(.post-card a,.post-card h2,.single-post h1,.stat-value,.stat-number,.detail-item strong) { color: #a4ccff; }
html[data-theme="dark"] .pagination :is(a,span) { border-color: var(--cb-line); }
html[data-theme="dark"] body:has(.mission-box) :is(section,.stats) { background: var(--cb-surface); }
html[data-theme="dark"] body:has(.mission-box) :is(.mission-box,.stat-item,main li,section li) { background: var(--cb-raised); color: var(--cb-ink); }
html[data-theme="dark"] body:has(.mission-box) :is(.tagline,.mission-box p strong,.stat-item div:last-child) { color: var(--cb-muted); }
.cb-standalone-theme .cb-theme-label { display: inline; }
html[data-theme="dark"] .cb-menu-lines::before, html[data-theme="dark"] .cb-menu-lines::after { background: #c1d3e7; }
html[data-theme="dark"] .featured-badge { color: #103355; }
html[data-theme="dark"] .auth-container .logo img { background: #fff; border-radius: 8px; padding: 6px; box-sizing: content-box; }
html[data-theme="dark"] .cb-legal-page .contact-info { background: var(--cb-surface); color: var(--cb-ink); }
html[data-theme="dark"] .cb-legal-page .important-note { background: #302e21; color: #f4e7c1; }
html[data-theme="dark"] .cb-legal-page .last-updated { color: var(--cb-muted); }
html[data-theme="dark"] body:has(.post-list,.single-post) header a { color: #fff; }
html[data-theme="dark"] :is(.alert-success,.alert.success,.upgrade-success) { background: #17372d; color: #8ce0b7; border-color: #398861; }
html[data-theme="dark"] :is(.alert-danger,.alert-error,.alert.error) { background: #3a232b; color: #ffa9b2; border-color: #9c4e60; }
html[data-theme="dark"] .message.received .message-time { color: #a2b5ca; }
