:root {
    --navy-900: #090c1e;
    --navy-800: #162040;
    --navy-700: #1e2a55;
    --brand: #2c3e7a;
    --brand-mid: #3a52a0;
    --brand-soft: #eef2ff;
    --accent: #00bfa6;
    --bg: #f8fafc;
    --bg-2: #f1f5f9;
    --field: #f5f9ff;
    --field-hover: #eef5ff;
    --field-line: #dbe6f5;
    --field-line-strong: #b9cde8;
    --card: #ffffff;
    --line: #e2e8f0;
    --line-soft: #f1f5f9;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --muted-lt: #94a3b8;
    --green: #059669;
    --green-ink: #065f46;
    --mint: #ecfdf5;
    --sky: #eff6ff;
    --sky-ink: #1d4ed8;
    --cream: #fffbeb;
    --cream-ink: #c2410c;
    --amber: #d97706;
    --lilac: #f5f3ff;
    --lilac-ink: #7c3aed;
    --teal: #e6f2f3;
    --teal-ink: #136b71;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --r-xs: 5px;
    --r-sm: 7px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --r-pill: 999px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, .07);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .10);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .14);
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 18px;
    --sp-6: 22px;
    --sp-7: 34px;
    --font-display: 'Sora', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-num: 'DM Mono', 'Consolas', ui-monospace, monospace;
    --sidebar-w: 188px;
    --sidebar-rail-w: 72px;
    --topbar-h: 60px;
    --avm-primary: #263192;
    --avm-primary-dark: #1b246d;
    --avm-accent: #ed1c24;
    --avm-info: #00aeef;
    --avm-success: #16a34a;
    --avm-warning: #f59e0b;
    --avm-danger: #dc2626;
    --avm-bg: #f6f8fc;
    --avm-surface: #ffffff;
    --avm-border: #d9e1f2;
    --avm-text: #1f2937;
    --avm-muted: #6b7280;
    /* VAi only. Deliberately not a hue: navy is the brand, red is the accent
       and danger, cyan is information, green is success and the Pay now
       button, amber is warning. A fifth colour has nowhere to stand without
       being read as one of those, so the assistant is graphite and the VAi
       mark is the only colour on it. */
    --avm-ai: #333a47;
    --avm-ai-dark: #1f242e;
    --avm-ai-ink: #1b2a83;
    --avm-ai-tint: #f6f8fb;
    --avm-ai-edge: #e2e7f0;
}

:root {
    --avm-font-scale: 1;
}

html[data-font-scale="sm"] {
    --avm-font-scale: .94;
}

html[data-font-scale="md"] {
    --avm-font-scale: 1;
}

html[data-font-scale="lg"] {
    --avm-font-scale: 1.12;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #c3ceda transparent;
}

    *::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    *::-webkit-scrollbar-track {
        background: transparent;
    }

    *::-webkit-scrollbar-thumb {
        background: #c3ceda;
        border-radius: 3px;
    }

        *::-webkit-scrollbar-thumb:hover {
            background: #9fb0c2;
        }

html {
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: calc(14px * var(--avm-font-scale));
    margin: 0;
    min-height: 100vh;
}

a {
    color: var(--brand-mid);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) *,
    :root:not([data-motion="full"]) *::before,
    :root:not([data-motion="full"]) *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

.avm-auth-page {
    align-items: center;
    display: grid;
    min-height: calc(100vh - 10rem);
}

.avm-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    padding: 2.5rem;
}

    .avm-auth-form h2 {
        font-size: calc(1.6rem * var(--avm-font-scale));
        margin: 0;
    }

.avm-auth-form-subtitle {
    color: var(--avm-muted);
    margin: -.4rem 0 .5rem;
}

.avm-alert {
    border-radius: .45rem;
    padding: .75rem .9rem;
}

.avm-alert-danger {
    background: rgba(220, 38, 38, .09);
    border: 1px solid rgba(220, 38, 38, .28);
    color: var(--avm-danger);
}

.avm-alert-success {
    background: rgba(22, 163, 74, .09);
    border: 1px solid rgba(22, 163, 74, .28);
    color: var(--avm-success);
}

.avm-auth-body {
    background: #253f7a;
    overflow: hidden;
}

.avm-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avm-card,
.avm-table-shell,
.avm-filterbar,
.avm-modal {
    background: var(--avm-surface);
    border: 1px solid var(--avm-border);
    border-radius: .5rem;
    box-shadow: 0 10px 28px rgba(31, 41, 55, .06);
}

.avm-filterbar {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem;
}

.avm-field {
    display: grid;
    gap: .35rem;
    min-width: 12rem;
}

.avm-label {
    color: var(--avm-muted);
    font-size: calc(.82rem * var(--avm-font-scale));
    font-weight: 600;
}

.avm-input,
.avm-select,
.avm-textarea {
    background: var(--avm-surface);
    border: 1px solid var(--avm-border);
    border-radius: .4rem;
    color: var(--avm-text);
    min-height: 2.4rem;
    padding: .5rem .65rem;
}

.avm-input-sm,
.avm-select-sm {
    border-radius: .42rem;
    font-size: calc(.84rem * var(--avm-font-scale));
    min-height: 2.05rem;
    padding: .34rem .55rem;
}

.avm-input-md,
.avm-select-md {
    min-height: 2.4rem;
}

.avm-input-lg,
.avm-select-lg {
    min-height: 2.8rem;
    padding: .62rem .8rem;
}

.avm-input:focus,
.avm-select:focus,
.avm-textarea:focus {
    border-color: var(--avm-primary);
    box-shadow: 0 0 0 .2rem rgba(38, 49, 146, .12);
    outline: 0;
}

.avm-btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: .4rem;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    gap: .45rem;
    justify-content: center;
    min-height: 2.4rem;
    padding: .5rem .8rem;
    text-decoration: none;
}

    .avm-btn:disabled,
    .avm-btn[aria-disabled="true"] {
        cursor: not-allowed;
        opacity: .6;
    }

.avm-btn-primary {
    background: var(--avm-primary);
    color: #fff;
}

    .avm-btn-primary:hover {
        background: var(--avm-primary-dark);
        color: #fff;
    }

.avm-btn-ghost {
    background: var(--avm-surface);
    border-color: var(--avm-border);
    color: var(--avm-primary);
}

.avm-btn-danger {
    background: var(--avm-danger);
    color: #fff;
}

.avm-table-shell {
    border-radius: 0;
    overflow: hidden;
}

.avm-table-scroll {
    overflow: auto;
    width: 100%;
}

.avm-table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    width: 100%;
}

    .avm-table th,
    .avm-table td {
        border-bottom: 1px solid var(--avm-border);
        padding: .75rem;
        vertical-align: middle;
        white-space: nowrap;
    }

    .avm-table th {
        background: #eef2ff;
        color: var(--avm-primary-dark);
        font-size: calc(.8rem * var(--avm-font-scale));
        font-weight: 800;
        position: sticky;
        text-transform: uppercase;
        top: 0;
        z-index: 2;
    }

    .avm-table td.avm-num,
    .avm-table td.avm-money {
        font-variant-numeric: tabular-nums;
        text-align: right;
    }

    .avm-table td.avm-date {
        text-align: center;
    }

.avm-loader {
    align-items: center;
    color: var(--avm-muted);
    display: inline-flex;
    gap: .5rem;
}

.avm-spinner {
    animation: avm-spin .8s linear infinite;
    border: 2px solid var(--avm-border);
    border-top-color: var(--avm-primary);
    border-radius: 999px;
    height: 1rem;
    width: 1rem;
}

.avm-empty,
.avm-error {
    color: var(--avm-muted);
    padding: 2rem;
    text-align: center;
}

.avm-error {
    color: var(--avm-danger);
}

.avm-pagination {
    align-items: center;
    border-top: 1px solid var(--avm-border);
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: space-between;
    padding: .75rem 1rem;
}

.avm-pagination-pages {
    display: flex;
    gap: .35rem;
}

.avm-page-button {
    background: var(--avm-surface);
    border: 1px solid var(--avm-border);
    border-radius: .35rem;
    color: var(--avm-text);
    min-height: 2rem;
    min-width: 2rem;
}

    .avm-page-button[aria-current="page"] {
        background: var(--avm-primary);
        color: #fff;
    }

.avm-modal-backdrop {
    align-items: center;
    background: rgba(31, 41, 55, .55);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 2000;
}

.avm-barcode-scanner {
    background: var(--avm-surface);
    color: var(--avm-text);
    border: 1px solid var(--avm-border);
    border-radius: 8px;
    padding: 0;
    width: min(36rem, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    overflow: auto;
}

    .avm-barcode-scanner::backdrop {
        background: rgba(31, 41, 55, .55);
    }

    .avm-barcode-scanner h2 {
        font-size: 1.1rem;
        margin: 0;
    }

.avm-barcode-viewport {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--avm-text);
}

.avm-barcode-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avm-barcode-viewfinder {
    position: absolute;
    inset: 35% 10%;
    border: 2px solid var(--avm-surface);
    border-radius: 6px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
    pointer-events: none;
}

.avm-barcode-scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: var(--avm-danger);
    visibility: hidden;
}

.avm-barcode-viewport.is-scanning .avm-barcode-scan-line {
    visibility: visible;
    animation: avm-barcode-scan 1.8s ease-in-out infinite alternate;
}

@keyframes avm-barcode-scan {
    from {
        top: 0;
    }

    to {
        top: calc(100% - 2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .avm-barcode-viewport.is-scanning .avm-barcode-scan-line {
        animation: none;
    }
}

.avm-modal-backdrop.is-open {
    display: flex;
}

.avm-modal {
    max-height: min(90vh, 48rem);
    max-width: 42rem;
    overflow: auto;
    width: 100%;
}

.avm-modal-header,
.avm-modal-footer {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    padding: 1rem;
}

.avm-modal-body {
    border-bottom: 1px solid var(--avm-border);
    border-top: 1px solid var(--avm-border);
    padding: 1rem;
}

.avm-form-error {
    color: var(--avm-danger);
    font-size: calc(.85rem * var(--avm-font-scale));
    margin-top: .3rem;
}

.avm-truncate-15,
.avm-truncate-20,
.avm-truncate-30,
.avm-truncate-35,
.avm-truncate-name,
.avm-truncate-email,
.avm-truncate-address {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.avm-truncate-15 {
    max-width: 15ch;
}

.avm-truncate-20,
.avm-truncate-email {
    max-width: 20ch;
}

.avm-truncate-30,
.avm-truncate-name {
    max-width: 30ch;
}

.avm-truncate-35,
.avm-truncate-address {
    max-width: 35ch;
}

.avm-auth-page-standalone {
    align-items: center;
    --avm-auth-panel-width: clamp(30rem, 36vw, 38rem);
    --avm-auth-card-width: 25.5rem;
    --avm-auth-panel-gutter: max(1.25rem, calc((var(--avm-auth-panel-width) - var(--avm-auth-card-width)) / 2));
    background: linear-gradient( 270deg, rgba(37, 63, 122, .95) 0%, rgba(45, 70, 125, .85) 45%, rgba(55, 80, 135, .55) 70%, rgba(55, 80, 135, .15) 100% ), url("/images/avm-lab-login-bg.png") center / cover no-repeat;
    display: flex;
    gap: clamp(1.25rem, 3vw, 3rem);
    justify-content: flex-end;
    height: 100vh;
    overflow: hidden;
    padding: .75rem var(--avm-auth-panel-gutter) .75rem clamp(1rem, 3vw, 3rem);
    position: relative;
}

    .avm-auth-page-standalone::before {
        background: linear-gradient( 180deg, rgba(28, 31, 58, .96) 0%, rgba(12, 26, 54, .98) 100% );
        border-left: 1px solid rgba(255, 255, 255, .12);
        bottom: 0;
        content: "";
        position: absolute;
        right: 0;
        top: 0;
        width: var(--avm-auth-panel-width);
    }

.avm-auth-intro {
    align-self: stretch;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-width: 48rem;
    padding: clamp(1.35rem, 3.2vh, 2.5rem) 0 clamp(1.2rem, 3vh, 2.15rem);
    position: relative;
    width: min(48rem, calc(100vw - var(--avm-auth-panel-width) - var(--avm-auth-panel-gutter) - 4rem));
    z-index: 1;
}

.avm-auth-intro-brand {
    align-items: center;
    display: inline-flex;
    gap: 1.15rem;
    justify-self: start;
}

.avm-auth-intro-logo {
    display: block;
    height: auto;
    max-height: 4.4rem;
    object-fit: contain;
    width: 8.4rem;
}

.avm-auth-intro-divider {
    background: linear-gradient(180deg, #1c74d8, #20aef3);
    border-radius: 999px;
    height: 3.35rem;
    width: 2px;
}

.avm-auth-intro-brand p {
    color: #f8fbff;
    font-size: calc(.92rem * var(--avm-font-scale));
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
    text-shadow: 0 2px 10px rgba(7, 18, 52, .5);
}

.avm-auth-intro-main {
    align-self: center;
}

    .avm-auth-intro-main h1 {
        color: #fff;
        font-size: clamp(2.4rem, 4.2vw, 4.85rem);
        font-weight: 800;
        letter-spacing: 0;
        line-height: .98;
        margin: 0 0 1.15rem;
        text-shadow: 0 4px 18px rgba(7, 18, 52, .55);
    }

.avm-auth-intro-copy {
    color: #f2f7ff;
    font-size: calc(1.05rem * var(--avm-font-scale));
    font-weight: 600;
    line-height: 1.65;
    margin: 0 0 2.1rem;
    text-shadow: 0 3px 14px rgba(7, 18, 52, .48);
}

.avm-auth-feature-row {
    display: grid;
    gap: .95rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 39rem;
}

.avm-auth-feature-card {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(222, 231, 246, .88);
    border-radius: .9rem;
    box-shadow: 0 12px 30px rgba(19, 45, 82, .08);
    display: grid;
    gap: .16rem .8rem;
    grid-template-columns: 2.15rem minmax(0, 1fr);
    min-height: 5.2rem;
    padding: .88rem .95rem;
}

.avm-auth-feature-icon,
.avm-auth-security-icon {
    align-items: center;
    background: #eaf6ff;
    border-radius: .65rem;
    color: #138fe3;
    display: inline-flex;
    justify-content: center;
}

.avm-auth-feature-icon {
    grid-row: 1 / span 2;
    height: 2.15rem;
    width: 2.15rem;
}

    .avm-auth-feature-icon svg,
    .avm-auth-security-icon svg {
        fill: currentColor;
    }

    .avm-auth-feature-icon svg {
        height: 1.15rem;
        width: 1.15rem;
    }

.avm-auth-feature-card strong {
    color: #102057;
    font-size: calc(.98rem * var(--avm-font-scale));
    line-height: 1.1;
}

.avm-auth-feature-card span:last-child {
    color: #71809a;
    font-size: calc(.78rem * var(--avm-font-scale));
    font-weight: 600;
    line-height: 1.25;
}

.avm-auth-security-note {
    align-items: center;
    color: #f7fbff;
    display: flex;
    gap: .85rem;
    text-shadow: 0 3px 14px rgba(7, 18, 52, .5);
}

.avm-auth-security-icon {
    flex: 0 0 auto;
    height: 2.35rem;
    width: 2.35rem;
}

    .avm-auth-security-icon svg {
        height: 1.18rem;
        width: 1.18rem;
    }

.avm-auth-security-note p {
    font-size: calc(.86rem * var(--avm-font-scale));
    font-weight: 600;
    line-height: 1.55;
    margin: 0;
}

.avm-auth-security-row {
    color: rgba(255, 255, 255, .68);
    font-size: calc(.75rem * var(--avm-font-scale));
    letter-spacing: .08em;
    text-transform: uppercase;
}

.avm-auth-card {
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(217, 225, 242, .9);
    border-radius: 1.15rem;
    box-shadow: 0 26px 60px rgba(0, 0, 0, .34);
    max-width: 25.5rem;
    overflow: hidden;
    padding: 0 clamp(1.15rem, 2vw, 1.65rem) clamp(1rem, 2vw, 1.25rem);
    position: relative;
    width: min(var(--avm-auth-card-width), calc(var(--avm-auth-panel-width) - 2.5rem), 100%);
    z-index: 1;
}

.avm-auth-card-bar {
    background: linear-gradient(90deg, #3744b0, #152081);
    height: .3rem;
    margin: 0 calc(clamp(1.15rem, 2vw, 1.65rem) * -1) .8rem;
}

.avm-auth-card-compact {
    grid-column: 1 / -1;
}

.avm-auth-card-logo {
    display: block;
    height: auto;
    margin: 0 auto .45rem;
    max-height: 4.15rem;
    max-width: 8.6rem;
    object-fit: contain;
    width: 48%;
}

.avm-auth-card h2 {
    color: var(--avm-primary-dark);
    font-size: calc(1.32rem * var(--avm-font-scale));
    letter-spacing: .02em;
    margin: 0;
    text-align: center;
}

.avm-auth-card .avm-auth-form-subtitle {
    color: #425174;
    font-size: calc(.74rem * var(--avm-font-scale));
    margin: .25rem 0 0;
    text-align: center;
}

.avm-auth-card .avm-auth-form {
    gap: .62rem;
    padding: 0;
}

.avm-auth-tagline {
    align-items: center;
    display: flex;
    gap: .75rem;
    margin: .62rem 0 .82rem;
}

    .avm-auth-tagline span {
        background: #e6ecf7;
        flex: 1;
        height: 1px;
    }

    .avm-auth-tagline strong {
        color: var(--avm-primary);
        font-size: calc(.58rem * var(--avm-font-scale));
        letter-spacing: .18em;
        text-transform: uppercase;
        white-space: nowrap;
    }

.avm-label-row {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.avm-auth-link {
    align-items: center;
    color: var(--avm-primary);
    display: inline-flex;
    font-size: calc(.78rem * var(--avm-font-scale));
    font-weight: 700;
    gap: .25rem;
    text-decoration: none;
}

    .avm-auth-link svg {
        fill: currentColor;
        height: .82rem;
        width: .82rem;
    }

    .avm-auth-link:hover {
        text-decoration: underline;
    }

.avm-input-icon-wrap {
    position: relative;
}

.avm-input-icon {
    align-items: center;
    color: #8fa0bb;
    display: inline-flex;
    height: 100%;
    justify-content: center;
    left: 1rem;
    position: absolute;
    top: 0;
    width: 1.25rem;
}

    .avm-input-icon svg,
    .avm-input-action svg,
    .avm-auth-security-row svg {
        fill: currentColor;
    }

.avm-input-with-icon {
    background: #eaf2ff;
    border-color: #d7e3f7;
    border-radius: .75rem;
    color: #111827;
    font-size: calc(.9rem * var(--avm-font-scale));
    min-height: 2.75rem;
    padding-left: 3.2rem;
    width: 100%;
}

    .avm-input-with-icon::placeholder {
        color: #8190aa;
    }

    .avm-input-with-icon:focus {
        background: #fff;
        border-color: var(--avm-primary);
    }

.avm-input-with-action {
    padding-right: 3.1rem;
}

.avm-input-action {
    align-items: center;
    background: transparent;
    border: 0;
    color: #8090aa;
    cursor: pointer;
    display: inline-flex;
    height: 100%;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: .95rem;
    top: 0;
    width: 1.4rem;
}

    .avm-input-action:hover,
    .avm-input-action[aria-pressed="true"] {
        color: var(--avm-primary);
    }

        .avm-eye-hide,
        .avm-input-action[aria-pressed="true"] .avm-eye-show {
            display: none;
        }

        .avm-input-action[aria-pressed="true"] .avm-eye-hide {
            display: block;
        }

.avm-auth-remember {
    align-items: center;
    color: #55627a;
    cursor: pointer;
    display: inline-flex;
    font-size: calc(.78rem * var(--avm-font-scale));
    gap: .55rem;
    margin: 0 0 .55rem;
    user-select: none;
}

    .avm-auth-remember input {
        accent-color: var(--avm-primary);
        height: 1.05rem;
        margin: 0;
        width: 1.05rem;
    }

.avm-auth-submit {
    align-items: center;
    border-radius: .8rem;
    box-shadow: 0 14px 28px rgba(38, 49, 146, .28);
    display: inline-flex;
    font-size: calc(.82rem * var(--avm-font-scale));
    gap: .65rem;
    justify-content: center;
    letter-spacing: .13em;
    min-height: 2.8rem;
    text-transform: uppercase;
    width: 100%;
}

    .avm-auth-submit.avm-is-loading {
        cursor: wait;
        opacity: .94;
    }

.avm-submit-spinner {
    animation: avm-spin .65s linear infinite;
    border: 2px solid rgba(255, 255, 255, .42);
    border-radius: 999px;
    border-top-color: #fff;
    display: none;
    flex: 0 0 auto;
    height: 1rem;
    width: 1rem;
}

.avm-auth-submit.avm-is-loading .avm-submit-spinner {
    display: inline-block;
}

.avm-auth-form-message {
    color: var(--avm-danger);
    font-size: calc(.78rem * var(--avm-font-scale));
    font-weight: 700;
    line-height: 1.25;
    margin: -.2rem 0 0;
    min-height: 1rem;
    text-align: center;
}

    .avm-auth-form-message.is-success {
        color: var(--avm-success);
    }

.avm-auth-step-text {
    color: #263653;
    font-size: calc(.86rem * var(--avm-font-scale));
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    text-align: left;
}

.avm-otp-row {
    display: grid;
    gap: .55rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.avm-otp-input {
    aspect-ratio: 1;
    background: #eaf2ff;
    border: 1px solid #cddcf5;
    border-radius: .75rem;
    color: #111827;
    font-size: calc(1.18rem * var(--avm-font-scale));
    font-weight: 800;
    outline: none;
    text-align: center;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    width: 100%;
}

    .avm-otp-input:focus {
        background: #f8fbff;
        border-color: var(--avm-primary);
        box-shadow: 0 0 0 3px rgba(38, 49, 146, .14);
    }

.avm-auth-card-divider {
    background: #e8eef8;
    height: 1px;
    margin: .45rem 0 .55rem;
}

.avm-auth-card-note {
    color: #8391a8;
    font-size: calc(.7rem * var(--avm-font-scale));
    line-height: 1.55;
    margin: 0 0 .5rem;
    text-align: center;
}

.avm-auth-security-row {
    align-items: center;
    color: #9aabba;
    display: flex;
    flex-wrap: wrap;
    font-size: calc(.62rem * var(--avm-font-scale));
    font-weight: 700;
    gap: .85rem;
    justify-content: center;
    letter-spacing: .08em;
    margin-top: 0;
}

    .avm-auth-security-row span {
        align-items: center;
        display: inline-flex;
        gap: .35rem;
    }

    .avm-auth-security-row svg {
        height: .9rem;
        width: .9rem;
    }

.avm-auth-back-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 1rem;
    width: 100%;
}

@keyframes avm-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .avm-auth-page-standalone {
        --avm-auth-panel-width: 100%;
        --avm-auth-card-width: 25.5rem;
        --avm-auth-panel-gutter: 1rem;
        background: linear-gradient( 270deg, rgba(37, 63, 122, .95) 0%, rgba(45, 70, 125, .85) 45%, rgba(55, 80, 135, .55) 70%, rgba(55, 80, 135, .15) 100% ), url("/images/avm-lab-login-bg.png") left top / cover no-repeat;
        justify-content: center;
        min-height: 100vh;
        overflow-y: auto;
        padding: 1rem;
    }

        .avm-auth-page-standalone::before {
            width: 100%;
        }

    .avm-auth-intro {
        display: none;
    }

    .avm-auth-card {
        width: 100%;
    }

    .avm-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .avm-field,
    .avm-btn {
        width: 100%;
    }
}

html,
body {
    height: 100%;
}

    body:not(.avm-auth-body) {
        overflow: hidden;
    }

.avm-portal-shell {
    background: var(--bg);
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    transition: grid-template-columns .24s cubic-bezier(.4, 0, .2, 1);
}

.avm-sidebar {
    background: radial-gradient(120% 60% at 0% 0%, rgba(5, 150, 105, .10), transparent 60%), linear-gradient(180deg, var(--navy-700) 0%, var(--navy-800) 46%, var(--navy-900) 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 45;
}

    .avm-sidebar::before {
        background: linear-gradient(to bottom, transparent, rgba(5, 150, 105, .55), transparent);
        content: "";
        height: 100%;
        opacity: .5;
        pointer-events: none;
        position: absolute;
        right: 0;
        top: 0;
        width: 1px;
    }

.avm-sidebar-frame {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.avm-sidebar-brand {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    min-height: 72px;
    text-decoration: none;
}

.avm-sidebar-logo {
    background: #fff;
    display: block;
    flex-shrink: 0;
    height: auto;
    max-height: 54px;
    max-width: 132px;
    object-fit: contain;
    padding: 4px 8px;
    margin: 0 auto;
}

.avm-sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: var(--sp-3) var(--sp-2);
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

    .avm-sidebar-scroll::-webkit-scrollbar {
        width: 4px;
    }

    .avm-sidebar-scroll::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .18);
        border-radius: 2px;
    }

.avm-nav-group + .avm-nav-group {
    margin-top: var(--sp-5);
}

.avm-nav-section-label {
    color: rgba(255, 255, 255, .28);
    font-family: var(--font-display);
    font-size: calc(9px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: var(--sp-1);
    padding: 0 var(--sp-3);
    text-transform: uppercase;
    white-space: nowrap;
}

.avm-nav-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    color: rgba(255, 255, 255, .52);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 500;
    gap: var(--sp-3);
    margin-bottom: 2px;
    padding: 9px var(--sp-3);
    position: relative;
    text-align: left;
    text-decoration: none;
    transition: background .16s, color .16s;
    white-space: nowrap;
    width: 100%;
}

    .avm-nav-item:hover,
    .avm-nav-item.is-active {
        background: rgba(5, 150, 105, .14);
        color: #fff;
    }

    .avm-nav-item.is-active {
        font-weight: 600;
    }

        .avm-nav-item.is-active::before {
            background: var(--green);
            border-radius: 0 3px 3px 0;
            box-shadow: 0 0 8px rgba(5, 150, 105, .45);
            content: "";
            height: 52%;
            left: 0;
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
        }

    .avm-nav-item.is-disabled {
        cursor: not-allowed;
        opacity: .38;
    }

        .avm-nav-item.is-disabled:hover {
            background: transparent;
            color: rgba(255, 255, 255, .52);
        }

.avm-nav-icon {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    height: 18px;
    justify-content: center;
    opacity: .7;
    width: 18px;
}

.avm-nav-item.is-active .avm-nav-icon {
    opacity: 1;
}

.avm-nav-icon svg,
.avm-icon-button svg {
    fill: currentColor;
    height: 100%;
    width: 100%;
}

.avm-nav-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar submenus */
.avm-nav-dropdown {
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
}

.avm-nav-dropdown-toggle {
    width: 100%;
}

.avm-nav-dropdown.is-open > .avm-nav-dropdown-toggle {
    color: #fff;
}

.avm-nav-dropdown-toggle.is-parent-active {
    color: #fff;
    font-weight: 600;
}

    .avm-nav-dropdown-toggle.is-parent-active::before {
        background: var(--green);
        border-radius: 0 3px 3px 0;
        box-shadow: 0 0 8px rgba(5, 150, 105, .45);
        content: "";
        height: 40%;
        left: 0;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
    }

.avm-nav-chevron {
    margin-left: auto;
    width: 14px;
    height: 14px;
    opacity: 0.55;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.16s ease;
    flex-shrink: 0;
}

.avm-nav-dropdown.is-open > .avm-nav-dropdown-toggle .avm-nav-chevron {
    transform: rotate(180deg);
    opacity: 0.9;
}

.avm-nav-submenu {
    display: none;
    flex-direction: column;
    padding: 3px 0 6px 12px;
    margin-left: 17px;
    border-left: 1.5px solid rgba(255, 255, 255, 0.12);
}

.avm-nav-dropdown.is-open > .avm-nav-submenu {
    display: flex;
}

.avm-nav-subitem {
    font-size: calc(12.5px * var(--avm-font-scale));
    padding: 7px 10px;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
    border-radius: var(--r-sm);
    margin-bottom: 2px;
}

    .avm-nav-subitem:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.06);
    }

    .avm-nav-subitem.is-active {
        color: #fff;
        background: rgba(5, 150, 105, 0.16);
        font-weight: 600;
    }

        .avm-nav-subitem.is-active::before {
            display: none;
        }

.avm-subitem-bullet {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
    transition: background 0.16s ease, transform 0.16s ease;
}

.avm-nav-subitem:hover .avm-subitem-bullet {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.avm-nav-subitem.is-active .avm-subitem-bullet {
    background: var(--green);
    box-shadow: 0 0 6px rgba(5, 150, 105, 0.8);
    transform: scale(1.3);
}

.avm-sidebar-signout {
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 6px;
    padding: 8px var(--sp-2);
    border-radius: var(--r-sm);
}

    .avm-sidebar-signout:hover {
        color: #fca5a5;
        background: rgba(239, 68, 68, 0.14);
    }

.avm-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, .07);
    flex-shrink: 0;
    overflow: hidden;
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
}

.avm-sidebar-status {
    align-items: center;
    color: rgba(255, 255, 255, .5);
    display: flex;
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 600;
    gap: var(--sp-2);
    letter-spacing: .3px;
    text-transform: uppercase;
}

    .avm-sidebar-status span {
        background: var(--green);
        border-radius: 50%;
        box-shadow: 0 0 0 3px rgba(5, 150, 105, .18);
        flex-shrink: 0;
        height: 6px;
        width: 6px;
    }

.avm-sidebar-profile {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    display: flex;
    flex-shrink: 0;
    gap: var(--sp-2);
    padding: 10px var(--sp-4);
}

.avm-sidebar-avatar {
    align-items: center;
    background: var(--green);
    border-radius: var(--r-sm);
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    height: 30px;
    justify-content: center;
    letter-spacing: -.3px;
    width: 30px;
}

.avm-sidebar-identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .avm-sidebar-identity strong {
        color: rgba(255, 255, 255, .9);
        font-size: calc(12px * var(--avm-font-scale));
        font-weight: 600;
        line-height: 1.3;
    }

    .avm-sidebar-identity span {
        color: rgba(255, 255, 255, .38);
        font-family: var(--font-num);
        font-size: calc(10px * var(--avm-font-scale));
        letter-spacing: .3px;
    }

.avm-sidebar-backdrop {
    background: rgba(9, 12, 30, .55);
    display: none;
    inset: 0;
    position: fixed;
    z-index: 40;
}

.avm-shell-workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.avm-topbar {
    align-items: center;
    background: var(--navy-900);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    display: flex;
    flex-shrink: 0;
    gap: var(--sp-2);
    height: var(--topbar-h);
    padding: 0 var(--sp-4);
    position: sticky;
    top: 0;
    z-index: 30;
}

    .avm-topbar::after {
        background: linear-gradient(90deg, transparent, rgba(5, 150, 105, .6), transparent);
        bottom: 0;
        content: "";
        height: 2px;
        left: 0;
        opacity: .5;
        pointer-events: none;
        position: absolute;
        right: 0;
    }

.avm-crumb {
    align-items: center;
    color: rgba(255, 255, 255, .45);
    display: flex;
    font-size: calc(12px * var(--avm-font-scale));
    gap: 5px;
    min-width: 0;
    white-space: nowrap;
}

.avm-crumb-sep {
    opacity: .35;
}

.avm-crumb-page {
    color: #fff;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avm-topbar-search {
    align-items: center;
    background: rgba(58, 82, 160, .12);
    border: 1px solid rgba(58, 82, 160, .28);
    border-radius: var(--r-sm);
    display: flex;
    flex: 1;
    gap: var(--sp-2);
    max-width: 280px;
    padding: 7px var(--sp-3);
    transition: border-color .2s, background .2s, box-shadow .2s;
}

    .avm-topbar-search:focus-within {
        background: rgba(5, 150, 105, .14);
        border-color: var(--green);
        box-shadow: 0 0 0 3px rgba(5, 150, 105, .18);
    }

    .avm-topbar-search svg {
        fill: rgba(255, 255, 255, .45);
        flex-shrink: 0;
        height: 13px;
        width: 13px;
    }

    .avm-topbar-search input {
        background: transparent;
        border: 0;
        color: #fff;
        font-family: inherit;
        font-size: calc(12.5px * var(--avm-font-scale));
        min-width: 0;
        outline: none;
        width: 100%;
    }

        .avm-topbar-search input::placeholder {
            color: rgba(255, 255, 255, .42);
        }

.avm-topbar-right {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: var(--sp-2);
    margin-left: auto;
}

.avm-icon-button {
    align-items: center;
    background: rgba(58, 82, 160, .12);
    border: 1px solid rgba(58, 82, 160, .28);
    border-radius: var(--r-sm);
    color: rgba(255, 255, 255, .55);
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    height: 34px;
    justify-content: center;
    padding: 8px;
    position: relative;
    transition: background .15s, border-color .15s, color .15s;
    width: 34px;
}

    .avm-icon-button:hover {
        background: rgba(5, 150, 105, .16);
        border-color: var(--green);
        color: #fff;
    }

.avm-font-picker {
    align-items: center;
    background: rgba(58, 82, 160, .12);
    border: 1px solid rgba(58, 82, 160, .28);
    border-radius: var(--r-sm);
    display: inline-flex;
    gap: 2px;
    padding: 2px;
}

.avm-font-btn {
    background: transparent;
    border: 0;
    border-radius: var(--r-xs);
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    height: 28px;
    line-height: 1;
    min-width: 28px;
    transition: background .15s, color .15s;
}

    .avm-font-btn:hover,
    .avm-font-btn[aria-pressed="true"] {
        background: var(--green);
        color: #fff;
    }

.avm-balance-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.avm-balance-chip {
    align-items: center;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--r-pill);
    display: inline-flex;
    flex-shrink: 0;
    gap: var(--sp-2);
    height: 34px;
    padding: 0 var(--sp-3);
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
    user-select: none;
    -webkit-user-select: none;
}

    .avm-balance-chip:hover,
    .avm-balance-chip:focus-visible,
    .avm-balance-menu.is-open .avm-balance-chip {
        border-color: rgba(255, 255, 255, .32);
        background: rgba(255, 255, 255, .09);
    }

    .avm-balance-chip:focus-visible {
        outline: 2px solid var(--accent, #3b82f6);
        outline-offset: 2px;
    }

    .avm-balance-chip.is-positive {
        background: rgba(5, 150, 105, .16);
        border-color: rgba(5, 150, 105, .36);
        box-shadow: 0 8px 24px rgba(5, 150, 105, .16);
    }

        .avm-balance-chip.is-positive:hover,
        .avm-balance-menu.is-open .avm-balance-chip.is-positive {
            background: rgba(5, 150, 105, .24);
            border-color: rgba(5, 150, 105, .55);
        }

    .avm-balance-chip.is-negative {
        background: rgba(127, 29, 29, .62);
        border-color: rgba(239, 68, 68, .78);
        box-shadow: 0 10px 28px rgba(127, 29, 29, .32);
    }

        .avm-balance-chip.is-negative:hover,
        .avm-balance-menu.is-open .avm-balance-chip.is-negative {
            background: rgba(127, 29, 29, .75);
            border-color: rgba(239, 68, 68, .95);
        }

.avm-balance-chip-caret {
    width: 12px;
    height: 12px;
    color: rgba(255, 255, 255, .5);
    margin-left: -2px;
    transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), color 180ms ease;
    flex-shrink: 0;
}

.avm-balance-chip:hover .avm-balance-chip-caret,
.avm-balance-menu.is-open .avm-balance-chip-caret,
.avm-balance-menu:hover .avm-balance-chip-caret {
    color: #fff;
}

.avm-balance-menu.is-open .avm-balance-chip-caret {
    transform: rotate(180deg);
}

.avm-balance-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #0f172a;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 14px;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .05);
    padding: 16px;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1), visibility 220ms;
}

.avm-balance-menu:hover .avm-balance-dropdown,
.avm-balance-menu:focus-within .avm-balance-dropdown,
.avm-balance-menu.is-open .avm-balance-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.avm-balance-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    margin-bottom: 12px;
}

.avm-balance-dropdown-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.avm-balance-dropdown-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.avm-balance-dropdown-title {
    color: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.avm-balance-dropdown-stamp {
    color: rgba(255, 255, 255, .45);
    font-size: 11px;
    white-space: nowrap;
}

.avm-balance-card-primary {
    background: rgba(16, 185, 129, .08);
    border: 1px solid rgba(16, 185, 129, .24);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.avm-balance-card-label {
    display: block;
    color: #34d399;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.avm-balance-card-num {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.avm-balance-card-value {
    color: #fff;
    font-family: var(--font-num, inherit);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums lining-nums;
}

.avm-balance-card-curr {
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
    font-weight: 600;
}

.avm-balance-card-sub {
    display: block;
    color: rgba(255, 255, 255, .55);
    font-size: 11px;
    margin-top: 4px;
}

.avm-balance-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.avm-balance-stat {
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .avm-balance-stat.is-alert {
        background: rgba(239, 68, 68, .08);
        border-color: rgba(239, 68, 68, .25);
    }

        .avm-balance-stat.is-alert .avm-balance-stat-label {
            color: #f87171;
        }

.avm-balance-stat-label {
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.avm-balance-stat-val {
    color: #f1f5f9;
    font-family: var(--font-num, inherit);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums lining-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-balance-stat-sub {
    color: rgba(255, 255, 255, .4);
    font-size: 10px;
    line-height: 1.2;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-balance-dropdown-foot {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.avm-balance-dropdown-settle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    background: var(--brand-teal, #0d9488);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background 160ms ease;
}

    .avm-balance-dropdown-settle:hover {
        background: #0f766e;
        color: #fff;
    }

@media (max-width: 620px) {
    .avm-balance-dropdown {
        left: 8px;
        right: 8px;
        position: fixed;
        top: calc(var(--topbar-h) + 8px);
        width: auto;
        max-height: calc(100dvh - var(--topbar-h) - 16px);
        overflow-y: auto;
    }
}

.avm-balance-chip-label {
    color: rgba(255, 255, 255, .5);
    font-size: calc(9px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.avm-balance-chip-value {
    color: #fff;
    font-family: var(--font-num);
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-size: calc(13px * var(--avm-font-scale));
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 500;
}

.avm-balance-chip-code {
    color: rgba(255, 255, 255, .45);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 600;
}

.avm-visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.avm-dots {
    display: inline-flex;
    gap: 3px;
}

    .avm-dots span {
        animation: avm-dot-pulse 1.4s infinite ease-in-out both;
        background: currentColor;
        border-radius: 50%;
        height: 5px;
        opacity: .25;
        width: 5px;
    }

        .avm-dots span:nth-child(1) {
            animation-delay: -.32s;
        }

        .avm-dots span:nth-child(2) {
            animation-delay: -.16s;
        }

@keyframes avm-dot-pulse {
    0%, 80%, 100% {
        opacity: .2;
        transform: scale(.4);
    }

    40% {
        opacity: .8;
        transform: scale(1);
    }
}

.avm-balance-chip.is-loading {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .55);
}

    .avm-balance-chip.is-loading .avm-balance-chip-value,
    .avm-balance-chip.is-loading .avm-balance-chip-code {
        display: none;
    }

.avm-balance-chip.is-unavailable {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .14);
}

    .avm-balance-chip.is-unavailable .avm-balance-chip-value {
        color: rgba(255, 255, 255, .55);
        font-family: var(--font-body);
        font-size: calc(11.5px * var(--avm-font-scale));
    }

.avm-paynow {
    align-items: center;
    background: var(--green);
    border: 0;
    border-radius: var(--r-pill);
    box-shadow: 0 2px 8px rgba(5, 150, 105, .34);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    font-family: inherit;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
    gap: 6px;
    height: 34px;
    letter-spacing: .1px;
    padding: 0 var(--sp-4);
    text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .15s;
}

    .avm-paynow:hover {
        background: var(--green-ink);
        box-shadow: 0 4px 14px rgba(5, 150, 105, .42);
        transform: translateY(-1px);
    }

.avm-signout-form {
    display: flex;
    flex-shrink: 0;
}

.avm-overdue-banner {
    align-items: center;
    background: linear-gradient(90deg, #b91c1c 0%, var(--red) 58%, #ef4444 100%);
    color: #fff;
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: var(--sp-3);
    padding: 10px var(--sp-6);
}

.avm-overdue-banner-icon {
    align-items: center;
    background: rgba(255, 255, 255, .18);
    border-radius: var(--r-sm);
    display: inline-flex;
    flex-shrink: 0;
    height: 28px;
    justify-content: center;
    padding: 6px;
    width: 28px;
}

    .avm-overdue-banner-icon svg {
        fill: currentColor;
        height: 100%;
        width: 100%;
    }

.avm-overdue-banner-text {
    flex: 1;
    font-size: calc(12.5px * var(--avm-font-scale));
    line-height: 1.5;
    min-width: 180px;
}

    .avm-overdue-banner-text strong {
        font-family: var(--font-num);
        font-feature-settings: "tnum" 1, "lnum" 1;
        font-variant-numeric: tabular-nums lining-nums;
        font-weight: 500;
    }

.avm-overdue-banner-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: var(--sp-2);
}

.avm-overdue-settle {
    background: #fff;
    border: 0;
    border-radius: var(--r-pill);
    color: #b91c1c;
    cursor: pointer;
    font-family: inherit;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    height: 28px;
    padding: 0 var(--sp-4);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.avm-overdue-dismiss {
    background: rgba(255, 255, 255, .16);
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: calc(15px * var(--avm-font-scale));
    height: 26px;
    line-height: 1;
    width: 26px;
}

    .avm-overdue-dismiss:hover {
        background: rgba(255, 255, 255, .3);
    }

.avm-content {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px var(--sp-4) var(--sp-4);
}

    .avm-content:focus {
        outline: none;
    }

/* The work-order-entry block sits over the page content only - the menu stays usable - and has
   no close control: it stands until the accounts team lifts it. The page behind shows through a
   frosted veil in the brand blue. */
.avm-content {
    position: relative;
}

.avm-woe-block {
    align-items: center;
    -webkit-backdrop-filter: blur(7px) saturate(1.05);
    backdrop-filter: blur(7px) saturate(1.05);
    background: rgba(44, 62, 122, .42);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: var(--sp-4);
    position: absolute;
    z-index: 60;
}

.avm-woe-card {
    align-items: center;
    animation: avm-woe-rise .32s cubic-bezier(.2, .8, .2, 1);
    background: #fff;
    border: 1px solid rgba(44, 62, 122, .12);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .06);
    display: flex;
    flex-direction: column;
    max-width: 520px;
    padding: 36px 32px 28px;
    text-align: center;
    width: 100%;
}

@keyframes avm-woe-rise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.avm-woe-mark {
    align-items: center;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(254, 226, 226, .55);
    color: var(--red);
    display: inline-flex;
    height: 72px;
    justify-content: center;
    margin-bottom: 18px;
    width: 72px;
}

    .avm-woe-mark svg {
        height: 36px;
        width: 36px;
    }

.avm-woe-eyebrow {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.avm-woe-title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(22px * var(--avm-font-scale));
    font-weight: 800;
    line-height: 1.25;
    margin: 6px 0 10px;
}

.avm-woe-text {
    color: var(--muted);
    font-size: calc(14px * var(--avm-font-scale));
    line-height: 1.6;
    margin: 0 0 20px;
    max-width: 420px;
}

.avm-woe-facts {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    gap: var(--sp-4);
    justify-content: center;
    margin-bottom: 22px;
    padding: 12px 20px;
    width: 100%;
}

.avm-woe-fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .avm-woe-fact span {
        color: var(--muted);
        font-size: calc(11px * var(--avm-font-scale));
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .avm-woe-fact strong {
        color: var(--red);
        font-family: var(--font-num);
        font-size: calc(17px * var(--avm-font-scale));
        font-weight: 700;
    }

.avm-woe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: center;
    width: 100%;
}

.avm-woe-btn {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    display: inline-flex;
    flex: 1 1 180px;
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    padding: 12px 18px;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

    .avm-woe-btn svg {
        height: 18px;
        width: 18px;
    }

    .avm-woe-btn:hover {
        box-shadow: 0 6px 16px rgba(15, 23, 42, .1);
        transform: translateY(-1px);
    }

    .avm-woe-btn.is-primary {
        background: linear-gradient(135deg, var(--brand-mid), var(--brand));
        border-color: transparent;
        box-shadow: 0 8px 20px rgba(44, 62, 122, .28);
        color: #fff;
    }

.avm-woe-back {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    margin-top: 18px;
    text-decoration: none;
}

    .avm-woe-back:hover {
        color: var(--ink);
        text-decoration: underline;
    }

/* Nothing under the block may be worked: the sticky order bar loses its stacking too. */
.avm-content:has(.avm-woe-block) .avm-material-bar {
    position: static;
}

@media (max-width: 640px) {
    .avm-woe-card {
        padding: 28px 20px 22px;
    }
}

.avm-woe-block-card {
    max-width: 560px;
}

.avm-woe-block-body {
    padding: var(--sp-4);
}

.avm-woe-block-message {
    color: var(--ink);
    font-size: calc(15px * var(--avm-font-scale));
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

.avm-woe-block-facts {
    display: grid;
    gap: 4px var(--sp-3);
    grid-template-columns: auto 1fr;
    margin: var(--sp-3) 0 0;
}

    .avm-woe-block-facts dt {
        color: var(--muted);
        font-size: calc(11px * var(--avm-font-scale));
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .avm-woe-block-facts dd {
        color: var(--red);
        font-family: var(--font-num);
        font-weight: 700;
        margin: 0;
    }

.avm-footer {
    align-items: center;
    background: var(--card);
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: grid;
    flex-shrink: 0;
    font-size: calc(10.5px * var(--avm-font-scale));
    gap: var(--sp-2);
    grid-template-columns: 1fr auto 1fr;
    padding: var(--sp-2) var(--sp-6);
}

.avm-footer-left {
    align-items: center;
    display: flex;
    gap: var(--sp-2);
    min-width: 0;
}

.avm-footer-brand {
    align-items: center;
    color: var(--ink-2);
    display: inline-flex;
    font-family: var(--font-display);
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 6px;
}

.avm-footer-dot {
    background: var(--green);
    border-radius: 50%;
    flex-shrink: 0;
    height: 6px;
    width: 6px;
}

.avm-footer-ver {
    background: var(--mint);
    border: 1px solid rgba(5, 150, 105, .22);
    border-radius: var(--r-xs);
    color: var(--green-ink);
    font-family: var(--font-display);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .2px;
    padding: 2px 7px;
    white-space: nowrap;
}

.avm-footer-center {
    text-align: center;
    white-space: nowrap;
}

.avm-footer-right {
    text-align: right;
    white-space: nowrap;
}

.avm-sidebar-collapsed .avm-portal-shell {
    grid-template-columns: var(--sidebar-rail-w) minmax(0, 1fr);
}

.avm-sidebar-collapsed .avm-sidebar-brand {
    justify-content: center;
    padding-left: var(--sp-2);
    padding-right: var(--sp-2);
}

.avm-sidebar-collapsed .avm-sidebar-logo {
    max-width: 46px;
    padding: 3px;
}

.avm-sidebar-collapsed .avm-nav-text,
.avm-sidebar-collapsed .avm-nav-section-label,
.avm-sidebar-collapsed .avm-sidebar-identity,
.avm-sidebar-collapsed .avm-nav-chevron,
.avm-sidebar-collapsed .avm-nav-submenu {
    display: none !important;
}

.avm-sidebar-collapsed .avm-sidebar-profile {
    justify-content: center;
    padding-left: var(--sp-2);
    padding-right: var(--sp-2);
}

.avm-sidebar-collapsed .avm-nav-item {
    justify-content: center;
    padding-left: var(--sp-2);
    padding-right: var(--sp-2);
}

.avm-sidebar-collapsed .avm-sidebar-status {
    justify-content: center;
}

@media (max-width: 1180px) {
    .avm-topbar-search {
        max-width: 190px;
    }
}

@media (max-width: 899px) {
    .avm-portal-shell,
    .avm-sidebar-collapsed .avm-portal-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-sidebar {
        bottom: 0;
        left: 0;
        position: fixed;
        top: 0;
        transform: translateX(-100%);
        transition: transform .26s cubic-bezier(.4, 0, .2, 1);
        width: var(--sidebar-w);
    }

    .avm-sidebar-open .avm-sidebar {
        transform: translateX(0);
    }

    .avm-sidebar-open .avm-sidebar-backdrop {
        display: block;
    }

    .avm-sidebar-collapsed .avm-nav-text,
    .avm-sidebar-collapsed .avm-nav-section-label,
    .avm-sidebar-collapsed .avm-sidebar-identity {
        display: revert;
    }

    .avm-sidebar-collapsed .avm-sidebar-profile {
        justify-content: flex-start;
        padding-left: var(--sp-4);
        padding-right: var(--sp-4);
    }

    .avm-sidebar-collapsed .avm-nav-item,
    .avm-sidebar-collapsed .avm-sidebar-brand {
        justify-content: flex-start;
        padding-left: var(--sp-3);
        padding-right: var(--sp-3);
    }

    .avm-sidebar-collapsed .avm-sidebar-logo {
        max-width: 132px;
        padding: 4px 8px;
    }

    .avm-crumb {
        display: none;
    }
}

@media (max-width: 720px) {
    .avm-topbar-search,
    .avm-footer-center {
        display: none;
    }

    .avm-footer {
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 760px) {
    .avm-topbar-optional {
        display: none;
    }
}

@media (max-width: 620px) {
    .avm-content {
        padding: var(--sp-4) var(--sp-3) 26px;
    }

    .avm-overdue-banner {
        padding: 10px var(--sp-3);
    }

    .avm-balance-chip-label {
        display: none;
    }
}

@media (max-width: 380px) {
    .avm-font-btn {
        min-width: 24px;
        padding: 0 2px;
    }

    .avm-balance-chip {
        padding: 0 10px;
    }

    .avm-balance-chip-code {
        display: none;
    }
}

@media (max-width: 420px) {
    .avm-footer-right {
        display: none;
    }

    .avm-footer {
        grid-template-columns: 1fr;
    }

    .avm-paynow {
        padding: 0 var(--sp-3);
    }
}

.avm-auth-card {
    border-color: rgba(215, 227, 247, .96);
    border-radius: .55rem;
    box-shadow: 0 28px 70px rgba(8, 17, 42, .34), inset 0 0 0 1px rgba(255, 255, 255, .75);
}

    .avm-auth-card::before {
        background: linear-gradient(180deg, rgba(37, 63, 122, .08), rgba(37, 63, 122, 0));
        content: "";
        height: 6rem;
        left: 0;
        pointer-events: none;
        position: absolute;
        right: 0;
        top: 0;
    }

.avm-auth-card-bar {
    background: linear-gradient(90deg, #3141ba, #10207a 55%, #00aeef);
    height: .32rem;
    position: relative;
    z-index: 1;
}

.avm-auth-card .avm-auth-form,
.avm-auth-card-logo,
.avm-auth-card h2,
.avm-auth-card .avm-auth-form-subtitle,
.avm-auth-tagline,
.avm-auth-card-divider,
.avm-auth-card-note,
.avm-auth-security-row {
    position: relative;
    z-index: 1;
}

.avm-input-with-icon {
    border-radius: .45rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82);
}

.avm-auth-submit {
    border-radius: .45rem;
    position: relative;
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

    .avm-auth-submit:hover {
        transform: translateY(-1px);
    }

    .avm-auth-submit.avm-is-loading {
        background: linear-gradient(90deg, #15803d, #16a34a, #22c55e);
        box-shadow: 0 16px 34px rgba(22, 163, 74, .3);
        color: #fff;
    }

.avm-confirm-modal {
    align-items: center;
    background: rgba(7, 17, 36, .62);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 1200;
}

.avm-confirm-card {
    background: #fff;
    border: 1px solid rgba(217, 225, 242, .95);
    border-radius: .5rem;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .34);
    display: grid;
    gap: 1rem;
    max-width: 26rem;
    padding: 1.25rem;
    width: 100%;
}

.avm-confirm-icon {
    align-items: center;
    background: #eef3ff;
    border: 1px solid #d7e3f7;
    border-radius: .5rem;
    color: var(--avm-primary);
    display: inline-flex;
    height: 2.6rem;
    justify-content: center;
    width: 2.6rem;
}

    .avm-confirm-icon svg {
        fill: currentColor;
        height: 1.3rem;
        width: 1.3rem;
    }

.avm-confirm-card h2 {
    color: var(--avm-primary-dark);
    font-size: calc(1.2rem * var(--avm-font-scale));
    margin: 0;
}

.avm-confirm-card p {
    color: var(--avm-muted);
    font-size: calc(.9rem * var(--avm-font-scale));
    line-height: 1.45;
    margin: .25rem 0 0;
}

.avm-confirm-actions {
    display: flex;
    gap: .65rem;
    justify-content: flex-end;
}

@keyframes avm-skeleton {
    0% {
        background-position: 120% 0;
    }

    100% {
        background-position: -120% 0;
    }
}

@keyframes avm-progress-pulse {
    0%, 100% {
        opacity: .62;
        transform: translateX(-8%);
    }

    50% {
        opacity: 1;
        transform: translateX(18%);
    }
}

@media (max-width: 768px) {
    .avm-confirm-actions {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
}

/* The page fills the workspace. A capped, centred column left a wide screen with a band of empty
   space down either side while the header and the banners above it ran the full width. */
.avm-dash {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    width: 100%;
}

.avm-hero {
    align-items: flex-start;
    animation: avm-rise .32s cubic-bezier(.22, 1, .36, 1) both;
    background: radial-gradient(80% 140% at 100% 0%, rgba(5, 150, 105, .3), transparent 60%), linear-gradient(120deg, var(--navy-700) 0%, var(--navy-800) 52%, var(--navy-900) 100%);
    border-radius: var(--r-lg);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    justify-content: space-between;
    padding: 12px var(--sp-5);
}

.avm-hero-main {
    min-width: 0;
}

.avm-hero-eyebrow {
    color: rgba(255, 255, 255, .48);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.avm-hero-title {
    font-family: var(--font-display);
    font-size: calc(19px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: -.3px;
    line-height: 1.3;
    margin: 2px 0 0;
}

.avm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    min-width: 0;
}

.avm-chip {
    align-items: center;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: var(--r-pill);
    color: #fff;
    display: inline-flex;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    gap: 5px;
    padding: 3px 10px;
    white-space: nowrap;
}

.avm-chip-key {
    color: rgba(255, 255, 255, .5);
    font-weight: 500;
}

.avm-chip.is-live {
    background: rgba(5, 150, 105, .18);
    border-color: rgba(5, 150, 105, .36);
}

.avm-chip-dot {
    animation: avm-pulse 2s ease-in-out infinite;
    background: var(--green);
    border-radius: 50%;
    flex-shrink: 0;
    height: 6px;
    width: 6px;
}

@keyframes avm-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .4;
        transform: scale(.7);
    }
}

@keyframes avm-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.avm-hero-side {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.avm-band {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin: 6px 0 -2px;
}

.avm-band-title {
    color: var(--ink-2);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: 1.1px;
    margin: 0;
    text-transform: uppercase;
}

.avm-band-meta {
    color: var(--muted-lt);
    font-size: calc(10.5px * var(--avm-font-scale));
}

.avm-band-action {
    background: none;
    border: 0;
    color: var(--brand-mid);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    margin-left: auto;
    padding: 0;
}

.avm-equation {
    align-items: stretch;
    display: flex;
    gap: 3px;
}

.avm-operator {
    align-items: center;
    color: var(--muted-lt);
    display: flex;
    flex: 0 0 auto;
    font-size: calc(13px * var(--avm-font-scale));
    justify-content: center;
    width: 13px;
}

.avm-position-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

    .avm-position-row .avm-tile {
        flex: 1 1 152px;
        max-width: 340px;
        min-width: 140px;
    }

.avm-tile {
    animation: avm-rise .32s cubic-bezier(.22, 1, .36, 1) both;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    padding: 10px 12px 9px;
    position: relative;
}

    .avm-tile[data-avm-kpi] {
        cursor: pointer;
        transition: border-color .15s, box-shadow .15s, transform .15s;
    }

        .avm-tile[data-avm-kpi]:hover {
            border-color: #c7d4e3;
            box-shadow: var(--shadow-sm);
            transform: translateY(-1px);
        }

.avm-tile-label {
    color: var(--muted);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.avm-tile-value {
    align-items: baseline;
    color: var(--ink);
    display: flex;
    font-family: var(--font-display);
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-size: calc(20px * var(--avm-font-scale));
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 600;
    flex-wrap: wrap;
    gap: 0 4px;
    letter-spacing: -.4px;
    line-height: 1.25;
    margin-top: 2px;
    min-width: 0;
}

    .avm-tile-value.is-zero {
        color: var(--muted-lt);
    }

.avm-tile-amount {
    word-break: break-word;
}

.avm-tile-ccy {
    color: var(--muted-lt);
    font-family: var(--font-body);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .3px;
}

.avm-tile-note {
    color: var(--muted-lt);
    font-size: calc(10px * var(--avm-font-scale));
    line-height: 1.45;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-tile-pill {
    background: var(--red-soft);
    border-radius: var(--r-pill);
    color: var(--red);
    font-size: calc(9px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .2px;
    margin-left: 4px;
    padding: 1px 7px;
    white-space: nowrap;
}

.avm-tile.is-sky {
    background: var(--sky);
    border-color: rgba(29, 78, 216, .16);
}

    .avm-tile.is-sky .avm-tile-value {
        color: var(--sky-ink);
    }

.avm-tile.is-amber {
    background: var(--cream);
    border-color: rgba(217, 119, 6, .18);
}

    .avm-tile.is-amber .avm-tile-value {
        color: var(--cream-ink);
    }

.avm-tile.is-red {
    background: var(--red-soft);
    border-color: rgba(220, 38, 38, .18);
}

    .avm-tile.is-red .avm-tile-value {
        color: var(--red);
    }

.avm-tile.is-teal {
    background: var(--teal);
    border-color: rgba(19, 107, 113, .18);
}

    .avm-tile.is-teal .avm-tile-value {
        color: var(--teal-ink);
    }

.avm-tile.is-lilac {
    background: var(--lilac);
    border-color: rgba(124, 58, 237, .16);
}

    .avm-tile.is-lilac .avm-tile-value {
        color: var(--lilac-ink);
    }

.avm-tile.is-mint {
    background: var(--mint);
    border-color: rgba(5, 150, 105, .2);
}

    .avm-tile.is-mint .avm-tile-value {
        color: var(--green-ink);
    }

.avm-tile.is-refreshed {
    animation: avm-tile-refresh .62s ease both;
}

@keyframes avm-tile-refresh {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 191, 166, .22);
    }

    45% {
        box-shadow: 0 0 0 5px rgba(0, 191, 166, .10);
    }

    100% {
        box-shadow: none;
    }
}

.avm-note {
    align-items: flex-start;
    background: var(--cream);
    border-left: 3px solid var(--amber);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--cream-ink);
    display: flex;
    font-size: calc(10.5px * var(--avm-font-scale));
    gap: 7px;
    line-height: 1.55;
    margin: 0;
    padding: 7px 12px;
}

    .avm-note svg {
        fill: currentColor;
        flex-shrink: 0;
        height: 13px;
        margin-top: 1px;
        width: 13px;
    }

.avm-grid-2 {
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.avm-panel {
    animation: avm-rise .32s cubic-bezier(.22, 1, .36, 1) both;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    padding: 12px var(--sp-4) var(--sp-4);
}

    .avm-panel.is-combo-open {
        position: relative;
        z-index: 70;
    }

.avm-flow-section {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .22s cubic-bezier(.22, 1, .36, 1);
    will-change: opacity, transform;
}

    .avm-flow-section.is-open {
        opacity: 1;
        transform: translateY(0);
    }

    .avm-flow-section.is-leaving {
        pointer-events: none;
    }

.avm-panel-head {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: space-between;
    margin-bottom: 10px;
}

.avm-panel-title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 600;
    margin: 0;
}

.avm-panel-sub {
    color: var(--muted-lt);
    font-size: calc(10.5px * var(--avm-font-scale));
    margin: 2px 0 0;
}

.avm-live-badge {
    align-items: center;
    background: var(--mint);
    border-radius: var(--r-pill);
    color: var(--green-ink);
    display: inline-flex;
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 5px;
    padding: 2px 8px;
}

.avm-empty {
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: var(--sp-5) var(--sp-4);
    text-align: center;
}

    .avm-empty strong {
        color: var(--ink-2);
        font-size: calc(12.5px * var(--avm-font-scale));
        font-weight: 600;
    }

    .avm-empty span {
        font-size: calc(11px * var(--avm-font-scale));
        line-height: 1.55;
        margin: 0 auto;
        max-width: 48ch;
    }

@media (max-width: 1440px) {
    .avm-hero-side {
        align-items: flex-start;
        width: 100%;
    }

    .avm-chip-row {
        justify-content: flex-start;
    }
}

@media (max-width: 1180px) {
    .avm-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Three across keeps the last row balanced instead of leaving one tile alone. */
@media (min-width: 561px) and (max-width: 1100px) {
    .avm-position-row .avm-tile {
        flex-basis: 30%;
        max-width: none;
    }
}

@media (max-width: 980px) {
    .avm-equation {
        display: grid;
        gap: var(--sp-2);
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .avm-operator {
        display: none;
    }
}

@media (max-width: 720px) {
    .avm-equation {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .avm-hero-side {
        align-items: flex-start;
        width: 100%;
    }

    .avm-chip-row {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .avm-hero {
        padding: 12px var(--sp-3);
    }

    .avm-hero-title {
        font-size: calc(17px * var(--avm-font-scale));
    }

    .avm-equation,
    .avm-position-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

        .avm-position-row .avm-tile,
        .avm-equation .avm-tile {
            min-width: 0;
        }

        .avm-position-row[data-avm-collapsed="true"] .avm-tile:nth-child(n + 3) {
            display: none;
        }

        .avm-equation[data-avm-collapsed="true"] .avm-tile:not(.is-sky),
        .avm-equation[data-avm-collapsed="true"] .avm-operator {
            display: none;
        }

    .avm-band-action {
        display: inline-block;
    }

    .avm-tile {
        padding: 9px 11px 8px;
    }
}

@media (min-width: 561px) {
    .avm-band-action {
        display: none;
    }
}

.avm-toggle {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    display: inline-flex;
    gap: 2px;
    padding: 2px;
}

.avm-toggle-btn {
    background: transparent;
    border: 0;
    border-radius: var(--r-xs);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 4px 10px;
    transition: background .15s, color .15s;
}

    .avm-toggle-btn:hover {
        color: var(--ink);
    }

    .avm-toggle-btn.is-active {
        background: var(--navy-800);
        color: #fff;
    }

.avm-panel-action {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink-2);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 5px 11px;
    transition: background .15s, border-color .15s;
}

    .avm-panel-action:hover {
        background: var(--bg);
        border-color: #c7d4e3;
    }

.avm-chart {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .avm-chart svg {
        display: block;
        height: 168px;
        width: 100%;
    }

.avm-chart-area,
.avm-chart-line {
    transition: opacity .2s;
}

.avm-chart-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

    .avm-chart-line.is-turnover {
        stroke: var(--green);
    }

    .avm-chart-line.is-patients {
        stroke: var(--lilac-ink);
        stroke-dasharray: 4 3;
    }

.avm-chart[data-avm-series-state="turnover"] .avm-chart-line.is-patients,
.avm-chart[data-avm-series-state="patients"] .avm-chart-line.is-turnover,
.avm-chart[data-avm-series-state="patients"] .avm-chart-area {
    opacity: 0;
}

.avm-chart-axis {
    color: var(--muted-lt);
    display: flex;
    font-size: calc(9.5px * var(--avm-font-scale));
    justify-content: space-between;
}

.avm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: 8px;
}

.avm-legend-item {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: calc(10.5px * var(--avm-font-scale));
    gap: 6px;
}

.avm-legend-key {
    border-radius: 2px;
    display: inline-block;
    height: 3px;
    width: 14px;
}

    .avm-legend-key.is-turnover {
        background: var(--green);
    }

    .avm-legend-key.is-patients {
        background: var(--lilac-ink);
    }

.avm-counters {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.avm-counter {
    background: var(--bg);
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 6px;
    text-align: center;
}

.avm-counter-label {
    color: var(--muted);
    font-size: calc(9px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.avm-counter-value {
    color: var(--ink);
    font-family: var(--font-display);
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-size: calc(17px * var(--avm-font-scale));
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 600;
    line-height: 1.1;
}

.avm-counter.is-sky {
    background: var(--sky);
}

    .avm-counter.is-sky .avm-counter-value {
        color: var(--sky-ink);
    }

.avm-counter.is-mint {
    background: var(--mint);
}

    .avm-counter.is-mint .avm-counter-value {
        color: var(--green-ink);
    }

.avm-counter.is-amber {
    background: var(--cream);
}

    .avm-counter.is-amber .avm-counter-value {
        color: var(--cream-ink);
    }

.avm-counter.is-red {
    background: var(--red-soft);
}

    .avm-counter.is-red .avm-counter-value {
        color: var(--red);
    }

.avm-rates {
    display: grid;
    gap: var(--sp-2) var(--sp-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.avm-rate {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.avm-rate-top {
    display: flex;
    justify-content: space-between;
}

.avm-rate-label {
    color: var(--muted);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 600;
}

.avm-rate-value {
    color: var(--ink-2);
    font-family: var(--font-display);
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 600;
}

.avm-rate-track {
    background: var(--line-soft);
    border-radius: var(--r-pill);
    display: block;
    height: 5px;
    overflow: hidden;
}

.avm-rate-fill {
    border-radius: var(--r-pill);
    display: block;
    height: 100%;
    transition: width .45s cubic-bezier(.22, 1, .36, 1);
}

    .avm-rate-fill.is-mint {
        background: var(--green);
    }

    .avm-rate-fill.is-amber {
        background: var(--amber);
    }

    .avm-rate-fill.is-red {
        background: var(--red);
    }

    .avm-rate-fill.is-sky {
        background: var(--sky-ink);
    }

.avm-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
}

.avm-tab {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 5px 11px;
    transition: background .15s, color .15s, border-color .15s;
}

    .avm-tab:hover {
        color: var(--ink);
    }

    .avm-tab.is-active {
        background: var(--brand-soft);
        border-color: rgba(58, 82, 160, .2);
        color: var(--brand-mid);
    }

.avm-table-scroll {
    overflow-x: auto;
}

.avm-table {
    border-collapse: collapse;
    min-width: 100%;
    width: 100%;
}

    .avm-table th,
    .avm-table td {
        padding: 7px 10px;
        text-align: left;
        white-space: nowrap;
    }

    .avm-table th {
        border-bottom: 1px solid var(--line);
        color: var(--muted);
        font-size: calc(9.5px * var(--avm-font-scale));
        font-weight: 700;
        letter-spacing: .7px;
        text-transform: uppercase;
    }

    .avm-table td {
        border-bottom: 1px solid var(--line-soft);
        color: var(--ink-2);
        font-size: calc(11.5px * var(--avm-font-scale));
    }

    .avm-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .avm-table tbody tr:hover td {
        background: var(--bg);
    }

    .avm-table .is-right {
        text-align: right;
    }

    .avm-table .is-muted {
        color: var(--muted-lt);
    }

    .avm-table .is-figure {
        font-family: var(--font-display);
        font-feature-settings: "tnum" 1, "lnum" 1;
        font-variant-numeric: tabular-nums lining-nums;
        font-weight: 600;
    }

    .avm-table th.is-current {
        color: var(--brand-mid);
    }

    .avm-table td.is-current {
        background: var(--brand-soft);
        color: var(--brand-mid);
    }

    .avm-table td.is-total {
        color: var(--ink);
    }

.avm-code {
    background: var(--bg-2);
    border-radius: var(--r-xs);
    color: var(--ink-2);
    font-family: var(--font-num);
    font-size: calc(10.5px * var(--avm-font-scale));
    letter-spacing: .3px;
    padding: 2px 6px;
}

.avm-pill {
    border-radius: var(--r-pill);
    display: inline-block;
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .2px;
    padding: 2px 8px;
}

    .avm-pill.is-mint {
        background: var(--mint);
        color: var(--green-ink);
    }

    .avm-pill.is-amber {
        background: var(--cream);
        color: var(--cream-ink);
    }

    .avm-pill.is-red {
        background: var(--red-soft);
        color: var(--red);
    }

    .avm-pill.is-sky {
        background: var(--sky);
        color: var(--sky-ink);
    }

    .avm-pill.is-neutral {
        background: var(--bg-2);
        color: var(--muted);
    }

.avm-tests {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.avm-test-chip {
    background: var(--bg-2);
    border-radius: var(--r-xs);
    color: var(--ink-2);
    font-size: calc(10px * var(--avm-font-scale));
    max-width: 18ch;
    overflow: hidden;
    padding: 2px 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .avm-test-chip.is-extra {
        display: none;
    }

.avm-tests.is-expanded .avm-test-chip.is-extra {
    display: inline-block;
}

.avm-test-more {
    background: var(--brand-soft);
    border: 0;
    border-radius: var(--r-xs);
    color: var(--brand-mid);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 600;
    padding: 2px 7px;
}

@media (max-width: 620px) {
    .avm-counters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .avm-rates {
        grid-template-columns: minmax(0, 1fr);
    }
}

.avm-cases {
    border-top: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
}

.avm-cases-label {
    color: var(--muted);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.avm-cases-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.avm-case {
    border-radius: var(--r-xs);
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
    letter-spacing: .2px;
    padding: 2px 7px;
}

    .avm-case.is-amber {
        background: var(--cream);
        color: var(--cream-ink);
    }

    .avm-case.is-red {
        background: var(--red-soft);
        color: var(--red);
    }

    .avm-case.is-neutral {
        background: var(--bg-2);
        color: var(--muted);
    }

.avm-form-grid {
    display: grid;
    gap: 10px var(--sp-3);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.avm-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

    .avm-field.is-span-2 {
        grid-column: span 2;
    }

    .avm-field.is-span-3 {
        grid-column: span 3;
    }

    .avm-field.is-span-4 {
        grid-column: span 4;
    }

    .avm-field.is-disabled {
        opacity: .55;
    }

.avm-field-label {
    color: var(--ink-2);
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .2px;
}

.avm-field-required {
    color: var(--red);
    margin-left: 2px;
}

.avm-field-control {
    display: flex;
    min-width: 0;
    position: relative;
}

    .avm-field-control.has-affix {
        align-items: stretch;
    }

.avm-mobile-code {
    flex: 0 0 82px;
    max-width: 82px;
}

.avm-patient-search-field {
    position: relative;
}

    .avm-patient-search-field .avm-search-badge {
        display: inline-block;
        margin-left: 6px;
        padding: 1px 6px;
        border-radius: 4px;
        font-size: 9.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        background: #e0f2fe;
        color: #0284c7;
        border: 1px solid #bae6fd;
    }

.avm-patient-search-control {
    position: relative;
    width: 100%;
}

.avm-search-box {
    display: flex;
    align-items: center;
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

    .avm-search-box:focus-within {
        border-color: #0284c7;
        box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    }

.avm-search-icon-affix {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 10px;
    padding-right: 4px;
    color: #64748b;
    flex-shrink: 0;
}

.avm-patient-search-input {
    flex: 1;
    border: none !important;
    background: #ffffff !important;
    box-shadow: none !important;
    color: #0f172a !important;
    padding: 7px 8px;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    min-width: 0;
}

    .avm-patient-search-input::placeholder {
        color: #94a3b8;
        font-weight: 400;
    }

.avm-patient-search-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(2, 132, 199, 0.2);
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: avm-spin 0.6s linear infinite;
    flex-shrink: 0;
    margin-right: 6px;
}

.avm-patient-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    margin: 3px 4px 3px 0;
    background: #0284c7;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease, transform 0.15s ease, filter 0.18s ease;
}

    .avm-patient-search-btn:hover {
        background: #0369a1;
        filter: brightness(1.08);
    }

    .avm-patient-search-btn:active {
        transform: scale(0.97);
    }

.avm-mobile-hint {
    color: #0284c7;
    font-weight: 600;
    font-size: calc(10px * var(--avm-font-scale));
    line-height: 1.45;
    margin: 0;
    white-space: nowrap;
}

.avm-patient-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 1100;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
}

.avm-patient-suggestions-header {
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.avm-patient-empty-note {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    color: #475569;
    font-size: 12px;
}

.avm-patient-empty-sub {
    font-size: 11px;
    color: #94a3b8;
}

.avm-patient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 140ms ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    color: inherit;
}

    .avm-patient-item:hover,
    .avm-patient-item:focus-visible {
        background: #f1f5f9;
        outline: none;
    }

.avm-patient-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.avm-patient-item-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-patient-item-sub {
    font-size: 11px;
    color: #64748b;
}

.avm-patient-item-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0284c7;
    white-space: nowrap;
    margin-left: 8px;
}

.avm-field[data-avm-field="Address"] {
    grid-column: 1 / -1 !important;
    width: 100%;
}

    .avm-field[data-avm-field="Address"] textarea {
        width: 100%;
        min-height: 52px;
        resize: vertical;
    }

.avm-field-affix {
    align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--muted);
    display: inline-flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    padding: 0 9px;
    white-space: nowrap;
}

    .avm-field-affix:first-child {
        border-radius: var(--r-sm) 0 0 var(--r-sm);
        border-right: 0;
    }

    .avm-field-affix:last-child {
        border-left: 0;
        border-radius: 0 var(--r-sm) var(--r-sm) 0;
    }

.avm-field-control.has-affix .avm-input,
.avm-field-control.has-affix .avm-select {
    border-radius: 0;
}

.avm-field-control.has-affix > :first-child.avm-input,
.avm-field-control.has-affix > :first-child.avm-select {
    border-radius: var(--r-sm) 0 0 var(--r-sm);
}

.avm-field-control.has-affix > :last-child.avm-input,
.avm-field-control.has-affix > :last-child.avm-select {
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.avm-input,
.avm-select {
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: var(--r-sm);
    color: var(--ink);
    font-family: inherit;
    font-size: calc(12px * var(--avm-font-scale));
    min-width: 0;
    padding: 8px 10px;
    transition: background .18s ease, border-color .18s ease, box-shadow .22s cubic-bezier(.22, 1, .36, 1);
    width: 100%;
}

    .avm-input::placeholder {
        color: var(--muted-lt);
    }

    .avm-input:hover:not(:disabled),
    .avm-select:hover:not(:disabled) {
        background: var(--field-hover);
        border-color: var(--field-line-strong);
    }

    .avm-input:focus,
    .avm-select:focus {
        background: var(--card);
        border-color: var(--brand-mid);
        box-shadow: 0 0 0 4px rgba(58, 82, 160, .13);
        outline: none;
    }

    .avm-input:disabled,
    .avm-select:disabled {
        background: var(--bg-2);
        cursor: not-allowed;
    }

    .avm-input:read-only {
        background: var(--bg);
    }

.avm-textarea {
    line-height: 1.5;
    min-height: 62px;
    resize: vertical;
}

.avm-select[multiple] {
    min-height: 78px;
    padding: 4px;
}

.avm-field.is-invalid .avm-input,
.avm-field.is-invalid .avm-select,
.avm-filter-field.is-invalid .avm-input,
.avm-filter-field.is-invalid .avm-select {
    background: var(--red-soft);
    border-color: var(--red);
}

    .avm-field.is-invalid .avm-input:focus,
    .avm-field.is-invalid .avm-select:focus,
    .avm-filter-field.is-invalid .avm-input:focus,
    .avm-filter-field.is-invalid .avm-select:focus {
        box-shadow: 0 0 0 3px rgba(220, 38, 38, .16);
    }

.avm-field-hint {
    color: var(--muted-lt);
    font-size: calc(10px * var(--avm-font-scale));
    line-height: 1.45;
    margin: 0;
}

.avm-field-error {
    align-items: flex-start;
    color: var(--red);
    display: flex;
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 500;
    gap: 4px;
    line-height: 1.45;
    margin: 0;
}

.avm-check,
.avm-radio {
    align-items: center;
    color: var(--ink-2);
    cursor: pointer;
    display: inline-flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    gap: 7px;
    min-height: 34px;
}

    .avm-check input,
    .avm-radio input {
        accent-color: var(--brand-mid);
        height: 15px;
        width: 15px;
    }

.avm-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
}

.avm-combo {
    position: relative;
    width: 100%;
}

.avm-combo-input {
    cursor: pointer;
}

.avm-combo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.avm-combo-tag {
    align-items: center;
    background: var(--brand-soft);
    border-radius: var(--r-xs);
    color: var(--brand-mid);
    display: inline-flex;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 600;
    gap: 5px;
    padding: 3px 5px 3px 9px;
}

    .avm-combo-tag button {
        background: none;
        border: 0;
        border-radius: 3px;
        color: inherit;
        cursor: pointer;
        font-size: calc(12px * var(--avm-font-scale));
        line-height: 1;
        padding: 1px 4px;
    }

        .avm-combo-tag button:hover {
            background: rgba(58, 82, 160, .16);
        }

.avm-combo-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-md);
    left: 0;
    max-height: 248px;
    overflow-y: auto;
    padding: 4px;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 60;
}

.avm-combo-option {
    background: none;
    border: 0;
    border-radius: var(--r-xs);
    color: var(--ink-2);
    cursor: pointer;
    display: block;
    font-family: inherit;
    font-size: calc(13.5px * var(--avm-font-scale));
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

    .avm-combo-option:not(.is-disabled):hover,
    .avm-combo-option:not([aria-disabled="true"]):hover,
    .avm-combo-option.is-active {
        background: var(--bg);
        color: var(--ink);
    }

    .avm-combo-option.is-selected {
        background: var(--brand-soft);
        color: var(--brand-mid);
        font-weight: 600;
    }

    .avm-combo-option.is-disabled,
    .avm-combo-option[aria-disabled="true"] {
        cursor: not-allowed;
        opacity: .48;
    }

.avm-combo-empty {
    color: var(--muted-lt);
    font-size: calc(11px * var(--avm-font-scale));
    padding: 10px 9px;
    text-align: center;
}

@media (max-width: 1100px) {
    .avm-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .avm-field.is-span-3,
    .avm-field.is-span-4 {
        grid-column: span 2;
    }
}

@media (max-width: 620px) {
    .avm-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-field.is-span-2,
    .avm-field.is-span-3,
    .avm-field.is-span-4 {
        grid-column: span 1;
    }
}

.avm-field-icon {
    fill: currentColor;
    flex-shrink: 0;
    height: 15px;
    width: 15px;
}

.avm-choice {
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: var(--r-sm);
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    width: 100%;
}

.avm-choice-input {
    height: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 0;
}

.avm-choice-item {
    align-items: center;
    border-radius: var(--r-xs);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    flex: 1;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    gap: 6px;
    justify-content: center;
    padding: 7px 10px;
    transition: background .2s ease, color .2s ease, transform .12s ease, box-shadow .2s ease;
    user-select: none;
}

    .avm-choice-item:hover {
        color: var(--ink-2);
    }

    .avm-choice-item:active {
        transform: scale(.97);
    }

.avm-choice-input:checked + .avm-choice-item {
    background: var(--card);
    box-shadow: 0 1px 3px rgba(15, 32, 56, .12);
    color: var(--brand-mid);
}

.avm-choice-input:focus-visible + .avm-choice-item {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.avm-choice-input:disabled + .avm-choice-item {
    cursor: not-allowed;
    opacity: .45;
}

.avm-switch {
    align-items: center;
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: var(--r-sm);
    cursor: pointer;
    display: flex;
    gap: 9px;
    min-height: 38px;
    padding: 5px 11px;
    transition: background .18s ease, border-color .18s ease;
    user-select: none;
}

    .avm-switch:hover {
        background: var(--field-hover);
        border-color: var(--field-line-strong);
    }

    .avm-switch input {
        height: 0;
        opacity: 0;
        pointer-events: none;
        position: absolute;
        width: 0;
    }

.avm-switch-track {
    background: #cbd8ea;
    border-radius: var(--r-pill);
    flex-shrink: 0;
    height: 18px;
    position: relative;
    transition: background .24s cubic-bezier(.22, 1, .36, 1);
    width: 32px;
}

.avm-switch-knob {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 32, 56, .28);
    height: 14px;
    left: 2px;
    position: absolute;
    top: 2px;
    transition: transform .24s cubic-bezier(.34, 1.56, .64, 1);
    width: 14px;
}

.avm-switch input:checked + .avm-switch-track {
    background: var(--green);
}

    .avm-switch input:checked + .avm-switch-track .avm-switch-knob {
        transform: translateX(14px);
    }

.avm-switch input:focus-visible + .avm-switch-track {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .28);
}

.avm-switch-text {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 500;
    gap: 6px;
    transition: color .18s ease;
}

.avm-switch input:checked ~ .avm-switch-text {
    color: var(--green-ink);
    font-weight: 600;
}

.avm-combo-trigger {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: calc(13.5px * var(--avm-font-scale));
    gap: 8px;
    justify-content: space-between;
    text-align: left;
}

.avm-combo-label {
    flex: 0 1 auto;
    min-width: 0;
}

/* An out lab test is sent to a partner lab and cannot share an order with main lab work,
   so it is marked where it is chosen. */
.avm-combo-tagline {
    background: var(--lilac);
    border: 1px solid #ddd6fe;
    border-radius: var(--r-xs);
    color: var(--lilac-ink);
    flex-shrink: 0;
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 800;
    letter-spacing: .06em;
    padding: 2px 6px;
}

/* The price is what the operator scans the list for, so it is set apart from the name. */
.avm-combo-price {
    color: var(--brand-mid);
    background: transparent;
    border-radius: 0;
    flex-shrink: 0;
    font-family: var(--font-num);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    padding: 0;
    white-space: nowrap;
}

    .avm-combo-price::before {
        content: "- ";
    }

.avm-combo-option.is-selected .avm-combo-price {
    color: var(--brand-mid);
}

.avm-combo-clear {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    color: var(--red);
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 0 10px;
}

    .avm-combo-clear:hover {
        background: var(--red-soft);
        border-color: var(--red);
    }

.avm-combo-tag-clear {
    align-self: flex-start;
    background: transparent;
    border: 0;
    color: var(--red);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    padding: 2px 0;
}

.avm-combo-caret {
    fill: var(--muted-lt);
    flex-shrink: 0;
    height: 14px;
    transition: transform .22s cubic-bezier(.22, 1, .36, 1);
    width: 14px;
}

.avm-combo.is-open .avm-combo-caret {
    transform: rotate(180deg);
}

.avm-combo-search {
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    gap: 6px;
    padding: 6px;
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 1;
}

.avm-combo-panel {
    animation: avm-pop .18s cubic-bezier(.22, 1, .36, 1) both;
    padding: 0 0 4px;
    transform-origin: top center;
}

@keyframes avm-pop {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(.99);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.avm-combo-list {
    padding: 4px;
}

.avm-combo-option {
    align-items: center;
    display: flex;
    gap: 9px;
    transition: background .14s ease;
}

.avm-combo-box {
    align-items: center;
    background: var(--card);
    border: 1.5px solid var(--field-line-strong);
    border-radius: 4px;
    display: inline-flex;
    flex-shrink: 0;
    height: 15px;
    justify-content: center;
    transition: background .16s ease, border-color .16s ease;
    width: 15px;
}

    .avm-combo-box svg {
        fill: #fff;
        height: 11px;
        opacity: 0;
        transform: scale(.6);
        transition: opacity .16s ease, transform .18s cubic-bezier(.34, 1.56, .64, 1);
        width: 11px;
    }

.avm-combo-option.is-selected .avm-combo-box {
    background: var(--brand-mid);
    border-color: var(--brand-mid);
}

    .avm-combo-option.is-selected .avm-combo-box svg {
        opacity: 1;
        transform: none;
    }

.avm-combo-count {
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
}

.avm-combo-tag {
    animation: avm-pop .16s ease both;
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-combo-panel,
    :root:not([data-motion="full"]) .avm-combo-tag {
        animation: none;
    }
}

.avm-combo.is-above .avm-combo-panel {
    bottom: calc(100% + 4px);
    top: auto;
    transform-origin: bottom center;
}

.avm-form-banner {
    border-radius: var(--r-sm);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
    padding: 9px var(--sp-4);
}

    .avm-form-banner.is-error {
        background: var(--red-soft);
        border-left: 3px solid var(--red);
        color: var(--red);
    }

    .avm-form-banner.is-success {
        background: var(--mint);
        border-left: 3px solid var(--green);
        color: var(--green-ink);
    }

.avm-price-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.avm-price-row {
    align-items: center;
    color: var(--ink-2);
    display: flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    justify-content: space-between;
    padding: 6px 0;
}

    .avm-price-row + .avm-price-row {
        border-top: 1px solid var(--line-soft);
    }

    .avm-price-row strong {
        font-family: var(--font-display);
        font-feature-settings: "tnum" 1, "lnum" 1;
        font-variant-numeric: tabular-nums lining-nums;
        font-weight: 600;
    }

    .avm-price-row.is-total {
        border-top: 1px solid var(--line);
        color: var(--ink);
        font-weight: 600;
        padding-top: 9px;
    }

        .avm-price-row.is-total strong {
            font-size: calc(16px * var(--avm-font-scale));
        }

.avm-price-note {
    color: var(--muted-lt);
    font-size: calc(10px * var(--avm-font-scale));
}

.avm-price-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--sp-3);
}

[data-avm-price-panel].is-busy .avm-price-rows {
    opacity: .55;
    transition: opacity .2s;
}

.avm-dob {
    display: grid;
    gap: 6px;
    grid-template-columns: 0.9fr 1.4fr 1fr;
}

.avm-age-chip {
    background: var(--mint);
    border-radius: var(--r-pill);
    color: var(--green-ink);
    font-weight: 600;
    margin-right: 8px;
    padding: 2px 9px;
}

.avm-linkish {
    background: none;
    border: 0;
    color: var(--brand-mid);
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.avm-tat {
    align-items: center;
    background: linear-gradient(120deg, var(--brand-mid), #5b6fc4);
    border-radius: var(--r-pill);
    box-shadow: 0 2px 10px rgba(58, 82, 160, .3);
    color: #fff;
    display: inline-flex;
    font-size: calc(10.5px * var(--avm-font-scale));
    gap: 6px;
    margin-left: auto;
    padding: 4px 12px;
}

    .avm-tat strong {
        font-family: var(--font-display);
        font-weight: 700;
    }

    .avm-tat svg {
        animation: avm-clock-run 1.4s steps(12) infinite;
        transform-origin: center;
    }

@keyframes avm-clock-run {
    to {
        transform: rotate(360deg);
    }
}

.avm-barcodes {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.avm-barcode-row {
    align-items: center;
    animation: avm-rise .26s cubic-bezier(.22, 1, .36, 1) both;
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: var(--r-sm);
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr) minmax(0, 1fr);
    padding: 8px 10px;
}

.avm-barcode-sample {
    color: var(--ink-2);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .3px;
}

.avm-barcode-row .avm-field {
    gap: 0;
}

.avm-barcode-row .avm-input {
    background: var(--card);
    font-family: var(--font-num);
    letter-spacing: .06em;
    text-transform: uppercase;
}

    /* The typed barcode is upper case; the prompt that asks for it is not. */
    .avm-barcode-row .avm-input::placeholder {
        font-family: var(--font-body);
        letter-spacing: normal;
        text-transform: none;
    }

    .avm-barcode-row .avm-input.is-invalid {
        border-color: var(--red);
        box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
    }

.avm-summary {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: minmax(220px, 25%) minmax(0, 1fr);
}

.avm-summary-tests {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avm-summary-chips {
    align-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    position: relative;
}

    .avm-summary-chips.is-busy {
        cursor: progress;
        opacity: .74;
    }

        .avm-summary-chips.is-busy::after {
            animation: avm-chip-row-shine 1.8s ease-in-out infinite;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .82), transparent);
            content: "";
            inset: 0 auto 0 0;
            pointer-events: none;
            position: absolute;
            transform: translateX(-120%) skewX(-18deg);
            width: 34%;
        }

.avm-summary-empty {
    color: var(--muted-lt);
    font-size: calc(11px * var(--avm-font-scale));
}

.avm-summary-price {
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

    .avm-summary-price .avm-price-row strong.is-vat {
        color: var(--cream-ink);
    }

.avm-price-row.is-inactive {
    color: var(--muted-lt);
    opacity: .62;
}

    .avm-price-row.is-inactive strong {
        text-decoration: line-through;
    }

.avm-price-row.is-total.is-flashing {
    animation: avm-total-flash .55s ease;
}

.avm-headroom {
    animation: avm-drop-in .34s cubic-bezier(.16, 1, .3, 1) both;
    background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(5, 150, 105, .08));
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: var(--r-sm);
    margin-bottom: var(--sp-3);
    padding: var(--sp-3);
    transform-origin: top center;
}

    .avm-headroom.is-leaving {
        animation: avm-drop-out .2s ease both;
    }

.avm-headroom-top {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.avm-headroom-title,
.avm-suggested-label {
    color: var(--ink);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.avm-headroom-pill {
    background: rgba(37, 99, 235, .12);
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: var(--r-pill);
    color: var(--brand);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    padding: 4px 8px;
}

.avm-headroom.is-met .avm-headroom-pill {
    background: rgba(5, 150, 105, .12);
    border-color: rgba(5, 150, 105, .2);
    color: var(--green-ink);
}

.avm-headroom-counter {
    color: var(--ink);
    font-family: var(--font-display);
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-size: calc(15px * var(--avm-font-scale));
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 700;
    margin-top: 8px;
}

.avm-headroom-track {
    background: rgba(148, 163, 184, .2);
    border-radius: var(--r-pill);
    height: 11px;
    margin-top: 9px;
    overflow: hidden;
    position: relative;
}

.avm-headroom-fill {
    animation: avm-headroom-flow 4.2s ease-in-out infinite, avm-headroom-pulse 3.2s ease-in-out infinite;
    background: linear-gradient(90deg, #2563eb, #0891b2, #059669, #2563eb);
    background-size: 220% 100%;
    border-radius: inherit;
    display: block;
    height: 100%;
    overflow: hidden;
    position: relative;
    transition: width .45s cubic-bezier(.2, .8, .2, 1);
    width: 0;
}

    /* A sweep alone is easy to miss on a bar this thin, so the whole fill carries moving
   stripes - the eye catches continuous motion far sooner than one pass of light. */
    .avm-headroom-fill::before {
        animation: avm-headroom-stripes 1.6s linear infinite;
        background-image: repeating-linear-gradient( 118deg, rgba(255, 255, 255, .34) 0 9px, rgba(255, 255, 255, 0) 9px 20px);
        background-size: 20px 100%;
        content: "";
        inset: 0;
        position: absolute;
    }

    .avm-headroom-fill::after {
        animation: avm-headroom-shine 2.2s linear infinite;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .92), transparent);
        content: "";
        inset: 0 auto 0 0;
        position: absolute;
        transform: translateX(-130%) skewX(-18deg);
        width: 48%;
    }

.avm-headroom-copy {
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
    line-height: 1.5;
    margin: 8px 0 0;
}

.avm-suggested-tests {
    animation: avm-drop-in .28s cubic-bezier(.16, 1, .3, 1) both;
    border-top: 1px solid rgba(37, 99, 235, .12);
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    transform-origin: top center;
}

    .avm-suggested-tests.is-leaving {
        animation: avm-drop-out .18s ease both;
    }

.avm-suggested-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
    max-height: 79px;
    overflow: hidden;
}

.avm-suggested-chip {
    align-items: center;
    animation: avm-chip-rise .26s cubic-bezier(.16, 1, .3, 1) both;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: var(--r-pill);
    color: var(--brand);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 7px;
    max-width: 100%;
    padding: 6px 9px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

    .avm-suggested-chip span {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .avm-suggested-chip strong {
        color: var(--green-ink);
        font-feature-settings: "tnum" 1, "lnum" 1;
        font-variant-numeric: tabular-nums lining-nums;
    }

    .avm-suggested-chip.is-over-headroom strong {
        color: var(--brand-mid);
    }

    .avm-suggested-chip:hover {
        border-color: rgba(37, 99, 235, .36);
        box-shadow: 0 6px 16px rgba(37, 99, 235, .12);
        transform: translateY(-1px);
    }

    .avm-suggested-chip.is-picking {
        animation: avm-suggestion-pick .22s ease;
        cursor: progress;
        opacity: .88;
    }

.avm-suggestion-loader {
    align-items: center;
    display: inline-flex;
    min-height: 32px;
    justify-content: center;
    width: 100%;
}

    .avm-suggestion-loader .avm-spinner {
        height: 18px;
        width: 18px;
    }

.avm-suggestion-pick-spinner {
    border: 2px solid rgba(37, 99, 235, .22);
    border-radius: 50%;
    border-top-color: var(--brand);
    display: none;
    height: 14px;
    width: 14px;
}

.avm-suggested-chip.is-picking .avm-suggestion-pick-spinner {
    animation: avm-spin .7s linear infinite;
    display: inline-block;
}

.avm-submit-order {
    align-items: center;
    animation: avm-submit-glow 3.6s ease-in-out infinite;
    background: linear-gradient(120deg, var(--green), #0d9e6d);
    border: 0;
    border-radius: var(--r-sm);
    box-shadow: 0 3px 12px rgba(5, 150, 105, .34);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 8px;
    isolation: isolate;
    justify-content: center;
    letter-spacing: .2px;
    margin-top: var(--sp-3);
    padding: 11px;
    overflow: hidden;
    position: relative;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
    width: 100%;
}

    /* The sweep pauses between passes so it reads as a shine crossing the button rather than
   a stripe on a loop, and it is bright enough to catch the eye from the form. */
    .avm-submit-order::before {
        animation: avm-button-shine 3.2s cubic-bezier(.35, 0, .25, 1) infinite;
        background: linear-gradient( 100deg, transparent 0%, rgba(255, 255, 255, .12) 35%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, .12) 65%, transparent 100%);
        content: "";
        inset: -40% auto -40% 0;
        pointer-events: none;
        position: absolute;
        transform: translateX(-140%) skewX(-20deg);
        width: 60%;
        z-index: 0;
    }

    .avm-submit-order > span {
        position: relative;
        z-index: 1;
    }

    .avm-submit-order:hover:not(:disabled) {
        box-shadow: 0 6px 18px rgba(5, 150, 105, .42);
        filter: brightness(1.04);
        transform: translateY(-1px);
    }

    .avm-submit-order:active:not(:disabled) {
        transform: translateY(0);
    }

    .avm-submit-order:disabled {
        cursor: progress;
        opacity: .92;
    }

    .avm-submit-order.is-busy {
        background: linear-gradient(120deg, #167c5b, #0f6f58);
    }

    .avm-submit-order .avm-submit-spinner,
    .avm-dialog-btn .avm-submit-spinner {
        flex: 0 0 auto;
        height: 16px;
        width: 16px;
    }

    .avm-submit-order.is-busy .avm-submit-spinner,
    .avm-dialog-btn.is-busy .avm-submit-spinner {
        display: inline-block;
    }

@keyframes avm-total-flash {
    0% {
        background: rgba(37, 99, 235, .14);
    }

    100% {
        background: transparent;
    }
}

@keyframes avm-headroom-shine {
    0% {
        transform: translateX(-130%) skewX(-18deg);
    }

    100% {
        transform: translateX(320%) skewX(-18deg);
    }
}

@keyframes avm-headroom-stripes {
    to {
        background-position-x: 20px;
    }
}

@keyframes avm-headroom-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }

    50% {
        box-shadow: 0 0 11px 1px rgba(37, 99, 235, .55);
    }
}

@keyframes avm-headroom-flow {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes avm-button-shine {
    0% {
        transform: translateX(-140%) skewX(-20deg);
    }

    68%, 100% {
        transform: translateX(300%) skewX(-20deg);
    }
}

@keyframes avm-submit-glow {
    0%, 100% {
        box-shadow: 0 3px 12px rgba(5, 150, 105, .34);
    }

    50% {
        box-shadow: 0 7px 22px rgba(5, 150, 105, .5);
    }
}

@keyframes avm-suggestion-pick {
    50% {
        transform: scale(.96);
    }
}

@keyframes avm-chip-row-shine {
    100% {
        transform: translateX(320%) skewX(-18deg);
    }
}

@keyframes avm-chip-rise {
    from {
        opacity: 0;
        transform: translateY(7px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes avm-drop-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scaleY(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

@keyframes avm-drop-out {
    from {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }

    to {
        opacity: 0;
        transform: translateY(-6px) scaleY(.97);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-headroom-fill::after,
    :root:not([data-motion="full"]) .avm-headroom-fill::before,
    :root:not([data-motion="full"]) .avm-headroom-fill,
    :root:not([data-motion="full"]) .avm-submit-order::before,
    :root:not([data-motion="full"]) .avm-submit-order,
    :root:not([data-motion="full"]) .avm-headroom,
    :root:not([data-motion="full"]) .avm-suggested-tests,
    :root:not([data-motion="full"]) .avm-suggested-chip,
    :root:not([data-motion="full"]) .avm-summary-chips.is-busy::after,
    :root:not([data-motion="full"]) .avm-price-row.is-total.is-flashing,
    :root:not([data-motion="full"]) .avm-suggested-chip.is-picking {
        animation: none;
    }
    /* Motion is off by request, so the bar and the button hold the lit state the animation
       would have passed through rather than sitting flat. */
    :root:not([data-motion="full"]) .avm-headroom-fill {
        box-shadow: 0 0 10px 1px rgba(37, 99, 235, .45);
    }

    :root:not([data-motion="full"]) .avm-submit-order {
        box-shadow: 0 6px 20px rgba(5, 150, 105, .46);
    }

        :root:not([data-motion="full"]) .avm-submit-order::before {
            opacity: 0;
        }
}

@media (max-width: 900px) {
    .avm-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-barcode-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.avm-age-manual {
    display: grid;
    gap: 8px;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
}

    .avm-age-manual [data-avm-field="Age"] .avm-input {
        width: 100%;
        min-width: 0;
        padding-left: 6px;
        padding-right: 6px;
        text-align: center;
    }

    .avm-age-manual .avm-choice {
        display: flex;
        gap: 2px;
    }

    .avm-age-manual .avm-choice-item {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 3px;
        font-size: calc(11px * var(--avm-font-scale));
        text-align: center;
        justify-content: center;
        white-space: nowrap;
    }

    .avm-age-manual.is-span-2 {
        grid-column: span 2;
        grid-template-columns: 90px minmax(0, 1fr);
    }

@media (max-width: 620px) {
    .avm-age-manual.is-span-2 {
        grid-column: span 1;
        grid-template-columns: 72px minmax(0, 1fr);
    }
}

.avm-order-entry-head {
    align-items: flex-start;
    gap: 10px;
    padding: 10px var(--sp-5);
}

.avm-order-entry-kpis {
    flex: 1 1 760px;
    gap: 7px;
    justify-content: flex-end;
    min-width: min(100%, 760px);
}

    .avm-order-entry-kpis .avm-tile {
        background: rgba(255, 255, 255, .94);
        border-color: rgba(255, 255, 255, .22);
        box-shadow: none;
        flex: 1 1 136px;
        max-width: none;
        min-height: 58px;
        min-width: 126px;
        padding: 7px 9px;
    }

    .avm-order-entry-kpis .avm-tile-label {
        font-size: calc(8.8px * var(--avm-font-scale));
    }

    .avm-order-entry-kpis .avm-tile-value {
        font-size: calc(15.5px * var(--avm-font-scale));
        margin-top: 0;
    }

    .avm-order-entry-kpis .avm-tile-note {
        font-size: calc(8.5px * var(--avm-font-scale));
        margin-top: 1px;
    }

.avm-cal-wrap {
    position: relative;
    width: 100%;
}

.avm-calendar-input {
    padding-right: 34px;
}

.avm-cal-open {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--r-xs);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    height: 26px;
    width: 26px;
    z-index: 2;
}

    .avm-cal-open:hover {
        background: var(--bg-2);
        color: var(--brand-mid);
    }

    .avm-cal-open svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

.avm-cal {
    animation: avm-pop .18s cubic-bezier(.22, 1, .36, 1) both;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    left: 0;
    padding: var(--sp-3);
    position: absolute;
    top: calc(100% + 6px);
    width: 300px;
    z-index: 70;
}

.avm-cal-head {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: space-between;
    margin-bottom: var(--sp-2);
}

.avm-cal-nav {
    background: transparent;
    border: 0;
    border-radius: var(--r-xs);
    color: var(--ink-2);
    cursor: pointer;
    font-size: calc(17px * var(--avm-font-scale));
    height: 28px;
    line-height: 1;
    width: 28px;
}

    .avm-cal-nav:hover {
        background: var(--bg);
    }

.avm-cal-title {
    background: transparent;
    border: 0;
    border-radius: var(--r-xs);
    color: var(--ink);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 4px 10px;
}

    .avm-cal-title:hover {
        background: var(--bg);
    }

.avm-cal-grid {
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(7, 1fr);
}

.avm-cal-weekday {
    color: var(--muted-lt);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 600;
    padding-bottom: 4px;
    text-align: center;
}

.avm-cal-day,
.avm-cal-year {
    background: transparent;
    border: 0;
    border-radius: var(--r-xs);
    color: var(--ink-2);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(11.5px * var(--avm-font-scale));
    height: 32px;
    transition: background .14s ease, color .14s ease, transform .12s ease;
}

    .avm-cal-day:hover:not(:disabled),
    .avm-cal-year:hover:not(:disabled) {
        background: var(--bg-2);
    }

    .avm-cal-day.is-outside {
        color: var(--muted-lt);
    }

    .avm-cal-day.is-picked,
    .avm-cal-year.is-picked {
        background: var(--brand-mid);
        color: #fff;
        font-weight: 600;
    }

    .avm-cal-day:disabled,
    .avm-cal-year:disabled {
        color: #cfd8e5;
        cursor: not-allowed;
    }

    .avm-cal-day:active:not(:disabled) {
        transform: scale(.92);
    }

.avm-cal-years {
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(3, 1fr);
}

.avm-cal-year {
    height: 38px;
}

.avm-dialog-btn {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--ink-2);
    cursor: pointer;
    flex: 1;
    font-family: inherit;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 8px;
}

    .avm-dialog-btn.is-primary {
        background: var(--brand-mid);
        border-color: var(--brand-mid);
        color: #fff;
    }

.avm-help {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--muted-lt);
    cursor: help;
    display: inline-flex;
    height: 16px;
    justify-content: center;
    margin-left: 5px;
    padding: 0;
    position: relative;
    vertical-align: -3px;
    width: 16px;
}

    .avm-help svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

    .avm-help:hover,
    .avm-help:focus-visible {
        color: var(--brand-mid);
    }

.avm-help-pop {
    background: var(--navy-800);
    font-weight: 400;
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-md);
    color: #fff;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 500;
    left: 50%;
    line-height: 1.55;
    opacity: 0;
    padding: 8px 11px;
    pointer-events: none;
    position: absolute;
    text-align: left;
    transform: translate(-50%, -4px);
    transition: opacity .16s ease, transform .16s ease;
    width: 268px;
    z-index: 80;
    bottom: calc(100% + 7px);
}

.avm-help:hover .avm-help-pop,
.avm-help:focus-visible .avm-help-pop {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* VIP and traveller share one column, side by side in the space of one field. */
.avm-switch-pair {
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: 1fr 1fr;
    min-width: 0;
}

    .avm-switch-pair .avm-field {
        min-width: 0;
    }

    .avm-switch-pair .avm-switch-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .avm-switch-pair .avm-switch {
        max-width: 100%;
        padding: 6px 9px;
    }

    .avm-switch-pair .avm-switch-text span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .avm-switch-pair.is-span-1 {
        grid-column: span 1;
    }

/* The address sits beside the collection time, so it starts at that height and grows by hand. */
.avm-field .avm-textarea {
    min-height: 2.4rem;
}

.avm-covered-note {
    grid-column: 1 / -1;
    background: var(--cream);
    border: 1px solid var(--amber);
    border-radius: var(--r-sm);
    color: var(--cream-ink);
    font-size: calc(10.5px * var(--avm-font-scale));
    line-height: 1.5;
    margin: 0;
    padding: 7px 10px;
}

    .avm-covered-note.is-warn {
        background: var(--red-soft);
        border-color: var(--red);
        color: var(--red);
    }

.avm-order-confirm {
    backdrop-filter: blur(2px);
    background: rgba(11, 18, 44, .55);
    opacity: 0;
    transition: opacity .2s ease, backdrop-filter .2s ease;
    z-index: 2000;
}

.avm-order-confirm-card {
    background: var(--card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 52rem);
    max-width: 880px;
    overflow: hidden;
    transform: translateY(-18px) scale(.98);
    transition: transform .24s cubic-bezier(.22, 1, .36, 1);
    width: 100%;
}

.avm-order-confirm.is-open,
.avm-order-confirm.is-closing {
    display: flex;
}

.avm-order-confirm.is-open {
    opacity: 1;
}

    .avm-order-confirm.is-open .avm-order-confirm-card {
        transform: translateY(0) scale(1);
    }

.avm-order-confirm.is-closing {
    opacity: 0;
}

    .avm-order-confirm.is-closing .avm-order-confirm-card {
        transform: translateY(-14px) scale(.985);
    }

.avm-order-confirm-head {
    align-items: center;
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-mid) 55%, #4a63b8 100%);
    display: flex;
    gap: 10px;
    padding: var(--sp-3) var(--sp-4);
}

.avm-order-confirm-mark {
    align-items: center;
    background: rgba(255, 255, 255, .16);
    border-radius: var(--r-sm);
    color: #fff;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

    .avm-order-confirm-mark svg {
        fill: currentColor;
        height: 17px;
        width: 17px;
    }

.avm-order-confirm-title {
    color: #fff;
    flex: 1;
    font-family: var(--font-display);
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 700;
    margin: 0;
}

.avm-order-confirm-close {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, .75);
    cursor: pointer;
    font-size: calc(19px * var(--avm-font-scale));
    line-height: 1;
    padding: 0 4px;
}

    .avm-order-confirm-close:hover {
        color: #fff;
    }

.avm-order-confirm-body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    overflow: auto;
    padding: var(--sp-4);
}

.avm-confirm-banner {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: 1fr 1fr;
}

/* Leads the confirmation body, so it is a tinted card in its own right rather than a line of
   text that the eye slides past on its way to the totals. */
.avm-confirm-consignment {
    background: linear-gradient(135deg, rgba(255, 247, 237, .98), rgba(255, 241, 242, .85));
    border: 1px solid rgba(217, 119, 6, .22);
    border-left: 4px solid var(--amber);
    border-radius: var(--r-sm);
    padding: 10px var(--sp-3);
}

.avm-confirm-total,
.avm-confirm-tat {
    align-items: center;
    border-radius: var(--r-sm);
    display: flex;
    gap: 10px;
    padding: 11px var(--sp-3);
}

.avm-confirm-total {
    background: var(--card);
    border: 1px solid var(--field-line-strong);
    justify-content: space-between;
}

    .avm-confirm-total strong {
        color: var(--brand);
        font-family: var(--font-display);
        font-size: calc(17px * var(--avm-font-scale));
        font-weight: 700;
    }

.avm-confirm-tat {
    background: var(--brand-soft);
    border: 1px solid var(--field-line-strong);
    color: var(--brand);
}

    .avm-confirm-tat .avm-tile-label {
        color: var(--brand-mid);
        display: block;
    }

    .avm-confirm-tat strong {
        font-family: var(--font-display);
        font-size: calc(14px * var(--avm-font-scale));
    }

.avm-confirm-tat-icon svg {
    fill: currentColor;
    height: 22px;
    width: 22px;
}

.avm-confirm-grid {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: 1fr 1fr;
}

.avm-confirm-block {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: var(--sp-3);
}

    .avm-confirm-block.is-wide {
        grid-column: 1 / -1;
    }

.avm-confirm-block-title {
    border-bottom: 1px solid var(--line-soft);
    color: var(--brand-mid);
    font-family: var(--font-display);
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .06em;
    margin: 0;
    padding-bottom: 6px;
    text-transform: uppercase;
}

.avm-order-confirm-list {
    display: grid;
    gap: 4px var(--sp-3);
    grid-template-columns: auto 1fr;
    margin: 0;
}

    .avm-order-confirm-list dt {
        color: var(--muted);
        font-size: calc(11px * var(--avm-font-scale));
    }

    .avm-order-confirm-list dd {
        color: var(--ink);
        font-size: calc(11.5px * var(--avm-font-scale));
        font-weight: 600;
        margin: 0;
        overflow-wrap: anywhere;
        text-align: right;
    }

    .avm-order-confirm-list.is-money dd:last-of-type,
    .avm-order-confirm-list.is-money dt:last-of-type {
        border-top: 1px solid var(--line-soft);
        font-size: calc(14px * var(--avm-font-scale));
        font-weight: 700;
        padding-top: 6px;
    }

.avm-order-confirm-samples {
    display: flex;
    flex-direction: column;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .avm-order-confirm-samples li {
        align-items: center;
        background: var(--bg);
        border-radius: var(--r-xs);
        display: flex;
        font-size: calc(11.5px * var(--avm-font-scale));
        justify-content: space-between;
        padding: 7px 10px;
    }

    .avm-order-confirm-samples li {
        border-left: 3px solid var(--brand-mid);
    }

        .avm-order-confirm-samples li strong {
            background: var(--brand-soft);
            border-radius: var(--r-xs);
            color: var(--brand-mid);
            font-family: var(--font-num);
            letter-spacing: .05em;
            padding: 3px 8px;
        }

.avm-confirm-sample-name {
    align-items: center;
    display: flex;
    font-weight: 600;
    gap: 8px;
}

.avm-confirm-sample-icon {
    align-items: center;
    background: var(--card);
    border-radius: var(--r-xs);
    color: var(--brand-mid);
    display: inline-flex;
    height: 24px;
    justify-content: center;
    width: 24px;
}

    .avm-confirm-sample-icon svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

.avm-order-confirm-samples li.is-missing {
    border-left-color: var(--red);
}

    .avm-order-confirm-samples li.is-missing .avm-confirm-sample-icon {
        color: var(--red);
    }

    .avm-order-confirm-samples li.is-missing strong {
        color: var(--red);
        font-family: inherit;
        font-weight: 500;
        letter-spacing: normal;
    }

.avm-order-confirm-foot {
    background: var(--card);
    border-top: 1px solid var(--line);
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
    padding: var(--sp-3) var(--sp-4);
}

    .avm-order-confirm-foot .avm-dialog-btn {
        flex: 0 0 auto;
        min-width: 150px;
    }

        .avm-order-confirm-foot .avm-dialog-btn.is-primary {
            background: var(--brand-mid);
            border-color: var(--brand-mid);
        }

.avm-dialog-btn.is-busy {
    align-items: center;
    cursor: progress;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
}

.avm-dialog-btn:disabled {
    opacity: .85;
}

@media (max-width: 720px) {
    .avm-confirm-banner,
    .avm-confirm-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-order-confirm-foot .avm-dialog-btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

.avm-help-pop .avm-price-note {
    color: rgba(255, 255, 255, .78);
    display: block;
    margin-top: 4px;
}

.avm-summary-chips .avm-test-chip {
    background: var(--brand-soft);
    border: 1px solid #cdd8f7;
    color: var(--brand-mid);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    max-width: none;
    overflow: visible;
    padding: 5px 10px;
    text-overflow: clip;
    white-space: normal;
}

.avm-barcode-sample {
    align-items: center;
    display: flex;
    gap: 7px;
}

    .avm-barcode-sample svg {
        fill: var(--brand-mid);
        flex-shrink: 0;
        height: 17px;
        width: 17px;
    }

.avm-topbar {
    background: linear-gradient(90deg, #253f7a 0%, #1b316c 56%, #121e49 100%);
    border-bottom-color: rgba(255, 255, 255, .08);
    box-shadow: 0 14px 32px rgba(18, 30, 73, .18);
}

    .avm-topbar::after {
        content: none;
    }

.avm-sidebar {
    background: linear-gradient(180deg, #253f7a 0%, #182d66 48%, #0d193e 100%);
    box-shadow: 18px 0 42px rgba(13, 25, 62, .22);
}

    .avm-sidebar::before {
        content: none;
    }

.avm-topbar-search:focus-within {
    border-color: rgba(0, 174, 239, .68);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, .16);
}

.avm-auth-page-standalone::before {
    background: linear-gradient(180deg, rgba(37, 63, 122, .98) 0%, rgba(18, 30, 73, .98) 100%);
    border-left: 1px solid rgba(255, 255, 255, .12);
}

.avm-auth-page-standalone .avm-auth-card {
    padding-top: clamp(1rem, 2.2vw, 1.45rem);
}

.avm-auth-card-bar {
    background: linear-gradient(90deg, #ed1c24 0%, #253f7a 38%, #00aeef 100%);
    border-radius: 0;
}

.avm-auth-form .avm-input-icon-wrap {
    align-items: center;
    display: flex;
    isolation: isolate;
    min-height: 48px;
    position: relative;
}

.avm-auth-form .avm-input-icon {
    align-items: center;
    color: #8294b4;
    display: inline-flex;
    height: 22px;
    justify-content: center;
    left: 16px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    z-index: 2;
}

    .avm-auth-form .avm-input-icon svg {
        display: block;
        height: 16px;
        width: 16px;
    }

.avm-auth-form .avm-input-with-icon {
    box-sizing: border-box;
    color: #15234f;
    display: block;
    font-size: calc(15px * var(--avm-font-scale));
    height: 48px;
    line-height: normal;
    min-height: 48px;
    padding: 0 18px 0 52px;
    position: relative;
    width: 100%;
    z-index: 1;
}

.avm-auth-form .avm-input-with-action {
    padding-right: 54px;
}

.avm-auth-form .avm-input-with-icon::placeholder {
    color: #7f8eab;
}

.avm-auth-form .avm-input-action {
    align-items: center;
    color: #8190aa;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    z-index: 3;
}

    .avm-auth-form .avm-input-action svg {
        display: block;
        height: 20px;
        width: 20px;
    }

    .avm-auth-form .avm-input-action .avm-eye-hide,
    .avm-auth-form .avm-input-action[aria-pressed="true"] .avm-eye-show {
        display: none;
    }

    .avm-auth-form .avm-input-action[aria-pressed="true"] .avm-eye-hide {
        display: block;
    }

.avm-auth-submit {
    align-items: center;
    background: linear-gradient(90deg, #253f7a 0%, #182b68 56%, #121f58 100%);
    border: 0;
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    min-height: 48px;
    overflow: hidden;
    white-space: nowrap;
}

    .avm-auth-submit:hover {
        background: linear-gradient(90deg, #1f376f 0%, #15245e 100%);
    }

    .avm-auth-submit.avm-is-loading {
        background: linear-gradient(90deg, #167c5b 0%, #0f6f58 100%);
        color: #fff;
    }

    .avm-auth-submit .avm-submit-label {
        display: inline-flex;
        line-height: 1;
        white-space: nowrap;
    }

    .avm-auth-submit .avm-submit-spinner {
        animation: avm-circle-spin .72s linear infinite !important;
        border: 2px solid rgba(255, 255, 255, .45);
        border-radius: 999px;
        border-top-color: #fff;
        display: none;
        flex: 0 0 16px;
        height: 16px;
        width: 16px;
    }

    .avm-auth-submit.avm-is-loading .avm-submit-spinner {
        display: inline-block;
    }

.avm-loader {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    min-width: max-content;
    white-space: nowrap;
}

    .avm-loader .avm-spinner {
        flex: 0 0 16px;
    }

.avm-table-loading-cell {
    height: 74px;
    text-align: center !important;
    vertical-align: middle !important;
}

    .avm-table-loading-cell .avm-loader {
        justify-content: center;
        width: 100%;
    }

.avm-table-empty-cell {
    border-right: 0 !important;
    color: var(--muted);
    height: 82px;
    text-align: center !important;
    vertical-align: middle !important;
}

.avm-nav-item.is-loading {
    color: #fff;
    pointer-events: none;
}

    .avm-nav-item.is-loading::after {
        animation: avm-spin .72s linear infinite;
        border: 2px solid rgba(255, 255, 255, .28);
        border-top-color: #fff;
        border-radius: 50%;
        content: "";
        display: block;
    }

    .avm-nav-item.is-loading::after {
        flex: 0 0 14px;
        height: 14px;
        margin-left: auto;
        width: 14px;
    }

.avm-page-loader {
    align-items: center;
    backdrop-filter: blur(0);
    background: rgba(8, 16, 40, 0);
    display: flex;
    bottom: 34px;
    justify-content: center;
    opacity: 0;
    padding: 24px;
    pointer-events: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--topbar-h);
    transition: opacity .18s ease, background-color .18s ease, backdrop-filter .18s ease;
    z-index: 1400;
}

    .avm-page-loader::before {
        animation: avm-overlay-drift 1.6s ease-in-out infinite;
        background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .16) 45%, transparent 100%);
        content: "";
        height: 100%;
        left: -35%;
        pointer-events: none;
        position: absolute;
        top: 0;
        transform: skewX(-12deg);
        width: 30%;
    }

    .avm-page-loader.is-visible {
        backdrop-filter: blur(3px);
        background: rgba(8, 16, 40, .28);
        opacity: 1;
        pointer-events: auto;
    }

.avm-page-loader-card {
    align-items: center;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(37, 63, 122, .14);
    box-shadow: 0 26px 70px rgba(13, 25, 62, .2);
    display: grid;
    gap: 7px;
    justify-items: center;
    min-width: 250px;
    overflow: hidden;
    padding: 22px 26px 20px;
    position: relative;
    text-align: center;
    transform: translateY(10px) scale(.98);
    transition: transform .2s cubic-bezier(.22, 1, .36, 1);
}

.avm-page-loader.is-visible .avm-page-loader-card {
    transform: translateY(0) scale(1);
}

.avm-page-loader-card::before {
    animation: avm-loader-sweep 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, transparent 0%, #00aeef 26%, #253f7a 54%, transparent 100%);
    content: "";
    height: 3px;
    left: -55%;
    position: absolute;
    right: auto;
    top: 0;
    width: 55%;
}

.avm-page-loader-mark {
    animation: avm-spin .78s linear infinite, avm-loader-pulse 1.2s ease-in-out infinite;
    border: 3px solid rgba(37, 63, 122, .16);
    border-top-color: #253f7a;
    border-radius: 50%;
    display: block;
    height: 30px;
    width: 30px;
}

.avm-page-loader-title {
    color: #15234f;
    font-family: var(--font-display);
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 800;
    line-height: 1.2;
}

.avm-page-loader-text {
    color: #687898;
    font-size: calc(11px * var(--avm-font-scale));
    line-height: 1.4;
}

.avm-page-loader.is-error {
    background: rgba(80, 13, 20, .18);
}

    .avm-page-loader.is-error .avm-page-loader-card {
        border-color: rgba(237, 28, 36, .22);
    }

        .avm-page-loader.is-error .avm-page-loader-card::before {
            animation: none;
            background: #ed1c24;
            left: 0;
            width: 100%;
        }

    .avm-page-loader.is-error .avm-page-loader-mark {
        animation: none;
        border-color: rgba(237, 28, 36, .18);
        border-top-color: #ed1c24;
    }

.avm-shell-busy .avm-page-main {
    pointer-events: none;
}

.avm-shell-busy .avm-content {
    pointer-events: none;
}

@keyframes avm-loader-sweep {
    0% {
        left: -55%;
    }

    55% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes avm-loader-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 63, 122, .18);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(37, 63, 122, .06);
    }
}

@keyframes avm-overlay-drift {
    0% {
        left: -35%;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        left: 105%;
        opacity: 0;
    }
}

.avm-spinner,
.avm-submit-spinner,
.avm-page-loader-mark,
.avm-nav-item.is-loading::after {
    animation-duration: .72s !important;
    animation-iteration-count: infinite !important;
    animation-name: avm-circle-spin !important;
    animation-timing-function: linear !important;
    transform-origin: center center;
    will-change: transform;
}

.avm-page-loader-mark {
    animation: avm-circle-spin .72s linear infinite, avm-loader-pulse 1.2s ease-in-out infinite !important;
}

@keyframes avm-circle-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.avm-confirm-card {
    gap: 1rem;
    max-width: 39rem;
}

.avm-confirm-main {
    align-items: flex-start;
    display: grid;
    gap: 1rem;
    grid-template-columns: 3rem minmax(0, 1fr);
}

.avm-confirm-copy {
    min-width: 0;
    padding-top: .15rem;
}

    .avm-confirm-copy h2 {
        line-height: 1.2;
    }

    .avm-confirm-copy p {
        max-width: 29rem;
    }

@media (max-width: 520px) {
    .avm-confirm-card {
        max-width: calc(100vw - 2rem);
    }

    .avm-confirm-main {
        grid-template-columns: 2.7rem minmax(0, 1fr);
    }
}

.avm-toasts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
    position: fixed;
    right: 16px;
    /* Above every dialog and backdrop, so the outcome of an action taken in one is seen. */
    z-index: 2100;
}

    .avm-toasts.is-top {
        top: 16px;
    }

    .avm-toasts.is-bottom {
        bottom: 16px;
        flex-direction: column-reverse;
    }

.avm-toast {
    align-items: flex-start;
    animation: avm-toast-in .26s cubic-bezier(.22, 1, .36, 1) both;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--muted-lt);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
    color: var(--ink);
    display: flex;
    font-size: calc(12px * var(--avm-font-scale));
    gap: 9px;
    line-height: 1.5;
    padding: 11px 12px;
    pointer-events: auto;
    transition: opacity .25s ease, transform .25s ease;
}

    .avm-toast.is-out {
        opacity: 0;
        transform: translateX(18px);
    }

.avm-toast-icon {
    flex-shrink: 0;
    height: 17px;
    width: 17px;
}

    .avm-toast-icon svg {
        fill: currentColor;
        height: 17px;
        width: 17px;
    }

.avm-toast-text {
    flex: 1;
    min-width: 0;
}

.avm-toast-close {
    background: transparent;
    border: 0;
    color: var(--muted-lt);
    cursor: pointer;
    flex-shrink: 0;
    font-size: calc(16px * var(--avm-font-scale));
    line-height: 1;
    padding: 0 2px;
}

    .avm-toast-close:hover {
        color: var(--ink);
    }

.avm-toast.is-success {
    border-left-color: var(--green);
}

    .avm-toast.is-success .avm-toast-icon {
        color: var(--green);
    }

.avm-toast.is-error {
    border-left-color: var(--red);
}

    .avm-toast.is-error .avm-toast-icon {
        color: var(--red);
    }

.avm-toast.is-warning {
    border-left-color: var(--amber);
}

    .avm-toast.is-warning .avm-toast-icon {
        color: var(--amber);
    }

.avm-toast.is-info {
    border-left-color: var(--brand-mid);
}

    .avm-toast.is-info .avm-toast-icon {
        color: var(--brand-mid);
    }

@keyframes avm-toast-in {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-toast {
        animation: none;
    }
}

.avm-order-view {
    gap: var(--sp-3);
}

.avm-order-kpis .avm-tile,
.avm-material-kpis .avm-tile {
    border: 1px solid var(--line);
    cursor: default;
    display: grid;
    gap: 1px 10px;
    grid-template-areas: "icon label" "icon value" "icon note";
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 78px;
    padding: 12px 14px;
    text-align: left;
}

.avm-order-kpis .avm-kpi-icon,
.avm-material-kpis .avm-kpi-icon {
    align-items: center;
    animation: avmKpiIconFloat 4.5s ease-in-out infinite;
    align-self: center;
    border: 1px solid transparent;
    border-radius: 50%;
    color: currentColor;
    display: inline-flex;
    grid-area: icon;
    height: 36px;
    justify-content: center;
    transition: box-shadow .22s ease, transform .22s ease;
    width: 36px;
}

.avm-order-kpis .avm-tile:hover .avm-kpi-icon,
.avm-material-kpis .avm-tile:hover .avm-kpi-icon {
    box-shadow: 0 10px 22px rgba(37, 99, 235, .14);
    transform: translateY(-1px) scale(1.03);
}

.avm-order-kpis .avm-kpi-icon svg,
.avm-material-kpis .avm-kpi-icon svg {
    fill: currentColor;
    height: 18px;
    width: 18px;
}

.avm-order-kpis .is-sky .avm-kpi-icon,
.avm-material-kpis .is-sky .avm-kpi-icon {
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #2563eb;
}

.avm-order-kpis .is-red .avm-kpi-icon,
.avm-material-kpis .is-red .avm-kpi-icon {
    background: #fee2e2;
    border-color: #fecaca;
    color: #ef4444;
}

.avm-order-kpis .is-amber .avm-kpi-icon,
.avm-material-kpis .is-amber .avm-kpi-icon {
    background: #ffedd5;
    border-color: #fed7aa;
    color: #f97316;
}

.avm-order-kpis .is-mint .avm-kpi-icon,
.avm-material-kpis .is-mint .avm-kpi-icon {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #059669;
}

.avm-order-kpis .is-lilac .avm-kpi-icon,
.avm-material-kpis .is-lilac .avm-kpi-icon {
    background: #ede9fe;
    border-color: #ddd6fe;
    color: #7c3aed;
}

@keyframes avmKpiIconFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-order-kpis .avm-kpi-icon,
    :root:not([data-motion="full"]) .avm-material-kpis .avm-kpi-icon {
        animation: none;
    }
}

.avm-kpi-currency-icon {
    font-family: var(--font-display);
    font-size: calc(18px * var(--avm-font-scale));
    font-weight: 800;
}

.avm-order-kpis .avm-tile-label,
.avm-material-kpis .avm-tile-label {
    color: var(--brand);
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 800;
    grid-area: label;
    letter-spacing: .06em;
}

.avm-order-kpis .avm-tile-value,
.avm-material-kpis .avm-tile-value {
    grid-area: value;
}

.avm-order-kpis .avm-tile-note,
.avm-material-kpis .avm-tile-note {
    grid-area: note;
}

.avm-order-kpis button.avm-tile,
.avm-material-kpis button.avm-tile {
    cursor: pointer;
}

    .avm-order-kpis button.avm-tile:hover,
    .avm-material-kpis button.avm-tile:hover {
        border-color: var(--field-line-strong);
        transform: translateY(-1px);
    }

.avm-order-toolbar {
    padding: var(--sp-3);
}

.avm-order-filters {
    align-items: end;
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: 132px 132px 160px 160px minmax(220px, 1fr) auto;
}

.avm-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.avm-filter-field-sm {
    max-width: 140px;
}

.avm-filter-field-md {
    max-width: 180px;
}

.avm-filter-field-lg {
    min-width: 260px;
}

.avm-filter-field > span {
    color: var(--ink-2);
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
}

/* A hint under a field explains it; it is not a second label. */
.avm-filter-field > .avm-field-hint {
    color: var(--muted-lt);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 400;
    margin-top: -2px;
}

.avm-filter-field.is-full {
    width: 100%;
}

.avm-filter-field textarea.avm-input {
    min-height: 88px;
    resize: vertical;
}

.avm-order-filter-actions {
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
}

.avm-order-table-shell,
.avm-material-table-shell {
    border: 1px solid rgba(185, 202, 229, .9);
    border-radius: 0;
    overflow: hidden;
}

    .avm-order-table-shell .avm-table-scroll {
        max-height: calc(100vh - 330px);
        overflow: auto;
    }

.avm-order-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    width: max-content;
}

    .avm-order-table th,
    .avm-order-table td,
    .avm-detail-table th,
    .avm-detail-table td,
    .avm-material-table th,
    .avm-material-table td,
    .avm-material-history th,
    .avm-material-history td {
        border-bottom: 1px solid rgba(180, 199, 229, .95);
        border-right: 1px solid rgba(180, 199, 229, .95);
        font-size: calc(12px * var(--avm-font-scale));
        padding: 8px 10px;
        vertical-align: middle;
        white-space: nowrap;
    }

        .avm-order-table th:first-child,
        .avm-order-table td:first-child,
        .avm-detail-table th:first-child,
        .avm-detail-table td:first-child,
        .avm-material-table th:first-child,
        .avm-material-table td:first-child,
        .avm-material-history th:first-child,
        .avm-material-history td:first-child {
            border-left: 0;
        }

        .avm-order-table th:last-child,
        .avm-order-table td:last-child,
        .avm-detail-table th:last-child,
        .avm-detail-table td:last-child,
        .avm-material-table th:last-child,
        .avm-material-table td:last-child,
        .avm-material-history th:last-child,
        .avm-material-history td:last-child {
            border-right: 0;
        }

    .avm-order-table thead th,
    .avm-detail-table thead th,
    .avm-material-table thead th,
    .avm-material-history thead th {
        background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
        border-bottom: 1px solid rgba(148, 168, 204, .95);
        color: #102057;
        font-size: calc(11px * var(--avm-font-scale));
        font-weight: 900;
        letter-spacing: .08em;
        position: sticky;
        text-transform: uppercase;
        top: 0;
        z-index: 3;
        text-align: center;
    }

    .avm-order-table tbody tr:hover td,
    .avm-detail-table tbody tr:hover td,
    .avm-material-table tbody tr:hover td,
    .avm-material-history tbody tr:hover td {
        background: #f7fbff;
    }

    .avm-order-table .avm-table-loading-cell,
    .avm-detail-table .avm-table-loading-cell,
    .avm-material-history .avm-table-loading-cell {
        border-right: 0;
        height: 82px;
        padding: 0;
        text-align: center !important;
        vertical-align: top !important;
    }

        .avm-order-table .avm-table-loading-cell .avm-loader,
        .avm-detail-table .avm-table-loading-cell .avm-loader,
        .avm-material-history .avm-table-loading-cell .avm-loader {
            align-items: center;
            display: flex;
            justify-content: center;
            margin: 0 auto;
            min-height: 82px;
            width: 100%;
        }

    .avm-order-table td:nth-child(5),
    .avm-order-table td:nth-child(9) {
        white-space: normal;
    }

    /* Sr.No, order date and patient stay put while the rest of the row scrolls. */
    .avm-order-table .avm-col-date {
        left: var(--avm-sticky-date, 62px);
        min-width: 132px;
        width: 132px;
    }

    .avm-order-table .avm-col-patient {
        left: var(--avm-sticky-patient, 194px);
        min-width: 190px;
        width: 190px;
    }

    .avm-order-table th.avm-col-sr,
    .avm-order-table td.avm-col-sr,
    .avm-order-table th.avm-col-date,
    .avm-order-table td.avm-col-date,
    .avm-order-table th.avm-col-patient,
    .avm-order-table td.avm-col-patient {
        background: #fff;
        position: sticky;
        z-index: 2;
    }

    .avm-order-table th.avm-col-sr,
    .avm-order-table td.avm-col-sr {
        left: 0;
    }

    .avm-order-table td.avm-col-patient {
        box-shadow: 10px 0 18px rgba(20, 45, 82, .05), inset -1px 0 0 rgba(180, 199, 229, .95);
    }

    .avm-order-table thead th.avm-col-sr,
    .avm-order-table thead th.avm-col-date,
    .avm-order-table thead th.avm-col-patient {
        background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
        z-index: 5;
    }

    .avm-order-table thead th.avm-col-patient {
        box-shadow: 10px 0 18px rgba(20, 45, 82, .05), inset -1px 0 0 rgba(148, 168, 204, .95);
    }

    .avm-order-table tbody tr:hover td.avm-col-sr,
    .avm-order-table tbody tr:hover td.avm-col-date,
    .avm-order-table tbody tr:hover td.avm-col-patient {
        background: #f7fbff;
    }

    /* The date reads as an identifier alongside the patient, so it carries the same weight. */
    .avm-order-table td.avm-col-date {
        color: var(--brand);
        font-weight: 700;
    }

/* On a narrow screen the pinned group would fill the viewport, so it releases and only the head stays. */
@media (max-width: 1024px) {
    .avm-order-table td.avm-col-sr,
    .avm-order-table td.avm-col-date,
    .avm-order-table td.avm-col-patient {
        position: static;
    }

    .avm-order-table thead th.avm-col-sr,
    .avm-order-table thead th.avm-col-date,
    .avm-order-table thead th.avm-col-patient {
        left: auto;
    }

    .avm-order-table td.avm-col-patient,
    .avm-order-table thead th.avm-col-patient {
        box-shadow: none;
    }
}

.avm-order-table th:last-child,
.avm-order-table td:last-child {
    background: #f8fbff;
    border-left: 1px solid rgba(180, 199, 229, .95);
    border-right: 1px solid rgba(180, 199, 229, .95);
    box-shadow: -10px 0 18px rgba(20, 45, 82, .05);
    min-width: 64px;
    position: sticky;
    right: 0;
    text-align: center;
    width: 64px;
    z-index: 4;
}

.avm-order-table thead th:last-child {
    background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
    z-index: 6;
}

/* The menu is position:fixed, but it sits inside this sticky cell, and a sticky cell carrying a
   z-index opens its own stacking context - so the menu's z-index is resolved inside the cell and
   the header cell above it still paints over the top. Lifting the cell itself while the menu is
   open is what actually frees it. */
.avm-order-table td:last-child:has(.avm-row-actions.is-menu-open) {
    z-index: 130;
}

.avm-order-actions-col {
    text-align: center !important;
}

.avm-col-sr {
    justify-content: center;
    text-align: center;
    width: 62px;
}

.avm-table .avm-col-sr,
.avm-order-table .avm-col-sr,
.avm-detail-table .avm-col-sr,
.avm-material-table .avm-col-sr,
.avm-material-history .avm-col-sr {
    text-align: center !important;
}

.avm-col-tests {
    min-width: 240px;
}

.avm-col-status {
    width: 130px;
}

.avm-col-time {
    min-width: 150px;
}

.avm-text-link {
    background: transparent;
    border: 0;
    color: var(--brand);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    padding: 0;
    text-align: left;
}

    .avm-text-link:hover {
        color: var(--brand-mid);
    }

    .avm-text-link.avm-truncate-15,
    .avm-text-link.avm-truncate-20,
    .avm-text-link.avm-truncate-30,
    .avm-text-link.avm-truncate-35,
    .avm-text-link.avm-truncate-name {
        display: inline-block;
    }

.avm-status {
    align-items: center;
    border-radius: var(--r-pill);
    display: inline-flex;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 800;
    letter-spacing: .02em;
    padding: 5px 10px;
}

    .avm-status.is-reported {
        background: var(--mint);
        color: var(--green-ink);
    }

    .avm-status.is-pending {
        background: var(--cream);
        color: var(--cream-ink);
    }

    .avm-status.is-cancelled,
    .avm-status.is-attention {
        background: var(--red-soft);
        color: var(--red);
    }

    .avm-status.is-neutral {
        background: var(--bg-2);
        color: var(--ink-2);
    }

.avm-etr,
.avm-row-alert {
    background: var(--brand-soft);
    border-radius: var(--r-pill);
    color: var(--brand);
    display: inline-flex;
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 800;
    margin-left: 6px;
    padding: 4px 7px;
    vertical-align: middle;
}

.avm-row-alert {
    background: var(--red-soft);
    color: var(--red);
}

.avm-money-button {
    background: transparent;
    border: 0;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-family: var(--font-num);
    font-weight: 700;
    padding: 0;
}

    .avm-money-button:hover {
        color: var(--brand);
    }

.avm-order-amount {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

.avm-amount-info-button {
    align-items: center;
    background: #eef4ff;
    border: 1px solid #c8d7ef;
    border-radius: var(--r-pill);
    color: var(--brand);
    cursor: help;
    display: inline-flex;
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 800;
    height: 18px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 18px;
}

    .avm-amount-info-button:hover,
    .avm-amount-info-button:focus-visible {
        background: var(--brand);
        border-color: var(--brand);
        color: #fff;
        outline: none;
    }

.avm-amount-tip {
    background: #fff;
    border: 1px solid #c8d7ef;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(19, 45, 82, .20);
    color: var(--ink);
    max-height: min(360px, calc(100vh - 24px));
    opacity: 0;
    overflow: auto;
    padding: 12px;
    pointer-events: none;
    position: fixed;
    transform: translateY(4px);
    transition: opacity .12s ease, transform .12s ease;
    width: min(320px, calc(100vw - 16px));
    z-index: 220;
}

    .avm-amount-tip.is-open {
        opacity: 1;
        transform: translateY(0);
    }

.avm-amount-tip-title {
    color: var(--brand);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.avm-amount-tip-grid {
    display: grid;
    gap: 7px 14px;
    grid-template-columns: minmax(0, 1fr) auto;
}

    .avm-amount-tip-grid span {
        color: var(--muted);
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .avm-amount-tip-grid strong {
        color: var(--ink);
        font-family: var(--font-num);
        font-weight: 800;
        text-align: right;
        white-space: nowrap;
    }

        .avm-amount-tip-grid span:nth-last-child(2),
        .avm-amount-tip-grid strong:last-child {
            border-top: 1px solid #dbe6f5;
            color: var(--brand);
            padding-top: 8px;
        }

.avm-amount-tip-loading,
.avm-amount-tip-empty {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-muted-text {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
}

.avm-identifier {
    display: block;
    line-height: 1.35;
}

    .avm-identifier span {
        color: var(--muted);
        font-size: calc(10px * var(--avm-font-scale));
        font-weight: 700;
        margin-right: 5px;
        text-transform: uppercase;
    }

    .avm-identifier strong {
        color: var(--ink-2);
        font-family: var(--font-num);
        font-size: calc(11px * var(--avm-font-scale));
        font-weight: 600;
    }

.avm-row-actions {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 32px;
    position: relative;
    width: 100%;
}

.avm-row-action-btn {
    background: #eef4ff;
    border-color: #c8d7ef;
    border-radius: 7px;
    box-sizing: border-box;
    color: #15245e;
    height: 24px;
    min-height: 24px;
    min-width: 24px;
    padding: 0;
    width: 24px;
}

    .avm-row-action-btn svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

.avm-row-actions:hover .avm-row-action-btn,
.avm-row-actions:focus-within .avm-row-action-btn,
.avm-row-actions.is-menu-open .avm-row-action-btn {
    background: #e4edff;
    border-color: #15245e;
    color: #15245e;
}

.avm-row-action-menu {
    background: #f8fbff;
    border: 1px solid #d7e2f2;
    box-shadow: 0 14px 30px rgba(19, 45, 82, .14);
    display: grid;
    min-width: 154px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    transform: translate(8px, -50%) scale(.98);
    transition: opacity .18s ease, transform .18s ease;
    z-index: 120;
}

.avm-row-actions:hover .avm-row-action-menu,
.avm-row-actions:focus-within .avm-row-action-menu,
.avm-row-actions.is-menu-open .avm-row-action-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%) scale(1);
}

.avm-row-action-item {
    align-items: center;
    background: #f8fbff;
    border: 0;
    border-bottom: 1px solid #edf2fa;
    color: #102057;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 800;
    gap: 9px;
    min-height: 38px;
    padding: 0 12px;
    text-align: left;
    white-space: nowrap;
}

    .avm-row-action-item:last-child {
        border-bottom: 0;
    }

    .avm-row-action-item svg {
        fill: #3b5da8;
        height: 15px;
        width: 15px;
    }

    .avm-row-action-item:hover {
        background: #f5f8ff;
        color: #15245e;
    }

    .avm-row-action-item.is-danger {
        color: #b91c1c;
    }

        .avm-row-action-item.is-danger svg {
            fill: #dc2626;
        }

.avm-mini-spinner {
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    height: 14px;
    width: 14px;
}

.avm-row-actions.is-downloading .avm-row-action-btn svg {
    display: none;
}

.avm-row-actions.is-downloading .avm-mini-spinner {
    animation: avmSpin .7s linear infinite;
    display: inline-block;
}

.avm-row-actions.is-downloading .avm-row-action-btn {
    background: #047857;
    border-color: #047857;
    color: #fff;
}

@keyframes avmSpin {
    to {
        transform: rotate(360deg);
    }
}

.avm-order-pagination {
    align-items: center;
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: space-between;
    height: 28px;
    min-height: 28px;
    padding: 2px 7px;
    position: sticky;
    bottom: 0;
    z-index: 4;
}

    .avm-order-pagination .avm-pg-info {
        color: var(--ink-2);
        font-size: calc(10px * var(--avm-font-scale));
        font-weight: 800;
        line-height: 1;
        margin-right: 4px;
    }

    .avm-order-pagination .avm-pagination-select {
        align-self: center;
        box-sizing: border-box;
        font-size: calc(10px * var(--avm-font-scale));
        height: 22px;
        min-height: 22px;
        padding: 1px 4px;
        width: 50px;
    }

.avm-pg-btns {
    align-items: center;
    display: flex;
    gap: 4px;
    margin-left: auto;
    min-height: 22px;
}

.avm-page-button,
.avm-page-ellipsis {
    align-items: center;
    border-radius: var(--r-sm);
    box-sizing: border-box;
    display: inline-flex;
    font-size: calc(10px * var(--avm-font-scale));
    height: 22px;
    justify-content: center;
    line-height: 1;
    min-height: 22px;
    min-width: 22px;
    padding: 0 5px;
}

.avm-page-button {
    background: #eef4ff;
    border: 1px solid #c9d8f2;
    color: #102057;
    cursor: pointer;
    font-weight: 700;
}

    .avm-page-button:hover:not(:disabled) {
        background: #dbeafe;
        border-color: #93c5fd;
    }

    .avm-page-button[aria-current="page"] {
        background: #2563eb;
        border-color: #2563eb;
        color: #fff;
    }

    .avm-page-button:disabled {
        background: #f7f9fc;
        border-color: #e1e8f3;
        color: #a3afc1;
        cursor: not-allowed;
    }

    .avm-page-button.is-arrow svg {
        fill: currentColor;
        height: 11px;
        width: 11px;
    }

.avm-side-panel {
    inset: 0;
    position: fixed;
    z-index: 1200;
}

body:has(.avm-side-panel.is-open) .avm-row-actions.is-menu-open,
body:has(.avm-side-panel.is-open) .avm-row-action-menu {
    display: none !important;
    pointer-events: none !important;
}

.avm-parent-order-banner {
    background: #eef4ff;
    border-left: 4px solid #1a56db;
    padding: 12px 14px;
}
.avm-parent-order-banner .avm-tile-label {
    color: #1a56db;
    margin-bottom: 4px;
}
.avm-parent-order-banner p {
    font-size: calc(12.5px * var(--avm-font-scale));
    color: #1e293b;
    margin: 0;
}

.avm-addrecheck-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
.avm-addrecheck-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.avm-addrecheck-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.avm-addrecheck-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.avm-addrecheck-type {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.avm-addrecheck-type strong {
    font-size: calc(13px * var(--avm-font-scale));
    color: #0f172a;
}
.avm-addrecheck-date {
    font-size: calc(11px * var(--avm-font-scale));
    color: #64748b;
}
.avm-addrecheck-rejection {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 6px 10px;
    color: #991b1b;
    font-size: calc(12px * var(--avm-font-scale));
}
.avm-addrecheck-accepted {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 6px 10px;
    color: #166534;
    font-size: calc(12px * var(--avm-font-scale));
    display: flex;
    gap: 6px;
}

.avm-side-panel-backdrop {
    background: rgba(15, 23, 42, .42);
    inset: 0;
    opacity: 0;
    position: absolute;
    transition: opacity .44s cubic-bezier(.16, 1, .3, 1);
}

.avm-side-panel.is-open .avm-side-panel-backdrop {
    opacity: 1;
}

.avm-side-panel-card {
    background: var(--card);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-left: auto;
    max-width: 980px;
    position: relative;
    transform: translateX(64px);
    transition: transform .44s cubic-bezier(.16, 1, .3, 1);
    width: min(980px, calc(100vw - 48px));
}

.avm-side-panel.is-open .avm-side-panel-card {
    transform: translateX(0);
}

.avm-side-panel-head {
    align-items: center;
    background: linear-gradient(90deg, #102057 0%, #253f7a 100%);
    border-bottom: 1px solid rgba(16, 32, 87, .95);
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: var(--sp-5);
}

    .avm-side-panel-head .avm-panel-sub,
    .avm-side-panel-head .avm-panel-title {
        color: #fff;
    }

    .avm-side-panel-head .avm-icon-button,
    .avm-order-action-head .avm-icon-button {
        background: rgba(255, 255, 255, .12);
        border-color: rgba(255, 255, 255, .2);
        color: #fff;
    }

        .avm-side-panel-head .avm-icon-button:hover,
        .avm-order-action-head .avm-icon-button:hover {
            background: rgba(255, 255, 255, .2);
            color: #fff;
        }

.avm-side-panel-body {
    flex: 1;
    overflow: auto;
    padding: var(--sp-4);
}

    .avm-side-panel-body > .avm-loader {
        display: flex;
        justify-content: center;
        margin: var(--sp-5) auto;
        width: 100%;
    }

.avm-detail-grid {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.avm-detail-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--sp-3);
}

    .avm-detail-card.is-wide {
        grid-column: 1 / -1;
    }

    .avm-detail-card.is-danger {
        background: var(--red-soft);
        border-color: rgba(220, 38, 38, .25);
    }

.avm-detail-list,
.avm-money-breakup {
    display: grid;
    gap: 6px 12px;
    grid-template-columns: minmax(110px, auto) 1fr;
    margin: var(--sp-2) 0 0;
}

.avm-detail-list-compact {
    grid-template-columns: minmax(90px, auto) minmax(0, 1fr) minmax(90px, auto) minmax(0, 1fr);
}

.avm-detail-list dt,
.avm-money-breakup span {
    color: var(--muted);
    font-weight: 700;
}

.avm-detail-list dd,
.avm-money-breakup strong {
    color: var(--ink);
    font-weight: 800;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.avm-detail-card .avm-detail-list-compact {
    grid-template-columns: minmax(80px, .7fr) minmax(0, 1fr);
}

.avm-tests-cell {
    white-space: normal !important;
}

.avm-more-tests {
    background: #e9f2ff;
    border: 1px solid #b9d4ff;
    border-radius: var(--r-pill);
    color: #174ea6;
    cursor: pointer;
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 900;
    line-height: 1;
    margin-left: 4px;
    padding: 4px 7px;
}

    .avm-more-tests:hover,
    .avm-more-tests[aria-expanded="true"] {
        background: #dbeafe;
        border-color: #60a5fa;
    }

/* The rest of the tests, beside the chip. Fixed so nothing in a scrolling table clips it. */
.avm-tests-pop {
    background: var(--card);
    border: 1px solid #b9d4ff;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .18);
    left: 0;
    max-height: 60vh;
    max-width: min(360px, calc(100vw - 16px));
    min-width: 200px;
    overflow: auto;
    padding: 10px 12px;
    position: fixed;
    top: 0;
    z-index: 1200;
}

.avm-tests-pop-title {
    color: #174ea6;
    display: block;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .06em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.avm-tests-pop .avm-tests-list {
    margin: 0;
    padding-left: 18px;
}

    .avm-tests-pop .avm-tests-list li {
        color: var(--ink);
        font-size: calc(12px * var(--avm-font-scale));
        line-height: 1.45;
        padding: 2px 0;
        white-space: normal;
    }

.avm-tests-modal {
    align-items: center;
    background: rgba(15, 23, 42, .48);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: var(--sp-4);
    pointer-events: none;
    position: fixed;
    transition: opacity .28s cubic-bezier(.22, 1, .36, 1);
    z-index: 98;
}

    .avm-tests-modal.is-open {
        opacity: 1;
        pointer-events: auto;
    }

.avm-tests-card {
    background: var(--card);
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    overflow: hidden;
    transform: translateY(-18px) scale(.98);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    width: min(520px, 100%);
}

.avm-tests-modal.is-open .avm-tests-card {
    transform: translateY(0) scale(1);
}

.avm-tests-body {
    max-height: min(420px, calc(100vh - 160px));
    overflow: auto;
    padding: var(--sp-4);
}

.avm-tests-list {
    color: var(--ink);
    display: grid;
    font-weight: 700;
    gap: 8px;
    margin: 0;
    padding-left: 22px;
}

/* The detail panel keeps identity and the whole-order actions pinned at the top, puts anything
   the lab is waiting on directly under them, and splits the rest into tabs - most orders have no
   cancelled test and no history request, so one long scroll changed shape on every open. */
.avm-order-detail-head {
    align-items: flex-start;
    gap: var(--sp-4);
}

.avm-order-detail-ident {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 5px;
    min-width: 0;
}

.avm-order-detail-facts {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: 2px;
}

.avm-order-detail-fact {
    color: rgba(255, 255, 255, .8);
    font-size: calc(11.5px * var(--avm-font-scale));
}

.avm-order-detail-amount {
    color: #fff;
    font-family: var(--font-num);
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-order-detail-facts .avm-status {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .26);
    color: #fff;
}

.avm-order-detail-tools {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: var(--sp-2);
}

.avm-order-detail-close {
    flex: 0 0 auto;
}

.avm-order-detail-tools .avm-btn-ghost {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
    white-space: nowrap;
}

    .avm-order-detail-tools .avm-btn-ghost:hover {
        background: rgba(255, 255, 255, .2);
        color: #fff;
    }

    .avm-order-detail-tools .avm-btn-ghost svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

.avm-order-detail-alert {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 247, 237, .98), rgba(255, 241, 242, .9));
    border-bottom: 1px solid rgba(217, 119, 6, .22);
    border-left: 4px solid var(--amber);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-5);
}

.avm-order-detail-alert-copy {
    display: flex;
    flex-direction: column;
    flex: 1 1 18rem;
    gap: 2px;
    min-width: 0;
}

    .avm-order-detail-alert-copy strong {
        color: var(--ink);
        font-size: calc(12.5px * var(--avm-font-scale));
    }

    .avm-order-detail-alert-copy span {
        color: var(--ink-2);
        font-size: calc(11.5px * var(--avm-font-scale));
        line-height: 1.5;
    }

.avm-order-detail-tabs {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 0 var(--sp-4);
}

.avm-detail-tab {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 600;
    gap: 6px;
    padding: 11px 14px;
    transition: color .18s ease, border-color .18s ease;
    white-space: nowrap;
}

    .avm-detail-tab:hover {
        color: var(--ink);
    }

    .avm-detail-tab.is-active {
        border-bottom-color: var(--brand);
        color: var(--brand);
    }

.avm-detail-tab-count {
    background: var(--bg-2);
    border-radius: var(--r-pill);
    color: var(--ink-2);
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    padding: 1px 6px;
}

    .avm-detail-tab-count.is-alert {
        background: var(--amber);
        color: #fff;
    }

.avm-detail-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

/* Two rows, not two columns: at half the panel width a real patient name wrapped onto a
   second line in every order. */
.avm-detail-pair {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: minmax(0, 1fr);
}

.avm-detail-hint {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
    line-height: 1.45;
    margin: 6px 0 0;
}

/* One card per sample with a named rail, in place of an eight-column table the panel could
   never show without scrolling sideways. */
.avm-sample-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.avm-sample-card-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.avm-sample-card-code {
    color: var(--ink);
    font-family: var(--font-num);
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 700;
}

/* The sample type sits in the card head rather than a chip row, so it borrows the chip look. */
.avm-sample-card-head .avm-test-chip,
.avm-cancelled-ident .avm-test-chip {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--ink-2);
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 2px 9px;
}

.avm-sample-card-status {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
    margin-left: auto;
}

/* The three stages stay on one line at every width - the rail is the shape of the journey, so
   wrapping it into a second row loses the thing it is drawing. */
.avm-sample-rail {
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.avm-sample-step {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    position: relative;
}

.avm-sample-step-track {
    align-items: center;
    display: flex;
    gap: 0;
}

    .avm-sample-step-track::after {
        background: var(--line);
        content: "";
        flex-grow: 1;
        height: 2px;
    }

.avm-sample-step:last-child .avm-sample-step-track::after {
    display: none;
}

.avm-sample-step.is-done:not(.is-current) .avm-sample-step-track::after {
    background: var(--green);
}

.avm-sample-step-mark {
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 50%;
    display: block;
    flex: 0 0 auto;
    height: 12px;
    width: 12px;
}

.avm-sample-step.is-done .avm-sample-step-mark {
    background: var(--green);
    border-color: var(--green);
}

/* Where the sample actually is right now. A sample that has finished every stage is no longer
   moving, so nothing on it pulses. */
.avm-sample-step.is-current .avm-sample-step-mark {
    animation: avm-sample-step-pulse 1.9s ease-in-out infinite;
    background: var(--amber);
    border-color: var(--amber);
}

.avm-sample-step.is-current .avm-sample-step-label {
    color: var(--amber);
}

.avm-sample-card.is-rejected {
    --avm-sample-outcome: var(--red);
}

.avm-sample-card.is-partially-rejected {
    --avm-sample-outcome: var(--amber);
}

.avm-sample-card:is(.is-rejected, .is-partially-rejected) .avm-sample-step .avm-sample-step-track::after,
.avm-sample-card:is(.is-rejected, .is-partially-rejected) .avm-sample-step .avm-sample-step-mark {
    background: var(--avm-sample-outcome);
    border-color: var(--avm-sample-outcome);
}

.avm-sample-card:is(.is-rejected, .is-partially-rejected) .avm-sample-card-status {
    color: var(--avm-sample-outcome);
    font-weight: 600;
}

@keyframes avm-sample-step-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(217, 119, 6, .5);
    }

    55% {
        box-shadow: 0 0 0 7px rgba(217, 119, 6, 0);
    }
}

.avm-sample-step-label {
    color: var(--ink-2);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    line-height: 1.35;
}

.avm-sample-step.is-done .avm-sample-step-label {
    color: var(--ink);
}

.avm-sample-step-time {
    color: var(--muted);
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
    line-height: 1.35;
}

.avm-money-total {
    align-items: baseline;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
}

    .avm-money-total span {
        font-size: calc(12.5px * var(--avm-font-scale));
        font-weight: 700;
    }

    .avm-money-total strong {
        color: var(--brand);
        font-family: var(--font-num);
        font-size: calc(18px * var(--avm-font-scale));
    }

/* Each cancelled test carries its own credit action, so it can only apply to the test on screen. */
.avm-cancelled-card,
.avm-chn-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

    .avm-cancelled-card.is-open {
        border-left: 3px solid var(--amber);
    }

.avm-cancelled-head,
.avm-chn-head {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    justify-content: space-between;
}

.avm-cancelled-ident {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.avm-cancelled-code {
    color: var(--muted);
    font-family: var(--font-num);
    font-size: calc(13.5px * var(--avm-font-scale));
    font-weight: 700;
    text-decoration: line-through;
}

.avm-cancelled-money {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .avm-cancelled-money strong {
        font-family: var(--font-num);
        font-size: calc(16px * var(--avm-font-scale));
    }

.avm-cancelled-state {
    background: rgba(217, 119, 6, .12);
    border-radius: var(--r-pill);
    color: var(--amber);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .05em;
    padding: 2px 8px;
    text-transform: uppercase;
}

    .avm-cancelled-state.is-applied {
        background: rgba(5, 150, 105, .12);
        color: var(--green);
    }

.avm-cancelled-tests,
.avm-chn-test {
    color: var(--ink);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 600;
    margin: 0;
}

.avm-chn-input {
    min-height: 68px;
    resize: vertical;
}

.avm-chn-foot {
    align-items: center;
    display: flex;
    gap: var(--sp-3);
    justify-content: space-between;
}

    .avm-chn-foot .avm-detail-hint {
        margin: 0;
    }

.avm-action-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.avm-action-warning {
    background: var(--red-soft);
    border: 1px solid rgba(220, 38, 38, .22);
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: var(--sp-3);
}

    .avm-action-warning.is-soft {
        background: rgba(217, 119, 6, .1);
        border-color: rgba(217, 119, 6, .22);
    }

    .avm-action-warning strong {
        font-size: calc(12.5px * var(--avm-font-scale));
    }

    .avm-action-warning span {
        color: var(--ink-2);
        font-size: calc(11.5px * var(--avm-font-scale));
        line-height: 1.55;
    }

.avm-action-amount {
    align-items: baseline;
    background: var(--bg-2);
    border-radius: var(--r-sm);
    display: flex;
    gap: var(--sp-3);
    justify-content: space-between;
    padding: var(--sp-3);
}

    .avm-action-amount span {
        color: var(--ink-2);
        font-size: calc(11.5px * var(--avm-font-scale));
    }

    .avm-action-amount strong {
        color: var(--brand);
        font-family: var(--font-num);
        font-size: calc(20px * var(--avm-font-scale));
    }

/* The barcode rules are checked as the reader types rather than refused after the button. */
.avm-free-lead-row.is-match {
    background: rgba(5, 150, 105, .07);
}

.avm-free-lead-row.is-invalid {
    background: var(--red-soft);
}

.avm-free-lead-check {
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
    grid-column: 1 / -1;
}

.avm-free-lead-row.is-match .avm-free-lead-check {
    color: var(--green);
}

.avm-free-lead-row.is-invalid .avm-free-lead-check {
    color: var(--red);
}

/* Narrow: the order actions drop to their own row, but closing the panel stays where a reader
   reaches for it - the top right corner. */
@media (max-width: 720px) {
    .avm-order-detail-head {
        display: grid;
        gap: var(--sp-3);
        grid-template-areas:
            "ident close"
            "tools tools";
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .avm-order-detail-ident {
        grid-area: ident;
    }

    .avm-order-detail-close {
        grid-area: close;
        justify-self: end;
    }

    .avm-order-detail-tools {
        grid-area: tools;
    }

    .avm-free-lead-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.avm-chn-list,
.avm-free-lead-grid {
    display: grid;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
}

.avm-chn-item,
.avm-free-lead-row {
    align-items: center;
    display: grid;
    gap: var(--sp-2);
}

.avm-chn-item {
    grid-template-columns: 120px 1fr minmax(220px, 1fr) auto;
}

.avm-free-lead-row {
    grid-template-columns: 130px 1fr 150px 150px;
}

.avm-inline-actions {
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
    margin-top: var(--sp-3);
}

.avm-order-action-modal {
    align-items: center;
    background: rgba(15, 23, 42, .48);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: var(--sp-5);
    pointer-events: none;
    position: fixed;
    transition: opacity .32s cubic-bezier(.22, 1, .36, 1);
    z-index: 95;
}

    .avm-order-action-modal.is-open {
        opacity: 1;
        pointer-events: auto;
    }

.avm-order-action-card {
    background: var(--card);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    max-width: 720px;
    overflow: hidden;
    transform: translateY(-18px) scale(.98);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1);
    width: min(720px, 100%);
}

.avm-order-action-modal.is-open .avm-order-action-card {
    transform: translateY(0) scale(1);
}

.avm-order-action-head,
.avm-order-action-foot {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: var(--sp-4);
}

.avm-order-action-head {
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
    border-bottom: 1px solid rgba(44, 62, 122, .55);
    color: #fff;
}

    .avm-order-action-head h2 {
        color: #fff;
        font-family: var(--font-display);
        font-size: calc(20px * var(--avm-font-scale));
        margin: 0;
    }

.avm-order-action-body {
    padding: var(--sp-4);
}

.avm-order-action-foot {
    background: var(--bg);
    border-top: 1px solid var(--line);
    gap: var(--sp-2);
    justify-content: flex-end;
}

    .avm-order-action-foot > .avm-btn-ghost {
        flex: 0 0 auto;
        white-space: nowrap;
    }

.avm-btn-sm {
    min-height: 34px;
    padding: 7px 12px;
}

/* Sits beside a filter input rather than carrying a form, so it stays off the eye. */
.avm-btn-xs {
    font-size: calc(11.5px * var(--avm-font-scale));
    min-height: 30px;
    padding: 5px 10px;
}

.avm-btn.is-loading .avm-submit-spinner,
.avm-submit-order.is-loading .avm-submit-spinner {
    display: inline-block;
}

.avm-btn .avm-submit-spinner {
    border-color: rgba(255, 255, 255, .4);
    border-top-color: #fff;
}

/* The three short fields share a row once the search no longer fits beside them. */
@media (max-width: 1180px) {
    .avm-order-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

        /* The caps size the desktop row; once the grid collapses they only leave the rows ragged. */
        .avm-order-filters .avm-filter-field-sm,
        .avm-order-filters .avm-filter-field-md,
        .avm-order-filters .avm-filter-field-lg {
            max-width: none;
            min-width: 0;
        }

        .avm-order-filters .avm-filter-field-lg,
        .avm-order-filter-actions {
            grid-column: 1 / -1;
        }
}

/* From and To stay paired down to the smallest screen; everything else takes the full row. */
@media (max-width: 620px) {
    .avm-order-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .avm-order-filters .avm-filter-field-md {
            grid-column: 1 / -1;
        }

    .avm-order-filter-actions > * {
        flex: 1 1 auto;
        justify-content: center;
        white-space: nowrap;
    }
}

@media (max-width: 760px) {
    .avm-order-kpis {
        display: none;
    }

    .avm-detail-grid,
    .avm-chn-item,
    .avm-free-lead-row {
        grid-template-columns: 1fr;
    }

    .avm-side-panel-card {
        width: 100%;
    }

    .avm-detail-list-compact {
        grid-template-columns: minmax(80px, .7fr) minmax(0, 1fr);
    }
}

/* ---- materials ---- */

.avm-material-table th.is-num,
.avm-material-table td.is-num,
.avm-material-history th.is-num,
.avm-material-history td.is-num {
    text-align: right;
}

/* The stepper sits in the middle of its column rather than hard against the amount. */
.avm-material-table th.avm-col-qty,
.avm-material-table td.avm-col-qty {
    text-align: center;
    width: 128px;
}

    .avm-material-table td.avm-col-qty .avm-stepper {
        justify-content: center;
    }

.avm-material-table td {
    white-space: normal;
}

.avm-material-name {
    color: var(--ink);
    display: block;
    font-weight: 600;
}

.avm-material-number {
    color: var(--muted);
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
}

/* A quantity is nudged up and down far more often than it is typed. */
.avm-stepper {
    align-items: center;
    display: inline-flex;
    gap: 0;
    justify-content: flex-end;
}

.avm-stepper-btn {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--field-line-strong);
    color: var(--brand-mid);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-display);
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 700;
    height: 26px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background .14s ease, color .14s ease, transform .1s ease;
    width: 24px;
}

    .avm-stepper-btn:first-child {
        border-radius: var(--r-xs) 0 0 var(--r-xs);
    }

    .avm-stepper-btn:last-child {
        border-radius: 0 var(--r-xs) var(--r-xs) 0;
    }

    .avm-stepper-btn:hover:not(:disabled) {
        background: var(--brand-mid);
        border-color: var(--brand-mid);
        color: #fff;
    }

    .avm-stepper-btn:active:not(:disabled) {
        transform: scale(.9);
    }

    .avm-stepper-btn:disabled {
        color: var(--muted-lt);
        cursor: not-allowed;
    }

.avm-material-qty {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    font-family: var(--font-num);
    font-weight: 600;
    height: 26px;
    min-height: 0;
    padding: 0 4px;
    text-align: center;
    width: 48px;
}

    .avm-material-qty:focus {
        position: relative;
        z-index: 1;
    }

    .avm-material-qty.is-invalid {
        border-color: var(--red);
        color: var(--red);
    }

.avm-material-table tbody tr.is-chosen td {
    background: var(--brand-soft);
}

.avm-material-table tbody tr.is-chosen .avm-material-name {
    color: var(--brand-mid);
}

.avm-line-amount {
    font-family: var(--font-num);
}

.avm-material-table tbody tr.is-chosen .avm-line-amount {
    color: var(--brand-mid);
    font-weight: 700;
}

.avm-line-gst-rate {
    color: var(--muted);
    display: block;
    font-size: calc(11px * var(--avm-font-scale));
    line-height: 1.2;
}

/* The amount changing is the feedback that the quantity registered. */
.avm-line-amount.is-bumped {
    animation: avm-bump .28s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes avm-bump {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.16);
    }

    100% {
        transform: scale(1);
    }
}

/* The total follows the operator down the list rather than sitting off screen. */
.avm-material-bar {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    bottom: var(--sp-3);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: row;
    gap: var(--sp-4);
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    position: sticky;
    z-index: 20;
}

.avm-material-total {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

    .avm-material-total strong {
        color: var(--ink);
        font-family: var(--font-display);
        font-size: calc(19px * var(--avm-font-scale));
        font-weight: 700;
    }

.avm-material-count {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
}

/* The location's minimum order value sits between the total and the buttons as a meter that
   fills as items are added; it goes green once the order clears it. */
.avm-material-minimum {
    display: flex;
    flex: 1 1 260px;
    flex-direction: column;
    gap: 6px;
    max-width: 420px;
    min-width: 0;
}

.avm-material-minimum-head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: space-between;
}

    .avm-material-minimum-head strong {
        color: var(--amber-ink, #b45309);
        font-family: var(--font-num);
        font-size: calc(12px * var(--avm-font-scale));
    }

.avm-material-minimum.is-met .avm-material-minimum-head strong {
    color: var(--green);
}

.avm-material-minimum.is-met .avm-mcb-fill {
    background: linear-gradient(90deg, #059669, #10b981, #34d399, #059669);
    background-size: 220% 100%;
}

.avm-material-bar .avm-submit-order {
    margin-top: 0;
    min-width: 200px;
    width: auto;
}

.avm-material-actions {
    align-items: center;
    display: flex;
    gap: var(--sp-2);
}

.avm-material-clear {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 9px 14px;
}

    .avm-material-clear:hover:not(:disabled) {
        border-color: var(--red);
        color: var(--red);
    }

    .avm-material-clear:disabled {
        cursor: not-allowed;
        opacity: .45;
    }

.avm-filter-action {
    align-self: end;
}

.avm-empty-panel {
    align-items: center;
    gap: 4px;
    padding: var(--sp-6) var(--sp-4);
    text-align: center;
}

.avm-empty-title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 600;
    margin: 0;
}

.avm-empty-text {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 0;
    max-width: 52ch;
}

.avm-order-number {
    font-family: var(--font-num);
    font-weight: 600;
}

.avm-status-chip {
    border-radius: var(--r-pill);
    display: inline-block;
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 9px;
    text-transform: uppercase;
}

    .avm-status-chip.is-green {
        background: var(--mint);
        color: var(--green-ink);
    }

    .avm-status-chip.is-mint {
        background: var(--mint);
        color: var(--green-ink);
    }

    .avm-status-chip.is-sky {
        background: var(--sky);
        color: var(--sky-ink);
    }

    .avm-status-chip.is-amber {
        background: var(--cream);
        color: var(--cream-ink);
    }

    .avm-status-chip.is-red {
        background: var(--red-soft);
        color: var(--red);
    }

.avm-patient-identity {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.avm-patient-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The last step of a rejected sample is the rejection, not a report. */
.avm-journey-step.is-rejected .avm-journey-dot,
.avm-journey-step.is-done.is-rejected .avm-journey-dot {
    background: var(--red);
    border-color: var(--red);
}

.avm-journey-step.is-rejected .avm-journey-label {
    color: var(--red);
}

/* The courier asks for this on the doorstep, so it reads as a code. */
.avm-otp {
    background: var(--navy-800);
    border-radius: var(--r-xs);
    color: #fff;
    display: inline-block;
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .08em;
    margin-left: 6px;
    padding: 2px 7px;
}

.avm-chip.is-link {
    color: var(--brand-mid);
    text-decoration: none;
}

    .avm-chip.is-link:hover {
        background: var(--brand-soft);
    }

/* Rows arrive in sequence so the list reads as it lands. */
.avm-material-table tbody tr,
.avm-material-history tbody tr {
    animation: avm-row-in .3s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes avm-row-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-material-table tbody tr,
    :root:not([data-motion="full"]) .avm-material-history tbody tr,
    :root:not([data-motion="full"]) .avm-line-amount.is-bumped {
        animation: none;
    }
}

@media (max-width: 720px) {
    .avm-material-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .avm-material-actions {
        flex-direction: column;
    }

    .avm-material-minimum {
        flex: 0 0 auto;
        max-width: none;
    }

    .avm-material-bar .avm-submit-order,
    .avm-material-clear {
        min-width: 0;
        width: 100%;
    }
}

/* ---- make my profile ---- */

.avm-builder {
    gap: var(--sp-3);
}

.avm-builder-name {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    border-top: 3px solid var(--brand);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-4);
}

.avm-builder-step-header {
    align-items: center;
    display: flex;
    gap: 12px;
}

.avm-step-number {
    align-items: center;
    background: var(--brand);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-family: var(--font-display);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.avm-step-title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(15px * var(--avm-font-scale));
    font-weight: 700;
    margin: 0;
}

.avm-step-sub {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 2px 0 0;
}

.avm-builder-name-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    justify-content: space-between;
    margin-top: 4px;
}

.avm-builder-grid.is-collapsed {
    display: none !important;
}

.avm-builder-label {
    color: var(--brand);
    display: block;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 800;
    letter-spacing: .06em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.avm-builder-optional {
    color: var(--muted-lt);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.avm-builder-input-wrap {
    align-items: center;
    display: flex;
    gap: 10px;
}

.avm-builder-input {
    font-family: var(--font-display);
    font-size: calc(18px * var(--avm-font-scale));
    font-weight: 700;
    max-width: 26rem;
    padding: 10px 14px;
}

/* The verdict sits beside the field rather than below, so the name and its answer read together. */
.avm-name-state {
    align-items: center;
    border-radius: var(--r-pill);
    display: inline-flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 6px;
    min-height: 26px;
    opacity: 0;
    padding: 0 12px;
    transform: translateX(-4px);
    transition: opacity .2s ease, transform .2s ease;
}

    .avm-name-state[data-avm-state="short"],
    .avm-name-state[data-avm-state="checking"],
    .avm-name-state[data-avm-state="free"],
    .avm-name-state[data-avm-state="taken"],
    .avm-name-state[data-avm-state="unknown"] {
        opacity: 1;
        transform: translateX(0);
    }

    .avm-name-state[data-avm-state="short"],
    .avm-name-state[data-avm-state="checking"] {
        background: var(--bg-2);
        color: var(--muted);
    }

    .avm-name-state[data-avm-state="free"] {
        background: #dcfce7;
        color: #047857;
    }

    .avm-name-state[data-avm-state="taken"],
    .avm-name-state[data-avm-state="unknown"] {
        background: #fee2e2;
        color: #b91c1c;
    }

.avm-builder-hint {
    color: var(--muted);
    font-size: calc(11.5px * var(--avm-font-scale));
    margin: 8px 0 0;
}

/* What is still missing, read left to right, rather than an error after the fact. */
.avm-builder-steps {
    display: flex;
    gap: var(--sp-3);
    list-style: none;
    margin: 0;
    padding: 0;
}

.avm-builder-step {
    align-items: center;
    color: var(--muted-lt);
    display: flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 7px;
    white-space: nowrap;
}

.avm-builder-step-dot {
    background: var(--field-line-strong);
    border-radius: 50%;
    flex: 0 0 9px;
    height: 9px;
    transition: background .22s ease, box-shadow .22s ease, transform .22s ease;
    width: 9px;
}

.avm-builder-step.is-active {
    color: var(--brand);
}

    .avm-builder-step.is-active .avm-builder-step-dot {
        background: var(--brand-mid);
        box-shadow: 0 0 0 4px rgba(58, 82, 160, .16);
    }

.avm-builder-step.is-done {
    color: #047857;
}

    .avm-builder-step.is-done .avm-builder-step-dot {
        background: #059669;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, .16);
        transform: scale(1.08);
    }

.avm-builder-grid {
    align-items: start;
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: minmax(0, 1fr) 22rem;
}

    .avm-builder-grid.is-collapsed {
        display: none !important;
    }

.avm-builder-catalogue,
.avm-builder-basket {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}

.avm-builder-bar {
    align-items: center;
    background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
    border-bottom: 1px solid rgba(148, 168, 204, .95);
    display: flex;
    justify-content: space-between;
    padding: 6px var(--sp-3);
    gap: var(--sp-2);
}

.avm-builder-tools {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: var(--sp-2);
    justify-content: flex-end;
    min-width: 0;
}

.avm-catalogue-title-wrap {
    align-items: center;
    display: flex;
    gap: 7px;
    min-width: max-content;
}

.avm-builder-heading {
    color: #102057;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 900;
    letter-spacing: .08em;
    margin: 0;
    text-transform: uppercase;
}

.avm-builder-count {
    background: rgba(255, 255, 255, .68);
    border: 1px solid rgba(148, 168, 204, .58);
    border-radius: var(--r-pill);
    color: #102057;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 800;
    line-height: 1;
    padding: 5px 8px;
    white-space: nowrap;
}

.avm-builder-search {
    align-items: center;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(148, 168, 204, .65);
    border-radius: var(--r-sm);
    display: flex;
    flex: 1 1 34rem;
    gap: 8px;
    margin-left: auto;
    max-width: 38rem;
    padding: 2px 9px;
    position: relative;
    transition: background .18s ease, border-color .18s ease, box-shadow .22s cubic-bezier(.22, 1, .36, 1);
}

    .avm-builder-search:hover,
    .avm-builder-search:focus-within {
        background: var(--card);
        border-color: var(--brand-mid);
        box-shadow: 0 5px 14px rgba(20, 45, 82, .1);
    }

.avm-builder-search-icon {
    fill: var(--muted-lt);
    flex: 0 0 16px;
    height: 16px;
    width: 16px;
}

.avm-builder-search-input {
    border: 0;
    background: transparent;
    min-width: 0;
    padding: 1px 0;
}

    .avm-builder-search-input:hover:not(:disabled) {
        background: transparent;
        border-color: transparent;
    }

    .avm-builder-search-input:focus {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

.avm-test-table-head {
    align-items: center;
    background: #f1f5f9;
    border-bottom: 1.5px solid var(--line);
    color: var(--muted);
    display: grid;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 800;
    gap: 12px;
    grid-template-columns: 24px minmax(0, 1fr) 64px 95px 95px 105px;
    letter-spacing: .05em;
    padding: 8px var(--sp-3);
    text-transform: uppercase;
}

.avm-col-cost,
.avm-col-patient,
.avm-col-margin {
    text-align: right;
}

.avm-col-tat {
    text-align: center;
}

.avm-test-list {
    list-style: none;
    margin: 0;
    max-height: 27rem;
    overflow: auto;
    padding: 0;
}

.avm-test-item {
    border-bottom: 1px solid var(--line-soft);
}

.avm-test-pick {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: 24px minmax(0, 1fr) 64px 95px 95px 105px;
    padding: 9px var(--sp-3);
    transition: background .16s ease;
}

    .avm-test-pick:hover {
        background: var(--field-hover);
    }

.avm-test-check {
    height: 0;
    opacity: 0;
    position: absolute;
    width: 0;
}

.avm-test-box {
    align-items: center;
    background: var(--card);
    border: 1.5px solid var(--field-line-strong);
    border-radius: 6px;
    display: inline-flex;
    height: 20px;
    justify-content: center;
    transition: background .16s ease, border-color .16s ease;
    width: 20px;
}

    .avm-test-box svg {
        fill: #fff;
        height: 13px;
        opacity: 0;
        transform: scale(.6);
        transition: opacity .16s ease, transform .16s ease;
        width: 13px;
    }

.avm-test-check:checked + .avm-test-box {
    background: var(--brand-mid);
    border-color: var(--brand-mid);
}

    .avm-test-check:checked + .avm-test-box svg {
        opacity: 1;
        transform: scale(1);
    }

.avm-test-check:focus-visible + .avm-test-box {
    box-shadow: 0 0 0 3px rgba(58, 82, 160, .28);
}

.avm-test-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.avm-test-name {
    color: var(--ink);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-test-meta {
    align-items: center;
    display: flex;
    gap: 6px;
}

.avm-test-code {
    color: var(--muted-lt);
    font-family: var(--font-num);
    font-size: calc(10.5px * var(--avm-font-scale));
}

.avm-test-sample {
    background: var(--bg-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-pill);
    color: var(--muted);
    font-size: calc(9.5px * var(--avm-font-scale));
    padding: 1px 6px;
}

.avm-test-tat {
    color: var(--muted);
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    text-align: center;
}

.avm-test-cost {
    color: var(--ink-2);
    font-family: var(--font-num);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    text-align: right;
}

.avm-test-patient {
    color: #4f46e5;
    font-family: var(--font-num);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    text-align: right;
}

.avm-test-margin {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}

.avm-dash-cell {
    color: var(--muted-lt);
    font-family: var(--font-num);
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 500;
    text-align: right;
}

.avm-margin-amount {
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-margin-badge {
    border-radius: var(--r-pill);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    min-width: 38px;
    padding: 1px 6px;
    line-height: 1.3;
    text-align: center;
}

.avm-test-margin.is-profit .avm-margin-amount {
    color: #059669;
}

.avm-test-margin.is-profit .avm-margin-badge {
    background: #ecfdf5;
    color: #059669;
}

.avm-test-margin.is-thin .avm-margin-amount {
    color: #d97706;
}

.avm-test-margin.is-thin .avm-margin-badge {
    background: #fffbeb;
    color: #b45309;
}

.avm-test-margin.is-loss .avm-margin-amount {
    color: #dc2626;
}

.avm-test-margin.is-loss .avm-margin-badge {
    background: #fef2f2;
    color: #dc2626;
}

.avm-test-item.is-picked .avm-test-pick {
    background: #f0fdf4;
    box-shadow: inset 3px 0 0 #10b981;
}

.avm-test-item.is-picked .avm-test-name {
    color: #047857;
    font-weight: 700;
}

.avm-test-empty {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 0;
    padding: var(--sp-4);
    text-align: center;
}

.avm-builder-basket {
    padding-bottom: var(--sp-3);
    position: sticky;
    top: var(--sp-3);
}

.avm-basket-pill {
    background: var(--brand-mid);
    border-radius: var(--r-pill);
    color: #fff;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 800;
    min-width: 24px;
    padding: 2px 9px;
    text-align: center;
}

.avm-basket-empty {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 0;
    padding: var(--sp-4) var(--sp-3);
    text-align: center;
}

.avm-basket-list {
    list-style: none;
    margin: 0;
    max-height: 16rem;
    overflow: auto;
    padding: 0;
}

.avm-basket-item {
    align-items: center;
    animation: avmBasketIn .2s ease both;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto 22px;
    padding: 8px var(--sp-3);
}

@keyframes avmBasketIn {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.avm-basket-item-name {
    color: var(--ink);
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-basket-item-price {
    color: var(--muted);
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
}

.avm-basket-drop {
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--muted-lt);
    cursor: pointer;
    font-size: calc(16px * var(--avm-font-scale));
    height: 22px;
    line-height: 1;
    transition: background .16s ease, color .16s ease;
    width: 22px;
}

    .avm-basket-drop:hover {
        background: #fee2e2;
        color: #b91c1c;
    }

.avm-basket-breakdown {
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px var(--sp-3);
}

.avm-breakdown-row {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: calc(12px * var(--avm-font-scale));
    justify-content: space-between;
}

    .avm-breakdown-row strong {
        color: var(--ink);
        font-family: var(--font-num);
        font-size: calc(12.5px * var(--avm-font-scale));
        font-weight: 600;
    }

    .avm-breakdown-row.is-list-price {
        align-items: center;
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
    }

.avm-breakdown-label {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.avm-breakdown-value {
    color: var(--brand);
    font-family: var(--font-display);
    font-size: calc(16.5px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-basket-sub-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    padding: 8px 12px;
}

.avm-basket-sub-row {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 500;
    justify-content: space-between;
}

    .avm-basket-sub-row.is-margin {
        border-top: 1px dashed #e2e8f0;
        margin-top: 2px;
        padding-top: 4px;
    }

        .avm-basket-sub-row.is-margin strong {
            color: #047857;
            font-weight: 700;
        }

            .avm-basket-sub-row.is-margin strong.is-loss {
                color: #dc2626;
            }

.avm-profit-label {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    min-width: 0;
}

.avm-profit-pill {
    background: #ecfdf5;
    border-radius: var(--r-pill);
    color: #059669;
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 800;
    line-height: 1.3;
    padding: 2px 7px;
    white-space: nowrap;
}

    .avm-profit-pill.is-thin {
        background: #fffbeb;
        color: #b45309;
    }

    .avm-profit-pill.is-loss {
        background: #fef2f2;
        color: #dc2626;
    }

.avm-profit-bar-wrap {
    background: #e2e8f0;
    border-radius: var(--r-pill);
    height: 7px;
    overflow: hidden;
    width: 100%;
}

.avm-profit-bar {
    background: linear-gradient(90deg, #10b981, #4f46e5);
    border-radius: var(--r-pill);
    display: block;
    height: 100%;
    transition: width .32s cubic-bezier(.22, 1, .36, 1), background .2s ease;
    width: 0;
}

    .avm-profit-bar.is-thin {
        background: linear-gradient(90deg, #f59e0b, #d97706);
    }

    .avm-profit-bar.is-loss {
        background: linear-gradient(90deg, #ef4444, #dc2626);
    }

.avm-basket-total {
    align-items: center;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 10px var(--sp-3);
}

    .avm-basket-total .avm-builder-label {
        margin: 0;
    }

    .avm-basket-total strong {
        color: var(--brand);
        font-family: var(--font-display);
        font-size: calc(15px * var(--avm-font-scale));
        white-space: nowrap;
    }

.avm-builder-basket .avm-builder-label,
.avm-builder-remarks,
.avm-builder-basket .avm-field-error,
.avm-builder-submit,
.avm-builder-clear {
    margin-left: var(--sp-3);
    margin-right: var(--sp-3);
    width: calc(100% - (2 * var(--sp-3)));
}

.avm-builder-basket .avm-builder-label {
    margin-top: var(--sp-3);
}

.avm-builder-remarks {
    resize: vertical;
}

.avm-builder-submit {
    justify-content: center;
    margin-top: var(--sp-3);
}

.avm-builder-clear {
    justify-content: center;
    margin-top: 8px;
}

@media (max-width: 1100px) {
    .avm-builder-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-builder-basket {
        position: static;
    }
}

@media (max-width: 760px) {
    .avm-builder-name {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-builder-steps {
        flex-wrap: wrap;
        gap: var(--sp-2);
    }

    .avm-builder-input {
        max-width: none;
    }

    .avm-builder-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .avm-builder-tools {
        justify-content: stretch;
    }

    .avm-builder-search {
        flex-basis: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-basket-item,
    :root:not([data-motion="full"]) .avm-name-state,
    :root:not([data-motion="full"]) .avm-builder-step-dot,
    :root:not([data-motion="full"]) .avm-test-box,
    :root:not([data-motion="full"]) .avm-test-box svg {
        animation: none;
        transition: none;
    }
}

/* ---- reports ---- */

.avm-reports {
    gap: var(--sp-3);
}

.avm-finder {
    align-items: end;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    display: grid;
    gap: var(--sp-4);
    /* modes | the mode's own inputs | print format | go */
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    padding: var(--sp-4);
}

/* The format applies to the downloads, not to the search, so it keeps its own column instead
   of sitting inside a mode pane where it would disappear when the mode changed. */
.avm-finder-format {
    min-width: 11rem;
}

    .avm-finder-format .avm-finder-note {
        margin: 0;
    }

@media (max-width: 860px) {
    .avm-finder {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Two ways in, side by side, rather than a dropdown that hides one of them. */
.avm-finder-modes {
    background: var(--bg-2);
    border: 1px solid var(--field-line);
    border-radius: var(--r-pill);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
    position: relative;
}

.avm-finder-slider {
    background: var(--card);
    border-radius: var(--r-pill);
    bottom: 4px;
    box-shadow: 0 2px 8px rgba(20, 45, 82, .14);
    left: 4px;
    position: absolute;
    top: 4px;
    transition: transform .26s cubic-bezier(.22, 1, .36, 1);
    width: calc(50% - 4px);
}

.avm-finder-mode {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--r-pill);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
    gap: 7px;
    justify-content: center;
    padding: 8px 16px;
    position: relative;
    transition: color .2s ease;
    white-space: nowrap;
    z-index: 1;
}

    .avm-finder-mode svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

    .avm-finder-mode.is-active {
        color: var(--brand);
    }

.avm-finder-inputs {
    display: grid;
    min-width: 0;
}

/* Both panes share one cell so the panel does not jump height when the mode changes. */
.avm-finder-pane {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    grid-area: 1 / 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
}

    .avm-finder-pane.is-active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

.avm-finder-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

    .avm-finder-field.is-wide {
        flex: 1 1 18rem;
    }

    .avm-finder-field > span {
        color: var(--brand);
        font-size: calc(10.5px * var(--avm-font-scale));
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

.avm-finder-barcode {
    font-family: var(--font-num);
    letter-spacing: .06em;
}

.avm-finder-note {
    color: var(--muted-lt);
    font-size: calc(11px * var(--avm-font-scale));
    margin: 0 0 8px;
}

/* Two segmented switches drive the catalogue, so the pill count comes from the markup. */
.avm-finder-modes {
    grid-template-columns: repeat(var(--avm-mode-count, 2), minmax(0, 1fr));
}

    .avm-finder-modes.is-two {
        --avm-mode-count: 2;
    }

    .avm-finder-modes.is-three {
        --avm-mode-count: 3;
    }

    .avm-finder-modes .avm-finder-slider {
        width: calc((100% - 8px) / var(--avm-mode-count, 2));
    }

.avm-catalog-bar {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    justify-content: space-between;
    padding: var(--sp-4);
}

.avm-catalog-source {
    align-items: center;
    display: flex;
    gap: var(--sp-3);
}

.avm-catalog-labs .avm-finder-mode {
    padding: 8px 16px;
}

.avm-catalog-lab-pick {
    display: block;
    max-width: 14rem;
}

.avm-catalog-shell .avm-table-scroll {
    max-height: calc(100vh - 20rem);
    min-height: 12rem;
    overflow: auto;
}

.avm-catalog-table th,
.avm-catalog-table td {
    padding: 6px 10px;
}

.avm-catalog-code {
    background: var(--brand-soft);
    border-radius: var(--r-sm);
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    padding: 2px 8px;
}

.avm-catalog-name {
    color: var(--ink);
    font-weight: 700;
}

.avm-catalog-fasting {
    color: var(--amber);
    font-weight: 700;
}

.avm-col-mid {
    text-align: center;
}

.avm-col-money {
    font-family: var(--font-num);
    font-weight: 700;
    text-align: right;
}

.avm-catalog-export {
    flex: 0 0 auto;
}

    .avm-catalog-export svg {
        fill: currentColor;
        height: 14px;
        width: 14px;
    }

.avm-breakdown-card {
    max-width: 62rem;
    width: min(62rem, 96vw);
}

.avm-catalog {
    gap: var(--sp-2) !important;
}

.avm-catalog-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-2);
    margin-bottom: 0;
}

.avm-catalog-kpi-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .avm-catalog-kpi-card:hover {
        border-color: var(--brand-mid);
    }

    .avm-catalog-kpi-card.is-highlight {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.08));
        border-color: rgba(16, 185, 129, 0.3);
    }

.avm-catalog-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avm-catalog-kpi-card.is-highlight .avm-catalog-kpi-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.avm-catalog-kpi-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.avm-catalog-kpi-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.avm-catalog-kpi-label {
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avm-catalog-kpi-val-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.avm-catalog-kpi-value {
    font-size: calc(20px * var(--avm-font-scale));
    font-weight: 900;
    color: var(--ink);
    font-variant-numeric: tabular-nums lining-nums;
    line-height: 1.2;
}

.avm-catalog-kpi-card.is-highlight .avm-catalog-kpi-value {
    color: #047857;
}

.avm-catalog-kpi-sub {
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    color: var(--muted);
}

.avm-mode-badge {
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    opacity: 0.85;
    margin-left: 2px;
}

.avm-catalog-search-inline {
    flex: 1 1 16rem;
    max-width: 24rem;
    position: relative;
    display: flex;
    align-items: center;
}

    .avm-catalog-search-inline svg {
        position: absolute;
        left: 10px;
        width: 15px;
        height: 15px;
        fill: var(--muted);
        pointer-events: none;
    }

    .avm-catalog-search-inline .avm-catalog-filter-input {
        width: 100%;
        padding-left: 32px;
        height: 36px;
        font-size: calc(12px * var(--avm-font-scale));
        border-radius: var(--r-md);
    }

.avm-tube-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    color: var(--ink);
}

.avm-tube-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.avm-tube-badge.is-serum .avm-tube-dot {
    background: #e11d48;
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.2);
}

.avm-tube-badge.is-edta .avm-tube-dot {
    background: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.avm-tube-badge.is-citrate .avm-tube-dot {
    background: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.avm-tube-badge.is-fluoride .avm-tube-dot {
    background: #6b7280;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

.avm-tube-badge.is-urine .avm-tube-dot {
    background: #eab308;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}

.avm-tube-badge.is-heparin .avm-tube-dot {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.avm-param-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--brand);
    padding: 3px 8px;
    border-radius: var(--r-sm);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .avm-param-pill:hover {
        background: var(--brand);
        color: #fff;
        border-color: var(--brand);
    }

.avm-param-calc-tag {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    border-radius: 4px;
    padding: 1px 4px;
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 800;
}

.avm-margin-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 800;
    font-variant-numeric: tabular-nums lining-nums;
}

    .avm-margin-pill.is-profit {
        background: rgba(16, 185, 129, 0.12);
        color: #047857;
        border: 1px solid rgba(16, 185, 129, 0.25);
    }

    .avm-margin-pill.is-thin {
        background: rgba(245, 158, 11, 0.12);
        color: #b45309;
        border: 1px solid rgba(245, 158, 11, 0.25);
    }

    .avm-margin-pill.is-loss {
        background: rgba(239, 68, 68, 0.12);
        color: #b91c1c;
        border: 1px solid rgba(239, 68, 68, 0.25);
    }

.avm-catalog-table th,
.avm-catalog-table td {
    padding: 6px 10px;
    text-align: left;
}

    .avm-catalog-table th.avm-col-sr,
    .avm-catalog-table td.avm-col-sr,
    .avm-catalog-table th.avm-col-mid,
    .avm-catalog-table td.avm-col-mid {
        text-align: center;
    }

    .avm-catalog-table th.is-num,
    .avm-catalog-table td.is-num,
    .avm-catalog-table th.avm-col-money,
    .avm-catalog-table td.avm-col-money {
        text-align: right;
    }

.avm-catalog-table .avm-catalog-name {
    text-align: left;
}

.avm-catalog-table .avm-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
}

/* Sticky all thead th columns vertically */
.avm-catalog-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
}

.avm-catalog-table th.avm-th-sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .avm-catalog-table th.avm-th-sortable:hover {
        background: linear-gradient(180deg, #cde0ff 0%, #b8cff2 100%) !important;
        color: #1d4ed8;
    }

    .avm-catalog-table th.avm-th-sortable:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: -2px;
    }

    .avm-catalog-table th.avm-th-sortable .avm-th-content {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        width: 100%;
    }

.avm-catalog-table th.is-num .avm-th-content,
.avm-catalog-table th.avm-col-money .avm-th-content {
    justify-content: flex-end;
}

.avm-catalog-table th.avm-col-mid .avm-th-content {
    justify-content: center;
}

.avm-sort-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

    .avm-sort-icon.is-neutral {
        opacity: 0.35;
    }

.avm-catalog-table th.avm-th-sortable:hover .avm-sort-icon.is-neutral {
    opacity: 0.75;
}

.avm-sort-icon.is-active {
    opacity: 1;
}

.avm-catalog-table th.is-sorted-asc,
.avm-catalog-table th.is-sorted-desc {
    color: #1d4ed8 !important;
}

/* Sticky first 2 columns and last action column */
.avm-catalog-table th:first-child,
.avm-catalog-table td:first-child:not([colspan]) {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #ffffff;
    width: 48px;
    min-width: 48px;
    text-align: center;
}

.avm-catalog-table th:nth-child(2),
.avm-catalog-table td:nth-child(2):not([colspan]) {
    position: sticky;
    left: 48px;
    z-index: 2;
    background: #ffffff;
    box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.08);
}

.avm-catalog-table th:last-child,
.avm-catalog-table td:last-child:not([colspan]) {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #ffffff;
    box-shadow: -2px 0 5px -2px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.avm-catalog-table td[colspan],
.avm-catalog-table td.avm-table-loading-cell {
    position: static !important;
    left: auto !important;
    width: auto !important;
    text-align: center !important;
}

.avm-catalog-table tbody tr:hover td:first-child:not([colspan]),
.avm-catalog-table tbody tr:hover td:nth-child(2):not([colspan]),
.avm-catalog-table tbody tr:hover td:last-child:not([colspan]) {
    background: #f7fbff;
}

.avm-catalog-table thead th:first-child {
    z-index: 10;
    background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
}

.avm-catalog-table thead th:nth-child(2) {
    z-index: 10;
    background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
}

.avm-catalog-table thead th:last-child {
    z-index: 10;
    background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
}

.avm-fasting-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    white-space: nowrap;
}

    .avm-fasting-badge.is-required {
        background: #fef3c7;
        border: 1px solid #fde68a;
        color: #b45309;
    }

        .avm-fasting-badge.is-required .avm-fasting-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #d97706;
        }

    .avm-fasting-badge.is-none {
        background: #f1f5f9;
        color: #64748b;
        border: 1px solid #e2e8f0;
    }

.avm-btn-copy-pt {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}

    .avm-btn-copy-pt:hover {
        color: var(--ink);
        background: var(--surface-subtle);
    }

    .avm-btn-copy-pt svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }

.avm-btn-quick-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.06);
}

    .avm-btn-quick-order svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
        transition: transform 0.15s ease;
    }

    .avm-btn-quick-order:hover {
        background: #2563eb;
        border-color: #2563eb;
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
    }

    .avm-btn-quick-order.is-added {
        background: #059669;
        border-color: #059669;
        color: #ffffff;
        box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
    }

        .avm-btn-quick-order.is-added:hover {
            background: #047857;
            border-color: #047857;
            color: #ffffff;
        }

.avm-catalog-order-dock {
    position: fixed;
    bottom: var(--sp-4);
    left: calc(50vw + (var(--sidebar-w) / 2));
    transform: translateX(-50%);
    width: min(52rem, calc(100vw - var(--sidebar-w) - 2rem));
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    box-shadow: 0 20px 35px -8px rgba(16, 32, 87, 0.18), 0 4px 12px -2px rgba(16, 32, 87, 0.08);
    z-index: 100;
    padding: 10px 18px;
    color: #0f172a;
    animation: avmDockSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.avm-portal-shell.is-collapsed .avm-catalog-order-dock {
    left: calc(50vw + (var(--sidebar-rail-w) / 2));
    width: min(52rem, calc(100vw - var(--sidebar-rail-w) - 2rem));
}

@media (max-width: 980px) {
    .avm-catalog-order-dock {
        left: 50%;
        width: min(52rem, calc(100vw - 2rem));
    }
}

@keyframes avmDockSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.avm-catalog-order-dock-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.avm-order-dock-flyout {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.25), 0 4px 16px -2px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    max-height: 380px;
    overflow: hidden;
    animation: avmFlyoutSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 105;
}

@keyframes avmFlyoutSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avm-order-dock-flyout-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line-soft);
}

.avm-order-dock-flyout-title strong {
    font-size: calc(13.5px * var(--avm-font-scale));
    font-weight: 800;
    color: #0f172a;
    display: block;
}

.avm-order-dock-flyout-subtitle {
    font-size: calc(11px * var(--avm-font-scale));
    color: #64748b;
}

.avm-order-dock-flyout-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
}

.avm-selected-flyout-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

    .avm-selected-flyout-item:hover {
        background: #f1f5f9;
        border-color: #e2e8f0;
    }

.avm-selected-flyout-sr {
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    color: #94a3b8;
    width: 20px;
    text-align: center;
}

.avm-selected-flyout-details {
    flex: 1 1 auto;
    min-width: 0;
}

.avm-selected-flyout-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avm-selected-flyout-name {
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-selected-flyout-rate {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

    .avm-selected-flyout-rate strong {
        font-size: calc(12.5px * var(--avm-font-scale));
        color: #0f172a;
        font-variant-numeric: tabular-nums lining-nums;
    }

.avm-selected-flyout-remove {
    background: transparent;
    border: 0;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

    .avm-selected-flyout-remove svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

    .avm-selected-flyout-remove:hover {
        color: #ef4444;
        background: #fee2e2;
    }

.avm-order-dock-flyout-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #f8fafc;
    border-top: 1px solid var(--line-soft);
}

.avm-flyout-tot-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: calc(12px * var(--avm-font-scale));
    color: #475569;
}

    .avm-flyout-tot-row strong {
        font-size: calc(13.5px * var(--avm-font-scale));
        color: #0f172a;
    }

.avm-flyout-margin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: calc(11px * var(--avm-font-scale));
    color: #64748b;
    margin-top: 2px;
}

.avm-order-dock-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 8px;
    padding: 2px 6px;
    transition: background 0.15s ease;
}

    .avm-order-dock-summary:hover {
        background: #f1f5f9;
    }

.avm-order-dock-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.avm-dock-view-hint {
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    color: #2563eb;
}

.avm-order-dock-badge {
    background: #102057;
    color: #ffffff;
    border-radius: 9999px;
    font-weight: 800;
    font-size: calc(12px * var(--avm-font-scale));
    padding: 3px 10px;
    font-variant-numeric: tabular-nums lining-nums;
}

.avm-order-dock-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .avm-order-dock-info strong {
        font-size: calc(13px * var(--avm-font-scale));
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap;
    }

.avm-order-dock-financials {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: calc(11.5px * var(--avm-font-scale));
    color: #475569;
    white-space: nowrap;
}

.avm-dock-amount {
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums lining-nums;
}

.avm-order-dock-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 22rem;
    overflow: hidden;
    padding: 0 4px;
    flex: 1 1 auto;
    min-width: 0;
}

.avm-order-dock-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #334155;
    flex-shrink: 0;
}

    .avm-order-dock-chip.is-more {
        background: #e2e8f0;
        color: #1e293b;
        font-weight: 700;
        cursor: default;
    }

.avm-order-dock-chip-remove {
    cursor: pointer;
    opacity: 0.6;
    font-weight: 700;
}

    .avm-order-dock-chip-remove:hover {
        opacity: 1;
        color: #ef4444;
    }

.avm-order-dock-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.avm-order-dock-proceed {
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: calc(12px * var(--avm-font-scale)) !important;
    height: 36px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: all 0.15s ease;
    white-space: nowrap;
}

    .avm-order-dock-proceed:hover {
        background: #1d4ed8 !important;
        box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
    }

    .avm-order-dock-proceed svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }

/* Centered table loader */
.avm-table-loading-cell,
td.avm-table-loading-cell {
    text-align: center !important;
    padding: 48px 16px !important;
    vertical-align: middle !important;
}

    .avm-table-loading-cell .avm-loader {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px;
        font-size: calc(13px * var(--avm-font-scale));
        font-weight: 500;
        color: var(--muted);
        margin: 0 auto !important;
    }

.avm-tat-days {
    color: var(--text-muted, #64748b);
    font-size: 0.8em;
    font-weight: 500;
    margin-left: 2px;
}

.avm-tests-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

.avm-breakdown-card.avm-catalog-drawer-card {
    max-width: 56rem !important;
    width: 100% !important;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    border: 1px solid var(--line);
    overflow: hidden;
    margin: auto;
}

.avm-catalog-drawer-card .avm-order-action-head {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avm-catalog-drawer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .avm-catalog-drawer-meta h2 {
        font-size: calc(16px * var(--avm-font-scale));
        font-weight: 800;
        color: #0f172a;
        margin: 0;
    }

.avm-catalog-drawer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.avm-catalog-drawer-tabs {
    display: flex;
    gap: 8px;
    padding: 8px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--line-soft);
}

.avm-drawer-tab {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .avm-drawer-tab.is-active {
        background: #2563eb;
        border-color: #2563eb;
        color: #ffffff;
        box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    }

.avm-modal-close-btn,
.avm-catalog-drawer-card [data-avm-breakdown-close],
.avm-tests-card [data-avm-tests-close] {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

    .avm-modal-close-btn:hover,
    .avm-catalog-drawer-card [data-avm-breakdown-close]:hover,
    .avm-tests-card [data-avm-tests-close]:hover {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border-color: #94a3b8 !important;
    }

    .avm-modal-close-btn svg,
    .avm-catalog-drawer-card [data-avm-breakdown-close] svg,
    .avm-tests-card [data-avm-tests-close] svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
    }

.avm-catalog-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: calc(86vh - 160px);
    padding: 0;
}

    .avm-catalog-drawer-body .avm-table-scroll {
        max-height: none;
    }

    .avm-catalog-drawer-body thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #f8fafc;
        border-bottom: 1px solid #cbd5e1;
    }

.avm-catalog-drawer-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avm-drawer-order-btn {
    height: 36px;
    padding: 0 16px;
    font-size: calc(12px * var(--avm-font-scale));
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
}

    .avm-drawer-order-btn svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }

.avm-drawer-calc-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
}

@media (max-width: 620px) {
    .avm-catalog-bar .avm-finder-mode svg {
        display: none;
    }

    .avm-catalog-bar .avm-finder-mode {
        padding: 8px 6px;
    }
}

@media (max-width: 900px) {
    .avm-catalog-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .avm-catalog-source {
        flex-wrap: wrap;
    }

    .avm-catalog-lab-pick {
        max-width: none;
    }
}

.avm-finder-go {
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-mid) 60%, #4a63b8 100%);
    border: 0;
    box-shadow: 0 3px 12px rgba(44, 62, 122, .28);
    justify-content: center;
    min-width: 10rem;
    transition: box-shadow .2s ease, transform .2s ease;
}

    .avm-finder-go:hover {
        box-shadow: 0 6px 18px rgba(44, 62, 122, .34);
        transform: translateY(-1px);
    }

    .avm-finder-go:active {
        transform: translateY(0);
    }

.avm-result-bar {
    align-items: center;
    display: flex;
    gap: var(--sp-3);
    justify-content: space-between;
}

.avm-result-count {
    align-items: baseline;
    color: var(--muted);
    display: flex;
    font-size: calc(12px * var(--avm-font-scale));
    gap: 6px;
}

    .avm-result-count strong {
        color: var(--brand);
        font-family: var(--font-display);
        font-size: calc(19px * var(--avm-font-scale));
    }

/* The toggle narrows the tally beside it, so it reads as part of it rather than as a
   control stranded in the middle of the bar. */
.avm-result-bar .avm-toggle {
    flex: 0 0 auto;
    margin-right: auto;
}

/* A label never breaks over two lines; when the bar runs short it is the search box that gives. */
.avm-result-bar .avm-toggle-btn {
    font-size: calc(12.5px * var(--avm-font-scale));
    padding: 6px 18px;
    white-space: nowrap;
}

.avm-result-bar .avm-result-count {
    flex: 0 0 auto;
    white-space: nowrap;
}

.avm-result-bar .avm-result-filter {
    min-width: 0;
}

    .avm-result-bar .avm-result-filter .avm-input {
        min-width: 0;
        width: 100%;
    }

.avm-result-filter {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--field-line);
    border-radius: var(--r-pill);
    display: flex;
    flex: 0 1 26rem;
    gap: 8px;
    padding: 0 14px;
    transition: background .18s ease, border-color .18s ease, box-shadow .22s cubic-bezier(.22, 1, .36, 1);
}

    .avm-result-filter:hover {
        background: var(--field-hover);
        border-color: var(--field-line-strong);
    }

    .avm-result-filter:focus-within {
        background: var(--card);
        border-color: var(--brand-mid);
        box-shadow: 0 0 0 4px rgba(58, 82, 160, .13);
    }

    .avm-result-filter svg {
        fill: var(--muted-lt);
        flex: 0 0 15px;
        height: 15px;
        width: 15px;
    }

    .avm-result-filter .avm-input {
        background: transparent !important;
        border: 0;
        padding: 8px 0;
    }

        .avm-result-filter .avm-input:hover:not(:disabled),
        .avm-result-filter .avm-input:focus {
            background: transparent !important;
            box-shadow: none;
        }

/* One report per card: the patient is the heading, the report is the one action. */
@keyframes avmReportIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avm-report-patient {
    color: var(--brand);
    font-weight: 700;
}

.avm-report-barcode {
    background: var(--brand-soft);
    border-radius: var(--r-sm);
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    padding: 2px 8px;
}

.avm-report-get {
    justify-content: center;
    min-height: 28px;
    min-width: 5.5rem;
    padding: 4px 10px;
}

    .avm-report-get svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

    .avm-report-get.is-loading svg,
    .avm-report-get.is-done svg {
        display: none;
    }

    .avm-report-get.is-loading span:not(.avm-submit-spinner) {
        display: none;
    }

    .avm-report-get.is-loading .avm-submit-spinner {
        display: inline-block;
        margin: 0;
    }

    .avm-report-get.is-loading {
        background: var(--green);
        border-color: var(--green);
        color: #fff;
    }

    .avm-report-get.is-done {
        background: var(--green);
        border-color: var(--green);
        color: #fff;
    }

.avm-report-blank {
    align-items: center;
    background: var(--card);
    border: 1px dashed var(--field-line-strong);
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--sp-6) var(--sp-4);
    text-align: center;
}

.avm-report-blank-mark {
    align-items: center;
    background: var(--brand-soft);
    border-radius: 50%;
    color: var(--brand-mid);
    display: inline-flex;
    height: 46px;
    justify-content: center;
    margin-bottom: 4px;
    width: 46px;
}

    .avm-report-blank-mark svg {
        fill: currentColor;
        height: 22px;
        width: 22px;
    }

.avm-report-blank-title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(15px * var(--avm-font-scale));
    font-weight: 700;
    margin: 0;
}

.avm-report-blank-text {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 0;
}

@media (max-width: 1024px) {
    .avm-finder {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-finder-go {
        width: 100%;
    }
}

@media (max-width: 620px) {
    .avm-result-bar {
        align-items: stretch;
        flex-direction: column;
    }

    /* Stacked, the flex basis would size the search box by height rather than width. */
    .avm-result-filter {
        flex: 0 0 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-finder-pane,
    :root:not([data-motion="full"]) .avm-finder-slider {
        animation: none;
        transition: none;
    }
}

/* ---- my profiles ---- */

.avm-profiles {
    gap: var(--sp-3);
}

.avm-profiles-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
}

    .avm-profiles-bar .avm-finder-modes {
        --avm-mode-count: 3;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

        .avm-profiles-bar .avm-finder-modes .avm-profiles-slider {
            width: calc((100% - 8px) / 3);
        }

    .avm-profiles-bar .avm-result-filter {
        flex: 1 1 20rem;
    }

.avm-profiles-new {
    margin-left: auto;
}

    .avm-profiles-new svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

.avm-profile-margin-toggle {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-family: inherit;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 800;
    gap: 8px;
    min-height: 38px;
    padding: 6px 12px 6px 7px;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

    .avm-profile-margin-toggle:hover,
    .avm-profile-margin-toggle:focus-visible,
    .avm-profile-margin-toggle[aria-pressed="true"] {
        background: #eef6ff;
        border-color: var(--brand-mid);
        color: var(--brand);
        box-shadow: 0 8px 18px rgba(38, 49, 146, .1);
        outline: 0;
    }

.avm-profile-margin-toggle-knob {
    background: #c6d3e7;
    border-radius: var(--r-pill);
    display: inline-flex;
    height: 20px;
    position: relative;
    transition: background .16s ease;
    width: 36px;
}

    .avm-profile-margin-toggle-knob::after {
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
        content: "";
        height: 16px;
        left: 2px;
        position: absolute;
        top: 2px;
        transition: transform .16s ease;
        width: 16px;
    }

.avm-profile-margin-toggle[aria-pressed="true"] .avm-profile-margin-toggle-knob {
    background: var(--brand);
}

    .avm-profile-margin-toggle[aria-pressed="true"] .avm-profile-margin-toggle-knob::after {
        transform: translateX(16px);
    }

/* A profile is a thing you keep and reuse, so each one gets its own card. */
.avm-profile-grid {
    align-items: stretch;
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    width: 100%;
}

    .avm-profile-grid .avm-loader {
        grid-column: 1 / -1;
        justify-content: center;
        padding: var(--sp-5);
    }

.avm-profile-card {
    animation: avmReportIn .24s ease both;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    border-top: 3px solid var(--brand-mid);
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-width: 0;
    padding: var(--sp-3);
    transition: border-color .18s ease, box-shadow .18s ease;
}

    .avm-profile-card:hover {
        border-color: var(--field-line-strong);
        border-top-color: var(--brand);
        box-shadow: 0 8px 22px rgba(20, 45, 82, .09);
    }

.avm-profile-card-head {
    align-items: start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.avm-profile-name {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(14.5px * var(--avm-font-scale));
    font-weight: 700;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.avm-profile-meta {
    color: var(--muted);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .04em;
    margin: 0;
    text-transform: uppercase;
}

.avm-profile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.avm-profile-chip {
    background: var(--brand-soft);
    border-radius: var(--r-sm);
    color: var(--brand);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    padding: 3px 8px;
}

.avm-profile-more {
    background: transparent;
    border: 1px dashed var(--field-line-strong);
    border-radius: var(--r-sm);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    padding: 3px 8px;
    transition: background .16s ease, color .16s ease;
}

    .avm-profile-more:hover {
        background: var(--bg-2);
        color: var(--brand);
    }

.avm-profile-price-strip {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
}

    .avm-profile-price-strip > span {
        background: #f7faff;
        border: 1px solid var(--line-soft);
        border-radius: var(--r-sm);
        display: flex;
        flex-direction: column;
        gap: 2px;
        justify-content: center;
        min-height: 46px;
        min-width: 0;
        padding: 7px 10px;
    }

    .avm-profile-price-strip small {
        color: var(--muted);
        font-size: calc(10px * var(--avm-font-scale));
        font-weight: 900;
        letter-spacing: .08em;
        line-height: 1;
        text-transform: uppercase;
    }

    .avm-profile-price-strip strong {
        color: var(--ink);
        font-variant-numeric: tabular-nums lining-nums;
        font-size: calc(16px * var(--avm-font-scale));
        font-weight: 900;
        line-height: 1.15;
    }

.avm-profile-price-extra {
    display: none !important;
}

.avm-profiles.is-margin-view .avm-profile-price-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.avm-profiles.is-margin-view .avm-profile-price-extra {
    display: flex !important;
}

.avm-profile-margin.is-profit strong,
.avm-profile-margin.is-profit em {
    color: #047857;
}

.avm-profile-margin.is-thin strong,
.avm-profile-margin.is-thin em {
    color: #b45309;
}

.avm-profile-margin.is-loss strong,
.avm-profile-margin.is-loss em {
    color: var(--danger);
}

.avm-profile-margin em {
    font-variant-numeric: tabular-nums lining-nums;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-style: normal;
    font-weight: 800;
}

.avm-profile-foot {
    align-items: center;
    border-top: 1px solid var(--line-soft);
    display: flex;
    gap: var(--sp-2);
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
}

.avm-profile-created-date {
    color: var(--muted);
    font-size: calc(11.5px * var(--avm-font-scale));
}

    .avm-profile-created-date strong {
        color: var(--ink);
        font-weight: 600;
    }

.avm-profile-order-btn {
    align-items: center;
    background: var(--brand);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: var(--r-sm);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 800;
    gap: 6px;
    justify-content: center;
    min-height: 38px;
    min-width: 7.5rem;
    padding: 8px 16px;
    box-shadow: 0 8px 18px rgba(38, 49, 146, .18);
    text-decoration: none;
    transition: background .16s ease, box-shadow .16s ease, transform .12s ease;
}

    .avm-profile-order-btn:hover,
    .avm-profile-order-btn:focus-visible {
        background: var(--brand-hover);
        color: #fff;
        box-shadow: 0 10px 22px rgba(38, 49, 146, .26);
        outline: 2px solid rgba(38, 49, 146, .18);
        outline-offset: 2px;
        transform: translateY(-1px);
    }

    .avm-profile-order-btn svg {
        fill: currentColor;
        height: 14px;
        width: 14px;
    }

@media (max-width: 760px) {
    .avm-profiles-new {
        margin-left: 0;
        width: 100%;
    }

    .avm-profiles-bar .avm-finder-modes,
    .avm-profiles-bar .avm-result-filter {
        flex: 1 1 100%;
    }

    .avm-profile-margin-toggle {
        width: 100%;
    }

    .avm-profiles.is-margin-view .avm-profile-price-strip {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-profile-card {
        animation: none;
        transition: none;
    }
}

/* ---- invoices ---- */

.avm-invoices {
    gap: var(--sp-3);
}

.avm-invoice-finder {
    grid-template-columns: minmax(0, 1fr) auto;
}

.avm-invoice-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* An invoice is read for its money, so the total carries the weight and the rest supports it. */
.avm-invoice-card {
    align-items: center;
    animation: avmReportIn .24s ease both;
    row-gap: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--field-line-strong);
    border-radius: var(--r-sm);
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: 11rem minmax(0, 1fr) auto auto;
    padding: 12px var(--sp-3);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

    .avm-invoice-card:hover {
        box-shadow: 0 6px 18px rgba(20, 45, 82, .08);
        transform: translateY(-1px);
    }

    .avm-invoice-card.is-open {
        border-left-color: var(--amber);
    }

    .avm-invoice-card.is-settled {
        border-left-color: var(--green);
    }

.avm-invoice-lead {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.avm-invoice-number {
    color: var(--ink);
    font-family: var(--font-num);
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avm-invoice-period {
    color: var(--brand);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.avm-invoice-figures {
    display: flex;
    flex-wrap: wrap;
    gap: 4px var(--sp-4);
    margin: 0;
}

    .avm-invoice-figures div {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .avm-invoice-figures dt {
        color: var(--muted);
        font-size: calc(10.5px * var(--avm-font-scale));
        font-weight: 800;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    .avm-invoice-figures dd {
        color: var(--ink);
        font-size: calc(13.5px * var(--avm-font-scale));
        font-weight: 600;
        margin: 0;
    }

        .avm-invoice-figures dd.is-num {
            font-family: var(--font-num);
        }

.avm-invoice-money {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: right;
}

.avm-invoice-total {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(19px * var(--avm-font-scale));
    font-weight: 700;
    white-space: nowrap;
}

    .avm-invoice-total small {
        color: var(--muted);
        font-size: calc(10.5px * var(--avm-font-scale));
        font-weight: 600;
    }

.avm-invoice-due {
    color: var(--cream-ink);
    font-family: var(--font-num);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    white-space: nowrap;
}

.avm-invoice-get {
    min-width: 6.5rem;
    justify-content: center;
}

    .avm-invoice-get svg {
        fill: currentColor;
        height: 14px;
        width: 14px;
    }

    .avm-invoice-get.is-loading svg {
        display: none;
    }

@media (max-width: 1180px) {
    .avm-invoice-card {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .avm-invoice-figures {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .avm-invoice-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-invoice-money {
        align-items: flex-start;
        text-align: left;
    }

    .avm-invoice-get {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-invoice-card {
        animation: none;
        transition: none;
    }
}

.avm-invoice-status {
    gap: 6px;
}

    /* The grid and the sliding pill both read the count from one variable, so the pill is a
   third of the track and lands on the third button rather than past the end of it. */
    .avm-invoice-status .avm-finder-modes {
        --avm-mode-count: 3;
        min-width: 21rem;
    }

/* ---- receipts, payment and ledger ---- */

.avm-receipts,
.avm-ledger {
    gap: var(--sp-3);
}

.avm-invoice-pick {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
}

.avm-invoice-card.has-pick {
    grid-template-columns: 20px 11rem minmax(0, 1fr) auto auto;
}

@media (max-width: 1180px) {
    .avm-invoice-card.has-pick {
        grid-template-columns: 20px minmax(0, 1fr) auto;
    }
}

@media (max-width: 620px) {
    .avm-invoice-card.has-pick {
        grid-template-columns: 20px minmax(0, 1fr);
    }
}

/* The bar only appears once something is picked, so it never asks to be ignored. */
.avm-pay-bar {
    align-items: center;
    animation: avmReportIn .2s ease both;
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-mid) 100%);
    border-radius: var(--r-md);
    box-shadow: 0 6px 20px rgba(44, 62, 122, .28);
    color: #fff;
    display: flex;
    gap: var(--sp-4);
    padding: 12px var(--sp-4);
}

.avm-pay-count {
    align-items: baseline;
    display: flex;
    font-size: calc(12px * var(--avm-font-scale));
    gap: 6px;
    opacity: .88;
}

    .avm-pay-count strong {
        font-family: var(--font-display);
        font-size: calc(19px * var(--avm-font-scale));
        opacity: 1;
    }

.avm-pay-total {
    margin-left: auto;
    text-align: right;
}

    .avm-pay-total .avm-builder-label {
        color: rgba(255, 255, 255, .75);
        margin-bottom: 1px;
    }

    .avm-pay-total strong {
        font-family: var(--font-display);
        font-size: calc(19px * var(--avm-font-scale));
        white-space: nowrap;
    }

.avm-pay-go {
    background: #fff;
    border: 0;
    color: var(--brand);
    min-width: 9rem;
}

    .avm-pay-go:hover {
        background: var(--brand-soft);
        color: var(--brand);
    }

    .avm-pay-go svg {
        fill: currentColor;
        height: 15px;
        width: 15px;
    }

    .avm-pay-go.is-loading svg {
        display: none;
    }










.avm-ledger-period {
    color: var(--brand);
    font-weight: 700;
}

/* Each kind of movement keeps one colour across the row, the tiles and the breakdown. */
.avm-ledger-table td.is-invoiced .avm-ledger-drill {
    color: var(--brand);
}

.avm-ledger-table td.is-credit .avm-ledger-drill {
    color: var(--green-ink);
}

.avm-ledger-table td.is-debit .avm-ledger-drill {
    color: var(--cream-ink);
}

.avm-ledger-table td.is-receipt .avm-ledger-drill {
    color: #7c3aed;
}

.avm-ledger-table td.is-zero {
    color: var(--muted-lt);
}

/* A figure with entries behind it reads as something to open. */
.avm-ledger-drill {
    background: transparent;
    border: 0;
    border-bottom: 1px dashed currentColor;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0 0 1px;
}

    .avm-ledger-drill:hover {
        border-bottom-style: solid;
    }

.avm-ledger-band {
    align-items: center;
    display: flex;
    gap: var(--sp-3);
}

.avm-ledger-export {
    margin-left: auto;
}

    .avm-ledger-export svg {
        fill: currentColor;
        height: 14px;
        width: 14px;
    }

.avm-brk-card {
    max-width: 60rem;
    width: min(60rem, 100%);
}

.avm-brk-body {
    max-height: min(60vh, 34rem);
    overflow: auto;
}

.avm-brk-foot {
    justify-content: space-between;
}

.avm-brk-total {
    color: var(--brand);
    font-family: var(--font-display);
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-receipt-table td.is-closing {
    color: var(--ink);
    font-weight: 700;
}

.avm-ledger-table td.is-closing {
    color: var(--ink);
    font-weight: 700;
}

@media (max-width: 900px) {
    .avm-pay-bar {
        flex-wrap: wrap;
    }

    .avm-pay-total {
        margin-left: 0;
        text-align: left;
    }

    .avm-pay-go {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-pay-bar {
        animation: none;
    }
}

/* ---- profile and users ---- */

.avm-profile {
    gap: var(--sp-3);
}

.avm-identity {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    border-top: 3px solid var(--brand-mid);
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: var(--sp-4);
}

.avm-identity-mark {
    align-items: center;
    background: linear-gradient(140deg, var(--brand) 0%, var(--brand-mid) 100%);
    border-radius: var(--r-md);
    color: #fff;
    display: inline-flex;
    font-family: var(--font-display);
    font-size: calc(24px * var(--avm-font-scale));
    font-weight: 700;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.avm-identity-body {
    min-width: 0;
}

.avm-identity-name {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(20px * var(--avm-font-scale));
    font-weight: 700;
    margin: 0;
}

.avm-identity-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: calc(12px * var(--avm-font-scale));
    gap: 6px var(--sp-3);
    margin: 3px 0 0;
}

.avm-identity-code {
    background: var(--brand-soft);
    border-radius: var(--r-sm);
    color: var(--brand);
    font-family: var(--font-num);
    font-weight: 700;
    padding: 2px 8px;
}

.avm-identity-address {
    color: var(--muted-lt);
    font-size: calc(11.5px * var(--avm-font-scale));
    margin: 6px 0 0;
}

.avm-identity-facts {
    display: flex;
    gap: var(--sp-4);
    margin: 0;
}

    .avm-identity-facts div {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .avm-identity-facts dt {
        color: var(--brand);
        font-size: calc(10.5px * var(--avm-font-scale));
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .avm-identity-facts dd {
        color: var(--ink);
        font-size: calc(13px * var(--avm-font-scale));
        font-weight: 600;
        margin: 0;
        white-space: nowrap;
    }

.avm-client-profile .avm-profile-grid {
    align-items: start;
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: minmax(0, 1fr) 21rem;
}

.avm-contact-card,
.avm-access-card {
    overflow: hidden;
    padding: 0;
}

.avm-contact-body {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    padding: var(--sp-4);
}

.avm-contact-group {
    border: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin: 0;
    min-width: 0;
    padding: 0;
}

    .avm-contact-group legend {
        color: var(--ink);
        font-family: var(--font-display);
        font-size: calc(13px * var(--avm-font-scale));
        font-weight: 700;
        padding: 0 0 var(--sp-2);
    }

.avm-contact-foot {
    align-items: center;
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
    padding: var(--sp-3) var(--sp-4);
}

/* Saying a change is unsaved is what makes the disabled button make sense. */
.avm-contact-state {
    color: var(--cream-ink);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    margin-right: auto;
}

.avm-access-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.avm-access-item {
    align-items: center;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    gap: 12px;
    padding: 12px var(--sp-3);
}

.avm-access-mark {
    border-radius: 50%;
    flex: 0 0 10px;
    height: 10px;
    width: 10px;
}

.avm-access-item.is-on .avm-access-mark {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, .16);
}

.avm-access-item.is-off .avm-access-mark {
    background: var(--field-line-strong);
}

.avm-access-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

    .avm-access-body strong {
        color: var(--ink);
        font-size: calc(12.5px * var(--avm-font-scale));
    }

    .avm-access-body span {
        color: var(--muted);
        font-size: calc(11.5px * var(--avm-font-scale));
    }

.avm-access-item.is-off .avm-access-body strong {
    color: var(--muted);
}

.avm-access-note {
    color: var(--muted-lt);
    font-size: calc(11px * var(--avm-font-scale));
    margin: 0;
    padding: var(--sp-3);
}

@media (max-width: 1100px) {
    .avm-profile-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .avm-identity {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .avm-identity-facts {
        flex-wrap: wrap;
        grid-column: 1 / -1;
    }

    .avm-contact-foot {
        flex-wrap: wrap;
    }

    .avm-contact-state {
        flex: 1 1 100%;
        margin-right: 0;
    }
}

.avm-brk-get svg {
    fill: currentColor;
    height: 13px;
    width: 13px;
}

.avm-brk-get.is-loading svg {
    display: none;
}

/* ---- track a sample ---- */

.avm-track {
    gap: var(--sp-3);
}

/* The barcode is the whole interaction, so the field is the page's biggest control. */
.avm-track-scan {
    align-items: end;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    border-top: 3px solid var(--brand-mid);
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: var(--sp-4);
}

.avm-track-scan-icon {
    align-items: center;
    background: var(--brand-soft);
    border-radius: var(--r-sm);
    color: var(--brand);
    display: inline-flex;
    height: 46px;
    justify-content: center;
    width: 46px;
}

    .avm-track-scan-icon svg {
        fill: currentColor;
        height: 24px;
        width: 24px;
    }

.avm-track-scan-field {
    min-width: 0;
}

.avm-track-input {
    font-family: var(--font-num);
    font-size: calc(19px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .1em;
    padding: 10px 14px;
}

.avm-track-result {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.avm-track-head {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: minmax(0, 1fr) auto;
    padding: var(--sp-4);
}

.avm-track-patient h2 {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(19px * var(--avm-font-scale));
    font-weight: 700;
    margin: 2px 0 0;
}

.avm-track-tests {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 3px 0 0;
}

/* Why something is not moving belongs above the samples, not inside one of them. */
.avm-track-holds {
    align-items: flex-start;
    background: var(--cream);
    border: 1px solid #fed7aa;
    border-radius: var(--r-md);
    display: flex;
    gap: 12px;
    padding: var(--sp-3) var(--sp-4);
}

.avm-track-holds-icon {
    color: var(--cream-ink);
    flex: 0 0 20px;
}

    .avm-track-holds-icon svg {
        fill: currentColor;
        height: 20px;
        width: 20px;
    }

.avm-track-holds-title {
    color: var(--cream-ink);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 800;
    margin: 0 0 4px;
}

.avm-track-holds-list {
    color: var(--ink-2);
    display: flex;
    flex-direction: column;
    font-size: calc(12px * var(--avm-font-scale));
    gap: 3px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.avm-track-samples {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
}

.avm-track-sample {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand-mid);
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: var(--sp-3);
}

.avm-track-sample-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.avm-track-sample-lead {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avm-track-sample-type {
    color: var(--muted);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-track-sample-tests {
    color: var(--muted);
    font-size: calc(11.5px * var(--avm-font-scale));
    margin: 0;
}

/* Three steps, left to right, so where a tube has got to is read at a glance. */
.avm-journey {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 4px 0 0;
}

.avm-journey-step {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    text-align: center;
}

    .avm-journey-step::before {
        background: var(--field-line);
        content: "";
        height: 2px;
        left: 50%;
        position: absolute;
        right: -50%;
        top: 4px;
    }

    .avm-journey-step:last-child::before {
        display: none;
    }

    .avm-journey-step.is-done::before {
        background: var(--green);
    }

.avm-journey-dot {
    background: var(--field-line-strong);
    border-radius: 50%;
    height: 10px;
    position: relative;
    width: 10px;
    z-index: 1;
}

.avm-journey-step.is-done .avm-journey-dot {
    background: var(--green);
}

.avm-journey-step.is-here .avm-journey-dot {
    animation: avmJourneyPulse 1.9s ease-in-out infinite;
    background: var(--brand-mid);
}

@keyframes avmJourneyPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(58, 82, 160, .30);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(58, 82, 160, .06);
    }
}

.avm-journey-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 6px;
}

.avm-journey-label {
    color: var(--muted-lt);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.avm-journey-step.is-done .avm-journey-label {
    color: var(--green-ink);
}

.avm-journey-step.is-here .avm-journey-label {
    color: var(--brand);
}

.avm-journey-time {
    color: var(--ink-2);
    font-size: calc(11px * var(--avm-font-scale));
    overflow-wrap: anywhere;
}

.avm-track-open {
    align-self: flex-start;
}

.avm-track-tests {
    padding-top: 4px;
}

.avm-track-sample.has-tests {
    grid-column: 1 / -1;
}

.avm-track-tests tr.is-cancelled td {
    color: var(--muted-lt);
    text-decoration: line-through;
}

.avm-track-facts dd {
    white-space: normal;
}

@media (max-width: 900px) {
    .avm-track-scan {
        grid-template-columns: auto minmax(0, 1fr);
    }

        .avm-track-scan .avm-finder-go {
            grid-column: 1 / -1;
        }

    .avm-track-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-track-facts {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-journey-step.is-here .avm-journey-dot {
        animation: none;
        box-shadow: 0 0 0 4px rgba(58, 82, 160, .22);
    }
}

.avm-track-scan.has-modes {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.avm-track-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 15rem;
}

    /* The chosen mode carries the brand, like the Track button it sits beside. */
    .avm-track-modes .avm-finder-slider {
        background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
        box-shadow: 0 2px 10px rgba(44, 62, 122, .28);
    }

    .avm-track-modes .avm-finder-mode.is-active {
        color: #fff;
    }

.avm-track-views {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-left: auto;
    min-width: 12rem;
}

.avm-track-band {
    align-items: center;
    display: flex;
    gap: var(--sp-3);
}

.avm-track-type {
    align-self: start;
}

/* Everything the lab knows about the order, read across rather than hunted for. */
.avm-track-detail {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4);
}

    .avm-track-detail .avm-track-facts {
        display: grid;
        gap: var(--sp-3) var(--sp-4);
        grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
        margin: 0;
    }

        .avm-track-detail .avm-track-facts div {
            display: flex;
            flex-direction: column;
            gap: 1px;
            min-width: 0;
        }

    .avm-track-detail dt {
        color: var(--brand);
        font-size: calc(10.5px * var(--avm-font-scale));
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .avm-track-detail dd {
        color: var(--ink);
        font-size: calc(13px * var(--avm-font-scale));
        font-weight: 600;
        margin: 0;
        overflow-wrap: anywhere;
    }

.avm-track-billed dd {
    color: var(--brand);
}

@media (max-width: 900px) {
    .avm-track-scan.has-modes {
        grid-template-columns: auto minmax(0, 1fr);
    }

        .avm-track-scan.has-modes .avm-track-scan-field {
            grid-column: 1 / -1;
        }

    .avm-track-modes {
        grid-column: auto;
    }

    .avm-track-views {
        margin-left: 0;
        width: 100%;
    }

    .avm-track-band {
        flex-wrap: wrap;
    }
}

.avm-finder-go {
    align-items: center;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
    border: 0;
    border-radius: var(--r-pill);
    box-shadow: 0 4px 14px rgba(44, 62, 122, .3);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    letter-spacing: .01em;
    min-height: 42px;
    padding: 0 var(--sp-5);
    transition: box-shadow .2s ease, transform .2s ease, filter .2s ease;
}

    .avm-finder-go svg {
        fill: currentColor;
        height: 17px;
        width: 17px;
    }

    .avm-finder-go:hover:not(:disabled) {
        box-shadow: 0 7px 20px rgba(44, 62, 122, .38);
        filter: brightness(1.08);
        transform: translateY(-1px);
    }

    .avm-finder-go:active:not(:disabled) {
        transform: translateY(0);
    }

    .avm-finder-go:disabled {
        cursor: progress;
        opacity: .92;
    }

    .avm-finder-go .avm-submit-spinner {
        flex: 0 0 auto;
        height: 16px;
        width: 16px;
    }

    .avm-finder-go.is-loading .avm-submit-spinner {
        display: inline-block;
    }

    .avm-finder-go.is-loading svg {
        display: none;
    }

/* Reports return many rows, so the list scrolls under a held header rather than growing the page.
   No minimum: a short list ends at its last row instead of leaving an empty band under it. */
.avm-report-shell .avm-table-scroll {
    height: auto;
    max-height: calc(100vh - 22rem);
    overflow: auto;
}

/* Separate, not collapsed: a collapsed border belongs to the table grid rather than the cell,
   so a pinned cell would leave its border behind and let the scrolled columns show through. */
.avm-report-table {
    border-collapse: separate;
    border-spacing: 0;
}

.avm-report-table th,
.avm-report-table td {
    padding: 6px 10px;
}

/* An outlab report comes from another lab, so the row says so before the badge is read. */
.avm-report-outlab-tag {
    background: #ea580c;
    border-radius: var(--r-pill);
    color: #fff;
    display: inline-block;
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1;
    margin-left: 6px;
    padding: 4px 8px;
    text-transform: uppercase;
    vertical-align: 1px;
    white-space: nowrap;
}

.avm-report-table tbody tr.is-outlab td {
    background: #fff7ed;
}

.avm-report-table tbody tr.is-outlab td.avm-col-sr {
    box-shadow: inset 3px 0 0 #ea580c;
}

.avm-report-table tbody tr.is-outlab:hover td,
.avm-report-table tbody tr.is-outlab:hover td.avm-col-sr,
.avm-report-table tbody tr.is-outlab:hover td.avm-report-col-patient {
    background: #ffedd5;
}

/* Sr.No and Patient stay in view while the wider columns scroll sideways. */
.avm-report-table th.avm-col-sr,
.avm-report-table td.avm-col-sr,
.avm-report-table .avm-report-col-patient {
    background: #fff;
    position: sticky;
    z-index: 2;
}

.avm-report-table th.avm-col-sr,
.avm-report-table td.avm-col-sr {
    left: 0;
    min-width: 62px;
    width: 62px;
}

.avm-report-table .avm-report-col-patient {
    box-shadow: inset -1px 0 0 rgba(180, 199, 229, .95), 10px 0 18px rgba(20, 45, 82, .05);
    left: 62px;
}

.avm-report-table thead th.avm-col-sr,
.avm-report-table thead th.avm-report-col-patient {
    background: linear-gradient(180deg, #dce8ff 0%, #cbdaf4 100%);
    z-index: 5;
}

.avm-report-table tbody tr:hover td.avm-col-sr,
.avm-report-table tbody tr:hover td.avm-report-col-patient {
    background: #f7fbff;
}

.avm-report-table .avm-table-loading-cell {
    border-right: 0;
    height: 82px;
    padding: 0;
    text-align: center !important;
    vertical-align: middle !important;
}

    .avm-report-table .avm-table-loading-cell .avm-loader {
        align-items: center;
        display: flex;
        justify-content: center;
        min-height: 82px;
        width: 100%;
    }

/* Only on a phone would the pinned pair fill the viewport, so only there does it release. */
@media (max-width: 620px) {
    .avm-report-table td.avm-col-sr,
    .avm-report-table td.avm-report-col-patient {
        position: static;
    }

    .avm-report-table thead th.avm-col-sr,
    .avm-report-table thead th.avm-report-col-patient {
        left: auto;
    }

    .avm-report-table .avm-report-col-patient {
        box-shadow: none;
    }
}

.avm-report-table .avm-report-mark {
    color: var(--ink-2);
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
}

/* Mobile over email, each a tap target. The number leads because it is the one clients
   recognise; the address truncates rather than widening the column. */
.avm-report-contact {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.avm-report-contact-line {
    align-items: center;
    color: var(--ink-2);
    display: inline-flex;
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    gap: 5px;
    max-width: 14rem;
    text-decoration: none;
}

    .avm-report-contact-line svg {
        color: var(--muted);
        flex-shrink: 0;
        height: 12px;
        width: 12px;
    }

    .avm-report-contact-line span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .avm-report-contact-line.is-email {
        color: var(--muted);
        font-family: inherit;
        font-size: calc(10.5px * var(--avm-font-scale));
    }

    .avm-report-contact-line:hover {
        color: var(--brand-mid);
    }

        .avm-report-contact-line:hover svg {
            color: var(--brand-mid);
        }

/* An order listed before every test is back. Amber, because the report the client opens
   today is real but will grow; the fraction says how much is still to come. */
.avm-report-partial {
    background: #fef3c7;
    border-radius: 999px;
    color: #92400e;
    display: inline-block;
    font-family: var(--font-num);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    margin-left: 6px;
    padding: 4px 7px;
    vertical-align: 1px;
    white-space: nowrap;
}

.avm-report-table tbody tr:hover .avm-report-patient {
    color: var(--brand-mid);
}

/* Sample pickup: loose samples on the left, the requests they can join on the right. */
.avm-pickup-today {
    align-items: center;
    border-top: 3px solid var(--brand-mid);
    display: grid;
    gap: var(--sp-3) var(--sp-5);
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
}

.avm-pickup-today-mcb {
    min-width: 0;
}

.avm-pickup-board {
    align-items: stretch;
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.avm-pickup.has-selection {
    padding-bottom: 6.5rem;
}

.avm-pickup-lane {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-4);
}

.avm-pickup-lane-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    justify-content: space-between;
}

.avm-pickup-lane-titles {
    flex: 1 1 auto;
    min-width: 0;
}

.avm-pickup-lane-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: var(--sp-2);
}

.avm-pickup-lane-title {
    color: var(--brand);
    font-family: var(--font-display);
    font-size: calc(15px * var(--avm-font-scale));
    margin: 0;
}

.avm-pickup-lane-note {
    color: var(--muted);
    font-size: calc(11.5px * var(--avm-font-scale));
    margin: 2px 0 0;
}

.avm-pickup-count {
    background: var(--brand-soft);
    border-radius: var(--r-pill);
    color: var(--brand);
    font-family: var(--font-display);
    font-size: calc(15px * var(--avm-font-scale));
    font-weight: 700;
    min-width: 2.2rem;
    padding: 3px 10px;
    text-align: center;
}

.avm-pickup-search {
    flex: 0 0 auto;
}

    .avm-pickup-search.is-compact {
        position: relative;
        width: 230px;
    }

        .avm-pickup-search.is-compact .avm-input {
            background: var(--bg-surface-raised, #f8fafc);
            border-radius: var(--r-full, 9999px);
            font-size: calc(11.5px * var(--avm-font-scale));
            height: 32px;
            padding-bottom: 0;
            padding-left: 30px;
            padding-top: 0;
        }

        .avm-pickup-search.is-compact svg {
            height: 14px;
            left: 10px;
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 14px;
            fill: var(--ink-4, #94a3b8);
        }

/* The list is as tall as its rows until it would run off the screen, then it scrolls. */
.avm-pickup-shell .avm-table-scroll {
    max-height: calc(100vh - 19rem);
    overflow: auto;
}

.avm-pickup-table th,
.avm-pickup-table td {
    padding: 5px 10px;
}

.avm-col-pick {
    text-align: center;
    width: 2.6rem;
}

.avm-pickup-table tbody tr {
    cursor: pointer;
}

/* Rows are not picked one by one, so the pick cell is a marker: blank until the header
   selects everything, a tick once it has. */
.avm-pickup-chosen-mark {
    border: 2px solid var(--line);
    border-radius: 50%;
    display: inline-block;
    height: 16px;
    position: relative;
    vertical-align: middle;
    width: 16px;
}

.avm-pickup-table tbody tr.is-chosen .avm-pickup-chosen-mark {
    background: var(--brand);
    border-color: var(--brand);
}

    .avm-pickup-table tbody tr.is-chosen .avm-pickup-chosen-mark::after {
        border: solid #fff;
        border-width: 0 2px 2px 0;
        content: "";
        height: 7px;
        left: 4px;
        position: absolute;
        top: 1px;
        transform: rotate(45deg);
        width: 3px;
    }

.avm-pickup-table tbody tr.is-chosen {
    background: var(--brand-soft);
}

.avm-pickup-barcodes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.avm-col-pick .avm-check {
    min-height: 0;
}

.avm-pickup-empty {
    padding: var(--sp-5) var(--sp-3);
    text-align: center;
}

.avm-pickup-request-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.avm-pickup-request-loader,
.avm-pickup-request-error {
    align-items: center;
    border: 1px dashed var(--field-line);
    border-radius: var(--r-sm);
    color: var(--muted);
    display: flex;
    justify-content: center;
    min-height: 96px;
    padding: var(--sp-4);
    text-align: center;
}

    .avm-pickup-request-loader .avm-loader {
        justify-content: center;
    }

.avm-pickup-request-error {
    border-color: rgba(220, 38, 38, .22);
    color: var(--red);
}

.avm-pickup-request {
    animation: avmPickupCardIn .34s cubic-bezier(.22, 1, .36, 1) both;
    background: var(--bg-2);
    border: 1px solid var(--field-line);
    border-left: 3px solid var(--green);
    border-radius: var(--r-sm);
    padding: var(--sp-3);
}

    .avm-pickup-request:nth-child(2) {
        animation-delay: .04s;
    }

    .avm-pickup-request:nth-child(3) {
        animation-delay: .08s;
    }

    .avm-pickup-request:nth-child(4) {
        animation-delay: .12s;
    }

    .avm-pickup-request header {
        align-items: center;
        display: flex;
        gap: var(--sp-2);
        justify-content: space-between;
    }

.avm-pickup-request-side {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.avm-pickup-request-id {
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-pickup-request-chc {
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-pickup-request-status {
    background: var(--card);
    border-radius: var(--r-pill);
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
    padding: 2px 8px;
}

.avm-pickup-request-meta {
    color: var(--ink-2);
    font-size: calc(11.5px * var(--avm-font-scale));
    margin: 6px 0 0;
}

.avm-pickup-request-free {
    color: var(--green);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    margin: 4px 0 0;
}

.avm-pickup-cancel {
    align-items: center;
    background: rgba(220, 38, 38, .08);
    border: 1px solid rgba(220, 38, 38, .18);
    border-radius: var(--r-pill);
    color: var(--red);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    gap: 5px;
    margin-top: var(--sp-2);
    padding: 4px 9px;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

    .avm-pickup-cancel:hover {
        background: rgba(220, 38, 38, .12);
        border-color: rgba(220, 38, 38, .34);
        transform: translateY(-1px);
    }

    .avm-pickup-cancel svg {
        fill: currentColor;
        height: 14px;
        width: 14px;
    }

    .avm-pickup-cancel.is-loading svg {
        animation: avmSpin .8s linear infinite;
    }

/* The action bar rises from the foot of the page once something is selected. */
.avm-pickup-bar {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    bottom: calc(var(--avm-footer-h, 0px) + var(--sp-3));
    box-shadow: 0 12px 32px rgba(20, 45, 82, .22);
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: auto minmax(0, 1fr) auto;
    left: var(--sidebar-w);
    margin: 0 auto;
    overflow: hidden;
    padding: var(--sp-3) var(--sp-4);
    position: fixed;
    right: 0;
    width: min(60rem, calc(100% - 2rem));
    z-index: 40;
    animation: avmPickupBarIn .28s cubic-bezier(.22, 1, .36, 1);
}

.avm-pickup-bar-line {
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
    height: 2px;
    inset: 0 auto auto 0;
    position: absolute;
    width: 100%;
    transform-origin: left;
    animation: avmPickupLine .45s cubic-bezier(.22, 1, .36, 1);
}

@keyframes avmPickupBarIn {
    from {
        opacity: 0;
        transform: translate(28px, 18px);
    }

    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

@keyframes avmPickupCardIn {
    from {
        opacity: 0;
        transform: translate(18px, 12px);
    }

    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

.avm-sidebar-collapsed .avm-pickup-bar {
    left: var(--sidebar-rail-w);
}

@keyframes avmPickupLine {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

.avm-pickup-bar-count {
    align-items: baseline;
    color: var(--muted);
    display: flex;
    font-size: calc(12px * var(--avm-font-scale));
    gap: 6px;
}

    .avm-pickup-bar-count strong {
        color: var(--brand);
        font-family: var(--font-display);
        font-size: calc(19px * var(--avm-font-scale));
    }

.avm-pickup-bar-charge {
    color: var(--ink-2);
    display: flex;
    flex-direction: column;
    font-size: calc(11.5px * var(--avm-font-scale));
    gap: 6px;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    min-width: 0;
}

.avm-pickup-bar-fact {
    line-height: 1.5;
}

.avm-pickup-bar-charge .avm-mcb-strip {
    background: rgba(255, 247, 237, .72);
    border: 1px solid rgba(217, 119, 6, .18);
    border-radius: var(--r-sm);
    padding: 8px 10px;
}

.avm-pickup-bar-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: var(--sp-2);
    grid-column: 3;
    grid-row: 1;
}

    .avm-pickup-bar-actions .avm-btn,
    .avm-pickup-bar-actions .avm-finder-go {
        white-space: nowrap;
    }

.avm-pickup-join {
    border-color: var(--green);
    color: var(--green);
    position: relative;
}

    .avm-pickup-join.is-loading {
        pointer-events: none;
    }

        .avm-pickup-join.is-loading span {
            opacity: 0;
        }

        .avm-pickup-join.is-loading::after {
            animation: avmSpin .75s linear infinite;
            border: 2px solid rgba(5, 150, 105, .22);
            border-top-color: var(--green);
            border-radius: 50%;
            content: "";
            height: 16px;
            left: 50%;
            margin: -8px 0 0 -8px;
            position: absolute;
            top: 50%;
            width: 16px;
        }

/* The dialog drops in from the top rather than fading in the middle. */
.avm-pickup-dialog {
    align-items: flex-start;
    display: flex;
    opacity: 0;
    padding-top: 4vh;
    pointer-events: none;
    transition: opacity .38s ease;
}

    .avm-pickup-dialog.is-open {
        opacity: 1;
        pointer-events: auto;
    }

.avm-pickup-card {
    background: var(--card);
    border-radius: var(--r-md);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    display: flex;
    flex-direction: column;
    max-height: 92vh;
    overflow: hidden;
    transform: translateY(-34px);
    opacity: 0;
    transition: transform .46s cubic-bezier(.16, 1, .3, 1), opacity .38s ease;
    width: min(46rem, 96vw);
}

.avm-pickup-dialog.is-open .avm-pickup-card {
    opacity: 1;
    transform: translateY(0);
}

.avm-pickup-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.avm-pickup-head-main {
    flex: 1 1 auto;
    min-width: 0;
}

.avm-pickup-head-line {
    background: rgba(255, 255, 255, .85);
    bottom: 0;
    height: 2px;
    left: 0;
    position: absolute;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .5s cubic-bezier(.22, 1, .36, 1);
    width: 100%;
}

.avm-pickup-dialog.is-open .avm-pickup-head-line {
    transform: scaleX(1);
}

.avm-pickup-head-note {
    color: rgba(255, 255, 255, .82);
    font-size: calc(11.5px * var(--avm-font-scale));
    margin: 3px 0 0;
}

.avm-pickup-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: var(--sp-4);
    min-height: 0;
    overflow: auto;
}

.avm-pickup-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.avm-pickup-chip {
    background: var(--brand-soft);
    border-radius: var(--r-sm);
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    padding: 3px 9px;
}

.avm-pickup-legend {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .06em;
    margin: 0 0 var(--sp-2);
    text-transform: uppercase;
}

.avm-pickup-choice-grid {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.avm-pickup-choice {
    animation: avmPickupCardIn .34s cubic-bezier(.22, 1, .36, 1) both;
    background: var(--card);
    border: 1.5px solid var(--field-line);
    border-radius: var(--r-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    gap: 4px;
    padding: var(--sp-3);
    position: relative;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

    .avm-pickup-choice:nth-child(2) {
        animation-delay: .04s;
    }

    .avm-pickup-choice:nth-child(3) {
        animation-delay: .08s;
    }

    .avm-pickup-choice:hover {
        border-color: var(--brand-mid);
        transform: translateY(-1px);
    }

    .avm-pickup-choice.is-active {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px var(--brand-soft);
    }

    .avm-pickup-choice.is-join.is-active {
        border-color: var(--green);
        box-shadow: 0 0 0 3px rgba(5, 150, 105, .14);
    }

.avm-pickup-choice-mark svg {
    fill: var(--brand-mid);
    height: 20px;
    width: 20px;
}

.avm-pickup-choice-title {
    color: var(--ink);
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-pickup-choice-note {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
}

.avm-pickup-choice-flag {
    background: var(--green);
    border-radius: var(--r-pill);
    color: #fff;
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .04em;
    padding: 2px 8px;
    position: absolute;
    right: var(--sp-3);
    text-transform: uppercase;
    top: var(--sp-3);
}

/* The two delivery cards are a quick choice, not the point of the dialog, so they read as one
   compact row and leave the height to the samples and the timings. */
.avm-pickup-choices.is-compact .avm-pickup-choice-grid {
    gap: var(--sp-2);
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.avm-pickup-choice.is-compact {
    align-items: center;
    flex-direction: row;
    gap: 9px;
    padding: 9px 11px;
}

    .avm-pickup-choice.is-compact .avm-pickup-choice-mark svg {
        height: 17px;
        width: 17px;
    }

.avm-pickup-choices-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: space-between;
    margin-bottom: var(--sp-1);
}

    .avm-pickup-choices-head .avm-pickup-legend {
        margin-bottom: 0;
    }

.avm-trip-slots-badge-group {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.avm-trip-slot-chip {
    align-items: center;
    background: var(--bg-surface-raised, #f1f5f9);
    border: 1px solid var(--border-soft, #e2e8f0);
    border-radius: var(--r-full, 9999px);
    color: var(--ink-2, #475569);
    display: inline-flex;
    font-size: calc(10.5px * var(--avm-font-scale));
    gap: 5px;
    line-height: 1;
    padding: 3px 8px;
    transition: all var(--trans-fast, 150ms ease);
}

    .avm-trip-slot-chip .avm-trip-slot-dot {
        background: var(--ink-4, #94a3b8);
        border-radius: 50%;
        display: inline-block;
        height: 6px;
        width: 6px;
    }

    .avm-trip-slot-chip.is-active-trip {
        background: #ecfdf5;
        border-color: #a7f3d0;
        color: #065f46;
    }

        .avm-trip-slot-chip.is-active-trip .avm-trip-slot-dot {
            background: #10b981;
            box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
        }

    .avm-trip-slot-chip .avm-trip-slot-label {
        font-weight: 700;
    }

    .avm-trip-slot-chip .avm-trip-slot-time {
        color: var(--ink-3, #64748b);
        font-size: calc(10px * var(--avm-font-scale));
    }

    .avm-trip-slot-chip.is-active-trip .avm-trip-slot-time {
        color: #047857;
        font-weight: 600;
    }

.avm-trip-indicator {
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--r-full, 9999px);
    color: #166534;
    display: flex;
    font-size: calc(11px * var(--avm-font-scale));
    gap: 6px;
    line-height: 1.3;
    padding: 4px 11px;
}

/* The footer reads right to left - confirm, then dismiss - so the rider window sits at the
   far left where it is read as context rather than as another thing to press. */
.avm-order-action-foot > .avm-trip-indicator {
    margin-right: auto;
    min-width: 0;
}

/* Narrow dialog: the window takes its own line above the buttons rather than squeezing them. */
@media (max-width: 560px) {
    .avm-order-action-foot {
        flex-wrap: wrap;
    }

        .avm-order-action-foot > .avm-trip-indicator {
            margin-right: 0;
            order: -1;
            width: 100%;
        }
}

.avm-trip-indicator-pulse {
    animation: avmTripPulse 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.8);
    flex-shrink: 0;
    height: 7px;
    width: 7px;
}

@keyframes avmTripPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.8);
        transform: scale(0.95);
    }

    60% {
        box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
        transform: scale(1.15);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
        transform: scale(0.95);
    }
}

.avm-trip-indicator-text {
    font-weight: 500;
}

/* Pickup Board Header Schedule Pill */
.avm-pickup-schedule-pill {
    align-items: center;
    background: var(--bg-surface-raised, #f8fafc);
    border: 1px solid var(--border-soft, #e2e8f0);
    border-radius: var(--r-full, 9999px);
    display: flex;
    font-size: calc(11px * var(--avm-font-scale));
    gap: 7px;
    padding: 4px 12px;
}

.avm-schedule-pill-icon svg {
    fill: var(--brand-mid, #2563eb);
    height: 14px;
    vertical-align: middle;
    width: 14px;
}

.avm-schedule-pill-title {
    color: var(--ink-3, #64748b);
    font-weight: 600;
}

.avm-schedule-pill-chip {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--r-full, 9999px);
    color: var(--ink-2, #334155);
    display: inline-flex;
    gap: 4px;
    padding: 2px 7px;
}

    .avm-schedule-pill-chip .avm-trip-slot-dot {
        background: #94a3b8;
        border-radius: 50%;
        height: 5px;
        width: 5px;
    }

    .avm-schedule-pill-chip.is-active-trip {
        background: #ecfdf5;
        border-color: #6ee7b7;
        color: #065f46;
    }

        .avm-schedule-pill-chip.is-active-trip .avm-trip-slot-dot {
            background: #10b981;
        }

.avm-pickup-choice-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.avm-pickup-choice.is-compact .avm-pickup-choice-title {
    font-size: calc(12px * var(--avm-font-scale));
}

.avm-pickup-choice.is-compact .avm-pickup-choice-note {
    font-size: calc(10.5px * var(--avm-font-scale));
}

/* Barcodes take the width they need and the timings sit beside them, so a long sample list
   does not push the fields out of view. When no timings are asked for the column collapses. */
.avm-pickup-arrange {
    align-items: start;
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: minmax(0, 1fr) auto;
}

.avm-pickup-samples {
    min-width: 0;
}

    .avm-pickup-samples .avm-pickup-chips {
        max-height: 15rem;
        overflow: auto;
    }

.avm-pickup-times {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    width: 15rem;
}

@media (max-width: 620px) {
    .avm-pickup-arrange {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-pickup-times {
        width: auto;
    }
}

.avm-pickup-charge {
    background: var(--brand-soft);
    border-left: 3px solid var(--brand-mid);
    border-radius: var(--r-sm);
    color: var(--ink-2);
    display: grid;
    font-size: calc(11.5px * var(--avm-font-scale));
    gap: 7px;
    margin: 0;
    padding: var(--sp-3);
}

/* The figure is what the decision turns on, so it is lifted out of the sentence. */
.avm-pickup-amount {
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
}

    .avm-pickup-amount.is-free {
        color: var(--green);
    }

.avm-pickup-charge.is-free {
    background: rgba(5, 150, 105, .1);
    border-left-color: var(--green);
}

@media (max-width: 1100px) {
    .avm-pickup-board {
        align-items: start;
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 899px) {
    .avm-pickup-bar {
        left: 0;
    }
}

@media (max-width: 620px) {
    .avm-pickup-bar {
        align-items: stretch;
        flex-direction: column;
        gap: var(--sp-2);
    }

    .avm-pickup-bar-actions {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-pickup-bar,
    :root:not([data-motion="full"]) .avm-pickup-bar-line {
        animation: none;
    }

    :root:not([data-motion="full"]) .avm-pickup-head-line {
        transform: scaleX(1);
    }
}

/* A count of samples nobody has sent yet, so it reads as a warning rather than a decoration. */
.avm-nav-badge,
.avm-dot-badge {
    align-items: center;
    background: var(--red);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    height: 1.15rem;
    justify-content: center;
    line-height: 1;
    min-width: 1.15rem;
    padding: 0 3px;
}

.avm-nav-badge {
    margin-left: auto;
}

.avm-pickup-shortcut {
    overflow: visible;
    position: relative;
}

.avm-dot-badge {
    box-shadow: 0 0 0 2px var(--brand);
    position: absolute;
    right: -2px;
    top: -2px;
}

.avm-pickup-shortcut svg {
    animation: avmPickupNudge 4s ease-in-out infinite;
}

@keyframes avmPickupNudge {
    0%, 82%, 100% {
        transform: translateX(0);
    }

    88% {
        transform: translateX(-2px);
    }

    94% {
        transform: translateX(2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="full"]) .avm-pickup-shortcut svg {
        animation: none;
    }
}

/* The day-wide minimum reads like the patient headroom bar the reader already knows: what the
   day has billed so far against what it has to reach, with the same moving fill so the eye
   lands on it. The panel carries the full explanation; the strip is the one-line form. */
.avm-mcb {
    background: linear-gradient(135deg, rgba(255, 247, 237, .98), rgba(255, 241, 242, .85));
    border: 1px solid rgba(217, 119, 6, .22);
    border-left: 4px solid var(--amber);
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: var(--sp-3);
    padding: var(--sp-3);
}

.avm-mcb-title,
.avm-mcb-strip-label {
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .05em;
    margin: 0;
    text-transform: uppercase;
}

/* The amounts carry the decision, so they are lifted out of the sentence around them. */
.avm-mcb-main {
    color: var(--ink-2);
    font-size: calc(12px * var(--avm-font-scale));
    line-height: 1.6;
    margin: 0;
}

.avm-mcb-facts {
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
    margin: 0;
}

.avm-mcb-main strong {
    color: var(--amber-ink, #b45309);
    font-family: var(--font-num);
    font-size: calc(15px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: 0;
}

.avm-mcb.is-met {
    background: linear-gradient(135deg, rgba(236, 253, 245, .98), rgba(240, 253, 250, .9));
    border-color: rgba(5, 150, 105, .24);
    border-left-color: var(--green);
}

    .avm-mcb.is-met .avm-mcb-main strong,
    .avm-mcb.is-met .avm-mcb-facts {
        color: var(--green);
    }

.avm-mcb-track {
    background: rgba(148, 163, 184, .28);
    border-radius: var(--r-pill);
    display: block;
    height: 10px;
    overflow: hidden;
    position: relative;
}

.avm-mcb-fill {
    animation: avm-headroom-flow 4.2s ease-in-out infinite, avm-headroom-pulse 3.2s ease-in-out infinite;
    background: linear-gradient(90deg, #d97706, #f59e0b, #fbbf24, #d97706);
    background-size: 220% 100%;
    border-radius: inherit;
    display: block;
    height: 100%;
    overflow: hidden;
    position: relative;
    transition: width .45s cubic-bezier(.2, .8, .2, 1);
}

    .avm-mcb-fill::before {
        animation: avm-headroom-stripes 1.6s linear infinite;
        background-image: repeating-linear-gradient( 118deg, rgba(255, 255, 255, .34) 0 9px, rgba(255, 255, 255, 0) 9px 20px);
        background-size: 20px 100%;
        content: "";
        inset: 0;
        position: absolute;
    }

    .avm-mcb-fill::after {
        animation: avm-headroom-shine 2.2s linear infinite;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .92), transparent);
        content: "";
        inset: 0 auto 0 0;
        position: absolute;
        transform: translateX(-130%) skewX(-18deg);
        width: 48%;
    }

/* The rule underneath stays plain on purpose - only the figures above are highlighted. */
.avm-mcb-note {
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
    line-height: 1.55;
    margin: 0;
}

.avm-mcb-strip {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.avm-mcb-strip-head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.avm-mcb-strip-value {
    color: var(--ink);
    font-family: var(--font-num);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-mcb-strip-note {
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
    line-height: 1.5;
}

    .avm-mcb-strip-note strong {
        color: var(--amber-ink, #b45309);
        font-family: var(--font-num);
    }

.avm-mcb-strip.is-met .avm-mcb-fill,
.avm-mcb.is-met .avm-mcb-fill {
    background: linear-gradient(90deg, #059669, #10b981, #34d399, #059669);
    background-size: 220% 100%;
}

.avm-mcb-strip.is-met .avm-mcb-strip-note,
.avm-mcb-strip.is-met .avm-mcb-strip-note strong {
    color: var(--green);
}

/* On the confirmation header the strip sits on the brand gradient, so it carries its own
   light palette rather than the page one. */
.avm-mcb-strip.is-onbrand {
    background: rgba(255, 255, 255, .14);
    border-radius: var(--r-sm);
    margin-top: 7px;
    padding: 7px 10px;
}

    .avm-mcb-strip.is-onbrand .avm-mcb-strip-label {
        color: rgba(255, 255, 255, .78);
    }

    .avm-mcb-strip.is-onbrand .avm-mcb-strip-value {
        color: #fff;
    }

    .avm-mcb-strip.is-onbrand .avm-mcb-strip-note {
        color: rgba(255, 255, 255, .82);
    }

        .avm-mcb-strip.is-onbrand .avm-mcb-strip-note strong {
            color: #fff;
        }

    .avm-mcb-strip.is-onbrand .avm-mcb-track {
        background: rgba(255, 255, 255, .24);
        height: 8px;
    }

    .avm-mcb-strip.is-onbrand .avm-mcb-fill {
        background: linear-gradient(90deg, #fde68a, #fbbf24, #fff, #fde68a);
        background-size: 220% 100%;
    }

    .avm-mcb-strip.is-onbrand.is-met .avm-mcb-fill {
        background: linear-gradient(90deg, #86efac, #34d399, #fff, #86efac);
        background-size: 220% 100%;
    }

/* On the order board the strip only reports, so it lies flat across one row rather than
   stacking a panel's worth of explanation the reader cannot act on from there. */
.avm-order-consignment {
    padding: var(--sp-3) var(--sp-4);
}

.avm-mcb-strip.is-inline {
    align-items: center;
    display: grid;
    gap: var(--sp-2) var(--sp-4);
    grid-template-columns: minmax(11rem, auto) minmax(6rem, 1fr) minmax(12rem, auto);
}

    .avm-mcb-strip.is-inline .avm-mcb-strip-head {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

@media (max-width: 720px) {
    .avm-mcb-strip.is-inline {
        grid-template-columns: 1fr;
    }

    .avm-pickup-bar {
        grid-template-columns: 1fr;
    }

    .avm-pickup-bar-charge {
        grid-column: 1;
    }

    .avm-pickup-bar-actions {
        grid-column: 1;
    }
}

/* A flat tag reads as a fact ("no extra charge" / "X payable"), never as a saving, so a
   client is never told they "saved" money on something that was never going to cost anything. */
.avm-pickup-chc-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avm-pickup-chc-tag {
    background: var(--brand-soft);
    border-radius: var(--r-pill);
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    padding: 3px 10px;
    white-space: nowrap;
}

    .avm-pickup-chc-tag.is-free {
        background: rgba(5, 150, 105, .12);
        color: var(--green);
    }

.avm-pickup-request-total {
    color: var(--ink-2);
    font-family: var(--font-num);
    font-size: calc(11.5px * var(--avm-font-scale));
    margin: 4px 0 0;
}

/* ==========================================================================
   Sample Pickup & Live 6-Stage Tracking Timeline (Compact 2026 Edition)
   ========================================================================== */

.avm-pickup-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.avm-pickup-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.avm-pickup-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all .2s cubic-bezier(.16, 1, .3, 1);
    white-space: nowrap;
}

    .avm-pickup-tab svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

    .avm-pickup-tab:hover {
        color: #1e293b;
    }

    .avm-pickup-tab.is-active {
        background: #ffffff;
        color: #0f172a;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
    }

.avm-pickup-tab-badge {
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.3;
}

.avm-pickup-tab-live-tag {
    background: #dcfce7;
    color: #15803d;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 5px;
    letter-spacing: .5px;
}

.avm-live-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .7);
    animation: avmRadarPulse 1.8s infinite;
    flex-shrink: 0;
}

@keyframes avmRadarPulse {
    0% {
        transform: scale(.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Header Controls on Right side of Toggle */
.avm-pickup-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.avm-pickup-header-search {
    position: relative;
    display: flex;
    align-items: center;
}

    .avm-pickup-header-search svg {
        position: absolute;
        left: 10px;
        width: 14px;
        height: 14px;
        fill: #94a3b8;
        pointer-events: none;
    }

.avm-header-search-input {
    height: 34px;
    padding: 0 10px 0 30px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 12.5px;
    color: #0f172a;
    width: 260px;
    transition: all .2s;
    outline: none;
}

    .avm-header-search-input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
        width: 290px;
    }

.avm-header-select {
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    outline: none;
}

    .avm-header-select:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
    }

.avm-header-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all .15s;
    outline: none;
}

    .avm-header-btn svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
        transition: transform .3s;
    }

    .avm-header-btn:hover {
        background: #f8fafc;
        border-color: #94a3b8;
        color: #0f172a;
    }

    .avm-header-btn.is-loading svg {
        animation: avmSpin .8s linear infinite;
    }

@keyframes avmSpin {
    100% {
        transform: rotate(360deg);
    }
}

/* History Cards */
.avm-pickup-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.avm-history-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
    transition: all .2s ease;
}

    .avm-history-card:hover {
        box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
        border-color: #cbd5e1;
    }

    .avm-history-card.is-cancelled {
        background: #fffafa;
        border-color: #fecaca;
    }

.avm-history-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.avm-history-head-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.avm-history-id-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avm-history-id-num {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    font-family: var(--font-num, inherit);
}

.avm-history-type-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #475569;
}

.avm-history-meta-dates {
    font-size: 12px;
    color: #64748b;
}

.avm-history-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

    .avm-history-status-pill.is-active {
        background: #eff6ff;
        color: #1d4ed8;
        border: 1px solid #bfdbfe;
    }

    .avm-history-status-pill.is-completed {
        background: #ecfdf5;
        color: #047857;
        border: 1px solid #a7f3d0;
    }

    .avm-history-status-pill.is-cancelled {
        background: #fef2f2;
        color: #b91c1c;
        border: 1px solid #fecaca;
    }

/* LME Rider Strip */
.avm-history-rider-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.avm-history-rider-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avm-rider-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
}

    .avm-rider-avatar svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

.avm-rider-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #94a3b8;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.avm-rider-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.avm-rider-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 6px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
}

    .avm-rider-call-btn svg {
        width: 13px;
        height: 13px;
        fill: currentColor;
    }

    .avm-rider-call-btn:hover {
        background: #059669;
        color: #ffffff;
        border-color: #059669;
    }

.avm-history-trip-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.avm-trip-chip {
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 5px;
}

    .avm-trip-chip.is-alert {
        background: #fffbeb;
        color: #b45309;
        border-color: #fde68a;
        font-weight: 600;
    }

/* 6-Stage Timeline Stepper */
.avm-history-stepper-wrap {
    margin: 8px 0 14px;
    padding: 0 4px;
}

.avm-history-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    width: 100%;
}

.avm-history-progress-track {
    position: absolute;
    top: 17px;
    left: 4%;
    right: 4%;
    height: 4px;
    background: #e2e8f0;
    z-index: 1;
    border-radius: 2px;
}

.avm-history-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #0284c7 100%);
    border-radius: 2px;
    transition: width .6s cubic-bezier(.16, 1, .3, 1);
}

.avm-timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 16.5%;
}

.avm-timeline-node {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all .3s ease;
}

.avm-timeline-icon svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.avm-timeline-pulse {
    display: none;
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #0284c7;
    opacity: 0;
}

.avm-timeline-label {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avm-timeline-step-title {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    line-height: 1.2;
}

.avm-timeline-step-desc {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
    display: none;
}

@media (min-width: 768px) {
    .avm-timeline-step-desc {
        display: block;
    }
}

.avm-timeline-step.is-complete .avm-timeline-node {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, .3);
}

.avm-timeline-step.is-complete .avm-timeline-step-title {
    color: #047857;
    font-weight: 600;
}

.avm-timeline-step.is-active .avm-timeline-node {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, .2);
    transform: scale(1.08);
}

.avm-timeline-step.is-active .avm-timeline-pulse {
    display: block;
    animation: avmActivePulse 1.8s infinite;
}

.avm-timeline-step.is-active .avm-timeline-step-title {
    color: #0369a1;
    font-weight: 700;
}

@keyframes avmActivePulse {
    0% {
        transform: scale(1);
        opacity: .7;
    }

    70% {
        transform: scale(1.35);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.avm-timeline-step-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 3px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    font-family: var(--font-num, inherit);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.avm-timeline-step.is-complete .avm-timeline-step-time {
    background: #ecfdf5;
    color: #047857;
}

.avm-timeline-step.is-active .avm-timeline-step-time {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
}

.avm-history-card.is-cancelled {
    background: #fff8f8;
    border-color: #fca5a5;
    border-left: 4px solid #ef4444;
}

    .avm-history-card.is-cancelled .avm-history-progress-track {
        background: #fee2e2;
    }

    .avm-history-card.is-cancelled .avm-history-progress-bar {
        background: #ef4444;
    }

.avm-timeline-step.is-cancelled .avm-timeline-node {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.avm-timeline-step.is-cancelled-node .avm-timeline-node {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .2);
}

.avm-timeline-step.is-cancelled-node .avm-timeline-step-title {
    color: #dc2626;
    font-weight: 700;
}

.avm-timeline-step.is-cancelled-node .avm-timeline-step-time {
    background: #fee2e2;
    color: #b91c1c;
}

/* Collapsible Samples */
.avm-history-samples-section {
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
    margin-top: 6px;
}

.avm-history-samples-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 3px 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

    .avm-history-samples-toggle:hover {
        color: #0284c7;
    }

.avm-samples-toggle-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .avm-samples-toggle-left svg {
        width: 15px;
        height: 15px;
        fill: currentColor;
    }

.avm-samples-toggle-chevron svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform .2s;
}

.avm-history-samples-section.is-open .avm-samples-toggle-chevron svg {
    transform: rotate(180deg);
}

.avm-history-samples-body {
    margin-top: 6px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

    .avm-history-samples-body::-webkit-scrollbar {
        width: 6px;
    }

    .avm-history-samples-body::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 3px;
    }

    .avm-history-samples-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }

        .avm-history-samples-body::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

.avm-history-sample-row {
    display: grid;
    grid-template-columns: 20px 120px 1.2fr 90px 1.5fr 110px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #334155;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
}

    .avm-history-sample-row:last-child {
        border-bottom: none;
    }

.avm-history-sample-num {
    font-weight: 700;
    color: #94a3b8;
    font-size: 11px;
}

.avm-history-sample-patient {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avm-history-sample-type {
    color: #64748b;
    font-size: 11.5px;
}

.avm-history-sample-test {
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avm-history-sample-time {
    color: #94a3b8;
    font-size: 11px;
    text-align: right;
}

.avm-history-empty-box {
    text-align: center;
    padding: 36px 20px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    max-width: 560px;
    margin: 20px auto;
}

/* ==========================================================================
   Rechecking Features (SSR & SPR)
   ========================================================================== */

.avm-recheck-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.avm-recheck-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.avm-recheck-search-box {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

.avm-recheck-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #d1d9e3;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0 14px;
    height: 48px;
}

    .avm-recheck-input-wrap:focus-within {
        border-color: #2c3e7a;
        box-shadow: 0 0 0 3px rgba(44, 62, 122, 0.15);
    }

    .avm-recheck-input-wrap .avm-search-icon-affix {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #64748b;
        flex-shrink: 0;
        margin-right: 10px;
    }

.avm-recheck-barcode-input {
    flex: 1;
    height: 100%;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    outline: none;
    color: #0f172a;
    min-width: 0;
}

    .avm-recheck-barcode-input::placeholder {
        color: #94a3b8;
        font-weight: 400;
    }

.avm-recheck-search-btn {
    height: 48px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

    .avm-recheck-search-btn .avm-submit-spinner {
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255, 255, 255, 0.35);
        border-top-color: #ffffff;
        border-radius: 50%;
        animation: avm-spin 0.6s linear infinite;
        display: none;
        flex-shrink: 0;
    }

    .avm-recheck-search-btn.is-loading {
        opacity: 0.88;
        cursor: wait;
        pointer-events: none;
    }

        .avm-recheck-search-btn.is-loading .avm-submit-spinner {
            display: inline-block;
        }

        .avm-recheck-search-btn.is-loading .avm-search-btn-icon {
            display: none;
        }

.avm-recheck-banner {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}

    .avm-recheck-banner.is-error {
        background: #fef2f2;
        border: 1px solid #fecaca;
        border-left: 4px solid #dc2626;
        color: #b91c1c;
    }

    .avm-recheck-banner.is-success {
        background: #ecfdf5;
        border: 1px solid #a7f3d0;
        border-left: 4px solid #059669;
        color: #065f46;
    }

.avm-recheck-banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Patient card facts */
.avm-recheck-facts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 12px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .avm-recheck-facts-grid {
        grid-template-columns: 1fr;
    }
}

.avm-recheck-fact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .avm-recheck-fact.is-wide {
        grid-column: 1 / -1;
    }

.avm-fact-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.avm-fact-value {
    font-size: 14px;
    color: #0f172a;
    word-break: break-word;
}

/* Summary bar */
.avm-recheck-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f1f5f9;
    border-radius: 10px;
    margin-top: 16px;
    border: 1px solid #e2e8f0;
}

.avm-recheck-summary-amount {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.avm-summary-label {
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
}

.avm-summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e7a;
}

    .avm-summary-value.is-free {
        color: #059669;
    }

.avm-recheck-submit-btn {
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 8px;
}

/* Tube table */
.avm-tube-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.avm-tube-barcode {
    max-width: 140px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Guidelines card */
/* The guidelines are read once and then in the way, so they fold behind an icon in the panel
   head and the table gets the full width back. Focus opens it too, so it is not hover-only. */
.avm-recheck-guide {
    align-items: center;
    border-radius: 50%;
    color: var(--muted-lt);
    cursor: help;
    display: inline-flex;
    height: 26px;
    justify-content: center;
    position: relative;
    width: 26px;
}

    .avm-recheck-guide:hover,
    .avm-recheck-guide:focus,
    .avm-recheck-guide:focus-within {
        background: #eef4ff;
        color: var(--brand-mid);
        outline: none;
    }

.avm-recheck-guide-pop {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(19, 45, 82, .16);
    opacity: 0;
    padding: 18px;
    pointer-events: none;
    position: absolute;
    right: 0;
    text-align: left;
    top: calc(100% + 10px);
    transform: translateY(-4px);
    transition: opacity .16s ease, transform .16s ease;
    width: min(420px, calc(100vw - 32px));
    z-index: 140;
}

.avm-recheck-guide:hover .avm-recheck-guide-pop,
.avm-recheck-guide:focus .avm-recheck-guide-pop,
.avm-recheck-guide:focus-within .avm-recheck-guide-pop {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.avm-recheck-guide-pop .avm-rules-head {
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.avm-rules-head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e7a;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 14px;
}

    .avm-rules-head h4 {
        margin: 0;
        font-size: 15px;
        font-weight: 700;
    }

.avm-rules-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .avm-rules-list li {
        font-size: 12.5px;
        color: #475569;
        line-height: 1.5;
    }

        .avm-rules-list li strong {
            color: #1e293b;
        }

/* ── Vlogue ─────────────────────────────────────────────────────────────────
   Two lanes on one bar: what the lab asked you, and what you asked the lab. The list
   reads like an inbox, one ticket per row. Opening one slides a drawer in from the right,
   so the list stays where it was and closing puts you back on it. Raising a ticket is
   two steps in the same drawer: who it is for, then what it says. */

/* ---- the bar ---- */

/* Five category hues, one per team the ticket routes to. Set on the card, the tile and the
   chosen-chip alike, so a ticket keeps its colour from the list into the drawer. */
.avm-vlogue [data-avm-hue="1"], .avm-vlogue-drawer [data-avm-hue="1"] {
    --hue-a: #00b894;
    --hue-b: #55d6ac;
    --hue-soft: #e8faf4;
}

.avm-vlogue [data-avm-hue="2"], .avm-vlogue-drawer [data-avm-hue="2"] {
    --hue-a: #3d5afe;
    --hue-b: #7c9bff;
    --hue-soft: #eceffe;
}

.avm-vlogue [data-avm-hue="3"], .avm-vlogue-drawer [data-avm-hue="3"] {
    --hue-a: #8e44ec;
    --hue-b: #c07dff;
    --hue-soft: #f4ecfe;
}

.avm-vlogue [data-avm-hue="4"], .avm-vlogue-drawer [data-avm-hue="4"] {
    --hue-a: #ff6b4a;
    --hue-b: #ff9770;
    --hue-soft: #fff0ec;
}

.avm-vlogue [data-avm-hue="5"], .avm-vlogue-drawer [data-avm-hue="5"] {
    --hue-a: #ff3d8b;
    --hue-b: #ff7fb0;
    --hue-soft: #ffecf3;
}

.avm-vlogue-bar {
    align-items: center;
    background: linear-gradient(120deg, var(--brand-mid) 0%, var(--brand) 60%, #22315f 100%);
    border: 0;
    box-shadow: 0 8px 24px rgba(44, 62, 122, .22);
    border-radius: var(--r-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
    margin-bottom: var(--sp-2);
    padding: 8px 10px;
}

.avm-vlogue-lanes {
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    display: inline-flex;
    gap: 2px;
    padding: 3px;
}

.avm-vlogue-lane {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: rgba(255, 255, 255, .78);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 600;
    gap: 6px;
    line-height: 1;
    padding: 7px 12px;
    position: relative;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
    white-space: nowrap;
}

    .avm-vlogue-lane svg {
        height: 14px;
        width: 14px;
    }

    .avm-vlogue-lane:hover {
        color: #fff;
    }

    .avm-vlogue-lane:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .avm-vlogue-lane.is-active {
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
        color: var(--brand);
    }

/* The count is what still needs the client, not the total: a closed ticket needs nothing. */
.avm-vlogue-lane-count {
    background: var(--avm-accent);
    border-radius: 999px;
    color: #fff;
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    padding: 3px 6px;
    text-align: center;
}

.avm-vlogue-tools {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: flex-end;
    min-width: 0;
}

.avm-vlogue-tool {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    min-width: 0;
}

.avm-vlogue-tool-dash {
    color: rgba(255, 255, 255, .62);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 0 -2px;
}

.avm-vlogue-tool .avm-input {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .22);
    color: #fff;
    color-scheme: dark;
    height: 34px;
    min-height: 34px;
    padding-bottom: 0;
    padding-top: 0;
}

    .avm-vlogue-tool .avm-input::placeholder {
        color: rgba(255, 255, 255, .62);
    }

    .avm-vlogue-tool .avm-input:hover {
        background: rgba(255, 255, 255, .2);
        border-color: rgba(255, 255, 255, .34);
    }

    .avm-vlogue-tool .avm-input:focus {
        background: rgba(255, 255, 255, .22);
        border-color: #fff;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
        outline: none;
    }

/* The dropdown list itself is drawn by the browser: dark scheme makes it readable. */
.avm-vlogue-tool select option {
    background: var(--brand);
    color: #fff;
}

.avm-vlogue-tool input[type="date"] {
    width: 9.2rem;
}

.avm-vlogue-tool select {
    width: 7rem;
}

.avm-vlogue-tool.is-search {
    position: relative;
}

    .avm-vlogue-tool.is-search svg {
        color: rgba(255, 255, 255, .72);
        height: 15px;
        left: 10px;
        pointer-events: none;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 15px;
    }

    .avm-vlogue-tool.is-search .avm-input {
        padding-left: 31px;
        width: 15rem;
    }

.avm-vlogue-raise {
    background: #fff;
    border: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
    color: var(--brand);
    height: 34px;
    padding-left: 14px;
    padding-right: 16px;
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
    white-space: nowrap;
}

    .avm-vlogue-raise:hover {
        background: #fff;
        box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
        color: var(--brand-mid);
        transform: translateY(-1px);
    }

    .avm-vlogue-raise:active {
        transform: translateY(0);
    }

/* ---- the list: a grid of cards, four across, each in its team's colour ---- */

.avm-vlogue-board {
    background: transparent;
    border: 0;
}

.avm-vlogue-list {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.avm-vlogue-card {
    background: linear-gradient(135deg, var(--hue-a, var(--brand-mid)), var(--hue-b, var(--brand)));
    border: 0;
    border-radius: 16px;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--hue-a, var(--brand-mid)) 28%, transparent);
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 150px;
    overflow: hidden;
    padding: 16px 18px 14px;
    position: relative;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease;
}

    /* The soft disc in the corner, as in the reference. */
    .avm-vlogue-card::after {
        background: rgba(255, 255, 255, .13);
        border-radius: 50%;
        bottom: -34px;
        content: "";
        height: 130px;
        position: absolute;
        right: -34px;
        width: 130px;
    }

    .avm-vlogue-card:hover {
        box-shadow: 0 16px 34px color-mix(in srgb, var(--hue-a, var(--brand-mid)) 40%, transparent);
        transform: translateY(-4px);
    }

    .avm-vlogue-card:focus-visible {
        box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--hue-a, var(--brand-mid));
        outline: none;
    }

    .avm-vlogue-card > * {
        position: relative;
        z-index: 1;
    }

.avm-vlogue-card-head {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.avm-vlogue-card-icon {
    align-items: center;
    background: rgba(255, 255, 255, .22);
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    height: 34px;
    justify-content: center;
    width: 34px;
}

    .avm-vlogue-card-icon svg {
        height: 18px;
        width: 18px;
    }

.avm-vlogue-card-cat {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    flex: 1 1 auto;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .04em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.avm-vlogue-card-text {
    color: #fff;
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .22);
    white-space: nowrap;
}

.avm-vlogue-card-from {
    color: rgba(255, 255, 255, .8);
    font-size: calc(10.5px * var(--avm-font-scale));
    margin: -6px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-vlogue-card-foot {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, .22);
    display: flex;
    gap: 8px;
    margin-top: auto;
    min-width: 0;
    padding-top: 10px;
}

.avm-vlogue-no {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-vlogue-no {
    color: rgba(255, 255, 255, .95);
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-vlogue-card-time {
    color: rgba(255, 255, 255, .82);
    font-family: var(--font-num);
    font-size: calc(10.5px * var(--avm-font-scale));
    margin-left: auto;
    white-space: nowrap;
}

.avm-vlogue-card-clip {
    color: rgba(255, 255, 255, .85);
    flex-shrink: 0;
    height: 13px;
    width: 13px;
}

.avm-vlogue-card-cta {
    align-items: center;
    color: #fff;
    display: inline-flex;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 1px;
    opacity: 0;
    transition: opacity .14s ease;
}

    .avm-vlogue-card-cta svg {
        height: 13px;
        width: 13px;
    }

.avm-vlogue-card:hover .avm-vlogue-card-cta,
.avm-vlogue-card:focus-visible .avm-vlogue-card-cta {
    opacity: 1;
}

/* The pill is the one thing on the card that is not the team's colour: it is the state. On
   the coloured card it sits on frosted white; in the drawer head it uses its own tint. */
.avm-vlogue-pill {
    border-radius: 999px;
    flex-shrink: 0;
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1;
    padding: 5px 9px;
    text-transform: uppercase;
    white-space: nowrap;
}

.avm-vlogue-card .avm-vlogue-pill {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, .92);
}

.avm-vlogue-pill.is-open {
    color: #b45309;
}

.avm-vlogue-pill.is-done {
    color: #047857;
}

.avm-vlogue-pill.is-waiting {
    color: #1e3a8a;
}

.avm-vlogue-drawer .avm-vlogue-pill.is-open {
    background: #fef3c7;
}

.avm-vlogue-drawer .avm-vlogue-pill.is-done {
    background: #d1fae5;
}

.avm-vlogue-drawer .avm-vlogue-pill.is-waiting {
    background: #e0e7ff;
}

/* Answered cards step back so the ones still moving stand forward. */
.avm-vlogue-card.is-done {
    filter: saturate(.72);
    opacity: .92;
}

    .avm-vlogue-card.is-done:hover {
        filter: none;
        opacity: 1;
    }

.avm-vlogue-empty {
    background: #ffffff;
    border: 1px dashed var(--line);
    border-radius: 16px;
    margin: 0;
    padding: 44px var(--sp-4);
}

.avm-vlogue-skeleton {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

    .avm-vlogue-skeleton span {
        background: linear-gradient(90deg, var(--line-soft) 25%, #fff 50%, var(--line-soft) 75%);
        background-size: 200% 100%;
        border-radius: 16px;
        display: block;
        height: 150px;
    }

    .avm-vlogue-skeleton.is-drawer {
        display: flex;
        flex-direction: column;
    }

        .avm-vlogue-skeleton.is-drawer span {
            height: 88px;
        }

/* ---- the drawer ---- */

.avm-vlogue-drawer-backdrop {
    background: rgba(15, 23, 42, 0);
    inset: 0;
    position: fixed;
    transition: background .22s ease;
    z-index: 1200;
}

    .avm-vlogue-drawer-backdrop.is-open {
        background: rgba(15, 23, 42, .42);
    }

.avm-vlogue-drawer {
    background: var(--card);
    box-shadow: -18px 0 48px rgba(15, 23, 42, .22);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    position: absolute;
    right: 0;
    top: 0;
    transform: translateX(100%);
    transition: transform .22s cubic-bezier(.22, 1, .36, 1);
    width: min(520px, 100vw);
}

.avm-vlogue-drawer-backdrop.is-open .avm-vlogue-drawer {
    transform: translateX(0);
}

.avm-vlogue-drawer-head {
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, var(--brand-soft) 100%);
    border-bottom: 1px solid #dbe4ff;
    display: flex;
    gap: var(--sp-2);
    padding: 12px 14px 12px 16px;
}

.avm-vlogue-drawer-back {
    align-items: center;
    background: var(--line-soft);
    border: 0;
    border-radius: 50%;
    color: var(--ink-2);
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    height: 30px;
    justify-content: center;
    width: 30px;
}

    .avm-vlogue-drawer-back svg {
        height: 18px;
        width: 18px;
    }

    .avm-vlogue-drawer-back:hover {
        background: var(--brand-soft);
        color: var(--brand);
    }

.avm-vlogue-drawer-heading {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: var(--sp-2);
    min-width: 0;
}

.avm-vlogue-drawer-title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(15px * var(--avm-font-scale));
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-vlogue-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--sp-4);
}

.avm-vlogue-drawer-foot {
    border-top: 1px solid var(--line);
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
    padding: 12px var(--sp-4);
}

/* ---- raise: two steps sliding past each other ---- */

.avm-vlogue-steps {
    overflow: hidden;
    position: relative;
}

.avm-vlogue-step {
    display: none;
}

    .avm-vlogue-step.is-current {
        animation: avmVlogueStep .24s cubic-bezier(.22, 1, .36, 1) both;
        display: flex;
        flex-direction: column;
        gap: var(--sp-3);
    }

@keyframes avmVlogueStep {
    from {
        opacity: 0;
        transform: translateX(28px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.avm-vlogue-step-lead {
    color: var(--ink);
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 600;
    margin: 0;
}

.avm-vlogue-cats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avm-vlogue-cat {
    align-items: center;
    background: radial-gradient(120% 100% at 100% 50%, var(--hue-soft, var(--brand-soft)) 0%, transparent 60%), #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    gap: 12px;
    padding: 10px 12px;
    text-align: left;
    transition: border-color .14s ease, background .14s ease, transform .14s ease;
}

    .avm-vlogue-cat:hover,
    .avm-vlogue-cat:focus-visible {
        border-color: var(--hue-b, var(--brand-mid));
        box-shadow: 0 8px 20px color-mix(in srgb, var(--hue-a, var(--brand-mid)) 18%, transparent);
        outline: none;
        transform: translateX(3px);
    }

.avm-vlogue-cat-icon {
    align-items: center;
    background: linear-gradient(135deg, var(--hue-a, var(--brand-mid)), var(--hue-b, var(--brand-soft)));
    border-radius: 10px;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--hue-a, var(--brand-mid)) 30%, transparent);
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    height: 38px;
    justify-content: center;
    width: 38px;
}

    .avm-vlogue-cat-icon svg {
        height: 20px;
        width: 20px;
    }

    .avm-vlogue-cat-icon.is-small {
        border-radius: 8px;
        height: 30px;
        width: 30px;
    }

        .avm-vlogue-cat-icon.is-small svg {
            height: 16px;
            width: 16px;
        }

.avm-vlogue-cat-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.avm-vlogue-cat-name {
    color: var(--ink);
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 600;
}

.avm-vlogue-cat-hint {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
}

.avm-vlogue-cat-go {
    color: var(--muted);
    flex-shrink: 0;
    height: 18px;
    width: 18px;
}

.avm-vlogue-cat:hover .avm-vlogue-cat-go {
    color: var(--hue-a, var(--brand));
}

/* The choice made, shown as a chip you can change without going back through the list. */
.avm-vlogue-chosen {
    align-items: center;
    background: var(--hue-soft, var(--brand-soft));
    border: 1px solid transparent;
    border-radius: var(--r-md);
    cursor: pointer;
    display: flex;
    font-family: inherit;
    gap: 10px;
    padding: 8px 10px;
    text-align: left;
}

    .avm-vlogue-chosen:hover {
        border-color: var(--hue-b, var(--brand-mid));
    }

.avm-vlogue-chosen-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.avm-vlogue-chosen-label {
    color: var(--muted);
    font-size: calc(10px * var(--avm-font-scale));
    letter-spacing: .04em;
    text-transform: uppercase;
}

.avm-vlogue-chosen-name {
    color: var(--hue-a, var(--brand));
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-vlogue-chosen-change {
    color: var(--brand-mid);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    text-decoration: underline;
}

/* ---- a ticket ---- */

.avm-vlogue-thread {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.avm-vlogue-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    margin: 0;
}

    .avm-vlogue-meta > div {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .avm-vlogue-meta dt {
        color: var(--muted);
        font-size: calc(10px * var(--avm-font-scale));
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .avm-vlogue-meta dd {
        color: var(--ink);
        font-size: calc(12.5px * var(--avm-font-scale));
        font-weight: 600;
        margin: 0;
    }

.avm-vlogue-bubble {
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 92%;
    padding: 10px 12px;
}

    .avm-vlogue-bubble p {
        color: var(--ink-2);
        font-size: calc(12.5px * var(--avm-font-scale));
        line-height: 1.5;
        margin: 0;
        white-space: pre-wrap;
        word-break: break-word;
    }

.avm-vlogue-bubble-who {
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-vlogue-bubble-when {
    color: var(--muted);
    font-family: var(--font-num);
    font-size: calc(10px * var(--avm-font-scale));
}

.avm-vlogue-bubble.is-them {
    align-self: flex-start;
    background: var(--line-soft);
    border-bottom-left-radius: 4px;
}

    .avm-vlogue-bubble.is-them .avm-vlogue-bubble-who {
        color: var(--ink);
    }

.avm-vlogue-bubble.is-us {
    align-self: flex-end;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-bottom-right-radius: 4px;
}

    .avm-vlogue-bubble.is-us .avm-vlogue-bubble-who {
        color: var(--brand);
    }

.avm-vlogue-attach-link {
    align-items: center;
    color: var(--brand-mid);
    display: inline-flex;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    gap: 4px;
    text-decoration: none;
}

    .avm-vlogue-attach-link:hover {
        text-decoration: underline;
    }

.avm-vlogue-compose {
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
}

.avm-vlogue-once {
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--r-sm);
    color: #92400e;
    display: flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    gap: var(--sp-2);
    line-height: 1.45;
    margin: 0;
    padding: 9px 11px;
}

    .avm-vlogue-once svg {
        flex-shrink: 0;
        margin-top: 1px;
    }

.avm-vlogue-textarea {
    font-family: inherit;
    min-height: 7rem;
    resize: vertical;
}

.avm-vlogue-attach {
    align-items: center;
    border: 1px dashed var(--line);
    border-radius: var(--r-sm);
    color: var(--brand-mid);
    cursor: pointer;
    display: flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    gap: var(--sp-2);
    padding: 10px 12px;
    transition: border-color .14s ease, background .14s ease;
}

    .avm-vlogue-attach:hover {
        background: var(--brand-soft);
        border-color: var(--brand-mid);
    }

    .avm-vlogue-attach.has-file {
        background: var(--mint);
        border-color: #6ee7b7;
        border-style: solid;
        color: #047857;
    }

body.avm-vlogue-locked {
    overflow: hidden;
}

/* ---- motion ---- */

.avm-vlogue-reveal {
    animation: avmVlogueReveal .28s cubic-bezier(.22, 1, .36, 1) backwards;
}

    .avm-vlogue-reveal:nth-child(1) {
        animation-delay: .04s;
    }

    .avm-vlogue-reveal:nth-child(2) {
        animation-delay: .09s;
    }

    .avm-vlogue-reveal:nth-child(3) {
        animation-delay: .14s;
    }

    .avm-vlogue-reveal:nth-child(4) {
        animation-delay: .19s;
    }

@keyframes avmVlogueReveal {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes avmVlogueShimmer {
    from {
        background-position: 100% 50%;
    }

    to {
        background-position: 0 50%;
    }
}

@media (prefers-reduced-motion: no-preference) {
    :root[data-motion="full"] .avm-vlogue-card {
        animation: avmVlogueReveal .26s cubic-bezier(.22, 1, .36, 1) backwards;
        animation-delay: calc(var(--avm-row-index, 0) * 24ms);
    }

    :root[data-motion="full"] .avm-vlogue-skeleton span {
        animation: avmVlogueShimmer 1.3s ease-in-out infinite;
    }
}

:root:not([data-motion="full"]) .avm-vlogue-reveal,
:root:not([data-motion="full"]) .avm-vlogue-card,
:root:not([data-motion="full"]) .avm-vlogue-step.is-current,
:root:not([data-motion="full"]) .avm-vlogue-skeleton span {
    animation: none;
}

:root:not([data-motion="full"]) .avm-vlogue-drawer,
:root:not([data-motion="full"]) .avm-vlogue-drawer-backdrop {
    transition: none;
}

/* ---- narrow ---- */

@media (max-width: 900px) {
    .avm-vlogue-tools {
        justify-content: flex-start;
    }

    .avm-vlogue-tool.is-search {
        flex: 1 1 100%;
    }

        .avm-vlogue-tool.is-search .avm-input {
            width: 100%;
        }

    .avm-vlogue-raise {
        flex: 1 1 100%;
    }
}

@media (max-width: 1280px) {
    .avm-vlogue-list,
    .avm-vlogue-skeleton {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .avm-vlogue-list,
    .avm-vlogue-skeleton {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .avm-vlogue-list,
    .avm-vlogue-skeleton {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-vlogue-card-cta {
        opacity: 1;
    }

    .avm-vlogue-bubble {
        max-width: 100%;
    }
}


/* ── Pay now ────────────────────────────────────────────────────────────────
   One page for Indian clients: how much is owed, the account to pay it into, and
   the three steps that get the credit onto their balance. Every field is one click
   to copy, because the client is about to type it into a bank form. */

.avm-pay {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

/* ---- the amount ---- */

.avm-pay-hero {
    align-items: center;
    background: radial-gradient(90% 160% at 100% 0%, rgba(0, 191, 166, .28), transparent 55%), radial-gradient(70% 140% at 0% 100%, rgba(124, 58, 237, .22), transparent 55%), linear-gradient(120deg, var(--navy-700) 0%, var(--navy-800) 55%, var(--navy-900) 100%);
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .2);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    justify-content: space-between;
    overflow: hidden;
    padding: 12px 20px;
    position: relative;
}

.avm-pay-hero-copy {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.avm-pay-eyebrow {
    color: rgba(255, 255, 255, .72);
    display: block;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.avm-pay-amount {
    font-family: var(--font-num);
    font-size: calc(28px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1;
    margin: 0;
}

.avm-pay-hero-side {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.avm-pay-standing {
    color: rgba(255, 255, 255, .82);
    font-size: calc(12.5px * var(--avm-font-scale));
}

    .avm-pay-standing strong {
        color: #fff;
        font-family: var(--font-num);
    }

.avm-pay-currency {
    color: rgba(255, 255, 255, .7);
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 600;
    margin-right: 2px;
    vertical-align: middle;
}

.avm-pay-overdue {
    background: rgba(251, 191, 36, .18);
    border: 1px solid rgba(251, 191, 36, .45);
    border-radius: 999px;
    color: #fde68a;
    display: inline-block;
    font-family: var(--font-num);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    padding: 4px 10px;
    white-space: nowrap;
}

/* ---- the two cards ---- */

.avm-pay-grid {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    margin-bottom: var(--sp-3);
}

.avm-pay-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    overflow: hidden;
    padding: 18px 20px 20px;
    position: relative;
}

    .avm-pay-card::before {
        background: linear-gradient(90deg, #3a52a0, #00bfa6);
        content: "";
        height: 4px;
        inset: 0 0 auto 0;
        position: absolute;
    }

    .avm-pay-card.is-steps::before {
        background: linear-gradient(90deg, #7c3aed, #ec4899, #f59e0b);
    }

.avm-pay-card-head {
    align-items: flex-start;
    display: flex;
    gap: var(--sp-3);
    justify-content: space-between;
}

.avm-pay-card-eyebrow {
    color: var(--muted);
    display: block;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.avm-pay-card-title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(17px * var(--avm-font-scale));
    font-weight: 700;
    margin: 2px 0 0;
}

.avm-pay-bank-badge {
    align-items: center;
    background: linear-gradient(135deg, #7c1d3a, #a3244d);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(163, 36, 77, .28);
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 6px;
    padding: 6px 12px;
    white-space: nowrap;
}

    .avm-pay-bank-badge svg {
        height: 14px;
        width: 14px;
    }

/* ---- the fields ---- */

.avm-pay-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.avm-pay-field {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    display: grid;
    gap: 4px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 14px;
}

    .avm-pay-field.is-primary {
        background: linear-gradient(135deg, #eef2ff 0%, #f0fdfa 100%);
        border-color: #c7d2fe;
    }

    .avm-pay-field dt {
        color: var(--muted);
        font-size: calc(10.5px * var(--avm-font-scale));
        font-weight: 600;
        grid-column: 1;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    .avm-pay-field dd {
        grid-column: 1;
        margin: 0;
        min-width: 0;
    }

.avm-pay-value {
    color: var(--ink);
    display: block;
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 600;
    overflow-wrap: anywhere;
}

.avm-pay-field.is-primary .avm-pay-value {
    color: var(--brand);
    font-size: calc(20px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .04em;
}

.avm-pay-mono {
    font-family: var(--font-num);
}

.avm-pay-copy {
    align-items: center;
    align-self: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--brand-mid);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 6px;
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 7px 12px;
    transition: background .14s ease, color .14s ease, border-color .14s ease, transform .14s ease;
    white-space: nowrap;
}

    .avm-pay-copy svg {
        height: 14px;
        width: 14px;
    }

    .avm-pay-copy:hover {
        background: var(--brand-soft);
        border-color: var(--brand-mid);
        transform: translateY(-1px);
    }

    .avm-pay-copy.is-copied,
    .avm-pay-copy-all.is-copied {
        background: #d1fae5;
        border-color: #34d399;
        color: #065f46;
    }

.avm-pay-copy-all {
    align-items: center;
    background: linear-gradient(135deg, var(--brand-mid), var(--brand));
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(44, 62, 122, .28);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    padding: 12px 16px;
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

    .avm-pay-copy-all svg {
        height: 16px;
        width: 16px;
    }

    .avm-pay-copy-all:hover {
        box-shadow: 0 10px 24px rgba(44, 62, 122, .36);
        filter: brightness(1.06);
        transform: translateY(-1px);
    }

/* ---- the steps ---- */

.avm-pay-steps {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.avm-pay-step {
    align-items: flex-start;
    background: var(--bg);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    display: flex;
    gap: 12px;
    padding: 12px 14px;
}

    .avm-pay-step[data-avm-hue="1"] {
        --step-a: #6d28d9;
        --step-b: #a78bfa;
    }

    .avm-pay-step[data-avm-hue="2"] {
        --step-a: #db2777;
        --step-b: #f472b6;
    }

    .avm-pay-step[data-avm-hue="3"] {
        --step-a: #d97706;
        --step-b: #fbbf24;
    }

.avm-pay-step-num {
    align-items: center;
    background: linear-gradient(135deg, var(--step-a), var(--step-b));
    border-radius: 10px;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--step-a) 32%, transparent);
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-family: var(--font-num);
    font-size: calc(14px * var(--avm-font-scale));
    font-weight: 700;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.avm-pay-step strong {
    color: var(--ink);
    display: block;
    font-size: calc(13px * var(--avm-font-scale));
    margin-bottom: 3px;
}

.avm-pay-step p {
    color: var(--ink-2);
    font-size: calc(12.5px * var(--avm-font-scale));
    line-height: 1.5;
    margin: 0;
}

    .avm-pay-step p b {
        color: var(--ink);
    }

.avm-pay-code {
    background: #fce7f3;
    border: 1px dashed #f472b6;
    border-radius: 6px;
    color: #9d174d;
    cursor: pointer;
    font-family: var(--font-num);
    font-weight: 700;
    padding: 1px 7px;
}

    .avm-pay-code:hover {
        background: #fbcfe8;
    }

.avm-pay-notify {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--brand);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 2px;
    margin-top: 8px;
    padding: 0;
    text-decoration: none;
}

    .avm-pay-notify svg {
        height: 14px;
        transition: transform .14s ease;
        width: 14px;
    }

    .avm-pay-notify:hover {
        text-decoration: underline;
    }

        .avm-pay-notify:hover svg {
            transform: translateX(2px);
        }


/* ---- the header button ---- */

.avm-paynow-btn {
    align-items: center;
    background: linear-gradient(135deg, #00bfa6, #00a08a);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--r-sm);
    box-shadow: 0 0 0 0 rgba(0, 191, 166, .55);
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 5px;
    height: 34px;
    line-height: 1;
    padding: 0 11px;
    text-decoration: none;
    transition: transform .14s ease, filter .14s ease;
    white-space: nowrap;
}

    .avm-paynow-btn svg {
        height: 13px;
        width: 13px;
    }

    .avm-paynow-btn:hover {
        color: #fff;
        filter: brightness(1.08);
        transform: translateY(-1px);
    }

/* A soft ring that breathes out every few seconds: enough to catch the eye on a header
   full of quiet controls, quiet enough not to nag. Off when the user prefers less motion. */
@media (prefers-reduced-motion: no-preference) {
    :root[data-motion="full"] .avm-paynow-btn {
        animation: avmPayNowPulse 3.2s ease-out infinite;
    }
}

@keyframes avmPayNowPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 191, 166, .55);
    }

    45% {
        box-shadow: 0 0 0 7px rgba(0, 191, 166, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 191, 166, 0);
    }
}

.avm-pay-notify-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.avm-pay-notify-row {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

.avm-pay-amount-control {
    align-items: center;
    display: flex;
    position: relative;
}

.avm-pay-amount-prefix {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 700;
    left: 12px;
    pointer-events: none;
    position: absolute;
}

.avm-pay-amount-control .avm-input {
    font-family: var(--font-num);
    font-weight: 700;
    padding-left: 44px;
}

.avm-pay-preview {
    background: linear-gradient(135deg, #eef2ff 0%, #f0fdfa 100%);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 12px 14px;
}

.avm-pay-preview-label {
    color: var(--muted);
    display: block;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 600;
    letter-spacing: .05em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.avm-pay-preview-text {
    color: var(--ink);
    font-size: calc(13px * var(--avm-font-scale));
    line-height: 1.55;
    margin: 0;
}

/* ---- scan and pay ---- */

.avm-pay-card.is-upi::before {
    background: linear-gradient(90deg, #0f766e, #22c55e);
}

.avm-pay-upi-badge {
    align-items: center;
    background: linear-gradient(135deg, #0f766e, #15803d);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(21, 128, 61, .26);
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    padding: 6px 12px;
    white-space: nowrap;
}

.avm-pay-qr-wrap {
    align-items: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}

/* A QR has to stay square and crisp: no smoothing, and a white quiet zone of its own so it
   still scans against the tinted panel. */
.avm-pay-qr {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .10);
    height: auto;
    image-rendering: pixelated;
    max-width: 100%;
    padding: 10px;
    width: 220px;
}

.avm-pay-qr-hint {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 0;
    text-align: center;
}

.avm-pay-upi-note {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
    line-height: 1.6;
    margin: 0;
}

.avm-pay-tid {
    color: var(--muted);
    display: block;
    font-size: calc(10.5px * var(--avm-font-scale));
    letter-spacing: .04em;
    margin-top: 6px;
    text-transform: uppercase;
}

@media (max-width: 960px) {
    .avm-pay-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-pay-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-pay-hero-side {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .avm-pay-notify-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-pay-field {
        grid-template-columns: minmax(0, 1fr);
    }

    .avm-pay-copy {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
    }

    .avm-paynow-btn span {
        display: none;
    }

    .avm-paynow-btn {
        padding: 0 11px;
    }
}

/* ==========================================================================
   Excel order entry (bulk) - one bar, three tight cards, then the review.
   ========================================================================== */

.avm-bulk {
    gap: var(--sp-2);
    letter-spacing: 0;
}

    .avm-bulk [hidden] {
        display: none !important;
    }

    .avm-bulk .avm-field {
        min-width: 0;
    }

    .avm-bulk .avm-input, .avm-bulk .avm-select {
        width: 100%;
        min-width: 0;
    }

    .avm-bulk .avm-form-banner {
        margin: 0;
    }

    .avm-bulk [data-avm-hue="1"] {
        --hue-a: #0ea5e9;
        --hue-b: #67e8f9;
        --hue-soft: #ecfbff;
        --hue-ink: #0c5f80;
    }

    .avm-bulk [data-avm-hue="2"] {
        --hue-a: #8e44ec;
        --hue-b: #c07dff;
        --hue-soft: #f4ecfe;
        --hue-ink: #5b21b6;
    }

    .avm-bulk [data-avm-hue="3"] {
        --hue-a: #00b894;
        --hue-b: #55d6ac;
        --hue-soft: #e8faf4;
        --hue-ink: #047857;
    }

    .avm-bulk [data-avm-hue="4"] {
        --hue-a: #f59e0b;
        --hue-b: #fcd34d;
        --hue-soft: #fff7e6;
        --hue-ink: #b45309;
    }

    .avm-bulk [data-avm-hue="5"] {
        --hue-a: #2c3e7a;
        --hue-b: #5b74c4;
        --hue-soft: #eef2ff;
        --hue-ink: #2c3e7a;
    }

/* ---- the bar ---- */

.avm-bulk-bar {
    align-items: center;
    background: linear-gradient(120deg, var(--brand-mid) 0%, var(--brand) 60%, #22315f 100%);
    border-radius: var(--r-md);
    box-shadow: 0 8px 24px rgba(44, 62, 122, .22);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
    padding: 8px 10px;
}

.avm-bulk-steps {
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    display: inline-flex;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 3px;
}

    .avm-bulk-steps li {
        align-items: center;
        border-radius: 999px;
        color: rgba(255, 255, 255, .72);
        display: inline-flex;
        font-size: calc(12px * var(--avm-font-scale));
        font-weight: 600;
        gap: 7px;
        line-height: 1;
        padding: 5px 12px 5px 5px;
        white-space: nowrap;
    }

        .avm-bulk-steps li span {
            align-items: center;
            background: rgba(255, 255, 255, .16);
            border-radius: 50%;
            display: inline-flex;
            font-family: var(--font-num);
            font-size: 11px;
            height: 20px;
            justify-content: center;
            width: 20px;
        }

    .avm-bulk-steps [aria-current] {
        background: #fff;
        color: var(--brand);
    }

        .avm-bulk-steps [aria-current] span {
            background: var(--brand);
            color: #fff;
        }

    .avm-bulk-steps .is-complete {
        color: #fff;
    }

        .avm-bulk-steps .is-complete span {
            background: var(--accent);
            color: #fff;
        }

.avm-bulk-bar-status {
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    color: rgba(255, 255, 255, .85);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    padding: 6px 12px;
    white-space: nowrap;
}

    .avm-bulk-bar-status.is-loaded {
        background: rgba(0, 191, 166, .28);
        color: #fff;
    }

    .avm-bulk-bar-status.is-stale {
        background: #fbbf24;
        color: #78350f;
    }

.avm-bulk-bar-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.avm-bulk-bar-btn {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--r-sm);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 600;
    gap: 6px;
    height: 34px;
    line-height: 1;
    padding: 0 12px;
    text-decoration: none;
    transition: background .14s ease;
    white-space: nowrap;
}

    .avm-bulk-bar-btn svg {
        height: 14px;
        width: 14px;
    }

    .avm-bulk-bar-btn:hover {
        background: rgba(255, 255, 255, .22);
        color: #fff;
    }

    .avm-bulk-bar-btn:disabled {
        cursor: not-allowed;
        opacity: .45;
    }

.avm-bulk-go {
    align-items: center;
    background: linear-gradient(135deg, #00bfa6, #00a08a);
    border: 0;
    border-radius: var(--r-sm);
    box-shadow: 0 6px 16px rgba(0, 191, 166, .35);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 6px;
    height: 34px;
    line-height: 1;
    padding: 0 16px;
    transition: transform .14s ease, filter .14s ease;
    white-space: nowrap;
}

    .avm-bulk-go:hover {
        filter: brightness(1.08);
        transform: translateY(-1px);
    }

    .avm-bulk-go:disabled {
        box-shadow: none;
        cursor: not-allowed;
        filter: grayscale(.4);
        opacity: .55;
        transform: none;
    }

    .avm-bulk-go.is-solid {
        background: linear-gradient(135deg, var(--brand-mid), var(--brand));
        box-shadow: 0 6px 16px rgba(44, 62, 122, .3);
    }

/* ---- setup: two short cards on the left, the tests on the right ---- */

.avm-bulk-setup-wrap > summary {
    align-items: center;
    background: linear-gradient(90deg, var(--brand-soft), #fff);
    border: 1px solid #c7d2fe;
    border-radius: var(--r-md);
    color: var(--brand);
    cursor: pointer;
    display: flex;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
    gap: 8px;
    list-style: none;
    padding: 9px 12px;
}

    .avm-bulk-setup-wrap > summary::-webkit-details-marker {
        display: none;
    }

    .avm-bulk-setup-wrap > summary svg {
        height: 15px;
        width: 15px;
    }

    .avm-bulk-setup-wrap > summary.is-stale {
        background: linear-gradient(90deg, #fff7e6, #fff);
        border-color: #fcd34d;
        color: #92400e;
    }

.avm-bulk-summary-name {
    max-width: 30%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-bulk-summary-chip {
    background: var(--brand);
    border-radius: 999px;
    color: #fff;
    font-family: var(--font-num);
    font-size: 11px;
    padding: 2px 9px;
    white-space: nowrap;
}

.avm-bulk-setup-wrap > summary.is-stale .avm-bulk-summary-chip {
    background: #d97706;
}

.avm-bulk-summary-hint {
    color: var(--muted);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-bulk-summary-change {
    align-items: center;
    background: #fff;
    border: 1px solid #c7d2fe;
    border-radius: var(--r-sm);
    color: var(--brand);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
    margin-left: auto;
    padding: 5px 10px;
    white-space: nowrap;
}

    .avm-bulk-summary-change svg {
        height: 13px;
        width: 13px;
    }

.avm-bulk-setup-wrap[open] > summary .avm-bulk-summary-change {
    display: none;
}

.avm-bulk-setup-wrap[open] > summary {
    margin-bottom: var(--sp-2);
}

.avm-bulk-setup {
    align-items: start;
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr);
}

.avm-bulk-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

    .avm-bulk-card::before {
        background: linear-gradient(90deg, var(--hue-a), var(--hue-b));
        content: "";
        height: 4px;
        inset: 0 0 auto;
        position: absolute;
    }

.avm-bulk-card-head {
    align-items: center;
    background: var(--hue-soft);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px 8px;
}

    .avm-bulk-card-head h2 {
        color: var(--ink);
        font-size: calc(13px * var(--avm-font-scale));
        font-weight: 700;
        line-height: 1.2;
        margin: 0;
    }

.avm-bulk-card-icon {
    align-items: center;
    background: linear-gradient(135deg, var(--hue-a), var(--hue-b));
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    height: 26px;
    justify-content: center;
    width: 26px;
}

    .avm-bulk-card-icon svg {
        height: 14px;
        width: 14px;
    }

.avm-bulk-card-meta {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
}

.avm-bulk-card-foot {
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--hue-ink);
    display: flex;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
    gap: 8px;
    justify-content: space-between;
    padding: 8px 12px;
}

.avm-bulk-count {
    background: linear-gradient(135deg, var(--hue-a), var(--hue-b));
    border-radius: 999px;
    color: #fff;
    font-family: var(--font-num);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    white-space: nowrap;
}

/* the drop strip */

.avm-bulk-drop {
    align-items: center;
    background: var(--hue-soft);
    border: 1.5px dashed var(--hue-a);
    border-radius: 10px;
    color: var(--hue-ink);
    cursor: pointer;
    display: flex;
    gap: 12px;
    margin: 10px 12px 12px;
    min-height: 64px;
    overflow: hidden;
    padding: 10px 14px;
    position: relative;
    transition: background .15s ease, border-color .15s ease;
}

    .avm-bulk-drop:hover, .avm-bulk-drop.is-dragging {
        background: #fff;
        border-style: solid;
    }

    .avm-bulk-drop:focus-within {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    .avm-bulk-drop > svg {
        flex-shrink: 0;
        height: 26px;
        width: 26px;
    }

.avm-bulk-drop-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

    .avm-bulk-drop-text strong {
        font-size: calc(13px * var(--avm-font-scale));
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .avm-bulk-drop-text span {
        color: var(--muted);
        font-size: calc(11px * var(--avm-font-scale));
    }

.avm-bulk-drop input {
    cursor: pointer;
    height: 100%;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

.avm-bulk-drop:has(input:disabled) {
    cursor: default;
}

.avm-bulk-defaults {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    padding: 10px 12px 12px;
}

.avm-bulk-address {
    font-family: inherit;
    height: auto;
    line-height: 1.4;
    min-height: 58px;
    padding: 8px 12px;
    resize: vertical;
}

.avm-bulk-defaults-error {
    grid-column: 1 / -1;
    margin: 0;
    white-space: normal;
}

.avm-bulk-defaults .is-invalid {
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .15);
}

/* the catalogue */

.avm-bulk-catalogue .avm-bulk-card-head {
    padding-bottom: 8px;
}

.avm-bulk-search {
    align-items: center;
    display: flex;
    flex: 1 1 160px;
    margin-left: auto;
    max-width: 260px;
    min-width: 140px;
    position: relative;
}

    .avm-bulk-search svg {
        color: var(--muted);
        height: 14px;
        left: 10px;
        pointer-events: none;
        position: absolute;
        width: 14px;
    }

    .avm-bulk-search .avm-input {
        height: 32px;
        padding-left: 30px;
    }

.avm-bulk-margin {
    align-items: center;
    color: var(--ink-2);
    display: inline-flex;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
}

    .avm-bulk-margin input {
        accent-color: var(--hue-a);
        cursor: pointer;
        height: 16px;
        width: 28px;
    }

.avm-bulk-tests-head, .avm-bulk-test {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 16px minmax(0, 1fr) 84px;
    padding: 0 12px;
}

    .avm-bulk-tests.has-margin .avm-bulk-test, .avm-bulk-tests-head:has([data-bulk-margin-head]:not([hidden])) {
        grid-template-columns: 16px minmax(0, 1fr) 84px 84px;
    }

.avm-bulk-tests-head {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    padding-bottom: 6px;
    padding-top: 8px;
    text-transform: uppercase;
}

    .avm-bulk-tests-head span:first-child {
        grid-column: 1 / 3;
    }

    .avm-bulk-tests-head span:not(:first-child) {
        text-align: right;
    }

.avm-bulk-tests {
    background: #fff;
    border-top: 1px solid var(--line);
    flex: 1;
    max-height: 320px;
    min-height: 120px;
    overflow: auto;
}

.avm-bulk-test {
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
    min-height: 40px;
    padding-bottom: 5px;
    padding-top: 5px;
}

    .avm-bulk-test:hover {
        background: var(--field);
    }

    .avm-bulk-test.is-selected {
        background: var(--hue-soft);
        box-shadow: inset 3px 0 0 var(--hue-a);
    }

    .avm-bulk-test > input {
        accent-color: var(--hue-a);
        height: 15px;
        margin: 0;
        width: 15px;
    }

    .avm-bulk-test > span:nth-child(2) {
        min-width: 0;
    }

    .avm-bulk-test strong {
        display: block;
        font-size: calc(12px * var(--avm-font-scale));
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .avm-bulk-test small, .avm-bulk-table td small {
        color: var(--muted);
        display: block;
        font-size: 11px;
        line-height: 1.4;
    }

.avm-bulk-test-price {
    font-family: var(--font-num);
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    text-align: right;
}

    .avm-bulk-test-price.is-b2c {
        color: var(--hue-ink);
    }

.avm-bulk-tests .avm-empty {
    padding: 20px;
}

/* ---- results ---- */

.avm-bulk-results {
    display: grid;
    gap: var(--sp-2);
    min-width: 0;
}

.avm-bulk-metrics {
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.avm-bulk-metric {
    background: linear-gradient(135deg, var(--hue-a), var(--hue-b));
    border-radius: var(--r-md);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
    color: #fff;
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 10px 14px;
}

    .avm-bulk-metric > span {
        font-size: calc(10.5px * var(--avm-font-scale));
        font-weight: 700;
        letter-spacing: .06em;
        opacity: .9;
        text-transform: uppercase;
    }

    .avm-bulk-metric strong {
        font-family: var(--font-num);
        font-size: calc(24px * var(--avm-font-scale));
        line-height: 1.1;
        overflow-wrap: anywhere;
    }

    .avm-bulk-metric small {
        font-size: calc(11px * var(--avm-font-scale));
        opacity: .92;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .avm-bulk-metric.is-over {
        background: linear-gradient(135deg, #dc2626, #f87171);
    }

    .avm-bulk-metric.is-clickable {
        cursor: pointer;
        transition: transform .14s ease, box-shadow .14s ease;
    }

        .avm-bulk-metric.is-clickable:hover {
            box-shadow: 0 10px 22px rgba(15, 23, 42, .18);
            transform: translateY(-1px);
        }

    .avm-bulk-metric:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

.avm-bulk-readiness {
    align-items: center;
    display: flex;
    gap: 8px;
}

    .avm-bulk-readiness progress {
        accent-color: #fff;
        border: none;
        border-radius: 4px;
        flex: 1;
        height: 6px;
        min-width: 40px;
        overflow: hidden;
    }

        .avm-bulk-readiness progress::-webkit-progress-bar {
            background: rgba(255, 255, 255, .3);
        }

        .avm-bulk-readiness progress::-webkit-progress-value {
            background: #fff;
            transition: width .25s ease;
        }

        .avm-bulk-readiness progress::-moz-progress-bar {
            background: #fff;
        }

    .avm-bulk-readiness b {
        font-family: var(--font-num);
    }

.avm-bulk-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

    .avm-bulk-tools .avm-bulk-search {
        flex: 0 1 240px;
        margin-left: 0;
    }

    .avm-bulk-tools > .avm-select {
        height: 32px;
        width: 170px;
    }

.avm-bulk-tools-end {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.avm-bulk-tools .avm-btn-ghost {
    min-height: 32px;
    padding: 0 12px;
}

.avm-bulk-table-scroll {
    max-height: max(360px, calc(100dvh - 340px));
}

.avm-bulk-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    table-layout: auto;
    width: max-content;
}

    .avm-bulk-table th {
        text-align: left;
        white-space: nowrap;
    }

        .avm-bulk-table th b {
            color: var(--red);
            font-weight: 700;
            margin-left: 2px;
        }

        .avm-bulk-table th small {
            color: var(--muted);
            display: block;
            font-size: 9.5px;
            font-weight: 600;
            letter-spacing: .04em;
            line-height: 1.2;
            text-transform: none;
        }

    .avm-bulk-table th, .avm-bulk-table td {
        border-right: 1px solid var(--line);
        padding: 5px 6px;
    }

    .avm-bulk-table td {
        background: var(--card);
        vertical-align: middle;
    }

.avm-bulk-col-row {
    font-family: var(--font-num);
    left: 0;
    position: sticky;
    text-align: center;
    width: 44px;
    z-index: 1;
}

.avm-bulk-sticky {
    position: sticky;
    z-index: 1;
}

.avm-bulk-table th.avm-bulk-col-row, .avm-bulk-table th.avm-bulk-sticky {
    z-index: 3;
}

.avm-bulk-col-barcode {
    min-width: 128px;
}

.avm-bulk-grid td.avm-bulk-col-note {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.35;
    max-width: 220px;
    min-width: 90px;
    white-space: normal;
}

.avm-bulk-col-actions {
    padding: 4px 6px;
    text-align: center;
    white-space: nowrap;
    width: 1%;
}
/* Cells are inputs with the chrome pared back: a hairline, the row's tint behind, and a full
   border only while focused or wrong. The header is the label, so cells carry none. */
.avm-bulk-grid td > input:not([type="checkbox"]), .avm-bulk-grid td > select {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    font-family: inherit;
    font-size: calc(12px * var(--avm-font-scale));
    height: 28px;
    min-width: 0;
    padding: 0 6px;
    width: 100%;
}

.avm-bulk-grid td > select {
    padding-right: 2px;
}

.avm-bulk-grid td > input[type="checkbox"] {
    accent-color: var(--brand);
    display: block;
    height: 15px;
    margin: 0 auto;
    width: 15px;
}

.avm-bulk-grid td > input:focus, .avm-bulk-grid td > select:focus {
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 2px rgba(58, 82, 160, .18);
    outline: 0;
}

.avm-bulk-grid td > input:disabled, .avm-bulk-grid td > select:disabled {
    background: transparent;
    border-color: transparent;
    color: var(--ink);
    opacity: 1;
}

.avm-bulk-grid td > .is-invalid {
    background: #fff5f5;
    border-color: var(--red);
    box-shadow: inset 0 0 0 1px var(--red);
}

    .avm-bulk-grid td > .is-invalid:focus {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, .2);
    }

.avm-bulk-barcode-input {
    font-family: var(--font-num);
    letter-spacing: .04em;
}
/* The row's tint is its state: a coloured edge on the sticky row number and a wash across the
   row. Ready is quiet green, attention amber, a failed submission red, unvalidated plain. */
.avm-bulk-row td:first-child {
    box-shadow: inset 3px 0 0 transparent;
}

.avm-bulk-row.is-ready td:first-child {
    box-shadow: inset 3px 0 0 #00b894;
}

.avm-bulk-row.is-ready td {
    background: #f3fcf8;
}

.avm-bulk-row.is-attention td:first-child {
    box-shadow: inset 3px 0 0 #f59e0b;
}

.avm-bulk-row.is-attention td {
    background: #fff8e8;
}

.avm-bulk-row.is-alert td:first-child {
    box-shadow: inset 3px 0 0 #ef4444;
}

.avm-bulk-row.is-alert td {
    background: #fff1f1;
}

.avm-bulk-row-issue {
    color: #b45309;
    font-weight: 600;
}

.avm-bulk-row.is-alert .avm-bulk-row-issue {
    color: var(--red);
}

.avm-bulk-row-ok {
    color: var(--green-ink);
    font-weight: 700;
}

.avm-bulk-gain, .avm-bulk-table small.avm-bulk-gain {
    color: var(--green-ink);
}

.avm-bulk-loss, .avm-bulk-table small.avm-bulk-loss {
    color: var(--red);
}

.avm-bulk-icon {
    font-size: 15px;
    height: 26px;
    min-height: 26px !important;
    padding: 0;
    width: 26px;
}

    .avm-bulk-icon svg {
        height: 15px;
        width: 15px;
    }

    .avm-bulk-icon.is-info {
        color: var(--brand-mid);
    }

    .avm-bulk-icon.is-remove {
        color: var(--red);
        margin-left: 4px;
    }

        .avm-bulk-icon.is-remove:hover {
            background: #fff1f1;
            border-color: #fca5a5;
        }
/* the patient card */
.avm-bulk-detail {
    width: min(860px, calc(100vw - 32px));
}

.avm-bulk-detail-heading {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

    .avm-bulk-detail-heading .avm-vlogue-pill {
        background: rgba(255, 255, 255, .16);
        color: #fff;
    }

.avm-bulk-detail-amount {
    background: rgba(0, 191, 166, .28);
    border-radius: 999px;
    color: #fff;
    font-family: var(--font-num);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
}

.avm-bulk-detail-scroll {
    margin: 12px 16px 16px;
    max-height: calc(100dvh - 150px);
    overflow: auto;
}

.avm-bulk-detail-table {
    border-collapse: collapse;
    font-size: calc(12px * var(--avm-font-scale));
    width: 100%;
}

    .avm-bulk-detail-table th, .avm-bulk-detail-table td {
        border-bottom: 1px solid var(--line-soft);
        padding: 7px 10px;
        text-align: left;
        vertical-align: top;
    }

    .avm-bulk-detail-table thead th {
        background: var(--brand-soft);
        color: var(--brand);
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .06em;
        position: sticky;
        text-transform: uppercase;
        top: 0;
    }

    .avm-bulk-detail-table tbody th {
        color: var(--muted);
        font-weight: 600;
        white-space: nowrap;
        width: 160px;
    }

    .avm-bulk-detail-table tbody td:nth-child(2) {
        font-family: var(--font-num);
    }

    .avm-bulk-detail-table tr.is-bad td, .avm-bulk-detail-table tr.is-bad th {
        background: #fff8f8;
    }

.avm-bulk-detail-mark {
    text-align: center;
    width: 56px;
}

    .avm-bulk-detail-mark .is-tick {
        color: #00b894;
        font-weight: 700;
    }

    .avm-bulk-detail-mark .is-cross {
        color: var(--red);
        font-weight: 700;
    }

.avm-bulk-detail-remark {
    color: var(--red);
    font-weight: 600;
    white-space: normal;
}

.avm-bulk-detail-empty {
    color: var(--muted);
}

/* ---- dialogs ---- */

.avm-bulk-section-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.avm-bulk-eyebrow {
    color: var(--teal-ink);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
}

.avm-bulk-dialog {
    background: var(--card);
    border: 0;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    color: var(--ink);
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    padding: 0;
    width: min(960px, calc(100vw - 32px));
}

    .avm-bulk-dialog::backdrop {
        background: rgba(15, 23, 42, .5);
    }

    .avm-bulk-dialog[open] {
        animation: avm-bulk-appear .18s ease-out;
        display: flex;
        flex-direction: column;
    }

    .avm-bulk-dialog h2 {
        font-size: 15px;
        margin: 0;
    }
/* The dialog head is the page bar again: brand gradient, white type, the close on the right. */
.avm-bulk-dialog-head {
    align-items: center;
    background: linear-gradient(120deg, var(--brand-mid) 0%, var(--brand) 60%, #22315f 100%);
    color: #fff;
    display: flex;
    flex-shrink: 0;
    gap: 10px;
    padding: 12px 16px;
}

    .avm-bulk-dialog-head h2 {
        color: #fff;
    }

    .avm-bulk-dialog-head .avm-bulk-card-icon {
        background: rgba(255, 255, 255, .16);
    }

.avm-bulk-dialog-close {
    align-items: center;
    background: rgba(255, 255, 255, .14);
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    margin-left: auto;
    width: 30px;
}

    .avm-bulk-dialog-close:hover {
        background: rgba(255, 255, 255, .26);
    }

    .avm-bulk-dialog-close svg {
        height: 14px;
        width: 14px;
    }

.avm-bulk-dialog .avm-btn {
    min-height: 34px;
}

.avm-bulk-dialog > :not(header) {
    margin-left: 16px;
    margin-right: 16px;
}

.avm-bulk-dialog > .avm-bulk-section-head {
    margin-bottom: 16px;
}

.avm-bulk-confirm {
    width: min(560px, calc(100vw - 32px));
}

    .avm-bulk-confirm .avm-bulk-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 16px;
    }

    .avm-bulk-confirm > [data-bulk-confirm-summary] > p {
        margin: 16px;
    }

    .avm-bulk-confirm > .avm-muted-text {
        margin-top: 0;
    }

    .avm-bulk-confirm .avm-bulk-metric {
        background: linear-gradient(135deg, var(--brand-mid), var(--brand));
    }

        .avm-bulk-confirm .avm-bulk-metric.is-mint {
            background: linear-gradient(135deg, #00b894, #55d6ac);
        }

@keyframes avm-bulk-appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .avm-bulk-dialog[open] {
        animation: none;
    }

    .avm-bulk-readiness progress::-webkit-progress-value {
        transition: none;
    }
}

@media (max-width: 1000px) {
    .avm-bulk-setup {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .avm-bulk-bar-actions {
        margin-left: 0;
        width: 100%;
    }

    .avm-bulk-go {
        flex: 1;
    }

    .avm-bulk-steps li {
        padding-right: 8px;
    }

    .avm-bulk-metrics {
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .avm-bulk-metric strong {
        font-size: 20px;
    }

    .avm-bulk-tools .avm-bulk-search, .avm-bulk-tools > .avm-select {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
    }

    .avm-bulk-tools-end {
        margin-left: 0;
        width: 100%;
    }

        .avm-bulk-tools-end .avm-bulk-go {
            flex: 1;
        }

    .avm-bulk-tests-head, .avm-bulk-test {
        grid-template-columns: 16px minmax(0, 1fr) 64px;
    }

        .avm-bulk-tests.has-margin .avm-bulk-test, .avm-bulk-tests-head:has([data-bulk-margin-head]:not([hidden])) {
            grid-template-columns: 16px minmax(0, 1fr) 64px 64px;
        }
}

/* A field with a small action at its top right, such as adding a doctor to the referrer list. */
.avm-field-wrap {
    min-width: 0;
    position: relative;
}

.avm-field-action {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--brand);
    cursor: pointer;
    display: inline-flex;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 2px;
    line-height: 1;
    padding: 1px 4px;
    position: absolute;
    right: -4px;
    top: -3px;
}

    .avm-field-action svg {
        height: 14px;
        width: 14px;
    }

    .avm-field-action:hover {
        background: rgba(44, 62, 122, .08);
    }

/* The add-doctor dialog: a compact form in the standard action card. */
.avm-doctor-card {
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 46rem);
    max-width: 760px;
    width: min(760px, 100%);
}

.avm-doctor-head {
    gap: 12px;
}

    .avm-doctor-head > div {
        flex: 1;
        min-width: 0;
    }

.avm-doctor-subtitle {
    color: rgba(255, 255, 255, .78);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 2px 0 0;
}

.avm-doctor-mark {
    align-items: center;
    background: rgba(255, 255, 255, .16);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    height: 40px;
    justify-content: center;
    width: 40px;
}

    .avm-doctor-mark svg {
        height: 22px;
        width: 22px;
    }

.avm-doctor-body {
    overflow: auto;
}

.avm-doctor-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: var(--red);
    font-size: calc(12.5px * var(--avm-font-scale));
    margin: var(--sp-3) 0 0;
    padding: 10px 12px;
}

.avm-doctor-foot {
    justify-content: space-between;
}

.avm-doctor-foot-note {
    color: var(--muted);
    font-size: calc(11.5px * var(--avm-font-scale));
}

.avm-doctor-foot-actions {
    display: flex;
    gap: var(--sp-2);
}

.avm-doctor-foot .avm-btn.is-loading {
    pointer-events: none;
}

@media (max-width: 620px) {
    .avm-doctor-foot {
        flex-direction: column;
        gap: var(--sp-2);
    }

    .avm-doctor-foot-actions {
        width: 100%;
    }

        .avm-doctor-foot-actions .avm-btn {
            flex: 1;
        }
}

/* The typed-value row of a free-text combo: the operator's own entry, told apart from the list. */
.avm-combo-option.is-custom {
    border-bottom: 1px solid var(--line);
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 4px;
}

/* B2C order entry. */
.avm-b2c-entry,
.avm-b2c-patient-form,
.avm-b2c-order {
    display: grid;
    gap: var(--sp-4);
    min-width: 0;
}

.avm-b2c-names {
    grid-template-columns: 112px repeat(3, minmax(0, 1fr));
}

.avm-b2c-age {
    display: grid;
    gap: var(--sp-1);
    min-width: 0;
}

    .avm-b2c-age > .avm-linkish {
        justify-self: start;
        font-size: calc(10px * var(--avm-font-scale));
        font-weight: 400;
        line-height: 1.4;
    }

.avm-b2c-patient-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: var(--sp-2);
}

.avm-b2c-search-button {
    background: var(--green);
    justify-content: center;
    min-height: 30px;
    width: 34px;
    padding: 6px;
}

    .avm-b2c-search-button:hover {
        background: var(--green-ink);
    }

.avm-b2c-start-row {
    align-items: stretch;
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: minmax(0, 1fr) 126px;
}

.avm-b2c-start-lead:only-child {
    grid-column: 1 / -1;
}

.avm-b2c-start-lead {
    margin: 0;
    position: relative;
}

.avm-b2c-lead-picker {
    position: relative;
}

    .avm-b2c-lead-picker .avm-input {
        background: #f8fafc;
        border-color: #cfe1f8;
        box-shadow: none;
        cursor: pointer;
        font-size: calc(12.5px * var(--avm-font-scale));
        min-height: 40px;
        padding-right: 34px;
    }

    .avm-b2c-lead-picker::after {
        color: var(--brand);
        content: "";
        width: 7px;
        height: 7px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        right: 14px;
        top: 50%;
        transform: translateY(-70%) rotate(45deg);
        pointer-events: none;
        position: absolute;
    }

.avm-b2c-routine {
    background: var(--teal-ink);
    border: 1px solid rgba(5, 150, 105, .24);
    box-shadow: none;
    color: #fff;
    font-size: calc(12px * var(--avm-font-scale));
    min-height: 40px;
    padding-inline: 14px;
    white-space: nowrap;
}

.avm-b2c-new-patient {
    background: var(--sky-ink);
    border-color: var(--sky-ink);
    color: #fff;
    white-space: nowrap;
}

    .avm-b2c-new-patient:hover {
        background: var(--brand);
        color: #fff;
    }

.avm-b2c-routine.is-active {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 8px 16px rgba(5, 150, 105, .18);
    color: #fff;
}

.avm-b2c-chosen {
    align-items: center;
    background: rgba(5, 150, 105, .08);
    border: 1px solid rgba(5, 150, 105, .22);
    border-radius: var(--r-sm);
    color: var(--ink);
    display: flex;
    font-size: calc(12.5px * var(--avm-font-scale));
    gap: 8px;
    padding: 8px 10px;
}

.avm-b2c-chosen-mark {
    align-items: center;
    background: var(--green, #059669);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: calc(10px * var(--avm-font-scale));
    height: 18px;
    justify-content: center;
    width: 18px;
}

.avm-b2c-work {
    display: grid;
    gap: var(--sp-4);
    animation: avmB2cReveal .2s ease-out;
    min-width: 0;
    width: 100%;
}


.avm-b2c-colnote {
    color: var(--muted);
    font-size: calc(11.5px * var(--avm-font-scale));
    text-align: right;
}

.avm-b2c-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

    .avm-b2c-fields .avm-field.is-span-2,
    .avm-b2c-fields .avm-field.is-span-3 {
        grid-column: span 2;
    }

    .avm-b2c-fields .avm-field.is-span-4 {
        grid-column: 1 / -1;
    }

    .avm-b2c-fields .avm-field[data-avm-field="Address"] {
        grid-column: span 2 !important;
    }


.avm-b2c-lead-clear {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    margin-left: auto;
}

/* The lead picker is the one list that floats; the catalogue simply sits in its column. */
.avm-b2c-suggestions {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
    left: 0;
    max-height: 18rem;
    overflow: auto;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 30;
}

.avm-b2c-entry .avm-field {
    position: relative;
}

.avm-panel.is-picker-open {
    position: relative;
    z-index: 40;
}

.avm-b2c-option {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    display: grid;
    gap: 2px;
    padding: 9px 12px;
    text-align: left;
    width: 100%;
}

    .avm-b2c-option:hover {
        background: rgba(44, 62, 122, .06);
    }

.avm-b2c-option-main {
    color: var(--ink);
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 600;
}

.avm-b2c-option-note {
    color: var(--muted);
    font-size: calc(11px * var(--avm-font-scale));
}

.avm-b2c-empty {
    color: var(--muted-lt);
    font-size: calc(11.5px * var(--avm-font-scale));
    margin: 0;
    padding: 14px;
    text-align: center;
}


/* One block per tube: what it is, what goes in it, and the barcode typed twice. */
.avm-b2c-samples {
    border-top: 1px solid var(--line);
    display: grid;
    gap: var(--sp-2);
    padding-top: var(--sp-3);
}

.avm-b2c-samples-head {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
}

.avm-b2c-subhead {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(13px * var(--avm-font-scale));
    margin: 0;
}


.avm-b2c-note {
    color: var(--amber, #b45309);
    font-size: calc(12px * var(--avm-font-scale));
    margin: 0;
}



@media (max-width: 900px) {
    .avm-b2c-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .avm-b2c-start-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .avm-b2c-names {
        grid-template-columns: 96px minmax(0, 1fr);
    }

        .avm-b2c-names [data-avm-field="MiddleName"],
        .avm-b2c-names [data-avm-field="LastName"] {
            grid-column: 1 / -1;
        }

    .avm-b2c-fields {
        grid-template-columns: minmax(0, 1fr);
    }

        .avm-b2c-fields .avm-field[class*="is-span-"] {
            grid-column: 1 / -1;
        }

        .avm-b2c-fields .avm-field[data-avm-field="Address"] {
            grid-column: 1 / -1 !important;
        }
}

@media (prefers-reduced-motion: reduce) {
    .avm-b2c-work {
        animation: none;
    }
}

@keyframes avmB2cReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* The lead MIS: a table row carries a second line under its heading value. */
.avm-b2c-lead-table .avm-cell-title {
    display: block;
    font-weight: 600;
}

.avm-b2c-lead-table .avm-cell-note {
    color: var(--muted);
    display: block;
    font-size: calc(11px * var(--avm-font-scale));
    margin-top: 2px;
}

.avm-b2c-lead-table td.is-num {
    font-family: var(--font-num);
    text-align: right;
}

/* Four filters and the button belong on one line; the grid is four wide by default. */
@media (min-width: 1100px) {
    .avm-b2c-mis-filters .avm-form-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.avm-b2c-lead-table .avm-b2c-tests-cell {
    white-space: nowrap;
}

/* What the scheme took off. It is the good news on the screen, so it is said once, in its
   own band, and it arrives rather than appears. */
.avm-save-banner {
    align-items: center;
    background: linear-gradient(120deg, rgba(5, 150, 105, .12), rgba(5, 150, 105, .04));
    border: 1px solid rgba(5, 150, 105, .28);
    border-radius: var(--r-md);
    color: #047857;
    display: flex;
    gap: 10px;
    margin-bottom: var(--sp-3);
    overflow: hidden;
    padding: 9px 12px;
    position: relative;
}

.avm-save-mark {
    align-items: center;
    background: rgba(5, 150, 105, .16);
    border-radius: 50%;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.avm-save-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

    .avm-save-text strong {
        font-family: var(--font-display);
        font-feature-settings: "tnum" 1, "lnum" 1;
        font-size: calc(15px * var(--avm-font-scale));
        font-variant-numeric: tabular-nums lining-nums;
    }

        .avm-save-text strong::after {
            content: " saved";
            font-family: var(--font-body);
            font-size: calc(11px * var(--avm-font-scale));
            font-weight: 500;
            opacity: .8;
        }

    .avm-save-text span {
        font-size: calc(11px * var(--avm-font-scale));
        opacity: .85;
    }

.avm-save-banner.is-arriving {
    animation: avmSaveArrive .5s cubic-bezier(.2, .7, .3, 1);
}

    /* A single sweep of light across the band when the figure changes; nothing repeating. */
    .avm-save-banner.is-arriving::after {
        animation: avmSaveSheen .9s ease-out;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
        content: "";
        inset: 0 auto 0 0;
        pointer-events: none;
        position: absolute;
        width: 40%;
    }

.avm-price-row strong.is-struck {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: rgba(107, 114, 128, .55);
}

.avm-price-row strong.is-off {
    color: #047857;
}

.avm-price-row.is-total strong.is-changed {
    animation: avmTotalPop .45s ease-out;
}

@keyframes avmSaveArrive {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes avmSaveSheen {
    from {
        transform: translateX(-120%) skewX(-18deg);
    }

    to {
        transform: translateX(320%) skewX(-18deg);
    }
}

@keyframes avmTotalPop {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.07);
    }

    100% {
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .avm-save-banner.is-arriving,
    .avm-save-banner.is-arriving::after,
    .avm-price-row.is-total strong.is-changed {
        animation: none;
    }
}

form[data-avm-order-form] .avm-switch-pair {
    grid-template-columns: auto minmax(0, 1fr);
}

form[data-avm-order-form] .avm-field[data-avm-field="Address"] {
    grid-column: span 2 !important;
}

@media (max-width: 620px) {
    form[data-avm-order-form] .avm-field[data-avm-field="Address"] {
        grid-column: 1 / -1 !important;
    }
}

@media (min-width: 1025px) {
    .avm-reports .avm-finder {
        grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    }
}

/* Narrower than a full row, the finder pairs up instead of stacking one control per line:
   the mode switch beside its dates, the two print choices side by side, the button below. */
@media (max-width: 1024px) {
    .avm-reports .avm-finder {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .avm-reports .avm-finder-format {
        min-width: 0;
    }

    .avm-reports .avm-finder-go {
        grid-column: 1 / -1;
    }

    .avm-reports .avm-finder-pane[data-avm-pane="1"] {
        flex-wrap: nowrap;
    }

        .avm-reports .avm-finder-pane[data-avm-pane="1"] .avm-finder-field {
            flex: 1 1 0;
        }

            .avm-reports .avm-finder-pane[data-avm-pane="1"] .avm-finder-field .avm-input {
                min-width: 0;
                width: 100%;
            }
}

/* On a phone the switch and the dates each need the full width; the selects still pair. */
@media (max-width: 620px) {
    .avm-reports .avm-finder-modes,
    .avm-reports .avm-finder-inputs {
        grid-column: 1 / -1;
    }
}

/* ---------- toggle ---------- */
.avm-ptoggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.avm-ptoggle-track {
    position: relative;
    display: inline-block;
    width: 2.4rem;
    height: 1.3rem;
    border-radius: 999px;
    transition: background .2s;
    flex: none;
}

.avm-ptoggle-thumb {
    position: absolute;
    top: .15rem;
    left: .15rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    transition: transform .2s;
}

.avm-ptoggle.is-on .avm-ptoggle-track {
    background: #16a34a;
}

.avm-ptoggle.is-on .avm-ptoggle-thumb {
    transform: translateX(1.1rem);
}

.avm-ptoggle.is-on .avm-ptoggle-text {
    color: #15803d;
}

.avm-ptoggle.is-off .avm-ptoggle-track {
    background: #dc2626;
}

.avm-ptoggle.is-off .avm-ptoggle-text {
    color: #b91c1c;
}

.avm-ptoggle:focus-visible .avm-ptoggle-track {
    outline: 2px solid #1e3a8a;
    outline-offset: 2px;
}

.avm-profile-foot {
    gap: .5rem;
}

.avm-profile-edit-btn.is-locked {
    opacity: .6;
}

/* ---------- dialogs ---------- */
.avm-dialog {
    border: 0;
    border-radius: 14px;
    padding: 0;
    width: min(28rem,92vw);
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    overflow: hidden;
}

    .avm-dialog.is-wide {
        width: min(40rem,94vw);
    }

    .avm-dialog::backdrop {
        background: rgba(15,23,42,.55);
    }

.avm-dialog-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    max-height: 90vh;
    box-sizing: border-box;
}

.avm-dialog-title {
    margin: 0;
    font-size: 1.1rem;
    flex: none;
}

.avm-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: auto;
    min-height: 0;
    flex: 1 1 auto;
}

.avm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    flex: none;
}

.avm-dlg-field {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.avm-dlg-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #334155;
}

.avm-dialog .avm-input {
    position: static;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    flex: none;
}

.avm-dlg-readonly {
    background: #f1f5f9;
    color: #475569;
    cursor: default;
}

.avm-dlg-green, .avm-dlg-red, .avm-dlg-primary {
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .55rem 1rem;
    cursor: pointer;
    font-weight: 600;
}

.avm-dlg-green {
    background: #16a34a;
}

.avm-dlg-red {
    background: #dc2626;
}

.avm-dlg-primary {
    background: #1e3a8a;
}

.avm-dlg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    max-height: 7rem;
    overflow: auto;
    flex: none;
}

.avm-dlg-chip-x {
    border: 0;
    background: none;
    margin-left: .35rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.avm-dlg-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: none;
    max-height: min(40vh,15rem);
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.avm-dlg-option {
    display: flex;
    gap: .6rem;
    padding: .55rem .75rem;
    cursor: pointer;
}

    .avm-dlg-option:hover {
        background: #f1f5f9;
    }
/* ============================================================================
   VAi assistant
   A panel, not a page. It opens over whatever the client is already looking at
   from the launcher in the corner, so asking a question never costs them their
   place. Its own class names throughout: nothing here is shared with a dialog
   or a list elsewhere, so a hidden panel can never restyle a row on the page
   behind it.
   ========================================================================== */

.avm-vai-panel {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 950;
    display: flex;
    flex-direction: column;
    width: min(540px, calc(100vw - 32px));
    height: min(720px, calc(100vh - 140px));
    background: var(--avm-surface);
    border: 1px solid var(--avm-border);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(17, 24, 39, .26);
    overflow: hidden;
    transform-origin: 100% 100%;
    animation: avm-vai-open .2s cubic-bezier(.2, .8, .3, 1) both;
}

    .avm-vai-panel[hidden] {
        display: none;
    }

@keyframes avm-vai-open {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.avm-vai-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    background: linear-gradient(135deg, var(--avm-ai), var(--avm-ai-dark));
    color: #fff;
}

.avm-vai-head-mark {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--avm-surface);
    border-radius: 50%;
}

    .avm-vai-head-mark img {
        width: 24px;
        height: 24px;
    }

.avm-vai-head-text {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}

.avm-vai-head-title {
    display: block;
    font-size: calc(.92rem * var(--avm-font-scale));
    font-weight: 700;
}

.avm-vai-head-sub {
    display: block;
    color: rgba(255, 255, 255, .82);
    font-size: calc(.7rem * var(--avm-font-scale));
}

.avm-vai-head-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, .16);
    border: 0;
    border-radius: 9px;
    color: #fff;
    cursor: pointer;
    transition: background .15s ease;
}

    .avm-vai-head-btn svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

    .avm-vai-head-btn:hover,
    .avm-vai-head-btn.is-on {
        background: rgba(255, 255, 255, .3);
    }

/* The body holds the conversation; the chat list slides over it rather than
   taking a column, because a panel this wide has no room for two. */
.avm-vai-body {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.avm-vai-aside {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 11px;
    background: var(--avm-surface);
    animation: avm-vai-slide .18s ease both;
}

    .avm-vai-aside[hidden] {
        display: none;
    }

@keyframes avm-vai-slide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.avm-vai-new {
    width: 100%;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--avm-ai), var(--avm-ai-dark));
    border-color: transparent;
}

    .avm-vai-new:hover {
        background: var(--avm-ai-dark);
        border-color: transparent;
    }

    .avm-vai-new svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
    }

.avm-vai-search {
    position: relative;
    display: block;
}

    .avm-vai-search svg {
        position: absolute;
        left: 10px;
        top: 50%;
        width: 15px;
        height: 15px;
        transform: translateY(-50%);
        fill: var(--avm-muted);
        pointer-events: none;
    }

    .avm-vai-search .avm-input {
        padding-left: 32px;
    }

.avm-vai-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    padding-right: 2px;
}

.avm-vai-list-empty {
    margin: 18px 6px;
    color: var(--avm-muted);
    font-size: calc(.82rem * var(--avm-font-scale));
    text-align: center;
}

.avm-vai-chat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 2px 4px 2px 2px;
    transition: background .18s ease, border-color .18s ease;
}

    .avm-vai-chat:hover {
        background: var(--avm-ai-tint);
        border-color: var(--avm-ai-edge);
    }

    .avm-vai-chat.is-active {
        background: var(--avm-ai-tint);
        border-color: var(--avm-ai-edge);
    }

    .avm-vai-chat.is-pinned .avm-vai-chat-title::before {
        content: "";
        display: inline-block;
        width: 6px;
        height: 6px;
        margin-right: 6px;
        border-radius: 50%;
        background: var(--avm-ai);
        vertical-align: middle;
    }

.avm-vai-chat-open {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: none;
    border: 0;
    padding: 8px;
    text-align: left;
    cursor: pointer;
}

.avm-vai-chat-title {
    overflow: hidden;
    color: var(--avm-text);
    font-size: calc(.84rem * var(--avm-font-scale));
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avm-vai-chat-when {
    color: var(--avm-muted);
    font-size: calc(.72rem * var(--avm-font-scale));
}

.avm-vai-chat-tools {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .18s ease;
}

.avm-vai-chat:hover .avm-vai-chat-tools,
.avm-vai-chat:focus-within .avm-vai-chat-tools {
    opacity: 1;
}

.avm-vai-chat-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: none;
    border: 0;
    border-radius: 7px;
    color: var(--avm-muted);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

    .avm-vai-chat-tool svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }

    .avm-vai-chat-tool:hover {
        background: var(--avm-surface);
        color: var(--avm-ai);
    }

    .avm-vai-chat-tool.is-danger:hover {
        color: var(--avm-danger);
    }

.avm-vai-rename {
    width: 100%;
    margin: 4px 0;
}

.avm-vai-thread {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 14px 14px 6px;
    scroll-behavior: smooth;
}

    .avm-vai-thread:focus-visible {
        outline: 2px solid var(--avm-ai);
        outline-offset: -2px;
    }

.avm-vai-turn {
    display: flex;
    gap: 8px;
    max-width: 96%;
    animation: avm-vai-rise .24s ease both;
}

    .avm-vai-turn.is-vai {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        max-width: 100%;
    }

    .avm-vai-turn.is-client {
        flex-direction: row-reverse;
        margin-left: auto;
        max-width: 86%;
    }

@keyframes avm-vai-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.avm-vai-avatar {
    display: none !important;
}

.avm-vai-turn.is-vai .avm-vai-bubble {
    width: 100%;
    border-radius: 12px;
}

/* The dots sit on their own rather than in a bubble the width of the panel, and lift as
   they pulse so the wait reads as something happening. */
.avm-vai-turn.is-vai .avm-vai-thinking {
    width: auto;
    border-radius: 13px;
    animation: avm-vai-float 2.4s ease-in-out infinite;
}

@keyframes avm-vai-float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.avm-vai-bubble {
    position: relative;
    min-width: 0;
    background: var(--avm-surface);
    border: 1px solid var(--avm-ai-edge);
    border-radius: 13px 13px 13px 4px;
    padding: 10px 12px;
    color: var(--avm-ai-ink);
    font-size: calc(.84rem * var(--avm-font-scale));
    line-height: 1.55;
}

.avm-vai-turn.is-client .avm-vai-bubble {
    background: linear-gradient(135deg, var(--avm-ai), var(--avm-ai-dark));
    border-color: transparent;
    border-radius: 13px 13px 4px;
    box-shadow: 0 6px 16px rgba(31, 36, 46, .18);
    color: #fff;
}

.avm-vai-bubble p {
    margin: 0 0 8px;
}

    .avm-vai-bubble p:last-of-type {
        margin-bottom: 0;
    }

.avm-vai-bullets {
    margin: 0 0 4px;
    padding-left: 18px;
}

    .avm-vai-bullets li {
        margin-bottom: 3px;
    }

.avm-vai-stamp {
    display: block;
    margin-top: 6px;
    color: var(--avm-muted);
    font-size: calc(.66rem * var(--avm-font-scale));
}

.avm-vai-turn.is-client .avm-vai-stamp {
    color: rgba(255, 255, 255, .74);
}

.avm-vai-thinking {
    display: flex;
    gap: 5px;
    padding: 14px 15px;
}

    .avm-vai-thinking span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--avm-ai);
        opacity: .4;
        animation: avm-vai-pulse 1.1s ease-in-out infinite;
    }

        .avm-vai-thinking span:nth-child(2) {
            animation-delay: .15s;
        }

/* The blanket reduced-motion rule stops every animation on the page, which leaves the
   waiting dots frozen - and a progress indicator that never changes reads as hung. They
   keep a gentle fade here, with no movement, so the preference is still honoured. */
@media (prefers-reduced-motion: reduce) {
    .avm-vai-thinking span {
        animation: avm-vai-fade 1.4s ease-in-out infinite !important;
        animation-iteration-count: infinite !important;
    }
}

@keyframes avm-vai-fade {
    0%, 70%, 100% {
        opacity: .25;
    }

    35% {
        opacity: 1;
    }
}

.avm-vai-thinking span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes avm-vai-pulse {
    0%, 60%, 100% {
        opacity: .3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.avm-vai-welcome {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    text-align: center;
    animation: avm-vai-rise .3s ease both;
}

.avm-vai-spark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
}

    .avm-vai-spark img {
        width: 76px;
        height: 76px;
    }

.avm-vai-welcome h2 {
    margin: 4px 0 0;
    font-size: calc(1rem * var(--avm-font-scale));
}

.avm-vai-welcome p {
    margin: 0;
    color: var(--avm-muted);
    font-size: calc(.8rem * var(--avm-font-scale));
}

.avm-vai-prompts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
}

.avm-vai-prompt {
    background: var(--avm-surface);
    border: 1px solid var(--avm-border);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--avm-text);
    font-size: calc(.78rem * var(--avm-font-scale));
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}

    .avm-vai-prompt:hover {
        background: var(--avm-ai-tint);
        border-color: var(--avm-ai);
        color: var(--avm-ai-dark);
    }

.avm-vai-composer {
    padding: 9px 12px 12px;
    border-top: 1px solid var(--avm-border);
}

.avm-vai-composer-box {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    background: var(--avm-bg);
    border: 1px solid var(--avm-border);
    border-radius: 13px;
    padding: 6px 6px 6px 12px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

    .avm-vai-composer-box:focus-within {
        border-color: var(--avm-ai);
        box-shadow: 0 0 0 3px rgba(51, 58, 71, .14);
    }

.avm-vai-input {
    flex: 1;
    max-height: 130px;
    background: none;
    border: 0;
    padding: 6px 0;
    color: var(--avm-text);
    font: inherit;
    font-size: calc(.85rem * var(--avm-font-scale));
    line-height: 1.5;
    resize: none;
}

    .avm-vai-input:focus {
        outline: none;
    }

.avm-vai-send {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--avm-ai), var(--avm-ai-dark));
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease, opacity .16s ease;
}

    .avm-vai-send svg {
        width: 16px;
        height: 16px;
        fill: #fff;
    }

    .avm-vai-send:hover:not(:disabled) {
        background: var(--avm-ai-dark);
        transform: translateY(-1px);
    }

    .avm-vai-send:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.avm-vai-offline {
    margin: auto;
    padding: 24px;
    color: var(--avm-muted);
    font-size: calc(.82rem * var(--avm-font-scale));
    text-align: center;
}

/* Its own container class, used by nothing else. */
.avm-vai-confirm {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, .45);
    animation: avm-vai-fade .16s ease both;
}

    .avm-vai-confirm[hidden] {
        display: none;
    }

@keyframes avm-vai-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.avm-vai-confirm-panel {
    width: min(380px, calc(100vw - 32px));
    background: var(--avm-surface);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 20px 50px rgba(17, 24, 39, .28);
    animation: avm-vai-rise .2s ease both;
}

.avm-vai-confirm-title {
    margin: 0 0 8px;
    font-size: calc(1rem * var(--avm-font-scale));
}

.avm-vai-confirm-text {
    margin: 0 0 18px;
    color: var(--avm-muted);
    font-size: calc(.84rem * var(--avm-font-scale));
}

.avm-vai-confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* On a phone the panel is the screen; a 430px card pinned to a corner is not
   usable at that width. */
@media (max-width: 560px) {
    .avm-vai-panel {
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        border: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .avm-vai-panel,
    .avm-vai-aside,
    .avm-vai-turn,
    .avm-vai-welcome,
    .avm-vai-confirm,
    .avm-vai-confirm-panel {
        animation: none;
    }

    .avm-vai-thinking span {
        animation-duration: 0s;
    }

    .avm-vai-thread {
        scroll-behavior: auto;
    }
}

/* The VAi launcher. Sits on every portal page, out of the way of the content
   and above it, so the assistant is one click from wherever a client already
   is. It carries the assistant's own colour, never the portal's. */
.avm-vai-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: 64px;
    padding: 0 8px;
    background: var(--avm-surface);
    border: 1px solid var(--avm-border);
    border-radius: 999px;
    box-shadow: 0 16px 38px rgba(31, 36, 46, .24);
    color: var(--avm-ai-ink);
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, gap .2s ease, padding .2s ease;
}

    .avm-vai-launcher:hover,
    .avm-vai-launcher:focus-visible {
        gap: 4px;
        padding: 0 20px 0 8px;
        box-shadow: 0 20px 46px rgba(31, 36, 46, .3);
        color: var(--avm-ai-ink);
        transform: translateY(-3px);
    }

/* The mark is the VAi logo, which turns on its own inside the file. The ring
   around it is the portal's: a slow red pulse that says the assistant is there
   without competing with the logo's own movement. */
.avm-vai-launcher-mark {
    position: relative;
    display: inline-flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

    .avm-vai-launcher-mark img {
        width: 40px;
        height: 40px;
    }

    .avm-vai-launcher-mark::after {
        content: "";
        position: absolute;
        inset: -6px;
        border-radius: 50%;
        border: 2px solid var(--avm-accent);
        opacity: 0;
        animation: avm-vai-breathe 3.6s ease-out infinite;
    }

@keyframes avm-vai-breathe {
    0% {
        opacity: .5;
        transform: scale(.78);
    }

    70%, 100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

.avm-vai-launcher-text {
    max-width: 0;
    overflow: hidden;
    font-size: calc(.86rem * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: max-width .24s ease;
}

.avm-vai-launcher:hover .avm-vai-launcher-text,
.avm-vai-launcher:focus-visible .avm-vai-launcher-text {
    max-width: 120px;
}

@media (max-width: 640px) {
    .avm-vai-launcher {
        right: 16px;
        bottom: 16px;
        height: 58px;
    }

    .avm-vai-launcher-mark,
    .avm-vai-launcher-mark img {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .avm-vai-launcher,
    .avm-vai-launcher-text {
        transition: none;
    }

    .avm-vai-launcher-mark::after {
        animation: none;
    }
}

/* A table of rows inside an answer - billing by patient, a workload by test.
   Same reading rules as every other table in the portal: bold header, numbers
   to the right, and it scrolls sideways rather than breaking the bubble. */
.avm-vai-table-wrap {
    margin: 4px 0 8px;
    overflow-x: auto;
}

.avm-vai-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--avm-ai-edge);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    font-size: calc(.8rem * var(--avm-font-scale));
}

    .avm-vai-table th,
    .avm-vai-table td {
        padding: 7px 10px;
        border-bottom: 1px solid var(--avm-ai-edge);
        border-right: 1px solid var(--avm-ai-edge);
        text-align: left;
        white-space: nowrap;
    }

        .avm-vai-table th:last-child,
        .avm-vai-table td:last-child {
            border-right: 0;
        }

    .avm-vai-table tbody tr:nth-child(even) td {
        background: var(--avm-ai-tint);
    }

    .avm-vai-table th {
        background: var(--avm-ai-tint);
        color: var(--avm-ai-ink);
        font-weight: 700;
        border-bottom-width: 2px;
    }

    .avm-vai-table td {
        color: var(--avm-text);
    }

    .avm-vai-table .is-num {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .avm-vai-table tbody tr:last-child td {
        border-bottom: 0;
    }

.avm-vai-chip.is-page {
    background: var(--avm-ai);
    border-color: var(--avm-ai);
    color: #fff;
    font-weight: 600;
}

    .avm-vai-chip.is-page:hover,
    .avm-vai-chip.is-page:focus-visible {
        background: var(--avm-ai-dark);
        border-color: var(--avm-ai-dark);
        color: #fff !important;
    }

/* "Status: Available in your rate card" reads as a labelled fact, not a sentence. */
.avm-vai-facts {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 12px;
    margin: 2px 0 8px;
}

    .avm-vai-facts dt {
        color: var(--avm-ai-ink);
        font-weight: 700;
    }

    .avm-vai-facts dd {
        margin: 0;
        color: var(--avm-text);
    }

/* A fact card inside an answer: the figures laid out rather than written out. */
.avm-vai-card {
    margin: 0 0 9px;
    background: var(--avm-ai-tint);
    border: 1px solid var(--avm-ai-edge);
    border-radius: 10px;
    padding: 10px 12px;
}

.avm-vai-card-title {
    margin: 0 0 7px;
    color: var(--avm-ai-ink);
    font-size: calc(.82rem * var(--avm-font-scale));
    font-weight: 700;
    line-height: 1.35;
}

.avm-vai-card dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 12px;
    margin: 0;
}

.avm-vai-card dt {
    color: var(--avm-muted);
    font-size: calc(.76rem * var(--avm-font-scale));
}

.avm-vai-card dd {
    margin: 0;
    color: var(--avm-text);
    font-size: calc(.8rem * var(--avm-font-scale));
    font-weight: 600;
}

/* Tappable. A choice settles which thing they meant; a suggestion is what people
   usually want next. Choices read as the stronger of the two. */
.avm-vai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 2px 0;
    animation: avm-vai-rise .24s ease both;
}

.avm-vai-chip {
    background: var(--avm-surface);
    border: 1px solid var(--avm-border);
    border-radius: 999px;
    padding: 6px 13px;
    color: var(--avm-text);
    font-size: calc(.76rem * var(--avm-font-scale));
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}

    .avm-vai-chip:hover {
        background: var(--avm-ai-tint);
        border-color: var(--avm-ai);
        color: var(--avm-ai-dark);
    }

    .avm-vai-chip.is-page:hover,
    .avm-vai-chip.is-page:focus-visible {
        background: var(--avm-ai-dark);
        border-color: var(--avm-ai-dark);
        color: #fff !important;
    }

.avm-vai-chips.is-choice .avm-vai-chip {
    border-color: var(--avm-ai-edge);
    font-weight: 600;
}

/* ==========================================================================
   Order Entry Mobile OTP Verification
   ========================================================================== */

.avm-mobile-field-control {
    position: relative;
    display: flex;
    align-items: stretch;
}

    .avm-mobile-field-control .avm-mobile-input,
    .avm-field-control.has-affix .avm-mobile-input {
        flex: 1 1 auto;
        padding-right: 100px;
        border-radius: 0 var(--r-sm) var(--r-sm) 0;
    }

.avm-mobile-validate-btn,
button.avm-mobile-validate-btn,
button.avm-btn.avm-mobile-validate-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #005d9e;
    color: #fff;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    line-height: 1;
    height: 24px !important;
    min-height: 0 !important;
    max-height: 24px !important;
    padding: 0 12px !important;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    margin: 0;
    transition: background .15s ease, opacity .15s ease, transform .1s ease;
}

    .avm-mobile-validate-btn:hover,
    button.avm-mobile-validate-btn:hover,
    button.avm-btn.avm-mobile-validate-btn:hover {
        background: #004b80;
        color: #fff;
    }

    .avm-mobile-validate-btn:active,
    button.avm-mobile-validate-btn:active,
    button.avm-btn.avm-mobile-validate-btn:active {
        transform: translateY(-50%) scale(.98);
    }

    .avm-mobile-validate-btn:disabled,
    button.avm-mobile-validate-btn:disabled,
    button.avm-btn.avm-mobile-validate-btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.avm-mobile-verified-badge {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    height: 24px !important;
    min-height: 0 !important;
    max-height: 24px !important;
    padding: 0 8px !important;
    border-radius: 9999px;
    z-index: 5;
    box-sizing: border-box;
    margin: 0;
}

.avm-verify-mobile-dialog {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    z-index: 1050;
    padding: var(--sp-3);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

    .avm-verify-mobile-dialog.is-open,
    .avm-modal-backdrop.avm-verify-mobile-dialog.is-open {
        display: flex !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

.avm-verify-mobile-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);
    max-width: 440px;
    width: min(440px, 100%);
    overflow: hidden;
    transform: scale(.95) translateY(-8px);
    transition: transform .2s cubic-bezier(.22, 1, .36, 1);
}

.avm-verify-mobile-dialog.is-open .avm-verify-mobile-card {
    transform: scale(1) translateY(0);
}

.avm-verify-mobile-head {
    padding: 20px 24px 12px;
    background: #fff;
    border-bottom: none;
}

.avm-verify-mobile-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avm-verify-mobile-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.avm-verify-mobile-close {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .avm-verify-mobile-close:hover {
        background: #f3f4f6;
        color: #111827;
    }

.avm-verify-mobile-sub {
    font-size: 13px;
    color: #4b5563;
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .avm-verify-mobile-sub strong {
        color: #111827;
        font-weight: 600;
    }

.avm-verify-change-btn {
    background: none;
    border: none;
    color: #0284c7;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

    .avm-verify-change-btn:hover {
        color: #0369a1;
    }

.avm-verify-mobile-body {
    padding: 12px 24px 20px;
}

    .avm-verify-mobile-body .avm-field-label {
        display: block;
        font-size: 12.5px;
        font-weight: 600;
        color: #374151;
        margin-bottom: 10px;
    }

.avm-otp-box-group {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.avm-otp-box {
    width: 48px;
    height: 50px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .avm-otp-box:focus {
        border-color: #0284c7;
        box-shadow: 0 0 0 3px rgba(2, 132, 199, .15);
    }

.avm-otp-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #4b5563;
    margin-top: 8px;
}

.avm-otp-resend-link {
    background: none;
    border: none;
    color: #0284c7;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

    .avm-otp-resend-link:hover {
        text-decoration: underline;
    }

.avm-otp-error-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12.5px;
    margin-top: 14px;
}

.avm-verify-mobile-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #fff;
    border-top: none;
}

    .avm-verify-mobile-foot .avm-btn-secondary {
        background: #fff;
        border: 1px solid #d1d5db;
        color: #374151;
        font-weight: 500;
        padding: 8px 18px;
        border-radius: 8px;
    }
        .avm-verify-mobile-foot .avm-btn-secondary:hover {
            background: #f9fafb;
            border-color: #9ca3af;
        }

    .avm-verify-mobile-foot .avm-btn-primary {
        background: #005d9e;
        color: #fff;
        font-weight: 600;
        padding: 8px 22px;
        border-radius: 8px;
        border: none;
    }

.avm-verify-mobile-foot .avm-btn-primary:hover {
    background: #004b80;
}

/* Additional test (Order view panel): the sample the tests go on, drawn like order entry's barcode row */
.avm-addtest-flow {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
}

.avm-barcode-row.avm-addtest-sample-row {
    cursor: pointer;
    grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr) auto;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.avm-addtest-sample-row:hover {
    background: var(--field-hover);
    border-color: var(--field-line-strong);
}

.avm-addtest-sample-row.is-selected {
    background: var(--brand-soft);
    border-color: var(--brand-mid);
    box-shadow: inset 0 0 0 1px var(--brand-mid);
}

.avm-addtest-sample-code {
    color: var(--ink);
    letter-spacing: .4px;
}

.avm-addtest-sample-radio {
    accent-color: var(--brand);
    height: 18px;
    margin: 0;
    width: 18px;
}

.avm-addtest-flow [data-avm-addtest-status] {
    margin: 8px 0 0;
}
/* ==========================================================================
   Order view > Edit tests > Review changes dialog (.otc)
   Paste in client-ui.css BEFORE the block that starts with
   "Order view > Edit tests > billing table, minimum-billing bar, suggestions".
   ========================================================================== */

.avm-modal-backdrop.otc,
.avm-order-confirm.otc {
    z-index: 2000 !important;
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(4px) !important;
}

.otc .avm-order-confirm-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25);
    border-radius: 16px;
    max-width: 960px;
    color: #0f172a;
}

.otc .avm-order-confirm-head.otc-head {
    background: linear-gradient(90deg, #122256 0%, #1e3a8a 100%);
    border-bottom: 2px solid #38bdf8;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.otc .otc-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.otc .avm-order-confirm-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
    display: grid;
    place-items: center;
}

.otc .avm-order-confirm-mark svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.otc .avm-order-confirm-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.01em;
}

.otc .otc-head-order-badge {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #e0f2fe;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 700;
    font-size: 12.5px;
    padding: 2px 8px;
    border-radius: 6px;
}

.otc .otc-head-center {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
}

.otc .otc-head-patient-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 13px;
    max-width: 100%;
}

.otc .otc-head-patient-icon {
    display: inline-flex;
    align-items: center;
    color: #38bdf8;
}

.otc .otc-head-patient-name {
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.otc .otc-head-meta {
    color: #cbd5e1;
    font-size: 12px;
    white-space: nowrap;
}

.otc .avm-order-confirm-close {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
    flex-shrink: 0;
}

.otc .avm-order-confirm-close:hover {
    color: #ffffff;
}

.otc .avm-order-confirm-body {
    background: #f8fafc;
    padding: 16px 20px;
    max-height: calc(88vh - 120px);
    overflow-y: auto;
}

.otc .avm-confirm-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 768px) {
    .otc .avm-confirm-grid {
        grid-template-columns: 1.15fr 1fr;
        gap: 16px;
        align-items: start;
    }

    .otc .avm-confirm-block[data-avm-confirm-added-block] {
        grid-column: 1 / 2;
    }

    .otc .avm-confirm-block[data-avm-confirm-removed-block] {
        grid-column: 2 / 3;
    }

    .otc .avm-confirm-block[data-avm-confirm-added-block].is-full {
        grid-column: 1 / -1;
    }

    .otc .avm-confirm-block[data-avm-confirm-removed-block].is-full {
        grid-column: 1 / -1;
    }

    .otc .otc-left-col {
        grid-column: 1 / 2;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .otc .otc-right-col {
        grid-column: 2 / 3;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
}

.otc .avm-confirm-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.otc .avm-confirm-block-title {
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-bottom: 8px;
    margin: 0 0 10px 0;
}

/* Added Tests Card: Solid emerald border & soft clean background */
.otc .avm-confirm-block[data-avm-confirm-added-block] {
    background: #f0fdf4;
    border: 1.5px solid #10b981;
    border-left: 5px solid #10b981;
}

.otc .avm-confirm-block[data-avm-confirm-added-block] .avm-confirm-block-title {
    color: #047857;
    border-bottom-color: #bbf7d0;
}

.otc-change-row.is-added {
    background: #ffffff;
    border: 1px solid #86efac;
    border-left: 3px solid #10b981;
    border-radius: 8px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.otc-change-badge.is-added {
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 10.5px;
    letter-spacing: 0.04em;
}

.otc-change-code {
    color: #0f172a;
    font-weight: 800;
    font-size: 14px;
}

.otc-change-name {
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
}

.otc-change-price {
    color: #047857;
    font-weight: 800;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 13.5px;
}

/* Removed Tests Card: Solid rose border & soft clean background */
.otc .avm-confirm-block[data-avm-confirm-removed-block] {
    background: #fff1f2;
    border: 1.5px solid #f43f5e;
    border-left: 5px solid #f43f5e;
}

.otc .avm-confirm-block[data-avm-confirm-removed-block] .avm-confirm-block-title {
    color: #be123c;
    border-bottom-color: #fecdd3;
}

.otc-change-row.is-removed {
    background: #ffffff;
    border: 1px solid #fca5a5;
    border-left: 3px solid #f43f5e;
    border-radius: 8px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.otc-change-badge.is-removed {
    background: #f43f5e;
    color: #ffffff;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 10.5px;
}

/* All Tests Included on Order: Clean white card & dark readable text */
.otc .otc-confirm-block-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.otc .otc-confirm-block-head .avm-confirm-block-title {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
    color: #0f172a;
}

.otc .otc-count-pill {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11.5px;
    font-weight: 700;
}

.otc .otc-tests-list {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 190px;
    overflow-y: auto;
}

.otc .otc-tests-item {
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
}

.otc .otc-tests-item:last-child {
    border-bottom: none;
}

.otc .otc-tests-item.is-newly-added {
    background: #f0fdf4;
    border-left: 3px solid #10b981;
}

.otc .otc-tests-item:not(.is-newly-added) {
    border-left: 3px solid #cbd5e1;
}

.otc .otc-tests-item .otc-change-code {
    color: #0f172a;
    font-weight: 800;
    font-size: 13.5px;
}

.otc .otc-tests-item .otc-change-name {
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
}

.otc .otc-tests-item .otc-change-price {
    color: #0f172a;
    font-weight: 800;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 13.5px;
}

.otc .otc-tests-tag.is-added {
    background: #10b981;
    color: #ffffff;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10.5px;
}

.otc .otc-tests-tag.is-kept {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10.5px;
}

/* Order Amount: Clean white card with crisp contrast */
.otc .is-billing-block {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.otc .is-billing-block .avm-confirm-block-title {
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
}

.otc .otc-bill {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.otc .otc-bill-row {
    display: grid;
    grid-template-columns: 1fr 90px 90px;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
    align-items: center;
}

.otc .otc-bill-row b {
    text-align: right;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 800;
    color: #0f172a;
}

.otc .otc-bill-row.is-head {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.otc .otc-bill-row.is-total {
    background: #f8fafc;
    border-top: 1.5px solid #cbd5e1;
    font-weight: 800;
    color: #0f172a;
    padding: 8px 10px;
    margin-top: 4px;
}

.otc .otc-bill-row.is-total span {
    font-size: 13.5px;
    font-weight: 800;
}

.otc .otc-bill-row.is-total b {
    font-size: 15px;
    color: #1e3a8a;
}

.otc .otc-delta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 8px;
    font-weight: 700;
}

.otc .otc-delta.is-up {
    background: #ecfdf5;
    border: 1.5px solid #10b981;
    color: #047857;
}

.otc .otc-delta.is-up strong {
    font-size: 20px;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    color: #047857;
    font-weight: 800;
}

.otc .otc-delta.is-down {
    background: #fff1f2;
    border: 1.5px solid #f43f5e;
    color: #be123c;
}

.otc .otc-delta.is-down strong {
    font-size: 20px;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    color: #be123c;
    font-weight: 800;
}

.otc .otc-delta.is-flat {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

/* Samples Block */
.otc .otc-samples {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.otc .otc-sample {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #2b2f8f;
    border-radius: 8px;
    padding: 8px 12px;
    display: grid;
    gap: 8px 12px;
    grid-template-columns: minmax(110px, .8fr) minmax(0, 1fr) auto;
    align-items: center;
}

.otc .otc-sample-name {
    color: #0f172a;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.otc .otc-sample-name svg {
    fill: #2b2f8f;
    width: 16px;
    height: 16px;
}

.otc .otc-code {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #2b2f8f;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 700;
    font-size: 12.5px;
    padding: 3px 8px;
    border-radius: 6px;
}

.otc .otc-tag {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
}

.otc .otc-sample .avm-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 12.5px;
    padding: 6px 10px;
    border-radius: 6px;
}

/* Footer: Clean light footer */
.otc .avm-order-confirm-foot {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 14px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.otc .avm-order-confirm-foot .avm-dialog-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    border-radius: 8px;
    height: 40px;
    font-weight: 600;
    padding: 0 18px;
    cursor: pointer;
    font-size: 13px;
}

.otc .avm-order-confirm-foot .avm-dialog-btn:hover {
    background: #f1f5f9;
}

.otc .avm-order-confirm-foot .avm-dialog-btn.is-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    font-weight: 700;
}

/* chips */
.otc .otc-chip {
    background: transparent;
    border-radius: var(--r-pill);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    padding: 3px 10px;
}

    .otc .otc-chip.is-added {
        border: 1px solid #00bfa6;
        color: var(--teal-ink);
    }

    .otc .otc-chip.is-removed {
        background: var(--red-soft);
        border: 1px solid rgba(220, 38, 38, .4);
        color: var(--red);
        text-decoration: line-through;
    }

/* samples */
.otc .otc-samples {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.otc .otc-sample {
    align-items: center;
    background: var(--field);
    border: 1px solid var(--field-line);
    border-left: 3px solid var(--brand-mid);
    border-radius: var(--r-sm);
    display: grid;
    gap: 6px 10px;
    grid-template-columns: minmax(110px, .8fr) minmax(0, 1fr) auto;
    padding: 8px 10px;
}

    .otc .otc-sample.is-new {
        border-left-color: #00bfa6;
        grid-template-columns: minmax(110px, .8fr) minmax(0, 1fr) minmax(0, 1fr) 22px;
    }

    .otc .otc-sample.is-match {
        background: rgba(5, 150, 105, .06);
        border-color: rgba(5, 150, 105, .45);
        border-left-color: var(--green);
    }

    .otc .otc-sample.is-invalid {
        background: var(--red-soft);
        border-color: rgba(220, 38, 38, .35);
        border-left-color: var(--red);
    }

.otc .otc-sample-name {
    align-items: center;
    color: var(--ink-2);
    display: inline-flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 700;
    gap: 7px;
    min-width: 0;
}

    /* fixes the giant tube icon */
    .otc .otc-sample-name svg {
        fill: var(--brand-mid);
        flex: 0 0 17px;
        height: 17px;
        width: 17px;
    }

    .otc .otc-sample-name span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.otc .otc-code {
    background: var(--brand-soft);
    border-radius: var(--r-xs);
    color: var(--brand-mid);
    font-family: var(--font-num);
    letter-spacing: .05em;
    padding: 3px 8px;
    width: fit-content;
}

.otc .otc-tag {
    background: var(--mint);
    border-radius: var(--r-pill);
    color: var(--green-ink);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 9px;
    text-transform: uppercase;
    white-space: nowrap;
}

.otc .otc-sample .avm-input {
    background: var(--card);
    font-family: var(--font-num);
    letter-spacing: .06em;
    text-transform: uppercase;
}

    .otc .otc-sample .avm-input::placeholder {
        font-family: var(--font-body);
        letter-spacing: normal;
        text-transform: none;
    }

    .otc .otc-sample .avm-input.is-invalid {
        border-color: var(--red);
        box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
    }

.otc .otc-sample.is-match .avm-input {
    border-color: var(--green);
}

.otc .otc-check {
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.otc .otc-sample.is-match .otc-check {
    color: var(--green);
}

.otc .otc-sample.is-invalid .otc-check {
    color: var(--red);
}

.otc .otc-hint {
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
    grid-column: 1 / -1;
    min-height: 1em;
}

.otc .otc-sample.is-match .otc-hint {
    color: var(--green);
}

.otc .otc-sample.is-invalid .otc-hint {
    color: var(--red);
}

.otc .avm-dialog-btn.is-primary:disabled {
    cursor: not-allowed;
    opacity: .45;
}

@media (max-width: 720px) {
    .otc .otc-sample,
    .otc .otc-sample.is-new {
        grid-template-columns: minmax(0, 1fr) 22px;
    }

        .otc .otc-sample.is-new .otc-sample-name,
        .otc .otc-sample.is-new .avm-input {
            grid-column: 1 / -1;
        }

        .otc .otc-sample.is-new .otc-check {
            display: none;
        }
}

/* ==========================================================================
   Order view > Edit tests > billing table, minimum-billing bar, suggestions
   Append at the END of client-ui.css, after order-tests-confirm.css.
   ========================================================================== */

.otc-live > * + * {
    margin-top: var(--sp-3);
}

.otc-live .is-busy {
    opacity: .55;
    transition: opacity .15s ease;
}

/* ---- Now / After table ---- */
.otc-bill {
    display: grid;
    gap: 2px;
}

.otc-bill-row {
    align-items: baseline;
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: minmax(0, 1.6fr) minmax(70px, 1fr) minmax(70px, 1fr);
    padding: 5px 0;
}

    .otc-bill-row span {
        color: var(--muted);
        font-size: calc(11.5px * var(--avm-font-scale));
    }

    .otc-bill-row b {
        color: var(--ink-2);
        font-family: var(--font-num);
        font-size: calc(12.5px * var(--avm-font-scale));
        font-weight: 500;
        text-align: right;
    }

    .otc-bill-row.is-head span,
    .otc-bill-row.is-head b {
        color: var(--muted-lt);
        font-family: var(--font-display);
        font-size: calc(9.5px * var(--avm-font-scale));
        font-weight: 700;
        letter-spacing: .12em;
        text-transform: uppercase;
    }

    .otc-bill-row.is-total {
        border-top: 1px solid var(--line-soft);
        margin-top: 2px;
        padding-top: 8px;
    }

        .otc-bill-row.is-total span {
            color: var(--ink-2);
            font-weight: 700;
        }

        .otc-bill-row.is-total b {
            color: var(--ink);
            font-size: calc(14px * var(--avm-font-scale));
            font-weight: 600;
        }

.otc-bill .otc-delta {
    align-items: baseline;
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: var(--r-sm);
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 8px 12px;
}

    .otc-bill .otc-delta span {
        color: var(--muted);
        font-size: calc(10px * var(--avm-font-scale));
        font-weight: 700;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

    .otc-bill .otc-delta strong {
        font-family: var(--font-num);
        font-size: calc(18px * var(--avm-font-scale));
        font-weight: 600;
    }

    .otc-bill .otc-delta.is-up strong {
        color: var(--cream-ink);
    }

    .otc-bill .otc-delta.is-down strong {
        color: var(--green);
    }

    .otc-bill .otc-delta.is-flat strong {
        color: var(--muted);
    }

/* ---- Minimum patient billing bar ---- */
.otc-headroom {
    background: var(--sky);
    border: 1px solid rgba(29, 78, 216, .14);
    border-radius: var(--r-sm);
    padding: 10px 12px;
}

    .otc-headroom.is-met {
        background: var(--mint);
        border-color: rgba(5, 150, 105, .25);
    }

.otc-headroom-top {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 4px var(--sp-3);
}

    .otc-headroom-top span {
        color: var(--muted);
        flex: 1;
        font-size: calc(10px * var(--avm-font-scale));
        font-weight: 700;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

    .otc-headroom-top b {
        font-family: var(--font-num);
        font-size: calc(12.5px * var(--avm-font-scale));
        font-weight: 500;
    }

    .otc-headroom-top em {
        background: var(--card);
        border-radius: var(--r-pill);
        color: var(--teal-ink);
        font-size: calc(10px * var(--avm-font-scale));
        font-style: normal;
        font-weight: 700;
        padding: 2px 9px;
    }

.otc-headroom-track {
    background: rgba(15, 23, 42, .08);
    border-radius: var(--r-pill);
    height: 6px;
    margin: 8px 0 6px;
    overflow: hidden;
}

    .otc-headroom-track span {
        background: linear-gradient(90deg, var(--accent), var(--brand-mid));
        border-radius: var(--r-pill);
        display: block;
        height: 100%;
        transition: width .4s cubic-bezier(.22, 1, .36, 1);
        width: 0;
    }

.otc-headroom.is-met .otc-headroom-track span {
    background: var(--green);
}

.otc-headroom p {
    color: var(--muted);
    font-size: calc(10.5px * var(--avm-font-scale));
    margin: 0;
}

.otc-sug-label {
    color: var(--muted);
    display: block;
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .1em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.otc-sug-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.otc-sug-chip {
    align-items: center;
    background: var(--card);
    border: 1px solid rgba(0, 191, 166, .5);
    border-radius: var(--r-pill);
    color: var(--teal-ink);
    cursor: pointer;
    display: inline-flex;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    gap: 8px;
    padding: 4px 11px;
    transition: box-shadow .15s ease, transform .15s ease;
}

    .otc-sug-chip strong {
        font-family: var(--font-num);
        font-weight: 500;
    }

    .otc-sug-chip:hover {
        box-shadow: 0 0 12px rgba(0, 191, 166, .25);
        transform: translateY(-1px);
    }

.otc .otc-amount, .otc [data-avm-confirm-price] > * + * {
    margin-top: var(--sp-3);
}

@media (prefers-reduced-motion: reduce) {
    .otc-headroom-track span, .otc-sug-chip {
        transition: none;
    }
}

/* ---- OTC Review Changes Patient & Tests List ---- */
.otc-confirm-patient-card {
    align-items: center;
    background: linear-gradient(135deg, var(--card) 0%, var(--brand-soft) 100%);
    border: 1px solid var(--field-line-strong);
    border-left: 4px solid var(--brand);
    border-radius: var(--r-sm);
    display: flex;
    gap: 12px;
    padding: 10px var(--sp-3);
}

.otc-confirm-patient-avatar {
    align-items: center;
    background: var(--brand-soft);
    border-radius: var(--r-pill);
    color: var(--brand);
    display: inline-flex;
    flex-shrink: 0;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.otc-confirm-patient-avatar svg {
    fill: currentColor;
    height: 22px;
    width: 22px;
}

.otc-confirm-patient-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.otc-confirm-patient-name {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(13.5px * var(--avm-font-scale));
    font-weight: 700;
}

.otc-confirm-patient-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: calc(11px * var(--avm-font-scale));
    gap: 6px 12px;
}

.otc-confirm-patient-meta strong {
    color: var(--ink-2);
    font-weight: 600;
}

.otc-change-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.otc-change-row {
    align-items: center;
    background: var(--bg);
    border-radius: var(--r-xs);
    display: flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    gap: 10px;
    padding: 6px 10px;
}

.otc-change-row.is-added {
    background: rgba(0, 191, 166, .06);
    border-left: 3px solid #00bfa6;
}

.otc-change-row.is-removed {
    background: var(--red-soft);
    border-left: 3px solid var(--red);
}

.otc-change-badge {
    border-radius: var(--r-pill);
    font-size: calc(10px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .03em;
    padding: 2px 7px;
    text-transform: uppercase;
    white-space: nowrap;
}

.otc-change-badge.is-added {
    background: #00bfa6;
    color: #fff;
}

.otc-change-badge.is-removed {
    background: var(--red);
    color: #fff;
}

.otc-change-info {
    align-items: baseline;
    display: flex;
    flex: 1;
    gap: 8px;
    min-width: 0;
}

.otc-change-code {
    color: var(--ink);
    font-family: var(--font-num);
    font-weight: 700;
    white-space: nowrap;
}

.otc-change-name {
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.otc-change-price {
    color: var(--ink);
    font-family: var(--font-num);
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    white-space: nowrap;
}

.otc-confirm-block-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.otc-count-pill {
    background: var(--brand-soft);
    border-radius: var(--r-pill);
    color: var(--brand);
    font-family: var(--font-num);
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
    padding: 2px 8px;
}

.otc-tests-list {
    border: 1px solid var(--line-soft);
    border-radius: var(--r-xs);
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
}

.otc-tests-item {
    align-items: center;
    background: var(--card);
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    font-size: calc(11.5px * var(--avm-font-scale));
    gap: 10px;
    padding: 7px 10px;
}

.otc-tests-item:last-child {
    border-bottom: none;
}

.otc-tests-item.is-newly-added {
    background: rgba(0, 191, 166, .04);
}

.otc-tests-tag {
    border-radius: var(--r-pill);
    font-size: calc(9.5px * var(--avm-font-scale));
    font-weight: 700;
    letter-spacing: .03em;
    padding: 2px 7px;
    text-transform: uppercase;
    white-space: nowrap;
}

.otc-tests-tag.is-added {
    background: rgba(0, 191, 166, .15);
    color: var(--teal-ink);
}

.otc-tests-tag.is-kept {
    background: var(--field);
    color: var(--muted);
}
/* ==========================================================================
   Additional Test (Workspace > Additional test)
   ========================================================================== */

.avm-addtest-page .avm-at-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1360px;
    margin: 0 auto;
}

.avm-at-head {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.avm-at-ttl {
    display: flex;
    gap: 14px;
    align-items: center;
}

.avm-at-ico {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #eef0fb;
    color: #2b2f8f;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.avm-at-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #0f172a;
}

.avm-at-lede {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13.5px;
}

.avm-at-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

.avm-at-window {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 600;
    background: #e3f6f1;
    color: #0b7a62;
    border: 1px solid rgba(18, 180, 143, 0.25);
}

.avm-at-note-btn {
    background: #ffffff;
    border: 1px solid #d9dfec;
    color: #2b2f8f;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.avm-at-note-btn:hover {
    background: #eef0fb;
    border-color: #c5cbee;
}

/* 2. Barcode search bar */
.avm-at-bar {
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
    padding: 24px 26px 20px;
}

.avm-at-bar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #2b2f8f, #12b48f);
}

.avm-at-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

@media (max-width: 620px) {
    .avm-at-bar-row {
        grid-template-columns: 1fr;
    }
}

.avm-at-scanfield {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 14px;
    background: #f7f9fc;
    border: 1px solid #dfe5f0;
    border-radius: 14px;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.avm-at-scanfield:hover {
    border-color: #c9d2e4;
}

.avm-at-scanfield:focus-within {
    background: #ffffff;
    border-color: #2b2f8f;
    box-shadow: 0 0 0 4px rgba(43, 47, 143, 0.12);
}

.avm-at-scan-icon {
    color: #2b2f8f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.avm-at-scan-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #0f172a;
    text-transform: uppercase;
}

.avm-at-scan-input::placeholder {
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 14.5px;
    font-weight: 400;
    letter-spacing: 0;
    color: #94a3b8;
    text-transform: none;
}

.avm-at-kbd {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 11.5px;
    color: #64748b;
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 6px;
    padding: 3px 8px;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.avm-at-scanfield:focus-within .avm-at-kbd {
    opacity: 1;
}

.avm-at-scan-beam {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s;
}

.avm-at-scan-beam::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, #2b2f8f, transparent);
    transform: translateX(-100%);
}

.avm-at-scanfield.is-scanning .avm-at-scan-beam {
    opacity: 1;
}

.avm-at-scanfield.is-scanning .avm-at-scan-beam::after {
    animation: avm-at-slide 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes avm-at-slide {
    to { transform: translateX(250%); }
}

.avm-at-scan-btn {
    height: 56px;
    padding: 0 34px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #2b2f8f, #3a40b5);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 6px 16px rgba(43, 47, 143, 0.25);
    transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.avm-at-scan-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(43, 47, 143, 0.3);
    filter: brightness(1.05);
}

.avm-at-scan-btn:active {
    transform: none;
}

.avm-at-banner {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
}

.avm-at-banner.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.avm-at-banner.is-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

/* Stepper */
.avm-at-steps {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 0;
    list-style: none;
    margin: 20px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid #eef1f7;
}

.avm-at-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: color 0.3s;
}

.avm-at-step + .avm-at-step::before {
    content: "";
    width: 56px;
    height: 2px;
    margin: 0 14px;
    border-radius: 2px;
    background: linear-gradient(#2b2f8f, #2b2f8f) left/0 100% no-repeat, #e5e9f2;
    transition: background-size 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.avm-at-step.is-current::before,
.avm-at-step.is-done::before {
    background-size: 100% 100%, auto;
}

.avm-at-step-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid #cfd6e6;
    background: #ffffff;
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    transition: all 0.3s;
}

.avm-at-step-check {
    display: none;
}

.avm-at-step.is-current {
    color: #0f172a;
    font-weight: 700;
}

.avm-at-step.is-current .avm-at-step-dot {
    background: #2b2f8f;
    border-color: #2b2f8f;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(43, 47, 143, 0.15);
}

.avm-at-step.is-done {
    color: #334155;
}

.avm-at-step.is-done .avm-at-step-dot {
    background: #eef0fb;
    border-color: #2b2f8f;
    color: #2b2f8f;
}

.avm-at-step.is-done .avm-at-step-num {
    display: none;
}

.avm-at-step.is-done .avm-at-step-check {
    display: block;
}

/* 3. Note panel */
.avm-at-notes {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .avm-at-notes {
        grid-template-columns: 1fr;
    }
}

.avm-at-guide {
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 20px;
    padding: 24px 26px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.avm-at-stat {
    background: linear-gradient(135deg, #14235a, #2b2f8f);
    border-radius: 14px;
    padding: 20px 24px;
    color: #ffffff;
}

.avm-at-stat small {
    display: block;
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
    font-weight: 600;
}

.avm-at-stat strong {
    display: block;
    font-size: 38px;
    line-height: 1.1;
    margin: 4px 0 2px;
    letter-spacing: -0.02em;
}

.avm-at-stat strong em {
    font-style: normal;
    font-size: 16px;
    font-weight: 600;
    opacity: 0.85;
    margin-left: 6px;
}

.avm-at-stat p {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.45;
}

.avm-at-how-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.avm-at-how-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.avm-at-how-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.avm-at-how-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eef0fb;
    color: #2b2f8f;
    font-size: 12px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.avm-at-how-item h3 {
    margin: 0 0 2px;
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
}

.avm-at-how-item p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}

.avm-at-notes-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.avm-at-note {
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.avm-at-note-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef0fb;
    color: #2b2f8f;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.avm-at-note-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.avm-at-note p,
.avm-at-note li {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #334155;
}

.avm-at-note ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

/* 4. Cards & Patient details */
.avm-at-card {
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
    padding: 20px 22px;
}

.avm-at-patient-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avm-at-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2b2f8f, #3a40b5);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    flex: 0 0 auto;
}

.avm-at-patient-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.avm-at-patient-ref {
    margin: 2px 0 0;
    font-size: 13px;
    color: #64748b;
}

.avm-at-mono {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 500;
    color: #334155;
}

.avm-at-pill {
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 10px;
}

.avm-at-pill.is-ok {
    margin-left: auto;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    background: #e3f6f1;
    color: #0b7a62;
    font-size: 12px;
    padding: 5px 12px;
}

.avm-at-pill.is-lab {
    background: #e3effe;
    color: #1d5fb0;
}

.avm-at-pill.is-out {
    background: #fff3dc;
    color: #9a6200;
}

.avm-at-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px 26px;
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid #eef1f7;
}

.avm-at-facts dt {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 3px;
}

.avm-at-facts dd {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
}

.avm-at-fact.is-wide {
    grid-column: 1 / -1;
}

.avm-at-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.avm-at-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.avm-at-card-sub {
    margin: 3px 0 0;
    font-size: 13px;
    color: #64748b;
}

/* Existing table */
.avm-at-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.avm-at-table th,
.avm-at-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eef1f7;
}

.avm-at-table th {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
}

/* 5. Choose tests to add */
.avm-at-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    background: #f7f9fc;
    border: 1px solid #dfe5f0;
    border-radius: 12px;
    margin-bottom: 14px;
    color: #94a3b8;
}

.avm-at-filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avm-at-filter-input {
    border: 0;
    outline: 0;
    background: transparent;
    flex: 1;
    font: inherit;
    font-size: 14px;
    color: #0f172a;
}

.avm-at-filter-count {
    font-size: 12.5px;
    color: #64748b;
}

.avm-at-list {
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    overflow: hidden;
}

.avm-at-row {
    display: grid;
    grid-template-columns: 22px 86px minmax(0, 1fr) auto 100px;
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eef1f7;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
    margin: 0;
}

.avm-at-row:last-child {
    border-bottom: 0;
}

.avm-at-row:hover {
    background: #f8faff;
}

.avm-at-row.is-selected {
    background: #eef0fb;
}

.avm-at-row.is-selected::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #2b2f8f;
}

.avm-at-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.avm-at-tick {
    width: 20px;
    height: 20px;
    border: 1.5px solid #b9c2d6;
    border-radius: 6px;
    background: #ffffff;
    display: grid;
    place-items: center;
    color: transparent;
    transition: all 0.15s;
}

.avm-at-row.is-selected .avm-at-tick {
    background: #2b2f8f;
    border-color: #2b2f8f;
    color: #ffffff;
}

.avm-at-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
}

.avm-at-name {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
}

.avm-at-fee {
    text-align: right;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 13.5px;
    font-weight: 500;
    color: #0f172a;
}

.avm-at-empty {
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 13.5px;
}

@media (max-width: 720px) {
    .avm-at-row {
        grid-template-columns: 22px 70px minmax(0, 1fr) 80px;
    }
    .avm-at-row .avm-at-pill {
        display: none;
    }
}

/* Dock / Summary */
.avm-at-dock {
    position: sticky;
    bottom: 16px;
    z-index: 10;
    background: #ffffff;
    border: 1px solid #d5dbea;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    padding: 14px 18px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avm-at-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.avm-at-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef0fb;
    border: 1px solid #d9dfec;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 12px;
    color: #2b2f8f;
    font-weight: 600;
}

.avm-at-chip-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.avm-at-chip-x {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    color: #64748b;
    display: grid;
    place-items: center;
}

.avm-at-chip-x:hover {
    color: #dc2626;
}

.avm-at-dock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.avm-at-totals {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.avm-at-total-label {
    font-size: 13px;
    color: #64748b;
}

.avm-at-total {
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.avm-at-balance {
    font-size: 12.5px;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.avm-at-balance strong {
    color: #0f172a;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.avm-at-balance-sep {
    width: 1px;
    height: 12px;
    background: #d5dbea;
}

.avm-at-submit {
    height: 44px;
    padding: 0 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2b2f8f, #3a40b5);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    border: 0;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(43, 47, 143, 0.22);
    transition: transform 0.18s, box-shadow 0.18s;
}

.avm-at-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(43, 47, 143, 0.3);
}

/* Modal confirm dialog */
.avm-at-confirm-card {
    max-width: 520px;
    width: calc(100% - 32px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    margin: auto;
}

.avm-at-cf-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    background: linear-gradient(90deg, #14235a, #2b2f8f);
    color: #ffffff;
    position: relative;
}

.avm-at-cf-ico {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.avm-at-cf-headtext {
    flex: 1;
    min-width: 0;
}

.avm-at-cf-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
}

.avm-at-cf-sub {
    margin: 2px 0 0;
    font-size: 12.5px;
    opacity: 0.8;
}

.avm-at-cf-close {
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px;
}

.avm-at-cf-close:hover {
    opacity: 1;
}

.avm-at-cf-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(85vh - 160px);
    overflow-y: auto;
}

.avm-at-cf-amount {
    background: linear-gradient(135deg, #0d1b3e 0%, #152860 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 18px rgba(13, 27, 62, 0.28);
}

.avm-at-cf-amount-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.avm-at-cf-amount-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.avm-at-cf-amount-count {
    font-size: 12.5px;
    color: #38bdf8;
    font-weight: 600;
}

.avm-at-cf-amount-value {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.avm-at-cf-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.avm-at-cf-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.avm-at-cf-card-head .avm-at-cf-label {
    margin: 0;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
}

.avm-at-cf-badge {
    background: #eef2ff;
    color: #2b2f8f;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
}

.avm-at-cf-patient {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avm-at-cf-sample {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    margin: 0;
    font-size: 13.5px;
    flex: 1;
}

.avm-at-cf-sample dt {
    color: #64748b;
    font-weight: 500;
}

.avm-at-cf-sample dd {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
    text-align: right;
    word-break: break-word;
}

.avm-at-cf-tests-wrap {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.avm-at-cf-tests {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    margin: 0;
    font-size: 13px;
    align-items: center;
}

.avm-at-cf-tests dt {
    color: #1e293b;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.avm-at-cf-tests dd {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 12.5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.avm-at-cf-tests dt.is-total {
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    margin-top: 4px;
    font-weight: 700;
    color: #0f172a;
}

.avm-at-cf-tests dd.is-total {
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    margin-top: 4px;
    font-weight: 800;
    color: #2b2f8f;
    background: transparent;
    border: none;
}

.avm-at-cf-total-bar {
    background: linear-gradient(135deg, #0d1b3e 0%, #152860 100%);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(13, 27, 62, 0.2);
}

.avm-at-cf-total-bar-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cbd5e1;
}

.avm-at-cf-total-bar-value {
    font-size: 16px;
    font-weight: 800;
    color: #38bdf8;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    letter-spacing: -0.01em;
}

.avm-at-cf-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.avm-at-cf-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid #d1d9e3;
    background: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.avm-at-cf-btn.is-primary {
    border-color: #2b2f8f;
    background: linear-gradient(135deg, #2b2f8f, #3a40b5);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(43, 47, 143, 0.2);
}

.avm-at-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Material pages: toolbar, segmented filters, sortable headers, dense rows, order detail panel. */
.avm-material-toolbar {
    align-items: center;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
}

.avm-material-search {
    flex: 0 1 300px;
    margin-left: auto;
}

.avm-material-view-count {
    color: var(--muted);
    font-size: calc(12px * var(--avm-font-scale));
}

.avm-segmented {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    display: inline-flex;
    overflow: hidden;
}

    .avm-segmented button {
        background: transparent;
        border: 0;
        color: var(--muted);
        cursor: pointer;
        font-family: inherit;
        font-size: calc(12px * var(--avm-font-scale));
        font-weight: 600;
        padding: 6px 12px;
    }

        .avm-segmented button:hover {
            color: var(--ink);
        }

        .avm-segmented button.is-active {
            background: var(--brand-soft);
            color: var(--brand-mid);
        }

.avm-tab-count {
    background: var(--brand-soft);
    border-radius: var(--r-pill);
    color: var(--brand-mid);
    font-size: calc(10px * var(--avm-font-scale));
    font-style: normal;
    margin-left: 4px;
    padding: 1px 7px;
}

.avm-sort-btn {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
    padding: 0;
    text-transform: inherit;
}

    .avm-sort-btn::after {
        content: " \2195";
        opacity: .35;
    }

th[aria-sort="ascending"] .avm-sort-btn::after {
    content: " \2191";
    opacity: 1;
}

th[aria-sort="descending"] .avm-sort-btn::after {
    content: " \2193";
    opacity: 1;
}

.avm-material-kpis .avm-tile.is-filtering {
    box-shadow: 0 0 0 2px var(--brand-mid);
}

.avm-material-table-shell.is-dense td {
    padding-bottom: 4px;
    padding-top: 4px;
}

.avm-material-table-shell.is-dense .avm-material-number {
    display: none;
}

.avm-material-table-shell .avm-table-scroll {
    max-height: calc(100vh - 460px);
    min-height: 260px;
    overflow: auto;
}

.avm-row-clickable {
    cursor: pointer;
}

.avm-row-more {
    color: var(--brand-mid);
    font-weight: 600;
    text-align: right;
}

button.avm-otp {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.avm-material-detail {
    max-width: 440px;
    width: min(440px, 100vw);
}

.avm-material-detail-top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

.avm-material-detail-by {
    color: var(--muted);
    margin-left: auto;
}

.avm-material-detail-note {
    color: var(--red);
    font-weight: 600;
    margin: var(--sp-3) 0;
}

.avm-material-timeline {
    list-style: none;
    margin: var(--sp-3) 0;
    padding: 0;
}

    .avm-material-timeline li {
        color: var(--muted);
        padding: 0 0 14px 24px;
        position: relative;
    }

        .avm-material-timeline li::before {
            background: var(--card);
            border: 2px solid var(--line);
            border-radius: 50%;
            content: "";
            height: 10px;
            left: 0;
            position: absolute;
            top: 4px;
            width: 10px;
        }

        .avm-material-timeline li::after {
            background: var(--line);
            bottom: -4px;
            content: "";
            left: 4px;
            position: absolute;
            top: 17px;
            width: 2px;
        }

        .avm-material-timeline li:last-child::after {
            display: none;
        }

        .avm-material-timeline li.is-done {
            color: var(--ink);
            font-weight: 600;
        }

            .avm-material-timeline li.is-done::before {
                background: var(--green-ink);
                border-color: var(--green-ink);
            }

.avm-material-detail-items {
    list-style: none;
    margin: 0 0 var(--sp-3);
    padding: 0;
}

    .avm-material-detail-items li {
        border-bottom: 1px solid var(--line);
        padding: 8px 0;
    }

.avm-material-detail-sums div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.avm-material-detail-sums dt {
    color: var(--muted);
}

.avm-material-detail-sums dd {
    font-weight: 600;
    margin: 0;
}

.avm-material-detail-sums .is-total {
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 8px;
}

@media (max-width: 900px) {
    .avm-material-search {
        flex-basis: 100%;
        margin-left: 0;
    }

    .avm-material-table-shell .avm-table-scroll {
        max-height: none;
    }
}
/* ===== Material pages: review corrections (append at the end of the material CSS) ===== */

/* --- Material orders: From / To / quick range / Show orders in ONE row, same height --- */
.avm-material-filter {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
}

    .avm-material-filter .avm-field {
        flex: 0 0 190px;
        margin: 0;
    }

        .avm-material-filter .avm-field input {
            height: 38px;
        }

    .avm-material-filter .avm-segmented,
    .avm-material-filter .avm-btn {
        height: 38px;
    }

        .avm-material-filter .avm-segmented button {
            height: 100%;
        }

    .avm-material-filter .avm-btn {
        min-width: 140px;
    }

/* --- Material orders: table cells stay on one line, materials get room --- */
.avm-material-history td {
    vertical-align: middle;
}

    .avm-material-history td.avm-col-materials {
        min-width: 280px;
    }

    .avm-material-history td:nth-child(2),
    .avm-material-history td:nth-child(4),
    .avm-material-history td:nth-child(5),
    .avm-material-history td.avm-row-more {
        white-space: nowrap;
    }

/* --- "+2 more" as a highlighted chip --- */
.avm-more-chip {
    background: #ede9fe;
    border: 1px solid #8b5cf6;
    border-radius: var(--r-sm);
    box-shadow: 0 1px 3px rgba(109, 40, 217, .25);
    color: #6d28d9;
    cursor: pointer;
    display: inline-block;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 700;
    margin-left: 6px;
    padding: 2px 10px;
    white-space: nowrap;
}

    .avm-more-chip:hover {
        background: #ddd6fe;
    }

/* --- Material order: slim order total bar (total, balance, minimum, buttons in one row) --- */
.avm-material-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    padding: var(--sp-2) var(--sp-3);
}

.avm-material-total {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
}

.avm-material-total-main {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

    .avm-material-total-main strong {
        font-size: calc(20px * var(--avm-font-scale));
    }

.avm-material-total-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 2px var(--sp-3);
}

.avm-material-minimum {
    flex: 1 1 220px;
    min-width: 200px;
}

.avm-material-actions {
    align-items: center;
    display: flex;
    gap: var(--sp-2);
    margin-left: auto;
}

/* Material order: the table fills the screen, the order total stays pinned at the bottom.
   3 materials or 8, the bar is always visible; extra rows scroll inside the table. */
/* Order page only: fill the screen. The History page keeps its own height rule. */
[data-avm-material-order] .avm-material-table-shell .avm-table-scroll {
    max-height: calc(100vh - 380px);
    min-height: calc(100vh - 380px);
}

/* History page: the filter row is slimmer now, so the table can be taller. */
[data-avm-material-history] .avm-material-table-shell .avm-table-scroll {
    max-height: calc(100vh - 400px);
}

.avm-material-bar {
    background: var(--card);
    border-top: 1px solid var(--line);
    bottom: 0;
    position: sticky;
    z-index: 5;
}

@media (max-width: 900px) {
    .avm-material-table-shell .avm-table-scroll {
        max-height: none;
        min-height: 0;
    }

    .avm-material-bar {
        position: static;
    }
}

/* =====  From / To labels sit left of their date fields, one compact row ===== */
.avm-material-filter {
    align-items: center;
    gap: var(--sp-3) var(--sp-4);
}

    .avm-material-filter .avm-field {
        align-items: center;
        display: flex;
        flex: none;
        gap: 8px;
    }

        .avm-material-filter .avm-field label {
            font-weight: 600;
            margin: 0;
            white-space: nowrap;
        }

        .avm-material-filter .avm-field input {
            width: 150px;
        }

/* "ORDERS 1 order" moves into the table toolbar, before the "All" tab ===== */
.avm-material-toolbar .avm-material-heading {
    align-items: baseline;
    border-right: 1px solid var(--line);
    display: inline-flex;
    gap: 8px;
    padding-right: var(--sp-3);
    white-space: nowrap;
}

    .avm-material-toolbar .avm-material-heading .avm-band-title {
        font-size: calc(11px * var(--avm-font-scale));
        letter-spacing: .1em;
        margin: 0;
        text-transform: uppercase;
    }
/* ===== Round 5: Order page bar, stronger selectors so older rules cannot override ===== */
form[data-avm-material-order] .avm-material-bar {
    align-items: center;
    background: var(--card);
    border-top: 1px solid var(--line);
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    padding: var(--sp-2) var(--sp-3);
    position: sticky;
    z-index: 5;
}

form[data-avm-material-order] .avm-material-total {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    margin: 0;
    padding: 0;
}

form[data-avm-material-order] .avm-material-total-main {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    margin: 0;
}

form[data-avm-material-order] .avm-material-total-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 2px var(--sp-3);
    margin: 0;
}

    form[data-avm-material-order] .avm-material-total-meta > * {
        margin: 0;
    }

form[data-avm-material-order] .avm-material-minimum {
    flex: 1 1 220px;
    margin: 0;
}

form[data-avm-material-order] .avm-material-actions {
    align-items: center;
    display: flex;
    gap: var(--sp-2);
    margin: 0 0 0 auto;
}
/* ===== Round 6: reset whatever the older bar rules set (direction, width, offsets) ===== */
form[data-avm-material-order] .avm-material-total {
    align-items: center !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

form[data-avm-material-order] .avm-material-total-main,
form[data-avm-material-order] .avm-material-total-meta {
    align-self: center !important;
    margin: 0 !important;
    order: 0 !important;
    padding: 0 !important;
    position: static !important;
}

form[data-avm-material-order] .avm-material-total-meta {
    align-items: center !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
}

/* The table was a bit too tall, so the page scrolled. Tune this number until the page does not scroll. */
[data-avm-material-order] .avm-material-table-shell .avm-table-scroll {
    max-height: calc(100vh - 390px);
    min-height: calc(100vh - 390px);
}
/* ===== Round 7: From / To label on the LEFT of the date field ===== */
.avm-material-filter .avm-field {
    align-items: center !important;
    flex: none !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: auto !important;
}

    .avm-material-filter .avm-field label {
        margin: 0 !important;
        text-align: left !important;
        white-space: nowrap;
    }

    .avm-material-filter .avm-field input {
        width: 160px !important;
    }
    /* ===== Round 8: From / To label font, bold and dark like the preview ===== */
    .avm-material-filter .avm-field label {
        color: var(--ink) !important;
        font-size: calc(13px * var(--avm-font-scale)) !important;
        font-weight: 700 !important;
        letter-spacing: .02em;
    }
/* ===== Round 9: phone layout (≤720px) for Material order + Material orders =====
   Append at the very END of client-ui.css (after Round 8). Uses the same selectors and
   !important as Rounds 5-7 so it wins over them. Desktop is untouched. */
@media (max-width: 720px) {

    /* ---- Material order: table first, order bar flows under it (no longer covers the screen) ---- */
    [data-avm-material-order] .avm-material-table-shell .avm-table-scroll {
        -webkit-overflow-scrolling: touch;
        max-height: 60vh !important;
        min-height: 0 !important;
        overflow: auto;
    }

    form[data-avm-material-order] .avm-material-bar {
        align-items: stretch !important;
        bottom: auto !important;
        display: grid !important;
        gap: var(--sp-2) !important;
        grid-template-columns: minmax(0, 1fr) !important;
        padding: var(--sp-3) !important;
        position: static !important;
    }

    form[data-avm-material-order] .avm-material-total {
        align-items: flex-start !important;
        display: flex !important;
        flex-direction: column !important;
        gap: var(--sp-2) !important;
        width: 100% !important;
    }

    form[data-avm-material-order] .avm-material-total-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }

    form[data-avm-material-order] .avm-material-minimum {
        flex: 0 0 auto !important;
        max-width: none !important;
        min-width: 0 !important;
        width: 100%;
    }

    form[data-avm-material-order] .avm-material-actions {
        display: grid !important;
        gap: var(--sp-2) !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        margin: 0 !important;
        width: 100%;
    }

        form[data-avm-material-order] .avm-material-bar .avm-submit-order,
        form[data-avm-material-order] .avm-material-actions .avm-material-clear {
            min-width: 0 !important;
            width: 100% !important;
        }

    /* ---- shared toolbar (both pages) ---- */
    .avm-material-toolbar {
        gap: var(--sp-2);
    }

        .avm-material-toolbar .avm-material-heading {
            border-right: 0;
            flex: 1 1 100%;
            padding-right: 0;
        }

        .avm-material-toolbar .avm-segmented,
        .avm-material-toolbar .avm-tabs {
            flex: 1 1 100%;
            max-width: 100%;
            overflow-x: auto;
        }

    /* ---- Material orders: From / To / presets / Show orders stack neatly ---- */
    .avm-material-filter {
        align-items: stretch;
        gap: var(--sp-2);
    }

        .avm-material-filter .avm-field {
            flex: 1 1 100% !important;
            width: 100% !important;
        }

            .avm-material-filter .avm-field label {
                flex: 0 0 44px;
            }

            .avm-material-filter .avm-field input {
                flex: 1 1 auto;
                min-width: 0;
                width: 100% !important;
            }

        .avm-material-filter .avm-segmented {
            flex: 1 1 100%;
            overflow-x: auto;
        }

        .avm-material-filter .avm-btn {
            flex: 1 1 100%;
            width: 100%;
        }

    [data-avm-material-history] .avm-material-table-shell .avm-table-scroll {
        max-height: 60vh;
    }

    .avm-material-history td.avm-col-materials {
        min-width: 220px;
    }
}
/* ===== Round 9: phone layout (≤720px) for Material order + Material orders =====
   Append at the very END of client-ui.css (after Round 8). Uses the same selectors and
   !important as Rounds 5-7 so it wins over them. Desktop is untouched. */
@media (max-width: 720px) {

    /* ---- Material order: table first, order bar flows under it (no longer covers the screen) ---- */
    [data-avm-material-order] .avm-material-table-shell .avm-table-scroll {
        -webkit-overflow-scrolling: touch;
        max-height: 60vh !important;
        min-height: 0 !important;
        overflow: auto;
    }

    form[data-avm-material-order] .avm-material-bar {
        align-items: stretch !important;
        bottom: auto !important;
        display: grid !important;
        gap: var(--sp-2) !important;
        grid-template-columns: minmax(0, 1fr) !important;
        padding: var(--sp-3) !important;
        position: static !important;
    }

    form[data-avm-material-order] .avm-material-total {
        align-items: flex-start !important;
        display: flex !important;
        flex-direction: column !important;
        gap: var(--sp-2) !important;
        width: 100% !important;
    }

    form[data-avm-material-order] .avm-material-bar,
    form[data-avm-material-order] .avm-material-total,
    form[data-avm-material-order] .avm-material-total-main,
    form[data-avm-material-order] .avm-material-total-meta,
    form[data-avm-material-order] .avm-material-minimum {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }

    form[data-avm-material-order] .avm-material-total-main,
    form[data-avm-material-order] .avm-material-total-meta {
        width: 100%;
    }

    form[data-avm-material-order] .avm-material-total-meta {
        flex-direction: column !important;
        gap: 4px !important;
    }

        form[data-avm-material-order] .avm-material-total-meta .avm-material-clear {
            width: 100%;
        }

    form[data-avm-material-order] .avm-material-minimum-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    /* keep every column readable; the table scrolls sideways instead of squashing */
    .avm-material-table {
        min-width: 640px;
    }

    .avm-material-history {
        min-width: 720px;
    }

    form[data-avm-material-order] .avm-material-minimum {
        flex: 0 0 auto !important;
        max-width: none !important;
        min-width: 0 !important;
        width: 100%;
    }

    form[data-avm-material-order] .avm-material-actions {
        display: grid !important;
        gap: var(--sp-2) !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        margin: 0 !important;
        width: 100%;
    }

        form[data-avm-material-order] .avm-material-bar .avm-submit-order,
        form[data-avm-material-order] .avm-material-actions .avm-material-clear {
            min-width: 0 !important;
            width: 100% !important;
        }

    /* ---- shared toolbar (both pages) ---- */
    .avm-material-toolbar {
        gap: var(--sp-2);
    }

        .avm-material-toolbar .avm-material-heading {
            border-right: 0;
            flex: 1 1 100%;
            padding-right: 0;
        }

        .avm-material-toolbar .avm-segmented,
        .avm-material-toolbar .avm-tabs {
            flex: 1 1 100%;
            max-width: 100%;
            overflow-x: auto;
        }

        .avm-material-toolbar .avm-material-search {
            flex: 1 1 100%;
            max-width: 100%;
            min-width: 0;
            width: 100%;
        }

        .avm-material-toolbar > .avm-btn {
            flex: 1 1 100%;
        }

    /* ---- Material orders: From / To / presets / Show orders stack neatly ---- */
    .avm-material-filter {
        align-items: stretch;
        gap: var(--sp-2);
    }

        .avm-material-filter .avm-field {
            flex: 1 1 100% !important;
            width: 100% !important;
        }

            .avm-material-filter .avm-field label {
                flex: 0 0 44px;
            }

            .avm-material-filter .avm-field input {
                flex: 1 1 auto;
                min-width: 0;
                width: 100% !important;
            }

        .avm-material-filter .avm-segmented {
            flex: 1 1 100%;
            overflow-x: auto;
        }

        .avm-material-filter .avm-btn {
            flex: 1 1 100%;
            width: 100%;
        }

    [data-avm-material-history] .avm-material-table-shell .avm-table-scroll {
        max-height: 60vh;
    }

    .avm-material-history td.avm-col-materials {
        min-width: 220px;
    }

    /* pager was a fixed 28px single row, so it clipped on phones; let it wrap */
    .avm-material-table-shell .avm-order-pagination {
        flex-wrap: wrap;
        gap: var(--sp-2);
        height: auto;
        justify-content: center;
        min-height: 0;
        padding: var(--sp-2);
        position: static;
    }

        .avm-material-table-shell .avm-order-pagination .avm-pg-info {
            flex: 1 1 100%;
            text-align: center;
        }

        .avm-material-table-shell .avm-order-pagination .avm-pg-btns {
            flex-wrap: wrap;
            justify-content: center;
        }
}
/* ===== Review order clearly disabled (no buffering look) ===== */
.avm-submit-wrap {
    display: inline-flex;
}

    .avm-submit-wrap.is-disabled {
        cursor: not-allowed;
    }

    .avm-submit-wrap .avm-submit-order:disabled {
        animation: none !important;
        box-shadow: none !important;
        cursor: not-allowed;
        filter: grayscale(.6);
        opacity: .55;
        pointer-events: none;
    }
@media (min-width: 901px) {
    form[data-avm-material-order] .avm-material-bar {
        padding-right: 96px;
    }
}

/* ==========================================================================
   Notice Board Feature Styles (Matches To Company / Vlogue color scheme)
   ========================================================================== */

.avm-noticeboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Base Top control bar (blue box) */
.avm-notice-bar {
    display: flex;
    background: linear-gradient(120deg, var(--brand-mid, #3a52a0) 0%, var(--brand, #2c3e7a) 60%, #22315f 100%);
    border-radius: var(--r-md, 14px);
    box-shadow: 0 8px 24px rgba(44, 62, 122, .22);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
}

/* 3 filter buttons fitting horizontally inside the blue box */
.avm-notice-lanes {
    display: flex;
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: 3px;
    box-sizing: border-box;
    align-items: center;
}

.avm-notice-lanes .avm-vlogue-lane {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    color: rgba(255, 255, 255, .82);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
    box-sizing: border-box;
}

.avm-notice-lanes .avm-vlogue-lane:hover {
    color: #ffffff;
}

.avm-notice-lanes .avm-vlogue-lane.is-active {
    background: #ffffff;
    color: var(--brand, #2c3e7a);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.avm-notice-lanes .avm-vlogue-lane-count {
    background: var(--avm-accent, #e11d48);
    border-radius: 999px;
    color: #ffffff;
    font-family: var(--font-num, "DM Mono", monospace);
    font-weight: 700;
    line-height: 1;
    text-align: center;
    flex-shrink: 0;
}

.avm-notice-panel {
    background: var(--card, #ffffff);
    border: 1px solid var(--line, #e2e8f0);
    border-radius: var(--r-lg, 16px);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.avm-notice-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-soft, #f1f5f9);
}

.avm-notice-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avm-notice-panel-title {
    font-size: calc(18px * var(--avm-font-scale));
    font-weight: 700;
    color: var(--ink, #0f172a);
    margin: 0;
    font-family: var(--font-heading, "Sora", sans-serif);
    letter-spacing: -0.01em;
}

.avm-notice-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-soft, #eef2ff);
    color: var(--brand, #2c3e7a);
    cursor: default;
    transition: background .15s ease, color .15s ease;
}

.avm-notice-info-icon:hover {
    background: var(--brand, #2c3e7a);
    color: #ffffff;
}

.avm-notice-count-caption {
    font-size: calc(12.5px * var(--avm-font-scale));
    color: var(--muted, #64748b);
    font-weight: 500;
}

.avm-notice-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.avm-notice-enhanced-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Base Notice Card */
.avm-notice-enhanced-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid var(--brand-mid, #3a52a0);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.avm-notice-enhanced-row:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

/* Acknowledged notices: Soft mint green pastel tint with matching perimeter border */
.avm-notice-enhanced-row.is-acknowledged {
    background: linear-gradient(180deg, #f0fdf4 0%, #f6fef9 100%);
    border-color: #bbf7d0;
    border-left: 5px solid #059669;
}

.avm-notice-enhanced-row.is-acknowledged:hover {
    background: #eafaf1;
    border-color: #86efac;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.12);
}

/* Action Required / Unread notices: Soft warm peach/cream pastel tint with matching perimeter border */
.avm-notice-enhanced-row.is-unread {
    background: linear-gradient(180deg, #fff7ed 0%, #fffcf8 100%);
    border-color: #fed7aa;
    border-left: 5px solid #ea580c;
}

.avm-notice-enhanced-row.is-unread:hover {
    background: #ffedd5;
    border-color: #fdba74;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.12);
}

/* For Knowledge notices: Soft cyan/ice pastel tint with matching perimeter border */
.avm-notice-enhanced-row.is-knowledge {
    background: linear-gradient(180deg, #f0f9ff 0%, #f8fcff 100%);
    border-color: #bae6fd;
    border-left: 5px solid #0284c7;
}

.avm-notice-enhanced-row.is-knowledge:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.12);
}

/* Date Badge Tile */
.avm-notice-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-mid, #3a52a0), var(--brand, #2c3e7a));
    color: #ffffff;
    flex-shrink: 0;
    user-select: none;
    box-shadow: 0 2px 8px rgba(44, 62, 122, 0.22);
}

.avm-notice-enhanced-row.is-acknowledged .avm-notice-date-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.22);
}

.avm-notice-enhanced-row.is-unread .avm-notice-date-badge {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

.avm-notice-enhanced-row.is-knowledge .avm-notice-date-badge {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.22);
}

.avm-date-day {
    font-weight: 800;
    line-height: 1.1;
    font-family: var(--font-num, "DM Mono", monospace);
}

.avm-date-month {
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    opacity: .95;
    line-height: 1;
    margin-top: 1px;
}

/* Badges & Category Pill */
.avm-notice-header-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.avm-notice-category-pill {
    background: var(--brand-soft, #eef2ff);
    color: var(--brand, #2c3e7a);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 4px;
    border: 1px solid #c7d2fe;
    line-height: 1.2;
}

.avm-notice-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1.2;
}

.avm-notice-badge.is-ack {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.avm-notice-badge.is-required {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.avm-notice-badge.is-knowledge {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.avm-notice-attach-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--teal-ink, #136b71);
    background: var(--teal, #e6f2f3);
    border-radius: 4px;
    border: 1px solid #bce2e5;
    text-decoration: none;
    line-height: 1.2;
}

.avm-notice-attach-tag.is-clickable {
    cursor: pointer;
    transition: all .16s ease;
}

.avm-notice-attach-tag.is-clickable:hover {
    background: #cbf0f3;
    color: #0b4a4f;
    transform: translateY(-1px);
}

.avm-notice-row-title {
    color: var(--ink, #0f172a);
    font-family: var(--font-heading, "Sora", sans-serif);
    word-break: break-word;
}

.avm-notice-enhanced-row:hover .avm-notice-row-title {
    color: var(--brand, #2c3e7a);
}

.avm-notice-row-snippet {
    color: var(--ink-2, #334155);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* Subtle divider line separating snippet from footer on mobile */
.avm-notice-divider {
    height: 1px;
    background: #e2e8f0;
    width: 100%;
}

.avm-notice-enhanced-row.is-acknowledged .avm-notice-divider {
    background: #dcfce7;
}

.avm-notice-enhanced-row.is-unread .avm-notice-divider {
    background: #fed7aa;
}

.avm-notice-enhanced-row.is-knowledge .avm-notice-divider {
    background: #bae6fd;
}

.avm-notice-row-meta {
    display: flex;
    align-items: center;
    color: var(--muted, #64748b);
    margin: 0;
}

.avm-meta-author strong,
.avm-meta-expiry strong {
    color: var(--ink, #0f172a);
    font-weight: 700;
}

.avm-meta-sep {
    color: var(--muted-lt, #94a3b8);
    font-size: 13px;
    margin: 0 2px;
}

.avm-row-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all .16s ease;
    white-space: nowrap;
}

.avm-row-cta-btn.is-read {
    background: #ffffff;
    color: var(--ink, #0f172a);
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.avm-row-cta-btn.is-read:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: var(--brand, #2c3e7a);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.avm-row-cta-btn.is-action-btn {
    background: linear-gradient(135deg, var(--brand-mid, #3a52a0), var(--brand, #2c3e7a));
    color: #ffffff;
    border: 1px solid var(--brand, #2c3e7a);
    box-shadow: 0 2px 8px rgba(44, 62, 122, 0.25);
}

.avm-row-cta-btn.is-action-btn:hover {
    background: linear-gradient(135deg, #2f4383, #22315f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 122, 0.35);
}

/* ==========================================================================
   DESKTOP / LARGE SCREENS (min-width: 769px)
   Matches original desktop layout: inline buttons on left, search on right;
   3-column notice card (Date tile on left, Content in middle, Action on right)
   ========================================================================== */
@media (min-width: 769px) {
    .avm-notice-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 10px 16px;
    }

    .avm-notice-lanes {
        width: auto;
        display: inline-flex;
        max-width: none;
        gap: 4px;
        padding: 3px;
    }

    .avm-notice-lanes .avm-vlogue-lane {
        flex: 0 0 auto;
        width: auto;
        padding: 7px 16px;
        gap: 6px;
        font-size: calc(12px * var(--avm-font-scale));
    }

    .avm-notice-lanes .avm-vlogue-lane svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .avm-notice-lanes .avm-vlogue-lane-count {
        font-size: calc(10px * var(--avm-font-scale));
        min-width: 18px;
        padding: 2.5px 6px;
    }

    .avm-vlogue-tools {
        display: flex;
        align-items: center;
        margin-left: auto;
        width: 340px;
        max-width: 100%;
    }

    /* 3-Column Notice Card on Desktop */
    .avm-notice-enhanced-row {
        display: grid;
        grid-template-columns: 68px 1fr auto;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "date header action"
            "date title  action"
            "date snippet action"
            "date meta   action";
        column-gap: 20px;
        row-gap: 4px;
        align-items: center;
        padding: 18px 24px;
        border-radius: var(--r-md, 14px);
    }

    .avm-notice-date-badge {
        grid-area: date;
        width: 68px;
        min-width: 68px;
        height: 68px;
        border-radius: 10px;
        align-self: center;
    }

    .avm-date-day {
        font-size: calc(22px * var(--avm-font-scale));
    }

    .avm-date-month {
        font-size: calc(9.5px * var(--avm-font-scale));
    }

    .avm-notice-header-line {
        grid-area: header;
        gap: 8px;
        margin-bottom: 2px;
    }

    .avm-notice-category-pill {
        font-size: calc(10.5px * var(--avm-font-scale));
        padding: 2.5px 8px;
    }

    .avm-notice-badge {
        font-size: calc(11px * var(--avm-font-scale));
        padding: 2.5px 9px;
        gap: 5px;
    }

    .avm-notice-attach-tag {
        font-size: calc(11px * var(--avm-font-scale));
        padding: 2.5px 8px;
    }

    .avm-notice-row-title {
        grid-area: title;
        margin: 0;
        font-size: calc(16.5px * var(--avm-font-scale));
        font-weight: 700;
        line-height: 1.35;
    }

    .avm-notice-row-snippet {
        grid-area: snippet;
        margin: 4px 0 6px 0;
        font-size: calc(13px * var(--avm-font-scale));
        line-height: 1.45;
    }

    /* Divider is hidden on desktop */
    .avm-notice-divider {
        display: none;
    }

    /* Footer contents flatten into direct grid children on desktop */
    .avm-notice-card-footer {
        display: contents;
    }

    .avm-notice-row-meta {
        grid-area: meta;
        margin: 0;
        gap: 6px;
        font-size: calc(12px * var(--avm-font-scale));
        flex-wrap: wrap;
    }

    .avm-notice-row-action {
        grid-area: action;
        align-self: center;
        margin-left: 16px;
        flex-shrink: 0;
    }

    .avm-row-cta-btn {
        padding: 8px 18px;
        font-size: calc(12.5px * var(--avm-font-scale));
        border-radius: 8px;
    }
}

/* ==========================================================================
   MOBILE PHONES & SMALL SCREENS (max-width: 768px)
   Matches target mobile format exactly:
   - 3 buttons horizontally fitted side-by-side inside the blue bar without clipping
   - Notice Card: Top section (Date tile left, Category & Title right),
     Middle section (Full-width Snippet), subtle divider,
     Bottom section (Meta on left, Action CTA button on right)
   ========================================================================== */
@media (max-width: 768px) {
    .avm-notice-bar {
        flex-direction: column;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 12px;
    }

    .avm-notice-lanes {
        width: 100%;
        max-width: 100%;
        padding: 2.5px;
        gap: 3px;
    }

    /* All 3 buttons fit horizontally side-by-side inside the blue box */
    .avm-notice-lanes .avm-vlogue-lane {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 4px;
        gap: 4px;
        font-size: calc(11px * var(--avm-font-scale));
    }

    .avm-notice-lanes .avm-vlogue-lane svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    .avm-notice-lanes .avm-vlogue-lane-count {
        font-size: calc(9px * var(--avm-font-scale));
        padding: 1.5px 4.5px;
        min-width: 15px;
    }

    .avm-vlogue-tools {
        width: 100%;
    }

    /* Target Mobile Notice Card Grid */
    .avm-notice-enhanced-row {
        display: grid;
        grid-template-columns: 50px 1fr;
        grid-template-rows: auto auto auto auto auto;
        grid-template-areas:
            "date header"
            "date title"
            "snippet snippet"
            "divider divider"
            "footer footer";
        column-gap: 12px;
        row-gap: 3px;
        padding: 12px 14px 10px 14px;
        border-radius: 10px;
    }

    .avm-notice-date-badge {
        grid-area: date;
        width: 50px;
        min-width: 50px;
        height: 50px;
        border-radius: 8px;
        align-self: start;
    }

    .avm-date-day {
        font-size: calc(17px * var(--avm-font-scale));
    }

    .avm-date-month {
        font-size: calc(8px * var(--avm-font-scale));
    }

    .avm-notice-header-line {
        grid-area: header;
        gap: 5px;
        margin-bottom: 2px;
    }

    .avm-notice-category-pill {
        font-size: calc(9.5px * var(--avm-font-scale));
        padding: 2px 6px;
    }

    .avm-notice-badge {
        font-size: calc(10px * var(--avm-font-scale));
        padding: 2px 7px;
        gap: 4px;
    }

    .avm-notice-attach-tag {
        font-size: calc(10px * var(--avm-font-scale));
        padding: 2px 6px;
    }

    .avm-notice-row-title {
        grid-area: title;
        font-size: calc(14px * var(--avm-font-scale));
        font-weight: 700;
        margin: 1px 0 0 0;
        line-height: 1.3;
    }

    .avm-notice-row-snippet {
        grid-area: snippet;
        font-size: calc(12.5px * var(--avm-font-scale));
        margin: 8px 0 9px 0;
        line-height: 1.4;
    }

    .avm-notice-divider {
        grid-area: divider;
        display: block;
        height: 1px;
        width: 100%;
        margin: 0 0 9px 0;
    }

    .avm-notice-card-footer {
        grid-area: footer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        flex-wrap: nowrap;
    }

    .avm-notice-row-meta {
        font-size: calc(11px * var(--avm-font-scale));
        gap: 4px;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .avm-notice-row-action {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .avm-row-cta-btn {
        padding: 5px 11px;
        font-size: calc(11px * var(--avm-font-scale));
        border-radius: 6px;
        gap: 4px;
    }
}

/* Extra small mobile phones */
@media (max-width: 380px) {
    .avm-notice-lanes .avm-vlogue-lane {
        padding: 5px 2px;
        gap: 2.5px;
        font-size: calc(10px * var(--avm-font-scale));
        letter-spacing: -0.02em;
    }

    .avm-notice-lanes .avm-vlogue-lane svg {
        width: 11px;
        height: 11px;
    }

    .avm-notice-enhanced-row {
        padding: 10px 10px 8px 10px;
        column-gap: 8px;
    }

    .avm-notice-date-badge {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }

    .avm-date-day {
        font-size: calc(15px * var(--avm-font-scale));
    }

    .avm-notice-row-meta {
        font-size: calc(10px * var(--avm-font-scale));
    }

    .avm-row-cta-btn {
        padding: 4px 8px;
        font-size: calc(10.5px * var(--avm-font-scale));
    }
}

@media (max-width: 330px) {
    .avm-notice-lanes .avm-vlogue-lane svg {
        display: none;
    }

    .avm-notice-lanes .avm-vlogue-lane {
        font-size: calc(9.5px * var(--avm-font-scale));
        padding: 4px 1px;
    }
}

.avm-notice-bar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-2, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--brand-mid, #3a52a0);
    border-radius: 8px;
    padding: 13px 18px;
    cursor: pointer;
    text-align: left;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
    user-select: text;
}

.avm-notice-bar-item.is-acknowledged {
    border-left-color: var(--green, #059669);
    background: #f8fafc;
}

.avm-notice-bar-item:hover {
    background: #eef4fc;
    border-color: var(--brand-mid, #3a52a0);
    border-left-color: var(--brand, #2c3e7a);
    box-shadow: 0 4px 14px rgba(44, 62, 122, 0.12);
    transform: translateY(-1px);
}

.avm-notice-bar-item.is-acknowledged:hover {
    border-left-color: var(--green, #059669);
}

.avm-notice-bar-item:focus-visible {
    outline: 2px solid var(--brand, #2c3e7a);
    outline-offset: 2px;
}

.avm-notice-bar-content {
    flex: 1 1 auto;
    min-width: 0;
}

.avm-notice-bar-text {
    font-size: calc(13px * var(--avm-font-scale));
    color: var(--ink, #0f172a);
    line-height: 1.5;
    word-break: break-word;
}

.avm-notice-item-title {
    font-weight: 700;
    color: var(--ink, #0f172a);
}

.avm-notice-pipe {
    font-weight: 700;
    color: var(--muted-lt, #94a3b8);
    margin: 0 6px;
    user-select: none;
}

.avm-notice-meta-segment {
    font-weight: 600;
    color: var(--ink-2, #334155);
}

.avm-notice-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.avm-notice-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    white-space: nowrap;
}

.avm-notice-badge.is-ack {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.avm-notice-badge.is-required {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.avm-notice-badge.is-knowledge {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.avm-badge-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ea580c;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
    animation: avm-pulse 1.8s infinite;
}

@keyframes avm-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(234, 88, 12, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
    }
}

.avm-notice-chevron {
    color: var(--muted, #64748b);
    transition: transform .14s ease, color .14s ease;
    flex-shrink: 0;
}

.avm-notice-bar-item:hover .avm-notice-chevron {
    color: var(--brand, #2c3e7a);
    transform: translateX(3px);
}

.avm-notice-empty,
.avm-notice-no-results {
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--muted, #64748b);
}

.avm-notice-empty .avm-empty-icon {
    color: var(--muted-lt, #94a3b8);
    margin-bottom: 8px;
}

/* Notice Drawer Details */
.avm-notice-drawer {
    width: min(580px, 100vw);
}

.avm-notice-drawer-head,
.avm-notice-drawer .avm-vlogue-drawer-head {
    align-items: flex-start;
    padding: 16px 20px;
    gap: 16px;
}

.avm-notice-drawer-heading,
.avm-notice-drawer .avm-vlogue-drawer-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.avm-notice-drawer-title,
.avm-notice-drawer .avm-vlogue-drawer-title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: calc(16.5px * var(--avm-font-scale));
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    width: 100%;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
    overflow-wrap: break-word;
}

.avm-notice-drawer-close,
.avm-notice-drawer .avm-modal-close-btn {
    flex-shrink: 0;
    margin-top: 2px;
}

.avm-notice-drawer-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    margin-bottom: 2px;
}

.avm-notice-drawer-badge.is-ack {
    background: #ecfdf5;
    color: #065f46;
}

.avm-notice-drawer-badge.is-required {
    background: #fff7ed;
    color: #c2410c;
}

.avm-notice-drawer-badge.is-knowledge {
    background: #e0f2fe;
    color: #0369a1;
}

.avm-notice-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.avm-notice-meta-card {
    background: var(--bg-2, #f1f5f9);
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.avm-notice-meta-caption {
    font-size: calc(10.5px * var(--avm-font-scale));
    color: var(--muted, #64748b);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}

.avm-notice-meta-val {
    font-size: calc(13px * var(--avm-font-scale));
    color: var(--ink, #0f172a);
    font-weight: 600;
}

.avm-notice-meta-val.is-ack-text {
    color: var(--green, #059669);
}

.avm-notice-attachment-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.avm-notice-attachment-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avm-notice-attachment-info svg {
    color: var(--green, #059669);
    flex-shrink: 0;
}

.avm-notice-attachment-info strong {
    display: block;
    font-size: calc(13px * var(--avm-font-scale));
    color: #14532d;
}

.avm-notice-attachment-info span {
    display: block;
    font-size: calc(11.5px * var(--avm-font-scale));
    color: #166534;
}

.avm-notice-message-box {
    background: #ffffff;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    padding: 18px 20px;
}

.avm-notice-message-heading {
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
    color: var(--muted, #64748b);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-soft, #f1f5f9);
}

.avm-notice-message-content {
    font-size: calc(14px * var(--avm-font-scale));
    line-height: 1.65;
    color: var(--ink, #0f172a);
}

.avm-notice-message-content p {
    margin: 0 0 1em;
}

.avm-notice-message-content p:last-child {
    margin-bottom: 0;
}

.avm-notice-message-content a {
    color: var(--brand-mid, #3a52a0);
    text-decoration: underline;
    font-weight: 500;
}

.avm-notice-message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.avm-notice-message-content th,
.avm-notice-message-content td {
    border: 1px solid var(--line, #e2e8f0);
    padding: 8px 12px;
    text-align: left;
}

.avm-notice-ack-btn {
    background: var(--brand, #2c3e7a) !important;
    border-color: var(--brand, #2c3e7a) !important;
}

.avm-notice-ack-btn:hover {
    background: var(--brand-mid, #3a52a0) !important;
}

.avm-notice-ack-btn.is-loading .avm-submit-spinner {
    display: inline-block;
}

/* Enhanced Styling for Embedded Notice Images & Captions */
.avm-notice-message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: inline-block;
    vertical-align: middle;
}

.avm-notice-message-content figure.image {
    display: block;
    margin: 16px 0;
    text-align: center;
}

.avm-notice-message-content figure.image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--line, #e2e8f0);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.avm-notice-message-content figcaption {
    margin-top: 8px;
    font-size: calc(12px * var(--avm-font-scale));
    font-weight: 500;
    font-style: italic;
    color: var(--muted, #64748b);
    text-align: center;
}

/* Need Reply Badges & Drawer Controls */
.avm-notice-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: calc(10.5px * var(--avm-font-scale));
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 6px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.avm-notice-type-tag.is-reply-tag {
    background: #fdf4ff;
    color: #9333ea;
    border: 1px solid #f0abfc;
}

.avm-notice-reply-box {
    background: #fbfbfe;
    border: 1.5px solid #e0e7ff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.avm-notice-reply-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: calc(12.5px * var(--avm-font-scale));
    font-weight: 700;
    color: var(--brand, #2c3e7a);
    margin-bottom: 8px;
}

.avm-char-counter {
    font-size: calc(11px * var(--avm-font-scale));
    font-weight: 600;
    color: var(--muted, #64748b);
    font-family: var(--font-num, "DM Mono", monospace);
}

.avm-notice-reply-textarea {
    width: 100%;
    min-height: 85px;
    resize: vertical;
    font-family: inherit;
    font-size: calc(13.5px * var(--avm-font-scale));
    padding: 10px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
    box-sizing: border-box;
    background: #ffffff;
}

.avm-notice-reply-textarea:focus {
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

.avm-notice-reply-textarea.is-invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.avm-notice-reply-display {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.avm-notice-reply-display-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #15803d;
}

.avm-notice-reply-display-head strong {
    font-size: calc(13px * var(--avm-font-scale));
    font-weight: 700;
}

.avm-notice-reply-display-date {
    margin-left: auto;
    font-size: calc(11.5px * var(--avm-font-scale));
    font-weight: 600;
    color: #166534;
    font-family: var(--font-num, "DM Mono", monospace);
}

.avm-notice-reply-display-text {
    margin: 0;
    font-size: calc(13.5px * var(--avm-font-scale));
    line-height: 1.55;
    color: #14532d;
    white-space: pre-wrap;
    word-break: break-word;
}

.avm-notice-reply-btn {
    background: #9333ea !important;
    border-color: #9333ea !important;
}

.avm-notice-reply-btn:hover {
    background: #7e22ce !important;
}

.avm-notice-reply-btn.is-loading .avm-submit-spinner {
    display: inline-block;
}



.avm-ledger {
    --ledger-primary: #087b91;
    --ledger-primary-dark: #075675;
    --ledger-text: #183344;
    --ledger-muted: #718495;
    --ledger-border: #e3ebf1;
    --ledger-surface: #ffffff;
    --ledger-soft: #f3f7fc;
    color: var(--ledger-text);
    background: var(--ledger-soft);
}



    .avm-ledger .avm-finder {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: space-between !important;
        flex-wrap: wrap;
        gap: 12px;
        width: auto;
        padding: 10px 18px !important;
        margin: 0 24px 10px !important;
        background: #ffffff !important;
        border: 1px solid #dce7f5 !important;
        border-radius: 16px !important;
        box-shadow: 0 5px 18px rgba(20, 55, 100, .07) !important;
        box-sizing: border-box;
    }

        /* Right side: search expands, then Export and Run ledger */
        .avm-ledger .avm-finder .avm-finder-actions {
            display: flex !important;
            align-items: center;
            align-self: flex-end;
            justify-content: flex-end;
            flex: 1 1 auto !important;
            flex-wrap: nowrap;
            gap: 12px !important;
            min-width: 0;
            margin-left: 24px !important;
        }


    .avm-ledger .avm-ss {
        position: relative;
    }

        .avm-ledger .avm-ss > select.avm-ss-native,
        .avm-ledger .avm-ss select[data-avm-searchable],
        .avm-ledger select[data-avm-searchable] {
            position: absolute !important;
            inset: auto auto 0 0 !important;
            width: 1px !important;
            height: 1px !important;
            min-width: 0 !important;
            padding: 0 !important;
            margin: 0 !important;
            border: 0 !important;
            opacity: 0 !important;
            overflow: hidden !important;
            pointer-events: none !important;
            appearance: none !important;
            clip-path: inset(50%) !important;
        }

    .avm-ledger .avm-ss-trigger {
        min-width: 110px;
        min-height: 40px;
        padding: 6px 30px 6px 12px;
        text-align: left;
        cursor: pointer;
        border: 1px solid #cbdcf2;
        border-radius: 9px;
        background: #f8fbff;
        color: #082e75;
        font-weight: 600;
        transition: border-color .2s ease, box-shadow .2s ease;
    }

        .avm-ledger .avm-ss-trigger:focus,
        .avm-ledger .avm-ss-trigger:focus-visible {
            border-color: #68b8c8;
            box-shadow: 0 0 0 3px rgba(8, 123, 145, .09);
            outline: none;
        }

    .avm-ledger .avm-ss-panel {
        position: absolute;
        z-index: 1000;
        top: calc(100% + 4px);
        left: 0;
        width: 200px;
        max-width: 90vw;
        padding: 8px;
        background: #fff;
        border: 1px solid #d5ddee;
        border-radius: 10px;
        box-shadow: 0 10px 28px rgba(20, 35, 90, .18);
        box-sizing: border-box;
    }

        .avm-ledger .avm-ss-panel[hidden] {
            display: none !important;
        }

    .avm-ledger .avm-ss-input {
        display: block;
        width: 100%;
        height: 36px;
        box-sizing: border-box;
        margin: 0 0 6px;
        padding: 0 10px;
        border: 1px solid #d5ddee;
        border-radius: 8px;
        font: inherit;
        background: #fff;
        outline: none;
    }

        .avm-ledger .avm-ss-input:focus {
            border-color: #68b8c8;
            box-shadow: 0 0 0 3px rgba(8, 123, 145, .08);
        }

    .avm-ledger .avm-ss-list {
        list-style: none;
        margin: 0;
        padding: 0;
        max-height: 240px;
        overflow-y: auto;
    }

        .avm-ledger .avm-ss-list li {
            display: block;
            padding: 8px 10px;
            border-radius: 6px;
            cursor: pointer;
            white-space: nowrap;
        }

            .avm-ledger .avm-ss-list li:hover {
                background: #eef3ff;
            }

            .avm-ledger .avm-ss-list li.is-selected {
                background: #087b91;
                color: #fff;
            }

            .avm-ledger .avm-ss-list li.is-empty {
                color: #8a94ad;
                cursor: default;
            }


    .avm-ledger .avm-table-search {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex: 1 1 280px !important;
        gap: 9px !important;
        width: auto !important;
        min-width: 200px !important;
        max-width: none !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        padding: 0 14px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        border: 1px solid #cbdcf2 !important;
        border-radius: 20px !important;
        background: #fff !important;
        box-shadow: none !important;
        transition: border-color .2s ease, box-shadow .2s ease;
    }

        .avm-ledger .avm-table-search:focus-within {
            border-color: #68b8c8 !important;
            box-shadow: 0 0 0 3px rgba(8, 123, 145, .09) !important;
        }

        .avm-ledger .avm-table-search svg {
            display: block !important;
            width: 16px !important;
            height: 16px !important;
            min-width: 16px !important;
            min-height: 16px !important;
            max-width: 16px !important;
            max-height: 16px !important;
            flex: 0 0 16px !important;
            overflow: hidden !important;
            fill: #5b7089;
        }

        .avm-ledger .avm-table-search input {
            display: block !important;
            flex: 1 1 auto !important;
            width: 100% !important;
            min-width: 0 !important;
            height: 30px !important;
            max-height: 30px !important;
            padding: 0 !important;
            margin: 0 !important;
            border: 0 !important;
            outline: none !important;
            background: transparent !important;
            color: #123b7b;
            font-size: 13px !important;
            font-family: inherit;
            box-sizing: border-box !important;
        }


    .avm-ledger .avm-finder .avm-finder-go,
    .avm-ledger .avm-finder .avm-ledger-export {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-sizing: border-box !important;
        width: 150px !important;
        min-width: 150px !important;
        height: 40px !important;
        min-height: 40px !important;
        margin: 0 !important;
        padding: 0 20px !important;
        border: 0 !important;
        font-family: inherit !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        border-radius: 20px !important;
        background: linear-gradient(135deg, #0753bd, #062e79) !important;
        color: #fff !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        box-shadow: 0 5px 13px rgba(5, 53, 130, .2) !important;
        transform: none !important;
        transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    }

        /* Same text size inside both buttons */
        .avm-ledger .avm-finder .avm-finder-go span,
        .avm-ledger .avm-finder .avm-ledger-export span {
            font-family: inherit !important;
            font-size: 14px !important;
            font-weight: 800 !important;
            line-height: 1 !important;
            letter-spacing: 0 !important;
        }

        .avm-ledger .avm-finder .avm-ledger-export svg {
            display: block;
            width: 16px;
            height: 16px;
            flex: 0 0 16px;
            fill: #fff;
        }

        .avm-ledger .avm-finder .avm-finder-go:hover,
        .avm-ledger .avm-finder .avm-ledger-export:hover {
            background: linear-gradient(135deg, #0753bd, #062e79) !important;
            color: #fff !important;
            filter: brightness(1.08);
            transform: translateY(-1px) !important;
            box-shadow: 0 8px 17px rgba(5, 53, 130, .25) !important;
        }

        .avm-ledger .avm-finder .avm-finder-go:focus-visible,
        .avm-ledger .avm-finder .avm-ledger-export:focus-visible {
            outline: 3px solid rgba(8, 123, 145, .25);
            outline-offset: 2px;
        }



    .avm-ledger .avm-material-kpis {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 12px !important;
        width: 100%;
        padding: 0 24px 10px !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

        .avm-ledger .avm-material-kpis .avm-tile {
            position: relative;
            isolation: isolate;
            display: grid;
            grid-template-columns: 44px minmax(0, 1fr);
            grid-template-areas:
                "icon label"
                "icon value"
                "icon amount"
                "icon note";
            align-content: center;
            column-gap: 12px;
            row-gap: 1px;
            width: 100% !important;
            max-width: none !important;
            min-width: 0 !important;
            min-height: 84px !important;
            flex: initial !important;
            padding: 10px 16px !important;
            overflow: hidden;
            border-radius: 13px;
            box-sizing: border-box;
            box-shadow: 0 5px 15px rgba(18, 59, 112, .055);
            transition: transform .2s ease, box-shadow .2s ease;
        }

            .avm-ledger .avm-material-kpis .avm-tile:hover {
                transform: translateY(-2px);
                box-shadow: 0 9px 22px rgba(18, 59, 112, .11);
            }

            /* Keep all card content above the waves */
            .avm-ledger .avm-material-kpis .avm-tile > * {
                position: relative;
                z-index: 4;
            }


        .avm-ledger .avm-material-kpis .avm-kpi-icon {
            grid-area: icon;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, .65);
            box-shadow: none;
        }

            .avm-ledger .avm-material-kpis .avm-kpi-icon svg {
                display: block;
                width: 22px;
                height: 22px;
                max-width: 22px;
                max-height: 22px;
            }


        .avm-ledger .avm-material-kpis .avm-tile-label {
            grid-area: label;
            color: #07377f;
            font-size: 12px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: .01em;
        }

        .avm-ledger .avm-material-kpis .avm-tile-value {
            grid-area: value;
            font-size: 26px;
            font-weight: 850;
            line-height: 1.15;
            color: #1d4ed8;
        }

            .avm-ledger .avm-material-kpis .avm-tile-value .avm-tile-amount,
            .avm-ledger .avm-material-kpis .avm-tile-amount {
                font-size: inherit !important;
                font-weight: inherit !important;
                color: inherit !important;
                font-variant-numeric: tabular-nums;
            }

        .avm-ledger .avm-material-kpis .avm-tile.is-sky .avm-tile-value {
            color: #1d4ed8;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-mint .avm-tile-value {
            color: #047857;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-amber .avm-tile-value {
            color: #a84a08;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-lilac .avm-tile-value {
            color: #6d28d9;
        }

        .avm-ledger .avm-material-kpis .avm-tile-note {
            grid-area: note;
            font-size: 13px;
            font-weight: 700;
            line-height: 1.3;
            color: #1e3a8a;
            margin-top: 3px;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-sky .avm-tile-note {
            color: #1e3a8a;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-mint .avm-tile-note {
            color: #065f46;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-amber .avm-tile-note {
            color: #7c2d12;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-lilac .avm-tile-note {
            color: #4c1d95;
        }



        .avm-ledger .avm-material-kpis .avm-tile.is-sky {
            --ledger-wave: rgba(43, 139, 246, .17);
            --wave-one: rgba(71, 157, 246, .24);
            --wave-two: rgba(71, 157, 246, .17);
            --wave-three: rgba(71, 157, 246, .12);
            background: linear-gradient(120deg, #edf7ff, #dceeff);
            border: 1px solid #cfe7ff;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-mint {
            --ledger-wave: rgba(0, 181, 125, .16);
            --wave-one: rgba(27, 190, 139, .23);
            --wave-two: rgba(27, 190, 139, .16);
            --wave-three: rgba(27, 190, 139, .12);
            background: linear-gradient(120deg, #effcf7, #d9f8eb);
            border: 1px solid #c8f0df;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-amber {
            --ledger-wave: rgba(255, 136, 37, .16);
            --wave-one: rgba(255, 153, 67, .24);
            --wave-two: rgba(255, 153, 67, .17);
            --wave-three: rgba(255, 153, 67, .12);
            background: linear-gradient(120deg, #fff8ef, #ffead8);
            border: 1px solid #ffe1c8;
        }

        .avm-ledger .avm-material-kpis .avm-tile.is-lilac {
            --ledger-wave: rgba(151, 92, 246, .16);
            --wave-one: rgba(166, 116, 244, .24);
            --wave-two: rgba(166, 116, 244, .17);
            --wave-three: rgba(166, 116, 244, .12);
            background: linear-gradient(120deg, #f8f2ff, #ecddff);
            border: 1px solid #e7d7ff;
        }



        .avm-ledger .avm-material-kpis .avm-tile::before {
            content: "";
            position: absolute;
            z-index: 1;
            pointer-events: none;
            width: 115%;
            height: 82px;
            left: 8%;
            bottom: -48px;
            border-radius: 48% 52% 0 0 / 65% 75% 0 0;
            background: var(--wave-one);
            transform: rotate(-5deg);
            will-change: transform;
            animation: avmWaveA 7s ease-in-out infinite;
        }

        .avm-ledger .avm-material-kpis .avm-tile::after {
            content: "";
            position: absolute;
            z-index: 2;
            pointer-events: none;
            width: 110%;
            height: 65px;
            left: 25%;
            bottom: -39px;
            border-radius: 52% 48% 0 0 / 75% 65% 0 0;
            background: var(--wave-two);
            transform: rotate(5deg);
            will-change: transform;
            animation: avmWaveB 10s ease-in-out infinite;
        }

        .avm-ledger .avm-material-kpis .avm-tile:nth-child(2)::before {
            animation-delay: -2s;
        }

        .avm-ledger .avm-material-kpis .avm-tile:nth-child(2)::after {
            animation-delay: -3s;
        }

        .avm-ledger .avm-material-kpis .avm-tile:nth-child(3)::before {
            animation-delay: -4s;
        }

        .avm-ledger .avm-material-kpis .avm-tile:nth-child(3)::after {
            animation-delay: -6s;
        }

        .avm-ledger .avm-material-kpis .avm-tile:nth-child(4)::before {
            animation-delay: -5s;
        }

        .avm-ledger .avm-material-kpis .avm-tile:nth-child(4)::after {
            animation-delay: -8s;
        }

        .avm-ledger .avm-material-kpis .avm-tile .avm-tile-value {
            font-size: 22px;
            font-weight: 550;
            letter-spacing: -0.5px;
        }

@keyframes avmWaveA {
    0% {
        transform: translateX(-4%) translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateX(4%) translateY(-6px) rotate(-3deg);
    }

    100% {
        transform: translateX(-4%) translateY(0) rotate(-5deg);
    }
}

@keyframes avmWaveB {
    0% {
        transform: translateX(4%) translateY(-2px) rotate(5deg);
    }

    50% {
        transform: translateX(-5%) translateY(4px) rotate(3deg);
    }

    100% {
        transform: translateX(4%) translateY(-2px) rotate(5deg);
    }
}



.avm-ledger .avm-ledger-band {
    display: none !important;
}



.avm-ledger [data-avm-ledger-shell] {
    position: relative;
    margin: 0 24px 12px !important;
    border: 1px solid #cbdcf0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 14px rgba(20, 55, 100, .07);
}

    .avm-ledger [data-avm-ledger-shell] .avm-table-scroll {
        position: relative;
        max-height: max(260px, calc(100vh - 345px)) !important;
        overflow-y: auto;
        overflow-x: auto;
        scrollbar-gutter: stable;
    }

.avm-ledger .avm-ledger-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    /* One colour per column – change a colour here */
    --col-sr: #5b7089;
    --col-period: #0b7285; /* teal   */
    --col-opening: #be185d; /* pink   */
    --col-invoices: #1d4ed8; /* blue   */
    --col-credits: #047857; /* green  */
    --col-debits: #a84a08; /* orange */
    --col-receipts: #6d28d9; /* violet */
    --col-closing: #073c91; /* navy   */
}

.avm-ledger .avm-ledger-rate {
    padding: 6px 16px;
}


.avm-ledger [data-avm-ledger-shell] .avm-ledger-table thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    height: 40px;
    padding: 10px 12px;
    background: #075d86 !important;
    color: #fff !important;
    border-right: 1px solid rgba(255, 255, 255, .14);
    border-bottom: 1px solid #0b6c98;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}


.avm-ledger .avm-ledger-table tbody td {
    height: 34px;
    padding: 7px 12px;
    color: #092f77;
    font-size: 12px;
    border-right: 1px solid #d6e3f3;
    border-bottom: 1px solid #d6e3f3;
    background: #fff;
}

.avm-ledger .avm-ledger-table tbody tr:nth-child(even) td {
    background: #f4f8fd;
}

.avm-ledger .avm-ledger-table tbody tr:hover td {
    background: #e6f1ff !important;
}

.avm-ledger .avm-ledger-table tbody td:nth-child(1) {
    color: var(--col-sr) !important;
}

.avm-ledger .avm-ledger-table tbody td:nth-child(2) {
    color: var(--col-period) !important;
    font-weight: 800;
}

.avm-ledger .avm-ledger-table tbody td:nth-child(3) {
    color: var(--col-opening) !important;
    font-weight: 600;
}

.avm-ledger .avm-ledger-table tbody td:nth-child(4) {
    color: var(--col-invoices) !important;
}

.avm-ledger .avm-ledger-table tbody td:nth-child(5) {
    color: var(--col-credits) !important;
}

.avm-ledger .avm-ledger-table tbody td:nth-child(6) {
    color: var(--col-debits) !important;
}

.avm-ledger .avm-ledger-table tbody td:nth-child(7) {
    color: var(--col-receipts) !important;
}

.avm-ledger .avm-ledger-table tbody td:nth-child(8) {
    color: var(--col-closing) !important;
    font-weight: 800;
}

.avm-ledger .avm-ledger-table tbody td * {
    color: inherit !important;
    opacity: 1 !important;
    border-bottom-color: currentColor !important;
    text-decoration-color: currentColor !important;
}



.avm-ledger .avm-ledger-table tfoot {
    visibility: visible;
}

    .avm-ledger .avm-ledger-table tfoot td {
        position: sticky;
        bottom: 0;
        z-index: 5;
        height: 40px;
        padding: 10px 14px;
        background: #075d86 !important;
        color: #fff !important;
        border-top: 1px solid #0b719b;
        border-right: 1px solid rgba(255, 255, 255, .16);
        font-size: 13px;
        font-weight: 800;
        white-space: nowrap;
    }

        .avm-ledger .avm-ledger-table tfoot td:first-child {
            text-align: left;
            text-transform: uppercase;
            letter-spacing: .04em;
        }


@media (max-width: 900px) {
    .avm-ledger .avm-material-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .avm-ledger .avm-finder {
        margin-left: 12px !important;
        margin-right: 12px !important;
        padding: 14px !important;
        align-items: stretch !important;
    }

        .avm-ledger .avm-finder .avm-finder-actions {
            width: 100%;
            flex-wrap: wrap;
            margin-left: 0 !important;
            gap: 10px !important;
        }

    .avm-ledger .avm-table-search {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    .avm-ledger .avm-finder .avm-finder-go,
    .avm-ledger .avm-finder .avm-ledger-export {
        flex: 1 1 0;
        width: auto !important;
        min-width: 0 !important;
    }
}

@media (max-width: 560px) {
    .avm-ledger .avm-material-kpis {
        grid-template-columns: 1fr !important;
        gap: 11px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

        .avm-ledger .avm-material-kpis .avm-tile {
            min-height: 80px !important;
        }

    .avm-ledger [data-avm-ledger-shell] {
        margin-left: 12px !important;
        margin-right: 12px !important;
    }
}


@media (prefers-reduced-motion: reduce) {
    .avm-ledger .avm-material-kpis .avm-tile::before,
    .avm-ledger .avm-material-kpis .avm-tile::after {
        animation: none !important;
    }

    .avm-ledger .avm-material-kpis .avm-tile,
    .avm-ledger .avm-finder .avm-ledger-export,
    .avm-ledger .avm-finder .avm-finder-go {
        transition: none !important;
    }
}

.avm-invoice-finder {
    position: relative;
    z-index: 20;
    overflow: visible;
}