/* DAQI V1.6.25.2 · Dark-mode text contrast hotfix
   Only applies when the visitor selects dark mode. Light mode and layout are unchanged.
   Scoped to the five page shells, so published content and backend are unaffected. */
html[data-theme="dark"] {
  color-scheme:dark;
  --ink:#eaf9f7;
  --muted:#a9c9c6;
  --brand-navy:#eaf9f7;
  --brand-muted:#a9c9c6;
}
html[data-theme="dark"] body { color:#eaf9f7; }
/* Dark backgrounds were correct; hard-coded light-theme headlines were not. */
html[data-theme="dark"] body > .site-header .brand-title,
html[data-theme="dark"] body .hero h1,
html[data-theme="dark"] body .page-hero h1,
html[data-theme="dark"] body .library-top h1,
html[data-theme="dark"] body .section-head h2,
html[data-theme="dark"] body .section-head h3,
html[data-theme="dark"] body .tool-card h3,
html[data-theme="dark"] body .about-card h3,
html[data-theme="dark"] body .project-card h3,
html[data-theme="dark"] body .handbook-card h3,
html[data-theme="dark"] body .article-mini h3,
html[data-theme="dark"] body .manual-intro h3,
html[data-theme="dark"] body .v162-intro h3,
html[data-theme="dark"] body .shelf-content h3,
html[data-theme="dark"] body .list-top b,
html[data-theme="dark"] body .card h3,
html[data-theme="dark"] body .card strong,
html[data-theme="dark"] body .article-title,
html[data-theme="dark"] body .toolbar strong,
html[data-theme="dark"] body .footer-brand .brand-title {
  color:#edfcfa !important;
}
/* Keep the approved teal gradient in emphasized words instead of making it solid white. */
html[data-theme="dark"] body .hero h1 em {
  background:linear-gradient(110deg,#91f5e9,#3edccc) !important;
  -webkit-background-clip:text !important;
  background-clip:text !important;
  -webkit-text-fill-color:transparent !important;
  color:transparent !important;
}
/* Labels, meta copy, and body text on genuinely dark cards. */
html[data-theme="dark"] body .tool-card p,
html[data-theme="dark"] body .about-card p,
html[data-theme="dark"] body .project-card p,
html[data-theme="dark"] body .page-hero p,
html[data-theme="dark"] body .hero-lead,
html[data-theme="dark"] body .section-head small,
html[data-theme="dark"] body .article-mini p,
html[data-theme="dark"] body .handbook-card p,
html[data-theme="dark"] body .shelf-content p,
html[data-theme="dark"] body .project-card .pc-sub,
html[data-theme="dark"] body .list-top span {
  color:#bed7d4 !important;
}
html[data-theme="dark"] body > .site-header .brand-sub,
html[data-theme="dark"] body .project-card .seq,
html[data-theme="dark"] body .pc-number,
html[data-theme="dark"] body .page-hero .kicker,
html[data-theme="dark"] body .hero .eyebrow,
html[data-theme="dark"] body .daqi-breadcrumb,
html[data-theme="dark"] body .library-crumb {
  color:#96d8d1 !important;
}
/* Header pills, search inputs and category tabs must remain visible when switched. */
html[data-theme="dark"] body .search-pill,
html[data-theme="dark"] body .round-action,
html[data-theme="dark"] body .input-search,
html[data-theme="dark"] body .article-find input,
html[data-theme="dark"] body .toolbar input,
html[data-theme="dark"] body .hero-search input,
html[data-theme="dark"] body .filter-btn,
html[data-theme="dark"] body .library-search input,
html[data-theme="dark"] body .library-tabs button {
  color:#e6faf7 !important;
}
html[data-theme="dark"] body input::placeholder,
html[data-theme="dark"] body textarea::placeholder { color:#aac8c7 !important; opacity:1; }
html[data-theme="dark"] body .filter-btn.active,
html[data-theme="dark"] body .library-tabs button.active,
html[data-theme="dark"] body .library-filters button.active {
  color:#082b30 !important;
  background:#86eadc !important;
  border-color:#86eadc !important;
}
/* Preserve distinctive card surfaces while correcting low contrast on their titles. */
html[data-theme="dark"] body .pc-vito h3,
html[data-theme="dark"] body .pc-tools h3,
html[data-theme="dark"] body .pc-blog h3 {color:#f0fffc !important;}
html[data-theme="dark"] body .project-card .linkline,
html[data-theme="dark"] body .section-head > a,
html[data-theme="dark"] body .daqi-breadcrumb a {color:#88eddf !important;}
/* Articles uses a separate hero/card stylesheet, so its title and counts need explicit rules. */
html[data-theme="dark"] body.articles-page .hero h1,
html[data-theme="dark"] body.articles-page .count,
html[data-theme="dark"] body.articles-page .card h3 {color:#f0fffd !important;}
html[data-theme="dark"] body.articles-page .card p,
html[data-theme="dark"] body.articles-page .hero p {color:#c4dcd8 !important;}
html[data-theme="dark"] body.articles-page .card,
html[data-theme="dark"] body.articles-page .empty,
html[data-theme="dark"] body.articles-page .empty-state {border-color:#345c60;}
/* On dark theme, avoid inherited dark-blue titles in the approved colored project cards. */
html[data-theme="dark"] body .project-card [class*="title"],
html[data-theme="dark"] body .tool-main h3 {color:#f0fffd !important;}
/* Explicitly protect normal/high contrast in the footer despite shared global selectors. */
html[data-theme="dark"] body footer.footer-new .brand-title,
html[data-theme="dark"] body footer.footer-new .footer-col h4 {color:#f3fffc !important;}
html[data-theme="dark"] body footer.footer-new .footer-col a,
html[data-theme="dark"] body footer.footer-new .legal-link {color:#d4f3ef !important;}
html[data-theme="dark"] body footer.footer-new .footer-contact {color:#fff !important;}

/* Final contrast pass: separate article page and light-themed project cards. */
html[data-theme="dark"] body.articles-page {
  background:#0a1c25 !important;
  color:#eaf9f7 !important;
}
html[data-theme="dark"] body.articles-page .card {
  background:#142e38 !important;
  border-color:#345b60 !important;
}
html[data-theme="dark"] body.articles-page .article-find,
html[data-theme="dark"] body.articles-page .article-find input {
  background:#173943 !important;
  border-color:#356063 !important;
  color:#eaf9f7 !important;
}
html[data-theme="dark"] body.articles-page .article-find svg,
html[data-theme="dark"] body.articles-page .label,
html[data-theme="dark"] body.articles-page .article-crumb,
html[data-theme="dark"] body.articles-page .article-crumb a {color:#8ee7dc !important;}
html[data-theme="dark"] body.articles-page .empty {color:#b7d1cf !important;}
/* The old light CSS forces pastels even in dark mode on the About project cards.
   Darken those surfaces rather than placing white text on light backgrounds. */
html[data-theme="dark"] body > .site-header ~ main .project-card {
  background:#193d48 !important;
  border-color:#39616a !important;
}
html[data-theme="dark"] body > .site-header ~ main .project-card:nth-child(2) {
  background:#164238 !important;
  border-color:#336b61 !important;
}
html[data-theme="dark"] body > .site-header ~ main .project-card:nth-child(3) {
  background:#332f46 !important;
  border-color:#635777 !important;
}
html[data-theme="dark"] body .tool-card .tool-icon.green {
  background:#118d83 !important;
  color:#f2fffe !important;
}

/* Standalone article hero had a light-only gradient with higher specificity. */
html[data-theme="dark"] body.articles-page > .hero {
  background:linear-gradient(115deg,#12333a,#183d40) !important;
  border-color:#335e60 !important;
}
html[data-theme="dark"] body .library-top p,
html[data-theme="dark"] body .library-top .wrap > p {color:#c5dfdc !important;}
html[data-theme="dark"] body .library-find svg,
html[data-theme="dark"] body .article-find svg {color:#72e6d8 !important;}
html[data-theme="dark"] body .library-find input,
html[data-theme="dark"] body .library-find {color:#e6f9f7 !important;}
html[data-theme="dark"] body .stage-empty,
html[data-theme="dark"] body #bookshelf-empty {
  color:#cee9e5 !important;
  background:#173740 !important;
  border-color:#345e60 !important;
}
