/* Color palettes: image pixels and artwork presentation remain independent of the page theme. */
:root {
  color-scheme: dark;
  --surface-soft:#1b1e1b;
  --surface-input:#1f241e;
  --surface-placeholder:#1a1e19;
  --placeholder-line:#495041;
  --tag-text:#b8c0b2;
  --nav-text:#c2c7be;
  --lead-text:#c9d0c1;
  --banner-bg:#252d20;
  --disabled-bg:#292f25;
  --disabled-text:#a4ae98;
  --disabled-line:#414939;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg:#f3f2ec;
  --panel:#e8ebe1;
  --text:#252c23;
  --muted:#62695c;
  --line:#cdd2c6;
  --accent:#4d652e;
  --surface-soft:#e8ebe1;
  --surface-input:#fafbf6;
  --surface-placeholder:#eceee5;
  --placeholder-line:#adb7a0;
  --tag-text:#54614c;
  --nav-text:#545e4e;
  --lead-text:#485441;
  --banner-bg:#e1e8d5;
  --disabled-bg:#e1e5d9;
  --disabled-text:#69745d;
  --disabled-line:#b7c0aa;
}
nav a { color:var(--nav-text); }
.tags span { color:var(--tag-text); }
.study-band { background:var(--surface-soft); }
.article-lead { color:var(--lead-text); }
.search input { background:var(--surface-input); }
.search input::placeholder { color:var(--muted); }
.placeholder { background:var(--surface-placeholder); border-color:var(--placeholder-line); }
.draft-banner { background:var(--banner-bg); }
.button:disabled { background:var(--disabled-bg); color:var(--disabled-text); border-color:var(--disabled-line); }
.file-icon { border-color:var(--placeholder-line); }
.note-number, footer>div span { color:var(--muted); }
.tab-dot { border-color:var(--muted); }

/* Text over photographs always retains its dark image treatment. */
.hero-link { color:#eceee7; }
.hero-top .status { color:#c4d39c; }
.hero-top .status i { background:#c4d39c; }
.study-index { color:#eceee7; }
dialog { color:#eceee7; --accent:#c4d39c; --line:#414939; color-scheme:dark; }

:root[data-theme="light"] .bridge-placeholder { background:linear-gradient(135deg,#e3e8da,#d6dfca); }
:root[data-theme="light"] .bridge-placeholder svg { stroke:#6a8054; }
:root[data-theme="light"] .bridge-placeholder>span:last-child { color:#4c5e3d; }
:root[data-theme="light"] .ghost-number { color:#3e57240c; }

.theme-control { flex-shrink:0; }
.theme-switch { display:flex; border:1px solid var(--line); padding:3px; gap:2px; }
.theme-switch button { border:0; background:transparent; color:var(--muted); font-size:11px; line-height:1.4; min-height:30px; padding:7px 10px; white-space:nowrap; }
.theme-switch button:hover { color:var(--text); background:var(--panel); }
.theme-switch button[aria-pressed="true"] { background:var(--accent); color:var(--bg); }
.theme-switch button:focus-visible { outline-offset:1px; }
.visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; padding:0; border:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (max-width:1240px) { .brand-caption { display:none; } }
@media (min-width:741px) and (max-width:950px) {
  .site-header { gap:16px; padding-inline:24px; }
  .site-header nav { gap:18px; }
  .site-header .brand { font-size:17px; }
  .theme-switch button { padding-inline:8px; }
}
@media (max-width:740px) {
  .site-header { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px 8px; }
  .site-header .brand { grid-column:1; grid-row:1; }
  .theme-control { grid-column:2; grid-row:1; }
  .site-header nav { grid-column:1 / -1; grid-row:2; }
  .theme-switch { gap:0; padding:2px; }
  .theme-switch button { min-height:34px; padding:7px 8px; font-size:10px; }
}
@media (max-width:400px) {
  .site-header .brand { font-size:15px; letter-spacing:.7px; }
  .site-header .brand-mark { width:24px; height:26px; line-height:26px; margin-right:8px; font-size:21px; }
  .theme-switch button { padding-inline:7px; }
}
