/* Shared appearance control. Existing light-mode styles remain the default. */
:root { color-scheme: light; }
.theme-toggle { display:inline-grid; place-items:center; width:40px; height:40px; flex:0 0 40px; padding:0; border:1px solid var(--line); border-radius:50%; background:transparent; color:var(--navy); cursor:pointer; }
.theme-toggle[hidden] { display:none; }
.theme-toggle svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.theme-toggle:hover { background:#edf1f2; }
.theme-toggle:focus-visible { outline:3px solid #587b91; outline-offset:3px; }
.theme-toggle .icon-sun { display:none; }
@media (max-width:1000px) {
  .header > .identity { order:0; }
  .header > .theme-toggle { order:1; }
  .header > nav { order:2; }
}
@media (max-width:380px) {
  .header { gap:12px; }
  .header .wordmark strong { font-size:20px; }
  .header .wordmark > span { font-size:9px; letter-spacing:.06em; }
  .header .emblem { width:34px; }
  .header .identity { gap:8px; }
  .header .wordmark { gap:6px; }
}
html[data-theme="dark"] { color-scheme:dark; --navy:#e5edf2; --steel:#b2cddd; --slate:#c3cfd5; --paper:#12212d; --line:#4c6270; --white:#192d3b; }
html[data-theme="dark"] header, html[data-theme="dark"] footer { background:#192d3b; }
html[data-theme="dark"] .emblem { background:#e6eef2; border-radius:3px; }
html[data-theme="dark"] .theme-toggle:hover, html[data-theme="dark"] .share-actions a:hover, html[data-theme="dark"] .share-actions button:hover { background:#304959; }
html[data-theme="dark"] .theme-toggle .icon-sun { display:block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display:none; }
html[data-theme="dark"] .theme-toggle:focus-visible, html[data-theme="dark"] a:focus-visible, html[data-theme="dark"] button:focus-visible, html[data-theme="dark"] input:focus-visible { outline-color:#a6c8dc; }
html[data-theme="dark"] .button { background:#c4dbe6; color:#10212d; }
html[data-theme="dark"] .button:hover { background:#e5f1f6; }
html[data-theme="dark"] .skip { background:#e5edf2; color:#10212d; }
html[data-theme="dark"] .insights, html[data-theme="dark"] .supply, html[data-theme="dark"] .evidence { background:#203746; border-color:var(--line); }
html[data-theme="dark"] .evidence { box-shadow:7px 7px 0 #283f4c; }
html[data-theme="dark"] .note-top, html[data-theme="dark"] .note-bottom { color:#c3cfd5; border-color:var(--line); }
html[data-theme="dark"] .orbit b { background:#c4dbe6; color:#10212d; }
html[data-theme="dark"] .approach { background:#1a303e; color:#e5edf2; }
html[data-theme="dark"] .contact { background:#203b4c; }
html[data-theme="dark"] .manual-copy input, html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { color:#e5edf2; background:#1c303e; border-color:#7692a1; }

/* Navy framing for the site's light theme; retain the existing page background. */
html:not([data-theme="dark"]) header, html:not([data-theme="dark"]) footer { background:#152c3b; color:#f0f5f7; }
html:not([data-theme="dark"]) header { border-color:#4c6270; }
html:not([data-theme="dark"]) header nav { border-color:#4c6270; }
html:not([data-theme="dark"]) header nav a:hover { color:#d2e5ef; }
html:not([data-theme="dark"]) header .theme-toggle { color:#f0f5f7; border-color:#8da8b6; }
html:not([data-theme="dark"]) header .theme-toggle:hover { background:#304959; }
html:not([data-theme="dark"]) header .theme-toggle:focus-visible, html:not([data-theme="dark"]) header a:focus-visible, html:not([data-theme="dark"]) footer a:focus-visible { outline-color:#b5d7e8; }
html:not([data-theme="dark"]) footer p, html:not([data-theme="dark"]) .brand-tag { color:#d2dfe5; }
html[data-theme="dark"] .emblem { background:transparent; border-radius:0; }
header .emblem img { filter:drop-shadow(1px 0 0 #dceaf2) drop-shadow(-1px 0 0 #dceaf2); }

/* Discreet sitewide appearance choice in the footer. */
.footer-appearance[hidden]{display:none}
.footer-appearance{display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin-top:22px;padding-top:14px;border-top:1px solid var(--line);font-size:12px;color:inherit}
.footer-appearance-label{font-weight:600;margin-right:10px}
.footer-appearance button{font:inherit;color:inherit;background:transparent;border:0;padding:6px 5px;cursor:pointer;opacity:.8}
.footer-appearance button[aria-pressed="true"]{font-weight:700;text-decoration:underline;text-underline-offset:4px;opacity:1}
.footer-appearance button:hover{opacity:1;text-decoration:underline;text-underline-offset:4px}
.footer-appearance button:focus-visible{outline:2px solid currentColor;outline-offset:2px}
@media(max-width:600px){.footer-appearance{margin-top:16px;padding-top:12px}}
