/* Adaptive text is independent of invariant dark brand/code surfaces. */
:root {
  --body-text: #334155;
  --accent-text: #4d7c0f;
  --error-text: #b91c1c;
  --warning-text: #92400e;
}

/* Theme preference is shared across sibling Busbar sites by /theme.js. */
:root:root[data-theme='dark'] {
  color-scheme: dark;
  --slate: #e2e8f0;
  --charcoal: #cbd5e1;
  --body-text: #cbd5e1;
  --accent-text: #bef264;
  --limed: #bef264;
  --error-text: #fca5a5;
  --warning-text: #fbbf24;
  /* --ink remains the branded dark surface used by code and primary buttons. */
  --line: #334155;
  --muted: #a8b7ca;
  --muted-d: #cbd5e1;
  --bg: #0f172a;
  --bg-soft: #172337;
  --card: #1e293b;
  --highlight: #273449;
}
:root:root[data-theme='light'] { color-scheme: light; }
.busbar-theme-control { display: inline-flex; align-items: center; gap: 2px; margin-left: 12px; padding: 0; border: 0; border-radius: 6px; flex-shrink: 0; }
.busbar-theme-control button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.busbar-theme-control button:hover { background: var(--bg-soft, var(--sl-color-gray-6, #334155)); }
.busbar-theme-control button[aria-pressed="true"] { color: var(--slate, var(--sl-color-text, #e2e8f0)); background: var(--card, var(--sl-color-bg, #1e293b)); border-color: #65a30d; box-shadow: inset 0 0 0 1px #65a30d; }
.busbar-theme-control button:focus-visible { outline: 2px solid #65a30d; outline-offset: 2px; }
.busbar-theme-control svg { display: block; pointer-events: none; }
@media (pointer: coarse) { .busbar-theme-control button { width: 44px; height: 44px; } }
@media (max-width: 700px) { .busbar-theme-control { margin-left: auto; margin-right: 12px; } }


:root[data-theme="dark"] .nav-links a.nav-cta { color: #bef264; }

/* Small text must stay readable on the tinted light canvas and inset wells. */
:root:root[data-theme='light'] {
  --muted: #475569;
  --accent-text: #3f6212;
  --link: #3f6212;
  --limed: #3f6212;
}
