/* KW Diagnostics design tokens. Loaded first on every workshop page.
   Night is the default. Day (html.theme-light) and Pink (html.theme-pink, which also
   has theme-light) only swap these values. Seasonal themes set their own --dp-* / --c-*
   later, on html.season-*, and those still win.
   The old --l-*, --c-*, --dp-*, --ml-*, --sn-* and --wn-* names are aliases of these
   tokens so existing sheets keep working. */

:root {
  --bg: #000000;
  --surface: #16161A;
  --surface-2: #1C1C21;
  --surface-3: #222228;
  --border: #2C2C33;
  --border-strong: #3A3A42;
  --text: #F4F4F5;
  --text-2: #A1A1AA;
  --text-3: #71717A;
  --accent: #FFD700;
  --accent-text: #FFD700;
  --accent-fg: #1A1500;
  --accent-grad: linear-gradient(135deg, #D4AF37, #FFD700, #B8860B);
  --accent-soft: rgba(255, 215, 0, 0.12);
  --accent-line: rgba(255, 215, 0, 0.55);
  --ok: #22C55E;
  --warn: #F59E0B;
  --bad: #EF4444;
  --bad-text: #F87171;
  --info: #3B82F6;
  --hover: #222228;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --overlay: rgba(0, 0, 0, 0.72);
  --font-ui: Inter, system-ui, sans-serif;
  --font-display: Montserrat, Inter, sans-serif;
  /* The text typed or chosen in a form field (.form-input, .kw-input, the themed dropdown list): Montserrat, as before the
     redesign (Kris 31/10/2026). Labels and the rest of the UI stay on --font-ui. */
  --font-field: var(--font-display);
  /* Registration chip (.kw-reg). JetBrains Mono Bold, tabular figures, slashed zero. Each theme sets the four colours below. */
  --font-reg: "JetBrains Mono", ui-monospace, "Segoe UI Mono", monospace;
  --reg-bg: var(--surface);
  --reg-fg: var(--text);
  --reg-border: var(--border-strong);
  --reg-tick: var(--accent);
  --reg-track: 0.12em;
  /* In-progress strip. Every banner is this one neutral slate (Kris 01/11/2026); only the tech / category pills inside
     carry a colour. #e5e7eb on #262c36 is 11.3:1 (AA and AAA). */
  --ip-bg: #141a14;
  --ip-border: rgba(74, 222, 128, 0.35);
  --ip-label: #86efac;
  --ip-tag-bg: #262c36;
  --ip-tag-fg: #e5e7eb;
  --ip-tag-border: #3b4554;
  --reg-tick-w: 3px;
  /* The settings (gear) menu: one fixed width on every page (Kris 31/10/2026). Before the redesign it sized to its content and
     measured 334px everywhere; trimming the long gear entries made it shrink to 240-312px. page-menu.css caps it on phones. */
  --menu-width: 334px;
  /* The gear button itself: one size, corner and icon on every page (Kris 31/10/2026; the Cars on Site gear before the redesign) */
  --menu-btn-size: 44px;
  --menu-btn-radius: 12px;
  --menu-btn-icon: 1.25rem;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --fs-display: 700 28px/32px var(--font-display);
  --fs-section: 700 22px/28px var(--font-display);
  --fs-card: 700 16px/22px var(--font-ui);
  --fs-body: 400 14px/20px var(--font-ui);
  --fs-small: 400 12px/16px var(--font-ui);
  --fs-eyebrow: 700 11px/16px var(--font-ui);
  color-scheme: dark;

  /* Retired variable sets. One value each, taken from the tokens above. */
  --dp-bg: var(--surface);
  --dp-fg: var(--text);
  --dp-muted: var(--text-2);
  --dp-border: var(--border);
  --dp-hover: var(--hover);
  --dp-accent: var(--accent);
  --dp-accent-fg: var(--accent-fg);
  --c-bg: var(--bg);
  --c-surface: var(--surface);
  --c-surface-2: var(--surface-2);
  --c-input: var(--surface);
  --c-border: var(--border);
  --c-border-strong: var(--border-strong);
  --c-text: var(--text);
  --c-muted: var(--text-2);
  --c-accent: var(--accent);
  --c-accent-text: var(--accent-text);
  --c-accent-fg: var(--accent-fg);
  --c-accent-grad: var(--accent-grad);
  --c-accent-soft: var(--accent-soft);
  --c-line: var(--accent-line);
  --c-shadow: var(--shadow);
  --c-overlay: var(--overlay);
  --c-user-msg: var(--surface-2);
  --c-bot-msg: var(--surface);
  --c-ok: var(--ok);
  --c-bad: var(--bad-text);
  --l-bg: var(--bg);
  --l-surface: var(--surface);
  --l-surface-2: var(--surface-2);
  --l-border: var(--border);
  --l-border-strong: var(--border-strong);
  --l-text: var(--text);
  --l-muted: var(--text-2);
  --l-faint: var(--text-3);
  --l-gold: var(--accent-text);
  --l-gold-big: var(--accent);
  --l-gold-line: var(--accent);
  --l-gold-bg: var(--accent);
  --l-shadow: var(--shadow-sm);
  --ml-surface: var(--surface);
  --ml-row: var(--surface-2);
  --ml-row-border: var(--border);
  --ml-editor: var(--surface-3);
  --sn-bg: var(--dp-bg);
  --sn-fg: var(--dp-fg);
  --sn-muted: var(--dp-muted);
  --sn-border: var(--dp-border);
  --sn-hover: var(--dp-hover);
  --sn-accent: var(--dp-accent);
  --sn-accent-fg: var(--dp-accent-fg);
  --wn-bg: var(--dp-bg);
  --wn-fg: var(--dp-fg);
  --wn-muted: var(--dp-muted);
  --wn-border: var(--dp-border);
  --wn-hover: var(--dp-hover);
  --wn-accent: var(--dp-accent);
  --wn-accent-fg: var(--dp-accent-fg);
  --sb-track: var(--bg);
  --sb-thumb: linear-gradient(135deg, rgba(255, 215, 0, 0.5), rgba(184, 134, 11, 0.5));
  --sb-thumb-hover: linear-gradient(135deg, rgba(255, 215, 0, 0.7), rgba(184, 134, 11, 0.7));
  --sb-ff-thumb: rgba(212, 175, 55, 0.6);
  --sb-ff-track: var(--bg);
}

/* Day. Pink also carries theme-light, so pink rules below must follow these. */
html.theme-light {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --surface-3: #EEF1F5;
  --border: #E3E6EB;
  --border-strong: #CFD4DC;
  --text: #1F2328;
  --text-2: #5F687A;
  --text-3: #8A94A3;
  --accent: #F7C600;
  --accent-text: #A98000;
  --accent-fg: #1A1500;
  --accent-grad: linear-gradient(135deg, #F2B900, #FFD21F, #E8A900);
  --accent-soft: #FFF6CC;
  --accent-line: rgba(226, 180, 0, 0.6);
  --bad-text: #B91C1C;
  --ok: #15803D;
  --hover: #F1F3F6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --shadow-sm: var(--shadow);
  --overlay: rgba(15, 23, 42, 0.45);
  --dp-accent: var(--accent-text);
  --dp-accent-fg: #FFFFFF;
  --l-gold: var(--accent-text);
  --l-gold-big: #C29100;
  --l-gold-line: #E2B400;
  --l-gold-bg: var(--accent);
  --l-shadow: var(--shadow);
  --c-user-msg: #FFF8DB;
  --c-bot-msg: var(--surface);
  --sb-track: #EEF0F3;
  --sb-thumb: linear-gradient(135deg, rgba(212, 160, 0, 0.55), rgba(167, 123, 0, 0.55));
  --sb-thumb-hover: linear-gradient(135deg, rgba(212, 160, 0, 0.8), rgba(167, 123, 0, 0.8));
  --sb-ff-thumb: rgba(190, 140, 0, 0.6);
  --sb-ff-track: #EEF0F3;
  --reg-bg: var(--surface);
  --reg-fg: var(--text);
  --reg-border: var(--border-strong);
  --reg-tick: var(--accent-text);
  --ip-bg: #f0fdf4;
  --ip-border: #86efac;
  --ip-label: #15803d;
  --ip-tag-bg: #ffffff;
  --ip-tag-fg: #1f2328;
  --ip-tag-border: #bbf7d0;
  color-scheme: light;
}

/* Pink swaps the accent (and a blush surface) only. Layout stays the Day shell. */
html.theme-pink {
  --bg: #FDF6F9;
  --surface: #FFFFFF;
  --surface-2: #FFF5F9;
  --surface-3: #FDE4EF;
  --border: #F5D0E1;
  --border-strong: #F5C6DC;
  --text: #4A1D33;
  --text-2: #9D5A7A;
  --text-3: #C084A0;
  --accent: #EC4899;
  --accent-text: #BE185D;
  --accent-fg: #FFFFFF;
  --accent-grad: linear-gradient(135deg, #DB2777, #EC4899, #BE185D);
  --accent-soft: #FCE7F3;
  --accent-line: rgba(244, 114, 182, 0.7);
  --hover: #FDE4EF;
  --dp-accent: var(--accent);
  --dp-accent-fg: var(--accent-fg);
  --l-gold: var(--accent-text);
  --l-gold-big: #DB2777;
  --l-gold-line: #F472B6;
  --l-gold-bg: var(--accent);
  --c-user-msg: #FDF2F8;
  --sb-track: #FDE4EF;
  --sb-thumb: linear-gradient(135deg, rgba(255, 111, 181, 0.6), rgba(214, 31, 122, 0.6));
  --sb-thumb-hover: linear-gradient(135deg, rgba(255, 111, 181, 0.85), rgba(214, 31, 122, 0.85));
  --sb-ff-thumb: rgba(236, 72, 153, 0.6);
  --sb-ff-track: #FDE4EF;
  --reg-bg: var(--surface);
  --reg-fg: var(--text);
  --reg-border: var(--border-strong);
  --reg-tick: var(--accent);
  --ip-bg: var(--accent-soft);
  --ip-border: var(--accent-line);
  --ip-label: var(--accent-text);
  --ip-tag-bg: var(--surface);
  --ip-tag-fg: var(--text);
  --ip-tag-border: var(--border);
  color-scheme: light;
}

/* Shared controls. Pages opt in by class. Existing buttons are not restyled here. */
.kw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid transparent;
  font-family: var(--font-ui); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer;
}
.kw-btn-primary { background: var(--accent); color: var(--accent-fg); }
.kw-btn-primary:hover { filter: brightness(1.06); }
.kw-btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.kw-btn-secondary:hover { background: var(--hover); }
.kw-btn-ghost { background: transparent; color: var(--text-2); }
.kw-btn-ghost:hover { background: var(--hover); color: var(--text); }
.kw-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.kw-seg button { margin: 0; border: 0; background: transparent; color: var(--text-2); font-family: var(--font-ui); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.kw-seg button.on, .kw-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.kw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--radius-pill); font-family: var(--font-ui); font-size: 12px; font-weight: 700; line-height: 18px; background: color-mix(in srgb, var(--chip, var(--text-2)) 16%, var(--surface)); color: var(--chip, var(--text)); border: 1px solid color-mix(in srgb, var(--chip, var(--border)) 45%, var(--border)); }
/* One registration chip everywhere a stored reg is shown. Neutral surface, strong border, accent bar on the left.
   The text is the reg as stored: nothing here inserts a space. The job-card field (#f-reg) is not this chip. */
.kw-reg, .kw-plate, .reg-text, .cc-plate {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-2);
  border-radius: var(--radius-sm); background: var(--reg-bg); color: var(--reg-fg);
  border: 1px solid var(--reg-border);
  font-family: var(--font-reg); font-weight: 700; font-size: 13px; line-height: 16px;
  font-variant-numeric: tabular-nums slashed-zero; font-feature-settings: "zero" 1;
  letter-spacing: var(--reg-track); white-space: nowrap;
}
.kw-reg::before, .kw-plate::before, .reg-text::before, .cc-plate::before {
  content: ""; width: var(--reg-tick-w); align-self: stretch; border-radius: var(--radius-sm);
  background: var(--reg-tick); flex: 0 0 auto;
}
/* Form field text (values and placeholders) on every page: the shared .form-input fields take the field font too. */
.form-input { font-family: var(--font-field); }
.form-input, .kw-input { font-size: 16px; line-height: 24px; }
.kw-input { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 10px 12px; font-family: var(--font-field); font-size: 16px; line-height: 24px; }
.kw-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* A plain content panel (e.g. the chat page's "In development" box for roles without the AI chat). */
.kw-panel { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); }
.kw-panel > * { margin: 0; }
.kw-panel > * + * { margin-top: var(--space-2); }
.kw-panel-text { font: var(--fs-body); color: var(--text-2); }
.kw-eyebrow { font: var(--fs-eyebrow); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.kw-section-title { font: var(--fs-section); color: var(--text); }
/* One bottom toast for Cars on Site, the archive and Users. The Cars on Site toast fades in with .show;
   the others are shown by removing .hidden. An error adds .bad. */
.cars-toast, .arch-toast, .ua-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10002;
  max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--accent);
  border-radius: var(--radius-md); box-shadow: var(--shadow);
  padding: 8px 14px; font: 600 13px/18px var(--font-ui); pointer-events: none;
}
.arch-toast.bad, .ua-toast.bad { background: var(--bad); color: #fff; border-color: transparent; }
@media (max-width: 639.98px) {
  .cars-toast, .arch-toast, .ua-toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
