:root{color-scheme:light;--toggle-bg:#fffefa;--toggle-hover:#f1f1e9}
:root[data-theme="dark"]{color-scheme:dark;--paper:#20221e;--ink:#eeeee5;--muted:#adb0a3;--line:#42463b;--accent:#bbc59c;--toggle-bg:#2b2e27;--toggle-hover:#383d31}
[data-theme="dark"] nav{background:var(--toggle-bg);box-shadow:0 5px 18px #0003}
[data-theme="dark"] nav a{color:#bec2b3}
[data-theme="dark"] nav a:hover{background:var(--toggle-hover);color:var(--ink)}
[data-theme="dark"] nav a[aria-current="page"]{background:var(--nav-accent);color:#000}
[data-theme="dark"] h1 em{color:var(--accent)}
[data-theme="dark"] .intro{color:#c9cdbe}
[data-theme="dark"] :is(.eyebrow,.body-copy,.draft-note,.index,.entries p,.pending,.role,footer){color:var(--muted)}
[data-theme="dark"] .text-link{border-color:#7e876d}
[data-theme="dark"] :is(input,textarea){border-color:#727a65}
[data-theme="dark"] :is(input,textarea):focus{border-color:var(--accent)}
[data-theme="dark"] ::placeholder{color:#a5ac99}
.theme-toggle{position:fixed;left:max(40px,env(safe-area-inset-left));bottom:max(24px,env(safe-area-inset-bottom));z-index:10;width:48px;height:48px;display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--toggle-bg);color:var(--ink);box-shadow:0 4px 16px #00000012;cursor:pointer;touch-action:manipulation}
.theme-toggle:hover{background:var(--toggle-hover)}
.theme-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .sun{display:none}
[data-theme="dark"] .theme-toggle .moon{display:none}
[data-theme="dark"] .theme-toggle .sun{display:block}
@media(max-width:760px){.theme-toggle{left:max(20px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom))}}
/* Leave the fixed switch clear of the navigation on short screens. */
@media(min-width:761px) and (max-height:540px){nav{max-height:calc(100dvh - 110px);overflow-y:auto;top:12px;transform:none}}
