/* Primitives: plain vb-* classes, usable from Razor, C# StringBuilders and JS strings alike. Colours come only from semantic tokens. */
@layer vb.components {
    /* ---- Hidden on screen, still read by screen readers ---- */
    .vb-visually-hidden {
        position: absolute !important;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* ---- Button: primary for the one main action, secondary for the rest, ghost for low emphasis, danger to destroy ---- */
    .vb-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--vb-space-6);
        height: var(--vb-control-h);
        padding: 0 var(--vb-space-16);
        border: 1px solid transparent;
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        font-family: var(--vb-font-sans);
        font-size: var(--vb-text-14);
        font-weight: var(--vb-weight-semibold);
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
        transition: background-color var(--vb-duration-fast) var(--vb-ease), border-color var(--vb-duration-fast) var(--vb-ease), color var(--vb-duration-fast) var(--vb-ease);
    }

    .vb-btn:hover {
        text-decoration: none;
    }

    .vb-btn:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 2px;
    }

    .vb-btn--primary {
        background: var(--vb-action);
        color: var(--vb-text-on-action);
    }

    .vb-btn--primary:hover {
        background: var(--vb-action-hover);
        color: var(--vb-text-on-action);
    }

    .vb-btn--secondary {
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        border-color: var(--vb-border-control);
    }

    .vb-btn--secondary:hover {
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
    }

    .vb-btn--ghost {
        background: transparent;
        color: var(--vb-link);
    }

    .vb-btn--ghost:hover {
        background: var(--vb-bg-selected);
        color: var(--vb-action-hover);
    }

    .vb-btn--danger {
        background: var(--vb-danger);
        color: var(--vb-text-on-action);
    }

    .vb-btn--danger:hover {
        background: var(--vb-danger-text);
        color: var(--vb-text-on-action);
    }

    .vb-btn--sm {
        height: var(--vb-control-h-sm);
        padding: 0 var(--vb-space-12);
        font-size: var(--vb-text-13);
    }

    /* a menu button with a label (Analysis's Edit): the chevron after the word turns while its menu is open */
    .vb-btn__chevron {
        font-size: 0.75em;
        transition: transform 0.15s ease;
    }

    .vb-btn[aria-expanded="true"] > .vb-btn__chevron {
        transform: rotate(180deg);
    }

    @media (prefers-reduced-motion: reduce) {
        .vb-btn__chevron {
            transition: none;
        }
    }

    /* icon-only: give it an aria-label; a square that never shrinks in a flex row */
    .vb-btn--icon {
        flex-shrink: 0;
        width: var(--vb-control-h);
        padding: 0;
    }

    .vb-btn--icon.vb-btn--sm {
        width: var(--vb-control-h-sm);
    }

    .vb-btn:disabled,
    .vb-btn[aria-disabled="true"] {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }

    /* ---- Form field: label, control, help, error ---- */
    .vb-field {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--vb-space-6);
        min-width: 0;
    }

    .vb-label {
        font-size: var(--vb-text-13);
        font-weight: var(--vb-weight-semibold);
        color: var(--vb-text);
    }

    .vb-required {
        color: var(--vb-danger-text);
        margin-left: 2px;
    }

    .vb-input,
    .vb-select,
    .vb-textarea {
        width: 100%;
        min-height: var(--vb-control-h);
        padding: 0 var(--vb-space-12);
        border: 1px solid var(--vb-border-control);
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        font-family: var(--vb-font-sans);
        font-size: var(--vb-text-14);
        line-height: 1.4;
    }

    .vb-textarea {
        min-height: 96px;
        padding: var(--vb-space-8) var(--vb-space-12);
        resize: vertical;
    }

    .vb-input::placeholder,
    .vb-textarea::placeholder {
        color: var(--vb-text-muted);
        opacity: 1;
    }

    .vb-input:hover,
    .vb-select:hover,
    .vb-textarea:hover {
        border-color: var(--vb-text-muted);
    }

    .vb-input:focus-visible,
    .vb-select:focus-visible,
    .vb-textarea:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 1px;
        border-color: var(--vb-action);
    }

    .vb-input[aria-invalid="true"],
    .vb-select[aria-invalid="true"],
    .vb-textarea[aria-invalid="true"] {
        border-color: var(--vb-danger);
    }

    .vb-input:disabled,
    .vb-select:disabled,
    .vb-textarea:disabled {
        background: var(--vb-bg-subtle);
        color: var(--vb-text-muted);
        cursor: not-allowed;
    }

    /* compact (30px) on tablets and computers: filter rows and toolbars; the same states, a size smaller (phones keep
       36px, for fingers) */
    @media (min-width: 577px) {
        .vb-input.vb-input--sm,
        .vb-select.vb-select--sm {
            min-height: var(--vb-control-h-sm);
            padding: 0 var(--vb-space-8);
            font-size: var(--vb-text-13);
        }

        .vb-select.vb-select--sm:not([multiple]) {
            padding-right: var(--vb-space-24);
            background-position: right var(--vb-space-8) center;
        }
    }

    /* a native select draws its arrow against the right border, whatever the padding: draw our own inside it */
    .vb-select:not([multiple]) {
        -webkit-appearance: none;
        appearance: none;
        padding-right: var(--vb-space-32);
        background-image: var(--vb-select-chevron);
        background-position: right var(--vb-space-12) center;
        background-repeat: no-repeat;
        background-size: 12px;
    }

    /* high contrast: the system's own arrow, which takes the forced colours */
    @media (forced-colors: active) {
        .vb-select:not([multiple]) {
            -webkit-appearance: auto;
            appearance: auto;
            background-image: none;
        }
    }

    /* ---- Hint: a note under a field that a script shows (with the hidden attribute) when it removes typed characters ---- */
    .vb-hint {
        font-size: var(--vb-text-13);
        color: var(--vb-warning-text);
    }

    /* ---- Verification code: one field (vb-input--code) or six one-digit boxes (vb-code) ---- */
    .vb-input.vb-input--code {
        font-size: var(--vb-text-22);
        font-variant-numeric: tabular-nums;
        letter-spacing: 0.4em;
        text-align: center;
    }

    .vb-code {
        display: flex;
        justify-content: center;
        gap: var(--vb-space-8);
    }

    .vb-code > .vb-input {
        width: 44px;
        min-height: 52px;
        padding: 0;
        font-size: var(--vb-text-22);
        font-variant-numeric: tabular-nums;
        text-align: center;
    }

    /* a script adds .filled once a box holds its digit */
    .vb-code > .vb-input.filled {
        border-color: var(--vb-action);
    }

    /* ---- Checklist: rules a value must meet; a script marks each li .valid or .invalid ---- */
    .vb-checklist {
        display: grid;
        gap: var(--vb-space-4);
        margin: 0;
        padding: 0;
        list-style: none;
        font-size: var(--vb-text-13);
        color: var(--vb-text-muted);
    }

    .vb-checklist > li {
        display: flex;
        align-items: baseline;
        gap: var(--vb-space-8);
    }

    .vb-checklist > li::before {
        content: "\f111";
        flex: none;
        width: 14px;
        font-family: "Font Awesome 6 Free";
        font-size: calc(7px * var(--vb-text-scale));
        font-weight: 900;
        text-align: center;
    }

    .vb-checklist > li.valid {
        color: var(--vb-success-text);
    }

    .vb-checklist > li.valid::before {
        content: "\f00c";
        font-size: calc(12px * var(--vb-text-scale));
    }

    .vb-checklist > li.invalid {
        color: var(--vb-danger-text);
    }

    .vb-checklist > li.invalid::before {
        content: "\f00d";
        font-size: calc(12px * var(--vb-text-scale));
    }

    /* read-only: shown and selectable, not editable */
    .vb-input[readonly],
    .vb-textarea[readonly] {
        background: var(--vb-bg-subtle);
    }

    /* ---- Fieldset: a group of checkboxes or radios under one legend ---- */
    .vb-fieldset {
        display: grid;
        gap: var(--vb-space-8);
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .vb-fieldset > legend {
        margin-bottom: var(--vb-space-8);
        padding: 0;
        font-size: var(--vb-text-13);
        font-weight: var(--vb-weight-semibold);
        color: var(--vb-text);
    }

    .vb-check-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
        gap: var(--vb-space-8) var(--vb-space-16);
    }

    /* a long check label (consent, terms) wraps beside its box, which stays on the first line
       (doubled class: .vb-check comes later in this file) */
    .vb-check.vb-check--block {
        align-items: flex-start;
    }

    .vb-check.vb-check--block input {
        flex: none;
        margin-top: 3px;
    }

    /* ---- Document box: legal or long text shown in place, scrolling inside a fixed height ---- */
    .vb-doc {
        max-height: 12rem;
        overflow-y: auto;
        padding: var(--vb-space-12) var(--vb-space-16);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
        font-size: var(--vb-text-13);
    }

    .vb-doc :where(p) {
        margin: 0 0 var(--vb-space-8);
    }

    .vb-help {
        font-size: var(--vb-text-13);
        color: var(--vb-text-muted);
    }

    /* validator spans keep their own inline display toggling (vb-validators.js) */
    .vb-error {
        font-size: var(--vb-text-13);
        color: var(--vb-danger-text);
    }

    .vb-check {
        display: inline-flex;
        align-items: center;
        gap: var(--vb-space-8);
        cursor: pointer;
    }

    .vb-check input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: var(--vb-action);
    }

    /* ---- Alert: status messages; role="status" for success/info, role="alert" for errors ---- */
    .vb-alert {
        display: flex;
        align-items: flex-start;
        gap: var(--vb-space-12);
        padding: var(--vb-space-12) var(--vb-space-16);
        border: 1px solid transparent;
        border-radius: var(--vb-radius-md);
        font-size: var(--vb-text-14);
    }

    .vb-alert > i {
        flex: none;
        margin-top: 3px;
    }

    /* an alert may end with one action button: the body takes the room, the button wraps under it when narrow */
    .vb-alert:has(> .vb-btn) {
        flex-wrap: wrap;
    }

    .vb-alert__body {
        flex: 1 1 16rem;
        min-width: 0;
    }

    .vb-alert__body > strong {
        display: block;
    }

    .vb-alert > .vb-btn {
        flex: none;
        align-self: center;
        margin-left: auto;
    }

    .vb-alert--info {
        background: var(--vb-info-bg);
        color: var(--vb-info-text);
        border-color: color-mix(in srgb, var(--vb-info) 25%, transparent);
    }

    .vb-alert--success {
        background: var(--vb-success-bg);
        color: var(--vb-success-text);
        border-color: color-mix(in srgb, var(--vb-success) 25%, transparent);
    }

    .vb-alert--warning {
        background: var(--vb-warning-bg);
        color: var(--vb-warning-text);
        border-color: color-mix(in srgb, var(--vb-warning) 25%, transparent);
    }

    .vb-alert--danger {
        background: var(--vb-danger-bg);
        color: var(--vb-danger-text);
        border-color: color-mix(in srgb, var(--vb-danger) 25%, transparent);
    }

    /* ---- Badge: short status or count ---- */
    .vb-badge {
        display: inline-flex;
        align-items: center;
        gap: var(--vb-space-4);
        padding: 2px var(--vb-space-8);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-pill);
        background: var(--vb-bg-subtle);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-medium);
        line-height: 1.4;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

    .vb-badge--info { background: var(--vb-info-bg); color: var(--vb-info-text); border-color: transparent; }
    .vb-badge--success { background: var(--vb-success-bg); color: var(--vb-success-text); border-color: transparent; }
    .vb-badge--warning { background: var(--vb-warning-bg); color: var(--vb-warning-text); border-color: transparent; }
    .vb-badge--danger { background: var(--vb-danger-bg); color: var(--vb-danger-text); border-color: transparent; }
    .vb-badge--solid { background: var(--vb-action); color: var(--vb-text-on-action); border-color: transparent; }

    /* ---- Section: one surface per content block; never nest them ---- */
    .vb-section {
        background: var(--vb-bg-surface);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-lg);
        padding: var(--vb-space-20);
        min-width: 0;
    }

    .vb-section--flush {
        padding: 0;
        overflow: hidden;
    }

    /* less padding, for a toolbar */
    .vb-section--compact {
        padding: var(--vb-space-12);
    }

    .vb-section__header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--vb-space-8) var(--vb-space-16);
        margin-bottom: var(--vb-space-16);
    }

    .vb-section--flush > .vb-section__header {
        margin: 0;
        padding: var(--vb-space-16) var(--vb-space-20);
        border-bottom: 1px solid var(--vb-border);
    }

    /* the strip under a flush section's table: its pager, or a count */
    .vb-section__footer {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: var(--vb-space-8) var(--vb-space-16);
        padding: var(--vb-space-12) var(--vb-space-16);
        border-top: 1px solid var(--vb-border);
    }

    .vb-section__title {
        margin: 0;
        font-size: var(--vb-text-16);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
    }

    .vb-section__subtitle {
        margin: var(--vb-space-2) 0 0;
        font-size: var(--vb-text-13);
        color: var(--vb-text-muted);
    }

    /* an icon before a section title (Dashboard cards), in the action colour */
    .vb-section__icon {
        margin-right: var(--vb-space-8);
        color: var(--vb-action);
    }

    /* ---- Table ---- */
    /* positioned, so visually hidden header text scrolls with the table instead of widening the page */
    .vb-table-wrap {
        position: relative;
        overflow-x: auto;
    }

    .vb-table {
        width: 100%;
        border-collapse: collapse;
        font-size: var(--vb-text-14);
    }

    .vb-table th {
        padding: var(--vb-space-8) var(--vb-space-16);
        border-bottom: 1px solid var(--vb-border);
        background: var(--vb-bg-subtle);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-semibold);
        letter-spacing: 0.04em;
        text-align: left;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .vb-table td {
        padding: var(--vb-space-12) var(--vb-space-16);
        border-bottom: 1px solid var(--vb-border);
        vertical-align: middle;
    }

    /* the compact table's smaller headings over roomy rows (Cases) */
    .vb-table--small-headings th {
        font-size: var(--vb-text-11);
        letter-spacing: 0.02em;
    }

    .vb-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .vb-table tbody tr:hover td {
        background: var(--vb-bg-subtle);
    }

    .vb-table .vb-table__num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .vb-table .vb-table__actions {
        text-align: right;
        white-space: nowrap;
    }

    .vb-table__actions > * + * {
        margin-left: var(--vb-space-4);
    }

    /* narrow screens: each row becomes a block; cells need data-label */
    @media (max-width: 576px) {
        .vb-table--stack thead {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
        }

        .vb-table--stack tr {
            display: block;
            padding: var(--vb-space-12) var(--vb-space-16);
            border-bottom: 1px solid var(--vb-border);
        }

        .vb-table--stack tbody tr:last-child {
            border-bottom: 0;
        }

        .vb-table--stack td,
        .vb-table--stack td.vb-table__num {
            display: grid;
            grid-template-columns: 7.5rem minmax(0, 1fr);
            gap: var(--vb-space-8);
            padding: var(--vb-space-4) 0;
            border: 0;
            text-align: left;
        }

        .vb-table--stack td::before {
            content: attr(data-label);
            color: var(--vb-text-muted);
            font-size: var(--vb-text-12);
            font-weight: var(--vb-weight-semibold);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        /* badges and buttons keep their own width inside the value column */
        .vb-table--stack td > * {
            justify-self: start;
        }

        .vb-table--stack td .vb-table__truncate {
            max-width: 100%;
        }

        .vb-table--stack td.vb-table__actions {
            display: flex;
            justify-content: flex-start;
            gap: var(--vb-space-8);
            padding-top: var(--vb-space-8);
        }

        .vb-table--stack td.vb-table__actions::before {
            content: none;
        }

        /* a row whose actions sit in one menu button: the button goes to the card's top right corner */
        .vb-table--stack tr:has(> td.vb-table__menu) {
            position: relative;
        }

        .vb-table--stack tr:has(> td.vb-table__menu) > td:first-child {
            padding-right: 44px;
        }

        .vb-table--stack td.vb-table__menu {
            position: absolute;
            top: var(--vb-space-4);
            right: var(--vb-space-4);
            width: auto;
            padding: 0;
        }

        /* a finger-sized square, its dots a size up */
        .vb-table--stack td.vb-table__menu > .vb-btn--icon {
            width: 40px;
            height: 40px;
            font-size: var(--vb-text-16);
        }

        .vb-table--stack tbody tr:hover td {
            background: transparent;
        }
    }

    /* ---- Empty state ---- */
    .vb-empty {
        display: grid;
        justify-items: center;
        gap: var(--vb-space-8);
        padding: var(--vb-space-40) var(--vb-space-16);
        text-align: center;
        color: var(--vb-text-muted);
    }

    .vb-empty__icon {
        font-size: calc(28px * var(--vb-text-scale));
        color: var(--vb-brand);
    }

    .vb-empty__title {
        margin: 0;
        font-size: var(--vb-text-16);
        font-weight: var(--vb-weight-semibold);
        color: var(--vb-text);
    }

    .vb-empty__text {
        max-width: 48ch;
    }

    .vb-empty .vb-btn {
        margin-top: var(--vb-space-8);
    }

    /* ---- Tile: a small card with icon, title and text; an <a class="vb-tile"> is one big link ---- */
    .vb-tile {
        display: grid;
        align-content: start;
        gap: var(--vb-space-4);
        padding: var(--vb-space-16);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-lg);
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        text-decoration: none;
    }

    a.vb-tile {
        transition: border-color var(--vb-duration-fast) var(--vb-ease), background-color var(--vb-duration-fast) var(--vb-ease);
    }

    a.vb-tile:hover {
        border-color: var(--vb-border-control);
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
        text-decoration: none;
    }

    a.vb-tile:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 2px;
    }

    .vb-tile__icon {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        margin-bottom: var(--vb-space-8);
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-selected);
        color: var(--vb-action);
        font-size: calc(16px * var(--vb-text-scale));
    }

    .vb-tile__title {
        margin: 0;
        font-size: var(--vb-text-14);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
    }

    .vb-tile__text {
        margin: 0;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
    }

    /* a locked tile (no active package) is shown but is not a link; its note says why */
    .vb-tile--locked {
        background: var(--vb-bg-subtle);
    }

    .vb-tile--locked .vb-tile__icon {
        background: var(--vb-bg-surface);
        color: var(--vb-text-muted);
    }

    .vb-tile__note {
        display: inline-flex;
        align-items: center;
        gap: var(--vb-space-6);
        margin-top: var(--vb-space-4);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-medium);
    }

    /* phones: icon beside the text, so a column of tiles stays short */
    @media (max-width: 480px) {
        .vb-tile {
            grid-template-columns: auto minmax(0, 1fr);
            column-gap: var(--vb-space-12);
        }

        .vb-tile__icon {
            grid-row: span 3;
            margin-bottom: 0;
        }
    }

    /* ---- Prose: long rich text from an editor (legal documents, help articles) ---- */
    .vb-prose {
        max-width: 72ch;
        color: var(--vb-text);
        line-height: 1.65;
        overflow-wrap: anywhere;
    }

    .vb-prose :where(h1, h2, h3, h4) {
        margin: 1.6em 0 0.5em;
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
        color: var(--vb-text);
    }

    .vb-prose :where(h1) { font-size: var(--vb-text-22); }
    .vb-prose :where(h2) { font-size: var(--vb-text-18); }
    .vb-prose :where(h3) { font-size: var(--vb-text-16); }
    .vb-prose :where(h4) { font-size: var(--vb-text-14); }

    .vb-prose :where(p, ul, ol, table, blockquote) {
        margin: 0 0 1em;
    }

    .vb-prose :where(ul, ol) {
        padding-left: 1.5em;
    }

    .vb-prose :where(li + li) {
        margin-top: 0.25em;
    }

    .vb-prose :where(a) {
        color: var(--vb-link);
        text-underline-offset: 2px;
    }

    .vb-prose :where(strong, b) {
        font-weight: var(--vb-weight-semibold);
    }

    .vb-prose :where(table) {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        border-collapse: collapse;
    }

    .vb-prose :where(th, td) {
        padding: var(--vb-space-6) var(--vb-space-12);
        border: 1px solid var(--vb-border);
        text-align: left;
        vertical-align: top;
    }

    .vb-prose :where(blockquote) {
        padding-left: var(--vb-space-12);
        border-left: 3px solid var(--vb-border-control);
        color: var(--vb-text-muted);
    }

    .vb-prose > :first-child {
        margin-top: 0;
    }

    .vb-prose > :last-child {
        margin-bottom: 0;
    }

    /* ---- Disclosure: native <details>/<summary>, opened and closed by keyboard or click with no script ---- */
    .vb-disclosure {
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-surface);
    }

    .vb-disclosure + .vb-disclosure {
        margin-top: var(--vb-space-8);
    }

    .vb-disclosure > summary {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--vb-space-8) var(--vb-space-12);
        padding: var(--vb-space-12) var(--vb-space-16);
        border-radius: var(--vb-radius-md);
        font-weight: var(--vb-weight-semibold);
        list-style: none;
        cursor: pointer;
    }

    .vb-disclosure > summary::-webkit-details-marker {
        display: none;
    }

    /* chevron (Font Awesome glyph, loaded by every layout) */
    .vb-disclosure > summary::after {
        content: "\f078";
        margin-left: auto;
        color: var(--vb-text-muted);
        font-family: "Font Awesome 6 Free";
        font-size: calc(12px * var(--vb-text-scale));
        font-weight: 900;
        transition: transform var(--vb-duration-fast) var(--vb-ease);
    }

    .vb-disclosure[open] > summary::after {
        transform: rotate(180deg);
    }

    .vb-disclosure > summary:hover {
        background: var(--vb-bg-subtle);
    }

    .vb-disclosure > summary:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -2px;
    }

    /* compact: a tool's panel under its search (vb-filters) */
    .vb-disclosure--compact > summary {
        padding: var(--vb-space-8) var(--vb-space-12);
        font-size: var(--vb-text-13);
    }

    .vb-disclosure__meta {
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
        font-weight: var(--vb-weight-regular);
    }

    .vb-disclosure__body {
        padding: var(--vb-space-16);
        border-top: 1px solid var(--vb-border);
    }

    /* ---- Feed: dated entries such as news; the body may hold editor HTML ---- */
    .vb-feed {
        display: grid;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .vb-feed__item {
        display: grid;
        gap: var(--vb-space-2);
        padding: var(--vb-space-12) 0;
        border-top: 1px solid var(--vb-border);
    }

    .vb-feed__item:first-child {
        padding-top: 0;
        border-top: 0;
    }

    .vb-feed__title {
        margin: 0;
        font-size: var(--vb-text-14);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
    }

    .vb-feed__meta {
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-variant-numeric: tabular-nums;
    }

    .vb-feed__body {
        margin-top: var(--vb-space-4);
        overflow-wrap: anywhere;
    }

    .vb-feed__body :where(p) {
        margin: 0 0 var(--vb-space-8);
    }

    .vb-feed__body :where(img) {
        max-width: 100%;
        height: auto;
    }

    /* scrolls inside a fixed height: give it tabindex="0" and a label so keyboard users can scroll it */
    .vb-feed--scroll {
        max-height: 26rem;
        overflow-y: auto;
        padding-right: var(--vb-space-4);
    }

    /* ---- Menu list: grouped rows of links, for the phone menu ---- */
    .vb-menu {
        display: grid;
        gap: var(--vb-space-20);
    }

    .vb-menu__group {
        display: grid;
        gap: var(--vb-space-6);
    }

    .vb-menu__title {
        margin: 0;
        padding: 0 var(--vb-space-4);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-semibold);
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .vb-menu__list {
        margin: 0;
        padding: 0;
        list-style: none;
        overflow: hidden;
        background: var(--vb-bg-surface);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-lg);
    }

    .vb-menu__list > li + li {
        border-top: 1px solid var(--vb-border);
    }

    .vb-menu__item {
        display: flex;
        align-items: center;
        gap: var(--vb-space-12);
        width: 100%;
        min-height: 48px;
        padding: 0 var(--vb-space-16);
        border: 0;
        background: transparent;
        color: var(--vb-text);
        font: inherit;
        font-weight: var(--vb-weight-medium);
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    .vb-menu__item > i:first-child {
        width: 20px;
        text-align: center;
        color: var(--vb-action);
        font-size: calc(16px * var(--vb-text-scale));
    }

    /* chevron, or a lock on locked rows (Font Awesome glyphs, loaded by both layouts) */
    .vb-menu__item::after {
        content: "\f054";
        margin-left: auto;
        color: var(--vb-text-muted);
        font-family: "Font Awesome 6 Free";
        font-size: calc(12px * var(--vb-text-scale));
        font-weight: 900;
    }

    .vb-menu__item:hover {
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
        text-decoration: none;
    }

    .vb-menu__item:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -2px;
    }

    .vb-menu__item--danger,
    .vb-menu__item--danger > i:first-child {
        color: var(--vb-danger-text);
    }

    .vb-menu__item--danger::after {
        content: none;
    }

    .vb-menu__item--locked {
        color: var(--vb-text-muted);
        cursor: default;
    }

    .vb-menu__item--locked > i:first-child {
        color: var(--vb-text-muted);
    }

    .vb-menu__item--locked::after {
        content: "\f023";
    }

    .vb-menu__item--locked:hover {
        background: transparent;
        color: var(--vb-text-muted);
    }

    /* ---- Input with a trailing button (copy a link, apply a code) ---- */
    .vb-input-group {
        display: flex;
        gap: var(--vb-space-8);
    }

    .vb-input-group > .vb-input {
        flex: 1 1 auto;
        min-width: 0;
    }

    .vb-input-group > .vb-btn {
        flex: none;
    }

    /* phones: the field gets the full width and the button goes under it (unless --nowrap, e.g. a show-password button) */
    @media (max-width: 576px) {
        .vb-input-group:not(.vb-input-group--nowrap) {
            flex-direction: column;
        }
    }

    /* ---- Character counter under a textarea; data-state="warning" near the limit, "danger" past it ---- */
    .vb-counter {
        font-size: var(--vb-text-13);
        color: var(--vb-text-muted);
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .vb-counter[data-state="warning"] {
        color: var(--vb-warning-text);
    }

    .vb-counter[data-state="danger"] {
        color: var(--vb-danger-text);
        font-weight: var(--vb-weight-semibold);
    }

    /* ---- Signed amount: points in (up) and out (down) ---- */
    .vb-amount {
        font-variant-numeric: tabular-nums;
        font-weight: var(--vb-weight-semibold);
        white-space: nowrap;
    }

    .vb-amount--up {
        color: var(--vb-success-text);
    }

    .vb-amount--down {
        color: var(--vb-danger-text);
    }

    /* ---- Spinner ---- */
    .vb-spinner {
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 2px solid var(--vb-border);
        border-top-color: var(--vb-action);
        border-radius: 50%;
        animation: vb-spin 0.8s linear infinite;
    }

    @keyframes vb-spin {
        to { transform: rotate(360deg); }
    }

    /* ---- Dialog: native <dialog> (top layer, focus kept inside); vb.confirm() in vb-core.js builds one ---- */
    .vb-dialog {
        width: min(440px, calc(100vw - 32px));
        padding: 0;
        border: 0;
        border-radius: var(--vb-radius-lg);
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        box-shadow: var(--vb-shadow-lg);
        font-family: var(--vb-font-sans);
        font-size: var(--vb-text-14);
        line-height: var(--vb-leading-body);
    }

    .vb-dialog::backdrop {
        background: var(--vb-backdrop);
    }

    .vb-dialog__body {
        display: grid;
        gap: var(--vb-space-12);
        margin: 0;
        padding: var(--vb-space-24);
    }

    .vb-dialog__title {
        margin: 0;
        font-size: var(--vb-text-18);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
    }

    .vb-dialog__message {
        margin: 0;
        color: var(--vb-text-muted);
    }

    /* vb.confirm's items: what the action takes away, one a line, scrolling when there are many */
    .vb-dialog__list {
        display: grid;
        gap: var(--vb-space-4);
        max-height: min(240px, 40vh);
        margin: 0;
        padding: var(--vb-space-8) var(--vb-space-12);
        overflow-y: auto;
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
        font-size: var(--vb-text-13);
        list-style: none;
        overflow-wrap: anywhere;
    }

    .vb-dialog__actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: var(--vb-space-8);
        margin-top: var(--vb-space-8);
    }

    /* alert dialog, vb.alert(): the tone icon beside the heading (the message itself when there is no title), one OK button */
    .vb-dialog--alert .vb-dialog__body {
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: var(--vb-space-12);
        row-gap: var(--vb-space-8);
    }

    .vb-dialog--alert .vb-dialog__title {
        grid-column: 2;
        font-size: var(--vb-text-16);
        overflow-wrap: anywhere;
    }

    .vb-dialog--alert .vb-dialog__message {
        grid-column: 2;
        overflow-wrap: anywhere;
        white-space: pre-line;
    }

    .vb-dialog--alert .vb-dialog__actions {
        grid-column: 1 / -1;
    }

    .vb-dialog__icon {
        grid-row: 1;
        font-size: calc(20px * var(--vb-text-scale));
        line-height: 1;
    }

    .vb-dialog--danger .vb-dialog__icon { color: var(--vb-danger); }
    .vb-dialog--warning .vb-dialog__icon { color: var(--vb-warning); }
    .vb-dialog--success .vb-dialog__icon { color: var(--vb-success); }
    .vb-dialog--info .vb-dialog__icon { color: var(--vb-info); }

    /* ---- Dropdown: a list of actions that opens from a button (a table row's menu). The list is a popover
       (popover attribute, opened by popovertarget), so it sits above everything and a table that scrolls sideways
       can't clip it; vb-core.js places it beside its button, focuses the first item and closes it when one is chosen.
       Each item may carry a muted line saying what it does. ---- */
    .vb-dropdown {
        position: fixed;
        inset: auto;
        width: min(20rem, calc(100vw - 16px));
        margin: 0;
        padding: var(--vb-space-6);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-lg);
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        box-shadow: var(--vb-shadow-lg);
        font-family: var(--vb-font-sans);
        font-size: var(--vb-text-14);
        line-height: var(--vb-leading-body);
        text-align: left;
        white-space: normal;
    }

    /* a sheet holds focus itself; it is not a control, so no ring */
    .vb-dropdown:focus {
        outline: none;
    }

    /* hidden for the moment between opening and being placed beside its button */
    .vb-dropdown:popover-open:not([data-vb-placed]) {
        visibility: hidden;
    }

    /* the sheet's head (grip and title) and its Cancel: phones only (vb-core.js adds them the first time it opens there) */
    .vb-dropdown:not([data-vb-sheet]) :is(.vb-dropdown__sheet-head, .vb-dropdown__cancel) {
        display: none;
    }

    /* ---- On phones the menu is a bottom sheet, as on a phone's own apps: it slides up from the foot of the screen
       (over the tab bar) above a dimmed page, with a grip and the row it acts on at the top and Cancel at the end.
       Swipe it down, tap outside or Cancel to close it (vb-core.js); it slides back down. No motion when the reader
       asks for less. ---- */
    @media (max-width: 576px) {
        .vb-dropdown[data-vb-sheet] {
            inset: auto 0 0 0;
            width: 100%;
            max-width: none;
            max-height: calc(100dvh - var(--vb-space-48));
            overflow-y: auto;
            overscroll-behavior: contain;
            padding: 0 var(--vb-space-8) calc(var(--vb-space-8) + env(safe-area-inset-bottom, 0px));
            border: 0;
            border-radius: 16px 16px 0 0;
            box-shadow: var(--vb-shadow-lg);
            transform: translateY(0);
            transition:
                transform var(--vb-duration-sheet) var(--vb-ease-sheet),
                overlay var(--vb-duration-sheet) allow-discrete,
                display var(--vb-duration-sheet) allow-discrete;
        }

        .vb-dropdown[data-vb-sheet]:not(:popover-open) {
            transform: translateY(100%);
        }

        @starting-style {
            .vb-dropdown[data-vb-sheet]:popover-open {
                transform: translateY(100%);
            }
        }

        .vb-dropdown[data-vb-sheet]::backdrop {
            background: var(--vb-backdrop);
            opacity: 1;
            transition:
                opacity var(--vb-duration-sheet) var(--vb-ease-sheet),
                overlay var(--vb-duration-sheet) allow-discrete,
                display var(--vb-duration-sheet) allow-discrete;
        }

        .vb-dropdown[data-vb-sheet]:not(:popover-open)::backdrop {
            opacity: 0;
        }

        @starting-style {
            .vb-dropdown[data-vb-sheet]:popover-open::backdrop {
                opacity: 0;
            }
        }

        /* the grip and the title stay at the top while a long list scrolls */
        .vb-dropdown__sheet-head {
            position: sticky;
            top: 0;
            z-index: 1;
            display: grid;
            justify-items: center;
            gap: var(--vb-space-8);
            padding: var(--vb-space-8) var(--vb-space-8) var(--vb-space-12);
            background: var(--vb-bg-surface);
        }

        .vb-dropdown__grip {
            width: 36px;
            height: 5px;
            border-radius: var(--vb-radius-pill);
            background: var(--vb-border-control);
        }

        .vb-dropdown__sheet-title {
            max-width: 100%;
            overflow: hidden;
            color: var(--vb-text-muted);
            font-size: var(--vb-text-13);
            font-weight: var(--vb-weight-semibold);
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* rows a finger can hit */
        .vb-dropdown[data-vb-sheet] .vb-dropdown__item {
            min-height: 48px;
            padding: var(--vb-space-12);
        }

        .vb-dropdown__cancel {
            width: 100%;
            min-height: 48px;
            margin-top: var(--vb-space-8);
            border: 0;
            border-radius: var(--vb-radius-lg);
            background: var(--vb-bg-subtle);
            color: var(--vb-link);
            font: inherit;
            font-weight: var(--vb-weight-semibold);
            cursor: pointer;
        }

        .vb-dropdown__cancel:focus-visible {
            outline: 2px solid var(--vb-focus);
            outline-offset: -2px;
        }
    }

    /* the page behind an open sheet does not scroll */
    html.vb-sheet-open {
        overflow: hidden;
    }

    /* under a menu sheet: takes the taps on the dim, so they only close the sheet (vb-core.js); the sheet itself is in
       the top layer, above it */
    .vb-sheet-catcher {
        position: fixed;
        inset: 0;
        z-index: 2147483000;
    }

    .vb-sheet-catcher[hidden] {
        display: none;
    }

    /* browsers without popovers (Chrome before 114, the last on Windows 7 being 109; Safari before 17): vb-core.js opens
       and closes the menus and marks the open one. A closed menu stays hidden, the open one sits above the page as the
       top layer would (a panel with its own z-index covered it; vb-core.js lifts the ancestors that hold it), and the
       catcher draws a sheet's dim (no ::backdrop). !important: a layered rule must beat any page rule that sets these */
    @supports not selector(:popover-open) {
        [popover]:not([data-vb-popover-open]) {
            display: none !important;
        }

        .vb-dropdown[data-vb-popover-open] {
            z-index: 2147483001 !important;
        }

        .vb-dropdown[data-vb-popover-open]:not([data-vb-placed]) {
            visibility: hidden;
        }

        .vb-sheet-catcher {
            background: var(--vb-backdrop);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .vb-dropdown[data-vb-sheet],
        .vb-dropdown[data-vb-sheet]::backdrop {
            transition: none;
        }
    }

    .vb-dropdown__list {
        display: grid;
        gap: 2px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    /* a divider above an item that starts a new group (the destructive one last) */
    .vb-dropdown__list > li.vb-dropdown__group {
        margin-top: var(--vb-space-4);
        padding-top: var(--vb-space-6);
        border-top: 1px solid var(--vb-border);
    }

    .vb-dropdown__item {
        display: grid;
        grid-template-columns: 20px minmax(0, 1fr);
        align-items: start;
        gap: var(--vb-space-12);
        padding: var(--vb-space-8) var(--vb-space-12);
        border-radius: var(--vb-radius-md);
        color: var(--vb-text);
        font-weight: var(--vb-weight-medium);
        text-decoration: none;
    }

    /* an item that acts on the page (opens a side panel) is a button that looks like the links */
    button.vb-dropdown__item {
        width: 100%;
        border: 0;
        background: none;
        font: inherit;
        font-weight: var(--vb-weight-medium);
        text-align: left;
        cursor: pointer;
    }

    .vb-dropdown__item > i {
        margin-top: 3px;
        color: var(--vb-text-muted);
        text-align: center;
    }

    .vb-dropdown__item:hover,
    .vb-dropdown__item:focus-visible {
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
        text-decoration: none;
    }

    .vb-dropdown__item:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -2px;
    }

    .vb-dropdown__text {
        display: block;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-regular);
    }

    .vb-dropdown__item--danger,
    .vb-dropdown__item--danger > i,
    .vb-dropdown__item--danger:hover,
    .vb-dropdown__item--danger:focus-visible {
        color: var(--vb-danger-text);
    }

    /* the menu column stays as narrow as its heading and button */
    .vb-table .vb-table__menu {
        width: 1%;
        text-align: right;
        white-space: nowrap;
    }

    /* and frozen at the right edge when a wide table scrolls sideways (phones stack the rows instead); the divider
       shows only while it scrolls (vb-core.js marks the wrapper data-vb-overflow) */
    @media (min-width: 577px) {
        .vb-table .vb-table__menu {
            position: sticky;
            right: 0;
            z-index: 1;
        }

        .vb-table-wrap[data-vb-overflow] .vb-table__menu {
            box-shadow: inset 1px 0 0 var(--vb-border);
        }

        .vb-table td.vb-table__menu {
            background: var(--vb-bg-surface);
        }

        .vb-table th.vb-table__menu {
            background: var(--vb-bg-subtle);
        }
    }

    /* ---- Toast: vb.toast(); a vb-alert at the foot of the screen (above the phone tab bar) that goes by itself ---- */
    .vb-toasts {
        position: fixed;
        left: 50%;
        bottom: calc(var(--vb-space-16) + var(--vb-tabbar-h, 0px));
        z-index: var(--vb-z-toast);
        display: grid;
        gap: var(--vb-space-8);
        width: min(440px, calc(100vw - 32px));
        transform: translateX(-50%);
        pointer-events: none;
    }

    .vb-toast {
        align-items: center;
        box-shadow: var(--vb-shadow-lg);
        font-family: var(--vb-font-sans);
        line-height: var(--vb-leading-body);
        overflow-wrap: anywhere;
        pointer-events: auto;
        animation: vb-toast-in var(--vb-duration-base) var(--vb-ease);
    }

    .vb-toast > i {
        margin-top: 0;
    }

    .vb-toast__close {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        margin: -4px -8px -4px 0;
        padding: 0;
        border: 0;
        border-radius: var(--vb-radius-sm);
        background: transparent;
        color: inherit;
        cursor: pointer;
    }

    .vb-toast__close:hover {
        background: color-mix(in srgb, currentColor 12%, transparent);
    }

    .vb-toast__close:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 1px;
    }

    @keyframes vb-toast-in {
        from { opacity: 0; transform: translateY(8px); }
    }

    @media (prefers-reduced-motion: reduce) {
        .vb-toast { animation: none; }
    }

    /* ---- Compact table: denser rows for long admin lists ---- */
    .vb-table--compact {
        font-size: var(--vb-text-13);
    }

    /* headings may wrap onto two lines, so many columns still fit */
    .vb-table--compact th {
        padding: var(--vb-space-8) var(--vb-space-8);
        font-size: var(--vb-text-11);
        white-space: normal;
    }

    .vb-table--compact td {
        padding: var(--vb-space-8) var(--vb-space-8);
    }

    .vb-table--compact th,
    .vb-table--compact th a {
        letter-spacing: 0.02em;
        gap: var(--vb-space-4);
    }

    /* when a wide list scrolls sideways, its row actions stay in view at the right edge */
    @media (min-width: 577px) {
        .vb-table--compact td.vb-table__actions {
            position: sticky;
            right: 0;
            background: var(--vb-bg-surface);
        }
    }

    .vb-table--compact th:first-child,
    .vb-table--compact td:first-child {
        padding-left: var(--vb-space-16);
    }

    .vb-table--compact th:last-child,
    .vb-table--compact td:last-child {
        padding-right: var(--vb-space-16);
    }

    /* stacked on phones, compact cells line up like any stacked table */
    @media (max-width: 576px) {
        .vb-table--stack.vb-table--compact td {
            padding: var(--vb-space-4) 0;
        }

        .vb-table--stack.vb-table--compact td.vb-table__actions {
            padding-top: var(--vb-space-8);
        }
    }

    /* a value longer than its column (a long email) breaks rather than overflow; whole words stay whole */
    .vb-table--compact td {
        overflow-wrap: break-word;
    }

    .vb-table .vb-table__nowrap {
        white-space: nowrap;
        overflow-wrap: normal;
    }

    /* one line, cut with an ellipsis; give the cell a title with the full value */
    .vb-table .vb-table__truncate {
        display: block;
        max-width: 16rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ---- Sortable column: the heading is a link; the arrow (vb-sort) shows the order ---- */
    .vb-table th a {
        display: inline-flex;
        align-items: center;
        gap: var(--vb-space-6);
        color: inherit;
        text-decoration: none;
    }

    .vb-table th a:hover {
        color: var(--vb-link);
    }

    .vb-sort {
        font-size: var(--vb-text-11);
        opacity: 0.4;
    }

    .vb-sort--active {
        opacity: 1;
        color: var(--vb-action);
    }

    /* ---- Pager: page numbers or first/previous/next/last buttons under a list ---- */
    .vb-pager {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--vb-space-4);
    }

    .vb-pager > a:not(.vb-btn),
    .vb-pager > [aria-current="page"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: var(--vb-control-h-sm);
        height: var(--vb-control-h-sm);
        padding: 0 var(--vb-space-8);
        border-radius: var(--vb-radius-md);
        font-size: var(--vb-text-13);
        font-weight: var(--vb-weight-semibold);
        font-variant-numeric: tabular-nums;
        text-decoration: none;
    }

    .vb-pager > a:not(.vb-btn) {
        color: var(--vb-link);
    }

    .vb-pager > a:not(.vb-btn):hover {
        background: var(--vb-bg-selected);
    }

    .vb-pager > a:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 2px;
    }

    .vb-pager > [aria-current="page"] {
        background: var(--vb-action);
        color: var(--vb-text-on-action);
    }

    .vb-pager__info {
        padding: 0 var(--vb-space-8);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
        font-variant-numeric: tabular-nums;
    }

    /* ---- Stats: counts with their labels in a row of chips, above a list ---- */
    .vb-stats {
        display: flex;
        flex-wrap: wrap;
        gap: var(--vb-space-8);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .vb-stat {
        display: inline-flex;
        align-items: baseline;
        gap: var(--vb-space-6);
        padding: var(--vb-space-4) var(--vb-space-12);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-pill);
        background: var(--vb-bg-subtle);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        white-space: nowrap;
    }

    .vb-stat > strong {
        color: var(--vb-text);
        font-size: var(--vb-text-13);
        font-variant-numeric: tabular-nums;
    }

    .vb-stat--success { background: var(--vb-success-bg); border-color: transparent; }
    .vb-stat--success > strong { color: var(--vb-success-text); }
    .vb-stat--warning { background: var(--vb-warning-bg); border-color: transparent; }
    .vb-stat--warning > strong { color: var(--vb-warning-text); }
    .vb-stat--danger { background: var(--vb-danger-bg); border-color: transparent; }
    .vb-stat--danger > strong { color: var(--vb-danger-text); }
    .vb-stat--info { background: var(--vb-info-bg); border-color: transparent; }
    .vb-stat--info > strong { color: var(--vb-info-text); }

    /* a stat that jumps to its list (Home's "Waiting for you" counts) */
    a.vb-stat {
        text-decoration: none;
    }

    a.vb-stat:hover {
        border-color: var(--vb-action);
        color: var(--vb-text);
    }

    a.vb-stat:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 2px;
    }

    /* ---- vb-continue - the one thing to pick up again (Home): a small label, the title, a line of facts, the next
       step (a vb-alert) and the actions; the action-colour edge marks where the page starts ---- */
    .vb-continue {
        display: grid;
        gap: var(--vb-space-12);
        min-width: 0;
        padding: var(--vb-space-20) var(--vb-space-24);
        border: 1px solid var(--vb-border);
        border-left: 4px solid var(--vb-action);
        border-radius: var(--vb-radius-lg);
        background: var(--vb-bg-surface);
        box-shadow: var(--vb-shadow-sm);
    }

    .vb-continue__label {
        margin: 0;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-semibold);
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .vb-continue__title {
        margin: 0;
        font-size: var(--vb-text-22);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
        overflow-wrap: anywhere;
    }

    .vb-continue__facts {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--vb-space-4) var(--vb-space-12);
        margin: var(--vb-space-6) 0 0;
        padding: 0;
        list-style: none;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
    }

    .vb-continue__actions {
        display: flex;
        flex-wrap: wrap;
        gap: var(--vb-space-8);
    }

    @media (max-width: 576px) {
        .vb-continue {
            padding: var(--vb-space-16);
        }
    }

    /* ---- vb-meter - how much of something is left: the amount, a bar (its fill's width set inline) and a note
       (Home's points). The bar repeats the text, so it is hidden from screen readers ---- */
    .vb-meter {
        display: grid;
        gap: var(--vb-space-8);
    }

    .vb-meter__value {
        margin: 0;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
    }

    .vb-meter__value strong {
        margin-right: var(--vb-space-4);
        color: var(--vb-text);
        font-size: var(--vb-text-28);
        font-weight: var(--vb-weight-semibold);
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }

    .vb-meter__bar {
        height: 8px;
        overflow: hidden;
        border-radius: var(--vb-radius-pill);
        background: var(--vb-bg-subtle);
    }

    .vb-meter__bar > span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: var(--vb-action);
    }

    .vb-meter__note {
        margin: 0;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
    }

    /* ---- Metric: one big number with its label and icon, in a grid of metrics (admin dashboard) ---- */
    .vb-metric {
        display: flex;
        align-items: center;
        gap: var(--vb-space-12);
        padding: var(--vb-space-16);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-lg);
        background: var(--vb-bg-surface);
        min-width: 0;
    }

    .vb-metric__icon {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-selected);
        color: var(--vb-action);
        font-size: var(--vb-text-16);
    }

    .vb-metric__icon--info { background: var(--vb-info-bg); color: var(--vb-info-text); }
    .vb-metric__icon--warning { background: var(--vb-warning-bg); color: var(--vb-warning-text); }
    .vb-metric__icon--danger { background: var(--vb-danger-bg); color: var(--vb-danger-text); }

    .vb-metric__value {
        display: block;
        font-size: var(--vb-text-22);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
        font-variant-numeric: tabular-nums;
    }

    .vb-metric__label {
        display: block;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
    }

    /* ---- Suggestions: a list under a search field (vb-suggest.js); the field and the list sit in .vb-suggest ---- */
    .vb-suggest {
        position: relative;
        min-width: 0;
    }

    .vb-suggest__list {
        position: absolute;
        top: calc(100% + var(--vb-space-4));
        left: 0;
        z-index: var(--vb-z-menu);
        width: max(100%, 320px);
        max-width: calc(100vw - 32px);
        max-height: 340px;
        overflow-x: hidden;
        overflow-y: auto;
        padding: var(--vb-space-6) 0 0;
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-lg);
        background: var(--vb-bg-surface);
        box-shadow: var(--vb-shadow-lg);
        font-size: var(--vb-text-13);
    }

    .vb-suggest__list[hidden] {
        display: none;
    }

    .vb-suggest__group {
        padding: var(--vb-space-6) var(--vb-space-12) var(--vb-space-4);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-11);
        font-weight: var(--vb-weight-bold);
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    [role="group"] + [role="group"] > .vb-suggest__group {
        margin-top: var(--vb-space-4);
        padding-top: var(--vb-space-8);
        border-top: 1px solid var(--vb-border);
    }

    .vb-suggest__option {
        display: flex;
        align-items: center;
        gap: var(--vb-space-8);
        padding: var(--vb-space-6) var(--vb-space-12);
        color: var(--vb-text);
        cursor: pointer;
    }

    .vb-suggest__option:hover,
    .vb-suggest__option[aria-selected="true"] {
        background: var(--vb-bg-selected);
        box-shadow: inset 3px 0 0 var(--vb-action);
    }

    .vb-suggest__icon {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: var(--vb-radius-md);
        background: var(--vb-success-bg);
        color: var(--vb-success-text);
        font-size: var(--vb-text-11);
    }

    .vb-suggest__icon--info { background: var(--vb-info-bg); color: var(--vb-info-text); }
    .vb-suggest__icon--warning { background: var(--vb-warning-bg); color: var(--vb-warning-text); }
    .vb-suggest__icon--neutral { background: var(--vb-bg-subtle); color: var(--vb-text-muted); }

    .vb-suggest__value {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .vb-suggest__detail {
        flex: 0 1 auto;
        max-width: 45%;
        overflow: hidden;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .vb-suggest__value mark {
        background: none;
        color: inherit;
        font-weight: var(--vb-weight-bold);
        text-decoration: underline;
        text-decoration-color: var(--vb-action);
        text-underline-offset: 2px;
    }

    .vb-suggest__foot {
        position: sticky;
        bottom: 0;
        display: flex;
        flex-wrap: wrap;
        gap: var(--vb-space-12);
        margin-top: var(--vb-space-6);
        padding: var(--vb-space-6) var(--vb-space-12);
        border-top: 1px solid var(--vb-border);
        background: var(--vb-bg-subtle);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-11);
    }

    .vb-suggest__foot kbd {
        display: inline-block;
        min-width: 16px;
        padding: 0 4px;
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-sm);
        background: var(--vb-bg-surface);
        font-family: inherit;
        font-size: calc(10px * var(--vb-text-scale));
        line-height: 16px;
        text-align: center;
    }

    /* ---- Choice cards: radios shown as selectable cards (the points packages); a fieldset.vb-choices holds them.
       Four across, two on tablets, one a row on phones ---- */
    .vb-choices {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--vb-space-12);
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    @media (max-width: 900px) {
        .vb-choices {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    .vb-choice {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: var(--vb-space-4);
        min-width: 0;
        padding: var(--vb-space-20);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-lg);
        background: var(--vb-bg-surface);
        cursor: pointer;
        transition: border-color var(--vb-duration-fast) var(--vb-ease), background-color var(--vb-duration-fast) var(--vb-ease);
    }

    .vb-choice:hover {
        border-color: var(--vb-border-control);
    }

    /* the radio stays a real, focusable control in the corner; the whole card is its label */
    .vb-choice__input {
        position: absolute;
        top: var(--vb-space-16);
        right: var(--vb-space-16);
        width: 18px;
        height: 18px;
        margin: 0;
        accent-color: var(--vb-action);
        cursor: pointer;
    }

    .vb-choice:has(.vb-choice__input:checked) {
        border-color: var(--vb-action);
        box-shadow: inset 0 0 0 1px var(--vb-action);
        background: var(--vb-bg-selected);
    }

    .vb-choice:has(.vb-choice__input:focus-visible) {
        outline: 2px solid var(--vb-focus);
        outline-offset: 2px;
    }

    .vb-choice__title {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--vb-space-6);
        padding-right: var(--vb-space-24);
        font-size: var(--vb-text-16);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
    }

    .vb-choice__price {
        margin-top: var(--vb-space-8);
        font-size: var(--vb-text-28);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
        font-variant-numeric: tabular-nums;
    }

    .vb-choice__meta {
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
    }

    .vb-choice__detail {
        margin-top: auto;
        padding-top: var(--vb-space-12);
        border-top: 1px solid var(--vb-border);
        font-variant-numeric: tabular-nums;
    }

    .vb-choice__meta + .vb-choice__detail {
        margin-top: var(--vb-space-12);
    }

    /* what the choice buys, under the price (the points), and a muted line at its foot (the price per run and per month) */
    .vb-choice__lead {
        font-size: var(--vb-text-16);
        font-weight: var(--vb-weight-semibold);
        font-variant-numeric: tabular-nums;
    }

    .vb-choice__note {
        margin-top: auto;
        padding-top: var(--vb-space-8);
        border-top: 1px solid var(--vb-border);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-variant-numeric: tabular-nums;
    }

    .vb-choice__meta + .vb-choice__note {
        margin-top: var(--vb-space-8);
    }

    /* phones: one card a row; the name on its own line, the price beside what it buys, the radio in the middle */
    @media (max-width: 576px) {
        .vb-choices {
            grid-template-columns: minmax(0, 1fr);
        }

        .vb-choice {
            flex-direction: row;
            flex-wrap: wrap;
            align-items: baseline;
            gap: var(--vb-space-2) var(--vb-space-12);
            padding: var(--vb-space-12) calc(var(--vb-space-12) + 30px) var(--vb-space-12) var(--vb-space-12);
        }

        .vb-choice__input {
            top: 50%;
            right: var(--vb-space-12);
            transform: translateY(-50%);
        }

        .vb-choice__title,
        .vb-choice__meta,
        .vb-choice__detail,
        .vb-choice__note {
            flex: 1 1 100%;
        }

        .vb-choice__title {
            padding-right: 0;
            font-size: var(--vb-text-14);
        }

        .vb-choice__price {
            margin-top: var(--vb-space-2);
            font-size: var(--vb-text-22);
        }

        .vb-choice__meta + .vb-choice__detail,
        .vb-choice__meta + .vb-choice__note {
            margin-top: var(--vb-space-6);
            padding-top: var(--vb-space-6);
        }
    }

    /* ---- Protected text: licensed reference content (repertory symptoms, Materia Medica and remedy text, VB results)
       cannot be selected or copied; form fields and editable areas inside it stay selectable ---- */
    .vb-protected {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

    .vb-protected :is(input, textarea, select, [contenteditable="true"]) {
        -webkit-user-select: text;
        user-select: text;
        -webkit-touch-callout: default;
    }

    /* ---- vb-toc - the contents of a long page: a card with a title, an optional filter field and
       nested links. The current link has aria-current="true"; a group with topics has a chevron button
       (aria-expanded, aria-controls) that shows or hides them. Only the list scrolls when the card has a max-height
       (vb-sidebar-layout gives it one), so the title and filter stay in view. ---- */
    .vb-toc {
        display: flex;
        flex-direction: column;
        gap: var(--vb-space-12);
        min-width: 0;
        min-height: 0;
        padding: var(--vb-space-16);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-lg);
        background: var(--vb-bg-surface);
    }

    .vb-toc__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--vb-space-8);
    }

    .vb-toc__title {
        margin: 0;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-semibold);
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .vb-toc__search {
        position: relative;
    }

    .vb-toc__search > i {
        position: absolute;
        top: 50%;
        left: var(--vb-space-12);
        transform: translateY(-50%);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
        pointer-events: none;
    }

    .vb-toc__search > .vb-input {
        padding-left: 34px;
    }

    .vb-toc__list,
    .vb-toc__sublist {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .vb-toc__list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .vb-toc__list > li + li,
    .vb-toc__sublist > li + li {
        margin-top: var(--vb-space-2);
    }

    .vb-toc__row {
        display: flex;
        align-items: center;
        gap: var(--vb-space-2);
    }

    .vb-toc__link {
        position: relative;
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        padding: var(--vb-space-6) var(--vb-space-8) var(--vb-space-6) var(--vb-space-12);
        border-radius: var(--vb-radius-md);
        color: var(--vb-text);
        font-size: var(--vb-text-13);
        font-weight: var(--vb-weight-medium);
        line-height: var(--vb-leading-tight);
        text-decoration: none;
    }

    .vb-toc__link:hover {
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
        text-decoration: none;
    }

    /* inset rings: the list scrolls, so an outside ring would be clipped */
    .vb-toc__link:focus-visible,
    .vb-toc__toggle:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -2px;
    }

    /* the current topic: tinted, with a bar at its start */
    .vb-toc__link[aria-current="true"] {
        background: var(--vb-bg-selected);
        font-weight: var(--vb-weight-semibold);
    }

    .vb-toc__link[aria-current="true"]::before {
        content: "";
        position: absolute;
        top: var(--vb-space-6);
        bottom: var(--vb-space-6);
        left: 0;
        width: 3px;
        border-radius: var(--vb-radius-pill);
        background: var(--vb-action);
    }

    .vb-toc__sublist {
        margin: var(--vb-space-2) 0 var(--vb-space-6) var(--vb-space-12);
        padding-left: var(--vb-space-6);
        border-left: 1px solid var(--vb-border);
    }

    .vb-toc__sublist .vb-toc__link {
        color: var(--vb-text-muted);
        font-weight: var(--vb-weight-regular);
    }

    .vb-toc__sublist .vb-toc__link:hover {
        color: var(--vb-text);
    }

    .vb-toc__sublist .vb-toc__link[aria-current="true"] {
        color: var(--vb-text);
        font-weight: var(--vb-weight-semibold);
    }

    .vb-toc__toggle {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 0;
        border-radius: var(--vb-radius-md);
        background: transparent;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-11);
        cursor: pointer;
    }

    .vb-toc__toggle:hover {
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
    }

    .vb-toc__toggle > i {
        transition: transform var(--vb-duration-fast) var(--vb-ease);
    }

    .vb-toc__toggle[aria-expanded="false"] > i {
        transform: rotate(-90deg);
    }

    /* touch screens: rows tall enough for a finger */
    @media (pointer: coarse) {
        .vb-toc__link {
            padding-top: var(--vb-space-8);
            padding-bottom: var(--vb-space-8);
        }

        .vb-toc__toggle {
            width: var(--vb-control-h);
            height: var(--vb-control-h);
        }
    }

    /* ---- vb-backdrop - dims the page behind a drawer (--vb-backdrop, as behind dialogs) ---- */
    .vb-backdrop {
        position: fixed;
        inset: 0;
        z-index: calc(var(--vb-z-drawer) - 1);
        background: var(--vb-backdrop);
    }

    /* ---- vb-fab - a vb-btn pinned to the bottom right of the screen, above the phone tab bar;
       a pill with a label, or round with vb-btn--icon (give it an aria-label) ---- */
    .vb-fab {
        position: fixed;
        right: var(--vb-space-16);
        bottom: calc(var(--vb-space-16) + var(--vb-tabbar-h, 0px));
        z-index: var(--vb-z-sticky);
        height: 44px;
        border-radius: var(--vb-radius-pill);
        box-shadow: var(--vb-shadow-md);
    }

    .vb-fab.vb-btn--icon {
        width: 44px;
    }

    .vb-fab[hidden] {
        display: none;
    }

    /* ---- a list nested in a list item sits just under its item ---- */
    .vb-prose :where(li > ul, li > ol) {
        margin: var(--vb-space-4) 0 0;
    }

    /* ---- vb-steps - numbered steps, <ol class="vb-steps" role="list"> (the role keeps it a list in
       Safari, which drops list semantics when list-style is none). Each number sits in a tinted circle; a list
       nested in a step keeps plain bullets. In components.css it goes after vb-prose, so it wins inside prose. ---- */
    .vb-steps {
        display: grid;
        gap: var(--vb-space-8);
        padding: 0;
        list-style: none;
        counter-reset: vb-step;
    }

    .vb-steps > li {
        position: relative;
        min-height: 24px;
        margin: 0;
        padding-left: 36px;
        counter-increment: vb-step;
    }

    .vb-steps > li::before {
        content: counter(vb-step);
        position: absolute;
        top: 0;
        left: 0;
        display: grid;
        place-items: center;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--vb-bg-selected);
        color: var(--vb-action-hover);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-semibold);
        font-variant-numeric: tabular-nums;
        line-height: 1;
    }

    .vb-steps :where(ul, ol) {
        margin: var(--vb-space-4) 0 0;
        padding-left: 1.25em;
    }

    /* ---- vb-ui-ref - names a button, menu or screen of the app in running text ("click New case");
       an icon inside shows the button's icon in the action colour. A key to press is a <kbd> inside vb-prose. ---- */
    .vb-ui-ref {
        padding: 1px var(--vb-space-6);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-sm);
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
        font-size: 0.92em;
        font-weight: var(--vb-weight-semibold);
        -webkit-box-decoration-break: clone;
        box-decoration-break: clone;
    }

    .vb-ui-ref > i {
        color: var(--vb-action);
    }

    .vb-prose kbd {
        display: inline-block;
        min-width: 1.75em;
        padding: 0 var(--vb-space-4);
        border: 1px solid var(--vb-border-control);
        border-bottom-width: 2px;
        border-radius: var(--vb-radius-sm);
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        font-family: var(--vb-font-sans);
        font-size: 0.85em;
        font-weight: var(--vb-weight-medium);
        line-height: 1.5;
        text-align: center;
        white-space: nowrap;
    }


    /* ---- Tabs (vb-tabs): a row of tab buttons over the panel they switch; the selected tab is underlined
       in the action colour. Tabs wrap onto another row when they don't fit, so none is hidden off screen.
       <div class="vb-tabs" role="tablist" aria-label=".."><button type="button" role="tab" class="vb-tabs__tab"
       aria-selected="true" aria-controls="panelId">Label</button></div> + <div id="panelId" role="tabpanel"> */
    .vb-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 0 var(--vb-space-4);
        padding: 0 var(--vb-space-12);
        border-bottom: 1px solid var(--vb-border);
    }

    .vb-tabs__tab {
        display: inline-flex;
        align-items: center;
        gap: var(--vb-space-6);
        min-height: 44px;
        padding: 0 var(--vb-space-12);
        border: 0;
        border-bottom: 2px solid transparent;
        background: transparent;
        color: var(--vb-text-muted);
        font-family: var(--vb-font-sans);
        font-size: var(--vb-text-14);
        font-weight: var(--vb-weight-medium);
        line-height: var(--vb-leading-tight);
        white-space: nowrap;
        cursor: pointer;
        transition: color var(--vb-duration-fast) var(--vb-ease), border-color var(--vb-duration-fast) var(--vb-ease);
    }

    .vb-tabs__tab:hover {
        color: var(--vb-text);
        border-bottom-color: var(--vb-border-control);
    }

    .vb-tabs__tab[aria-selected="true"] {
        color: var(--vb-text);
        font-weight: var(--vb-weight-semibold);
        border-bottom-color: var(--vb-action);
    }

    .vb-tabs__tab:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -2px;
    }

    /* --scroll: one line that scrolls sideways when the tabs don't fit (Remedy detail's ten authors), on every width;
       while tabs are hidden past the right edge (vb-core.js sets data-vb-more) the edge fades. A chosen tab scrolls into
       view */
    .vb-tabs.vb-tabs--scroll {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .vb-tabs.vb-tabs--scroll::-webkit-scrollbar {
        display: none;
    }

    .vb-tabs.vb-tabs--scroll[data-vb-more] {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--vb-space-40)), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - var(--vb-space-40)), transparent);
    }

    /* a number on a tab: how many times a search matches in that tab's panel */
    .vb-tabs__count {
        min-width: 20px;
        padding: 1px var(--vb-space-6);
        border-radius: var(--vb-radius-pill);
        background: var(--vb-warning-bg);
        color: var(--vb-warning-text);
        font-size: var(--vb-text-11);
        font-weight: var(--vb-weight-semibold);
        font-variant-numeric: tabular-nums;
        line-height: 1.4;
        text-align: center;
    }

    @media (max-width: 576px) {
        .vb-tabs {
            padding: 0 var(--vb-space-4);
        }

        .vb-tabs__tab {
            min-height: 40px;
            padding: 0 var(--vb-space-8);
            font-size: var(--vb-text-13);
        }
    }

    /* ---- vb-section__body — padded content under a flush section's header */
    .vb-section__body {
        padding: var(--vb-space-16) var(--vb-space-20);
    }

    /* ---- vb-list — rows in a flush section: a title (often a link), a muted line under it and
       trailing meta (badges) on the right; on phones the meta moves beside the muted line, under the title */
    .vb-list {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .vb-list__item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "title meta" "text meta";
        align-items: center;
        gap: var(--vb-space-2) var(--vb-space-16);
        padding: var(--vb-space-8) var(--vb-space-20);
        border-bottom: 1px solid var(--vb-border);
    }

    .vb-list__item:last-child {
        border-bottom: 0;
    }

    @media (hover: hover) {
        .vb-list__item:hover {
            background: var(--vb-bg-subtle);
        }
    }

    .vb-list__title {
        grid-area: title;
        min-width: 0;
        color: var(--vb-text);
        font-weight: var(--vb-weight-medium);
        line-height: var(--vb-leading-tight);
        text-decoration: none;
        overflow-wrap: anywhere;
    }

    a.vb-list__title:hover {
        color: var(--vb-link);
        text-decoration: none;
    }

    /* a small label over a group of rows in one section (Home's Recent: Repertory searches, Remedies you read) */
    .vb-list__heading {
        margin: 0;
        padding: var(--vb-space-12) var(--vb-space-20) var(--vb-space-4);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-semibold);
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    /* rows whose meta is an action button (Home): the button stays beside the title and line on phones too, and the
       line wraps instead of running under it */
    .vb-list--actions .vb-list__item {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "title meta" "text meta";
    }

    /* a title that posts a form (Home opens a case through its form): looks like the link */
    button.vb-list__title {
        justify-self: start;
        padding: 0;
        border: 0;
        background: none;
        font-family: inherit;
        font-size: inherit;
        text-align: left;
        cursor: pointer;
    }

    button.vb-list__title:hover {
        color: var(--vb-link);
    }

    button.vb-list__title:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 2px;
    }

    .vb-list__text {
        grid-area: text;
        min-width: 0;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        line-height: var(--vb-leading-tight);
        overflow-wrap: anywhere;
    }

    .vb-list__meta {
        grid-area: meta;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: var(--vb-space-4);
    }

    /* phones: the muted line keeps its width and the meta wraps in the rest of the row */
    @media (max-width: 576px) {
        .vb-list__item {
            grid-template-columns: auto minmax(0, 1fr);
            grid-template-areas: "title title" "text meta";
            row-gap: var(--vb-space-4);
            padding: var(--vb-space-8) var(--vb-space-16);
        }
    }

    /* ---- vb-btn--warning - an action that has to come first ("Complete Prescription First") ---- */
    .vb-btn--warning {
        background: var(--vb-warning-bg);
        color: var(--vb-warning-text);
        border-color: color-mix(in srgb, var(--vb-warning) 45%, transparent);
    }

    .vb-btn--warning:hover {
        background: color-mix(in srgb, var(--vb-warning) 16%, var(--vb-bg-surface));
        color: var(--vb-warning-text);
    }

    /* ---- vb-remedies - remedy names as VBAnalysisModel.StructuredRemedyToHtml renders them, the degree
       in an inline colour on each name: grey = 1, italic blue = 2, bold red = 3, bold black capitals = 4 (the Help
       page's "Remedy Degrees"). The <i> and <b> give the italic and the bold; the colours become the --vb-degree-*
       tokens (grey, blue, red, ink in both themes), and !important is needed to beat the inline colours. Degree 2
       is also given --vb-degree-2-weight (bold): italic alone read too light. */
    .vb-remedies {
        font-size: var(--vb-text-14);
        line-height: 1.6;
        overflow-wrap: anywhere;
    }

    /* with or without a space after the colon: older stored HTML passes through as it is */
    .vb-remedies :is(a, span):is([style*="color:grey"], [style*="color: grey"], [style*="color:gray"], [style*="color: gray"]) {
        color: var(--vb-degree-1) !important;
    }

    .vb-remedies :is(a, span):is([style*="color:blue"], [style*="color: blue"]) {
        color: var(--vb-degree-2) !important;
        font-weight: var(--vb-degree-2-weight);
    }

    .vb-remedies :is(a, span):is([style*="color:red"], [style*="color: red"]) {
        color: var(--vb-degree-3) !important;
    }

    .vb-remedies :is(a, span):is([style*="color:black"], [style*="color: black"]) {
        color: var(--vb-degree-4) !important;
    }

    .vb-remedies a:hover {
        text-decoration: underline !important;
        text-underline-offset: 2px;
    }

    .vb-remedies a:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 1px;
        border-radius: var(--vb-radius-sm);
    }

    /* ---- vb-degree - one remedy's degree in a symptom as a small number chip that gets stronger with
       the degree, in the vb-remedies colours (1 grey, 2 blue, 3 red, 4 ink); --0 = not in the symptom ("-") */
    .vb-degree {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 20px;
        padding: 0 var(--vb-space-6);
        border: 1px solid var(--vb-border);
        border-radius: var(--vb-radius-sm);
        background: var(--vb-bg-subtle);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-semibold);
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }

    .vb-degree--0 {
        border-style: dashed;
        background: transparent;
    }

    .vb-degree--2 {
        border-color: color-mix(in srgb, var(--vb-degree-2) 40%, var(--vb-bg-surface));
        background: var(--vb-bg-surface);
        color: var(--vb-degree-2);
    }

    .vb-degree--3 {
        border-color: transparent;
        background: var(--vb-danger-bg);
        color: var(--vb-degree-3);
    }

    .vb-degree--4 {
        border-color: transparent;
        background: var(--vb-text);
        color: var(--vb-bg-surface);
        font-weight: var(--vb-weight-bold);
    }

    /* ---- Phones: form fields at 16px, so iOS Safari does not zoom the page when one gets focus ---- */
    @media (max-width: 576px) {
        .vb-input,
        .vb-select,
        .vb-textarea {
            font-size: max(16px, var(--vb-text-16));
        }
    }

    /* ---- Theme switch: Light / Dark / System as one segmented row of radios (account menu, admin topbar);
       vb-core.js saves the choice in the vb-theme cookie and applies it at once. --icons shows the icons only ---- */
    .vb-theme-switch {
        min-width: 0;
        margin: 0 0 var(--vb-space-12);
        padding: 0;
        border: 0;
    }

    .vb-theme-switch__options {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2px;
        padding: 2px;
        border: 1px solid var(--vb-border-control);
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-surface);
    }

    .vb-theme-switch__options > label {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--vb-space-6);
        min-height: calc(var(--vb-control-h-sm) - 6px);
        padding: 0 var(--vb-space-8);
        border-radius: var(--vb-radius-sm);
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-medium);
        white-space: nowrap;
        cursor: pointer;
    }

    .vb-theme-switch__options > label:hover {
        color: var(--vb-text);
    }

    /* the radio stays focusable for the keyboard (arrow keys move the choice); the label shows the state */
    .vb-theme-switch__options input {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: 0;
        opacity: 0;
    }

    .vb-theme-switch__options > label:has(input:checked) {
        background: var(--vb-bg-selected);
        color: var(--vb-text);
        font-weight: var(--vb-weight-semibold);
    }

    .vb-theme-switch__options > label:has(input:focus-visible) {
        outline: 2px solid var(--vb-focus);
        outline-offset: 1px;
    }

    .vb-theme-switch--icons {
        margin: 0;
    }

    .vb-theme-switch--icons .vb-theme-switch__options > label {
        width: 28px;
        padding: 0;
    }

    /* ---- Text size: smaller | 100% | larger in one frame like the theme switch (account menu). vb-core.js sets
       --vb-text-scale on <html> (90% to 130%) and keeps it in this browser only (localStorage vb-text-size); the
       layouts apply it before the page draws. Every --vb-text-* token, and the px sizes written as
       calc(Npx * var(--vb-text-scale)), follow it. At either end the button says so (aria-disabled), keeping focus ---- */
    .vb-text-size {
        margin: 0 0 var(--vb-space-12);
    }

    .vb-text-size__controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2px;
        padding: 2px;
        border: 1px solid var(--vb-border-control);
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-surface);
    }

    .vb-text-size__controls > button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: calc(var(--vb-control-h-sm) - 6px);
        padding: 0 var(--vb-space-8);
        border: 0;
        border-radius: var(--vb-radius-sm);
        background: transparent;
        color: var(--vb-text);
        font: inherit;
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-semibold);
        cursor: pointer;
    }

    .vb-text-size__controls > button > i {
        font-size: 0.7em;
    }

    .vb-text-size__controls > button:hover:not([aria-disabled="true"]) {
        background: var(--vb-bg-subtle);
    }

    .vb-text-size__controls > button[aria-disabled="true"] {
        color: var(--vb-text-muted);
        cursor: default;
    }

    .vb-text-size__controls > button:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 1px;
    }

    .vb-text-size__value {
        font-variant-numeric: tabular-nums;
    }

    /* ---- vb-segmented - the views of one area as one joined row of buttons, aria-pressed="true" on the one on screen
       (Analysis: Repertory | Flat results | VB results). Items may be submit buttons; each keeps one meaning. The parts
       fill the frame edge to edge, so the switch is exactly as tall as a button beside it; on a screen too narrow for
       it the row scrolls inside itself rather than widening the page. ---- */
    .vb-segmented {
        display: inline-flex;
        align-items: stretch;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        border: 1px solid var(--vb-border-control);
        border-radius: var(--vb-radius-md);
        background: var(--vb-bg-surface);
    }

    .vb-segmented__item {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--vb-space-6);
        min-height: calc(var(--vb-control-h) - 2px);
        margin: 0;
        padding: 0 var(--vb-space-12);
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--vb-text-muted);
        font-family: var(--vb-font-sans);
        font-size: var(--vb-text-14);
        font-weight: var(--vb-weight-medium);
        line-height: 1;
        white-space: nowrap;
        cursor: pointer;
    }

    .vb-segmented__item + .vb-segmented__item {
        border-left: 1px solid var(--vb-border);
    }

    .vb-segmented__item:hover {
        background: var(--vb-bg-subtle);
        color: var(--vb-text);
    }

    .vb-segmented__item[aria-pressed="true"] {
        background: var(--vb-action);
        color: var(--vb-text-on-action);
        font-weight: var(--vb-weight-semibold);
    }

    .vb-segmented__item:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -3px;
    }

    /* small: beside small buttons, e.g. a list's order (As added | Chapter | Degree) */
    .vb-segmented--sm .vb-segmented__item {
        min-height: calc(var(--vb-control-h-sm) - 2px);
        padding: 0 var(--vb-space-8);
        font-size: var(--vb-text-13);
    }

    /* ---- vb-btn__note - a short note inside a button, such as the cost of a paid action ("VB results · 1 point") ---- */
    .vb-btn__note {
        display: inline-flex;
        align-items: center;
        padding: 2px var(--vb-space-6);
        border-radius: var(--vb-radius-pill);
        background: color-mix(in srgb, currentColor 16%, transparent);
        font-size: var(--vb-text-12);
        font-weight: var(--vb-weight-medium);
        line-height: 1.2;
    }

    /* ---- vb-events - a case history: one row per event, oldest first: date, type (<vb-event-type>), what happened
       with a muted detail line, and the row menu. __item--child indents a prescription under its analysis (on phones
       the whole entry), with a corner (└) beside its type, --acute marks
       an acute episode at the left edge, --current is the event the next step is about. Phones: type, text, then date. ---- */
    .vb-events {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .vb-events__item {
        display: grid;
        grid-template-columns: 7.5rem 11rem minmax(0, 1fr) auto;
        grid-template-areas: "date type main menu";
        align-items: center;
        gap: var(--vb-space-4) var(--vb-space-16);
        padding: var(--vb-space-8) var(--vb-space-12) var(--vb-space-8) var(--vb-space-20);
        border-bottom: 1px solid var(--vb-border);
    }

    .vb-events__item:last-child {
        border-bottom: 0;
    }

    .vb-events__date {
        grid-area: date;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .vb-events__type {
        grid-area: type;
        min-width: 0;
    }

    .vb-events__main {
        grid-area: main;
        min-width: 0;
    }

    .vb-events__menu {
        grid-area: menu;
    }

    /* the event's name opens it: a link, or a button where opening posts back */
    .vb-events__title {
        padding: 0;
        border: 0;
        background: none;
        color: var(--vb-text);
        font: inherit;
        font-weight: var(--vb-weight-medium);
        text-align: left;
        text-decoration: none;
        overflow-wrap: anywhere;
        cursor: pointer;
    }

    .vb-events__title:hover {
        color: var(--vb-link);
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .vb-events__title:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 2px;
        border-radius: var(--vb-radius-sm);
    }

    .vb-events__text {
        display: block;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-12);
        overflow-wrap: anywhere;
    }

    .vb-events__item--child .vb-events__type {
        position: relative;
        align-self: stretch;
        display: flex;
        align-items: center;
        padding-left: var(--vb-space-20);
    }

    /* the line from the analysis above: an even corner (└), as tall as it is wide, that turns into the type at its
       middle, clear of the row's top border */
    .vb-events__item--child .vb-events__type::before {
        content: "";
        position: absolute;
        top: calc(50% - var(--vb-space-12));
        left: var(--vb-space-4);
        width: var(--vb-space-12);
        height: var(--vb-space-12);
        border-bottom: 1.5px solid var(--vb-border-control);
        border-left: 1.5px solid var(--vb-border-control);
        border-bottom-left-radius: var(--vb-radius-sm);
        pointer-events: none;
    }

    .vb-events__item--acute {
        box-shadow: inset 3px 0 0 var(--vb-warning);
    }

    .vb-events__item--current {
        background: var(--vb-bg-selected);
    }

    @media (max-width: 700px) {
        .vb-events__item {
            grid-template-columns: minmax(0, 1fr) auto;
            grid-template-areas: "type menu" "main menu" "date menu";
            padding-left: var(--vb-space-16);
        }

        /* a prescription's whole entry (type, what happened, date) sits indented under its analysis; the corner stays
           in the indent, beside the type */
        .vb-events__item--child {
            padding-left: calc(var(--vb-space-16) + var(--vb-space-20));
        }

        .vb-events__item--child .vb-events__type {
            padding-left: 0;
        }

        .vb-events__item--child .vb-events__type::before {
            left: calc(var(--vb-space-4) - var(--vb-space-20));
        }
    }

    /* ---- vb-drawer - a side panel at the right of the page (Case notes, GV tips): a header with title, optional subtitle
       and actions, then a body that scrolls. vb-core.js opens it from [data-vb-drawer="id"] buttons and closes it from
       [data-vb-drawer-close], Esc or the backdrop; focus moves into it and back. On a computer it does not block the
       page: the doctor can read the history while writing; in a vb-drawer-host it docks beside the page from 1280px.
       On tablets and phones (1024px and below, or a touch screen below 1280px) it is a tall bottom sheet instead, like
       the row menus: it slides up over a dimmed page, with a grip on its title bar to swipe it down. ---- */
    .vb-drawer {
        position: fixed;
        top: var(--vb-shell-header-h);
        right: 0;
        bottom: var(--vb-tabbar-h, 0px);
        z-index: var(--vb-z-drawer);
        display: flex;
        flex-direction: column;
        width: min(var(--vb-drawer-w), calc(100vw - var(--vb-space-24)));
        border-left: 1px solid var(--vb-border);
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        box-shadow: var(--vb-shadow-lg);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform var(--vb-duration-base) var(--vb-ease), visibility 0s linear var(--vb-duration-base);
    }

    .vb-drawer[data-vb-open] {
        transform: none;
        visibility: visible;
        transition: transform var(--vb-duration-base) var(--vb-ease);
    }

    /* a closed panel hides all it holds once it has slid away, even what a page forces visible (Analysis's Kendo editor
       has visibility: visible !important); a layered !important beats the page's unlayered one */
    .vb-drawer:not([data-vb-open]) * {
        visibility: inherit !important;
    }

    /* closing from the docked column: no slide (vb-core.js sets it for that one change) */
    .vb-drawer[data-vb-instant] {
        transition: none;
    }

    .vb-drawer:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -2px;
    }

    .vb-drawer__header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--vb-space-12);
        padding: var(--vb-space-16) var(--vb-space-20);
        border-bottom: 1px solid var(--vb-border);
    }

    .vb-drawer__title {
        margin: 0;
        font-size: var(--vb-text-16);
        font-weight: var(--vb-weight-semibold);
        line-height: var(--vb-leading-tight);
    }

    .vb-drawer__subtitle {
        margin: var(--vb-space-2) 0 0;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
    }

    .vb-drawer__actions {
        display: flex;
        flex: none;
        align-items: center;
        gap: var(--vb-space-4);
    }

    .vb-drawer__body {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        align-content: start;
        padding: var(--vb-space-16) var(--vb-space-20);
    }

    /* docked: the host keeps a column for the open panel, which stays in view as the page scrolls */
    @media (min-width: 1280px) {
        .vb-drawer-host[data-vb-docked] {
            display: grid;
            grid-template-columns: minmax(0, 1fr) var(--vb-drawer-w);
            align-items: start;
            gap: var(--vb-space-16);
        }

        .vb-drawer-host[data-vb-docked] > .vb-drawer {
            position: sticky;
            top: calc(var(--vb-shell-header-h) + var(--vb-space-16));
            bottom: auto;
            z-index: auto;
            width: auto;
            height: calc(100vh - var(--vb-shell-header-h) - 2 * var(--vb-space-16));
            border: 1px solid var(--vb-border);
            border-radius: var(--vb-radius-lg);
            box-shadow: none;
            overflow: hidden;
            transition: none;
        }
    }

    /* tablets and phones: a sheet from the foot of the screen (over the tab bar), most of the screen tall, at most
       760px wide; a page's Widen makes it fill the screen */
    @media (max-width: 1024px), (pointer: coarse) and (max-width: 1279px) {
        .vb-drawer {
            top: auto;
            right: 0;
            bottom: 0;
            left: 0;
            width: min(100%, 760px);
            height: calc(100dvh - var(--vb-space-48));
            margin-inline: auto;
            padding-bottom: env(safe-area-inset-bottom, 0px);
            border: 0;
            border-radius: 16px 16px 0 0;
            transform: translateY(100%);
            transition:
                transform var(--vb-duration-sheet) var(--vb-ease-sheet),
                visibility 0s linear var(--vb-duration-sheet);
        }

        .vb-drawer[data-vb-open] {
            transform: none;
            transition: transform var(--vb-duration-sheet) var(--vb-ease-sheet);
        }

        /* the grip: drag the title bar down to close (vb-core.js) */
        .vb-drawer__header {
            position: relative;
            padding-top: var(--vb-space-24);
            touch-action: none;
        }

        .vb-drawer__header::before {
            content: "";
            position: absolute;
            top: var(--vb-space-8);
            left: 50%;
            width: 36px;
            height: 5px;
            margin-left: -18px;
            border-radius: var(--vb-radius-pill);
            background: var(--vb-border-control);
        }
    }

    /* the backdrop behind a panel sheet fades in and out with it */
    .vb-backdrop--drawer {
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--vb-duration-sheet) var(--vb-ease-sheet);
    }

    .vb-backdrop--drawer[data-vb-shown] {
        opacity: 1;
        pointer-events: auto;
    }

    @media (prefers-reduced-motion: reduce) {
        .vb-drawer,
        .vb-drawer[data-vb-open],
        .vb-backdrop--drawer {
            transition: none;
        }
    }

    /* ---- vb-dialog--form - a dialog that holds a form (New case, Prescribe, Move): wider, a header with the title and
       a close button, a body that scrolls when long and a footer with the actions that stays in view. Phones: a bottom
       sheet like the menus and panels, sliding up over the tab bar with a grip on its header. A tap on the dim (and on
       a phone a swipe down) closes it as Esc does, asking first when the doctor typed in it (vb-core.js). vb-core.js opens it from [data-vb-dialog="id"], closes it from
       [data-vb-dialog-close], and Enter in one of its fields presses the dialog's own submit button. ---- */
    .vb-dialog--form {
        width: min(560px, calc(100vw - 32px));
        max-height: min(90vh, 760px);
    }

    .vb-dialog--form[open],
    .vb-dialog--form > form {
        display: flex;
        flex-direction: column;
    }

    /* a dialog with its own <form method="dialog"> inside (not posted with the page) */
    .vb-dialog--form > form {
        flex: 1 1 auto;
        min-height: 0;
        margin: 0;
    }

    .vb-dialog__header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--vb-space-12);
        padding: var(--vb-space-20) var(--vb-space-24) 0;
    }

    .vb-dialog--form .vb-dialog__body {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        padding: var(--vb-space-16) var(--vb-space-24);
    }

    .vb-dialog__footer {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: var(--vb-space-8);
        padding: var(--vb-space-12) var(--vb-space-24) var(--vb-space-20);
        border-top: 1px solid var(--vb-border);
    }

    @media (max-width: 576px) {
        .vb-dialog--form {
            width: 100vw;
            max-width: 100vw;
            max-height: calc(100dvh - var(--vb-space-48));
            margin: auto 0 0;
            padding-bottom: env(safe-area-inset-bottom, 0px);
            border-radius: 16px 16px 0 0;
            transform: translateY(100%);
            transition:
                transform var(--vb-duration-sheet) var(--vb-ease-sheet),
                overlay var(--vb-duration-sheet) allow-discrete,
                display var(--vb-duration-sheet) allow-discrete;
        }

        .vb-dialog--form[open] {
            transform: none;
        }

        @starting-style {
            .vb-dialog--form[open] {
                transform: translateY(100%);
            }
        }

        .vb-dialog--form::backdrop {
            opacity: 0;
            transition:
                opacity var(--vb-duration-sheet) var(--vb-ease-sheet),
                overlay var(--vb-duration-sheet) allow-discrete,
                display var(--vb-duration-sheet) allow-discrete;
        }

        .vb-dialog--form[open]::backdrop {
            opacity: 1;
        }

        @starting-style {
            .vb-dialog--form[open]::backdrop {
                opacity: 0;
            }
        }

        /* the grip: drag the header down to close */
        .vb-dialog--form .vb-dialog__header {
            position: relative;
            padding-top: var(--vb-space-24);
        }

        .vb-dialog--form .vb-dialog__header::before {
            content: "";
            position: absolute;
            top: var(--vb-space-8);
            left: 50%;
            width: 36px;
            height: 5px;
            margin-left: -18px;
            border-radius: var(--vb-radius-pill);
            background: var(--vb-border-control);
        }

        .vb-dialog__footer > .vb-btn {
            flex: 1 1 auto;
        }
    }

    @media (max-width: 576px) and (prefers-reduced-motion: reduce) {
        .vb-dialog--form,
        .vb-dialog--form::backdrop {
            transition: none;
        }
    }

    /* ---- vb-search - one search field: the magnifier submits, the text, a clear button that shows once there is
       something to clear, and an attached segment saying what to search in (a native select after an "In:" label,
       so keyboards, screen readers and phone pickers work as usual). A picker (__picker) can stand in for the text.
       Cases is the example. ---- */
    .vb-search {
        display: flex;
        align-items: stretch;
        width: 100%;
        max-width: 720px;
        min-height: var(--vb-control-h);
        border: 1px solid var(--vb-border-control);
        border-radius: var(--vb-radius-pill);
        background: var(--vb-bg-surface);
        color: var(--vb-text);
        font-size: var(--vb-text-14);
        font-weight: var(--vb-weight-regular);
        transition: border-color var(--vb-duration-fast) var(--vb-ease);
    }

    /* the same states as every field: a darker border on hover, the action border and the focus ring when in use */
    .vb-search:hover {
        border-color: var(--vb-text-muted);
    }

    .vb-search:focus-within {
        border-color: var(--vb-action);
        outline: 2px solid var(--vb-focus);
        outline-offset: 1px;
    }

    /* compact (30px) on tablets and computers: a search in a panel's toolbar (Analysis's remedy filter) */
    @media (min-width: 577px) {
        .vb-search.vb-search--sm {
            min-height: var(--vb-control-h-sm);
            font-size: var(--vb-text-13);
        }

        .vb-search--sm .vb-search__submit {
            width: var(--vb-control-h-sm);
        }
    }

    .vb-search__submit {
        flex: none;
        display: inline-grid;
        place-items: center;
        width: var(--vb-control-h);
        padding: 0;
        border: 0;
        border-radius: var(--vb-radius-pill);
        background: none;
        color: var(--vb-text-muted);
        font: inherit;
        cursor: pointer;
    }

    .vb-search__submit:hover {
        color: var(--vb-text);
    }

    .vb-search__submit:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -4px;
    }

    /* ---- The clear button: one look for every field that can be emptied (vb-search, and in vendor-select2.css and
       vendor-kendo.css the remedy pickers and the chapter picker): a small round button, muted, that darkens with a
       faint fill on hover ---- */
    .vb-search__clear {
        flex: none;
        align-self: center;
        display: inline-grid;
        place-items: center;
        width: 24px;
        height: 24px;
        margin-right: var(--vb-space-8);
        padding: 0;
        border: 0;
        border-radius: var(--vb-radius-pill);
        background: none;
        color: var(--vb-text-muted);
        font: inherit;
        font-size: var(--vb-text-13);
        cursor: pointer;
    }

    .vb-search__clear:hover {
        background: color-mix(in srgb, var(--vb-text) 8%, transparent);
        color: var(--vb-text);
    }

    .vb-search__clear:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: 0;
    }

    .vb-search__clear[hidden] {
        display: none;
    }

    .vb-search__input {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0 var(--vb-space-4);
        border: 0;
        background: transparent;
        color: inherit;
        font-family: var(--vb-font-sans);
        font-size: inherit;
        font-weight: inherit;
        outline: none;
    }

    .vb-search__input::placeholder {
        color: var(--vb-text-muted);
    }

    /* the field has its own clear button */
    .vb-search__input::-webkit-search-cancel-button {
        -webkit-appearance: none;
    }

    .vb-search__picker {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
    }

    .vb-search__filter {
        position: relative;
        flex: none;
        display: flex;
        align-items: stretch;
        border-left: 1px solid var(--vb-border);
        border-radius: 0 var(--vb-radius-pill) var(--vb-radius-pill) 0;
        background: var(--vb-bg-subtle);
    }

    /* "In:" sits over the select's left padding, centred on the same line as the choice (line-height 1 for both, so
       both are centred by their type, not by different line boxes); a click on it reaches the select */
    .vb-search__filter-label {
        position: absolute;
        top: 0;
        bottom: 0;
        left: var(--vb-space-12);
        display: flex;
        align-items: center;
        color: var(--vb-text-muted);
        font-size: var(--vb-text-13);
        line-height: 1;
        pointer-events: none;
    }

    /* the choice, with the chevron every select has (--vb-select-chevron), centred in the same box */
    .vb-search__filter select {
        -webkit-appearance: none;
        appearance: none;
        min-height: calc(var(--vb-control-h) - 2px);
        padding: 0 var(--vb-space-32) 0 calc(var(--vb-space-12) + 1.75em);
        border: 0;
        border-radius: inherit;
        background: transparent var(--vb-select-chevron) no-repeat right var(--vb-space-12) center / 12px;
        color: var(--vb-text);
        font-family: var(--vb-font-sans);
        font-size: var(--vb-text-13);
        font-weight: var(--vb-weight-semibold);
        line-height: 1;
        cursor: pointer;
    }

    .vb-search__filter select:focus-visible {
        outline: 2px solid var(--vb-focus);
        outline-offset: -3px;
    }

    @media (max-width: 576px) {
        /* at least 16px, so iOS Safari does not zoom on focus */
        .vb-search__input,
        .vb-search__filter select {
            font-size: max(16px, var(--vb-text-16));
        }
    }
}

/* vb.confirm / vb.alert dialogs are added to <body> on every page, including pages not yet migrated, where Bootstrap and
   page CSS (h2, p) sit outside the layers and would beat the rules above: their type is repeated here, unlayered and
   limited to <dialog class="vb-dialog">, so it holds on any page */
dialog.vb-dialog .vb-dialog__title {
    margin: 0;
    font-family: var(--vb-font-sans);
    font-size: var(--vb-text-18);
    font-weight: var(--vb-weight-semibold);
    line-height: var(--vb-leading-tight);
    color: var(--vb-text);
}

dialog.vb-dialog.vb-dialog--alert .vb-dialog__title {
    font-size: var(--vb-text-16);
}

dialog.vb-dialog .vb-dialog__message {
    margin: 0;
    font-family: var(--vb-font-sans);
    font-size: var(--vb-text-14);
    font-weight: var(--vb-weight-regular);
    line-height: var(--vb-leading-body);
    color: var(--vb-text-muted);
}

dialog.vb-dialog .vb-dialog__list {
    margin: 0;
    padding: var(--vb-space-8) var(--vb-space-12);
    list-style: none;
    font-family: var(--vb-font-sans);
    font-size: var(--vb-text-13);
    font-weight: var(--vb-weight-regular);
    line-height: var(--vb-leading-body);
    color: var(--vb-text);
}

dialog.vb-dialog .vb-dialog__list li {
    margin: 0;
    padding: 0;
}
