/* A quiet header control, with room for both touch targets on narrow phones. */
.mast-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:1;min-width:0}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex-shrink:0;border:1px solid #3a4553;border-radius:6px;background:transparent;color:var(--on-night);padding:10px}
.theme-toggle:hover{background:var(--night-2)}
.theme-toggle svg,.search-link svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.theme-sun{display:none}
[data-theme=dark] .theme-moon{display:none}
[data-theme=dark] .theme-sun{display:block}
.public-edition .theme-toggle{color:var(--ink);border-color:var(--line-strong)}
.public-edition .theme-toggle:hover{background:var(--paper-2)}
.public-edition .brand::before{content:none}
.brand-mark{width:46px;height:46px;border-radius:50%;flex-shrink:0}
@media(max-width:760px){
  .mast,.public-edition .mast{gap:8px}
  .mast-tools{flex:0 0 auto;gap:4px}
  .search-link,.public-edition .search-link{width:44px;height:44px;justify-content:center;padding:10px}
  .brand-mark{width:34px;height:34px}
}
@media(max-width:360px){
  .public-edition .brand{font-size:24px;gap:6px}
  .brand-mark{width:26px;height:26px}
  body:not(.public-edition) .brand{white-space:normal;max-width:170px;line-height:1.5}
}

/* Screen-only overrides keep the existing light print edition intact.
   Collection plate colours stay unchanged; their pale inks become reading links. */
@media screen{
  :root[data-theme=dark]{color-scheme:dark;--paper:#181621;--scroll-thumb:#82768f;--scroll-thumb-hover:#a295b1;--scroll-thumb-active:#c2b3d1;scrollbar-color:var(--scroll-thumb) var(--paper)}
  [data-theme=dark] body{
    --paper:#181621;--paper-2:#221f2e;--white:#272332;
    --ink:#ede9f5;--ink-soft:#c5bfd3;--muted:#aaa2bd;
    --line:#40394f;--line-strong:#71657f;--focus:#c2a2ff;
    --night:#13111b;--night-2:#221f2e;--on-night:#ede9f5;--on-night-muted:#aaa2bd;
  }
  [data-theme=dark] :is(.col-cabinet,.col-strange-places,.col-mind-perception,.col-belief-meaning,.col-machines-futures,.col-other-realities){--accent:var(--bright);--tint:var(--deep)}
  [data-theme=dark] .col-cabinet{--accent:#c9b5ed;--tint:#30283e}
  [data-theme=dark] .public-edition .quick-links a[aria-current]{background:var(--paper-2);box-shadow:inset 0 -2px #c9b5ed}
  [data-theme=dark] .public-edition.home-page .hero{background:#30283e;border-color:var(--line)}
  [data-theme=dark] .public-edition.home-page .hero :is(.eyebrow,.hero-meta),
  [data-theme=dark] .public-edition.home-page .hero .actions a{color:#c9b5ed}
  [data-theme=dark] .public-edition.home-page .daily-tile:first-child .daily-picture{background:var(--paper-2)}
  [data-theme=dark] .archive-photo img,[data-theme=dark] .hero-search input{background:var(--paper-2)}
  [data-theme=dark] .directory-links a:first-child{color:var(--deep)}
  [data-theme=dark] .chip[aria-pressed=true]:not([class*=col-]){color:var(--paper)}
  [data-theme=dark] .connection-type,[data-theme=dark] .overlap-feature{background:#30243b;border-color:#675074;color:#dbb3e6}
  [data-theme=dark] :is(.overlap-feature h2,.overlap-backlinks h2){color:var(--ink)}
  [data-theme=dark] :is(.quick-links .overlaps-link,.overlap-subjects>span,.overlap-subjects a,.overlap-feature .eyebrow,.overlap-feature .editorial-art figcaption,.overlap-feature .feature-link,.overlap-backlinks a){color:#dbb3e6}
  [data-theme=dark] .overlap-backlinks li{border-color:#675074}
  [data-theme=dark] .website-feature,[data-theme=dark] .public-edition.home-page .website-feature{background:#17332e;border-color:#466c5f;color:var(--ink)}
  [data-theme=dark] .website-feature h2,[data-theme=dark] .public-edition.home-page .website-feature h2{color:var(--ink)}
  [data-theme=dark] .website-feature .eyebrow,[data-theme=dark] .website-feature .reading-links a{color:#8fd8c6}
}
