/* Visitor color preference stays separate from the CMS theme setting. */
html[data-color-mode="dark"] body {
  color-scheme: dark;
  --bg-primary: #090e17;
  --bg-secondary: #111c2a;
  --bg-card: #162231;
  --bg-card-hover: #1e2e41;
  --border: #37485d;
  --border-focus: #b7f568;
  --text-main: #f1f5fb;
  --text-muted: #bbc7d8;
  --text-dim: #a4b3c8;
  --accent: #b7f568;
  --accent-secondary: #6ce2b2;
  --accent-glow: rgba(151,219,96,.16);
  --code-bg: #0c1520;
  --badge-bg: #253523;
  --shadow-card: 0 12px 38px rgba(0,0,0,.22);
  --on-accent: #15210d;
  --header-bg: rgba(11,18,28,.92);
  background-image: radial-gradient(ellipse at 0 0,rgba(51,105,91,.32),transparent 56%),radial-gradient(ellipse at 100% 35%,rgba(61,69,139,.28),transparent 58%),linear-gradient(155deg,#101f28 0%,#101524 52%,#111c27 100%);
}
html[data-color-mode="light"] body {
  color-scheme: light;
  --bg-primary: #f1f5f8;
  --bg-secondary: #eaf0f4;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f8fc;
  --border: #c8d3df;
  --border-focus: #356500;
  --text-main: #172738;
  --text-muted: #46576d;
  --text-dim: #536176;
  --accent: #356500;
  --accent-secondary: #116653;
  --accent-glow: rgba(66,112,55,.13);
  --code-bg: #e7edf3;
  --badge-bg: #edf5e3;
  --shadow-card: 0 10px 32px rgba(35,55,75,.07);
  --on-accent: #ffffff;
  --header-bg: rgba(249,252,254,.94);
  background-image: radial-gradient(ellipse at 0 0,rgba(146,209,184,.34),transparent 54%),radial-gradient(ellipse at 100% 30%,rgba(169,182,238,.3),transparent 56%),linear-gradient(145deg,#f4faf7 0%,#f1f4fc 52%,#eaf4f6 100%);
}
html[data-color-mode] body { background-attachment: fixed; background-size: 100% 100vh; }
html[data-color-mode] body .header-nav { background: var(--header-bg); }
html[data-color-mode] body :is(.btn-primary,.ad-btn,.nav-tab-btn.active,.cat-pill.active,.cat-pill:hover,.tag-btn.active,.tag-btn:hover,.admin-menu-item.active,.admin-menu-item:hover,.legal-tab-btn.active) { color: var(--on-accent); }
html[data-color-mode] body :is([style*="background: var(--accent)"],[style*="background:var(--accent)"],[style*="background-color: var(--accent)"]) { color: var(--on-accent) !important; }
html[data-color-mode] :is(input,textarea,select,button) { font-family: inherit; }
html[data-color-mode] :is(input,textarea,select) { color: var(--text-main); color-scheme: inherit; }
html[data-color-mode] :is(input,textarea)::placeholder { color: var(--text-dim); opacity: 1; }
html[data-color-mode] :is(a,button,input,textarea,select):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
html[data-color-mode="light"] body :is(.ads-contact-btn,.sponsor-badge,[style*="color: #ffd700"],[style*="color:#ffd700"]) { color: #775000 !important; }
html[data-color-mode="light"] body .status-badge.enabled { color: #14623b; }
html[data-color-mode="light"] body .btn-danger { color: #ab2424; }
html[data-color-mode="light"] body .btn-danger:hover { color: #fff; background: #ab2424; }
html[data-color-mode="light"] body #header-user-level-badge { color: #536176 !important; border-color: #7b8c9f !important; }
.color-mode-toggle { cursor: pointer; flex-shrink: 0; width: 38px; height: 38px; }
.color-mode-toggle svg { width: 19px; height: 19px; }
.color-mode-toggle .icon-moon { display: none; }
html[data-color-mode="light"] .color-mode-toggle .icon-moon { display: block; }
html[data-color-mode="light"] .color-mode-toggle .icon-sun { display: none; }
@media (max-width: 1100px) {
  .nav-container { height: auto; min-height: 64px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
  .nav-right-socials { margin-left: auto; flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 600px) {
  .nav-right-socials { width: 100%; justify-content: flex-end; }
  .nav-container { padding-left: 14px; padding-right: 14px; }
  .nav-tab-btn { padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) { html[data-color-mode] *,html[data-color-mode] *::before,html[data-color-mode] *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
