/* ============================================================
   public/css/kb-theme.css — light / dark tokens for the Knowledge Base form
   (auth-pages/knowledge-form.html). public/js/kb-theme.js sets <html data-mode>.

   Dark keeps the page's own :root tokens (the form's original look). Light is the
   dashboard's light palette: navy #0D1B2A text on white / #eef3f8, brand orange #F5A623
   for fills with dark ink on it, and deep amber #854F00 (--orange-fg) wherever orange
   is TEXT or an ICON (raw #F5A623 on white is 2:1).

   Contrast (WCAG AA, measured — test/kb/theme.test.js keeps the token pairs honest):
   text ≥ 4.5:1, large text and icons ≥ 3:1, in both themes.

   Loaded after the page's <style> (and before glass.css, which takes the light / dark
   glass recipe from the same data-mode). Every selector is html[data-mode=…] (0,1,1) so
   it wins over the page's :root / [data-mode] token blocks.
   ============================================================ */

/* ---------- shared names the glass layer, voice picker and dialogs read ---------- */
html{
  --accent:var(--orange); --accent-soft:var(--orange-soft); --accent-line:var(--orange-line); --accent-ink:#1a1206;
  --bg:var(--deep);
}
html[data-mode="dark"]{--raised:#0e2236; --amber-fg:#F5C75D}

/* ---------- LIGHT token set ---------- */
html[data-mode="light"]{
  color-scheme:light;
  /* surfaces */
  --deep:#eef3f8; --panel:#ffffff; --panel2:#f6f9fc; --raised:#ffffff;
  --field:#ffffff; --field2:#ffffff; --field-focus:#ffffff; --pop:#ffffff; --track:#D3DBE4;
  --line:#D3DBE4; --line-soft:#E2E8EE; --hover:rgba(13,27,42,.04);
  /* text */
  --text:#0D1B2A; --body:#2F4459; --muted:#566B80;
  /* brand + status, deepened so they read on white */
  --orange-soft:#FDEBCB; --orange-line:#E9B860; --orange-fg:#854F00;
  --amber:#DD9410; --amber-fg:#744A00;
  --green:#0B6C4E; --green-soft:#D3F0E3; --green-line:#84CDB0;
  --red:#A92A18; --red-soft:#FBDDD7; --red-line:#EBA193;
  --blue:#0A5D84; --blue-soft:#D5ECF8; --blue-line:#86C5E3;
  --violet:#5234B8; --violet-soft:#E8E2FD; --violet-line:#B7A8F0;
  /* chrome */
  --sb:rgba(13,27,42,.18); --sb-h:rgba(13,27,42,.36);
  --metal:repeating-linear-gradient(135deg,rgba(13,27,42,.016) 0 1px,transparent 1px 8px);
}

/* ---------- both themes: things that used a hard-coded colour ---------- */
.hint.hint-warn{color:var(--amber-fg)}
/* the current step's "Section 0N" line sits on the orange-tinted row: muted there is 3.6:1 on dark */
.side-item.active .si-text span{color:var(--body)}
/* Name + Mobile are always collected: chosen, not clickable, a little dimmed (.85 was 4.3:1 for the
   deep-amber label on light; .92 is 4.8:1) */
.trade-chip.always-on{opacity:.85}
html[data-mode="light"] .trade-chip.always-on{opacity:.92}

/* ---------- LIGHT only ---------- */
/* the progress track was the field colour — white on a white card */
html[data-mode="light"] .overall-track{background:var(--line-soft)}
html[data-mode="light"] .overall-fill{box-shadow:0 0 10px rgba(245,166,35,.35)}
/* white marks on the deep light-theme green / red / blue / violet fills */
html[data-mode="light"] .side-item.done .si-dot{color:#ffffff}
html[data-mode="light"] .exclude-chip.sel .check-badge{color:#ffffff}
html[data-mode="light"] :is(.tier-card.t1,.tier-card.t2,.tier-card.t3).sel .tc-radio::after{background:#ffffff}
/* the button row was a black tint — grey on white */
html[data-mode="light"] .step-actions{background:var(--panel2)}
/* navy shadows instead of black */
html[data-mode="light"] .form-shell{box-shadow:0 1px 2px rgba(13,27,42,.05),0 30px 70px -24px rgba(13,27,42,.30)}
html[data-mode="light"] :is(.suggest-panel,.select-panel){box-shadow:0 20px 50px -12px rgba(13,27,42,.28)}
/* a focus ring you can see on white */
html[data-mode="light"] :is(.field input:focus:not(.invalid),.field textarea:focus:not(.invalid),.chip-field:focus-within,.select-wrap.open .select-trigger){box-shadow:0 0 0 4px rgba(245,166,35,.26)}
/* native pickers + checkboxes in light chrome */
html[data-mode="light"] :is(.dt-wrap > input[type="time"],.dt-wrap > input[type="date"],.hours-row select,.hours-row input[type="time"]){color-scheme:light}
/* sliders sit on white / orange-soft: a deep-amber track, and a white edge + deep-amber ring on the
   orange thumb (raw orange on orange-soft is 1.8:1; the ring is 5:1) */
html[data-mode="light"] :is(.cq-range,.tq-range){background:#A47B40}
html[data-mode="light"] :is(.cq-range,.tq-range)::-webkit-slider-thumb{border-color:#ffffff; box-shadow:0 0 0 1px #854F00,0 2px 6px rgba(133,79,0,.35)}
html[data-mode="light"] :is(.cq-range,.tq-range)::-moz-range-thumb{border-color:#ffffff; box-shadow:0 0 0 1px #854F00}
/* ambient blobs: quieter on a light page */
html[data-mode="light"] .orb{opacity:.18}
html[data-mode="light"] .grid-bg{background-image:linear-gradient(rgba(13,27,42,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(13,27,42,.035) 1px,transparent 1px)}

/* voice picker (public/css/voice-picker.css reads the host tokens): the pending badge and the
   sound bars are text / indicator, so they take the deep amber; softer shadows on white */
html[data-mode="light"] .vp-root{--vp-amber:var(--amber-fg)}
html[data-mode="light"] .vp-root .vp-bars i{background:var(--orange-fg)}
html[data-mode="light"] .vp-root .vp-avatar{box-shadow:0 8px 20px -6px rgba(13,27,42,.30)}
html[data-mode="light"] .vp-root .vp-play{box-shadow:0 4px 10px rgba(13,27,42,.22)}
html[data-mode="light"] .vp-dialog{box-shadow:0 24px 60px rgba(13,27,42,.28)}
html[data-mode="light"] .vp-dialog-backdrop{background:rgba(13,27,42,.45)}
