/* Visitor color preference. All content stays in the same server-rendered HTML. */
:root {
  color-scheme: light;
  --surface-soft:#edf3f7; --control-bg:#fff; --control-line:#bccbd6; --control-line-hover:#88b9d3;
  --hero-end:#f6f9fb; --hero-muted:#35576b; --avatar-ink:#244257; --topic-icon:#206c8d;
  --quote-ink:#294d65; --success-ink:#206c5d; --inline-code-bg:#edf3f6;
  --callout-bg:#eef6fa; --callout-line:#cee2ee;
  --button-bg:#142332; --button-ink:#fff; --button-hover:#0961c9; --button-hover-ink:#fff;
  --selection-bg:#b8f0f4; --selection-ink:#142332;
  --art-light-display:block; --art-dark-display:none;
  --switch-track:#dbe5ed; --switch-thumb:#fff; --switch-sun:#345168; --switch-moon:#526577;
}
html[data-color-scheme="dark"] {
  color-scheme:dark;
  --ink:#e2ebf4; --muted:#a1b3c5; --line:#2c4154; --paper:#0c1622; --wash:#111f2f;
  --blue:#80dce8; --cyan:#58dde5;
  --surface-soft:#142538; --control-bg:#132334; --control-line:#496277; --control-line-hover:#71acbd;
  --hero-end:#112638; --hero-muted:#a4c0d4; --avatar-ink:#badbe9; --topic-icon:#84d8e6;
  --quote-ink:#badbe9; --success-ink:#88dac2; --inline-code-bg:#203547;
  --callout-bg:#122e3e; --callout-line:#2a5367;
  --button-bg:#80dce8; --button-ink:#081c25; --button-hover:#abf0f4; --button-hover-ink:#081c25;
  --selection-bg:#174b61; --selection-ink:#e1f7fc;
  --art-light-display:none; --art-dark-display:block;
  --switch-track:#243d52; --switch-thumb:#80dce8; --switch-sun:#a1b3c5; --switch-moon:#081c25;
  --wp--preset--color--ink:#e2ebf4; --wp--preset--color--blue:#80dce8;
}
/* JS disabled or blocked: follow the device, with no ineffective switch shown. */
@media (prefers-color-scheme:dark) {
  html:not([data-color-scheme="light"]) {
    color-scheme:dark;
    --ink:#e2ebf4; --muted:#a1b3c5; --line:#2c4154; --paper:#0c1622; --wash:#111f2f;
    --blue:#80dce8; --cyan:#58dde5;
    --surface-soft:#142538; --control-bg:#132334; --control-line:#496277; --control-line-hover:#71acbd;
    --hero-end:#112638; --hero-muted:#a4c0d4; --avatar-ink:#badbe9; --topic-icon:#84d8e6;
    --quote-ink:#badbe9; --success-ink:#88dac2; --inline-code-bg:#203547;
    --callout-bg:#122e3e; --callout-line:#2a5367;
    --button-bg:#80dce8; --button-ink:#081c25; --button-hover:#abf0f4; --button-hover-ink:#081c25;
    --selection-bg:#174b61; --selection-ink:#e1f7fc;
    --art-light-display:none; --art-dark-display:block;
    --switch-track:#243d52; --switch-thumb:#80dce8; --switch-sun:#a1b3c5; --switch-moon:#081c25;
    --wp--preset--color--ink:#e2ebf4; --wp--preset--color--blue:#80dce8;
  }
}
/* Specificity also covers WordPress global body styles. */
html[data-color-scheme] body {background:var(--paper);color:var(--ink)}
@media (prefers-color-scheme:dark) {
  html:not([data-color-scheme="light"]) body {background:var(--paper);color:var(--ink)}
}
.header-actions {display:flex;align-items:center;gap:12px;flex-shrink:0}
.theme-toggle {display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:5px 9px;border:1px solid var(--line);border-radius:24px;color:var(--ink);background:var(--paper);line-height:1;white-space:nowrap}
.theme-toggle:hover {border-color:var(--control-line-hover)}
.theme-toggle-label {font-size:.67rem;font-weight:600;min-width:38px;text-align:left}
.theme-switch-track {position:relative;display:block;isolation:isolate;width:50px;height:26px;background:var(--switch-track);border-radius:15px;flex-shrink:0}
.theme-switch-thumb {position:absolute;inset:3px auto auto 3px;width:20px;height:20px;background:var(--switch-thumb);border-radius:50%;box-shadow:0 1px 3px #0002;transition:transform .18s}
.theme-toggle[aria-checked="true"] .theme-switch-thumb {transform:translateX(24px)}
.theme-sun,.theme-moon {position:absolute;top:5.5px;z-index:1;pointer-events:none}
.theme-sun {left:5.5px;color:var(--switch-sun)}
.theme-moon {right:5.5px;color:var(--switch-moon)}
.system-art-light {display:var(--art-light-display)}
.system-art-dark {display:var(--art-dark-display)}
.search-form input::placeholder,.comment-form input::placeholder,.comment-form textarea::placeholder {color:var(--muted);opacity:1}
.comment-form textarea,.comment-form input:not([type="submit"]),.post-password-form input[type="password"] {color:var(--ink);background:var(--control-bg)}
.entry-content .wp-block-table tr:nth-child(even) {background:var(--wash)}
.preview-badge {background:var(--paper)!important;color:var(--muted)!important;border-color:var(--line)!important}
@media (max-width:1100px) {
  .header-inner {gap:20px}
  .nav-list {gap:16px}
  .theme-toggle-label {display:none}
  .theme-toggle {padding:5px 7px}
}
@media (max-width:800px) {
  .header-actions {margin-left:auto;gap:8px}
  .menu-toggle:not([hidden]) {order:3;margin-left:0}
}
@media (max-width:560px) {
  .header-inner {gap:8px}
  .brand {font-size:1.32rem;gap:8px}
  .brand-mark {width:28px;height:28px;font-size:24px}
  .brand-mark span {font-size:22px}
  .header-actions {gap:6px}
  .theme-toggle {padding:4px;border:0;min-width:50px}
  .header-search {width:34px;height:34px}
  .menu-toggle:not([hidden]) {padding:8px 4px;min-width:30px;min-height:44px;justify-content:center}
  .menu-toggle>span:first-child {display:none}
}
@media (prefers-reduced-motion:reduce) {.theme-switch-thumb {transition:none}}
@media print {
  :root,html[data-color-scheme],html:not([data-color-scheme="light"]) {
    color-scheme:light;--ink:#000;--muted:#333;--paper:#fff;--wash:#fff;--line:#ccc;--blue:#000;
    --callout-bg:#fff;--callout-line:#ccc;--inline-code-bg:#eee;
  }
  .theme-toggle {display:none!important}
}
