:root {
  --canvas: #050a14;
  --canvas-strong: #08111f;
  --surface: #0f1928;
  --surface-raised: #142134;
  --surface-muted: #0b1525;
  --ink: #f3f8ff;
  --text: #dce8f8;
  --muted: #91a5c1;
  --line: rgba(137, 164, 198, 0.23);
  --line-strong: rgba(151, 181, 218, 0.38);
  --blue: #4f8cff;
  --blue-strong: #2e63e6;
  --blue-soft: rgba(79, 140, 255, 0.16);
  --teal: #30d6cf;
  --teal-soft: rgba(48, 214, 207, 0.13);
  --green: #7cf2a7;
  --green-soft: rgba(124, 242, 167, 0.12);
  --amber: #f9c86d;
  --amber-soft: rgba(249, 200, 109, 0.13);
  --red: #ff7777;
  --red-soft: rgba(255, 119, 119, 0.13);
  --violet: #9b7cff;
  --violet-soft: rgba(155, 124, 255, 0.14);
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
  --shadow-tight: 0 12px 30px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  /* UI-5 (U9): spacing scale. Gaps and padding come from this list (4, 8, 12, 16, 24, 32). */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  /* UI-5 (U9): type scale. Nothing renders under 12px; body text is 14px. */
  --text-meta: 12px;
  --text-body: 14px;
  --text-field: 15px;
  --text-section: 20px;
  --text-page: 26px;
  /* UI-5: the keyboard focus ring (opaque, >= 3:1 against every surface the app draws). */
  --focus-ring: #8fb8ff;
  /* UI-5: text on the blue-to-teal gradient (primary buttons, brand mark): dark, so it holds 4.5:1 along the whole gradient. */
  --on-accent: #04101f;
  /* UI-5: text links and citation chips (measured against --surface and the tinted panel backgrounds). */
  --link: #8fb8ff;
  /* UI-5: the primary button / brand mark gradient; --on-accent text is >= 4.5:1 on every stop. */
  /* UI-5: secondary text on the tinted panels (the Ask panel's blue/violet gradient took --muted to 4.37:1) and on disabled controls. */
  --muted-strong: #a9bad2;
  --accent-from: #3b78f0;
  --accent-mid: #4f8cff;
  --accent-to: #30d6cf;
  --sidebar-width: 156px;
  --display-font: "Bahnschrift", "Aptos Display", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --ui-font: "Aptos", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-family: var(--ui-font);
  color: var(--ink);
}

/* V1 (interface rebuild): the role tokens of features/ui-design/07_VISUAL_SYSTEM.md section 2, here with TODAY's dark values (the
   `premium` theme, served when VINCE2_UI is unset), so the page looks as it did. Names that existed before keep their literal value
   above; the new role name points at it. The three selectable themes further down set the same names to their own values.
   Paint tokens (--paint-*) hold the composite fills (gradients) of today's look; the new themes make each of them a flat surface. */
:root {
  --surface-sunken: var(--surface-muted);
  --text-strong: var(--ink);
  --text-secondary: var(--muted-strong);
  --text-muted: var(--muted);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --accent: var(--blue);
  --accent-hover: var(--blue-strong);
  --selected-bg: rgba(79, 140, 255, 0.14);
  --selected-border: rgba(79, 140, 255, 0.52);
  --nav-bg: #0a1524;
  --nav-text: #bfd0e8;
  --nav-text-strong: #ffffff;
  --nav-group-label: #91a5c1;
  --nav-active-bg: #16294a;
  --nav-active-marker: var(--blue);
  --nav-focus-ring: var(--focus-ring);
  --info-text: #9fc5ff;
  --info-bg: var(--blue-soft);
  --info-mark: rgba(79, 140, 255, 0.34);
  --warning-text: var(--amber);
  --warning-bg: var(--amber-soft);
  --warning-mark: rgba(249, 200, 109, 0.3);
  --error-text: var(--red);
  --error-bg: var(--red-soft);
  --error-mark: rgba(255, 119, 119, 0.3);
  --success-text: var(--green);
  --success-bg: var(--green-soft);
  --success-mark: rgba(124, 242, 167, 0.3);
  --code-bg: rgba(3, 7, 17, 0.96);
  --code-text: #dce8ff;
  --bubble-bg: var(--ask-user-bubble-start);
  --bubble-text: var(--ask-user-bubble-text);
  --placeholder: #7085a3;
  --series-1: var(--blue);
  --series-2: var(--teal);
  --series-3: var(--amber);
  --series-4: var(--violet);
  --series-5: #ff7eb0;
  --series-6: var(--green);
  --brand-from: var(--accent-from);
  --brand-to: var(--accent-to);
  --on-brand: var(--on-accent);
  --elevation-1: var(--shadow-tight);
  --elevation-2: var(--shadow);
  --text-lead: 16px;
  --text-subsection: 16px;
  --space-7: 48px;
  --radius-md: var(--radius);
  --radius-sm: 4px;
  --radius-pill: 999px;
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --row-h: 32px;
  --nav-row-h: 38px;
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --summary-font: var(--ui-font);
  --page-weight: 780;

  --paint-page:
    radial-gradient(circle at 18% 4%, rgba(79, 140, 255, 0.2), transparent 31%),
    radial-gradient(circle at 86% 12%, rgba(48, 214, 207, 0.18), transparent 29%),
    radial-gradient(circle at 62% 95%, rgba(155, 124, 255, 0.13), transparent 34%),
    linear-gradient(180deg, #030711 0, var(--canvas) 44%, #08101d 100%);
  --paint-nav: linear-gradient(180deg, rgba(10, 21, 36, 0.98), rgba(7, 14, 25, 0.96)), var(--surface-muted);
  --nav-edge: rgba(137, 164, 198, 0.18);
  --nav-shadow: 10px 0 38px rgba(0, 0, 0, 0.32);
  --nav-brand-text: #f8fbff;
  --paint-brand-mark: linear-gradient(135deg, var(--accent-mid), var(--accent-to));
  --brand-mark-shadow: 0 12px 24px rgba(79, 140, 255, 0.28);
  --nav-chip-text: #8fc6ff;
  --nav-chip-bg: rgba(79, 140, 255, 0.13);
  --paint-nav-active: linear-gradient(90deg, rgba(79, 140, 255, 0.22), rgba(48, 214, 207, 0.11));
  --nav-active-edge: rgba(79, 140, 255, 0.42);
  --paint-panel: linear-gradient(180deg, rgba(20, 33, 52, 0.94), rgba(12, 22, 37, 0.94)), var(--surface);
  --paint-topbar: linear-gradient(90deg, rgba(16, 28, 46, 0.96), rgba(11, 21, 36, 0.92)), var(--surface);
  --topbar-filter: blur(14px);
  --hero-edge: rgba(79, 140, 255, 0.36);
  --paint-hero:
    linear-gradient(135deg, rgba(79, 140, 255, 0.18), rgba(48, 214, 207, 0.08) 46%, rgba(155, 124, 255, 0.1)),
    linear-gradient(180deg, rgba(18, 31, 50, 0.96), rgba(10, 19, 34, 0.96));
  --hero-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
  --heading-text: #f6fbff;
  --label-text: #9fc5ff;
  --bubble-edge: var(--ask-user-bubble-start);
  --paint-bubble: linear-gradient(135deg, var(--ask-user-bubble-start), var(--ask-user-bubble-end));
  --input-text: #f7fbff;
  --input-bg: rgba(5, 12, 23, 0.76);
  --input-border: #6b82a3;
  --input-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --paint-primary: linear-gradient(135deg, var(--accent-from), var(--accent-mid) 48%, var(--accent-to));
  --primary-edge: rgba(79, 140, 255, 0.74);
  --primary-shadow: 0 14px 32px rgba(79, 140, 255, 0.28);
  --paint-primary-hover: linear-gradient(135deg, #4a85f6, #5d98ff 48%, #3ee0d9);
  --button-text: #dceaff;
  --button-bg: rgba(79, 140, 255, 0.12);
  --button-edge: rgba(79, 140, 255, 0.32);
  --button-hover-text: #ffffff;
  --button-hover-edge: rgba(48, 214, 207, 0.52);
  --button-hover-bg: rgba(48, 214, 207, 0.12);
  --chip-text: #b9d5ff;
  --chip-bg: rgba(79, 140, 255, 0.13);
  --chip-edge: rgba(79, 140, 255, 0.3);
  --pill-text: #cad9ef;
  --pill-bg: rgba(145, 165, 193, 0.12);
  --pill-edge: rgba(145, 165, 193, 0.26);
  --disclosure-edge: rgba(79, 140, 255, 0.28);
  --disclosure-bg: rgba(79, 140, 255, 0.08);
  --disclosure-small-text: #9fb3d4;
  --disclosure-rule: rgba(79, 140, 255, 0.2);
  --teal-edge: rgba(48, 214, 207, 0.28);
  --artifact-label-bg: rgba(48, 214, 207, 0.1);
  --kpi-edge: rgba(137, 164, 198, 0.25);
  --paint-kpi: linear-gradient(180deg, rgba(24, 39, 62, 0.96), rgba(13, 24, 41, 0.96)), var(--surface-raised);
  --paint-kpi-primary: linear-gradient(135deg, rgba(79, 140, 255, 0.96), rgba(48, 214, 207, 0.75)), var(--blue);
  --paint-bar: linear-gradient(90deg, var(--teal), var(--blue), var(--violet));
  --bar-track: rgba(137, 164, 198, 0.18);
  --rank-bg: rgba(79, 140, 255, 0.16);
  --inset-edge: rgba(48, 214, 207, 0.24);
  --paint-inset: linear-gradient(180deg, rgba(15, 31, 48, 0.9), rgba(9, 18, 32, 0.9)), var(--surface-muted);
  --inset-passive-hover: rgba(15, 31, 48, 0.72);
  --selected-text: #ffffff;
  --selected-edge: rgba(79, 140, 255, 0.52);
  --table-rule: rgba(137, 164, 198, 0.2);
  --th-text: #b9d5ff;
  --th-bg: rgba(79, 140, 255, 0.12);
  --thead-bg: #172742;
  --thead-rule: rgba(137, 164, 198, 0.3);
  --note-text: #f5d391;
  --pre-text: #dceaff;
  --pre-bg: #050b16;
  --pre-edge: rgba(137, 164, 198, 0.28);
  --table-bg: rgba(8, 17, 31, 0.38);
  --disabled-bg: rgba(145, 165, 193, 0.1);
  --hover-lift: translateY(-1px);
  --selection-text: #ffffff;
  --selection-bg: rgba(79, 140, 255, 0.52);
  --paint-nav-footer: var(--paint-panel);
  --nav-footer-edge: var(--line);
  --nav-footer-text: var(--muted);
  --nav-footer-shadow: var(--shadow-tight);
  --nav-rule: var(--line);
}

/* Precision (light): light workspace, deep slate navigation, restrained blue accent, compact tables (the default under VINCE2_UI=v4). Values from features/ui-design/mockups/tools/tokens.py. */
body[data-theme="precision"] {
  color-scheme: light;
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #edf0f4;
  --text-strong: #0e1826;
  --text: #1e2a3b;
  --text-secondary: #3c4859;
  --text-muted: #566275;
  --border: #d6dce4;
  --border-strong: #7f8a99;
  --accent: #1d5bd0;
  --accent-hover: #164aad;
  --on-accent: #ffffff;
  --link: #1a55c4;
  --focus-ring: #1d5bd0;
  --selected-bg: #e5eeff;
  --selected-border: #1d5bd0;
  --nav-bg: #0f1b2d;
  --nav-text: #c5d1e1;
  --nav-text-strong: #ffffff;
  --nav-group-label: #93a3b9;
  --nav-active-bg: #1f3150;
  --nav-active-marker: #5cc8ff;
  --nav-focus-ring: #8cc8ff;
  --info-text: #0b57a4;
  --info-bg: #e6f0fb;
  --info-mark: #1f6fd1;
  --warning-text: #7f4500;
  --warning-bg: #fdf1dc;
  --warning-mark: #b26a00;
  --error-text: #ab2117;
  --error-bg: #fcebe9;
  --error-mark: #c8321f;
  --success-text: #1b6535;
  --success-bg: #e6f4ea;
  --success-mark: #2a8248;
  --code-bg: #f0f3f7;
  --code-text: #1e2a3b;
  --bubble-bg: #e9eef6;
  --bubble-text: #0e1826;
  --placeholder: #5f6b7d;
  --series-1: #1d5bd0;
  --series-2: #0b8a99;
  --series-3: #b25e00;
  --series-4: #7446c9;
  --series-5: #c0386f;
  --series-6: #4d7a12;
  --brand-from: #3b78f0;
  --brand-to: #30d6cf;
  --on-brand: #04101f;
  --nav-divider: #22324a;
  --input-bg: #ffffff;
  --elevation-1: 0 1px 2px rgba(15, 27, 45, 0.06);
  --elevation-2: 0 -6px 18px rgba(15, 27, 45, 0.10);
  --page-weight: 650;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Executive (warm): warm surfaces, editorial serif for page titles and the answer's prose, roomier rhythm. Values from features/ui-design/mockups/tools/tokens.py. */
body[data-theme="executive"] {
  color-scheme: light;
  --canvas: #f4f1ea;
  --surface: #fffdf8;
  --surface-raised: #ffffff;
  --surface-sunken: #ede8de;
  --text-strong: #1b1916;
  --text: #2a2722;
  --text-secondary: #47423a;
  --text-muted: #5e584e;
  --border: #ddd5c7;
  --border-strong: #857c6d;
  --accent: #0d6a50;
  --accent-hover: #0a563f;
  --on-accent: #ffffff;
  --link: #0b5e47;
  --focus-ring: #0d6a50;
  --selected-bg: #e2f0ea;
  --selected-border: #0d6a50;
  --nav-bg: #ebe6dc;
  --nav-text: #2f2b25;
  --nav-text-strong: #1b1916;
  --nav-group-label: #5e584e;
  --nav-active-bg: #fffdf8;
  --nav-active-marker: #0d6a50;
  --nav-focus-ring: #0d6a50;
  --info-text: #1d4f86;
  --info-bg: #e8eef6;
  --info-mark: #2a62a3;
  --warning-text: #7a4300;
  --warning-bg: #fbefd9;
  --warning-mark: #a86400;
  --error-text: #a1241a;
  --error-bg: #fae8e4;
  --error-mark: #bf3424;
  --success-text: #3b5f0e;
  --success-bg: #eef3e0;
  --success-mark: #577d1c;
  --code-bg: #f1ede4;
  --code-text: #2a2722;
  --bubble-bg: #ece6da;
  --bubble-text: #1b1916;
  --placeholder: #665f54;
  --series-1: #0d6a50;
  --series-2: #2a62a3;
  --series-3: #a85a00;
  --series-4: #7a4a9c;
  --series-5: #b03a5b;
  --series-6: #5e584e;
  --brand-from: #0d6a50;
  --brand-to: #127a5b;
  --on-brand: #ffffff;
  --nav-divider: #d6cdbd;
  --input-bg: #fffdf8;
  --elevation-1: none;
  --elevation-2: 0 -6px 18px rgba(40, 32, 20, 0.10);
  --page-weight: 500;
  --text-body: 15px;
  --text-lead: 18px;
  --text-page: 28px;
  --radius-md: 4px;
  --row-h: 40px;
  --nav-row-h: 24px;
  --sidebar-width: 232px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: "Georgia", "Cambria", "Times New Roman", serif;
  --summary-font: "Georgia", "Cambria", serif;
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: var(--border);
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Frontier (dark): graphite and navy, solid layers, the luminous accent kept for the composer and the active menu item. Values from features/ui-design/mockups/tools/tokens.py. */
body[data-theme="frontier"] {
  color-scheme: dark;
  --canvas: #070c15;
  --surface: #0f1725;
  --surface-raised: #152033;
  --surface-sunken: #0a111d;
  --text-strong: #f3f7fc;
  --text: #dbe4f0;
  --text-secondary: #b6c3d4;
  --text-muted: #9aaabf;
  --border: #253247;
  --border-strong: #62728b;
  --accent: #5b95ff;
  --accent-hover: #79a9ff;
  --on-accent: #04101f;
  --link: #94bcff;
  --focus-ring: #94bcff;
  --selected-bg: #1b2d4d;
  --selected-border: #5b95ff;
  --nav-bg: #09101b;
  --nav-text: #c3d0e2;
  --nav-text-strong: #ffffff;
  --nav-group-label: #8d9db3;
  --nav-active-bg: #18294a;
  --nav-active-marker: #30d6cf;
  --nav-focus-ring: #94bcff;
  --info-text: #9cc6ff;
  --info-bg: #13243d;
  --info-mark: #5b95ff;
  --warning-text: #f6cb78;
  --warning-bg: #2a2213;
  --warning-mark: #e0a84a;
  --error-text: #ff9a92;
  --error-bg: #33171a;
  --error-mark: #ff6f66;
  --success-text: #86e8aa;
  --success-bg: #11291d;
  --success-mark: #4fcf83;
  --code-bg: #060b14;
  --code-text: #d6e2f2;
  --bubble-bg: #1a2a47;
  --bubble-text: #f3f7fc;
  --placeholder: #8d9db3;
  --series-1: #5b95ff;
  --series-2: #30d6cf;
  --series-3: #f0b45a;
  --series-4: #a98bff;
  --series-5: #ff7eb0;
  --series-6: #a6d96a;
  --brand-from: #3b78f0;
  --brand-to: #30d6cf;
  --on-brand: #04101f;
  --nav-divider: #1c2738;
  --input-bg: #0a111d;
  --elevation-1: 0 1px 0 rgba(0, 0, 0, 0.4);
  --elevation-2: 0 -10px 24px rgba(0, 0, 0, 0.45);
  --page-weight: 650;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 26px;
  --radius-md: 8px;
  --row-h: 34px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface-sunken);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--selected-bg);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* === GENERATED THEMES: written by features/ui-design/mockups/tools/product_theme.py from mockups/tools/tokens.py; do not edit by hand === */
/* Broadsheet (light, Claude; generated from tokens.py) */
body[data-theme="broadsheet"] {
  color-scheme: light;
  --canvas: #f7e9dc;
  --surface: #fff4ea;
  --surface-raised: #fffaf5;
  --surface-sunken: #f0dfcf;
  --text-strong: #1a1817;
  --text: #33302e;
  --text-secondary: #4d4845;
  --text-muted: #605a55;
  --border: #e0cbb8;
  --border-strong: #8c7b6d;
  --accent: #0d7680;
  --accent-hover: #0a5f68;
  --on-accent: #ffffff;
  --link: #0a6670;
  --focus-ring: #0d7680;
  --selected-bg: #e2eeec;
  --selected-border: #0d7680;
  --nav-bg: #201d1b;
  --nav-text: #e6d9cc;
  --nav-text-strong: #ffffff;
  --nav-group-label: #b3a596;
  --nav-active-bg: #3b3530;
  --nav-active-marker: #5fc2c9;
  --nav-focus-ring: #7fd3d9;
  --info-text: #0b4f8a;
  --info-bg: #e5edf6;
  --info-mark: #2066b0;
  --warning-text: #7a4000;
  --warning-bg: #fbe8c8;
  --warning-mark: #a86200;
  --error-text: #a3201a;
  --error-bg: #fbe1dc;
  --error-mark: #c0352a;
  --success-text: #245c2c;
  --success-bg: #e3efdc;
  --success-mark: #3a7d3f;
  --code-bg: #f3e4d6;
  --code-text: #33302e;
  --bubble-bg: #f0ddcc;
  --bubble-text: #1a1817;
  --placeholder: #655d56;
  --series-1: #0d7680;
  --series-2: #3f5ea8;
  --series-3: #b0571b;
  --series-4: #7b4aa0;
  --series-5: #b03c6a;
  --series-6: #5d7414;
  --brand-from: #0d7680;
  --brand-to: #0f5499;
  --on-brand: #ffffff;
  --nav-divider: #3b3530;
  --input-bg: #fffaf5;
  --elevation-1: none;
  --elevation-2: 0 -6px 18px rgba(40, 24, 10, 0.10);
  --page-weight: 600;
  --text-body: 15px;
  --text-lead: 18px;
  --text-page: 28px;
  --radius-md: 4px;
  --row-h: 40px;
  --nav-row-h: 24px;
  --sidebar-width: 232px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: "Georgia", "Cambria", "Times New Roman", serif;
  --summary-font: "Georgia", "Cambria", serif;
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Swiss Grid (light, Claude; generated from tokens.py) */
body[data-theme="swiss"] {
  color-scheme: light;
  --canvas: #f2f2f2;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #ebebeb;
  --text-strong: #000000;
  --text: #1a1a1a;
  --text-secondary: #3d3d3d;
  --text-muted: #595959;
  --border: #d4d4d4;
  --border-strong: #767676;
  --accent: #111111;
  --accent-hover: #333333;
  --on-accent: #ffffff;
  --link: #111111;
  --focus-ring: #111111;
  --selected-bg: #e8e8e8;
  --selected-border: #111111;
  --nav-bg: #ffffff;
  --nav-text: #1a1a1a;
  --nav-text-strong: #000000;
  --nav-group-label: #595959;
  --nav-active-bg: #ebebeb;
  --nav-active-marker: #000000;
  --nav-focus-ring: #000000;
  --info-text: #0050a0;
  --info-bg: #e8f0f8;
  --info-mark: #0064c8;
  --warning-text: #7a4a00;
  --warning-bg: #fff0d0;
  --warning-mark: #a86b00;
  --error-text: #c4000f;
  --error-bg: #fde8e8;
  --error-mark: #e1000f;
  --success-text: #00663a;
  --success-bg: #e3f3ea;
  --success-mark: #008a4e;
  --code-bg: #f5f5f5;
  --code-text: #1a1a1a;
  --bubble-bg: #ebebeb;
  --bubble-text: #000000;
  --placeholder: #5e5e5e;
  --series-1: #111111;
  --series-2: #3767b0;
  --series-3: #c45c00;
  --series-4: #7a3fa0;
  --series-5: #b8336a;
  --series-6: #5c7a12;
  --brand-from: #000000;
  --brand-to: #3a3a3a;
  --on-brand: #ffffff;
  --nav-divider: #d4d4d4;
  --input-bg: #ffffff;
  --elevation-1: none;
  --elevation-2: 0 -1px 0 #d4d4d4;
  --page-weight: 700;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Ledger (light, Claude; generated from tokens.py) */
body[data-theme="ledger"] {
  color-scheme: light;
  --canvas: #f3eedd;
  --surface: #fdfaf0;
  --surface-raised: #fffdf6;
  --surface-sunken: #ebe4cf;
  --text-strong: #221c14;
  --text: #2f281e;
  --text-secondary: #4a4134;
  --text-muted: #5c5243;
  --border: #d9cfb5;
  --border-strong: #82755c;
  --accent: #6b2d5c;
  --accent-hover: #55224a;
  --on-accent: #ffffff;
  --link: #6b2d5c;
  --focus-ring: #6b2d5c;
  --selected-bg: #f1e4ec;
  --selected-border: #6b2d5c;
  --nav-bg: #2e1f29;
  --nav-text: #e8dbe2;
  --nav-text-strong: #ffffff;
  --nav-group-label: #b8a3b0;
  --nav-active-bg: #4a3343;
  --nav-active-marker: #e8b4d4;
  --nav-focus-ring: #f0c6de;
  --info-text: #1d4f86;
  --info-bg: #e6edf5;
  --info-mark: #2d62a0;
  --warning-text: #7a4300;
  --warning-bg: #f8e7c4;
  --warning-mark: #a46100;
  --error-text: #a3241b;
  --error-bg: #f8e1da;
  --error-mark: #bd3426;
  --success-text: #355f12;
  --success-bg: #e7eed6;
  --success-mark: #53801f;
  --code-bg: #efe8d4;
  --code-text: #2f281e;
  --bubble-bg: #ebe2cc;
  --bubble-text: #221c14;
  --placeholder: #62584a;
  --series-1: #6b2d5c;
  --series-2: #33639c;
  --series-3: #a65a10;
  --series-4: #3d7a6e;
  --series-5: #8c4a2f;
  --series-6: #6b6e1f;
  --brand-from: #6b2d5c;
  --brand-to: #8a3b6f;
  --on-brand: #ffffff;
  --nav-divider: #4a3343;
  --input-bg: #fffdf6;
  --elevation-1: none;
  --elevation-2: 0 -6px 18px rgba(40, 32, 20, 0.10);
  --page-weight: 500;
  --text-body: 15px;
  --text-lead: 18px;
  --text-page: 28px;
  --radius-md: 4px;
  --row-h: 40px;
  --nav-row-h: 24px;
  --sidebar-width: 232px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: "Georgia", "Cambria", "Times New Roman", serif;
  --summary-font: "Georgia", "Cambria", serif;
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Civic (light, Claude; generated from tokens.py) */
body[data-theme="civic"] {
  color-scheme: light;
  --canvas: #f0f0f0;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #edeff0;
  --text-strong: #1b1b1b;
  --text: #2e2e2e;
  --text-secondary: #3d4551;
  --text-muted: #565c65;
  --border: #dfe1e2;
  --border-strong: #71767a;
  --accent: #005ea2;
  --accent-hover: #1a4480;
  --on-accent: #ffffff;
  --link: #005ea2;
  --focus-ring: #005ea2;
  --selected-bg: #d9e8f6;
  --selected-border: #005ea2;
  --nav-bg: #162e51;
  --nav-text: #dfe1e2;
  --nav-text-strong: #ffffff;
  --nav-group-label: #a9aeb1;
  --nav-active-bg: #1a4480;
  --nav-active-marker: #73b3e7;
  --nav-focus-ring: #97d4ea;
  --info-text: #2e6276;
  --info-bg: #e7f6f8;
  --info-mark: #009ec1;
  --warning-text: #6b4a00;
  --warning-bg: #faf3d1;
  --warning-mark: #c2850c;
  --error-text: #b50909;
  --error-bg: #f4e3db;
  --error-mark: #d54309;
  --success-text: #216e1f;
  --success-bg: #ecf3ec;
  --success-mark: #00a91c;
  --code-bg: #f0f0f0;
  --code-text: #1b1b1b;
  --bubble-bg: #eff6fb;
  --bubble-text: #1b1b1b;
  --placeholder: #565c65;
  --series-1: #005ea2;
  --series-2: #c05600;
  --series-3: #7828c8;
  --series-4: #a72f6f;
  --series-5: #4d8055;
  --series-6: #5e6b00;
  --brand-from: #005ea2;
  --brand-to: #162e51;
  --on-brand: #ffffff;
  --nav-divider: #1a4480;
  --input-bg: #ffffff;
  --elevation-1: 0 1px 2px rgba(27, 27, 27, 0.08);
  --elevation-2: 0 -6px 18px rgba(27, 27, 27, 0.10);
  --page-weight: 700;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Tonal (Material 3) (light, Claude; generated from tokens.py) */
body[data-theme="tonal"] {
  color-scheme: light;
  --canvas: #f7f2fa;
  --surface: #fef7ff;
  --surface-raised: #ffffff;
  --surface-sunken: #ece6f0;
  --text-strong: #1d1b20;
  --text: #2b2930;
  --text-secondary: #49454f;
  --text-muted: #5c5864;
  --border: #cac4d0;
  --border-strong: #79747e;
  --accent: #6750a4;
  --accent-hover: #4f378b;
  --on-accent: #ffffff;
  --link: #6750a4;
  --focus-ring: #6750a4;
  --selected-bg: #eaddff;
  --selected-border: #6750a4;
  --nav-bg: #f3edf7;
  --nav-text: #49454f;
  --nav-text-strong: #1d1b20;
  --nav-group-label: #625b71;
  --nav-active-bg: #e8def8;
  --nav-active-marker: #6750a4;
  --nav-focus-ring: #6750a4;
  --info-text: #00497d;
  --info-bg: #d1e4ff;
  --info-mark: #0061a4;
  --warning-text: #6d3a00;
  --warning-bg: #ffdcc2;
  --warning-mark: #8b5000;
  --error-text: #b3261e;
  --error-bg: #f9dedc;
  --error-mark: #b3261e;
  --success-text: #1e6b2e;
  --success-bg: #d7f5d1;
  --success-mark: #2b8a3e;
  --code-bg: #f3edf7;
  --code-text: #1d1b20;
  --bubble-bg: #e8def8;
  --bubble-text: #1d1b20;
  --placeholder: #625b71;
  --series-1: #6750a4;
  --series-2: #006a6a;
  --series-3: #9c4400;
  --series-4: #7d5260;
  --series-5: #3a5fa0;
  --series-6: #56651a;
  --brand-from: #6750a4;
  --brand-to: #7d5260;
  --on-brand: #ffffff;
  --nav-divider: #e6e0e9;
  --input-bg: #ffffff;
  --elevation-1: 0 1px 2px rgba(29, 27, 32, 0.08);
  --elevation-2: 0 -4px 12px rgba(29, 27, 32, 0.10);
  --page-weight: 500;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Carbon Gray 100 (dark, Claude; generated from tokens.py) */
body[data-theme="carbon"] {
  color-scheme: dark;
  --canvas: #161616;
  --surface: #262626;
  --surface-raised: #393939;
  --surface-sunken: #1d1d1d;
  --text-strong: #f4f4f4;
  --text: #e0e0e0;
  --text-secondary: #c6c6c6;
  --text-muted: #a8a8a8;
  --border: #424242;
  --border-strong: #8d8d8d;
  --accent: #4589ff;
  --accent-hover: #78a9ff;
  --on-accent: #161616;
  --link: #78a9ff;
  --focus-ring: #ffffff;
  --selected-bg: #002d9c;
  --selected-border: #4589ff;
  --nav-bg: #161616;
  --nav-text: #c6c6c6;
  --nav-text-strong: #f4f4f4;
  --nav-group-label: #a8a8a8;
  --nav-active-bg: #393939;
  --nav-active-marker: #4589ff;
  --nav-focus-ring: #ffffff;
  --info-text: #82cfff;
  --info-bg: #0b2638;
  --info-mark: #33b1ff;
  --warning-text: #f1c21b;
  --warning-bg: #302400;
  --warning-mark: #f1c21b;
  --error-text: #ffb3b8;
  --error-bg: #3d1a1d;
  --error-mark: #fa4d56;
  --success-text: #6fdc8c;
  --success-bg: #0e2a18;
  --success-mark: #42be65;
  --code-bg: #121212;
  --code-text: #e0e0e0;
  --bubble-bg: #393939;
  --bubble-text: #f4f4f4;
  --placeholder: #a8a8a8;
  --series-1: #4589ff;
  --series-2: #08bdba;
  --series-3: #a56eff;
  --series-4: #ff7eb6;
  --series-5: #ff832b;
  --series-6: #c6c6c6;
  --brand-from: #0f62fe;
  --brand-to: #0043ce;
  --on-brand: #ffffff;
  --nav-divider: #393939;
  --input-bg: #262626;
  --elevation-1: none;
  --elevation-2: 0 -1px 0 #393939;
  --page-weight: 600;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface-sunken);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--selected-bg);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Radix Mauve and Iris (light, Claude; generated from tokens.py) */
body[data-theme="radix"] {
  color-scheme: light;
  --canvas: #faf9fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #f2eff3;
  --text-strong: #211f26;
  --text: #2e2b33;
  --text-secondary: #4a4752;
  --text-muted: #65636d;
  --border: #dbd8e0;
  --border-strong: #84828e;
  --accent: #5b5bd6;
  --accent-hover: #5151cd;
  --on-accent: #ffffff;
  --link: #5753c6;
  --focus-ring: #5b5bd6;
  --selected-bg: #e6e7ff;
  --selected-border: #5b5bd6;
  --nav-bg: #eae7ec;
  --nav-text: #3a3740;
  --nav-text-strong: #211f26;
  --nav-group-label: #5c5a64;
  --nav-active-bg: #ffffff;
  --nav-active-marker: #5b5bd6;
  --nav-focus-ring: #5b5bd6;
  --info-text: #113264;
  --info-bg: #e6f4fe;
  --info-mark: #0090ff;
  --warning-text: #4f3422;
  --warning-bg: #fff7c2;
  --warning-mark: #ab6400;
  --error-text: #ce2c31;
  --error-bg: #feebec;
  --error-mark: #e5484d;
  --success-text: #193b2d;
  --success-bg: #e6f6eb;
  --success-mark: #30a46c;
  --code-bg: #f2eff3;
  --code-text: #2e2b33;
  --bubble-bg: #f0f1fe;
  --bubble-text: #211f26;
  --placeholder: #65636d;
  --series-1: #5b5bd6;
  --series-2: #0d9b8a;
  --series-3: #ef5f00;
  --series-4: #ab4aba;
  --series-5: #d6409f;
  --series-6: #a18072;
  --brand-from: #5b5bd6;
  --brand-to: #3e63dd;
  --on-brand: #ffffff;
  --nav-divider: #dbd8e0;
  --input-bg: #ffffff;
  --elevation-1: 0 1px 2px rgba(33, 31, 38, 0.06);
  --elevation-2: 0 -6px 18px rgba(33, 31, 38, 0.08);
  --page-weight: 650;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Graphite and Ultramarine (light, Claude; generated from tokens.py) */
body[data-theme="graphite"] {
  color-scheme: light;
  --canvas: #f5f5f5;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #efefef;
  --text-strong: #0a0a0a;
  --text: #171717;
  --text-secondary: #404040;
  --text-muted: #525252;
  --border: #e5e5e5;
  --border-strong: #737373;
  --accent: #3d34c4;
  --accent-hover: #2e27a0;
  --on-accent: #ffffff;
  --link: #3d34c4;
  --focus-ring: #3d34c4;
  --selected-bg: #ecebfb;
  --selected-border: #3d34c4;
  --nav-bg: #171717;
  --nav-text: #d4d4d4;
  --nav-text-strong: #ffffff;
  --nav-group-label: #a3a3a3;
  --nav-active-bg: #2e2e2e;
  --nav-active-marker: #a9a4ff;
  --nav-focus-ring: #c7c3ff;
  --info-text: #0b5f73;
  --info-bg: #e3f2f5;
  --info-mark: #0e7c94;
  --warning-text: #7a4200;
  --warning-bg: #fbefd8;
  --warning-mark: #a96300;
  --error-text: #ae1f1f;
  --error-bg: #fbe7e7;
  --error-mark: #cf2f2f;
  --success-text: #1d6533;
  --success-bg: #e5f3e9;
  --success-mark: #2c8449;
  --code-bg: #f5f5f5;
  --code-text: #171717;
  --bubble-bg: #ededed;
  --bubble-text: #0a0a0a;
  --placeholder: #5c5c5c;
  --series-1: #3d34c4;
  --series-2: #262626;
  --series-3: #7f79e3;
  --series-4: #6b6b6b;
  --series-5: #24206e;
  --series-6: #858585;
  --brand-from: #171717;
  --brand-to: #3d34c4;
  --on-brand: #ffffff;
  --nav-divider: #2e2e2e;
  --input-bg: #ffffff;
  --elevation-1: 0 1px 2px rgba(10, 10, 10, 0.06);
  --elevation-2: 0 -6px 18px rgba(10, 10, 10, 0.10);
  --page-weight: 650;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Flight Deck (dark, Claude; generated from tokens.py) */
body[data-theme="flightdeck"] {
  color-scheme: dark;
  --canvas: #000000;
  --surface: #0b0d10;
  --surface-raised: #14181d;
  --surface-sunken: #050607;
  --text-strong: #ffffff;
  --text: #f0f0f0;
  --text-secondary: #d6d9dc;
  --text-muted: #bfc4c9;
  --border: #2c3238;
  --border-strong: #7d868f;
  --accent: #5ccfe0;
  --accent-hover: #8ae0ec;
  --on-accent: #000000;
  --link: #7fdbe8;
  --focus-ring: #ffffff;
  --selected-bg: #0c2a30;
  --selected-border: #5ccfe0;
  --nav-bg: #000000;
  --nav-text: #e0e0e0;
  --nav-text-strong: #ffffff;
  --nav-group-label: #b0b5ba;
  --nav-active-bg: #14262a;
  --nav-active-marker: #5ccfe0;
  --nav-focus-ring: #ffffff;
  --info-text: #e3b3ff;
  --info-bg: #22142c;
  --info-mark: #c77dff;
  --warning-text: #ffc857;
  --warning-bg: #2b2000;
  --warning-mark: #ffb000;
  --error-text: #ff8a80;
  --error-bg: #330d0b;
  --error-mark: #ff4d40;
  --success-text: #7ee08a;
  --success-bg: #0c2410;
  --success-mark: #3ccf54;
  --code-bg: #050607;
  --code-text: #e8e8e8;
  --bubble-bg: #1a2026;
  --bubble-text: #ffffff;
  --placeholder: #b0b5ba;
  --series-1: #5ccfe0;
  --series-2: #e0e0e0;
  --series-3: #9fa8ff;
  --series-4: #ff8fc7;
  --series-5: #c5e06b;
  --series-6: #f0a070;
  --brand-from: #5ccfe0;
  --brand-to: #9fe8f0;
  --on-brand: #000000;
  --nav-divider: #2c3238;
  --input-bg: #050607;
  --elevation-1: none;
  --elevation-2: 0 -1px 0 #2c3238;
  --page-weight: 700;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 26px;
  --radius-md: 8px;
  --row-h: 34px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface-sunken);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--selected-bg);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Terminal (dark, Claude; generated from tokens.py) */
body[data-theme="terminal"] {
  color-scheme: dark;
  --canvas: #1b1d21;
  --surface: #24272c;
  --surface-raised: #2c3036;
  --surface-sunken: #1f2226;
  --text-strong: #f5f3ee;
  --text: #e6e2d8;
  --text-secondary: #cdc8bc;
  --text-muted: #b5afa2;
  --border: #3a3e45;
  --border-strong: #878b93;
  --accent: #a3b4f0;
  --accent-hover: #bccaf7;
  --on-accent: #15171a;
  --link: #b3c2f5;
  --focus-ring: #c9d3fa;
  --selected-bg: #323a52;
  --selected-border: #a3b4f0;
  --nav-bg: #16181b;
  --nav-text: #d4cfc3;
  --nav-text-strong: #ffffff;
  --nav-group-label: #a39d90;
  --nav-active-bg: #2f3442;
  --nav-active-marker: #a3b4f0;
  --nav-focus-ring: #c9d3fa;
  --info-text: #8fd6e8;
  --info-bg: #1a2e35;
  --info-mark: #4fb8d4;
  --warning-text: #f2c879;
  --warning-bg: #33290f;
  --warning-mark: #e0a646;
  --error-text: #ff9e94;
  --error-bg: #3a1e1e;
  --error-mark: #f06b5f;
  --success-text: #9edc94;
  --success-bg: #1d2e1c;
  --success-mark: #6cc061;
  --code-bg: #17191c;
  --code-text: #e6e2d8;
  --bubble-bg: #343a48;
  --bubble-text: #f5f3ee;
  --placeholder: #a8a295;
  --series-1: #a3b4f0;
  --series-2: #7fc7b9;
  --series-3: #c79ad8;
  --series-4: #e2a3b8;
  --series-5: #cfc9bd;
  --series-6: #d4a373;
  --brand-from: #a3b4f0;
  --brand-to: #7fc7b9;
  --on-brand: #15171a;
  --nav-divider: #2c3036;
  --input-bg: #1f2226;
  --elevation-1: 0 1px 0 rgba(0, 0, 0, 0.3);
  --elevation-2: 0 -8px 20px rgba(0, 0, 0, 0.35);
  --page-weight: 600;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 26px;
  --radius-md: 8px;
  --row-h: 34px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface-sunken);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--selected-bg);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Broadsheet (light, ChatGPT; generated from tokens.py) */
body[data-theme="chatgpt-broadsheet"] {
  color-scheme: light;
  --canvas: #f3f0e9;
  --surface: #fffdf7;
  --surface-raised: #ffffff;
  --surface-sunken: #eae5da;
  --text-strong: #211e19;
  --text: #302b24;
  --text-secondary: #443d33;
  --text-muted: #51493e;
  --border: #d4ccbd;
  --border-strong: #776b59;
  --accent: #694525;
  --accent-hover: #51331c;
  --on-accent: #ffffff;
  --link: #624022;
  --focus-ring: #694525;
  --selected-bg: #eee0cd;
  --selected-border: #694525;
  --nav-bg: #e7e0d3;
  --nav-text: #302b24;
  --nav-text-strong: #211e19;
  --nav-group-label: #51493e;
  --nav-active-bg: #fffdf7;
  --nav-active-marker: #694525;
  --nav-focus-ring: #694525;
  --info-text: #124b68;
  --info-bg: #e8f3f8;
  --info-mark: #176080;
  --warning-text: #704000;
  --warning-bg: #fff2d9;
  --warning-mark: #986000;
  --error-text: #a0222a;
  --error-bg: #fcebed;
  --error-mark: #b62c37;
  --success-text: #205b39;
  --success-bg: #e9f4ed;
  --success-mark: #287448;
  --code-bg: #eee9df;
  --code-text: #302b24;
  --bubble-bg: #e9dfcf;
  --bubble-text: #211e19;
  --placeholder: #554c40;
  --series-1: #694525;
  --series-2: #007f86;
  --series-3: #9b571b;
  --series-4: #515c9c;
  --series-5: #a73c78;
  --series-6: #616b27;
  --brand-from: #315b8c;
  --brand-to: #245d65;
  --on-brand: #ffffff;
  --nav-divider: #d4ccbd;
  --input-bg: #fffdf7;
  --elevation-1: none;
  --elevation-2: none;
  --page-weight: 650;
  --text-body: 15px;
  --text-lead: 18px;
  --text-page: 28px;
  --radius-md: 4px;
  --row-h: 40px;
  --nav-row-h: 24px;
  --sidebar-width: 232px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: "Georgia", "Cambria", "Times New Roman", serif;
  --summary-font: "Georgia", "Cambria", serif;
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Caliper (light, ChatGPT; generated from tokens.py) */
body[data-theme="chatgpt-caliper"] {
  color-scheme: light;
  --canvas: #f4f4f4;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #e8e8e8;
  --text-strong: #111111;
  --text: #242424;
  --text-secondary: #393939;
  --text-muted: #484848;
  --border: #c6c6c6;
  --border-strong: #6f6f6f;
  --accent: #262626;
  --accent-hover: #111111;
  --on-accent: #ffffff;
  --link: #262626;
  --focus-ring: #262626;
  --selected-bg: #dedede;
  --selected-border: #262626;
  --nav-bg: #ffffff;
  --nav-text: #242424;
  --nav-text-strong: #111111;
  --nav-group-label: #484848;
  --nav-active-bg: #dedede;
  --nav-active-marker: #262626;
  --nav-focus-ring: #262626;
  --info-text: #124b68;
  --info-bg: #e8f3f8;
  --info-mark: #176080;
  --warning-text: #704000;
  --warning-bg: #fff2d9;
  --warning-mark: #986000;
  --error-text: #a0222a;
  --error-bg: #fcebed;
  --error-mark: #b62c37;
  --success-text: #205b39;
  --success-bg: #e9f4ed;
  --success-mark: #287448;
  --code-bg: #e8e8e8;
  --code-text: #242424;
  --bubble-bg: #dedede;
  --bubble-text: #111111;
  --placeholder: #505050;
  --series-1: #262626;
  --series-2: #007f86;
  --series-3: #9b571b;
  --series-4: #515c9c;
  --series-5: #a73c78;
  --series-6: #616b27;
  --brand-from: #315b8c;
  --brand-to: #245d65;
  --on-brand: #ffffff;
  --nav-divider: #c6c6c6;
  --input-bg: #ffffff;
  --elevation-1: none;
  --elevation-2: none;
  --page-weight: 650;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Civic Ledger (light, ChatGPT; generated from tokens.py) */
body[data-theme="chatgpt-civic"] {
  color-scheme: light;
  --canvas: #edf0f2;
  --surface: #ffffff;
  --surface-raised: #f8fafb;
  --surface-sunken: #e3e8ed;
  --text-strong: #171f27;
  --text: #25313d;
  --text-secondary: #394957;
  --text-muted: #485565;
  --border: #c5cdd5;
  --border-strong: #697887;
  --accent: #413f85;
  --accent-hover: #323067;
  --on-accent: #ffffff;
  --link: #383675;
  --focus-ring: #413f85;
  --selected-bg: #e5e4f1;
  --selected-border: #413f85;
  --nav-bg: #dfe5eb;
  --nav-text: #25313d;
  --nav-text-strong: #171f27;
  --nav-group-label: #485565;
  --nav-active-bg: #ffffff;
  --nav-active-marker: #413f85;
  --nav-focus-ring: #413f85;
  --info-text: #124b68;
  --info-bg: #e8f3f8;
  --info-mark: #176080;
  --warning-text: #704000;
  --warning-bg: #fff2d9;
  --warning-mark: #986000;
  --error-text: #a0222a;
  --error-bg: #fcebed;
  --error-mark: #b62c37;
  --success-text: #205b39;
  --success-bg: #e9f4ed;
  --success-mark: #287448;
  --code-bg: #e8edf1;
  --code-text: #25313d;
  --bubble-bg: #e0e5ed;
  --bubble-text: #171f27;
  --placeholder: #4c5866;
  --series-1: #413f85;
  --series-2: #007f86;
  --series-3: #9b571b;
  --series-4: #6f548e;
  --series-5: #a73c78;
  --series-6: #616b27;
  --brand-from: #315b8c;
  --brand-to: #245d65;
  --on-brand: #ffffff;
  --nav-divider: #c5cdd5;
  --input-bg: #ffffff;
  --elevation-1: none;
  --elevation-2: none;
  --page-weight: 650;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Orchid (light, ChatGPT; generated from tokens.py) */
body[data-theme="chatgpt-orchid"] {
  color-scheme: light;
  --canvas: #f6f2fa;
  --surface: #fffbff;
  --surface-raised: #ffffff;
  --surface-sunken: #eae3ef;
  --text-strong: #211a28;
  --text: #302837;
  --text-secondary: #493f50;
  --text-muted: #574b60;
  --border: #d1c5dc;
  --border-strong: #7a6985;
  --accent: #70428b;
  --accent-hover: #58316f;
  --on-accent: #ffffff;
  --link: #65367f;
  --focus-ring: #70428b;
  --selected-bg: #eadcf5;
  --selected-border: #70428b;
  --nav-bg: #eee6f4;
  --nav-text: #302837;
  --nav-text-strong: #211a28;
  --nav-group-label: #574b60;
  --nav-active-bg: #fffbff;
  --nav-active-marker: #70428b;
  --nav-focus-ring: #70428b;
  --info-text: #124b68;
  --info-bg: #e8f3f8;
  --info-mark: #176080;
  --warning-text: #704000;
  --warning-bg: #fff2d9;
  --warning-mark: #986000;
  --error-text: #a0222a;
  --error-bg: #fcebed;
  --error-mark: #b62c37;
  --success-text: #205b39;
  --success-bg: #e9f4ed;
  --success-mark: #287448;
  --code-bg: #eee7f3;
  --code-text: #302837;
  --bubble-bg: #e7dbef;
  --bubble-text: #211a28;
  --placeholder: #594d62;
  --series-1: #70428b;
  --series-2: #007f86;
  --series-3: #9b571b;
  --series-4: #515c9c;
  --series-5: #a73c78;
  --series-6: #616b27;
  --brand-from: #315b8c;
  --brand-to: #245d65;
  --on-brand: #ffffff;
  --nav-divider: #d1c5dc;
  --input-bg: #fffbff;
  --elevation-1: none;
  --elevation-2: none;
  --page-weight: 650;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 24px;
  --radius-md: 6px;
  --row-h: 32px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: var(--ui-font);
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--surface-sunken);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}

/* Ticker (dark, ChatGPT; generated from tokens.py) */
body[data-theme="chatgpt-ticker"] {
  color-scheme: dark;
  --canvas: #171518;
  --surface: #211e23;
  --surface-raised: #28242b;
  --surface-sunken: #121013;
  --text-strong: #fffaff;
  --text: #f0eaf1;
  --text-secondary: #d9d1dc;
  --text-muted: #c4bac8;
  --border: #49414d;
  --border-strong: #95869c;
  --accent: #e5a4d1;
  --accent-hover: #f1bce2;
  --on-accent: #251520;
  --link: #edb6dc;
  --focus-ring: #edb6dc;
  --selected-bg: #403044;
  --selected-border: #e5a4d1;
  --nav-bg: #121013;
  --nav-text: #e4dce8;
  --nav-text-strong: #fffaff;
  --nav-group-label: #c4bac8;
  --nav-active-bg: #403044;
  --nav-active-marker: #e5a4d1;
  --nav-focus-ring: #edb6dc;
  --info-text: #acd9f0;
  --info-bg: #19303d;
  --info-mark: #79bdda;
  --warning-text: #f9da92;
  --warning-bg: #382c15;
  --warning-mark: #e6b858;
  --error-text: #ffb6ad;
  --error-bg: #3d2023;
  --error-mark: #f58d81;
  --success-text: #a2dfbb;
  --success-bg: #1c3428;
  --success-mark: #6dc58f;
  --code-bg: #121013;
  --code-text: #f0eaf1;
  --bubble-bg: #403044;
  --bubble-text: #fffaff;
  --placeholder: #c4bac8;
  --series-1: #e5a4d1;
  --series-2: #7bd1ce;
  --series-3: #d7ae83;
  --series-4: #b7b3ef;
  --series-5: #d8b2bd;
  --series-6: #bfd490;
  --brand-from: #9aabd8;
  --brand-to: #8ac9c4;
  --on-brand: #171518;
  --nav-divider: #49414d;
  --input-bg: #211e23;
  --elevation-1: none;
  --elevation-2: none;
  --page-weight: 650;
  --text-body: 14px;
  --text-lead: 16px;
  --text-page: 26px;
  --radius-md: 8px;
  --row-h: 34px;
  --nav-row-h: 24px;
  --sidebar-width: 224px;
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "Aptos", system-ui, sans-serif;
  --display-font: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --summary-font: var(--ui-font);
  --paint-page: var(--canvas);
  --paint-nav: var(--nav-bg);
  --nav-edge: var(--nav-divider);
  --nav-shadow: none;
  --nav-brand-text: var(--nav-text-strong);
  --paint-brand-mark: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  --brand-mark-shadow: none;
  --nav-chip-text: var(--nav-text);
  --nav-chip-bg: transparent;
  --paint-nav-active: var(--nav-active-bg);
  --nav-active-edge: transparent;
  --paint-panel: var(--surface);
  --paint-topbar: var(--surface-sunken);
  --topbar-filter: none;
  --hero-edge: var(--border);
  --paint-hero: var(--surface);
  --hero-shadow: var(--elevation-1);
  --heading-text: var(--text-strong);
  --label-text: var(--text-secondary);
  --bubble-edge: var(--border);
  --paint-bubble: var(--bubble-bg);
  --input-text: var(--text-strong);
  --input-border: var(--border-strong);
  --input-shadow: none;
  --paint-primary: var(--accent);
  --primary-edge: var(--accent);
  --primary-shadow: none;
  --paint-primary-hover: var(--accent-hover);
  --button-text: var(--text-strong);
  --button-bg: var(--surface);
  --button-edge: var(--border-strong);
  --button-hover-text: var(--text-strong);
  --button-hover-edge: var(--selected-border);
  --button-hover-bg: var(--selected-bg);
  --chip-text: var(--text-secondary);
  --chip-bg: var(--surface-sunken);
  --chip-edge: var(--border);
  --pill-text: var(--text-secondary);
  --pill-bg: var(--surface);
  --pill-edge: var(--border-strong);
  --disclosure-edge: var(--border);
  --disclosure-bg: var(--surface-sunken);
  --disclosure-small-text: var(--text-secondary);
  --disclosure-rule: var(--border);
  --teal-edge: var(--selected-border);
  --artifact-label-bg: var(--selected-bg);
  --kpi-edge: var(--border);
  --paint-kpi: var(--surface);
  --paint-kpi-primary: var(--selected-bg);
  --paint-bar: var(--series-1);
  --bar-track: var(--surface-sunken);
  --rank-bg: var(--selected-bg);
  --inset-edge: var(--border);
  --paint-inset: var(--surface-sunken);
  --inset-passive-hover: var(--surface-sunken);
  --selected-text: var(--text-strong);
  --selected-edge: var(--selected-border);
  --table-rule: var(--border);
  --th-text: var(--text-secondary);
  --th-bg: var(--surface-sunken);
  --thead-bg: var(--surface-sunken);
  --thead-rule: var(--border);
  --note-text: var(--warning-text);
  --pre-text: var(--code-text);
  --pre-bg: var(--code-bg);
  --pre-edge: var(--border);
  --table-bg: var(--surface);
  --disabled-bg: var(--surface-sunken);
  --hover-lift: none;
  --selection-text: var(--text-strong);
  --selection-bg: var(--selected-bg);
  --mono-font: "Cascadia Mono", "Consolas", "Courier New", monospace;
  --paint-nav-footer: transparent;
  --nav-footer-edge: var(--nav-divider);
  --nav-footer-text: var(--nav-group-label);
  --nav-footer-shadow: none;
  --nav-rule: var(--nav-divider);
  /* the older names (used by this file and by the pages' own inline styles) follow the role tokens */
  --canvas-strong: var(--surface-sunken);
  --surface-muted: var(--surface-sunken);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --muted-strong: var(--text-secondary);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --blue: var(--accent);
  --blue-soft: var(--info-bg);
  --blue-strong: var(--accent-hover);
  --teal: var(--link);
  --teal-soft: var(--selected-bg);
  --violet: var(--series-4);
  --violet-soft: var(--selected-bg);
  --green: var(--success-text);
  --green-soft: var(--success-bg);
  --amber: var(--warning-text);
  --amber-soft: var(--warning-bg);
  --red: var(--error-text);
  --red-soft: var(--error-bg);
  --shadow: var(--elevation-2);
  --shadow-tight: var(--elevation-1);
  --radius: var(--radius-md);
  --accent-from: var(--brand-from);
  --accent-mid: var(--accent);
  --accent-to: var(--brand-to);
  --ask-user-bubble-start: var(--bubble-bg);
  --ask-user-bubble-end: var(--bubble-bg);
  --ask-user-bubble-text: var(--bubble-text);
  --chart-mark: var(--series-2);
  --chart-mark-alt: var(--series-1);
  --chart-axis: var(--text-muted);
  --chart-note: var(--text-muted);
}
/* === END GENERATED THEMES === */

* {
  box-sizing: border-box;
}

/* REM-UI (M7, audit L3): the plain HTML `hidden` attribute is only a UA-stylesheet
   `display: none` -- any author rule that sets `display` on the same element (e.g.
   `.state-pill { display: inline-flex }`, matched by the "Demo fixture" pill even
   after JS sets `hidden = true`) wins the cascade and the element stays visible.
   `!important` here beats every such rule repo-wide, so `hidden` always actually
   hides, for any element, with no need to special-case each class that sets its own
   `display` (`.salesforce-write-access-banner[hidden]`/`.modal-overlay[hidden]`
   below did that one class at a time; this rule makes both of those redundant, but
   harmless, since `!important` yields the same result either way). Nothing in this
   stylesheet uses `[hidden]` to mean anything other than "not shown."  */
[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--canvas);
}

body {
  margin: 0;
  max-width: 100%;
  font-size: var(--text-body);
  /* UI-1 (audit A3): `hidden` on body made it a scroll container, so the sticky sidebar, top
     bar and write-access alert stuck to a box that never scrolls. `clip` hides sideways
     overflow without creating a scroll container. */
  overflow-x: clip;
  color: var(--ink);
  letter-spacing: 0;
  background: linear-gradient(180deg, #f8fafc 0, var(--canvas) 520px, var(--canvas-strong) 100%);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: var(--space-4);
  height: 100vh;
  padding: var(--space-4) var(--space-3);
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 8px 0 28px rgba(20, 32, 51, 0.04);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  font-family: var(--display-font);
  font-size: var(--text-section);
  font-weight: 780;
  color: #15315f;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-size: var(--text-meta);
  font-weight: 800;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.command-module-nav {
  min-height: 0;
  overflow-y: auto;
  align-self: stretch;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

body[data-active-view="ask"] .command-module-nav {
  display: none;
}

body[data-active-view="command"] .command-module-nav {
  display: grid;
}

.nav-group-label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 38px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #314159;
  font-size: var(--text-body);
  font-weight: 760;
  line-height: 1.25;
}

.side-nav a span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: var(--text-meta);
  font-weight: 820;
}

.side-nav a.active,
.side-nav a:hover {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(34, 88, 208, 0.18);
}

.sidebar-footer {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.sidebar-footer p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.35;
}

body[data-active-view="ask"] .sidebar-footer {
  display: none;
}

.app-main {
  min-width: 0;
  padding: var(--space-3) var(--space-4) var(--space-6);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(360px, auto) auto;
  gap: var(--space-4);
  align-items: center;
  min-height: 64px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-tight);
  backdrop-filter: blur(10px);
}

.brand-block h1,
.panel h2,
.report-view h3,
.catalog-card h3 {
  margin: 0;
  font-family: var(--display-font);
}

.app-label {
  margin: 0 0 2px;
  color: #56677f;
  font-size: var(--text-meta);
  font-weight: 760;
}

.brand-block h1 {
  font-size: var(--text-page);
  line-height: 1.05;
  font-weight: 780;
  color: #102039;
}

.brand-subtitle,
.data-scope,
.panel-note,
.control-strip p,
.catalog-card p,
.summary-line,
.empty-state,
.error-state,
.loading-state,
.agent-output p,
.claude-output p {
  max-width: 74ch;
}

.brand-subtitle {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.35;
}

.topbar-right {
  display: grid;
  gap: var(--space-1);
  justify-items: start;
  min-width: 0;
}

.data-scope {
  margin: 0;
  color: #526178;
  font-size: var(--text-meta);
  line-height: 1.35;
}

.runtime-strip,
.utility-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.utility-actions {
  justify-content: flex-end;
}

.utility-button,
.utility-link {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  color: #26364f;
  background: var(--surface-raised);
  font-size: var(--text-body);
  font-weight: 760;
  line-height: 1.2;
}

.utility-button:hover,
.utility-link:hover {
  border-color: rgba(34, 88, 208, 0.44);
  color: var(--blue);
}

.eyebrow,
.section-kicker,
.report-id,
.control-label {
  margin: 0 0 var(--space-1);
  color: #51647e;
  font-size: var(--text-meta);
  font-weight: 800;
  text-transform: uppercase;
}

.mode-pill,
.dataset-badge,
.state-pill,
.catalog-count,
.runtime-status,
.run-id,
.validation-chip,
.meta-chip,
.stage-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-meta);
  font-weight: 780;
  line-height: 1.3;
  white-space: nowrap;
}

.mode-pill {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(20, 118, 87, 0.23);
}

.runtime-status,
.run-id,
.state-pill,
.stage-state {
  color: #4d5d73;
  background: #eef3f8;
  border: 1px solid var(--line);
}

.workspace {
  display: grid;
  gap: var(--space-3);
  align-items: start;
  min-width: 0;
  padding-top: var(--space-3);
}

/* UI-1 (audit A1): the Command Center is one column of full-width panels. It used to be a
   3-column grid of named areas; nine panels had no area and one explicit column against three
   area columns collapsed Overview and Activity to 30px. No named areas, no breakpoint variants. */
.command-center-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

body[data-active-view="ask"] .command-center-view,
body[data-active-view="command"] .ask-vince-panel {
  display: none;
}

.ask-vince-panel {
  border-color: rgba(34, 88, 208, 0.2);
  background:
    linear-gradient(135deg, rgba(233, 240, 255, 0.95), rgba(226, 245, 244, 0.92) 56%, rgba(255, 255, 255, 0.98));
}

.panel {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid rgba(185, 199, 216, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.conversations-panel {
  margin-bottom: var(--space-4);
}

.threads-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 220px;
  overflow-y: auto;
}

.thread-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(185, 199, 216, 0.7);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  text-align: left;
}

.thread-list-item.is-active {
  border-color: var(--accent, #3057d5);
  background: rgba(48, 87, 213, 0.08);
}

.thread-list-item .thread-title {
  font-weight: 600;
}

.thread-list-item .thread-meta {
  font-size: var(--text-meta);
  color: rgba(30, 40, 60, 0.65);
}

.ask-vince-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.92fr) minmax(420px, 1.08fr);
  gap: var(--space-3);
  align-items: stretch;
}

body[data-active-view="ask"] .topbar {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

body[data-active-view="ask"] #runtimeStatus,
body[data-active-view="ask"] .topbar .app-label,
body[data-active-view="ask"] .topbar .data-scope,
body[data-active-view="ask"] .ask-vince-panel > .panel-heading .section-kicker,
body[data-active-view="ask"] #unifiedState,
body[data-active-view="ask"] .unified-chat-form .utility-link[data-view-target="command"],
body[data-active-view="ask"] .ask-trust-status,
body[data-active-view="ask"] .ask-trust-details,
body[data-active-view="ask"] .unified-output.is-empty {
  display: none;
}

body[data-active-view="ask"] .workspace {
  align-content: stretch;
  min-height: calc(100vh - 112px);
}

body[data-active-view="ask"] .ask-vince-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  max-width: none;
  min-height: clamp(560px, calc(100vh - 112px), 920px);
  margin: 0;
}

body[data-active-view="ask"]:not(.has-ask-chat) .workspace,
body[data-active-view="ask"]:not(.has-ask-chat) .ask-vince-panel {
  min-height: auto;
}

body[data-active-view="ask"]:not(.has-ask-chat) .ask-vince-panel {
  grid-template-rows: auto auto auto;
}

/* UI-4 (U8, audit E1): the answer and the question box are a column (not a grid) so the question box
   can be `position: sticky; bottom: 0` -- a grid item can only stick inside its own row, which is
   exactly as tall as the box. The answer takes the space above it and the box stays at the bottom of
   the window while an answer is longer than the screen. */
body[data-active-view="ask"] .ask-vince-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
}

body[data-active-view="ask"] .ask-vince-layout .unified-response {
  flex: 1 1 auto;
}

.unified-chat-form {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid rgba(185, 199, 216, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
}

body[data-active-view="ask"] .executive-quiet-control {
  display: none;
}

.unified-chat-form textarea {
  min-height: 118px;
}

/* The per-question Ask engine choice (hidden unless the deployment offers more than one engine) */
.ask-engine-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.ask-engine-field[hidden] {
  display: none;
}

.ask-engine-field select {
  width: auto;
  min-width: 9rem;
}

.ask-engine-note {
  flex: 1 1 16rem;
  font-size: var(--text-meta);
  opacity: 0.8;
}

body[data-active-view="ask"] .unified-chat-form textarea {
  min-height: clamp(76px, 12vh, 148px);
  resize: vertical;
  font-size: var(--text-field);
  line-height: 1.5;
}

body[data-active-view="ask"] .unified-chat-form,
body[data-active-view="ask"] .unified-response,
body[data-active-view="ask"] .ask-results-workbench {
  width: 100%;
}

body[data-active-view="ask"] .unified-chat-form {
  order: 2;
  min-height: 0;
  align-content: start;
  flex: 0 0 auto;
}

/* UI-4 (U8): once there is an answer on screen the question box sticks to the bottom of the window.
   Opaque background so the answer scrolling under it doesn't show through. */
body[data-active-view="ask"].has-ask-chat .unified-chat-form {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: var(--space-3) var(--space-3);
  background: var(--surface);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.35);
}

body[data-active-view="ask"].has-ask-chat .unified-chat-form textarea {
  height: 64px;
  min-height: 56px;
  max-height: 160px;
}

.unified-response {
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(260px, 1.1fr);
  gap: var(--space-3);
  min-width: 0;
}

body[data-active-view="ask"] .unified-response {
  order: 1;
  grid-template-columns: minmax(0, 1fr);
  min-height: min(58vh, 660px);
  align-content: stretch;
}

body[data-active-view="ask"]:not(.has-ask-chat) .unified-response {
  display: none;
}

body[data-active-view="ask"] .unified-output {
  min-height: clamp(260px, 46vh, 650px);
}

.ask-trust-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(185, 199, 216, 0.7);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.84);
  font-size: var(--text-meta);
  font-weight: 740;
}

.trusted-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #28886f;
  box-shadow: 0 0 0 4px rgba(40, 136, 111, 0.12);
}

.ask-trust-status[data-status="running"] .trusted-dot {
  background: #4f8cff;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.14);
}

.ask-trust-status[data-status="blocked"] .trusted-dot,
.ask-trust-status[data-status="unavailable"] .trusted-dot {
  background: #c05621;
  box-shadow: 0 0 0 4px rgba(192, 86, 33, 0.14);
}

.ask-trust-details,
.ask-audit-disclosure {
  min-width: 0;
  border: 1px solid rgba(185, 199, 216, 0.66);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.ask-trust-details summary,
.ask-audit-disclosure summary {
  cursor: pointer;
  min-height: 38px;
  padding: var(--space-3) var(--space-3);
  color: #314159;
  font-size: var(--text-body);
  font-weight: 780;
}

.ask-trust-details .reasoning-trace,
.ask-audit-disclosure .role-audit-state-panel {
  padding: 0 var(--space-3) var(--space-3);
}

.reasoning-trace {
  display: grid;
  gap: var(--space-2);
}

.reasoning-trace article {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  min-height: 58px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid rgba(185, 199, 216, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
}

.reasoning-trace strong {
  display: block;
  color: #203049;
  font-size: var(--text-body);
  line-height: 1.2;
}

.reasoning-trace p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.35;
}

.reasoning-trace .stage-state {
  justify-self: end;
  min-height: 22px;
}

.unified-output {
  min-height: 100%;
  display: grid;
  gap: var(--space-4);
  align-content: start;
  overflow-y: auto;
  padding: var(--space-3);
  border: 1px solid rgba(185, 199, 216, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.unified-answer-card {
  display: grid;
  gap: var(--space-2);
}

.unified-answer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.unified-answer-header h3 {
  margin: var(--space-2) 0 0;
  color: #142033;
  font-size: var(--text-section);
  line-height: 1.2;
}

.unified-answer-card p {
  margin: 0;
  color: var(--text);
  font-size: var(--text-body);
  line-height: 1.45;
}

.unified-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  padding-top: var(--space-1);
}

.ask-chat-turn {
  display: flex;
  min-width: 0;
}

.ask-chat-turn-user {
  justify-content: flex-end;
}

.ask-chat-turn-assistant {
  justify-content: flex-start;
}

.ask-chat-bubble {
  width: min(100%, 860px);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid rgba(185, 199, 216, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-tight);
}

.ask-chat-turn-user .ask-chat-bubble {
  width: min(100%, 760px);
  color: #eef5ff;
  border-color: rgba(95, 130, 255, 0.34);
  background: linear-gradient(135deg, rgba(59, 89, 214, 0.9), rgba(39, 62, 148, 0.94));
}

.ask-chat-turn-user p {
  color: #f7fbff;
}

.ask-chat-turn-assistant.warning .ask-chat-bubble,
.ask-chat-turn-assistant.blocked .ask-chat-bubble {
  border-color: rgba(219, 151, 54, 0.36);
}

.ask-chat-turn-assistant.unavailable .ask-chat-bubble {
  border-color: rgba(179, 58, 58, 0.34);
}

.ask-chat-speaker {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 850;
  text-transform: uppercase;
}

.ask-chat-turn-user .ask-chat-speaker {
  color: rgba(239, 246, 255, 0.78);
}

.ask-chat-answer-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.ask-chat-answer-header h3 {
  margin: 0;
  color: #142033;
  font-size: var(--text-section);
  line-height: 1.2;
}

.ask-chat-bubble p {
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-size: var(--text-body);
  line-height: 1.5;
}

.ask-chat-bubble p:last-child {
  margin-bottom: 0;
}

.query-disclosure {
  margin: var(--space-3) 0;
  border: 1px solid rgba(96, 124, 244, 0.24);
  border-radius: 8px;
  background: rgba(247, 250, 255, 0.76);
  overflow: hidden;
}

.query-disclosure summary {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  color: #23365d;
  font-size: var(--text-meta);
  font-weight: 850;
  cursor: pointer;
}

.query-disclosure summary small {
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.query-sql {
  max-height: 340px;
  margin: 0;
  padding: var(--space-3);
  overflow: auto;
  border-top: 1px solid rgba(96, 124, 244, 0.18);
  background: #08111f;
  color: #dce8ff;
  font-size: var(--text-meta);
  line-height: 1.5;
  white-space: pre;
}

.query-sql code {
  color: inherit;
  font: inherit;
}

.ask-progress-stream {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin-top: var(--space-1);
  padding: var(--space-3);
  border: 1px solid rgba(185, 199, 216, 0.66);
  border-radius: 8px;
  background: rgba(247, 250, 255, 0.84);
}

.ask-progress-stream strong {
  display: block;
  color: #203049;
  font-size: var(--text-body);
  line-height: 1.2;
}

.ask-progress-stream .ask-progress-still {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-meta);
}

.ask-progress-stream ol {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  padding-left: var(--space-4);
  color: var(--muted);
  font-size: var(--text-meta);
}

.ask-progress-stream li.active {
  color: var(--blue);
  font-weight: 800;
}

.ask-progress-summary {
  margin-top: var(--space-3);
  border: 1px solid rgba(20, 118, 87, 0.18);
  border-radius: 8px;
  background: rgba(20, 118, 87, 0.07);
}

.ask-progress-summary summary {
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  color: var(--green);
  font-size: var(--text-meta);
  font-weight: 820;
}

.ask-progress-summary p {
  padding: 0 var(--space-3) var(--space-3);
  color: var(--muted);
  font-size: var(--text-meta);
}

.ask-results-workbench {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(185, 199, 216, 0.72);
}

.ask-results-workbench.is-empty,
.ask-dashboard-preview.is-empty {
  display: none;
}

.ask-report-card,
.ask-dashboard-preview,
.role-audit-state-panel {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid rgba(185, 199, 216, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.role-audit-state-panel {
  display: grid;
  gap: var(--space-3);
}

.role-audit-header,
.audit-layer-heading,
.active-role-copy,
.audit-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.role-audit-header {
  align-items: center;
}

.role-audit-header h3,
.audit-layer-heading strong {
  margin: 0;
  color: #142033;
  font-size: var(--text-field);
  line-height: 1.2;
}

.role-audit-select-label {
  display: grid;
  gap: var(--space-1);
  min-width: 190px;
}

.role-audit-select {
  min-height: 34px;
  font-size: var(--text-meta);
}

.active-role-view,
.query-audit-summary,
.semantic-status-summary,
.memory-evidence-boundary {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid rgba(185, 199, 216, 0.7);
  border-radius: var(--radius);
  background: rgba(247, 250, 252, 0.88);
}

.active-role-view p,
.audit-layer-card p,
.query-audit-summary p,
.semantic-status-summary p,
.memory-evidence-boundary p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.45;
}

.lifecycle-state-rail,
.audit-surface-grid,
.audit-summary-grid {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.audit-surface-grid,
.audit-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lifecycle-state-card,
.audit-layer-card {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid rgba(185, 199, 216, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.lifecycle-state-card.active {
  border-color: rgba(40, 136, 111, 0.38);
  background: rgba(235, 252, 247, 0.76);
}

.lifecycle-state-card strong {
  display: block;
  margin-top: var(--space-2);
  color: #142033;
  font-size: var(--text-body);
}

.lifecycle-state-card p {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.35;
}

.audit-meta-row {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: var(--muted);
  font-size: var(--text-meta);
}

.command-audit-state-panel {
  margin-top: var(--space-3);
}

.ask-output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.ask-kpi-grid {
  margin-top: var(--space-3);
}

.ask-chart-shell,
.ask-table-shell {
  margin-top: var(--space-3);
}

.compact-dashboard-header {
  margin-bottom: var(--space-3);
}

.compact-widget-grid {
  margin-top: var(--space-2);
}

.panel-heading,
.report-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.compact-heading {
  margin-bottom: var(--space-2);
}

.panel h2 {
  font-size: var(--text-section);
  line-height: 1.15;
  font-weight: 760;
}

.panel-note {
  margin: -2px 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.42;
}

.dataset-badge,
.catalog-count {
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(8, 113, 121, 0.22);
}

.request-form,
.claude-form,
.definition-controls {
  display: grid;
  gap: var(--space-2);
}

label {
  color: #53647a;
  font-size: var(--text-meta);
  font-weight: 780;
}

textarea,
select,
input {
  width: 100%;
  font-size: var(--text-field);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 106px;
  padding: var(--space-3) var(--space-3);
  line-height: 1.45;
}

select,
input {
  min-height: 39px;
  padding: 0 var(--space-3);
}

textarea:focus,
select:focus,
input:focus,
button:focus-visible,
a:focus-visible,
tr:focus-visible,
h3:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.request-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.primary-action,
.secondary-action,
.btn-secondary,
.ask-version-btn,
.suggestion-use-btn,
.quality-show-records-btn,
.quality-mark-known-btn,
.quality-reopen-btn,
.quality-export-issue-btn,
.link-sort-btn,
.prompt-bank button,
.catalog-card button,
.workpaper-item,
.definition-item {
  min-height: 39px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 760;
  line-height: 1.35;
}

.primary-action {
  color: #fff;
  background: linear-gradient(180deg, #2b63dc, var(--blue));
  border-color: var(--blue);
  padding: var(--space-2) var(--space-4);
  box-shadow: 0 9px 18px rgba(34, 88, 208, 0.2);
}

.primary-action:hover {
  background: var(--blue-strong);
}

.secondary-action,
.btn-secondary,
.ask-version-btn,
.suggestion-use-btn,
.quality-show-records-btn,
.quality-mark-known-btn,
.quality-reopen-btn,
.quality-export-issue-btn,
.link-sort-btn {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(34, 88, 208, 0.24);
  padding: var(--space-2) var(--space-3);
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
}

.secondary-action:hover,
.btn-secondary:hover,
.ask-version-btn:hover,
.suggestion-use-btn:hover,
.quality-show-records-btn:hover,
.quality-mark-known-btn:hover,
.quality-reopen-btn:hover,
.quality-export-issue-btn:hover,
.link-sort-btn:hover,
.prompt-bank button:hover,
.catalog-card button:hover {
  border-color: rgba(34, 88, 208, 0.48);
}

.small-action {
  min-height: 32px;
}

.prompt-bank {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.prompt-bank button {
  color: var(--text);
  background: #f0f4f8;
  border-color: var(--line);
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-meta);
}

.runtime-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.runtime-checklist article {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
  min-height: 58px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.stage-number {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: var(--text-meta);
  font-weight: 820;
}

.runtime-checklist strong {
  display: block;
  color: #203049;
  font-size: var(--text-body);
  line-height: 1.2;
}

.runtime-checklist p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.35;
}

.runtime-checklist .stage-state {
  grid-column: 2;
  justify-self: start;
  min-height: 22px;
}

.agent-panel textarea,
.claude-panel textarea {
  height: 82px;
  min-height: 82px;
}

.state-pill.validated,
.state-pill.approved,
.state-pill.ready,
.state-pill.passed,
.stage-state {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(20, 118, 87, 0.22);
}

.state-pill.running {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(34, 88, 208, 0.24);
}

.state-pill.failed,
.state-pill.error,
.state-pill.unavailable {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(179, 58, 58, 0.22);
}

.state-pill.blocked,
.state-pill.warning,
.state-pill.warn,
.state-pill.draft {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(152, 101, 15, 0.24);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.catalog-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-2);
  min-height: 150px;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.catalog-card h3 {
  font-size: var(--text-body);
  line-height: 1.2;
}

.catalog-card p {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.38;
}

.catalog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.meta-chip {
  color: #4b5b70;
  background: #eef3f8;
}

/* P91 S1: the workpaper id on an Ask card is a button that looks like the text around it, underlined. */
.link-chip {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* P5F2: the Ask-box answer card's data-source badge. */
.ask-chat-answer-header-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.data-source-badge {
  font-weight: 700;
  white-space: nowrap;
}

.data-source-badge-salesforce {
  color: #0b6b3a;
  background: #e3f6ea;
}

.data-source-badge-sample {
  color: #8a5a00;
  background: #fff2d9;
}

.data-source-badge-guidance {
  color: #3c4a5c;
  background: #e7ecf3;
}

.catalog-card button {
  width: 100%;
  color: var(--blue);
  background: #f7faff;
  border-color: rgba(34, 88, 208, 0.3);
  padding: var(--space-2) var(--space-2);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: var(--space-3);
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 251, 0.96)),
    var(--surface-raised);
  box-shadow: 0 12px 26px rgba(20, 32, 51, 0.055);
}

.kpi-card.primary-kpi {
  grid-column: span 2;
  color: #fff;
  border-color: rgba(34, 88, 208, 0.28);
  background:
    linear-gradient(135deg, rgba(34, 88, 208, 0.97), rgba(8, 113, 121, 0.94)),
    var(--blue);
  box-shadow: 0 18px 34px rgba(34, 88, 208, 0.18);
}

.kpi-card.primary-kpi .kpi-label,
.kpi-card.primary-kpi .kpi-note,
.kpi-card.primary-kpi .kpi-topline {
  color: rgba(255, 255, 255, 0.78);
}

.kpi-card.primary-kpi .kpi-value {
  color: #fff;
}

.kpi-topline {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  color: #68778e;
  font-size: var(--text-meta);
  font-weight: 860;
  text-transform: uppercase;
}

.kpi-label {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 780;
}

.kpi-value {
  margin: 0;
  font-family: var(--display-font);
  font-size: var(--text-page);
  line-height: 1.04;
  font-weight: 820;
  color: #17243a;
}

.kpi-note {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.32;
}

.kpi-accent {
  position: absolute;
  right: 12px;
  bottom: 11px;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
}

.kpi-card[data-accent="teal"] .kpi-accent {
  background: var(--teal);
}

.kpi-card[data-accent="green"] .kpi-accent {
  background: var(--green);
}

.kpi-card.primary-kpi .kpi-accent {
  background: rgba(255, 255, 255, 0.72);
}

.report-view,
.agent-output,
.workpaper-detail,
.claude-output {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: var(--space-3);
}

.report-view h3 {
  font-size: var(--text-section);
  line-height: 1.2;
}

.report-summary,
.chart-shell {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.summary-line {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.artifact-summary {
  margin-top: var(--space-3);
}

.artifact-evidence-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid rgba(20, 118, 87, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f5fbf8);
}

.artifact-evidence-card h3 {
  margin: 0;
  font-size: var(--text-field);
}

.artifact-evidence-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.artifact-evidence-header strong {
  display: block;
  margin-top: 2px;
  color: #10213a;
  font-size: var(--text-body);
  overflow-wrap: anywhere;
}

.artifact-path-list {
  display: grid;
  gap: var(--space-2);
}

.artifact-path-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.24fr) minmax(0, 0.76fr);
  gap: var(--space-2);
  align-items: center;
  min-height: 32px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid rgba(20, 118, 87, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 760;
}

.artifact-path-row code {
  color: #10213a;
  font-size: var(--text-meta);
  white-space: normal;
  overflow-wrap: anywhere;
}

.artifact-file-link {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  color: #10213a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.artifact-file-link:hover,
.artifact-file-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.artifact-file-link code {
  min-width: 0;
  cursor: pointer;
}

.artifact-open-label {
  flex: 0 0 auto;
  padding: 3px var(--space-2);
  border: 1px solid rgba(96, 124, 244, 0.28);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(96, 124, 244, 0.09);
  font-size: var(--text-meta);
  font-weight: 850;
  text-decoration: none;
}

.artifact-boundary-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.executive-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.8fr);
  grid-auto-rows: minmax(118px, auto);
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.chart-card {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #f8fbff),
    var(--surface-raised);
  box-shadow: var(--shadow-tight);
}

.primary-chart-card {
  grid-row: span 2;
}

.chart-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.chart-card h4 {
  margin: 0;
  color: #19283f;
  font-size: var(--text-field);
  line-height: 1.2;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(34, 88, 208, 0.18);
  border-radius: 999px;
  padding: 3px var(--space-2);
  color: var(--blue);
  background: var(--blue-soft);
  font-size: var(--text-meta);
  font-weight: 800;
}

.bar-stack {
  display: grid;
  gap: var(--space-2);
}

.bar-row {
  display: grid;
  grid-template-columns: 24px minmax(112px, 180px) minmax(120px, 1fr) minmax(76px, auto);
  gap: var(--space-2);
  align-items: center;
  min-height: 32px;
}

.bar-rank {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: var(--text-meta);
  font-weight: 850;
}

.bar-label,
.bar-value {
  color: #42526a;
  font-size: var(--text-meta);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.bar-track {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7f1;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.metric-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.metric-summary-grid div {
  min-height: 58px;
  padding: var(--space-2);
  border: 1px solid rgba(216, 225, 236, 0.76);
  border-radius: var(--radius);
  background: #fff;
}

.metric-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 800;
}

.metric-summary-grid strong {
  display: block;
  margin-top: var(--space-2);
  color: #18263c;
  font-family: var(--display-font);
  font-size: var(--text-section);
  line-height: 1.1;
}

.driver-list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.driver-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  min-height: 34px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid #e8edf4;
}

.driver-list li:last-child {
  border-bottom: 0;
}

.driver-list span {
  color: #34445a;
  font-size: var(--text-meta);
  font-weight: 780;
  overflow-wrap: anywhere;
}

.driver-list strong {
  color: var(--blue);
  font-size: var(--text-meta);
  white-space: nowrap;
}

.driver-note,
.sparkline-caption {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.35;
}

.sparkline-svg {
  width: 100%;
  height: 64px;
  margin-top: var(--space-3);
  padding: var(--space-2) 0;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(34, 88, 208, 0.08), rgba(8, 113, 121, 0.05)),
    #fff;
}

.sparkline-svg polyline {
  fill: none;
  stroke: var(--teal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.table-shell {
  overflow-x: auto;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table-caption-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  margin-left: var(--space-1);
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: var(--text-meta);
}

.link-button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.table-caption-bar span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(34, 88, 208, 0.14);
  border-radius: 999px;
  padding: 3px var(--space-2);
  color: #3b4d66;
  background: #f3f7fc;
  font-size: var(--text-meta);
  font-weight: 800;
}

table {
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  border-collapse: collapse;
}

th,
td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid #e8edf4;
  text-align: left;
  font-size: var(--text-body);
  vertical-align: top;
}

th {
  color: #3e4b5f;
  background: #f2f6fb;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.validation-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.validation-chip {
  border-radius: var(--radius);
  color: var(--muted);
  background: #edf1f6;
  border: 1px solid var(--line);
}

.validation-chip.pass {
  color: var(--green);
  background: var(--green-soft);
}

.validation-chip.fail {
  color: var(--red);
  background: var(--red-soft);
}

.validation-chip.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.claude-output {
  min-height: 142px;
  margin-top: var(--space-3);
  color: #334155;
  line-height: 1.48;
}

.claude-output p,
.agent-output p {
  margin: 0 0 var(--space-2);
}

.claude-output p:last-child,
.agent-output p:last-child {
  margin-bottom: 0;
}

.agent-output {
  min-height: 92px;
  overflow: auto;
  color: var(--text);
}

.semantic-plan {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.semantic-plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.semantic-plan-header h3 {
  margin: 0;
  font-size: var(--text-field);
}

.compact-grid {
  grid-template-columns: minmax(118px, 0.32fr) minmax(0, 0.68fr);
  margin-bottom: var(--space-3);
}

.semantic-list p {
  margin: 0 0 var(--space-2);
}

.caveat-list {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-4);
}

.caveat-list li {
  margin-bottom: var(--space-2);
}

.execution-plan {
  border-color: rgba(20, 118, 87, 0.25);
}

.mini-table {
  margin-top: var(--space-3);
}

.dashboard-workspace {
  display: grid;
  gap: var(--space-3);
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 86px;
  padding: var(--space-4);
  border: 1px solid rgba(34, 88, 208, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(34, 88, 208, 0.08), rgba(8, 113, 121, 0.07)),
    var(--surface-raised);
}

.dashboard-header h3,
.dashboard-widget-detail h3 {
  margin: 3px 0 0;
  font-size: var(--text-section);
  line-height: 1.2;
  font-weight: 800;
}

.dashboard-action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: 32px;
}

.dashboard-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.dashboard-widget-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-3);
  min-height: 168px;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-tight);
}

.dashboard-widget-card:hover,
.dashboard-widget-card.active {
  border-color: rgba(34, 88, 208, 0.45);
  background: linear-gradient(180deg, #ffffff, #f7faff);
}

.widget-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.widget-card-heading h4 {
  margin: 3px 0 0;
  font-size: var(--text-body);
  line-height: 1.2;
  font-weight: 820;
}

.widget-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.widget-kpi-strip span {
  display: grid;
  align-content: center;
  min-height: 58px;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-muted);
  font-size: var(--text-meta);
  line-height: 1.25;
}

.widget-kpi-strip strong {
  display: block;
  margin-bottom: 3px;
  color: #10213a;
  font-family: var(--display-font);
  font-size: var(--text-field);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.widget-evidence {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid #e8edf4;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dashboard-evidence-summary,
.dashboard-widget-detail {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.dashboard-widget-detail {
  overflow: auto;
}

.dashboard-action-plan {
  border-color: rgba(34, 88, 208, 0.24);
  background: #f9fbff;
}

.memory-action-plan {
  border-color: rgba(8, 113, 121, 0.26);
  background: #f7fcfc;
}

.report-answer-plan {
  border-color: rgba(8, 113, 121, 0.28);
  background: linear-gradient(180deg, #ffffff 0, #f3fbfb 100%);
}

.report-packet-plan {
  border-color: rgba(20, 118, 87, 0.3);
  background: linear-gradient(180deg, #ffffff 0, #f4fbf8 100%);
}

.report-refinement-plan {
  border-color: rgba(34, 88, 208, 0.28);
  background: linear-gradient(180deg, #ffffff 0, #f5f8ff 100%);
}

.memory-item {
  align-items: flex-start;
}

.memory-summary {
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.35;
}

.memory-result-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.report-answer-points {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.report-refinement-operations {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.report-packet-sections {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.memory-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: #fff;
}

.report-answer-point {
  border-color: rgba(8, 113, 121, 0.2);
}

.report-refinement-operation {
  border-color: rgba(34, 88, 208, 0.2);
}

.report-packet-section {
  border-color: rgba(20, 118, 87, 0.2);
}

.memory-result span {
  display: block;
  margin: 3px 0 var(--space-1);
  color: var(--muted);
  font-size: var(--text-meta);
}

.definition-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.32fr) minmax(360px, 0.68fr);
  gap: var(--space-3);
}

.definition-table-region {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.definition-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-2);
}

.definition-actions .secondary-action,
.definition-actions .primary-action {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
}

.definition-list,
.workpaper-list {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.definition-list {
  overflow: auto;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.definition-item,
.workpaper-item {
  display: grid;
  gap: var(--space-2);
  align-items: start;
  width: 100%;
  min-height: 58px;
  padding: var(--space-2);
  line-height: 1.35;
  text-align: left;
  color: var(--ink);
  background: var(--surface-raised);
  border-color: var(--line);
  overflow-wrap: anywhere;
}

.definition-item.active,
.definition-item:hover,
.workpaper-item:hover,
.workpaper-item.active {
  border-color: rgba(34, 88, 208, 0.45);
  background: var(--blue-soft);
}

.definition-item.passive {
  cursor: default;
}

.definition-item.passive:hover {
  border-color: transparent;
  background: #ffffff;
}

.definition-runtime-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.definition-name,
.workpaper-name {
  display: block;
  font-size: var(--text-body);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.definition-meta,
.definition-note,
.workpaper-meta {
  display: block;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.definition-warning {
  display: block;
  color: #8a4b14;
  font-size: var(--text-meta);
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.definition-note {
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(152, 101, 15, 0.22);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--warning-text);
}

/* A13: a figure the AI calculated (not in the returned data) is tagged beside it; a check that
   fired is a plain note under the narrative. Never a reason to hide the narrative. */
.ask-narrative-calculated {
  display: inline-block;
  margin-left: var(--space-1);
  padding: 0 var(--space-2);
  border: 1px solid rgba(152, 101, 15, 0.22);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--warning-text);
  font-size: var(--text-meta);
  font-weight: 600;
  line-height: 1.5;
  vertical-align: baseline;
}

.ask-narrative-check-note {
  margin: var(--space-2) 0 0;
  padding: var(--space-1) var(--space-3);
  border-left: 3px solid rgba(152, 101, 15, 0.45);
  background: var(--amber-soft);
  color: var(--warning-text);
  font-size: var(--text-meta);
  line-height: 1.4;
}

.evidence-layout {
  display: grid;
  gap: var(--space-3);
}

.deliverable-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.34fr) minmax(0, 0.66fr);
  gap: var(--space-3);
}

.source-evidence-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.38fr) minmax(0, 0.62fr);
  gap: var(--space-3);
}

.source-evidence-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: var(--space-2);
  align-items: end;
  margin-bottom: var(--space-3);
}

.source-evidence-search label,
.source-evidence-search textarea {
  grid-column: 1;
}

.source-evidence-library,
.source-evidence-detail {
  min-width: 0;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.source-evidence-library,
.source-result-list {
  display: grid;
  gap: var(--space-2);
}

.semantic-definition-lineage {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.source-evidence-item,
.source-result {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.semantic-definition-card {
  border-color: rgba(40, 136, 111, 0.28);
  background: rgba(40, 136, 111, 0.06);
}

.evaluation-suite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.evaluation-suite-card,
.evaluation-case-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.evaluation-suite-card span,
.evaluation-case-card span {
  color: var(--muted);
  font-size: var(--text-meta);
}

.evaluation-case-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.failed-case {
  border-color: rgba(172, 57, 49, 0.48);
  background: rgba(172, 57, 49, 0.06);
}

.source-evidence-item strong,
.source-result strong {
  display: block;
  color: #17263d;
  font-size: var(--text-body);
  line-height: 1.25;
}

.source-evidence-item span,
.source-result span,
.source-evidence-item p,
.source-result p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: 1.38;
}

.source-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.source-evidence-plan {
  border-color: rgba(8, 113, 121, 0.28);
  background: linear-gradient(180deg, #ffffff 0, #f4fbfb 100%);
}

.compact-source-results {
  margin-top: var(--space-3);
}

.deliverable-list {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  overflow: auto;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.deliverable-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.deliverable-item .definition-name,
.deliverable-item .definition-meta {
  grid-column: 1 / -1;
}

.deliverable-detail {
  min-height: 340px;
  overflow: auto;
}

.deliverable-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.deliverable-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.review-note-label {
  display: block;
  margin: var(--space-2) 0 var(--space-1);
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 800;
  text-transform: uppercase;
}

.markdown-preview {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.markdown-preview h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-body);
}

.markdown-preview pre {
  max-height: 270px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #263244;
  font-size: var(--text-meta);
}

.workpaper-list {
  overflow: auto;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* UI-1 (audit B2): the one scroll box. Lists that can grow long (hundreds of definitions,
   objects, log rows) opt in with this class; a visible border marks the box and it never
   exceeds 60% of the window or 520px. Everything else shows all its rows. */
.scroll-box {
  max-height: min(60vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.workpaper-detail {
  min-height: 300px;
  overflow: auto;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(128px, 0.32fr) minmax(0, 0.68fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.detail-key,
.detail-value {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid #e8edf4;
  font-size: var(--text-meta);
}

.detail-key {
  color: #45546a;
  background: #f2f6fb;
  font-weight: 800;
}

.detail-value {
  overflow-wrap: anywhere;
  color: #253044;
}

.detail-key:last-of-type,
.detail-value:last-of-type {
  border-bottom: 0;
}

pre {
  max-height: 340px;
  overflow: auto;
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101827;
  color: #eef5ff;
  font-size: var(--text-meta);
  line-height: 1.45;
}

.empty-state,
.error-state,
.loading-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.error-state {
  color: var(--red);
}

/* VFX (2026-09-28): persistent, high-visibility alert -- the connected
   Salesforce login can write data. Never blocks the page; just stays visible at the
   very top until a later crawl records read_only again. */
.salesforce-write-access-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--red);
  color: #ffffff;
  font-weight: 600;
  font-size: var(--text-body);
  text-align: center;
}

.salesforce-write-access-banner[hidden] {
  display: none;
}

@media (max-width: 1400px) {
  .topbar {
    grid-template-columns: minmax(280px, 1fr) minmax(280px, auto);
  }

  .utility-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .ask-vince-layout,
  .unified-response {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* V1 (interface rebuild): the theme layer. Every colour below is a token defined at the top of this file. `premium` (today's dark
   look, served when VINCE2_UI is unset) and the three selectable themes (`precision`, `executive`, `frontier`) are only different
   token values. This block was the 276 `body[data-theme="premium"]` overrides; it now applies to every theme. */
body[data-theme] {
  color: var(--ink);
  background: var(--paint-page);
}

body[data-theme] .app-sidebar {
  border-right-color: var(--nav-edge);
  background: var(--paint-nav);
  box-shadow: var(--nav-shadow);
}

body[data-theme] .sidebar-brand {
  color: var(--nav-brand-text);
}

body[data-theme] .brand-mark {
  color: var(--on-brand);
  background: var(--paint-brand-mark);
  box-shadow: var(--brand-mark-shadow);
}

body[data-theme] .side-nav a {
  color: var(--nav-text);
}

body[data-theme] .side-nav a span {
  color: var(--nav-chip-text);
  background: var(--nav-chip-bg);
}

body[data-theme] .side-nav a.active,
body[data-theme] .side-nav a:hover {
  color: var(--nav-text-strong);
  background: var(--paint-nav-active);
  border-color: var(--nav-active-edge);
  box-shadow: inset 3px 0 0 var(--nav-active-marker);
}

body[data-theme] .sidebar-footer,
body[data-theme] .topbar,
body[data-theme] .panel,
body[data-theme] .unified-chat-form,
body[data-theme] .unified-output,
body[data-theme] .ask-chat-bubble,
body[data-theme] .ask-progress-stream,
body[data-theme] .ask-progress-summary,
body[data-theme] .ask-trust-status,
body[data-theme] .ask-trust-details,
body[data-theme] .ask-audit-disclosure,
body[data-theme] .reasoning-trace article,
body[data-theme] .runtime-checklist article,
body[data-theme] .ask-report-card,
body[data-theme] .ask-dashboard-preview,
body[data-theme] .role-audit-state-panel,
body[data-theme] .active-role-view,
body[data-theme] .lifecycle-state-card,
body[data-theme] .audit-layer-card,
body[data-theme] .query-audit-summary,
body[data-theme] .semantic-status-summary,
body[data-theme] .memory-evidence-boundary,
body[data-theme] .report-view,
body[data-theme] .agent-output,
body[data-theme] .workpaper-detail,
body[data-theme] .claude-output,
body[data-theme] .catalog-card,
body[data-theme] .chart-card,
body[data-theme] .semantic-plan,
body[data-theme] .dashboard-header,
body[data-theme] .dashboard-widget-card,
body[data-theme] .dashboard-evidence-summary,
body[data-theme] .dashboard-widget-detail,
body[data-theme] .definition-list,
body[data-theme] .workpaper-list,
body[data-theme] .source-evidence-library,
body[data-theme] .source-evidence-detail,
body[data-theme] .source-evidence-item,
body[data-theme] .source-result,
body[data-theme] .evaluation-suite-card,
body[data-theme] .evaluation-case-card,
body[data-theme] .memory-result,
body[data-theme] .deliverable-list,
body[data-theme] .markdown-preview,
body[data-theme] .detail-grid,
body[data-theme] .table-shell {
  border-color: var(--line);
  background: var(--paint-panel);
  box-shadow: var(--shadow-tight);
}

body[data-theme] .app-sidebar .sidebar-footer {
  border-color: var(--nav-footer-edge);
  background: var(--paint-nav-footer);
  box-shadow: var(--nav-footer-shadow);
}

body[data-theme] .sidebar-footer p {
  color: var(--nav-footer-text);
}

body[data-theme] .nav-group-label {
  color: var(--nav-group-label);
}

body[data-theme] .command-module-nav {
  border-top-color: var(--nav-rule);
}

body[data-theme] .topbar {
  background: var(--paint-topbar);
  backdrop-filter: var(--topbar-filter);
}

body[data-theme] .ask-vince-panel,
body[data-theme] .command-center-intro {
  border-color: var(--hero-edge);
  background: var(--paint-hero);
  box-shadow: var(--hero-shadow);
}

body[data-theme] .brand-block h1,
body[data-theme] .panel h2,
body[data-theme] .report-view h3,
body[data-theme] .catalog-card h3,
body[data-theme] .unified-answer-header h3,
body[data-theme] .ask-chat-answer-header h3,
body[data-theme] .ask-progress-stream strong,
body[data-theme] .reasoning-trace strong,
body[data-theme] .runtime-checklist strong,
body[data-theme] .kpi-value,
body[data-theme] .chart-card h4,
body[data-theme] .metric-summary-grid strong,
body[data-theme] .dashboard-header h3,
body[data-theme] .dashboard-widget-detail h3,
body[data-theme] .widget-kpi-strip strong,
body[data-theme] .source-evidence-item strong,
body[data-theme] .source-result strong,
body[data-theme] .artifact-evidence-header strong,
body[data-theme] .role-audit-header h3,
body[data-theme] .audit-layer-heading strong,
body[data-theme] .lifecycle-state-card strong {
  color: var(--heading-text);
}

body[data-theme] .app-label,
body[data-theme] .eyebrow,
body[data-theme] .section-kicker,
body[data-theme] .report-id,
body[data-theme] .control-label,
body[data-theme] .ask-chat-speaker,
body[data-theme] .ask-progress-summary summary,
body[data-theme] label {
  color: var(--label-text);
}

body[data-theme] .ask-chat-turn-user .ask-chat-speaker,
body[data-theme] .ask-chat-turn-user p {
  color: var(--bubble-text);
}

body[data-theme] .ask-chat-turn-user .ask-chat-bubble {
  border-color: var(--bubble-edge);
  background: var(--paint-bubble);
}

body[data-theme] .brand-subtitle,
body[data-theme] .data-scope,
body[data-theme] .panel-note,
body[data-theme] .summary-line,
body[data-theme] .empty-state,
body[data-theme] .loading-state,
body[data-theme] .catalog-card p,
body[data-theme] .reasoning-trace p,
body[data-theme] .runtime-checklist p,
body[data-theme] .unified-answer-card p,
body[data-theme] .ask-chat-bubble p,
body[data-theme] .ask-progress-stream ol,
body[data-theme] .ask-progress-summary p,
body[data-theme] .kpi-label,
body[data-theme] .kpi-note,
body[data-theme] .kpi-topline,
body[data-theme] .bar-label,
body[data-theme] .bar-value,
body[data-theme] .driver-note,
body[data-theme] .sparkline-caption,
body[data-theme] .memory-summary,
body[data-theme] .definition-meta,
body[data-theme] .definition-note,
body[data-theme] .workpaper-meta,
body[data-theme] .source-evidence-item span,
body[data-theme] .source-result span,
body[data-theme] .source-evidence-item p,
body[data-theme] .source-result p,
body[data-theme] .evaluation-suite-card span,
body[data-theme] .evaluation-case-card span {
  color: var(--muted);
}

body[data-theme] .active-role-view p,
body[data-theme] .audit-layer-card p,
body[data-theme] .query-audit-summary p,
body[data-theme] .semantic-status-summary p,
body[data-theme] .memory-evidence-boundary p,
body[data-theme] .lifecycle-state-card p,
body[data-theme] .audit-meta-row {
  color: var(--muted);
}

body[data-theme] textarea,
body[data-theme] select,
body[data-theme] input {
  color: var(--input-text);
  background: var(--input-bg);
  border-color: var(--input-border);
  box-shadow: var(--input-shadow);
}

body[data-theme] textarea::placeholder,
body[data-theme] input::placeholder {
  color: var(--placeholder);
}

body[data-theme] textarea:focus,
body[data-theme] select:focus,
body[data-theme] input:focus,
body[data-theme] button:focus-visible,
body[data-theme] a:focus-visible {
  outline-color: var(--focus-ring);
}

body[data-theme] .primary-action {
  color: var(--on-accent);
  background: var(--paint-primary);
  border-color: var(--primary-edge);
  box-shadow: var(--primary-shadow);
}

body[data-theme] .primary-action:hover {
  background: var(--paint-primary-hover);
}

body[data-theme] .secondary-action,
body[data-theme] .btn-secondary,
body[data-theme] .ask-version-btn,
body[data-theme] .suggestion-use-btn,
body[data-theme] .quality-show-records-btn,
body[data-theme] .quality-mark-known-btn,
body[data-theme] .quality-reopen-btn,
body[data-theme] .quality-export-issue-btn,
body[data-theme] .link-sort-btn,
body[data-theme] .utility-button,
body[data-theme] .utility-link,
body[data-theme] .prompt-bank button,
body[data-theme] .catalog-card button {
  color: var(--button-text);
  background: var(--button-bg);
  border-color: var(--button-edge);
}

body[data-theme] .secondary-action:hover,
body[data-theme] .btn-secondary:hover,
body[data-theme] .ask-version-btn:hover,
body[data-theme] .suggestion-use-btn:hover,
body[data-theme] .quality-show-records-btn:hover,
body[data-theme] .quality-mark-known-btn:hover,
body[data-theme] .quality-reopen-btn:hover,
body[data-theme] .quality-export-issue-btn:hover,
body[data-theme] .link-sort-btn:hover,
body[data-theme] .utility-button:hover,
body[data-theme] .utility-link:hover,
body[data-theme] .prompt-bank button:hover,
body[data-theme] .catalog-card button:hover {
  color: var(--button-hover-text);
  border-color: var(--button-hover-edge);
  background: var(--button-hover-bg);
}

body[data-theme] .mode-pill,
body[data-theme] .dataset-badge,
body[data-theme] .catalog-count,
body[data-theme] .metric-chip,
body[data-theme] .meta-chip,
body[data-theme] .table-caption-bar span,
body[data-theme] .validation-chip {
  color: var(--chip-text);
  background: var(--chip-bg);
  border-color: var(--chip-edge);
}

body[data-theme] .runtime-status,
body[data-theme] .run-id,
body[data-theme] .state-pill,
body[data-theme] .stage-state {
  color: var(--pill-text);
  background: var(--pill-bg);
  border-color: var(--pill-edge);
}

body[data-theme] .ask-trust-details summary,
body[data-theme] .ask-audit-disclosure summary,
body[data-theme] .query-disclosure summary,
body[data-theme] .ask-trust-status {
  color: var(--button-text);
}

body[data-theme] .query-disclosure {
  border-color: var(--disclosure-edge);
  background: var(--disclosure-bg);
}

body[data-theme] .query-disclosure summary small {
  color: var(--disclosure-small-text);
}

body[data-theme] .query-sql {
  border-top-color: var(--disclosure-rule);
  background: var(--code-bg);
  color: var(--code-text);
}

body[data-theme] .artifact-file-link,
body[data-theme] .artifact-file-link code {
  color: var(--button-text);
}

body[data-theme] .artifact-file-link:hover,
body[data-theme] .artifact-file-link:focus-visible {
  color: var(--teal);
}

body[data-theme] .artifact-open-label {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: var(--teal-edge);
}

body[data-theme] .state-pill.validated,
body[data-theme] .state-pill.approved,
body[data-theme] .state-pill.ready,
body[data-theme] .state-pill.passed,
body[data-theme] .validation-chip.pass,
body[data-theme] .mode-pill,
body[data-theme] .stage-state {
  color: var(--success-text);
  background: var(--success-bg);
  border-color: var(--success-mark);
}

body[data-theme] .state-pill.running {
  color: var(--info-text);
  background: var(--info-bg);
  border-color: var(--info-mark);
}

body[data-theme] .state-pill.failed,
body[data-theme] .state-pill.error,
body[data-theme] .state-pill.unavailable,
body[data-theme] .validation-chip.fail,
body[data-theme] .error-state {
  color: var(--error-text);
  background: var(--error-bg);
  border-color: var(--error-mark);
}

body[data-theme] .state-pill.blocked,
body[data-theme] .state-pill.warning,
body[data-theme] .state-pill.warn,
body[data-theme] .state-pill.draft,
body[data-theme] .validation-chip.warn {
  color: var(--warning-text);
  background: var(--warning-bg);
  border-color: var(--warning-mark);
}

body[data-theme] .kpi-card {
  border-color: var(--kpi-edge);
  background: var(--paint-kpi);
}

body[data-theme] .kpi-card.primary-kpi {
  background: var(--paint-kpi-primary);
}

body[data-theme] .kpi-accent,
body[data-theme] .bar-fill {
  background: var(--paint-bar);
}

body[data-theme] .bar-track {
  background: var(--bar-track);
}

body[data-theme] .bar-rank,
body[data-theme] .stage-number {
  color: var(--chip-text);
  background: var(--rank-bg);
}

body[data-theme] .metric-summary-grid div,
body[data-theme] .artifact-evidence-card,
body[data-theme] .artifact-path-row,
body[data-theme] .active-role-view,
body[data-theme] .lifecycle-state-card,
body[data-theme] .audit-layer-card,
body[data-theme] .query-audit-summary,
body[data-theme] .semantic-status-summary,
body[data-theme] .memory-evidence-boundary,
body[data-theme] .dashboard-widget-card:hover,
body[data-theme] .dashboard-widget-card.active,
body[data-theme] .definition-item,
body[data-theme] .workpaper-item,
body[data-theme] .dashboard-action-plan,
body[data-theme] .memory-action-plan,
body[data-theme] .report-answer-plan,
body[data-theme] .report-packet-plan,
body[data-theme] .report-refinement-plan,
body[data-theme] .source-evidence-plan,
body[data-theme] .sparkline-svg {
  border-color: var(--inset-edge);
  background: var(--paint-inset);
}

body[data-theme] .definition-item:hover,
body[data-theme] .definition-item.active,
body[data-theme] .workpaper-item:hover,
body[data-theme] .workpaper-item.active {
  color: var(--selected-text);
  border-color: var(--selected-edge);
  background: var(--selected-bg);
}

body[data-theme] .definition-item.passive:hover {
  background: var(--inset-passive-hover);
  border-color: var(--line);
}

body[data-theme] .driver-list li,
body[data-theme] th,
body[data-theme] td,
body[data-theme] .widget-evidence,
body[data-theme] .detail-key,
body[data-theme] .detail-value {
  border-color: var(--table-rule);
}

body[data-theme] th,
body[data-theme] .detail-key {
  color: var(--th-text);
  background: var(--th-bg);
}

body[data-theme] td,
body[data-theme] .detail-value,
body[data-theme] .markdown-preview pre,
body[data-theme] .artifact-path-row code,
body[data-theme] .driver-list span {
  color: var(--text);
}

body[data-theme] .definition-warning {
  color: var(--warning-text);
}

body[data-theme] .definition-note {
  color: var(--note-text);
  background: var(--amber-soft);
}

body[data-theme] pre {
  color: var(--pre-text);
  background: var(--pre-bg);
  border-color: var(--pre-edge);
}

body[data-theme] table {
  background: var(--table-bg);
}

body[data-theme] .sparkline-svg polyline {
  stroke: var(--teal);
}

body[data-theme] .catalog-card,
body[data-theme] .dashboard-widget-card,
body[data-theme] .workpaper-item,
body[data-theme] .definition-item {
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

body[data-theme] .catalog-card:hover,
body[data-theme] .dashboard-widget-card:hover,
body[data-theme] .workpaper-item:hover,
body[data-theme] .definition-item:hover {
  transform: var(--hover-lift);
}

body[data-theme] ::selection {
  color: var(--selection-text);
  background: var(--selection-bg);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .side-nav a {
    flex: 0 0 auto;
  }

  .primary-side-nav {
    justify-content: flex-start;
  }

  .command-module-nav {
    grid-column: 1 / -1;
    align-self: stretch;
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
  }

  .nav-group-label {
    display: none;
  }

  .sidebar-footer {
    min-width: 160px;
  }

  .topbar {
    position: static;
  }

  .definition-layout,
  .deliverable-layout,
  .source-evidence-layout,
  .source-evidence-search {
    grid-template-columns: 1fr;
  }

  .definition-actions {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .dashboard-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lifecycle-state-rail,
  .audit-surface-grid,
  .audit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .executive-chart-grid {
    grid-template-columns: 1fr;
  }

  .primary-chart-card {
    grid-row: auto;
  }

  .kpi-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: var(--space-3) var(--space-3) var(--space-5);
  }

  .app-sidebar {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .sidebar-footer {
    min-width: 0;
  }

  .topbar,
  .workspace,
  .panel,
  .ask-vince-panel,
  .ask-results-workbench,
  .ask-report-card,
  .ask-dashboard-preview,
  .role-audit-state-panel,
  .unified-chat-form,
  .unified-output,
  .reasoning-trace,
  .report-view,
  .dashboard-workspace,
  .workpaper-detail,
  .definition-list,
  .deliverable-detail,
  .source-evidence-detail,
  .memory-list,
  .table-shell,
  .chart-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .topbar,
  .panel-heading,
  .report-title-row,
  .role-audit-header,
  .active-role-copy,
  .semantic-plan-header {
    display: grid;
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .panel-heading .state-pill,
  .panel-heading .dataset-badge,
  .panel-heading .catalog-count,
  .report-title-row .run-id {
    justify-self: start;
  }

  .utility-actions,
  .runtime-strip {
    justify-content: flex-start;
  }

  .brand-block h1 {
    font-size: var(--text-page);
  }

  .brand-subtitle {
    max-width: 100%;
    font-size: var(--text-body);
    overflow-wrap: anywhere;
  }

  .data-scope,
  .empty-state,
  .panel-note,
  .unified-output,
  .report-summary,
  .workpaper-detail {
    overflow-wrap: anywhere;
  }

  .request-actions,
  .prompt-bank,
  .catalog-grid,
  .kpi-grid,
  .metric-summary-grid,
  .definition-actions,
  .source-evidence-search,
  .dashboard-widget-grid,
  .lifecycle-state-rail,
  .audit-surface-grid,
  .audit-summary-grid,
  .widget-kpi-strip,
  .bar-row,
  .runtime-checklist article {
    grid-template-columns: 1fr;
  }

  .role-audit-select-label {
    min-width: 0;
  }

  textarea,
  select,
  input,
  button,
  .utility-link,
  .utility-button,
  .primary-action,
  .secondary-action {
    max-width: 100%;
    min-width: 0;
  }

  .dashboard-header,
  .deliverable-detail-header,
  .chart-card-heading,
  .driver-list li,
  .widget-card-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  .kpi-card.primary-kpi {
    grid-column: auto;
  }

  .stage-number {
    width: 30px;
    height: 30px;
  }

  .panel {
    padding: var(--space-3);
  }

  .bar-value {
    justify-self: start;
  }

  .bar-rank {
    justify-self: start;
  }

  .detail-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .detail-key {
    border-bottom: 0;
  }

  .mode-pill,
  .dataset-badge,
  .state-pill,
  .catalog-count,
  .runtime-status,
  .run-id,
  .validation-chip,
  .meta-chip,
  .stage-state {
    white-space: normal;
  }
}

.command-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}

.command-overview-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-raised);
}

.command-overview-block h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.command-overview-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-meta);
}

.command-overview-list li {
  border-top: 1px solid var(--line);
  padding-top: var(--space-2);
}

.command-overview-open {
  padding: 2px var(--space-2);
  margin-right: var(--space-2);
}

/* P3F6 / UI-1 (audit B1): dialogs (change password, reset password, mark issue known) --
   fixed overlay over the whole window, card centred, overlay scrolls only when the card is
   taller than the window. Closed by Escape or Cancel (app.js). Own classes: these used to also
   carry `definition-list`, whose 260px max-height clipped the card and hid Save and Cancel. */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100; /* above the sticky write-access alert (1000) */
  display: flex;
  padding: var(--space-4);
  overflow-y: auto;
  background: rgba(15, 18, 24, 0.55);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  margin: auto; /* centres both ways; falls back to top-aligned, scrollable, when taller than the window */
  background: var(--surface, #fff);
  border-radius: 8px;
  padding: var(--space-5) var(--space-5);
  width: min(360px, 100%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.modal-card form {
  display: grid;
  gap: var(--space-2);
}

/* P4F7: standard clip-technique visually-hidden helper (P3-F5 convention) -- content
   stays in the accessibility tree and reachable by screen readers, but is never shown
   visually. Used for the chart's label:value text alternative below. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* UI-4 (U8, audit E3): chart marks and text take their colour from theme tokens (defined with the
   user-bubble tokens below), measured against the panel surface; the old light-theme blue was 2.17:1. */
.ask-chart {
  margin: var(--space-2) 0 var(--space-3);
  padding: 0;
  color: var(--chart-mark);
}

.ask-chart-bar.ask-chart-s0 { fill: var(--chart-mark); }
.ask-chart-bar.ask-chart-s1 { fill: var(--chart-mark-alt); }
.ask-chart-line { fill: none; }
.ask-chart-line.ask-chart-s0 { stroke: var(--chart-mark); }
.ask-chart-line.ask-chart-s1 { stroke: var(--chart-mark-alt); }
.ask-chart-axis { stroke: var(--chart-axis); }

.ask-chart svg {
  width: 100%;
  height: auto;
  max-height: 220px;
}

.ask-chart-note,
.ask-chart .ask-chart-note {
  margin: var(--space-1) 0 0;
  font-size: var(--text-meta);
  color: var(--chart-note);
}

/* UI-1 (audit A3): how far down the sticky Review batch bar sits so it stops under the sticky
   top bar instead of sliding beneath it. Values are the measured top bar height plus 8px at
   the three layouts (wide 123px, 1400px and narrower 153px, 1120px and narrower: the top bar
   is not sticky, so 0). Re-measure if the top bar content changes. */
:root { --topbar-clear: 140px; }
@media (max-width: 1400px) { :root { --topbar-clear: 172px; } }
@media (max-width: 1120px) { :root { --topbar-clear: 0px; } }
/* With the top bar now staying put, a menu link that scrolls to a panel would land its heading
   underneath it; this keeps the panel's top edge just below the bar. */
#commandCenter .panel { scroll-margin-top: var(--topbar-clear, 0px); }

/* REVIEW-UI: batch review table, replies, and the list-row overlap fix. */
.workpaper-list { grid-auto-rows: max-content; }
.workpaper-item { min-height: max-content; }
.rv-tabs { display: flex; gap: var(--space-2); margin: var(--space-2) 0; flex-wrap: wrap; }
.rv-tab { padding: var(--space-2) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-raised); cursor: pointer; }
.rv-tab.active { background: var(--blue-soft); border-color: rgba(34, 88, 208, 0.45); font-weight: 600; }
.rv-filters { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: end; margin: var(--space-2) 0; }
.rv-filters label { display: grid; gap: 3px; font-size: var(--text-meta); }
.rv-batchbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin: var(--space-2) 0; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--blue-soft); position: sticky; top: var(--topbar-clear, 0); z-index: 2; }
.rv-batchbar #rvDraftSummary { flex: 1 1 200px; font-weight: 600; }
.rv-batchbar button { width: auto; min-width: 0; }
.rv-tablewrap { overflow-x: auto; }
.rv-table { width: 100%; border-collapse: collapse; font-size: var(--text-body); }
.rv-table th, .rv-table td { padding: var(--space-2); border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.rv-table th { background: var(--surface-raised); }
.rv-table td:nth-child(1) { min-width: 180px; }
.rv-table td.rv-meaning { min-width: 260px; max-width: 420px; }
.rv-table textarea { width: 100%; min-width: 180px; }
.rv-center { text-align: center !important; }
.rv-api { font-size: var(--text-meta); color: var(--muted); overflow-wrap: anywhere; }
.rv-na, .rv-status { color: var(--muted); font-size: var(--text-meta); }
.rv-placeholder { color: var(--amber); font-weight: 600; }
.rv-row-placeholder { background: rgba(200, 120, 20, 0.07); }
.rv-pager { display: flex; gap: var(--space-3); align-items: center; justify-content: center; margin: var(--space-3) 0; }
.rv-pager button { width: auto; min-width: 0; }
.rv-replies { display: grid; gap: var(--space-3); margin: var(--space-3) 0; }
.rv-card { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); background: var(--surface-raised); }
.rv-card header { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.rv-card p { margin: var(--space-2) 0; }
.rv-diffbody { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }
.rv-before-box, .rv-after-box { padding: var(--space-2); border-radius: var(--radius); border: 1px solid var(--line); }
.rv-before-box { background: rgba(200, 60, 60, 0.06); }
.rv-after-box { background: rgba(40, 150, 80, 0.08); }
.rv-actions { margin-top: var(--space-2); }
.rv-actions button { width: auto; min-width: 0; }
.rv-table { table-layout: fixed; }
.rv-table th:nth-child(1) { width: 22%; }
.rv-table th:nth-child(2) { width: 38%; }
.rv-table th:nth-child(3) { width: 9%; }
.rv-table th:nth-child(4) { width: 8%; }
.rv-table td { overflow-wrap: anywhere; }
.rv-api { white-space: normal; word-break: break-all; }
.rv-table td:nth-child(1), .rv-table td.rv-meaning, .rv-table textarea { min-width: 0; max-width: none; }
.rv-table td:nth-child(1) { min-width: 0; }
/* REVIEW-UI: a wide panel elsewhere in the Command Center (the Semantic Map) stretched every panel to ~3,000px; panels stay at the page width. (The one-column grid itself is `.command-center-view` above.) */
#extensionPanels, #extensionPanels > .panel { min-width: 0; max-width: 100%; }
.rv-tab { color: var(--ink); }

/* ==== UI-2 (audit A2/A4/A5/A7, units U3 + U10): one module at a time, grouped menu, drawer ====
   The page shows one Command Center module. app.js (applyModuleRoute) puts `route-hidden` on the
   panels that are not current; they stay mounted and keep loading. The Semantic Map panel is cut
   into `data-subpage` slices and `#commandCenter[data-subpage]` says which slice is current. */
.route-hidden { display: none !important; }

#commandCenter[data-subpage="run"] [data-subpage]:not([data-subpage~="run"]),
#commandCenter[data-subpage="map"] [data-subpage]:not([data-subpage~="map"]),
#commandCenter[data-subpage="glossary"] [data-subpage]:not([data-subpage~="glossary"]),
#commandCenter[data-subpage="questions"] [data-subpage]:not([data-subpage~="questions"]),
#commandCenter[data-subpage="gaps"] [data-subpage]:not([data-subpage~="gaps"]) {
  display: none;
}

/* Review shows two extension panels at once; give them the same gap as the rest of the page. */
#extensionPanels { display: grid; gap: var(--space-3); }

/* Grouped menu. Link text is the page title; the number chips are gone from the module list. */
.command-module-nav { gap: var(--space-1); }
.nav-group { display: grid; gap: 2px; margin-bottom: var(--space-3); }
.command-module-nav .nav-group a { min-height: 32px; padding: var(--space-2) var(--space-2); overflow-wrap: anywhere; }
/* The sidebar's "Command Center" link is the way in from Ask; once inside, the menu's own
   Command Center group (Overview) replaces it. */
body[data-active-view="command"] .primary-side-nav a[data-view-target="command"] { display: none; }

.side-menu { display: contents; }
.menu-toggle, .menu-backdrop { display: none; }

/* The red write-access alert is sticky at the top of the window; the sticky sidebar and top bar
   start under it instead of sliding beneath it (app.js syncAlertOffset sets --alert-h). */
:root { --alert-h: 0px; }
@media (min-width: 1121px) {
  .app-sidebar { top: var(--alert-h); height: calc(100vh - var(--alert-h)); }
  .topbar { top: var(--alert-h); }
}
.rv-batchbar { top: calc(var(--topbar-clear, 0px) + var(--alert-h)); }
#commandCenter .panel { scroll-margin-top: calc(var(--topbar-clear, 0px) + var(--alert-h)); }

/* 900-1120px (audit A5): the sidebar becomes a strip above the page. The old rule that turned
   the module list into one scrolling row lost to `body[data-active-view="command"]
   .command-module-nav { display: grid }`, so the whole list stacked above the content. */
@media (max-width: 1120px) {
  .sidebar-brand { grid-column: 1; grid-row: 1; }
  .primary-side-nav { grid-column: 2; grid-row: 1; }
  .sidebar-footer { grid-column: 3; grid-row: 1; }
  .command-module-nav { grid-column: 1 / -1; grid-row: 2; }
  body[data-active-view="command"] .command-module-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: var(--space-2);
  }
  .command-module-nav .nav-group {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding-right: var(--space-2);
    border-right: 1px solid var(--line);
  }
  .command-module-nav .nav-group-label { display: block; margin: 0 var(--space-1) 0 0; white-space: nowrap; }
  .command-module-nav .nav-group a { flex: 0 0 auto; white-space: nowrap; min-height: 34px; }
}

/* Below 900px (unit U10): a slim bar with the brand and a Menu button; the same menu opens as a
   drawer from the left. */
@media (max-width: 900px) {
  :root { --topbar-clear: 64px; }
  /* One column of plain blocks: as a grid row the sidebar could only stick inside its own row, and
     the 720px rule above made the shell a scroll container (overflow hidden), which also stops it. */
  .app-shell { display: block; overflow-x: clip; }
  .app-sidebar {
    position: sticky;
    top: var(--alert-h);
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 var(--space-4);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--blue-soft);
    font: inherit;
    font-weight: 760;
    cursor: pointer;
  }
  .side-menu {
    display: block;
    position: fixed;
    top: var(--alert-h);
    bottom: 0;
    left: 0;
    z-index: 8;
    width: min(300px, 86vw);
    overflow-y: auto;
    padding: var(--space-4) var(--space-3) var(--space-5);
    border-right: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.16s ease-out, visibility 0s linear 0.16s;
  }
  body.menu-open .side-menu { transform: none; visibility: visible; transition: transform 0.16s ease-out; }
  body.menu-open .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 7;
    background: rgba(3, 7, 17, 0.6);
  }
  .side-menu .side-nav { display: grid; overflow: visible; padding: 0 0 var(--space-3); }
  .side-menu .primary-side-nav { margin-bottom: var(--space-2); }
  .side-menu .sidebar-footer { min-width: 0; }
  .side-menu .command-module-nav,
  body[data-active-view] .side-menu .command-module-nav {
    display: grid;
    overflow: visible;
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
  }
  .side-menu .command-module-nav .nav-group { display: grid; padding-right: 0; border-right: 0; gap: 2px; margin-bottom: var(--space-3); }
  .side-menu .command-module-nav .nav-group a { white-space: normal; }
  .side-menu .sidebar-footer { display: grid; }
}

/* The page header takes focus when you move between pages (so a screen reader announces it); it is
   not a control, so no focus box. */
#pageTitle:focus { outline: none; }

/* Review page: the review queue first, then the AI questions inbox slice of the Semantic Map. */
#semanticReviewPanel { order: -1; }

/* ===== UI-3: tables, controls and forms ================================================== */

/* -- U6: the aliased buttons are small, in-line buttons (answer actions, sort headers) --------- */
.btn-secondary,
.ask-version-btn,
.suggestion-use-btn,
.quality-show-records-btn,
.quality-mark-known-btn,
.quality-reopen-btn,
.quality-export-issue-btn {
  min-height: 34px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-body);
}

/* A sort button in a table header is text, not a block button: no fill, no box, an underline on hover. */
.link-sort-btn,
body[data-theme] .link-sort-btn {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: inherit;
}
.link-sort-btn:hover,
body[data-theme] .link-sort-btn:hover {
  background: none;
  color: var(--ink);
  text-decoration: underline;
}

/* btn-link: a quiet text link that is a button (same look as .link-button, readable on the dark theme). */
.btn-link {
  border: 0;
  background: none;
  padding: 0 2px;
  color: var(--blue);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.btn-link:hover { color: var(--teal); }

/* UI-5: a disabled control is flat and grey with readable text; at 50% opacity white-on-gradient text was 1.3:1. */
button:disabled,
.secondary-action[aria-disabled="true"],
body[data-theme] button:disabled,
body[data-theme] .secondary-action[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--muted-strong);
  background: var(--disabled-bg);
  border-color: var(--line);
  box-shadow: none;
}

/* -- U6: checkboxes and radios were 36-40px blue squares (audit C2) ---------------------------- */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: none;
  accent-color: var(--blue);
  vertical-align: middle;
}

/* -- U6: the .field pattern (audit B7) --------------------------------------------------------- */
/* A form: label above its control, 40px controls, two columns, one column on a phone. */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
  align-items: start;
}
.field {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}
.field > label {
  color: var(--muted);
  font-size: var(--text-meta);
  font-weight: 700;
}
.field > input,
.field > select {
  min-height: 40px;
  height: 40px;
}
.field > input::placeholder { color: var(--muted); opacity: 0.85; }
.field-wide { grid-column: 1 / -1; }
/* A wrapper that only groups fields (shown or hidden together) takes part in the same grid. */
.field-pair { display: contents; }
.field-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.field-actions .secondary-action,
.field-actions .primary-action { width: auto; min-width: 140px; }
@media (max-width: 720px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
}

/* -- U5: one table wrapper ---------------------------------------------------------------------- */
/* Scrolls sideways (and up/down past its height) inside its own box with a sticky header; the page
   never scrolls sideways because of a table. */
.table-wrap {
  max-width: 100%;
  min-width: 0;
  max-height: min(70vh, 640px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-wrap > table {
  margin: 0;
  border-radius: 0;
  overflow: visible;
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
body[data-theme] .table-wrap thead th {
  background: var(--thead-bg);
  box-shadow: 0 1px 0 var(--thead-rule);
}
.table-wrap td { overflow-wrap: anywhere; }
th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#semanticFindingsTable { min-width: 960px; }
#discoveryGlossaryTable { min-width: 640px; }
#discoveryScopeTable { min-width: 560px; }

/* Ask answer: the value columns are numbers, so they sit on the right; the table scrolls inside
   the answer card on a phone instead of pushing the card wider than the screen. */
.ask-answer-table-wrap { max-height: none; }
.ask-answer-table-wrap th:not(:first-child),
.ask-answer-table-wrap td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ask-answer-table-wrap > table { min-width: 100%; }

/* "Showing 1-100 of 5,472" with Previous / Next / Show all, under a paged table. */
.table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.table-pager-status {
  margin-right: var(--space-1);
  color: var(--muted);
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
}

/* Table tools (brief G): the filter, the column selects, the Columns menu and the "Showing N of M rows" line above a long table or list. */
.tt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-2) 0;
}
.tt-bar label {
  display: grid;
  gap: 2px;
  font-size: var(--text-meta);
  color: var(--muted);
}
.tt-bar input[type="search"],
.tt-bar select {
  min-width: 0;
  max-width: 100%;
}
.tt-filter input[type="search"] { min-width: min(260px, 100%); }
.tt-columns {
  position: relative;
  font-size: var(--text-body);
}
.tt-columns > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.tt-column-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 2px var(--space-3);
  max-height: 260px;
  overflow: auto;
  padding: var(--space-2);
  margin: var(--space-1) 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tt-column-list label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: inherit;
  font-size: var(--text-body);
  overflow-wrap: anywhere;
}
.tt-count {
  margin: var(--space-1) 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
}
.tt-field { margin-right: var(--space-2); overflow-wrap: anywhere; }
.tt-field-name { color: var(--muted); font-size: var(--text-meta); }
.table-wrap thead th[aria-sort="ascending"],
.table-wrap thead th[aria-sort="descending"] { text-decoration: underline; }

/* Text that has a customer-build version stays hidden until `/api/auth/me` has said which build this
   is (applyCustomerWording sets data-wording-ready), so the wrong version is never shown, even briefly. */
body:not([data-wording-ready]) [data-customer-text],
body:not([data-wording-ready]) [data-customer-seed-text],
body:not([data-wording-ready]) [data-customer-hide] {
  visibility: hidden;
}

/* Gaps table: room for the kind and field names, and the kinds line wraps instead of running off the card. */
#semanticFindingsTable td:nth-child(1) { min-width: 140px; }
#semanticFindingsTable td:nth-child(3) { min-width: 150px; }
#semanticFindingsSummary .run-id { display: block; white-space: normal; }
/* A number never breaks into pieces ("12845 / 00"); the dimension column takes the squeeze instead. */
.ask-answer-table-wrap td:not(:first-child),
.ask-answer-table-wrap th:not(:first-child) { white-space: nowrap; overflow-wrap: normal; }

/* UI-4 (U8): Ask screen colour tokens. The user's bubble is text on a gradient, so both ends of the
   gradient and the text are tokens, and tests/demo/test_ui4_ask_and_pages.py computes the contrast of the
   text against each end (>= 4.5:1). The chart tokens are measured against --surface (marks >= 3:1,
   the note text >= 4.5:1). Audit E2 and E3: both were light-theme leftovers that lost the cascade. */
:root {
  --ask-user-bubble-start: #2a46b8;
  --ask-user-bubble-end: #0e6f7d;
  --ask-user-bubble-text: #ffffff;
  --chart-mark: var(--teal);
  --chart-mark-alt: var(--blue);
  --chart-axis: var(--muted);
  --chart-note: var(--muted);
}

/* Same specificity as `body[data-theme] .ask-chat-bubble p` (which came later and won, giving
   grey text on blue), plus the turn class, so the user's text can't lose to it again. */
body[data-theme] .ask-chat-turn-user .ask-chat-bubble {
  border-color: var(--bubble-edge);
  background: var(--paint-bubble);
}
body[data-theme] .ask-chat-turn-user .ask-chat-bubble p,
body[data-theme] .ask-chat-turn-user .ask-chat-bubble .ask-chat-speaker {
  color: var(--ask-user-bubble-text);
}

/* Long names (a market, a dimension value, a thread title, a chip) wrap inside their card instead of
   pushing it wider. The first column of an answer table gets a floor so it wraps by words, not letters. */
.ask-chat-bubble p,
.ask-chat-answer-header h3,
.ask-source-summary,
.thread-list-item .thread-title {
  overflow-wrap: break-word;
}
.ask-answer-table-wrap td:first-child,
.ask-answer-table-wrap th:first-child {
  min-width: 160px;
  max-width: 420px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* An empty "Saved threads" panel is one slim row (title and New conversation); with threads it is the
   full list again. app.js (renderThreadsList) toggles `is-empty`. */
.conversations-panel.is-empty {
  padding: var(--space-2) var(--space-4);
  margin-bottom: 0;
}
.conversations-panel.is-empty .section-kicker,
.conversations-panel.is-empty .threads-list {
  display: none;
}
.conversations-panel.is-empty .compact-heading {
  margin-bottom: 0;
  align-items: center;
}
.conversations-panel.is-empty h3 {
  margin: 0;
  font-size: var(--text-field);
}

/* UI-5 (U9): the panel note sits on the tinted Ask panel; --muted measured 4.37:1 there. */
body[data-theme] .panel-note {
  color: var(--muted-strong);
}

/* ==========================================================================================================================
   Interface rebuild, W-B (visual system). Everything below applies only under VINCE2_UI=v4 (`body[data-ui="v4"]`) or styles a
   class that exists only in v4 markup, so the page served with the switch unset is unchanged. Colours are role tokens only.
   Nothing here selects inside the Ask answer card (`.ask-chat-turn-assistant`): that card is parked (OD-1).
   ========================================================================================================================== */

/* The Maintenance fold (menu, W-A): a consultant control inside a customer page is drawn only while Maintenance is open.
   Nothing is fetched or permitted differently; only drawn. */
body[data-ui="v4"]:not([data-maintenance="open"]) .maint-only {
  display: none !important;
}

/* Keyboard: one visible ring everywhere (2.4.7); the sticky top bar and composer must not cover a focused element (2.4.11). */
body[data-ui="v4"] {
  scroll-padding-top: 88px;
  scroll-padding-bottom: 140px;
}

body[data-ui="v4"] :focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

body[data-ui="v4"] .app-sidebar {
  --focus-ring: var(--nav-focus-ring);
}

/* Skip link (W-A adds the link; this is its style): hidden until focused, then the first thing on the page. */
.skip-link {
  position: absolute;
  top: -64px;
  left: var(--space-3);
  z-index: 2000;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: underline;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: var(--space-3);
}

/* Targets (WCAG 2.5.8, 24 x 24): row checkboxes, disclosure summaries and stand-alone links, outside the answer card. */
body[data-ui="v4"] input[type="checkbox"]:not(.ask-chat-turn-assistant *),
body[data-ui="v4"] input[type="radio"]:not(.ask-chat-turn-assistant *) {
  width: 24px;
  height: 24px;
  margin: 0;
}

body[data-ui="v4"] summary:not(.ask-chat-turn-assistant *) {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 28px;
  cursor: pointer;
  list-style: none;
}

body[data-ui="v4"] summary:not(.ask-chat-turn-assistant *)::-webkit-details-marker {
  display: none;
}

body[data-ui="v4"] summary:not(.ask-chat-turn-assistant *)::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform var(--motion-fast) ease;
}

body[data-ui="v4"] details[open] > summary:not(.ask-chat-turn-assistant *)::before {
  transform: rotate(90deg);
}

body[data-ui="v4"] :is(.btn-link, .link-button, td > a):not(.ask-chat-turn-assistant *) {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

body[data-ui="v4"] :is(.btn-link, .link-button, td > a, a.utility-link):not(.ask-chat-turn-assistant *):not(.side-nav *) {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* Motion: no hover lift; the one spinner is the only animation and stops under reduced motion. */
@media (prefers-reduced-motion: reduce) {
  body[data-ui="v4"] *,
  body[data-ui="v4"] *::before,
  body[data-ui="v4"] *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---- V-4: the shell. Sidebar width comes from the theme (224 px; Executive 232), 24 px rows, no "01/02" badges, a visible
   scroll gutter, the footer one line below the links, and the menu is shown on the Ask view too (today it is hidden there). */
body[data-ui="v4"] .app-sidebar {
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2) var(--space-2);
  overflow: hidden;
}

body[data-ui="v4"] .sidebar-brand {
  min-height: 36px;
  padding: 0 var(--space-2);
  font-size: var(--text-lead);
  font-weight: 700;
}

body[data-ui="v4"] .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

body[data-ui="v4"] .side-nav {
  gap: 1px;
}

body[data-ui="v4"] .side-nav a {
  min-height: var(--nav-row-h);
  padding: 0 var(--space-2) 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 500;
  line-height: 1.25;
  transition: background var(--motion-fast) ease;
}

body[data-ui="v4"] .side-nav a > span[aria-hidden="true"] {
  display: none;
}

body[data-ui="v4"] .side-nav a[aria-current="page"] {
  color: var(--nav-text-strong);
  background: var(--paint-nav-active);
  border-color: var(--nav-active-edge);
  box-shadow: inset 3px 0 0 var(--nav-active-marker);
  font-weight: 650;
}

body[data-ui="v4"] .primary-side-nav {
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--nav-rule);
}

body[data-ui="v4"] .command-module-nav,
body[data-ui="v4"][data-active-view="ask"] .command-module-nav {
  display: grid;
  align-content: start;
  padding-top: var(--space-2);
  padding-right: 2px;
  border-top: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

body[data-ui="v4"] .command-module-nav .nav-group a,
body[data-ui="v4"] .nav-group a {
  min-height: var(--nav-row-h);
  padding: 0 var(--space-2) 0 var(--space-3);
}

body[data-ui="v4"] .nav-group,
body[data-ui="v4"] .command-module-nav .nav-group {
  display: grid;
  gap: 1px;
  margin: var(--space-2) 0 0;
}

body[data-ui="v4"] .nav-group-label,
body[data-ui="v4"] .nav-group-title {
  margin: 0;
  padding: 0 var(--space-3);
  color: var(--nav-group-label);
  font-size: var(--text-meta);
  font-weight: 650;
  line-height: 18px;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* The Maintenance group (W-A): a labelled, collapsed-by-default group at the foot of the menu. */
body[data-ui="v4"] .nav-group-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--nav-row-h);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--nav-group-label);
  font: inherit;
  font-size: var(--text-meta);
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

body[data-ui="v4"] .nav-group-toggle:hover {
  color: var(--nav-text-strong);
}

body[data-ui="v4"] .nav-group-toggle::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform var(--motion-fast) ease;
}

body[data-ui="v4"] .nav-group-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

body[data-ui="v4"] .nav-group[data-group="maintenance"] {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--nav-rule);
}

body[data-ui="v4"] .nav-group-note {
  margin: 0;
  padding: 0 var(--space-3);
  color: var(--nav-group-label);
  font-size: var(--text-meta);
  line-height: 1.35;
}

body[data-ui="v4"] .app-sidebar .sidebar-footer,
body[data-ui="v4"][data-active-view="ask"] .app-sidebar .sidebar-footer {
  display: grid;
  gap: 2px;
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3) 0;
  border: 0;
  border-top: 1px solid var(--nav-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-ui="v4"] .app-sidebar .sidebar-footer p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The theme picker (ext/theme_picker.js) sits in the footer and on the System page. */
.theme-picker {
  display: grid;
  gap: 2px;
  margin: var(--space-1) 0 0;
}

body[data-theme] .theme-picker label {
  color: var(--nav-footer-text);
  font-size: var(--text-meta);
  font-weight: 650;
}

.theme-picker select {
  min-height: 28px;
  width: 100%;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-meta);
}

body[data-theme] .panel .theme-picker label {
  color: var(--text-secondary);
}

.panel .theme-picker select {
  width: auto;
  min-width: 220px;
}

/* ---- The three directions: what differs beyond token values (07 section 4, one rule each). ---- */
body[data-theme="precision"] .panel h2,
body[data-theme="precision"] .ask-chat-answer-heading {
  letter-spacing: -0.005em;
}

body[data-theme="executive"] .panel h2,
body[data-theme="executive"] .panel h3,
body[data-theme="executive"] .brand-block h1,
body[data-theme="executive"] .ask-chat-answer-heading {
  font-family: var(--display-font);
  font-weight: 500;
}

body[data-theme="executive"] .panel {
  padding: var(--space-5) var(--space-6);
}

body[data-theme="executive"] .side-nav a[aria-current="page"],
body[data-theme="executive"] .side-nav a.active {
  box-shadow: inset 3px 0 0 var(--nav-active-marker), 0 1px 0 var(--border);
}

body[data-theme="frontier"] .unified-chat-form {
  border-color: transparent;
  background:
    linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box,
    linear-gradient(90deg, var(--brand-from), var(--brand-to)) border-box;
}

/* Numbers read in columns: tabular numerals on the tables outside the answer card (the answer's own tables are parked, P-7). */
body[data-ui="v4"] .table-wrap:not(.ask-answer-table-wrap) table,
body[data-ui="v4"] .count-item .n,
body[data-ui="v4"] .tt-count {
  font-variant-numeric: tabular-nums lining-nums;
}

body[data-ui="v4"] .table-wrap:not(.ask-answer-table-wrap) tbody td {
  vertical-align: top;
}

/* ---- Component grammar for the v4 pages (classes the discovery and review pages use; none exists in today's markup). ---- */
.page-job {
  margin: 2px 0 0;
  max-width: 78ch;
  color: var(--text-secondary);
  font-size: var(--text-body);
}

.count-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: var(--space-3) 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.count-item {
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border-right: 1px solid var(--border);
}

.count-item:last-child {
  border-right: 0;
}

.count-item .n {
  display: block;
  color: var(--text-strong);
  font-size: var(--text-section);
  font-weight: 650;
  line-height: 1.2;
}

.count-item .what {
  display: block;
  color: var(--text);
  font-size: var(--text-meta);
  font-weight: 600;
}

.count-item .scope {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-meta);
}

.count-item.attention .n {
  color: var(--warning-text);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 24px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--text-meta);
  font-weight: 650;
}

.status-chip::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-chip.success {
  color: var(--success-text);
  background: var(--success-bg);
  border-color: var(--success-mark);
}

.status-chip.success::before {
  background: var(--success-mark);
}

.status-chip.info {
  color: var(--info-text);
  background: var(--info-bg);
  border-color: var(--info-mark);
}

.status-chip.info::before {
  background: var(--info-mark);
}

.status-chip.warning {
  color: var(--warning-text);
  background: var(--warning-bg);
  border-color: var(--warning-mark);
}

.status-chip.warning::before {
  background: var(--warning-mark);
  border-radius: 1px;
  transform: rotate(45deg);
}

.status-chip.error {
  color: var(--error-text);
  background: var(--error-bg);
  border-color: var(--error-mark);
}

.status-chip.error::before {
  background: var(--error-mark);
  border-radius: 1px;
}

.state-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-2) 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text);
}

.state-notice .mark {
  flex: none;
  min-width: 6.5em;
  color: var(--text-secondary);
  font-size: var(--text-meta);
  font-weight: 750;
}

.state-notice p {
  margin: 0;
}

.state-notice.info {
  border-color: var(--info-mark);
  background: var(--info-bg);
}

.state-notice.info .mark {
  color: var(--info-text);
}

.state-notice.warning {
  border-color: var(--warning-mark);
  background: var(--warning-bg);
}

.state-notice.warning .mark {
  color: var(--warning-text);
}

.state-notice.loading {
  border-color: var(--info-mark);
}

.state-notice.loading .mark::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: var(--space-2);
  border: 2px solid var(--info-mark);
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: v4-spin 900ms linear infinite;
}

@keyframes v4-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Maintenance-only region: dashed boundary; shown only while the Maintenance fold is open (see .maint-only above). */
.action-region {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.action-region p {
  margin: 0;
  max-width: 90ch;
  color: var(--text-secondary);
  font-size: var(--text-meta);
}

/* Lists of names: long API names wrap anywhere; a fixed-height scroll box. */
body[data-ui="v4"] .status-names {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  align-content: start;
  column-gap: var(--space-5);
  max-height: 360px;
  margin: var(--space-2) 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  list-style: none;
}

body[data-ui="v4"] .status-names li {
  min-width: 0;
  padding: 3px 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: var(--text-meta);
}

body[data-ui="v4"] .status-names code {
  color: var(--text-strong);
  font-family: var(--mono-font);
  font-size: var(--text-meta);
}

body[data-ui="v4"] .status-names .absent {
  color: var(--text-muted);
  font-style: italic;
}

.group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.group-row:last-child {
  border-bottom: 0;
}

.group-row p {
  margin: 0;
}

body[data-ui="v4"] .group-row .status-names {
  grid-column: 1 / -1;
}

/* Tabs: a selected tab is a 3 px underline and strong text, not colour alone. */
.tab-bar {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.tab-bar [role="tab"] {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: -1px;
  padding: 0 var(--space-3);
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tab-bar [role="tab"][aria-selected="true"] {
  color: var(--text-strong);
  border-bottom-color: var(--accent);
}

body[data-ui="v4"] .link-sort-btn {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

/* BRIEF_SOW_SURFACES (2026-10-21): the read-only position on the Status page; long request paths wrap instead of widening the page. */
#readOnlyProofSection code { overflow-wrap: anywhere; }
#readOnlyFooter { overflow-wrap: anywhere; }

/* N17 (2026-10-22): a BI view with Ask beside it (ext/views.js). The dashboard fills two thirds, the conversation one third; under 1000px they stack. */
.view-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: var(--space-4); align-items: start; }
.view-iframe { display: block; width: 100%; height: calc(100vh - 190px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.view-chat-column { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; max-height: calc(100vh - 190px); }
.view-chat-output { flex: 1 1 auto; min-height: 160px; overflow: auto; }
.view-chat-form { display: grid; gap: var(--space-2); }
.view-chat-form textarea { width: 100%; resize: vertical; }
.view-chat-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.view-chat-form .review-note { overflow-wrap: anywhere; margin: 0; }
/* P69 (b): the person's earlier conversations on a view; the list scrolls when it is long */
body[data-ui="v4"] .view-conversations > summary { cursor: pointer; font-size: var(--text-meta); }
.view-conversations-list { display: flex; flex-direction: column; gap: var(--space-2); max-height: 180px; overflow-y: auto; margin-top: var(--space-2); }
/* P72 (b): each earlier conversation is a row: the open button, then Rename and Delete; a row turns into the name box or the delete question in place */
.view-conversation-row { display: flex; gap: var(--space-2); align-items: stretch; }
.view-conversation-row .thread-list-item { flex: 1 1 auto; min-width: 0; }
.view-conversation-row .thread-title { overflow-wrap: anywhere; }
.view-conversation-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.view-conversation-actions button { padding: 2px var(--space-2); font-size: var(--text-meta); }
.view-conversation-edit, .view-conversation-confirm { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); }
.view-conversation-edit label, .view-conversation-confirm p { flex: 1 1 100%; margin: 0; font-size: var(--text-meta); overflow-wrap: anywhere; }
.view-conversation-edit input { flex: 1 1 140px; min-width: 0; }
/* N17 slice 4b: the name row of "Save as new view", and the "Changed the view" block on an answer (each change in words, with Undo) */
.view-save-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.view-save-row input { flex: 1 1 180px; min-width: 0; }
.view-changes { margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); }
.view-changes-heading { margin: 0 0 var(--space-2); font-size: var(--text-body); }
.view-changes-list { margin: 0; padding-left: 1.1em; display: grid; gap: var(--space-2); }
.view-change-text { overflow-wrap: anywhere; }
.view-change-undone .view-change-text { text-decoration: line-through; opacity: 0.75; }
.view-change-refused .view-change-text { font-style: italic; }
.view-change-undo { margin-left: var(--space-2); padding: 2px var(--space-2); }
.view-change-open { margin: var(--space-3) 0 0; }
.view-change-open a { display: inline-block; }
@media (max-width: 1000px) {
  .view-layout { grid-template-columns: minmax(0, 1fr); }
  .view-chat-column { max-height: none; }
}

/* N18 (the view library): the Views entry under Ask is a dropdown that lists every registered view, grouped by report folder; the list scrolls when it is long */
body[data-ui="v4"] .nav-views { display: grid; gap: 1px; margin-top: var(--space-1); }
body[data-ui="v4"] .nav-views-count { margin-left: auto; padding: 0 var(--space-2); border-radius: 999px; background: var(--nav-rule); font-size: var(--text-meta); font-weight: 500; }
body[data-ui="v4"] .nav-views-panel { display: grid; gap: 1px; }
body[data-ui="v4"] .nav-views-panel[hidden] { display: none; }
body[data-ui="v4"] .nav-views-search { margin: var(--space-1) var(--space-2); min-height: 28px; padding: 2px var(--space-2); border-radius: var(--radius-sm); font-size: var(--text-meta); }
body[data-ui="v4"] .nav-views-list { display: grid; gap: 1px; max-height: min(52vh, 420px); overflow-y: auto; scrollbar-gutter: stable; }
body[data-ui="v4"] .nav-views-list .nav-link { padding-left: var(--space-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-ui="v4"] .nav-views-folder { margin: var(--space-2) 0 0; padding: 0 var(--space-3); color: var(--nav-group-label); font-size: var(--text-meta); font-weight: 650; line-height: 18px; }
body[data-ui="v4"] .nav-views-none { margin: 0; padding: 0 var(--space-3); color: var(--nav-group-label); font-size: var(--text-meta); }

/* N18 slice 2 (the view library): a near-copy's selector above the dashboard, and the "variant" tag on a Views menu line */
.view-variants { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); }
.view-variants label { font-size: var(--text-meta); font-weight: 650; }
.view-variants select { flex: 1 1 280px; min-width: 0; max-width: 560px; font-size: var(--text-body); }
.view-variants-note { font-size: var(--text-meta); color: var(--muted, inherit); overflow-wrap: anywhere; }
body[data-ui="v4"] .nav-views-list .nav-views-variant { display: flex; align-items: center; gap: var(--space-1); }
body[data-ui="v4"] .nav-views-title { font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-ui="v4"] .nav-views-tag { flex: none; margin-left: var(--space-1); padding: 0 var(--space-1); border: 1px solid var(--nav-rule); border-radius: var(--radius-sm); font-size: var(--text-meta); font-weight: 500; }

/* P91 S4/S5: a workpaper read as a document; the generation badge on a list row */
.wp-badge { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 10px; font-size: var(--text-meta); font-weight: 700; color: var(--ink); }
.wp-badge-v2 { border-color: rgba(46, 160, 95, 0.6); }
.wp-badge-legacy-complete { border-color: rgba(200, 160, 40, 0.7); }
.wp-badge-legacy-thin { border-color: rgba(214, 90, 60, 0.7); }
.wp-missing { color: var(--muted); font-size: var(--text-meta); margin: var(--space-1, 4px) 0; }
.wp-document { display: grid; gap: var(--space-3, 12px); }
.wp-header { display: grid; gap: var(--space-1, 4px); }
.wp-title { margin: 0; overflow-wrap: anywhere; }
.wp-actions { display: flex; flex-wrap: wrap; gap: var(--space-2, 8px); margin: 0; }
.wp-section { border-top: 1px solid var(--line); padding-top: var(--space-2, 8px); }
.wp-section h3 { margin: 0 0 var(--space-2, 8px); font-size: var(--text-body); }
.wp-facts { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 2px var(--space-3, 12px); margin: 0 0 var(--space-2, 8px); }
.wp-facts dt { color: var(--muted); font-size: var(--text-meta); }
.wp-facts dd { margin: 0; overflow-wrap: anywhere; }
.wp-table-wrap { overflow-x: auto; margin: var(--space-2, 8px) 0; }
.wp-table { border-collapse: collapse; font-size: var(--text-meta); }
.wp-table th, .wp-table td { border: 1px solid var(--line); padding: 2px 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.wp-statement { margin-bottom: var(--space-3, 12px); }
.wp-chip { display: inline-block; padding: 0 var(--space-2); border: 1px solid var(--line); border-radius: 8px; font-size: var(--text-meta); }
.wp-chip-error { border-color: rgba(214, 90, 60, 0.7); }
.wp-chip-ok { border-color: rgba(46, 160, 95, 0.6); }
.wp-integrity-tampered { color: #d65a3c; font-weight: 700; }
.wp-hashes { margin: 0; padding-left: var(--space-4); font-size: var(--text-meta); }
.wp-none { color: var(--muted); }

/* P94: a client session (Expo) sees the BI views as a preview outside the Phase 1A scope. The Beta tag sits in the Views menu header, the note at the top of the
   Views panel and of every view page; they are drawn hidden and shown by ext/views.js for a client only. [data-client-hide] is what a client is not offered
   (changing a view): hidden by the body's data-client-view mark, whatever else toggles the element. */
body[data-client-view] [data-client-hide] { display: none !important; }
body[data-client-view] #personQueuePanel a[href^="#/discovery/"] { display: none; }   /* "open in the map": the Map is not in the client's view */
.nav-beta-tag { flex: none; margin-left: var(--space-2, 8px); padding: 0 var(--space-2); border: 1px solid currentColor; border-radius: 999px; font-size: var(--text-meta); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: #c98a00; }
.nav-beta-tag[hidden], .nav-views-beta[hidden], .beta-note[hidden] { display: none; }
.nav-views-beta { margin: 0 0 var(--space-2, 8px); padding: 0 var(--space-3, 12px); font-size: var(--text-meta); font-weight: 600; color: #c98a00; }
.beta-note { margin: 0 0 var(--space-3, 12px); padding: var(--space-2, 8px) var(--space-3, 12px); border: 1px solid #c98a00; border-left-width: 4px; border-radius: var(--radius, 8px); font-weight: 600; }

/* R174 (Part B): the KPI catalog on the KPI glossary page. */
.kpi-catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.kpi-catalog-tabs [aria-pressed="true"] {
  border-color: var(--teal);
  color: var(--ink);
}
.kpi-assess-same {
  color: var(--teal);
  font-weight: 600;
}
.kpi-assess-diff {
  color: var(--amber);
  font-weight: 600;
}
pre.kpi-formula {
  margin: 0;
  white-space: pre-wrap;
  font-size: var(--text-meta);
}
.kpi-reports {
  margin-top: 6px;
  max-height: 360px;
  overflow: auto;
}
#kpiCatalogSection td {
  min-width: 80px;
}
#kpiCatalogSection td code,
#kpiCatalogSection pre.kpi-formula {
  display: inline-block;
  min-width: 260px;
  word-break: break-all;
}
#kpiCatalogSection .kpi-reports {
  min-width: 620px;
}

/* R174 (Part C): the object and field definitions on the Map's Objects and areas tab. */
#fieldDefsSection td {
  min-width: 80px;
}
#fieldDefsSection pre.kpi-formula {
  display: inline-block;
  min-width: 240px;
  max-height: 220px;
  overflow: auto;
  word-break: break-all;
}
.defs-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0;
}
#fieldDefsSection .defs-text {
  min-width: 260px;
  white-space: pre-wrap;
}

/* R174 (Part A): the data health and gap register on the Findings page. */
#registerSection .defs-text {
  min-width: 240px;
  white-space: pre-wrap;
}
#registerSection pre.kpi-formula {
  display: inline-block;
  min-width: 260px;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.reg-high {
  color: var(--red);
  font-weight: 600;
}
.reg-medium {
  color: var(--amber);
  font-weight: 600;
}
.reg-low {
  color: var(--teal);
  font-weight: 600;
}
#registerSection td {
  min-width: 96px;
}
#registerSection td:first-child {
  min-width: 0;
  white-space: nowrap;
}
