:root { color-scheme: light; }
[data-theme=light] .direct-flow, [data-theme=light] .docs-content { background: var(--white); }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  flex-shrink: 0;
}
.theme-toggle svg { width: 24px; height: 28px; padding: 3px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; border-radius: 50%; }
[data-theme=light] .theme-sun, [data-theme=dark] .theme-moon { color: var(--forest); background: var(--lime-pale); }
.theme-toggle:hover { border-color: var(--lime); }
/* Keep all controls in the mobile header without shrinking their touch areas. */
@media (max-width: 479px) {
  .site-header .header-inner { row-gap: 2px; }
  .site-header .header-controls { margin-left: auto; }
  .site-header .wordmark { font-size: 1.35rem; letter-spacing: -1px; }
  .site-header .brand { gap: 5px; }
  .site-header .brand img { width: 30px; height: 30px; }
  .site-header .language { padding-inline: 5px; gap: 3px; }
}
@media (max-width: 359px) {
  .site-header .header-inner { padding-block: 8px; }
  .site-header .brand { flex: 1 0 100%; }
}
[data-theme=dark] {
  color-scheme: dark;
  --forest: #e5f2eb;
  --lime: #a2d86b;
  --paper: #101a17;
  --white: #1a2923;
  --border: #3c5047;
  --muted: #b6c8bd;
  --lime-pale: #263e25;
  --turquoise-pale: #173c37;
  --coral-pale: #422c29;
  --honey-pale: #3c341c;
  --wordmark-forest: #e5f2eb;
  --wordmark-green: #a2d86b;
}
[data-theme=dark] :focus-visible { outline-color: #a2d86b; }
[data-theme=dark] h1 em { color: #a2d86b; }
[data-theme=dark] .button-lime, [data-theme=dark] .primary { background: #a2d86b; color: #183d35; border-color: #a2d86b; }
[data-theme=dark] .primary:hover, [data-theme=dark] .button-lime:hover { background: #b6e58a; }
[data-theme=dark] input:not([type=color]):not([type=checkbox]), [data-theme=dark] textarea, [data-theme=dark] select { color: var(--forest); background: #14211b; border-color: var(--border); }
[data-theme=dark] input::placeholder, [data-theme=dark] textarea::placeholder { color: #95a89b; }
[data-theme=dark] .type-switch button { color: var(--muted); background: #14211b; }
[data-theme=dark] .type-switch button[aria-pressed=true] { color: var(--forest); background: var(--lime-pale); }
[data-theme=dark] .hero-benefits li { color: #d3eac4; background: var(--lime-pale); border-color: #48673b; }
[data-theme=dark] .hero-benefits .icon, [data-theme=dark] .independence .icon, [data-theme=dark] .live, [data-theme=dark] .learn-intro .eyebrow, [data-theme=dark] .faq-intro .eyebrow { color: #b2db92; }
[data-theme=dark] .utm-toggle { background: var(--turquoise-pale); border-color: #355e54; }
[data-theme=dark] .utm-help, [data-theme=dark] .utm-quick-example strong { color: #86ddd0; }
[data-theme=dark] .switch::after { background: #fff; }
[data-theme=dark] .switch:checked::before { background: #5c9634; }
[data-theme=dark] .quality { color: #b2db92; }
[data-theme=dark] .quality.warning, [data-theme=dark] #error { color: #ffb3a5; }
[data-theme=dark] .free-tag { background: var(--lime-pale); color: #c5e7a9; }
[data-theme=dark] .step { background: var(--lime-pale); color: #c5e7a9; }
[data-theme=dark] .tone-lime { --tone-strong: #344e2c; --tone-ink: #c5e7a9; }
[data-theme=dark] .tone-turquoise { --tone-strong: #24554d; --tone-ink: #a1e7db; }
[data-theme=dark] .tone-coral { --tone-strong: #633d36; --tone-ink: #ffc5b9; }
[data-theme=dark] .tone-honey { --tone-strong: #58471d; --tone-ink: #ffe3a0; }
[data-theme=dark] .control-mobile-layout { background: #071b13; border-color: var(--border); }
[data-theme=dark] .control-banner-copy .eyebrow { color: #c5e7a9; }
[data-theme=dark] .control-mobile-cta { background: #a2d86b; color: #183d35; border-color: #a2d86b; }
[data-theme=dark] .faq-guide { border-color: #48673b; }
[data-theme=dark] .faq-guide:hover { background: #344e2c; }
[data-theme=dark] .main-nav :is(a, button):hover, [data-theme=dark] .footer-links a:hover { color: #b2db92; }
[data-theme=dark] .toast { background: #e5f2eb; color: #14211b; }
[data-theme=dark] .encoded { background: #14211b; border-color: var(--border); }
[data-theme=dark] .color-control, [data-theme=dark] .secondary { border-color: var(--border); }
[data-theme=dark] .primary:hover:enabled { background: #b6e58a; }
[data-theme=dark] .category-button:hover { background: #27382e; }
[data-theme=dark] .comparison-redirect { background: #25322f; }
[data-theme=dark] .comparison-card .eyebrow { background: #3c4a46; color: var(--forest); }
[data-theme=dark] .comparison-direct .eyebrow { background: #3b592d; }
[data-theme=dark] .docs-content { background: var(--white); }
[data-theme=dark] .docs-art-orbit { background: #30452a; }
[data-theme=dark] .paper-line { background: #3c5047; }
[data-theme=dark] .paper-point .icon { color: #c5e7a9; }
/* Brand illustrations and the functional QR retain their original colors. */
[data-theme=dark] .qr-stage { background: #fbfcf9; color-scheme: light; }
[data-theme=dark] input[type=color] { color-scheme: light; }
