/* Layer order for every vb stylesheet: later layers win; unlayered page CSS beats all of them */
@layer vb.tokens, vb.legacy, vb.base, vb.shell, vb.components, vb.patterns, vb.vendor;

@layer vb.tokens {
    :root {
        /* primitives: raw values, never used directly by components */
        --vb-green-50: #e3f1ec;
        --vb-green-100: #c9e5da;
        --vb-green-300: #7fbfaa;
        --vb-green-500: #2f8d78;
        --vb-green-600: #25755f;
        --vb-green-700: #1d5e4c;
        --vb-green-900: #12382e;
        --vb-ink-0: #ffffff;
        --vb-ink-25: #f6f8f7;
        --vb-ink-50: #eef3f1;
        --vb-ink-100: #e5ebe9;
        --vb-ink-200: #d8e0dd;
        --vb-ink-400: #808c88;
        --vb-ink-500: #5d6966;
        --vb-ink-700: #3b4542;
        --vb-ink-900: #1d2523;
        --vb-red-50: #fbeaea;
        --vb-red-600: #b23b3b;
        --vb-red-700: #9b3030;
        --vb-amber-50: #fbf1de;
        --vb-amber-700: #8f5a0e;
        --vb-blue-50: #e7eefa;
        --vb-blue-600: #2f62a8;
        --vb-blue-700: #2a5694;
        --vb-blue-800: #2424d1;

        /* semantic roles (light): the only colour names components use */
        --vb-bg-canvas: var(--vb-ink-50);
        --vb-bg-surface: var(--vb-ink-0);
        --vb-bg-subtle: var(--vb-ink-25);
        --vb-bg-selected: var(--vb-green-50);
        --vb-text: var(--vb-ink-900);
        --vb-text-muted: var(--vb-ink-500);
        /* the vb-select arrow, in --vb-text-muted (an image cannot read a variable) */
        --vb-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.25 6 7.75l3.5-3.5' fill='none' stroke='%235d6966' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        --vb-text-on-action: #ffffff;
        --vb-border: var(--vb-ink-200);
        --vb-border-control: var(--vb-ink-400);
        --vb-brand: var(--vb-green-500);
        --vb-action: var(--vb-green-600);
        --vb-action-hover: var(--vb-green-700);
        --vb-link: var(--vb-green-600);
        --vb-focus: var(--vb-green-500);
        --vb-success: var(--vb-green-600);
        --vb-success-bg: var(--vb-green-50);
        --vb-success-text: #1f6b5a;
        --vb-warning: var(--vb-amber-700);
        --vb-warning-bg: var(--vb-amber-50);
        --vb-warning-text: var(--vb-amber-700);
        --vb-danger: var(--vb-red-600);
        --vb-danger-bg: var(--vb-red-50);
        --vb-danger-text: var(--vb-red-700);
        --vb-info: var(--vb-blue-600);
        --vb-info-bg: var(--vb-blue-50);
        --vb-info-text: var(--vb-blue-700);
        /* repertory degrees, the way doctors read a remedy list: 1 grey, 2 blue (italic), 3 red (bold), 4 ink (bold
           capitals); 1, 3 and 4 alias the roles above; 2 is darker than info blue, since the italic reads light */
        --vb-degree-1: var(--vb-text-muted);
        --vb-degree-2: var(--vb-blue-800);
        --vb-degree-3: var(--vb-danger);
        --vb-degree-4: var(--vb-text);
        /* degree 2 is bold as well as italic (rubrics.css and the Analysis remedy panels read this) */
        --vb-degree-2-weight: var(--vb-weight-bold);
        /* type: one density, 14px base (docs/adr/0002); px because Bootstrap 3 pages set html to 10px */
        --vb-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        --vb-font-mono: ui-monospace, Menlo, Consolas, monospace;
        /* the reader's text size (Text size in the account menu, kept in this browser: vb-core.js sets it on <html>) */
        --vb-text-scale: 1;
        --vb-text-11: calc(11px * var(--vb-text-scale));
        --vb-text-12: calc(12px * var(--vb-text-scale));
        --vb-text-13: calc(13px * var(--vb-text-scale));
        --vb-text-14: calc(14px * var(--vb-text-scale));
        --vb-text-16: calc(16px * var(--vb-text-scale));
        --vb-text-18: calc(18px * var(--vb-text-scale));
        --vb-text-22: calc(22px * var(--vb-text-scale));
        --vb-text-28: calc(28px * var(--vb-text-scale));
        --vb-text-base: var(--vb-text-14);
        --vb-leading-tight: 1.25;
        --vb-leading-body: 1.5;
        --vb-weight-regular: 400;
        --vb-weight-medium: 500;
        --vb-weight-semibold: 600;
        --vb-weight-bold: 600;
        /* space: 4px base, with 2 and 6 for dense rows */
        --vb-space-2: 2px;
        --vb-space-4: 4px;
        --vb-space-6: 6px;
        --vb-space-8: 8px;
        --vb-space-12: 12px;
        --vb-space-16: 16px;
        --vb-space-20: 20px;
        --vb-space-24: 24px;
        --vb-space-32: 32px;
        --vb-space-40: 40px;
        --vb-space-48: 48px;
        --vb-radius-sm: 4px;
        --vb-radius-md: 6px;
        --vb-radius-lg: 10px;
        --vb-radius-pill: 999px;
        --vb-shadow-sm: 0 1px 2px rgba(29, 37, 35, 0.06);
        --vb-shadow-md: 0 4px 12px -2px rgba(29, 37, 35, 0.12);
        --vb-shadow-lg: 0 16px 32px -8px rgba(29, 37, 35, 0.2);
        /* dims the page behind a dialog or drawer */
        --vb-backdrop: rgba(15, 23, 21, 0.45);
        --vb-duration-fast: 120ms;
        --vb-duration-base: 200ms;
        --vb-ease: cubic-bezier(0.2, 0, 0, 1);
        /* a bottom sheet's slide: longer, with the soft stop of a phone's sheets */
        --vb-duration-sheet: 320ms;
        --vb-ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
        /* z-index: header keeps today's 1030 so Bootstrap and Kendo layers still sit where they did */
        --vb-z-sticky: 900;
        --vb-z-header: 1030;
        --vb-z-menu: 1040;
        --vb-z-drawer: 1050;
        --vb-z-dialog: 1060;
        --vb-z-toast: 1070;
        /* component tokens */
        --vb-control-h: 36px;
        --vb-control-h-sm: 30px;
        --vb-shell-header-h: 68px;
        --vb-shell-content-max: 1440px;
        --vb-shell-sidebar-w: 248px;
        --vb-drawer-w: 460px;
    }

    /* dark roles: only on pages that opt in with data-vb-theme on <html> */
    :root[data-vb-theme="dark"] {
        color-scheme: dark;
        --vb-bg-canvas: #121816;
        --vb-bg-surface: #1a211f;
        --vb-bg-subtle: #161c1a;
        --vb-bg-selected: #1d3029;
        --vb-text: #e4ebe8;
        --vb-text-muted: #a3b0ac;
        --vb-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.25 6 7.75l3.5-3.5' fill='none' stroke='%23a3b0ac' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        --vb-text-on-action: #0f1f1a;
        --vb-border: #2d3835;
        --vb-border-control: #6b7874;
        --vb-brand: #4fb39d;
        --vb-action: #5bb89f;
        --vb-action-hover: #7cc9b2;
        --vb-link: #6cc4ab;
        --vb-focus: #6cc4ab;
        --vb-success: #6cc4ab;
        --vb-success-bg: #16302a;
        --vb-success-text: #8fd6c0;
        --vb-warning: #e2b25c;
        --vb-warning-bg: #352a14;
        --vb-warning-text: #f0c77a;
        --vb-danger: #f08a7e;
        --vb-danger-bg: #3a1f1c;
        --vb-danger-text: #f6a59b;
        --vb-info: #8ab4f0;
        --vb-info-bg: #1b2a40;
        --vb-info-text: #a9c7f5;
        /* degree 2 no longer follows --vb-info: a light blue on the dark surface */
        --vb-degree-2: var(--vb-info-text);
        --vb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --vb-shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
        --vb-shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, 0.6);
    }

    @media (prefers-color-scheme: dark) {
        :root[data-vb-theme="system"] {
            color-scheme: dark;
            --vb-bg-canvas: #121816;
            --vb-bg-surface: #1a211f;
            --vb-bg-subtle: #161c1a;
            --vb-bg-selected: #1d3029;
            --vb-text: #e4ebe8;
            --vb-text-muted: #a3b0ac;
            --vb-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.25 6 7.75l3.5-3.5' fill='none' stroke='%23a3b0ac' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
            --vb-text-on-action: #0f1f1a;
            --vb-border: #2d3835;
            --vb-border-control: #6b7874;
            --vb-brand: #4fb39d;
            --vb-action: #5bb89f;
            --vb-action-hover: #7cc9b2;
            --vb-link: #6cc4ab;
            --vb-focus: #6cc4ab;
            --vb-success: #6cc4ab;
            --vb-success-bg: #16302a;
            --vb-success-text: #8fd6c0;
            --vb-warning: #e2b25c;
            --vb-warning-bg: #352a14;
            --vb-warning-text: #f0c77a;
            --vb-danger: #f08a7e;
            --vb-danger-bg: #3a1f1c;
            --vb-danger-text: #f6a59b;
            --vb-info: #8ab4f0;
            --vb-info-bg: #1b2a40;
            --vb-info-text: #a9c7f5;
            /* degree 2 no longer follows --vb-info: a light blue on the dark surface */
            --vb-degree-2: var(--vb-info-text);
            --vb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
            --vb-shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
            --vb-shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, 0.6);
        }
    }
}
