:root {
  color-scheme: light;
  --bg:#faf9f6; --paper:#f0efeb; --ink:#20231f; --muted:#71746a;
  --line:#dedfd7; --accent:#495a3b; --surface:#fafaf7;
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --bg:#181b19; --paper:#212522; --surface:#272c28; --ink:#eeeee7;
  --muted:#adb4a8; --line:#3d463e; --accent:#bfcca9;
}
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
  width:44px; height:44px; padding:0; border:1px solid var(--line); border-radius:50%;
  background:transparent; color:var(--ink); cursor:pointer; }
.theme-toggle:hover { background:var(--paper); }
.theme-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.theme-picker { position:relative; flex-shrink:0; }
.theme-picker summary { list-style:none; }
.theme-picker summary::-webkit-details-marker { display:none; }
.theme-options { position:absolute; right:0; top:calc(100% + 10px); z-index:60; width:208px; padding:6px;
  background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:14px; box-shadow:0 12px 35px #0003; }
.theme-options button { display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; min-height:44px; padding:10px 12px; background:transparent; border:0; border-radius:8px;
  font:inherit; font-size:13px; text-align:left; color:var(--ink); cursor:pointer; }
.theme-options button:hover,.theme-options button[aria-pressed="true"] { background:var(--paper); }
.theme-options button[aria-pressed="true"]::after { content:'✓'; color:var(--accent); }
.theme-options button:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.theme-sun, [data-theme="dark"] .theme-moon { display:none; }
[data-theme="dark"] .theme-sun { display:block; }
.nav-wrap { gap:22px; }
.nav-wrap nav { margin-left:auto; }
.nav-wrap > .theme-picker { order:2; }
.nav-wrap > .menu-toggle { order:3; }
@media (min-width:701px) and (max-width:1100px) {
  .nav-wrap { gap:14px; width:calc(100% - 40px); }
  .nav-wrap nav { gap:15px; font-size:12px; }
  .nav-wrap .nav-login { margin-left:0; padding-left:14px; }
  .nav-wrap .wordmark { font-size:22px; }
}
@media(max-width:700px) {
  .nav-wrap { gap:12px; }
  .nav-wrap > .theme-picker { margin-left:auto; }
  .nav-wrap > .menu-toggle { width:36px; flex-shrink:0; }
}
/* Photograph pixels stay unchanged; only the surrounding interface changes. */
[data-theme="dark"] .site-header { background:rgba(24,27,25,.95); }
[data-theme="dark"] :is(.stage-label,.stage-ribbon) { background:#293329; color:#c0cdb4; }
[data-theme="dark"] :is(.stage-note,.hero-side p,.editor-note,.footer-bottom,.card-bottom>span:first-child,.preview-top,.mini-nav,.module-number,.module-plus) { color:var(--muted); }
[data-theme="dark"] h1 span { color:#b0bca7; }
[data-theme="dark"] :is(.wordmark-dot,.status-dot) { color:#b0bca7; }
[data-theme="dark"] .status-dot { background:#b0bca7; }
[data-theme="dark"] .product-card { background:var(--surface); border-color:var(--line); }
[data-theme="dark"] .product-card:hover { box-shadow:0 15px 35px #0003; }
[data-theme="dark"] .button.dark,
[data-theme="dark"] .filters button.selected { background:#c2cfb4; color:#1e281d; border-color:#c2cfb4; }
[data-theme="dark"] .button:hover { background:#333d32; }
[data-theme="dark"] .button.dark:hover { background:#d4dec9; }
[data-theme="dark"] .image-arrow { background:rgba(28,34,28,.94); color:#eef2e8; }
[data-theme="dark"] :is(.preview-frame,.persona-panel) { background:#252d26; }
[data-theme="dark"] :is(.mini-platform,.small-button,.skip) { background:var(--bg); color:var(--ink); border-color:var(--line); }
[data-theme="dark"] :is(.mini-platform aside,.mini-task,.pill,.learning-card) { background:#2c352a; border-color:#46513f; }
[data-theme="dark"] .pill { color:#c1cfb2; }
[data-theme="dark"] .mini-nav { border-color:var(--line); }
[data-theme="dark"] .learning-card.locked { background:var(--paper); border-color:var(--line); }
[data-theme="dark"] .gallery-photo:first-child img { background:var(--paper); }
[data-theme="dark"] .return-product { background:#c2cfb4; color:#1e281d; }
[data-theme="dark"] .symbol-blog i { border-color:#829675; background:#394933; box-shadow:5px 5px 0 #12181266; }
[data-theme="dark"] .symbol-blog i:nth-child(2) { background:#526746; }
[data-theme="dark"] .symbol-blog i:nth-child(3) { background:repeating-linear-gradient(#465b3e 0px,#465b3e 12px,#90a37e 13px,#465b3e 14px); }
[data-theme="dark"] .symbol-clients i { border-color:#b3a27b; background:#6d614c80; }
[data-theme="dark"] .symbol-product i { border-color:#77918b; background:#3c5350; }
[data-theme="dark"] .symbol-product i:nth-child(1) { background:#30443f; }
[data-theme="dark"] .symbol-product i:nth-child(2) { background:#49645c; }
[data-theme="dark"] .symbol-product i:nth-child(3) { background:#637e72; }
/* The platform uses the same preference and palette as the author site. */
.platform-theme-bar { height:48px; display:flex; align-items:center; justify-content:space-between;
  padding:0 16px; background:var(--paper); border-bottom:1px solid var(--line); color:var(--ink); font-size:12px; }
.platform-theme-bar + #app,
.platform-theme-bar + #app .h-screen,
.platform-theme-bar + #app .lesson-main { height:calc(100dvh - 48px); }
.stage-ribbon + .platform-theme-bar + #app,
.stage-ribbon + .platform-theme-bar + #app .h-screen,
.stage-ribbon + .platform-theme-bar + #app .lesson-main { height:calc(100dvh - 78px); }
/* Anchor lesson controls below the theme bar, including on mobile. */
.platform-view .lesson-main > .mobile-topbar { position:absolute; }
[data-theme="dark"] .platform-view { background:var(--bg); color:var(--ink); }
[data-theme="dark"] .platform-view :is(.lesson-main,.cabinet-main,.bg-cream) { background:var(--bg); }
[data-theme="dark"] .platform-view :is(.bg-canvas,.bg-white,.field,.btn-secondary,.tb-pub,.toc-drawer,.profile-popover,.lib-modal,.modal,.combo-panel,.callout-task,.file-card,.lib-card,.lib-search) { background:var(--surface); color:var(--ink); border-color:var(--line); }
[data-theme="dark"] .platform-view :is(.text-ink,.lesson-prose,.lesson-prose h1,.lesson-prose h2,.lesson-prose h3,.lesson-prose strong,.section-link,.file-card-name,.profile-popover a,.modal-label,.combo-option,.dlg-label,.dlg-toggle-t,.lib-search input,.seg-tab.is-active) { color:var(--ink); }
[data-theme="dark"] .platform-view :is(.text-muted,.text-slate,.text-stone,.toc,.toc a,.lib-card__sum,.lib-card__meta,.lib-card__slug,.lib-detail__meta,.lib-empty) { color:var(--muted); }
[data-theme="dark"] .platform-view :is(.lesson-prose a:not([class]),.lesson-prose .rate-edit,.toc a.active) { color:var(--accent); }
[data-theme="dark"] .platform-view :is(.tb-ghost,.mobile-topbar,.lesson-prose blockquote) { background:var(--paper); color:var(--ink); border-color:var(--line); }
[data-theme="dark"] .platform-view :is(.lesson-prose hr,.lesson-prose td,.lesson-prose th,.modal-head) { border-color:var(--line); }
[data-theme="dark"] .platform-view :is(.lesson-prose th,.lesson-prose tr:nth-child(even) td,.lesson-prose code,.callout-info,.file-card:hover,.profile-popover a:hover) { background:var(--paper); color:var(--ink); border-color:var(--line); }
[data-theme="dark"] .platform-view .lesson-prose :is(.rate-block,.rate-btn,.rate-text) { background:var(--surface); color:var(--ink); border-color:var(--line); }
[data-theme="dark"] .platform-view .lesson-prose :is(.rate-title,.rate-done) { color:var(--ink); }
[data-theme="dark"] .platform-view .lesson-prose :is(.rate-sub,.rate-done-sub) { color:var(--muted); }
[data-theme="dark"] .platform-view .lesson-prose .rate-btn.active { background:var(--accent); color:var(--bg); }
[data-theme="dark"] .platform-view :is(.btn-primary,.rate-next,.rate-submit) { background:#495a3b; color:#fff; }
