/* Pocketcraft theme tokens + dark mode overrides (color only; no layout changes). */

:root {
  --pc-bg: #f8fafc;
  --pc-bg-soft: #f1f5f9;
  --pc-surface: #ffffff;
  --pc-surface-2: #f8fafc;
  --pc-text: #0f172a;
  --pc-text-secondary: #334155;
  --pc-muted: #64748b;
  --pc-border: #e2e8f0;
  --pc-border-strong: #cbd5e1;
  --pc-brand: #4aa3df;
  --pc-brand-hover: #357abd;
  --pc-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --pc-shadow-soft: 0 4px 14px rgba(15, 23, 42, 0.05);
  --pc-input-bg: #ffffff;
  --pc-input-border: #d1d5db;
  --pc-table-stripe: #f8fafc;
  --pc-code-bg: #f1f5f9;

  --bs-body-bg: var(--pc-bg);
  --bs-body-color: var(--pc-text);
  --bs-border-color: var(--pc-border);
  --bs-secondary-color: var(--pc-muted);
  --bs-tertiary-bg: var(--pc-bg-soft);
  --bs-modal-bg: var(--pc-surface);
  --bs-modal-color: var(--pc-text);
  --bs-modal-border-color: var(--pc-border);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --pc-bg: #0b1220;
  --pc-bg-soft: #111827;
  --pc-surface: #151e2e;
  --pc-surface-2: #1a2436;
  --pc-text: #e5eef8;
  --pc-text-secondary: #cbd5e1;
  --pc-muted: #94a3b8;
  --pc-border: #2a364a;
  --pc-border-strong: #3b4a63;
  --pc-brand: #4aa3df;
  --pc-brand-hover: #7cc4ef;
  --pc-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --pc-shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.28);
  --pc-input-bg: #0f172a;
  --pc-input-border: #334155;
  --pc-table-stripe: #121a29;
  --pc-code-bg: #0f172a;

  --bs-body-bg: var(--pc-bg);
  --bs-body-color: var(--pc-text);
  --bs-border-color: var(--pc-border);
  --bs-secondary-color: var(--pc-muted);
  --bs-tertiary-bg: var(--pc-bg-soft);
  --bs-modal-bg: var(--pc-surface);
  --bs-modal-color: var(--pc-text);
  --bs-modal-border-color: var(--pc-border);
  --bs-light: #1a2436;
  --bs-light-rgb: 26, 36, 54;
}

/* ---------- Global dark readability ---------- */
html[data-theme="dark"] body {
  background-color: var(--pc-bg) !important;
  color: var(--pc-text);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: var(--pc-text);
}

html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label {
  color: var(--pc-text-secondary);
}

html[data-theme="dark"] a:not(.nav-link):not(.btn):not(.navbar-brand) {
  color: var(--pc-brand-hover);
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white {
  background-color: var(--pc-surface) !important;
  color: var(--pc-text);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item {
  background-color: var(--pc-surface);
  color: var(--pc-text);
  border-color: var(--pc-border);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  border-color: var(--pc-border);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background-color: var(--pc-input-bg);
  color: var(--pc-text);
  border-color: var(--pc-input-border);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  background-color: var(--pc-input-bg);
  color: var(--pc-text);
  border-color: var(--pc-brand);
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--pc-muted);
  opacity: 1;
}

html[data-theme="dark"] .table {
  color: var(--pc-text);
  --bs-table-bg: var(--pc-surface);
  --bs-table-striped-bg: var(--pc-table-stripe);
  --bs-table-border-color: var(--pc-border);
  --bs-table-color: var(--pc-text);
}

html[data-theme="dark"] .table > :not(caption) > * > * {
  border-color: var(--pc-border);
  color: var(--pc-text);
}

html[data-theme="dark"] hr {
  border-color: var(--pc-border);
  opacity: 1;
}

html[data-theme="dark"] .footer {
  background-color: var(--pc-bg-soft);
  color: var(--pc-muted);
}

html[data-theme="dark"] .footer a {
  color: var(--pc-brand-hover);
}

/* Theme-invariant: keep site chrome dark as-is */
html[data-theme="dark"] #mainNav,
html[data-theme="dark"] #mainNav.navbar-shrink,
html[data-theme="dark"] .nav-tools-menu,
html[data-theme="dark"] .nav-site-search-results {
  /* intentionally unchanged — already dark */
}

/* Nav theme toggle */
.nav-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  margin-left: 0.35rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8f9fa;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-theme-toggle:hover,
.nav-theme-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  outline: none;
}

.nav-theme-toggle i {
  font-size: 0.85rem;
}

@media (max-width: 991.98px) {
  .nav-theme-toggle {
    margin: 0.55rem 0 0.25rem;
  }
}

/* Account appearance control */
.account-theme-card {
  display: block;
}

.account-theme-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.account-theme-copy {
  flex: 1 1 16rem;
  min-width: 0;
}

.account-theme-copy .profile-name,
.account-theme-copy .account-theme-title {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.account-theme-copy p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--pc-muted);
}

.account-theme-choices {
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
  gap: 0.45rem;
  padding: 0.25rem;
  border: 1px solid var(--pc-border);
  border-radius: 999px;
  background: var(--pc-bg-soft);
}

.account-theme-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pc-muted);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  padding: 0.5rem 0.95rem;
  min-height: 2.1rem;
  cursor: pointer;
}

.account-theme-choice.is-active {
  background: var(--pc-brand);
  color: #fff;
}

html[data-theme="dark"] .account-theme-choices {
  background: var(--pc-surface-2);
  border-color: var(--pc-border);
}

/* ---------- Tokenized tools ---------- */
html[data-theme="dark"] {
  --tb-primary: #60a5fa;
  --tb-gray-700: #e2e8f0;
  --tb-gray-500: #94a3b8;
  --tb-gray-100: #1e293b;
  --tb-surface: #151e2e;
  --tb-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --tb-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45);

  --spawn-primary: #60a5fa;
  --spawn-gray-700: #e2e8f0;
  --spawn-gray-500: #94a3b8;
  --spawn-gray-100: #1e293b;
  --spawn-surface: #151e2e;
  --spawn-shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.35);
  --spawn-shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
  --spawn-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45);

  --tracker-primary: #60a5fa;
  --tracker-primary-hover: #93c5fd;
  --tracker-gray-700: #e2e8f0;
  --tracker-gray-500: #94a3b8;
  --tracker-gray-100: #1e293b;
  --tracker-surface: #151e2e;
  --tracker-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --tracker-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45);
  --tracker-border: #2a364a;

  --tools-bg: #0b1220;
  --tools-card-bg: #151e2e;
  --tools-border: #2a364a;
  --tools-border-hover: #3b4a63;
  --tools-ink: #e5eef8;
  --tools-muted: #94a3b8;
  --tools-subtle: #94a3b8;
  --tools-link: #7cc4ef;
  --tools-link-hover: #93c5fd;
  --tools-brand: #4aa3df;
  --tools-icon: #cbd5e1;

  --links-text: #e5eef8;
  --links-muted: #94a3b8;
  --links-border: #2a364a;
}

html[data-theme="dark"] body.team-builder-page,
html[data-theme="dark"] body.spawn-tool-page,
html[data-theme="dark"] body.spawn-tracker-page,
html[data-theme="dark"] body.tools-page-body {
  background-color: var(--pc-bg) !important;
  color: var(--pc-text);
}

html[data-theme="dark"] .links-page {
  background: linear-gradient(180deg, #0b1220 0%, #111827 55%);
  color: var(--links-text);
}

html[data-theme="dark"] .links-button {
  background: var(--pc-surface);
  border-color: var(--pc-border);
  color: var(--pc-text);
}

/* ---------- Hard-coded tool pages ---------- */
html[data-theme="dark"] .crafting-recipes-page,
html[data-theme="dark"] .farming-checklist-page,
html[data-theme="dark"] .pokedex-page,
html[data-theme="dark"] .servers-page,
html[data-theme="dark"] .berry-mutations-page,
html[data-theme="dark"] .site-search-results-page,
html[data-theme="dark"] .osc-page,
html[data-theme="dark"] body.aprijuice-page,
html[data-theme="dark"] .modpacks-page,
html[data-theme="dark"] .ram-calc-page {
  background: var(--pc-bg) !important;
  color: var(--pc-text);
}

html[data-theme="dark"] .cr-page,
html[data-theme="dark"] .cr-hero h1,
html[data-theme="dark"] .cr-subtitle,
html[data-theme="dark"] .fc-page,
html[data-theme="dark"] .pdx-shell,
html[data-theme="dark"] .servers-shell,
html[data-theme="dark"] .site-search-page {
  color: var(--pc-text);
}

html[data-theme="dark"] .cr-hero h1,
html[data-theme="dark"] .site-search-hero h1,
html[data-theme="dark"] .tools-page-hero h1,
html[data-theme="dark"] .fc-hero h1,
html[data-theme="dark"] .pdx-hero h1 {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .cr-subtitle,
html[data-theme="dark"] .site-search-hero p,
html[data-theme="dark"] .tools-subtitle,
html[data-theme="dark"] .fc-subtitle {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .cr-card,
html[data-theme="dark"] .cr-item-card,
html[data-theme="dark"] .fc-card,
html[data-theme="dark"] .fc-panel,
html[data-theme="dark"] .site-search-result,
html[data-theme="dark"] .server-card,
html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .modpack-card,
html[data-theme="dark"] .pdx-card,
html[data-theme="dark"] .pdx-species-card,
html[data-theme="dark"] .osc-card,
html[data-theme="dark"] .osc-panel,
html[data-theme="dark"] .aj-card,
html[data-theme="dark"] .berry-card,
html[data-theme="dark"] .id-card,
html[data-theme="dark"] .spawn-card,
html[data-theme="dark"] .tracker-card,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .about-card,
html[data-theme="dark"] .legal-card,
html[data-theme="dark"] .auth-container {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text);
  box-shadow: var(--pc-shadow-soft);
}

html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .badges-card,
html[data-theme="dark"] .teams-card,
html[data-theme="dark"] .seeds-card,
html[data-theme="dark"] .add-badge-dropdown {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text);
}

html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .badges-hint {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .stat-value {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .add-badge-dropdown .add-badge-option {
  color: var(--pc-text);
}

html[data-theme="dark"] .add-badge-dropdown .add-badge-option:hover {
  background: var(--pc-surface-2);
}

html[data-theme="dark"] .profile-add-badge-btn {
  background: var(--pc-surface);
}

html[data-theme="dark"] .btn-account {
  border-color: var(--pc-border);
}

/* Team builder leftover hard-coded whites */
html[data-theme="dark"] .tb-panel,
html[data-theme="dark"] .tb-card,
html[data-theme="dark"] .tb-slot,
html[data-theme="dark"] .tb-modal,
html[data-theme="dark"] .pokemon-picker,
html[data-theme="dark"] .team-builder-page .card {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text);
}

/* Spawn / tracker panels */
html[data-theme="dark"] .spawn-tool-page .search-container,
html[data-theme="dark"] .spawn-tool-page .results-container,
html[data-theme="dark"] .spawn-tool-page .pokemon-card,
html[data-theme="dark"] .tracker-best-card,
html[data-theme="dark"] .tracker-list-card,
html[data-theme="dark"] .tracker-empty {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text);
}

/* Homepage sections that are light */
html[data-theme="dark"] #services,
html[data-theme="dark"] #portfolio,
html[data-theme="dark"] #about,
html[data-theme="dark"] #team,
html[data-theme="dark"] .page-section {
  background-color: var(--pc-bg) !important;
  color: var(--pc-text);
}

html[data-theme="dark"] .page-section .section-heading,
html[data-theme="dark"] .page-section .section-subheading {
  color: var(--pc-text) !important;
}

/* Pricing invariant: hero stays dark; ensure body doesn't fight it */
html[data-theme="dark"] .pricing-page {
  color: var(--pc-text);
}

html[data-theme="dark"] .cr-search,
html[data-theme="dark"] .cr-item-card:hover,
html[data-theme="dark"] .tool-card:hover,
html[data-theme="dark"] .site-search-result:hover {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border-strong) !important;
}

html[data-theme="dark"] .cr-item-card-name,
html[data-theme="dark"] .site-search-result-title,
html[data-theme="dark"] .tool-card-title,
html[data-theme="dark"] .server-card-title,
html[data-theme="dark"] .modpack-card-title,
html[data-theme="dark"] .pdx-species-name,
html[data-theme="dark"] .profile-name,
html[data-theme="dark"] .legal-heading {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .site-search-result-snippet,
html[data-theme="dark"] .tool-card-desc,
html[data-theme="dark"] .server-card-desc,
html[data-theme="dark"] .cr-subtitle,
html[data-theme="dark"] .legal-intro,
html[data-theme="dark"] .about-section p {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .site-search-group h2,
html[data-theme="dark"] .tools-section-title,
html[data-theme="dark"] .tools-category-title {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .cr-grid-cell,
html[data-theme="dark"] .cr-ingredient,
html[data-theme="dark"] .fc-item,
html[data-theme="dark"] .fc-row {
  background: var(--pc-surface-2);
  border-color: var(--pc-border);
  color: var(--pc-text);
}

html[data-theme="dark"] .cr-input-wrap input,
html[data-theme="dark"] .site-search-form input,
html[data-theme="dark"] .modpacks-search,
html[data-theme="dark"] .fc-search input,
html[data-theme="dark"] .pdx-search input {
  background: var(--pc-input-bg) !important;
  color: var(--pc-text) !important;
  border-color: var(--pc-input-border) !important;
}

/* Pokédex / content shells */
html[data-theme="dark"] .pdx-shell,
html[data-theme="dark"] .pdx-main,
html[data-theme="dark"] .article-body,
html[data-theme="dark"] .blog-article-page,
html[data-theme="dark"] .blog-article-page .article-wrap,
html[data-theme="dark"] .about-page-wrap,
html[data-theme="dark"] .legal-page-wrap,
html[data-theme="dark"] .account-wrap {
  color: var(--pc-text);
}

html[data-theme="dark"] .blog-article-page,
html[data-theme="dark"] body.blog-article-page {
  background: var(--pc-bg) !important;
}

html[data-theme="dark"] .article-card,
html[data-theme="dark"] .blog-card {
  background: var(--pc-surface);
  border-color: var(--pc-border);
  color: var(--pc-text);
}

/* Item drops / berry / OSC leftover surfaces */
html[data-theme="dark"] .id-shell,
html[data-theme="dark"] .berry-shell,
html[data-theme="dark"] .osc-shell,
html[data-theme="dark"] .aj-shell,
html[data-theme="dark"] .ram-calc-shell,
html[data-theme="dark"] .modpacks-shell,
html[data-theme="dark"] .biome-finder-shell {
  color: var(--pc-text);
}

html[data-theme="dark"] .id-panel,
html[data-theme="dark"] .berry-panel,
html[data-theme="dark"] .osc-result,
html[data-theme="dark"] .aj-panel,
html[data-theme="dark"] .ram-calc-card,
html[data-theme="dark"] .modpacks-filters,
html[data-theme="dark"] .wheel-card {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text);
}

/* Pricing: keep intentional dark marketing; fix only light cards if needed */
html[data-theme="dark"] .pricing-page .pricing-card,
html[data-theme="dark"] .pricing-page .plan-card {
  background: var(--pc-surface);
  border-color: var(--pc-border);
  color: var(--pc-text);
}

/* Upgrade / shared modals */
html[data-theme="dark"] #upgradeModal .modal-content,
html[data-theme="dark"] #loginRequiredModal .modal-content {
  background: var(--pc-surface);
  color: var(--pc-text);
}

html[data-theme="dark"] #upgradeModal .text-muted,
html[data-theme="dark"] #loginRequiredModal .text-muted {
  color: var(--pc-muted) !important;
}

/* Challenge wheel / biome finder page bodies */
html[data-theme="dark"] .challenge-wheel-page,
html[data-theme="dark"] .biome-structure-finder-page,
html[data-theme="dark"] body.spawn-calculator-page {
  background: var(--pc-bg) !important;
  color: var(--pc-text);
}

/* Community teams */
html[data-theme="dark"] .community-teams-page,
html[data-theme="dark"] .community-team-card {
  background: var(--pc-bg);
  color: var(--pc-text);
}

html[data-theme="dark"] .community-team-card {
  background: var(--pc-surface);
  border-color: var(--pc-border);
}

/* Soften white inline-ish panels commonly used in tools */
html[data-theme="dark"] .bg-white.rounded,
html[data-theme="dark"] .shadow-sm.bg-white,
html[data-theme="dark"] .rounded-3.bg-white {
  background-color: var(--pc-surface) !important;
  color: var(--pc-text);
}

/* Code / pre */
html[data-theme="dark"] code,
html[data-theme="dark"] pre {
  background: var(--pc-code-bg);
  color: var(--pc-text-secondary);
  border-color: var(--pc-border);
}

/* Pagination / badges that are not semantic type colors */
html[data-theme="dark"] .page-link {
  background-color: var(--pc-surface);
  border-color: var(--pc-border);
  color: var(--pc-brand-hover);
}

html[data-theme="dark"] .page-item.disabled .page-link {
  background-color: var(--pc-surface-2);
  color: var(--pc-muted);
}

html[data-theme="dark"] .badge.bg-light {
  background-color: var(--pc-surface-2) !important;
  color: var(--pc-text) !important;
}

/* Accordion / collapse */
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .accordion-button {
  background-color: var(--pc-surface);
  color: var(--pc-text);
  border-color: var(--pc-border);
}

html[data-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: var(--pc-surface-2);
  color: var(--pc-text);
}

html[data-theme="dark"] .accordion-button::after {
  filter: invert(1);
}

/* ---------- Expanded tool surface overrides ---------- */
html[data-theme="dark"] .farming-checklist-page,
html[data-theme="dark"] .item-drops-page,
html[data-theme="dark"] .berry-page,
html[data-theme="dark"] .berry-mutations-page,
html[data-theme="dark"] .spawn-calc-page,
html[data-theme="dark"] .aj-page,
html[data-theme="dark"] .modpacks-page,
html[data-theme="dark"] .servers-page,
html[data-theme="dark"] .pokedex-page,
html[data-theme="dark"] .crafting-recipes-page {
  background: var(--pc-bg) !important;
  color: var(--pc-text);
}

html[data-theme="dark"] .fc-card,
html[data-theme="dark"] .fc-login-banner,
html[data-theme="dark"] .fc-empty,
html[data-theme="dark"] .fc-suggestions,
html[data-theme="dark"] .fc-row,
html[data-theme="dark"] .item-drops-panel,
html[data-theme="dark"] .item-drops-suggestions,
html[data-theme="dark"] .item-drops-encyclopedia-entry,
html[data-theme="dark"] .item-drops-table-wrap,
html[data-theme="dark"] .berry-card,
html[data-theme="dark"] .berry-section,
html[data-theme="dark"] .berry-seo-entry,
html[data-theme="dark"] .berry-meta-table-wrap,
html[data-theme="dark"] .spawn-calc-card,
html[data-theme="dark"] .spawn-calc-filters-panel,
html[data-theme="dark"] .spawn-calc-results,
html[data-theme="dark"] .aj-stats-panel,
html[data-theme="dark"] .aj-faq,
html[data-theme="dark"] .modpack-card,
html[data-theme="dark"] .modpacks-controls,
html[data-theme="dark"] .modpacks-faq,
html[data-theme="dark"] .server-card,
html[data-theme="dark"] .server-submit-card,
html[data-theme="dark"] .servers-empty-card,
html[data-theme="dark"] .pdx-card,
html[data-theme="dark"] .pdx-controls,
html[data-theme="dark"] .pdx-family,
html[data-theme="dark"] .pdx-faq,
html[data-theme="dark"] .pdx-facts,
html[data-theme="dark"] .pdx-drops,
html[data-theme="dark"] .cr-card,
html[data-theme="dark"] .cr-cell,
html[data-theme="dark"] .cr-obtain,
html[data-theme="dark"] .cr-farm-list,
html[data-theme="dark"] .osc-controls,
html[data-theme="dark"] .osc-biome-panel,
html[data-theme="dark"] .osc-advanced-panel,
html[data-theme="dark"] .osc-gate,
html[data-theme="dark"] .osc-empty {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text);
}

html[data-theme="dark"] .fc-item-name,
html[data-theme="dark"] .fc-hero h1,
html[data-theme="dark"] .item-drops-hero h1,
html[data-theme="dark"] .berry-hero h1,
html[data-theme="dark"] .berry-section-title,
html[data-theme="dark"] .pdx-card-name,
html[data-theme="dark"] .pdx-hero h1,
html[data-theme="dark"] .modpack-title,
html[data-theme="dark"] .server-card-title,
html[data-theme="dark"] .cr-detail-name,
html[data-theme="dark"] .cr-index-title,
html[data-theme="dark"] .spawn-calc-filters-title {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .fc-subtitle,
html[data-theme="dark"] .fc-item-kind,
html[data-theme="dark"] .item-drops-muted,
html[data-theme="dark"] .berry-muted,
html[data-theme="dark"] .berry-hero-lead,
html[data-theme="dark"] .berry-section-hint,
html[data-theme="dark"] .pdx-hero-lead,
html[data-theme="dark"] .pdx-credit,
html[data-theme="dark"] .modpack-desc,
html[data-theme="dark"] .modpack-author,
html[data-theme="dark"] .server-description,
html[data-theme="dark"] .cr-muted,
html[data-theme="dark"] .cr-detail-desc,
html[data-theme="dark"] .cr-detail-desc--muted {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .fc-add-input,
html[data-theme="dark"] .item-drops-input-field,
html[data-theme="dark"] .berry-input,
html[data-theme="dark"] .modpacks-search,
html[data-theme="dark"] .modpacks-select,
html[data-theme="dark"] .server-form-control,
html[data-theme="dark"] .server-form-textarea,
html[data-theme="dark"] .cr-input,
html[data-theme="dark"] .osc-field input,
html[data-theme="dark"] .osc-field select {
  background: var(--pc-input-bg) !important;
  color: var(--pc-text) !important;
  border-color: var(--pc-input-border) !important;
}

html[data-theme="dark"] .fc-btn-secondary,
html[data-theme="dark"] .item-drops-mode-btn,
html[data-theme="dark"] .servers-filter-btn,
html[data-theme="dark"] .modpacks-loader-btn,
html[data-theme="dark"] .spawn-calc-btn-outline,
html[data-theme="dark"] .osc-chip {
  background: var(--pc-surface-2);
  border-color: var(--pc-border);
  color: var(--pc-text);
}

html[data-theme="dark"] .item-drops-table,
html[data-theme="dark"] .berry-meta-table,
html[data-theme="dark"] .spawn-calc-table {
  color: var(--pc-text);
}

html[data-theme="dark"] .item-drops-table th,
html[data-theme="dark"] .berry-meta-table th,
html[data-theme="dark"] .spawn-calc-table th {
  background: var(--pc-surface-2);
  color: var(--pc-text-secondary);
  border-color: var(--pc-border);
}

html[data-theme="dark"] .item-drops-table td,
html[data-theme="dark"] .berry-meta-table td,
html[data-theme="dark"] .spawn-calc-table td {
  border-color: var(--pc-border);
  color: var(--pc-text);
}

html[data-theme="dark"] .fc-progress-track {
  background: var(--pc-surface-2);
}

html[data-theme="dark"] .cr-cell-name,
html[data-theme="dark"] .cr-farm-item-name {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .osc-field-label,
html[data-theme="dark"] .osc-biome-name,
html[data-theme="dark"] .osc-biome-meta {
  color: var(--pc-text-secondary);
}

/* Article / tutorial content cards */
html[data-theme="dark"] .article-content,
html[data-theme="dark"] .blog-article-page .card,
html[data-theme="dark"] .blog-article-page .content-card {
  background: var(--pc-surface);
  color: var(--pc-text);
  border-color: var(--pc-border);
}

/* ==========================================================================
   Dark mode contrast pass — force surfaces dark + text readable
   (fixes white cards with light text / dark text on dark surfaces)
   ========================================================================== */

html[data-theme="dark"] {
  /* Ink only — cream stays light (used as text on dark pot slots) */
  --osc-ink: #e8e4dc;
}

/* Generic: kill leftover pure-white tool cards */
html[data-theme="dark"] .spawn-pokedex-card,
html[data-theme="dark"] .spawn-page .spawn-results,
html[data-theme="dark"] .spawn-page .btn-share-spawn,
html[data-theme="dark"] .pdx-card,
html[data-theme="dark"] .pdx-panel,
html[data-theme="dark"] .pdx-mon-hero,
html[data-theme="dark"] .pdx-mon-card,
html[data-theme="dark"] .pdx-family,
html[data-theme="dark"] .pdx-faq details,
html[data-theme="dark"] .pdx-crosslinks,
html[data-theme="dark"] .pdx-grid a,
html[data-theme="dark"] .spawn-calc-summary,
html[data-theme="dark"] .spawn-calc-table-wrap,
html[data-theme="dark"] .spawn-calc-card,
html[data-theme="dark"] .spawn-calc-filters-panel,
html[data-theme="dark"] .berry-search,
html[data-theme="dark"] .berry-card,
html[data-theme="dark"] .berry-seo-entry,
html[data-theme="dark"] .cr-related-sources,
html[data-theme="dark"] .cr-obtain,
html[data-theme="dark"] .cr-recipe-block,
html[data-theme="dark"] .cr-detail-block,
html[data-theme="dark"] .cr-farm-item,
html[data-theme="dark"] .osc-controls,
html[data-theme="dark"] .osc-pot-panel,
html[data-theme="dark"] .osc-biome-panel,
html[data-theme="dark"] .aj-faq details,
html[data-theme="dark"] .tb-coach-hero,
html[data-theme="dark"] .tb-coach-card,
html[data-theme="dark"] .tb-coach-body-pane,
html[data-theme="dark"] .tb-score-card,
html[data-theme="dark"] .tb-coaching-card,
html[data-theme="dark"] .seed-map-ruins-filter,
html[data-theme="dark"] .ram-calc-host-card,
html[data-theme="dark"] .ram-calc-panel,
html[data-theme="dark"] .ram-calc-modpack-card-inner,
html[data-theme="dark"] .ram-calc-seo-card,
html[data-theme="dark"] .ram-calc-compare,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .seed-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .badges-card,
html[data-theme="dark"] .profile-card {
  background: var(--pc-surface) !important;
  background-image: none !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
  box-shadow: var(--pc-shadow-soft);
}

/* Headings / names that stayed dark (#0f172a / #212529 / #1e293b) */
html[data-theme="dark"] .badge-name,
html[data-theme="dark"] .team-card h4,
html[data-theme="dark"] .profile-name,
html[data-theme="dark"] .spawn-page .spawn-results-header h1,
html[data-theme="dark"] .spawn-pokedex-card .spawn-pokedex-name,
html[data-theme="dark"] .spawn-pokedex-card .spawn-pokedex-id,
html[data-theme="dark"] .pdx-mon-name,
html[data-theme="dark"] .pdx-card-name,
html[data-theme="dark"] .pdx-mon-dex,
html[data-theme="dark"] .pdx-panel h2,
html[data-theme="dark"] .pdx-panel h3,
html[data-theme="dark"] .berry-token-label,
html[data-theme="dark"] .berry-section-title,
html[data-theme="dark"] .berry-subhead,
html[data-theme="dark"] .berry-seo-entry-title,
html[data-theme="dark"] .cr-seo-heading,
html[data-theme="dark"] .cr-detail-name,
html[data-theme="dark"] .cr-farm-item-name,
html[data-theme="dark"] .cr-item-card-name,
html[data-theme="dark"] .cr-cell-name,
html[data-theme="dark"] .aj-page .aj-controls-title,
html[data-theme="dark"] .aj-faq summary,
html[data-theme="dark"] .aj-stat-name,
html[data-theme="dark"] .osc-field-label,
html[data-theme="dark"] .tb-coach-heading-hero,
html[data-theme="dark"] .tb-coach-verbal-score,
html[data-theme="dark"] .tb-coach-placeholder,
html[data-theme="dark"] .tb-coach-subheading,
html[data-theme="dark"] .tb-coaching-title,
html[data-theme="dark"] .tb-coaching-explanation,
html[data-theme="dark"] .ram-calc-host-name,
html[data-theme="dark"] .ram-calc-host-lead,
html[data-theme="dark"] .ram-calc-panel-title,
html[data-theme="dark"] .ram-calc-modpack-title,
html[data-theme="dark"] .spawn-calc-summary,
html[data-theme="dark"] .spawn-calc-card-head a,
html[data-theme="dark"] .seed-map-cb-label,
html[data-theme="dark"] .seed-map-layer-title,
html[data-theme="dark"] .seed-map-layer-subtitle {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-page .spawn-results-subtitle,
html[data-theme="dark"] .berry-muted,
html[data-theme="dark"] .berry-section-hint,
html[data-theme="dark"] .cr-seo-intro p,
html[data-theme="dark"] .cr-related-source-list,
html[data-theme="dark"] .cr-detail-desc,
html[data-theme="dark"] .aj-faq details p,
html[data-theme="dark"] .aj-seo-links,
html[data-theme="dark"] .aj-page .aj-juices-hint,
html[data-theme="dark"] .tb-coach-hero-tagline,
html[data-theme="dark"] .tb-coaching-reasoning,
html[data-theme="dark"] .ram-calc-host-list,
html[data-theme="dark"] .ram-calc-host-compare-sub,
html[data-theme="dark"] .seed-muted,
html[data-theme="dark"] .badges-hint,
html[data-theme="dark"] .spawn-calc-card-meta {
  color: var(--pc-muted) !important;
}

/* Spawn calculator table body */
html[data-theme="dark"] .spawn-calc-table,
html[data-theme="dark"] .spawn-calc-table tbody,
html[data-theme="dark"] .spawn-calc-table tbody td,
html[data-theme="dark"] .spawn-calc-table tbody tr {
  background: var(--pc-surface) !important;
  color: var(--pc-text) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .spawn-calc-table thead th {
  background: var(--pc-surface-2) !important;
  color: var(--pc-text) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .spawn-calc-cond,
html[data-theme="dark"] .spawn-calc-mon a,
html[data-theme="dark"] .spawn-calc-link-btn {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-calc-link-btn,
html[data-theme="dark"] .spawn-calc-btn-outline {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border-strong) !important;
  color: var(--pc-brand-hover) !important;
}

/* Pokédex grid tiles */
html[data-theme="dark"] .pdx-grid .pdx-card,
html[data-theme="dark"] a.pdx-card,
html[data-theme="dark"] .pdx-species-card {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .pdx-card-sprite,
html[data-theme="dark"] .spawn-pokedex-card .spawn-pokedex-sprite,
html[data-theme="dark"] .spawn-page .pokemon-sprite {
  background: var(--pc-surface-2) !important;
}

/* Berry formula token names */
html[data-theme="dark"] .berry-recipe-formula .berry-token-label,
html[data-theme="dark"] .berry-detail-head .berry-token-label,
html[data-theme="dark"] .berry-token--hero .berry-token-label {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .berry-search,
html[data-theme="dark"] .berry-search-row {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
}

/* Crafting detail white panels */
html[data-theme="dark"] .cr-related-sources,
html[data-theme="dark"] .cr-obtain,
html[data-theme="dark"] .cr-card .cr-detail,
html[data-theme="dark"] .crafting-recipes-page .cr-card {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .cr-related-sources h2,
html[data-theme="dark"] .cr-related-sources h3,
html[data-theme="dark"] .cr-obtain h2,
html[data-theme="dark"] .cr-obtain h3,
html[data-theme="dark"] .cr-card h2,
html[data-theme="dark"] .cr-card h3 {
  color: var(--pc-text) !important;
}

/* Aprijuice / OSC warm-theme leftovers */
html[data-theme="dark"] .aj-page,
html[data-theme="dark"] .osc-page,
html[data-theme="dark"] body.osc-page,
html[data-theme="dark"] .aj-page .osc-controls,
html[data-theme="dark"] .aj-page .osc-results,
html[data-theme="dark"] .aj-stats-panel {
  color: var(--osc-ink) !important;
}

html[data-theme="dark"] .aj-page .osc-controls,
html[data-theme="dark"] .aj-faq details {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .aj-page .osc-field-label,
html[data-theme="dark"] .aj-page .aj-juices-inline,
html[data-theme="dark"] .aj-page .aj-juices-inline strong,
html[data-theme="dark"] .aj-page .aj-controls-title,
html[data-theme="dark"] .aj-page .aj-subhead,
html[data-theme="dark"] .aj-page .aj-seo,
html[data-theme="dark"] .aj-page .aj-seo h2,
html[data-theme="dark"] .aj-page .aj-seo h3,
html[data-theme="dark"] .aj-page .osc-panel-title,
html[data-theme="dark"] .osc-panel-title {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .aj-page .aj-juices-inline,
html[data-theme="dark"] .aj-page .aj-poke-field .osc-field-label,
html[data-theme="dark"] .aj-page .aj-subhead,
html[data-theme="dark"] .aj-faq details p,
html[data-theme="dark"] .aj-seo-links {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .aj-page .aj-stat-row {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .aj-page .aj-stat-name,
html[data-theme="dark"] .aj-page .aj-stat-value {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .aj-page .aj-stat-value.is-pos {
  color: #4ade80 !important;
}

html[data-theme="dark"] .aj-page .aj-stat-value.is-neg {
  color: #f87171 !important;
}

html[data-theme="dark"] .pdx-mon-hero-info h1,
html[data-theme="dark"] .pdx-mon-hero-lead,
html[data-theme="dark"] .pdx-mon-hero-dex,
html[data-theme="dark"] .pdx-panel h2,
html[data-theme="dark"] .pdx-panel h3,
html[data-theme="dark"] .pdx-family-head h2 a,
html[data-theme="dark"] .pdx-action {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pdx-mon-hero-lead,
html[data-theme="dark"] .pdx-mon-hero-dex {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .pdx-action {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .pdx-mon-hero-art {
  background: radial-gradient(circle at center, #1e3a5f 0%, var(--pc-surface-2) 70%) !important;
}

/* Team coach */
html[data-theme="dark"] .tb-coach-hero {
  background: linear-gradient(180deg, var(--pc-surface-2) 0%, var(--pc-surface) 100%) !important;
}

html[data-theme="dark"] .tb-coach-body-pane {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .tb-coaching-card {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

/* Biome finder ruins block */
html[data-theme="dark"] .seed-map-ruins-filter {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .seed-map-ruins-filter label,
html[data-theme="dark"] .seed-map-ruins-master,
html[data-theme="dark"] .seed-map-ruins-hint,
html[data-theme="dark"] .seed-map-cb-label {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .seed-map-ruins-search,
html[data-theme="dark"] .seed-map-ruins-select,
html[data-theme="dark"] .seed-map-saved-seeds-select {
  background: var(--pc-input-bg) !important;
  color: var(--pc-text) !important;
  border-color: var(--pc-input-border) !important;
}

html[data-theme="dark"] .seed-map-ruins-unmapped {
  background: #3b2f14 !important;
  border-color: #6b5420 !important;
  color: #fde68a !important;
}

/* Server RAM host compare cards */
html[data-theme="dark"] .ram-calc-host-card,
html[data-theme="dark"] .ram-calc-host-card--apex,
html[data-theme="dark"] .ram-calc-host-card--vyper {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .ram-calc-host-name,
html[data-theme="dark"] .ram-calc-host-lead,
html[data-theme="dark"] .ram-calc-host-list li {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .ram-calc-host-btn--apex {
  background: var(--pc-surface-2) !important;
  color: var(--pc-text) !important;
  border-color: #d4a017 !important;
}

/* Account page inline styles */
html[data-theme="dark"] .badge-name {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .seed-card,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .empty-state {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .seed-inline-code {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .seed-table th,
html[data-theme="dark"] .seed-table td {
  color: var(--pc-text) !important;
  border-color: var(--pc-border) !important;
}

/* Catch-all for Bootstrap white utility leftovers inside tools */
html[data-theme="dark"] .spawn-calc-page .bg-white,
html[data-theme="dark"] .pokedex-page .bg-white,
html[data-theme="dark"] .crafting-recipes-page .bg-white,
html[data-theme="dark"] .aj-page .bg-white,
html[data-theme="dark"] .team-builder-page .bg-white,
html[data-theme="dark"] .seed-map-page .bg-white {
  background-color: var(--pc-surface) !important;
  color: var(--pc-text) !important;
}

/* ==========================================================================
   Dark mode contrast pass 2 — pills, FAQ, stats, leftovers
   ========================================================================== */

/* Spawn tool: "Best Spawn Conditions" badge (spawn-gray-700 remaps light) */
html[data-theme="dark"] .spawn-page .spawn-card-badge {
  background: #1e3a5f !important;
  color: #e5eef8 !important;
  border: 1px solid #3b82f6;
}

html[data-theme="dark"] .spawn-page .spawn-card-best,
html[data-theme="dark"] .spawn-page .spawn-card-other {
  background: var(--pc-surface) !important;
  color: var(--pc-text) !important;
  box-shadow: var(--pc-shadow-soft);
}

html[data-theme="dark"] .spawn-page .spawn-card-label {
  color: var(--pc-muted) !important;
}

/* Tracker "How this works" pills */
html[data-theme="dark"] .tracker-guide-step {
  background: var(--pc-surface-2) !important;
  background-image: none !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .tracker-guide-label,
html[data-theme="dark"] .tracker-guide-step {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .tracker-guide-icon {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border-strong) !important;
  color: var(--pc-brand-hover) !important;
}

/* Spawn calculator rarity chips */
html[data-theme="dark"] .spawn-calc-rarity-chip {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-calc-rarity-chip:has(input:checked) {
  background: rgba(74, 163, 223, 0.2) !important;
  border-color: #4aa3df !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-calc-rarity-label {
  color: var(--pc-muted) !important;
}

/* Berry browse chips + "ONE OF" mutation option pill */
html[data-theme="dark"] .berry-chip {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .berry-chip .berry-token-label,
html[data-theme="dark"] .berry-grid .berry-token-label {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .berry-formula-or-wrap {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border-strong) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .berry-formula-or-wrap .berry-token-label,
html[data-theme="dark"] .berry-formula-muted {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .berry-formula-muted {
  color: var(--pc-muted) !important;
}

/* Crafting recipe card (uses #fafbfc, not pure white) */
html[data-theme="dark"] .cr-recipe,
html[data-theme="dark"] .cr-recipe-block,
html[data-theme="dark"] .crafting-recipes-page .cr-card {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .cr-recipe-head h3,
html[data-theme="dark"] .cr-seo-heading {
  color: var(--pc-text) !important;
}

/* Pokédex FAQ, moves, facts, base stats */
html[data-theme="dark"] .pdx-faq details,
html[data-theme="dark"] .pdx-moves-extra details,
html[data-theme="dark"] .pdx-crosslinks {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .pdx-faq summary,
html[data-theme="dark"] .pdx-moves-extra summary,
html[data-theme="dark"] .pdx-faq p,
html[data-theme="dark"] .pdx-moves-extra p,
html[data-theme="dark"] .pdx-crosslinks,
html[data-theme="dark"] .pdx-crosslinks strong {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pdx-facts dt {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .pdx-facts dd,
html[data-theme="dark"] .pdx-stat-label,
html[data-theme="dark"] .pdx-stat-val,
html[data-theme="dark"] .pdx-moves-table th,
html[data-theme="dark"] .pdx-moves-table td,
html[data-theme="dark"] .pdx-seo h2,
html[data-theme="dark"] .pdx-seo h3,
html[data-theme="dark"] .pdx-seo,
html[data-theme="dark"] .pdx-seo-list,
html[data-theme="dark"] .pdx-seo-list strong {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pdx-stat-label,
html[data-theme="dark"] .pdx-moves-table th {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .pdx-stat-total .pdx-stat-label,
html[data-theme="dark"] .pdx-stat-total .pdx-stat-val,
html[data-theme="dark"] .pdx-moves-table td:first-child {
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .pdx-moves-table-wrap {
  background: transparent !important;
  border-color: var(--pc-border) !important;
}

/* Breeding page hero stats */
html[data-theme="dark"] .pdx-hero-stats,
html[data-theme="dark"] .pdx-hero-stats li {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .pdx-hero-stats strong {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pdx-chip {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pdx-chip.is-active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

html[data-theme="dark"] .pdx-breed-context,
html[data-theme="dark"] .pdx-breed-guide-cta {
  color: var(--pc-muted) !important;
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .pdx-breed-context strong {
  color: var(--pc-text) !important;
}

/* Server RAM bottom SEO cards */
html[data-theme="dark"] .ram-calc-seo-card,
html[data-theme="dark"] .ram-calc-seo-faq-item,
html[data-theme="dark"] .ram-calc-seo-callout {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .ram-calc-seo-card h3,
html[data-theme="dark"] .ram-calc-seo-card p,
html[data-theme="dark"] .ram-calc-seo-appendix,
html[data-theme="dark"] .ram-calc-seo-appendix h2,
html[data-theme="dark"] .ram-calc-seo-appendix h3,
html[data-theme="dark"] .ram-calc-seo-faq-item h3,
html[data-theme="dark"] .ram-calc-seo-faq-item p,
html[data-theme="dark"] .ram-calc-tips-heading,
html[data-theme="dark"] .ram-calc-tips h3,
html[data-theme="dark"] .ram-calc-tips p {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .ram-calc-tips-intro,
html[data-theme="dark"] .ram-calc-seo-appendix {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .ram-calc-seo-appendix code.bg-light {
  background: var(--pc-surface-2) !important;
  color: var(--pc-text) !important;
}

/* ==========================================================================
   Pricing / About / Legal dark mode
   ========================================================================== */

/* Keep pricing hero intentionally dark; theme the light plan/FAQ bands */
html[data-theme="dark"] .pricing-page {
  background: var(--pc-bg) !important;
}

html[data-theme="dark"] .pricing-plans {
  background: var(--pc-bg) !important;
}

html[data-theme="dark"] .pricing-card,
html[data-theme="dark"] .pricing-card--free,
html[data-theme="dark"] .pricing-card--pro {
  background: var(--pc-surface) !important;
  background-image: none !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
  box-shadow: var(--pc-shadow-soft) !important;
}

html[data-theme="dark"] .pricing-card--pro {
  border-color: rgba(74, 163, 223, 0.55) !important;
  box-shadow:
    0 0 0 6px rgba(74, 163, 223, 0.12),
    var(--pc-shadow) !important;
}

html[data-theme="dark"] .pricing-card-header {
  border-bottom-color: var(--pc-border) !important;
}

html[data-theme="dark"] .pricing-card-name,
html[data-theme="dark"] .pricing-card-amount,
html[data-theme="dark"] .pricing-feature-list li,
html[data-theme="dark"] .pricing-feature-list-item--key,
html[data-theme="dark"] .pricing-card-cta-points li {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pricing-card-period,
html[data-theme="dark"] .pricing-card-tagline,
html[data-theme="dark"] .pricing-card-free-note,
html[data-theme="dark"] .pricing-card-fineprint,
html[data-theme="dark"] .pricing-feature-list--pro li:not(.pricing-feature-list-item--key) {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .pricing-feature-list li {
  border-bottom-color: var(--pc-border) !important;
}

html[data-theme="dark"] .pricing-faq {
  background: var(--pc-bg) !important;
}

html[data-theme="dark"] .pricing-faq-title {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pricing-faq-subtitle {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .pricing-accordion-item,
html[data-theme="dark"] .pricing-accordion-button,
html[data-theme="dark"] .pricing-accordion-body {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pricing-accordion-button:not(.collapsed) {
  background: rgba(74, 163, 223, 0.12) !important;
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .pricing-accordion-body {
  color: var(--pc-text-secondary) !important;
}

/* About title + cards (beats leftover hard-coded page styles) */
html[data-theme="dark"] .about-title,
html[data-theme="dark"] .about-logo-text h1,
html[data-theme="dark"] .about-section h2,
html[data-theme="dark"] .about-proof-value,
html[data-theme="dark"] .about-card > p {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .about-kicker,
html[data-theme="dark"] .about-proof-label,
html[data-theme="dark"] .about-section p,
html[data-theme="dark"] .about-cta .about-cta-secondary {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .about-card,
html[data-theme="dark"] .about-proof-item {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .about-social-proof {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
}

/* Privacy / Terms TOC + card */
html[data-theme="dark"] .legal-card {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .legal-toc {
  background: var(--pc-surface-2) !important;
  border: 1px solid var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .legal-toc h2,
html[data-theme="dark"] .legal-heading,
html[data-theme="dark"] .legal-section h2 {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .legal-updated,
html[data-theme="dark"] .legal-intro,
html[data-theme="dark"] .legal-section p,
html[data-theme="dark"] .legal-section ul li {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .legal-toc a {
  color: var(--pc-brand-hover) !important;
}

/* Pokédex evolution path cards */
html[data-theme="dark"] .pdx-evo-list li {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pdx-evo-target {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pdx-evo-from,
html[data-theme="dark"] .pdx-evo-learns {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .pdx-evo-method {
  background: rgba(74, 163, 223, 0.18) !important;
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .pdx-berry-tip {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .pdx-berry-tip p {
  color: var(--pc-text-secondary) !important;
}

/* ==========================================================================
   Dark mode contrast pass 3 — leftovers from QA
   ========================================================================== */

/* Berry related tools + search suggestions / autofill */
html[data-theme="dark"] .berry-related-tools {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .berry-related-tools-title {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .berry-related-tools-list {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .berry-related-tools-list a {
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .berry-search,
html[data-theme="dark"] .berry-input,
html[data-theme="dark"] .berry-suggestions,
html[data-theme="dark"] .berry-suggestion-btn {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .berry-suggestion-btn:hover {
  background: var(--pc-surface-2) !important;
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .berry-input:-webkit-autofill,
html[data-theme="dark"] .berry-input:-webkit-autofill:hover,
html[data-theme="dark"] .berry-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--pc-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--pc-input-bg) inset !important;
  caret-color: var(--pc-text);
  transition: background-color 99999s ease-out;
}

/* Aprijuice / OSC pokemon search suggestions + autofill */
html[data-theme="dark"] .osc-search-suggestions,
html[data-theme="dark"] .aj-page .osc-search-suggestions {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  box-shadow: var(--pc-shadow) !important;
}

html[data-theme="dark"] .osc-search-suggestions button,
html[data-theme="dark"] .aj-page .osc-search-suggestions button {
  background: transparent !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .osc-search-suggestions button:hover,
html[data-theme="dark"] .osc-search-suggestions button.is-active,
html[data-theme="dark"] .aj-page .osc-search-suggestions button:hover,
html[data-theme="dark"] .aj-page .osc-search-suggestions button.is-active {
  background: rgba(74, 163, 223, 0.18) !important;
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .osc-field input,
html[data-theme="dark"] .aj-page .osc-field input,
html[data-theme="dark"] .osc-search-wrap input {
  background: var(--pc-input-bg) !important;
  color: var(--pc-text) !important;
  border-color: var(--pc-input-border) !important;
}

html[data-theme="dark"] .osc-field input:-webkit-autofill,
html[data-theme="dark"] .osc-field input:-webkit-autofill:hover,
html[data-theme="dark"] .osc-field input:-webkit-autofill:focus,
html[data-theme="dark"] .aj-page input:-webkit-autofill,
html[data-theme="dark"] .aj-page input:-webkit-autofill:hover,
html[data-theme="dark"] .aj-page input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--pc-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--pc-input-bg) inset !important;
  caret-color: var(--pc-text);
  transition: background-color 99999s ease-out;
}

/* Crafting "Add to farming list" buttons */
html[data-theme="dark"] .cr-farm-add-btn {
  background: rgba(74, 163, 223, 0.22) !important;
  border-color: rgba(124, 196, 239, 0.65) !important;
  color: #e0f2fe !important;
}

html[data-theme="dark"] .cr-farm-add-btn:hover:not(:disabled),
html[data-theme="dark"] .cr-farm-add-btn:focus-visible {
  background: rgba(74, 163, 223, 0.35) !important;
  border-color: #7cc4ef !important;
  color: #fff !important;
}

html[data-theme="dark"] .cr-farm-add-btn.is-added {
  background: rgba(34, 197, 94, 0.22) !important;
  border-color: rgba(74, 222, 128, 0.55) !important;
  color: #bbf7d0 !important;
}

/* Footer copyright / legal line */
html[data-theme="dark"] .footer,
html[data-theme="dark"] .footer .my-footer,
html[data-theme="dark"] .footer .col-lg-6 {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .footer a {
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .footer p,
html[data-theme="dark"] .footer p[style] {
  color: var(--pc-muted) !important;
}

/* Server RAM terrain toggle + toolkit strip */
html[data-theme="dark"] .ram-calc-terrain-row {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .ram-calc-terrain-label {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .ram-calc-terrain-hint {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .ram-calc-seo-callout {
  background: rgba(74, 163, 223, 0.12) !important;
  border-left-color: #4aa3df !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .ram-calc-seo-callout p {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .ram-calc-seo-callout a {
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .ram-calc-internal-links {
  background: var(--pc-surface) !important;
  border-top-color: var(--pc-border) !important;
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .ram-calc-internal-links a {
  color: var(--pc-brand-hover) !important;
}

/* Modpacks SEO card */
html[data-theme="dark"] .modpacks-content {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .modpacks-content h2,
html[data-theme="dark"] .modpacks-content h3,
html[data-theme="dark"] .modpacks-faq summary {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .modpacks-content p,
html[data-theme="dark"] .modpacks-steps li,
html[data-theme="dark"] .modpacks-faq p,
html[data-theme="dark"] .modpacks-internal-links {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .modpacks-faq details {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
}

/* Servers IP + filters / submit tag pills */
html[data-theme="dark"] .server-ip-row {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .server-ip-row code {
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .server-tag {
  background: rgba(74, 163, 223, 0.18) !important;
  color: #bfdbfe !important;
}

html[data-theme="dark"] .servers-filter-option,
html[data-theme="dark"] .server-tag-option {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .servers-filter-actions button {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .servers-filter-panel {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

/* Tutorial / article pages — white article card */
html[data-theme="dark"] body.blog-article-page,
html[data-theme="dark"] .blog-article-page {
  background: var(--pc-bg) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .blog-article-page article,
html[data-theme="dark"] article {
  background: var(--pc-surface) !important;
  color: var(--pc-text) !important;
  box-shadow: var(--pc-shadow-soft) !important;
}

html[data-theme="dark"] .blog-article-page article h1,
html[data-theme="dark"] .blog-article-page article h2,
html[data-theme="dark"] .blog-article-page article h3,
html[data-theme="dark"] article h1,
html[data-theme="dark"] article h2,
html[data-theme="dark"] article h3 {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .blog-article-page article p,
html[data-theme="dark"] .blog-article-page article li,
html[data-theme="dark"] article p,
html[data-theme="dark"] article li {
  color: var(--pc-text-secondary) !important;
}

html[data-theme="dark"] .blog-article-page article a,
html[data-theme="dark"] article a {
  color: var(--pc-brand-hover) !important;
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--pc-muted, #6b7280);
}

/* Community teams Pokémon circles */
html[data-theme="dark"] .pkmn-slot {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
}

/* Spawn tool SEO sections (popular lookups, explainer, crawl table) */
html[data-theme="dark"] .spawn-seo-appendix,
html[data-theme="dark"] .spawn-seo-bottom {
  background: var(--pc-surface) !important;
  background-image: none !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-seo-appendix-title,
html[data-theme="dark"] .spawn-seo-bottom h2,
html[data-theme="dark"] .spawn-seo-explainer h3,
html[data-theme="dark"] .spawn-seo-popular-name {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-seo-appendix-lead,
html[data-theme="dark"] .spawn-seo-appendix-foot,
html[data-theme="dark"] .spawn-seo-bottom-lead,
html[data-theme="dark"] .spawn-seo-explainer p,
html[data-theme="dark"] .spawn-seo-popular-meta,
html[data-theme="dark"] .spawn-seo-crawl-table caption {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .spawn-seo-popular-card {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-seo-crawl-table table {
  background: var(--pc-surface) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-seo-crawl-table th,
html[data-theme="dark"] .spawn-seo-crawl-table td {
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .spawn-seo-crawl-table th {
  background: var(--pc-surface-2) !important;
}

html[data-theme="dark"] .spawn-seo-crawl-table tbody tr:nth-child(even) {
  background: var(--pc-surface-2) !important;
}

html[data-theme="dark"] .spawn-seo-crawl-table a {
  color: var(--pc-brand-hover) !important;
}

/* Evolution guide level / method pills */
html[data-theme="dark"] .pdx-step-method {
  background: rgba(74, 163, 223, 0.18) !important;
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .pdx-step-route,
html[data-theme="dark"] .pdx-step-route a {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .pdx-steps {
  border-top-color: var(--pc-border) !important;
}

/* Item drops search input + suggestions (actual input is .item-drops-input) */
html[data-theme="dark"] .item-drops-search,
html[data-theme="dark"] .item-drops-input,
html[data-theme="dark"] .item-drops-suggestions {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .item-drops-input {
  background: var(--pc-input-bg) !important;
  color: var(--pc-text) !important;
  border-color: var(--pc-input-border) !important;
}

html[data-theme="dark"] .item-drops-input::placeholder {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .item-drops-suggestion-btn {
  background: var(--pc-surface) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .item-drops-suggestion-btn:hover {
  background: var(--pc-surface-2) !important;
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .item-drops-input:-webkit-autofill,
html[data-theme="dark"] .item-drops-input:-webkit-autofill:hover,
html[data-theme="dark"] .item-drops-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--pc-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--pc-input-bg) inset !important;
  caret-color: var(--pc-text);
  transition: background-color 99999s ease-out;
}

html[data-theme="dark"] .item-drops-search-icon {
  color: var(--pc-muted) !important;
}

/* Optimal Spawn Calculator unlock tease modal */
html[data-theme="dark"] .osc-tease-overlay {
  background: rgba(11, 18, 32, 0.72) !important;
  border-color: var(--pc-border) !important;
}

html[data-theme="dark"] .osc-tease-card {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  box-shadow: var(--pc-shadow) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .osc-tease-title {
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .osc-tease-sub {
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .osc-tease-icon {
  background: rgba(74, 163, 223, 0.2) !important;
  color: var(--pc-brand-hover) !important;
}

html[data-theme="dark"] .osc-gate {
  background: var(--pc-surface) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

/* Optimal Spawn Calculator filter chips (bg is on the inner span) */
html[data-theme="dark"] .osc-chip span {
  background: var(--pc-surface-2) !important;
  border-color: var(--pc-border) !important;
  color: var(--pc-text) !important;
}

html[data-theme="dark"] .osc-chip input:checked + span {
  background: rgba(74, 163, 223, 0.22) !important;
  border-color: #4aa3df !important;
  color: #e0f2fe !important;
}

html[data-theme="dark"] .osc-chip.is-disabled span {
  background: var(--pc-surface) !important;
  color: var(--pc-muted) !important;
}

html[data-theme="dark"] .osc-chip--free input:checked + span {
  background: rgba(106, 168, 79, 0.22) !important;
  border-color: #6aa84f !important;
  color: #bbf7d0 !important;
}
