/* zy-theme.css — the calm design system shared by every Zyentora app
   (Release B, 2026-10-21; Lakshay: "a shared calm system, each app keeps its
   own accent"). Wanderlight's language without Wanderlight's plum: soft tinted
   pages, white cards with hairline borders, 18 px corners, three quiet text
   tiers, two shadows, 44 px taps. Light is the default (zy-theme.js sets
   <html data-theme> before the first paint); dark is the same system at night.

   Each app maps its own variable names onto these --c-* tokens and adds its
   accent. Every text pair here passes WCAG AA on --c-bg, --c-surface and
   --c-surface2 (tests/theme-contrast.cjs measures the real pages). */

:root {
  --c-r-sm: 10px; --c-r: 14px; --c-r-lg: 18px; --c-r-full: 999px;
  --c-tap: 44px;
  --c-font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --c-serif: "Iowan Old Style", "Bookman Old Style", Georgia, "Times New Roman", serif;
  --c-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Roboto Mono", monospace;
}
html[data-theme="light"] {
  --c-bg: #F6F5F9; --c-bg2: #FBFAFD; --c-side: #FBFAFD;
  --c-surface: #FFFFFF; --c-surface2: #F1EFF6; --c-surface3: #E8E5F0; --c-hover: rgba(28, 22, 46, .05);
  --c-border: rgba(28, 22, 46, .10); --c-border2: rgba(28, 22, 46, .18);
  --c-field: #8A849A;              /* form-field edges: 3:1 on every surface */
  --c-t1: #1B1726; --c-t2: #4A4459; --c-t3: #5B556B;
  --c-overlay: rgba(24, 18, 40, .45);
  --c-shadow-1: 0 1px 2px rgba(28, 22, 46, .06), 0 1px 1px rgba(28, 22, 46, .04);
  --c-shadow-2: 0 24px 60px -24px rgba(28, 22, 46, .38);
  /* status, as text (AA) and as fills */
  --c-good-t: #0B7A4E; --c-bad-t: #B4233C; --c-warn-t: #8A5A00; --c-info-t: #5440B8;
  --c-good: #12A06A; --c-bad: #DC3A55; --c-warn: #E2A336; --c-info: #7B63D6;
  --c-good-bg: rgba(18, 160, 106, .12); --c-bad-bg: rgba(220, 58, 85, .10); --c-warn-bg: rgba(226, 163, 54, .16); --c-info-bg: rgba(123, 99, 214, .12);
  color-scheme: light;
}
html[data-theme="dark"] {
  --c-bg: #15131C; --c-bg2: #1A1822; --c-side: #18161F;
  --c-surface: #211E2B; --c-surface2: #2A2736; --c-surface3: #343042; --c-hover: rgba(255, 255, 255, .06);
  --c-border: rgba(255, 255, 255, .10); --c-border2: rgba(255, 255, 255, .18);
  --c-field: #7E7892;
  --c-t1: #F2F0F7; --c-t2: #C8C4D6; --c-t3: #ADA8BF;
  --c-overlay: rgba(6, 4, 12, .72);
  --c-shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --c-shadow-2: 0 30px 80px -20px rgba(0, 0, 0, .65);
  --c-good-t: #5BD6A4; --c-bad-t: #FF8A9C; --c-warn-t: #F2C36B; --c-info-t: #B9A8FF;
  --c-good: #2FBF85; --c-bad: #F0566F; --c-warn: #E8AE47; --c-info: #9580F0;
  --c-good-bg: rgba(47, 191, 133, .14); --c-bad-bg: rgba(240, 86, 111, .14); --c-warn-bg: rgba(232, 174, 71, .14); --c-info-bg: rgba(149, 128, 240, .16);
  color-scheme: dark;
}

/* The shared frame (zy-shell.css) reads these: the overlay and shadows follow the theme. */
html { --zy-overlay: var(--c-overlay); --zy-shadow: var(--c-shadow-2); --zy-field: var(--c-field);
  --zy-ok-text: var(--c-good-t); --zy-danger-text: var(--c-bad-t); --zy-warn-text: var(--c-warn-t); }
html[data-theme="light"] { --zy-on-danger: #FFFFFF; }
html[data-theme="dark"] { --zy-on-danger: #1B0A0F; }

/* ---------- the "Dark mode" switch (zy-theme.js mount) ---------- */
.zy-theme-switch {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--c-tap);
  padding: 0 12px; border: 1px solid var(--zy-border); border-radius: var(--c-r);
  background: transparent; color: var(--zy-text); font: 500 14px/1.2 var(--zy-font, var(--c-font)); cursor: pointer; text-align: left;
}
.zy-theme-switch:hover { background: var(--c-hover); }
.zy-theme-switch:focus-visible { outline: 2px solid var(--zy-accent); outline-offset: 2px; }
.zy-theme-icon { display: inline-flex; color: var(--zy-muted); }
.zy-theme-label { flex: 1; }
.zy-theme-track {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px;
  background: var(--c-surface3); border: 1px solid var(--c-field); transition: background .2s;
}
.zy-theme-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-surface); color: var(--c-t2); box-shadow: var(--c-shadow-1); transition: transform .2s;
}
.zy-theme-thumb svg { width: 12px; height: 12px; }
.zy-theme-switch[aria-checked="true"] .zy-theme-track { background: var(--zy-accent); border-color: var(--zy-accent); }
.zy-theme-switch[aria-checked="true"] .zy-theme-thumb { transform: translateX(18px); }
.zy-theme-slot { margin: 8px 0; }
@media (prefers-reduced-motion: reduce) { .zy-theme-track, .zy-theme-thumb { transition: none; } }
