/* Light / dark mode — shared by every page the interface serves.

   Each page keeps its own dark palette in an inline `:root`. theme.js stamps
   `wiki-light` on <html> (before first paint) and this file redefines the
   palette under it, so everything drawn from the vars flips at once. Rules
   for colors a page hardcodes live in that page's own <style>, next to the
   dark rule they override.

   `html.wiki-light` outranks a bare `:root`, so load order doesn't matter. */
html.wiki-light {
  --bg: #f7f7f4; --panel: #ffffff; --panel-2: #f0f0ec;
  --border: #e2e2dc; --border-hi: #9a9a92;
  --text: #16161a; --dim: #6a6a74; --accent: #2f5fd0; --link: #2f5fd0;
  --green: #1f7a4d; --yellow: #a9631a; --red: #c0392b; --purple: #6b4fa0;
  --leaf: #a9631a; --internal: #6b4fa0; --root: #2f5fd0; --agent: #1f7a4d;
  color-scheme: light;
}

/* The toggle (injected by theme.js). In a sidebar it sits above the stats;
   on pages without one it floats in the bottom-right corner. */
.wiki-light-toggle {
  padding: 8px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font: inherit; font-size: 12px; cursor: pointer; text-align: left;
  white-space: nowrap; transition: border-color .12s, background .12s;
}
.wiki-light-toggle:hover { border-color: var(--accent); }
.sidebar .wiki-light-toggle { margin: auto 8px 8px; }
.sidebar .wiki-light-toggle + .sidebar-bottom { margin-top: 0; }
#app.sidebar-collapsed .sidebar .wiki-light-toggle { display: none; }
.wiki-light-toggle.floating {
  position: fixed; right: 14px; bottom: 14px; z-index: 90;
  background: var(--panel, #0c0c12); color: var(--dim, #6a6a78);
  border-color: var(--border, var(--line, #1d1d28));
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0; text-transform: none;
}
.wiki-light-toggle.floating:hover { color: var(--text); }
