﻿/**
 * FinchBridge Design System (VDS) — components, layout, legacy compatibility
 */

/* Phase 2A: login.css scoped to auth via site-header (loadAuthCss) — not imported here */

/* ---- Base ---- */
body.vds-has-shell,
body.vb-has-shell {
    background: var(--background);
    font-family: var(--font-family);
    font-size: var(--font-body);
    line-height: var(--line-height-body);
    color: var(--text-primary);
}

body.auth-page {
    background: linear-gradient(160deg, var(--surface-muted) 0%, var(--background) 45%, var(--surface) 100%);
}

body.auth-page:has(.vds-page--login) {
    background: var(--background);
}

body.auth-page .vds-page--auth:not(.vds-page--login):not(.vds-page--register) {
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: center;
}

body.auth-page .auth-card { max-width: 42rem; margin-inline: auto; }

/* ---- App shell (fixed-width sidebar; collapse removed pending redesign) ----
   Horizontal spacing is owned ONLY by --shell-gutter on .vb-main-content / .vb-topbar.
   Page views must not add competing padding-left / margin-left against the sidebar. */
.vb-app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    column-gap: 0;
    row-gap: 0;
    min-height: calc(100vh - 1px);
}

.vb-sidebar {
    --nav-link-text: var(--sidebar-ink-text);
    --nav-link-icon: var(--sidebar-ink-muted);
    --nav-hover-bg: var(--sidebar-ink-hover);
    --nav-hover-text: #ffffff;
    --nav-active-bg: var(--sidebar-ink-active);
    --nav-active-text: #ffffff;
    --nav-active-icon: #ffffff;
    --nav-radius: 0.5rem;
    position: sticky;
    top: 0;
    align-self: start;
    z-index: 2;
    display: flex; flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--sidebar-surface, var(--sidebar-ink));
    color: var(--sidebar-ink-text);
    border-right: 1px solid var(--sidebar-ink-border);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.28);
    /* visible so sidebar help tips can extend over main content */
    overflow: visible;
}

.vb-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 4.25rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--sidebar-ink-border);
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
}

.vb-sidebar-brand:hover { color: #ffffff; }
.vb-sidebar-brand-icon,
.vb-sidebar-brand-logo {
    flex-shrink: 0;
    width: 2.15rem;
    height: 2.15rem;
    object-fit: contain;
    font-size: 1.35rem;
    color: var(--discipline-speech, var(--primary));
}
.vb-sidebar-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    overflow: hidden;
}
.vb-sidebar-brand-text {
    font-weight: var(--weight-bold);
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vb-sidebar-brand-tagline {
    font-size: 0.72rem;
    font-weight: var(--weight-medium);
    color: var(--sidebar-ink-muted);
    line-height: 1.25;
    white-space: normal;
}

.vb-topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: var(--space-3);
    min-height: var(--topbar-height);
    padding: 0 var(--shell-gutter-sm);
    background: var(--surface);
    backdrop-filter: none;
    border-bottom: 1px solid var(--border);
}

.vb-topbar--patient {
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
}

@media (min-width: 992px) {
    .vb-topbar--patient {
        display: none;
    }
}

.vb-topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: var(--font-small);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vb-topbar-portal {
    flex-shrink: 0;
    font-size: var(--font-caption);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Phase 178 — dual-role workspace selector in the main header (compact, not a CTA). */
.vb-topbar-workspace {
    position: relative;
    flex-shrink: 0;
    max-width: min(100%, 16rem);
}

.vb-topbar-workspace__summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.2rem 0.15rem 0.2rem 0.35rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.vb-topbar-workspace__summary::-webkit-details-marker {
    display: none;
}

.vb-topbar-workspace__summary::marker {
    content: '';
}

.vb-topbar-workspace__label {
    font-size: var(--font-caption);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    color: var(--text-muted);
}

.vb-topbar-workspace__summary i {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.vb-topbar-workspace[open] > .vb-topbar-workspace__summary {
    color: var(--text-strong, #151225);
    background: color-mix(in srgb, var(--primary) 6%, #fff);
}

.vb-topbar-workspace[open] > .vb-topbar-workspace__summary .vb-topbar-workspace__label {
    color: var(--text-strong, #151225);
}

.vb-topbar-workspace[open] > .vb-topbar-workspace__summary i {
    transform: rotate(180deg);
    color: var(--text-strong, #151225);
}

.vb-topbar-workspace__summary:hover .vb-topbar-workspace__label,
.vb-topbar-workspace__summary:hover i {
    color: var(--text-strong, #151225);
}

.vb-topbar-workspace__summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.vb-topbar-workspace__menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 40;
    min-width: 14.5rem;
    padding: 0.55rem;
    border: 1px solid var(--border-subtle, #e6e1f2);
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(49, 46, 129, 0.12);
}

.vb-topbar-workspace__menu-title {
    margin: 0 0 0.35rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.72rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.vb-topbar-workspace__form {
    display: block;
}

.vb-topbar-workspace__option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.6rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: var(--weight-semibold);
    text-align: left;
    line-height: 1.25;
    cursor: pointer;
}

button.vb-topbar-workspace__option:hover {
    background: color-mix(in srgb, var(--primary) 8%, #fff);
    color: var(--primary);
}

button.vb-topbar-workspace__option:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.vb-topbar-workspace__option.is-current {
    background: color-mix(in srgb, var(--primary) 8%, #fff);
    color: var(--text-strong, #151225);
    cursor: default;
}

.vb-topbar-workspace__option i,
.vb-topbar-workspace__option-spacer {
    display: inline-flex;
    width: 1rem;
    flex-shrink: 0;
    justify-content: center;
    color: var(--primary);
}

.vb-topbar-workspace__option-spacer {
    visibility: hidden;
}

@media (max-width: 767.98px) {
    .vb-topbar-workspace {
        max-width: 10.5rem;
    }

    .vb-topbar-workspace__label {
        font-size: 0.68rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 8.25rem;
    }

    .vb-topbar-workspace__menu {
        min-width: 12.5rem;
    }
}

.vb-sidebar-nav {
    flex: 1;
    min-width: 0;
    overflow-x: visible;
    overflow-y: auto;
    padding: 1.25rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.vb-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 0.35rem;
    min-width: 0;
}

.vb-nav-item--practice {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
}

.vb-nav-item--practice .vb-nav-item__row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    width: 100%;
}

.vb-nav-item--practice .vb-nav-item__row .vb-nav-link {
    flex: 1;
    min-width: 0;
}

button.vb-nav-link {
    appearance: none;
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

/* Phase 175 — Yes/No compact practice popover (anchored; sidebar width unchanged) */
.fb-practice-popover.fb-sidebar-practice,
.fb-sidebar-practice.fb-practice-popover {
    position: fixed;
    z-index: 50;
    width: min(17.5rem, calc(100vw - 1.25rem));
    max-width: calc(100vw - 1.25rem);
    max-height: min(28rem, calc(100vh - 1.25rem));
    overflow: auto;
    margin: 0;
    padding: 0.55rem 0.6rem 0.55rem;
    border: 1px solid rgba(91, 75, 138, 0.16);
    border-radius: 0.8rem;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(49, 46, 129, 0.14);
    box-sizing: border-box;
}

.fb-sidebar-practice[hidden] {
    display: none !important;
}

.fb-sidebar-practice__chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
}

.fb-sidebar-practice__title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fb-sidebar-practice__close {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    cursor: pointer;
    flex-shrink: 0;
}

.fb-sidebar-practice__close:hover,
.fb-sidebar-practice__close:focus-visible {
    color: var(--text-strong);
    background: rgba(91, 75, 138, 0.08);
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.fb-sidebar-practice__prompt {
    margin: 0 0 0.4rem;
    font-size: 0.98rem;
    line-height: 1.25;
    color: var(--text-strong);
    font-weight: var(--weight-semibold);
}

.fb-sidebar-practice__soft {
    margin: -0.15rem 0 0.35rem;
    font-size: 0.8rem;
    color: var(--primary);
}

.fb-sidebar-practice__answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin: 0 0 0.4rem;
}

.fb-sidebar-practice__answer {
    appearance: none;
    border: 2px solid rgba(91, 75, 138, 0.22);
    border-radius: 0.7rem;
    min-height: 2.85rem;
    padding: 0.45rem 0.5rem;
    font-size: 1.05rem;
    font-weight: var(--weight-bold);
    background: #fff;
    color: var(--text-strong);
    cursor: pointer;
}

.fb-sidebar-practice__answer--yes {
    order: 0;
}

.fb-sidebar-practice__answer--no {
    order: 1;
}

.fb-sidebar-practice__answer:hover,
.fb-sidebar-practice__answer:focus-visible {
    border-color: var(--primary);
    background: rgba(91, 75, 138, 0.08);
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.fb-sidebar-practice__media {
    display: flex;
    justify-content: center;
    margin: 0 0 0.35rem;
    max-height: 4.75rem;
}

.fb-sidebar-practice__media img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 4.75rem;
    height: auto;
    object-fit: contain;
    border-radius: 0.45rem;
}

.fb-sidebar-practice__hear,
.fb-sidebar-practice__next,
.fb-sidebar-practice__retry,
.fb-sidebar-practice__done {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2rem;
    margin: 0 0 0.3rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(91, 75, 138, 0.18);
    background: #fff;
    color: var(--text-strong);
    font-size: 0.82rem;
    font-weight: var(--weight-semibold);
    cursor: pointer;
}

.fb-sidebar-practice__hear:hover,
.fb-sidebar-practice__next:hover,
.fb-sidebar-practice__retry:hover,
.fb-sidebar-practice__done:hover,
.fb-sidebar-practice__pause:hover,
.fb-sidebar-practice__hear:focus-visible,
.fb-sidebar-practice__next:focus-visible,
.fb-sidebar-practice__retry:focus-visible,
.fb-sidebar-practice__done:focus-visible,
.fb-sidebar-practice__pause:focus-visible {
    background: rgba(91, 75, 138, 0.06);
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.fb-sidebar-practice__progress {
    margin: 0 0 0.25rem;
    font-size: 0.72rem;
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    text-align: center;
}

.fb-sidebar-practice__pause {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 1.75rem;
    margin: 0;
    padding: 0.15rem 0.4rem;
    border-radius: 0.45rem;
    border: 1px dashed rgba(91, 75, 138, 0.22);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: var(--weight-medium);
    cursor: pointer;
}

.fb-sidebar-practice__complete-lead {
    margin: 0 0 0.25rem;
    font-size: 0.98rem;
    font-weight: var(--weight-bold);
    color: var(--text-strong);
}

.fb-sidebar-practice__loading,
.fb-sidebar-practice__error {
    margin: 0.2rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.fb-sidebar-practice.is-busy {
    opacity: 0.72;
    pointer-events: none;
}

.fb-sidebar-practice__answers--yes-only,
.fb-sidebar-practice__answers--no-only {
    grid-template-columns: 1fr 1fr;
}

.fb-sidebar-practice__answers--yes-only .fb-sidebar-practice__answer--yes {
    grid-column: 1;
}

.fb-sidebar-practice__answers--no-only .fb-sidebar-practice__answer--no {
    grid-column: 2;
}

@media (max-width: 991.98px) {
    .fb-practice-popover.fb-sidebar-practice,
    .fb-sidebar-practice.fb-practice-popover {
        z-index: 1050;
    }
}

@media (min-width: 992px) {
    .fb-sidebar-practice__answers {
        grid-template-columns: 1fr 1fr;
    }

    .fb-sidebar-practice__answer--yes {
        order: 0;
    }

    .fb-sidebar-practice__answer--no {
        order: 0;
    }

    .fb-sidebar-practice__answers--no-only {
        grid-template-columns: 1fr 1fr;
    }

    .fb-sidebar-practice__answers--no-only .fb-sidebar-practice__answer--no {
        grid-column: 2;
    }
}

.vb-nav-item:has(.vb-nav-link.is-active)::before {
    content: "";
    position: absolute;
    left: -0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.28rem;
    height: 1.65rem;
    border-radius: var(--radius-full);
    background: var(--nav-active-bg);
}

.vb-nav-item .vb-nav-link {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

/* Sidebar contextual help — dedicated tip module (sidebar-help-tooltip.js).
   Panels are portaled to document.body with Floating UI–style placement. */
.vb-nav-item .vds-sidebar-tip {
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
}

.vds-sidebar-tip__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--nav-help-size, 1.75rem);
    height: var(--nav-help-size, 1.75rem);
    min-width: var(--nav-help-size, 1.75rem);
    min-height: var(--nav-help-size, 1.75rem);
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    opacity: 0.45;
    color: var(--text-muted);
    background: transparent;
    cursor: help;
    transition: color 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

.vb-nav-item:hover .vds-sidebar-tip__trigger {
    opacity: 0.65;
}

.vds-sidebar-tip:hover .vds-sidebar-tip__trigger,
.vds-sidebar-tip:focus-within .vds-sidebar-tip__trigger,
.vds-sidebar-tip.is-open .vds-sidebar-tip__trigger {
    opacity: 1;
    color: var(--primary);
    background: var(--primary-soft);
}

.vds-sidebar-tip__trigger:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Hidden until JS portals the panel to the body host */
.vds-sidebar-tip__panel:not(.vds-sidebar-tip__panel--portaled) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.vds-sidebar-tip-portal {
    position: fixed;
    z-index: 40;
    box-sizing: border-box;
    width: max-content;
    min-width: 14rem;
    max-width: min(20rem, calc(100vw - 1.25rem));
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 4px, 0);
    transition:
        opacity 150ms ease,
        visibility 150ms ease,
        transform 150ms ease;
}

.vds-sidebar-tip-portal.is-visible {
    visibility: visible;
}

.vds-sidebar-tip-portal.is-visible.is-enter {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.vds-sidebar-tip-portal.is-measuring {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: none !important;
}

.vds-sidebar-tip-portal[data-placement="right"].is-visible:not(.is-enter) {
    transform: translate3d(-4px, 0, 0);
}

.vds-sidebar-tip-portal[data-placement="left"].is-visible:not(.is-enter) {
    transform: translate3d(4px, 0, 0);
}

.vds-sidebar-tip-portal[data-placement="top"].is-visible:not(.is-enter) {
    transform: translate3d(0, 4px, 0);
}

.vds-sidebar-tip-portal[data-placement="bottom"].is-visible:not(.is-enter) {
    transform: translate3d(0, -4px, 0);
}

.vds-sidebar-tip-portal .vds-sidebar-tip__panel--portaled {
    display: block;
    margin: 0;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    background: var(--text-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

.vds-sidebar-tip__heading {
    margin: 0 0 0.3rem;
    font-size: 0.8rem;
    font-weight: var(--weight-bold);
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.vds-sidebar-tip__body {
    margin: 0;
    font-size: 0.875rem;
    font-weight: var(--weight-medium);
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: break-word;
}

@media (prefers-reduced-motion: reduce) {
    .vds-sidebar-tip-portal {
        transition: opacity 120ms ease, visibility 120ms ease;
        transform: none;
    }

    .vds-sidebar-tip-portal.is-visible.is-enter,
    .vds-sidebar-tip-portal[data-placement].is-visible:not(.is-enter) {
        transform: none;
    }
}

.vb-nav-section {
    display: block;
    margin: var(--space-4) 0 var(--space-2);
    padding: 0 var(--space-2);
    max-width: 100%;
    min-width: 0;
    font-size: var(--font-caption);
    font-weight: var(--weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vb-sidebar-nav > .vb-nav-section:first-of-type {
    margin-top: 0;
}

.vb-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.vb-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--nav-link-gap, var(--space-3));
    min-height: var(--nav-min-height);
    padding: var(--nav-link-pad-y, 0.65rem) var(--nav-link-pad-x, 0.9rem);
    border-radius: var(--nav-radius);
    color: var(--nav-link-text);
    text-decoration: none;
    font-weight: var(--weight-semibold);
    font-size: 0.95rem;
    line-height: 1.25;
    transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.vb-nav-link > span {
    /* Intentional wrap for longer labels (e.g. My Communication) — max two lines. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: normal;
    line-height: 1.25;
    min-width: 0;
}

.vb-nav-link i {
    font-size: var(--nav-icon-size, 1.15rem);
    width: var(--nav-icon-slot, 1.35rem);
    text-align: center;
    flex-shrink: 0;
    color: var(--nav-link-icon);
}
.vb-nav-link:hover { background: var(--nav-hover-bg); color: var(--nav-hover-text); }
.vb-nav-link:hover i { color: var(--primary); }
.vb-nav-link.is-active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    box-shadow: 0 8px 20px rgba(91, 63, 196, 0.22);
}
.vb-nav-link.is-active i { color: var(--nav-active-icon); }
.vb-nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vb-nav-link:disabled,
.vb-nav-link.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.vb-sidebar .vb-nav-section {
    color: var(--sidebar-ink-muted);
}
.vb-sidebar .vb-nav-link:hover i {
    color: inherit;
}
.vb-sidebar .vb-nav-link.is-active,
.vb-sidebar .vb-nav-link--speak.is-active,
.vb-sidebar .vb-nav-link--help.is-active {
    box-shadow: none;
}
.vb-sidebar .vds-sidebar-tip__trigger {
    color: var(--sidebar-ink-muted);
}
.vb-sidebar .vds-sidebar-tip:hover .vds-sidebar-tip__trigger,
.vb-sidebar .vds-sidebar-tip:focus-within .vds-sidebar-tip__trigger,
.vb-sidebar .vds-sidebar-tip.is-open .vds-sidebar-tip__trigger {
    color: #ffffff;
    background: var(--sidebar-ink-hover);
}

/**
 * Shared interactive surface — same hover language as .vb-nav-link.
 * Use on clickable cards/links only. Non-clickable surfaces must omit this class.
 */
.vds-interactive-surface {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition:
        background-color var(--transition),
        color var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.vds-interactive-surface:hover,
.vds-interactive-surface:focus-visible,
.vds-interactive-surface:has(:focus-visible) {
    background: var(--nav-hover-bg);
    color: inherit;
    text-decoration: none;
}

.vds-interactive-surface:focus-visible,
.vds-interactive-surface:has(:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Soft elevation aligned with active nav shadow — no lift/scale. */
.vds-interactive-surface--elevated:hover,
.vds-interactive-surface--elevated:focus-visible,
.vds-interactive-surface--elevated:has(:focus-visible) {
    box-shadow: 0 8px 20px rgba(91, 63, 196, 0.14);
}

@media (prefers-reduced-motion: reduce) {
    .vds-interactive-surface {
        transition: none;
    }
}

/* Patient Speak / Help — same nav geometry as other items (Phase 202).
   Keep markers for tooling; do not use separate pill/button chrome inside Communication. */
[data-portal="patient"] .vb-nav-item--tool {
    margin-top: 0;
    margin-bottom: 0.35rem;
}

[data-portal="patient"] .vb-nav-item--speak {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

[data-portal="patient"] .vb-nav-link--speak,
[data-portal="patient"] .vb-nav-link--help {
    min-height: var(--nav-min-height);
    font-weight: var(--weight-semibold);
    letter-spacing: normal;
    background: transparent;
    color: var(--nav-link-text);
    box-shadow: none;
}

[data-portal="patient"] .vb-nav-link--speak i,
[data-portal="patient"] .vb-nav-link--help i {
    color: var(--nav-link-icon);
}

[data-portal="patient"] .vb-nav-link--speak:hover,
[data-portal="patient"] .vb-nav-link--help:hover {
    background: var(--nav-hover-bg);
    color: var(--nav-hover-text);
    box-shadow: none;
}

[data-portal="patient"] .vb-nav-link--speak:hover i,
[data-portal="patient"] .vb-nav-link--help:hover i {
    color: var(--primary);
}

[data-portal="patient"] .vb-nav-link--speak.is-active,
[data-portal="patient"] .vb-nav-link--help.is-active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    box-shadow: 0 8px 20px rgba(91, 63, 196, 0.22);
}

[data-portal="patient"] .vb-nav-link--speak.is-active i,
[data-portal="patient"] .vb-nav-link--help.is-active i {
    color: var(--nav-active-icon);
}

[data-portal="patient"] .vb-nav-item--tool:has(.vb-nav-link.is-active)::before {
    background: var(--nav-active-bg);
    opacity: 1;
}

.vb-nav-link--logout,
.vb-nav-link--logout i { color: #FCA5A5; }
.vb-nav-link--logout:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #FECACA;
}
.vb-nav-link--logout:hover i { color: #FECACA; }
.vb-sidebar-logout { margin: 0; }
.vb-sidebar-logout .vb-nav-link {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.vb-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
    padding: 1rem 0.9rem 1.15rem;
    border-top: 1px solid var(--sidebar-ink-border);
    background: transparent;
    overflow: hidden;
}

.vb-main {
    display: flex; flex-direction: column; flex: 1; min-width: 0;
    margin-left: 0;
    background: transparent;
}

/* Canonical sidebar gutter — identical for every portal / page.
   Does NOT set content max-width; page layouts own that independently. */
.vb-main-content {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: var(--shell-pad-block-start-sm) var(--shell-gutter-sm) var(--shell-pad-block-end-sm);
    box-sizing: border-box;
}

/* Soft ceiling only — dashboards/tables use available width up to --content-max.
   Page-specific layouts (practice, forms) override max-width in their own CSS. */
body.vb-has-shell .vds-page-container,
body.vds-has-shell .vds-page-container {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

body.vb-has-shell .vds-page-header,
body.vds-has-shell .vds-page-header {
    margin-bottom: var(--page-header-gap);
}

body.vb-has-shell .vds-section,
body.vds-has-shell .vds-section {
    margin-bottom: var(--section-gap);
}

.vb-topbar-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    position: relative;
    width: 2.25rem; height: 2.25rem; padding: 0;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-primary);
    transition: background-color var(--transition), border-color var(--transition);
}

.vb-topbar-toggle:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.vb-topbar-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vb-topbar-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }

/* Platform / shell disclosures */
.vb-main-content details > summary {
    cursor: pointer;
}

.vb-main-content details > summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.vb-page-body {
    flex: 1; width: 100%; max-width: var(--content-max);
    margin-inline: auto; padding: var(--space-4) var(--space-4) var(--space-6);
}

.vb-sidebar-backdrop {
    display: none; position: fixed; inset: 0; z-index: 1035;
    background: color-mix(in srgb, var(--text-primary) 40%, transparent);
}

@media (max-width: 991.98px) {
    .vb-app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .vb-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1040;
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
        max-width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .vb-sidebar.is-mobile-open { transform: translateX(0); }
    .vb-sidebar-backdrop.is-visible { display: block; }
    body.vb-has-shell .site-footer { margin-left: 0; }
    .vds-editor-sticky-footer { left: 0; }
}

@media (min-width: 992px) {
    .vb-topbar-toggle--mobile { display: none; }

    .vb-topbar {
        padding-left: var(--shell-gutter);
        padding-right: var(--shell-gutter);
    }

    .vb-main-content {
        padding: var(--shell-pad-block-start) var(--shell-gutter) var(--shell-pad-block-end);
    }
}

body.vb-has-shell .site-footer {
    margin-left: var(--sidebar-width);
    border-top: 1px solid var(--border); background: var(--surface);
    padding: var(--space-4) 0; font-size: var(--font-small); color: var(--text-muted);
}

/* ---- Page layout ---- */
.vds-container { width: 100%; max-width: var(--content-max); margin-inline: auto; }
.vds-page-header { margin-bottom: var(--page-header-gap); }
.vds-page-header__main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
}
.vds-page-header__intro { flex: 1 1 16rem; min-width: 0; }
.vds-page-header__primary { flex: 0 0 auto; }
.vds-page-title { font-size: var(--font-page-title); font-weight: var(--weight-bold); line-height: var(--line-height-tight); margin: 0 0 var(--space-2); letter-spacing: -0.02em; }
.vds-page-subtitle { font-size: var(--font-body); color: var(--text-muted); margin: 0; }

/* ---- Page chrome (Patients header recipe) ---- */
/* WorkspaceHero lives inside .vds-page-container so title and content share width.
   Auto height. White surface. No lavender marketing band. Decorative illustration off.
   PageToolbar, when the next sibling, fuses into the same header surface. */
.vds-workspace-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    width: 100%;
    max-width: none;
    margin: 0 0 var(--page-header-gap);
    height: auto;
    min-height: 0;
    max-height: none;
    padding: var(--workspace-hero-padding-block) var(--workspace-hero-padding-inline);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--workspace-hero-radius);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.vds-workspace-hero__rail {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    margin-inline: 0;
    padding-inline: 0;
    box-sizing: border-box;
}

.vds-workspace-hero__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.vds-workspace-hero__backdrop-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    transform: none;
    object-fit: cover;
    object-position: 78% center;
    opacity: var(--workspace-hero-bridge-opacity);
    border-radius: 0;
    /* Soft left fade for text readability — not a second opacity system */
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.12) 16%,
        rgba(0, 0, 0, 0.4) 36%,
        rgba(0, 0, 0, 0.75) 55%,
        #000 72%,
        #000 100%
    );
    mask-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.12) 16%,
        rgba(0, 0, 0, 0.4) 36%,
        rgba(0, 0, 0, 0.75) 55%,
        #000 72%,
        #000 100%
    );
}

.vds-workspace-hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.2rem var(--space-4);
    width: 100%;
    height: auto;
    min-height: 0;
    max-width: 100%;
}

.vds-workspace-hero--has-art .vds-workspace-hero__content {
    max-width: 100%;
    padding-right: 0;
}

.vds-workspace-hero--has-art .vds-workspace-hero__main {
    position: relative;
    z-index: 2;
    max-width: none;
    padding: 0;
    background: none;
}

.vds-workspace-hero__crumbs {
    grid-column: 1 / -1;
    margin-bottom: 0.15rem;
    flex-shrink: 0;
}

.vds-workspace-hero__main {
    min-width: 0;
    flex: 0 1 auto;
}

.vds-workspace-hero__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.4rem;
    row-gap: 0.1rem;
    margin: 0;
    font-size: var(--workspace-hero-title-size);
    font-weight: var(--weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

.vds-workspace-hero__title-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.vds-workspace-hero__wave {
    display: inline-block;
    flex: 0 0 auto;
    font-size: 0.88em;
    line-height: 1;
}

.vds-workspace-hero__date {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: var(--weight-medium);
    letter-spacing: 0.01em;
}

.vds-workspace-hero__subtitle {
    margin: 0.2rem 0 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: var(--line-height-relaxed);
    max-width: 34rem;
    font-weight: var(--weight-regular);
}

.vds-workspace-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.45rem 0 0;
    padding: 0.3rem 0.7rem;
    max-width: 100%;
    width: fit-content;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface-muted);
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.35;
    white-space: normal;
    box-shadow: none;
}

.vds-workspace-hero__badge-icon {
    flex-shrink: 0;
    color: var(--primary);
    font-size: 1.15rem;
    line-height: 1;
}

.vds-workspace-hero__badge-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    min-width: 0;
    font-weight: var(--weight-semibold);
}

.vds-workspace-hero__badge-kicker {
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
}

.vds-workspace-hero__badge-stage {
    font-weight: var(--weight-semibold);
    color: var(--text-strong);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.vds-workspace-hero__badge-waiting {
    font-weight: var(--weight-medium);
    color: var(--text-primary);
    white-space: normal;
}

.vds-workspace-hero__badge--goal {
    align-items: flex-start;
    border-radius: var(--radius-xl);
    padding: 0.85rem 1.15rem;
    max-width: min(100%, 28rem);
    gap: 0.7rem;
}

.vds-workspace-hero__badge--goal .vds-workspace-hero__badge-icon {
    margin-top: 0.12rem;
}

.vds-workspace-hero__badge--goal .vds-workspace-hero__badge-kicker {
    font-size: 0.78rem;
    font-weight: var(--weight-bold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--primary);
}

.vds-workspace-hero__badge--goal .vds-workspace-hero__badge-message {
    font-weight: var(--weight-medium);
    color: var(--text-primary);
    white-space: normal;
    line-height: 1.4;
}

.vds-workspace-hero__badge--goal .vds-workspace-hero__badge-message + .vds-workspace-hero__badge-message {
    margin-top: 0.15rem;
    color: var(--text-secondary);
    font-weight: var(--weight-regular);
}

.vds-workspace-hero__badge--celebrate .vds-workspace-hero__badge-kicker {
    text-transform: none;
    letter-spacing: 0;
    font-size: 1.05rem;
    font-weight: var(--weight-semibold);
    color: var(--text-strong);
}

.vds-workspace-hero__badge-wrap {
    margin-top: 0.85rem;
}

.vds-workspace-hero__badge-wrap .vds-workspace-hero__badge {
    margin-top: 0;
}

.vds-workspace-hero__actions {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    max-width: 100%;
    flex-shrink: 0;
}

/* Keep header CTAs on one baseline — no nested flex wrappers needed. */
.vds-workspace-hero__actions > .vds-btn {
    flex: 0 0 auto;
    margin: 0;
}

.vds-workspace-hero--has-art .vds-workspace-hero__actions {
    max-width: 100%;
}

/* Optional stats row under WorkspaceHero (Page::open stats prop) */
.vds-page-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: var(--space-3);
    margin: 0 0 var(--page-header-gap);
}

.vds-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--page-header-gap);
}

.vds-status-row--flush {
    margin-bottom: 0;
}

.vds-page-stats__item {
    min-width: 0;
}

.vds-page-stats__card {
    display: block;
    height: 100%;
    padding: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.vds-page-stats__label {
    margin: 0 0 var(--space-1);
    color: var(--text-muted);
    font-size: var(--font-small);
    font-weight: var(--weight-semibold);
}

.vds-page-stats__icon {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    line-height: 1;
}

.vds-page-stats__value {
    margin: 0;
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: var(--weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-strong);
}

.vds-page-stats__hint {
    margin: var(--space-1) 0 0;
    color: var(--text-muted);
    font-size: var(--font-caption);
    line-height: 1.4;
}

@media (max-width: 575.98px) {
    .vds-workspace-hero__actions {
        gap: var(--space-2);
    }

    .vds-workspace-hero__actions > .vds-btn {
        flex: 1 1 calc(50% - var(--space-2));
        justify-content: center;
        text-align: center;
    }
}

/* Compact modifier — same EHR chrome, slightly tighter padding. Home uses this too. */
.vds-workspace-hero--compact {
    --workspace-hero-height: auto;
    --workspace-hero-min-height: 0;
    height: auto;
    min-height: 0;
    max-height: none;
    --workspace-hero-padding-block: 0.7rem;
    --workspace-hero-padding-inline: 1.35rem;
    --workspace-hero-radius: var(--radius-panel, 0.5rem);
    --workspace-hero-title-size: clamp(1.25rem, 2vw, 1.5rem);
    box-shadow: var(--shadow-sm);
}

.vds-workspace-hero--compact .vds-workspace-hero__backdrop-img {
    opacity: var(--workspace-hero-bridge-opacity);
}

/* Patients recipe: PageToolbar fuses into the header surface when it is the next sibling. */
.vds-page-container > .vds-workspace-hero:has(+ .vds-page-toolbar) {
    margin-bottom: 0;
    border-bottom-width: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none;
}

.vds-page-container > .vds-workspace-hero + .vds-page-toolbar {
    margin: 0 0 var(--page-header-gap);
    padding: 0 var(--workspace-hero-padding-inline) var(--workspace-hero-padding-block);
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--workspace-hero-radius) var(--workspace-hero-radius);
    box-shadow: var(--shadow-sm);
}

.vds-page-container:has(> .vds-workspace-hero--compact) {
    --workspace-hero-padding-block: 0.7rem;
    --workspace-hero-padding-inline: 1.35rem;
}

@media (max-width: 1024px) {
    .vds-page-container:has(> .vds-workspace-hero--compact) {
        --workspace-hero-padding-block: 0.6rem;
        --workspace-hero-padding-inline: 1.15rem;
    }
}

@media (max-width: 767.98px) {
    .vds-page-container:has(> .vds-workspace-hero--compact) {
        --workspace-hero-padding-block: 0.55rem;
        --workspace-hero-padding-inline: 1rem;
    }
}

@media (max-width: 1024px) {
    .vds-workspace-hero {
        --workspace-hero-padding-block: 0.7rem;
        --workspace-hero-padding-inline: 1.15rem;
    }

    .vds-workspace-hero--compact {
        --workspace-hero-padding-block: 0.6rem;
        --workspace-hero-padding-inline: 1.15rem;
    }
}

@media (max-width: 767.98px) {
    .vds-workspace-hero {
        --workspace-hero-padding-block: 0.6rem;
        --workspace-hero-padding-inline: 1rem;
        --workspace-hero-title-size: clamp(1.15rem, 4vw, 1.4rem);
    }

    .vds-workspace-hero--compact {
        --workspace-hero-padding-block: 0.55rem;
        --workspace-hero-padding-inline: 1rem;
        --workspace-hero-title-size: clamp(1.15rem, 4vw, 1.4rem);
    }

    .vds-workspace-hero__content {
        grid-template-columns: minmax(0, 1fr);
    }

    .vds-workspace-hero__actions {
        grid-column: 1;
        grid-row: auto;
        justify-content: flex-start;
    }

    .vds-workspace-hero--has-art .vds-workspace-hero__content {
        max-width: 100%;
        text-align: left;
    }

    .vds-workspace-hero__backdrop-img {
        object-position: 80% center;
    }
}

/* In-page hero targets (e.g. People → Add People) clear sticky chrome when scrolled */
#add-people {
    scroll-margin-top: 1.5rem;
}

.vds-section { margin-bottom: var(--section-gap); }
.vds-section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.vds-section-title {
    font-size: var(--font-section-title);
    font-weight: var(--weight-bold);
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}
.vds-section-subtitle {
    font-size: var(--font-body);
    color: var(--text-muted);
    margin: 0.35rem 0 var(--space-5);
    line-height: var(--line-height-relaxed);
}

/* ---- Buttons ---- */
.vds-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    border: 1px solid transparent; border-radius: var(--radius-panel, 0.5rem);
    font-size: var(--font-button); font-weight: var(--weight-semibold); line-height: 1.2;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.vds-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vds-btn:disabled, .vds-btn.is-loading { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.vds-btn:not(:disabled):not(.is-loading):hover { box-shadow: var(--shadow-sm); }

.vds-btn--sm { min-height: 2rem; padding: 0.3rem 0.75rem; font-size: var(--font-caption); border-radius: var(--radius-panel, 0.5rem); }
.vds-btn--md { min-height: 2.5rem; padding: 0.45rem 1.05rem; font-size: var(--font-button); }
.vds-btn--lg { min-height: 2.85rem; padding: 0.55rem 1.25rem; font-size: var(--font-small); }

.vds-btn--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-inverse); border-color: transparent;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.28);
}
.vds-btn--primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--secondary-hover) 100%);
    border-color: transparent; color: var(--text-inverse);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}
.vds-btn--secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    color: var(--text-inverse); border-color: transparent;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.25);
}
.vds-btn--secondary:hover {
    background: linear-gradient(135deg, var(--secondary-hover) 0%, var(--secondary) 100%);
    border-color: transparent; color: var(--text-inverse);
}
.vds-btn--success {
    background: linear-gradient(135deg, var(--success) 0%, var(--accent-teal) 100%);
    color: var(--text-inverse); border-color: transparent;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}
.vds-btn--success:hover { background: linear-gradient(135deg, var(--success-hover) 0%, #0D9488 100%); color: var(--text-inverse); }
.vds-btn--danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--accent-rose) 100%);
    color: var(--text-inverse); border-color: transparent;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25);
}
.vds-btn--danger:hover { background: linear-gradient(135deg, var(--danger-hover) 0%, #E11D48 100%); color: var(--text-inverse); }
.vds-btn--warning {
    background: linear-gradient(135deg, var(--warning) 0%, #FB923C 100%);
    color: var(--text-primary); border-color: transparent;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}
.vds-btn--warning:hover { background: linear-gradient(135deg, var(--warning-hover) 0%, #EA580C 100%); color: var(--text-primary); }
.vds-btn--ghost { background: transparent; color: var(--text-primary); border-color: transparent; }
.vds-btn--ghost:hover { background: var(--primary-soft); color: var(--primary); }
.vds-btn--outline {
    background: var(--surface); color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.vds-btn--outline:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-hover); }
.vds-btn--outline-danger {
    background: var(--surface);
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}
.vds-btn--outline-danger:hover {
    background: var(--danger-soft, color-mix(in srgb, var(--danger) 12%, var(--surface)));
    color: var(--danger);
    border-color: var(--danger);
}
summary.vds-btn {
    display: inline-flex;
    list-style: none;
    cursor: pointer;
}
summary.vds-btn::-webkit-details-marker {
    display: none;
}
.vds-btn--link { background: transparent; color: var(--primary); border-color: transparent; padding-inline: 0; min-height: auto; }
.vds-btn--link:hover { color: var(--primary-hover); transform: none; box-shadow: none; }
.vds-btn.is-active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

.vds-btn__spinner {
    width: 1rem; height: 1rem; border: 2px solid currentColor;
    border-right-color: transparent; border-radius: 50%;
    animation: vds-spin 0.65s linear infinite;
}

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

/* ---- Cards ---- */
.vds-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.vds-card--elevated { box-shadow: var(--shadow-md); }
.vds-card--outlined { box-shadow: none; border-color: var(--border); }
.vds-card--compact .vds-card__body { padding: var(--space-3) var(--space-4); }
.vds-card--standard .vds-card__body,
.vds-card:not(.vds-card--compact) .vds-card__body { padding: var(--space-4) var(--space-5); }

.vds-card__header {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
    padding: var(--space-4) var(--space-5) 0;
}
.vds-card__title {
    font-size: var(--font-section-title);
    font-weight: var(--weight-bold);
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}
.vds-card__footer {
    padding: 0 var(--space-5) var(--space-4);
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
}

.vds-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---- Forms ---- */
.vds-field { margin-bottom: var(--space-4); }
.vds-label { display: block; font-size: var(--font-label); font-weight: var(--weight-semibold); margin-bottom: var(--space-1); color: var(--text-primary); }
.vds-label__required { color: var(--danger); margin-left: 0.15rem; }

.vds-input, .vds-select, .vds-textarea {
    display: block; width: 100%;
    min-height: 2.85rem; padding: 0.7rem 1rem;
    font-size: var(--font-body); color: var(--text-primary);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem); transition: border-color var(--transition), box-shadow var(--transition);
}

/*
 * Inline form actions — input/select + action share one control row.
 *
 * Labeled fields include a .vds-label. Action columns must reserve the same
 * label slot (.vds-inline-form__label-slot) so the button sits on the control
 * row and is vertically centred with the adjacent input/select — never
 * flex-end against the whole field column.
 *
 * @see docs/ui/INLINE_FORM_ALIGNMENT_AUDIT.md
 */
.vds-inline-form {
    --vds-inline-control-height: 2.5rem;
    --vds-inline-control-radius: var(--radius-lg);
    --vds-inline-control-gap: var(--space-3);
    /* Must match .vds-label: font-size + line-height + margin-bottom */
    --vds-inline-label-slot: calc((var(--font-label) * 1.25) + var(--space-1));
}

.vds-inline-form.row {
    --bs-gutter-x: var(--vds-inline-control-gap);
    --bs-gutter-y: var(--vds-inline-control-gap);
    align-items: flex-start;
}

.vds-inline-form .vds-field {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vds-inline-form .vds-label {
    flex: 0 0 auto;
    line-height: 1.25;
    min-height: calc(var(--font-label) * 1.25);
    margin-bottom: var(--space-1);
}

.vds-inline-form .vds-input,
.vds-inline-form .vds-select,
.vds-inline-form .form-control,
.vds-inline-form .form-select {
    box-sizing: border-box;
    width: 100%;
    height: var(--vds-inline-control-height);
    min-height: var(--vds-inline-control-height);
    max-height: var(--vds-inline-control-height);
    padding: 0 1rem;
    line-height: 1.2;
    border-radius: var(--vds-inline-control-radius);
}

.vds-inline-form__actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-width: 0;
}

.vds-inline-form__label-slot {
    display: block;
    flex: 0 0 auto;
    height: var(--vds-inline-label-slot);
    min-height: var(--vds-inline-label-slot);
    margin: 0;
    padding: 0;
    line-height: 1.25;
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    visibility: hidden;
    pointer-events: none;
    user-select: none;
    overflow: hidden;
}

.vds-inline-form__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--vds-inline-control-height);
    min-width: 0;
}

.vds-inline-form__controls .vds-btn,
.vds-inline-form__controls .btn,
.vds-inline-form__actions > .vds-btn,
.vds-inline-form__actions > .btn {
    box-sizing: border-box;
    height: var(--vds-inline-control-height);
    min-height: var(--vds-inline-control-height);
    max-height: var(--vds-inline-control-height);
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1.2;
    border-radius: var(--vds-inline-control-radius);
    transform: none;
}

.vds-inline-form__controls .vds-btn:not(:disabled):not(.is-loading):hover,
.vds-inline-form__controls .btn:not(:disabled):not(.is-loading):hover,
.vds-inline-form__actions > .vds-btn:not(:disabled):not(.is-loading):hover,
.vds-inline-form__actions > .btn:not(:disabled):not(.is-loading):hover {
    transform: none;
}

/* Compact: unlabeled control + action (table cells, dense toolbars). */
.vds-inline-form--compact {
    --vds-inline-control-height: 2.25rem;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.vds-inline-form--compact .vds-field {
    margin-bottom: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.vds-inline-form--compact .vds-inline-form__label-slot {
    display: none;
}

.vds-inline-form--compact .vds-inline-form__actions {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
}

.vds-inline-form--compact .vds-inline-form__controls {
    min-height: var(--vds-inline-control-height);
}

@media (max-width: 767.98px) {
    .vds-inline-form__actions {
        width: 100%;
    }

    .vds-inline-form__controls .vds-btn,
    .vds-inline-form__controls .btn {
        flex: 1 1 auto;
    }
}

.vds-textarea { min-height: 6rem; resize: vertical; }
.vds-input:focus, .vds-select:focus, .vds-textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.vds-input::placeholder, .vds-textarea::placeholder { color: var(--text-muted); }
.vds-field--invalid .vds-input, .vds-field--invalid .vds-select, .vds-field--invalid .vds-textarea { border-color: var(--danger); }
.vds-help { font-size: var(--font-small); color: var(--text-muted); margin: var(--space-1) 0 0; }
.vds-help--field-block { margin-top: var(--space-2); line-height: 1.5; }
.vds-help--field-block p { margin: 0 0 var(--space-2); }
.vds-help--field-block p:last-child { margin-bottom: 0; }
.vds-help__steps {
    margin: 0 0 var(--space-3);
    padding-left: 1.25rem;
}
.vds-help__steps li + li { margin-top: var(--space-1); }
.vds-help__link-row { margin-top: var(--space-1); }
.vds-help__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--primary);
    text-decoration: none;
}
.vds-help__link--primary { font-weight: var(--weight-semibold); }
.vds-help__link--secondary { font-size: var(--font-small); font-weight: var(--weight-medium); }
.vds-help__link:hover,
.vds-help__link:focus-visible {
    text-decoration: underline;
    color: var(--primary);
}
.vds-error { font-size: var(--font-small); color: var(--danger); margin: var(--space-1) 0 0; }

.vds-checkbox-label, .vds-radio-label {
    display: inline-flex; align-items: flex-start; gap: var(--space-2);
    cursor: pointer; font-size: var(--font-body);
}

.vds-checkbox, .vds-radio {
    width: 1.05rem; height: 1.05rem; margin-top: 0.15rem;
    accent-color: var(--primary);
}

/* ---- Alerts ---- */
.vds-alert {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: 1rem 1.2rem; border-radius: var(--radius-xl);
    border: 1px solid transparent; font-size: var(--font-body);
    box-shadow: var(--shadow-sm); animation: vds-alert-in 0.25s ease;
    margin-bottom: var(--space-5);
}

@keyframes vds-alert-in {
    from { opacity: 0; transform: translateY(-0.35rem); }
    to { opacity: 1; transform: translateY(0); }
}

.vds-alert__body { flex: 1; min-width: 0; }
.vds-alert__list { margin: var(--space-2) 0 0; padding-left: 1.1rem; }
.vds-alert__close {
    flex-shrink: 0; width: 1.75rem; height: 1.75rem; padding: 0;
    border: none; border-radius: var(--radius-sm); background: transparent;
    color: inherit; opacity: 0.7; cursor: pointer;
}

.vds-alert__close:hover { opacity: 1; background: color-mix(in srgb, currentColor 6%, transparent); }
/* Soft alert fills use on-soft text tokens so body copy stays readable (WCAG). */
.vds-alert--success { background: var(--success-soft); border-color: var(--success-border); color: var(--success-on-soft); }
.vds-alert--info { background: var(--info-soft); border-color: var(--info-border); color: var(--info-on-soft); }
.vds-alert--warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-on-soft); }
.vds-alert--danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-on-soft); }

/* ---- Badges ---- */
/* Solid fills + inverse/dark text. Never mid-tone status hue on *-soft (washes out labels). */
.vds-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: var(--badge-min-height);
    padding: var(--badge-pad-y) var(--badge-pad-x);
    border-radius: var(--radius-full);
    font-size: var(--badge-font-size);
    font-weight: var(--weight-semibold);
    line-height: var(--badge-line-height);
    white-space: nowrap;
    vertical-align: middle;
}

.vds-badge--neutral { background: var(--text-secondary); color: var(--text-inverse); }
.vds-badge--primary, .vds-badge--admin { background: var(--primary); color: var(--text-inverse); }
.vds-badge--success, .vds-badge--active, .vds-badge--completed { background: var(--success); color: var(--text-inverse); }
.vds-badge--warning, .vds-badge--pending { background: var(--warning); color: var(--text-primary); }
.vds-badge--danger, .vds-badge--inactive { background: var(--danger); color: var(--text-inverse); }
.vds-badge--info { background: var(--info); color: var(--text-inverse); }
.vds-badge--therapist { background: var(--info); color: var(--text-inverse); }
.vds-badge--patient { background: var(--primary); color: var(--text-inverse); }
.vds-badge--carer { background: var(--success); color: var(--text-inverse); }

/* Clinical Quality readiness matrix */
.cq-matrix {
    --cq-cell-pad-y: 0.7rem;
    --cq-cell-pad-x: 0.75rem;
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--font-small);
}

.cq-matrix thead th {
    padding: 0.65rem var(--cq-cell-pad-x);
    border-bottom: 1px solid var(--border);
    font-size: var(--font-caption);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    vertical-align: middle;
    background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
}

.cq-matrix tbody td {
    padding: var(--cq-cell-pad-y) var(--cq-cell-pad-x);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.cq-matrix tbody tr:last-child td {
    border-bottom: none;
}

.cq-matrix tbody tr:hover td {
    background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
}

.cq-matrix__stage {
    min-width: 7.5rem;
}

.cq-matrix__stage-link {
    display: block;
    font-weight: var(--weight-semibold);
    line-height: 1.3;
    text-decoration: none;
}

.cq-matrix__stage-meta {
    margin-top: 0.15rem;
    font-size: var(--font-caption);
    line-height: 1.3;
    color: var(--text-muted);
}

.cq-matrix__gate,
.cq-matrix__readiness,
.cq-matrix__actions {
    white-space: nowrap;
}

.cq-matrix__gate .vds-badge,
.cq-matrix__readiness .vds-badge {
    display: inline-flex;
    min-width: 4.25rem;
}

.cq-matrix__gate-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.cq-matrix__freshness .vds-badge {
    min-width: 0;
    font-size: 0.7rem;
}

.cq-matrix__actions .vds-btn {
    white-space: nowrap;
}

.cq-refresh-form {
    margin: 0;
}

.cq-matrix__text {
    font-size: var(--font-caption);
    line-height: 1.35;
    color: var(--text-secondary);
    white-space: nowrap;
}

.cq-matrix__text--wrap {
    white-space: normal;
    max-width: 11rem;
}

.cq-matrix__empty {
    color: var(--text-muted);
}

/* ---- Icons ---- */
.vds-icon { display: inline-block; line-height: 1; vertical-align: -0.125em; }
.vds-icon--sm { font-size: 0.95rem; }
.vds-icon--md { font-size: 1.1rem; }
.vds-icon--lg { font-size: 1.5rem; }

/* ---- Tables ---- */
.vds-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.vds-table { width: 100%; border-collapse: collapse; font-size: var(--font-small); }
.vds-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.85rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: var(--font-caption);
    text-align: left;
    white-space: nowrap;
    color: var(--text-muted);
}

.vds-table tbody td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}
.vds-table--striped tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-muted) 80%, transparent); }
.vds-table tbody tr:hover { background: color-mix(in srgb, var(--surface-muted) 70%, transparent); }
.vds-table--compact tbody td, .vds-table--compact thead th { padding: 0.45rem 0.65rem; }
.vds-table__empty { text-align: center; color: var(--text-muted); padding: var(--space-6) !important; }

/* Super Admin commercial pricing panel */
.fb-billing-pricing-form .fb-billing-pricing__note {
    margin: 0 0 var(--space-3);
    max-width: 46rem;
}
.fb-billing-pricing {
    margin-top: var(--space-2);
}
.fb-billing-pricing .vds-table {
    min-width: 46rem;
}
.fb-billing-pricing .vds-table tbody th {
    font-weight: inherit;
    text-align: left;
    vertical-align: top;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    min-width: 11rem;
}
.fb-billing-pricing .vds-table tbody td {
    vertical-align: top;
    padding: 0.75rem 0.85rem;
}
.fb-billing-pricing__name {
    display: block;
    font-weight: var(--weight-semibold);
    color: var(--text);
    line-height: 1.3;
}
.fb-billing-pricing__slug {
    display: block;
    margin-top: 0.2rem;
    font-size: var(--font-caption);
    color: var(--text-muted);
    font-weight: var(--weight-regular, 400);
    letter-spacing: 0.01em;
}
.fb-billing-pricing .vds-table tbody tr.fb-billing-pricing__row--private {
    background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface));
    box-shadow: inset 3px 0 0 var(--primary);
}
.fb-billing-pricing .vds-table tbody tr.fb-billing-pricing__row--private:hover {
    background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface));
}
.fb-billing-pricing__amounts {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 11.5rem;
}
.fb-billing-pricing__amount,
.fb-billing-pricing__static {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-weight: var(--weight-regular, 400);
}
.fb-billing-pricing__currency {
    flex: 0 0 auto;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}
.fb-billing-pricing__amount .form-control {
    width: 4.75rem;
    max-width: 5.5rem;
    min-height: 2.125rem;
    padding: 0.25rem 0.4rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.fb-billing-pricing__period {
    font-size: var(--font-caption);
    color: var(--text-muted);
    white-space: nowrap;
}
.fb-billing-pricing__static-value {
    font-weight: var(--weight-semibold);
    color: var(--text);
}
.fb-billing-pricing__limits {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: var(--font-small);
    line-height: 1.35;
    white-space: nowrap;
}
.fb-billing-pricing__status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}
.fb-billing-pricing__actions {
    display: flex;
    justify-content: flex-start;
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

/* ---- Retired patient archive list (canonical) ---- */
.fb-retired-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}
.fb-retired-list__header,
.fb-retired-list__row {
    display: grid;
    grid-template-columns:
        minmax(7rem, 1.15fr)
        minmax(8rem, 1.25fr)
        minmax(7rem, 1.1fr)
        4.5rem
        minmax(6.5rem, 0.95fr)
        auto;
    gap: var(--space-3) 1rem;
    align-items: center;
    padding: 0.7rem 1rem;
}
.fb-retired-list__header {
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-size: var(--font-small);
    font-weight: var(--weight-bold);
    color: var(--text-muted);
}
.fb-retired-list__row {
    border-bottom: 1px solid var(--border);
}
.fb-retired-list__row:last-child {
    border-bottom: 0;
}
.fb-retired-list__row:hover {
    background: var(--primary-soft);
}
.fb-retired-list__label {
    display: none;
}
.fb-retired-list__value {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-small);
    color: var(--text);
}
.fb-retired-list__value--name {
    font-weight: var(--weight-bold);
    font-size: 0.95rem;
}
.fb-retired-list__identity {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}
.fb-retired-list__identity .vds-avatar {
    flex-shrink: 0;
}
.fb-retired-list__actions.vds-action-cluster {
    justify-content: flex-end;
    flex-wrap: wrap;
}
.fb-retired-list__actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}
.fb-retired-list__form {
    display: inline-flex;
    margin: 0;
}
.fb-retired-list__btn {
    white-space: nowrap;
    flex-shrink: 0;
}
.fb-retired-list__col--actions {
    justify-self: end;
}

@media (max-width: 1100px) {
    .fb-retired-list__header {
        display: none;
    }
    .fb-retired-list__row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "name actions"
            "email actions"
            "programme actions"
            "progress actions"
            "discharged actions";
        align-items: start;
        gap: 0.35rem 1rem;
        padding: 0.85rem 1rem;
    }
    .fb-retired-list__col--name { grid-area: name; }
    .fb-retired-list__col--email { grid-area: email; }
    .fb-retired-list__col--programme { grid-area: programme; }
    .fb-retired-list__col--progress { grid-area: progress; }
    .fb-retired-list__col--discharged { grid-area: discharged; }
    .fb-retired-list__col--actions {
        grid-area: actions;
        align-self: center;
    }
    .fb-retired-list__label {
        display: inline;
        font-size: 0.7rem;
        font-weight: var(--weight-bold);
        text-transform: uppercase;
        letter-spacing: 0.02em;
        color: var(--text-muted);
        margin-right: 0.35rem;
    }
    .fb-retired-list__value {
        display: inline;
        white-space: normal;
    }
    .fb-retired-list__actions {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
    }
    .fb-retired-list__form,
    .fb-retired-list__btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .fb-retired-list__row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "email"
            "programme"
            "progress"
            "discharged"
            "actions";
        gap: 0.45rem;
    }
    .fb-retired-list__col--actions {
        justify-self: stretch;
        padding-top: 0.35rem;
        border-top: 1px solid var(--border);
        margin-top: 0.15rem;
    }
    .fb-retired-list__actions {
        flex-direction: column;
        width: 100%;
    }
}

/* ---- Centre Admin People list (compact expandable rows) ---- */
.fb-people-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}
.fb-people-list__item {
    border-bottom: 1px solid var(--border);
}
.fb-people-list__item:last-child {
    border-bottom: 0;
}
/* Phase 214C — expanded row stays neutral (no purple fill on whole item). */
.fb-people-list__item.is-expanded {
    background: var(--surface);
}
.fb-people-list__summary {
    display: block;
    padding: 0;
    min-height: 0;
}
.fb-people-list__summary-main {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
}
.fb-people-list__sites {
    font-size: var(--font-small);
    font-weight: var(--weight-regular, 400);
    color: var(--text-muted);
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.fb-people-list__therapists {
    font-size: var(--font-small);
    font-weight: var(--weight-regular, 400);
    color: var(--text-muted);
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.fb-people-list__therapists::before {
    content: "·";
    margin-right: 0.5rem;
    color: var(--border-strong, var(--border));
}
.fb-people-filters__more {
    margin-top: 0.25rem;
}
.fb-people-filters__more-summary {
    cursor: pointer;
    font-weight: var(--weight-semibold, 600);
    color: var(--text);
    list-style: none;
}
.fb-people-filters__more-summary::-webkit-details-marker {
    display: none;
}
.fb-people-filters__secondary {
    margin-top: 0.75rem;
}
@media (min-width: 768px) {
    .fb-people-filters__more {
        display: contents;
    }
    .fb-people-filters__more-summary {
        display: none;
    }
    .fb-people-filters__secondary {
        display: contents;
        margin-top: 0;
    }
}
.fb-caseload-other-sites {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}
.fb-people-list__summary-end {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}
.fb-people-list__name {
    font-weight: var(--weight-bold);
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--text);
    overflow-wrap: anywhere;
}
.fb-people-list__summary-status {
    font-size: var(--font-small);
    color: var(--text-muted);
    white-space: nowrap;
}
/* Phase 182 — full-row expand/collapse activation (chevron = indicator only). */
.fb-people-list__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    width: 100%;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.fb-people-list__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
}
.fb-people-list__toggle:hover {
    background: color-mix(in srgb, var(--text) 3.5%, var(--surface));
}
.fb-people-list__toggle:hover .fb-people-list__chevron {
    border-color: var(--primary);
    color: var(--primary);
}
.fb-people-list__item.is-expanded > .fb-people-list__summary .fb-people-list__toggle {
    background: var(--surface-muted, color-mix(in srgb, var(--text) 2.5%, var(--surface)));
}
.fb-people-list__toggle:focus {
    outline: none;
}
.fb-people-list__toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}
.fb-people-list__toggle:focus-visible .fb-people-list__chevron {
    border-color: var(--primary);
    color: var(--primary);
}
/* Phase 214C — detail is flush inside the row (no inset nested card). */
.fb-people-list__panel.vds-expand-panel {
    margin: 0;
    padding: 0;
}
.fb-people-list__email {
    word-break: break-word;
    overflow-wrap: anywhere;
}
.fb-people-list__relationship-value--unassigned {
    font-weight: var(--weight-bold);
}
.fb-people-list__status-form {
    display: inline-flex;
    vertical-align: middle;
}
.fb-people-list__assign {
    max-width: 100%;
}
.fb-people-list__assign-status {
    margin: var(--space-2) 0 0;
    font-size: var(--font-sm, 0.875rem);
    line-height: 1.35;
}
.fb-people-list__assign-status.is-success {
    color: var(--success, #0f7a45);
}
.fb-people-list__assign-status.is-error {
    color: var(--danger, #b42318);
}
.fb-people-list__assign-empty {
    margin-top: var(--space-1);
}
.fb-people-list__assigned-block {
    margin-bottom: var(--space-2);
}
.fb-people-list__assigned-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fb-people-list__assigned-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle, var(--border));
}
.fb-people-list__assigned-row:last-child {
    border-bottom: none;
}
.fb-people-list__assigned-name {
    font-weight: var(--weight-medium, 500);
    min-width: 0;
    overflow-wrap: anywhere;
}
.fb-people-list__remove-form {
    flex: 0 0 auto;
    margin: 0;
}
.fb-people-list__remove-btn.vds-btn {
    /* Compact secondary — not equivalent to Delete patient (danger). */
    min-width: 5.5rem;
}
.fb-people-list__assign-divider {
    height: 1px;
    margin: var(--space-3) 0;
    background: var(--border-subtle, var(--border));
}

@media (max-width: 576px) {
    .fb-people-list__toggle {
        flex-wrap: wrap;
        align-items: flex-start;
        min-height: 3rem;
    }
    .fb-people-list__summary-end {
        margin-left: auto;
    }
}

/* ---- Expanded UI Standard (Phase 182 + 214C visual layer) ----
   Use for expandable rows, disclosure panels, and revealed action collections.
   Do not dump buttons/selects into one undifferentiated strip.
   One primary container: prefer --in-row when the detail opens inside a list row. */
.vds-expand-panel {
    border: 1px solid var(--border-subtle, var(--border));
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(49, 46, 129, 0.04);
    overflow: hidden;
}
/* Phase 214C — in-row detail: same component as the row; no nested rounded card. */
.vds-expand-panel--in-row {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--border-subtle, var(--border));
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    overflow: visible;
}
.vds-expand-panel--in-row .vds-expand-panel__section--danger {
    background: color-mix(in srgb, #b42318 3%, var(--surface));
}
.vds-expand-panel__sections {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.vds-expand-panel__section {
    padding: var(--space-4, 0.85rem) var(--space-4, 0.9rem);
    border-bottom: 1px solid var(--border-subtle, var(--border));
}
.vds-expand-panel__section:last-child {
    border-bottom: 0;
}
.vds-expand-panel__section--danger {
    background: color-mix(in srgb, #b42318 4%, var(--surface));
}
.vds-expand-panel__section-title {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.3;
}
.vds-expand-panel__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 1.25rem;
    margin: 0;
}
.vds-expand-panel__field {
    min-width: 0;
}
.vds-expand-panel__field dt {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}
.vds-expand-panel__field dd {
    margin: 0;
    font-size: var(--font-small);
    color: var(--text);
    overflow-wrap: anywhere;
}
.vds-expand-panel__control {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 28rem;
}
.vds-expand-panel__control-label {
    margin: 0;
    font-size: var(--font-small);
    font-weight: var(--weight-semibold);
    color: var(--text);
}
.vds-expand-panel__control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.vds-expand-panel__checks {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0 0 0.75rem;
}
.vds-expand-panel__check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    font-size: var(--font-small);
    color: var(--text);
    cursor: pointer;
}
.vds-expand-panel__check input {
    margin-top: 0.2rem;
    flex: 0 0 auto;
}
.vds-expand-panel__sites-form {
    margin: 0;
}
.vds-expand-panel__select {
    flex: 1 1 12rem;
    min-width: 10rem;
    max-width: 100%;
    min-height: 2.25rem;
}
.vds-expand-panel__assign-form,
.vds-expand-panel__inline-form {
    margin: 0;
}
.vds-expand-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.vds-expand-panel__actions--primary {
    justify-content: flex-start;
}
.vds-expand-panel__actions--destructive {
    justify-content: flex-start;
}
.vds-expand-panel__actions--destructive .vds-btn--danger {
    margin-left: 0;
}

@media (min-width: 992px) {
    .vds-expand-panel__fields {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .vds-expand-panel__fields {
        grid-template-columns: 1fr;
    }
    .vds-expand-panel__control-row {
        flex-direction: column;
        align-items: stretch;
    }
    .vds-expand-panel__select {
        width: 100%;
        min-width: 0;
    }
    .vds-expand-panel__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .vds-expand-panel__actions .vds-btn,
    .vds-expand-panel__actions .btn,
    .vds-expand-panel__control-row .vds-btn,
    .vds-expand-panel__control-row .btn {
        width: 100%;
        justify-content: center;
    }
}

.vds-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    flex-wrap: nowrap;
    white-space: nowrap;
}
.vds-row-actions__form {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}
.vds-row-actions__select {
    min-width: 8.25rem;
    height: 2rem;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    font-size: 0.8rem;
}
.vds-table-wrap--methodical .vds-table {
    table-layout: auto;
}
.vds-table-wrap--methodical .vds-table td,
.vds-table-wrap--methodical .vds-table th {
    white-space: nowrap;
}
.vds-table-wrap--methodical .vds-table td:last-child,
.vds-table-wrap--methodical .vds-table th:last-child {
    text-align: right;
}
@media (max-width: 1199.98px) {
    .vds-row-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        white-space: normal;
    }
}

/* ---- Modals ---- */
.vds-modal__content {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-panel, 0.5rem);
    box-shadow: var(--shadow-modal);
}
.vds-modal__header { padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.vds-modal__title { font-size: var(--font-section-title); font-weight: var(--weight-bold); margin: 0; letter-spacing: -0.02em; }
.vds-modal__body { padding: var(--space-6); }
.vds-modal__footer {
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: flex-end;
}
.vds-modal__close { border: none; background: transparent; padding: var(--space-1); border-radius: var(--radius-sm); cursor: pointer; }
.vds-modal__close:hover { background: var(--surface-muted); }

/* Therapist Site-switch confirm: above the entire application shell (header, sidebar, sticky topbar). */
.modal.fb-site-switch-leave-dialog {
    z-index: 10800;
}
.modal-backdrop.fb-site-switch-leave-backdrop {
    z-index: 10790;
}

/* ---- Search ---- */
.vds-search-box { position: relative; }
.vds-search-box__icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.vds-search-box__input {
    width: 100%; min-height: 2.375rem; padding: 0.45rem 0.75rem 0.45rem 2.25rem;
    border: 1px solid var(--border-strong); border-radius: var(--radius-full);
    font-size: var(--font-body); background: var(--surface);
}

.vds-search-box__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }

/* ---- Dashboard components ---- */
.vds-stats-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    box-shadow: var(--shadow-sm);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    height: 100%;
}

.vds-stats-card:hover {
    box-shadow: var(--shadow-sm);
}

.vds-stats-card__value {
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: var(--weight-bold);
    color: var(--text-strong);
    margin: 0 0 var(--space-1);
    line-height: var(--line-height-tight);
}

.vds-stats-card__label {
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    margin: 0;
}

.vds-stats-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary);
    margin-bottom: var(--space-3);
    font-size: 1.35rem;
}

.vds-stats-card--blue {
    background: linear-gradient(145deg, rgba(11, 61, 145, 0.1) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(11, 61, 145, 0.14);
}

.vds-stats-card--green {
    background: linear-gradient(145deg, rgba(6, 118, 71, 0.1) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(6, 118, 71, 0.14);
}

.vds-stats-card--green .vds-stats-card__icon,
.vds-stats-card--green .vds-stats-card__value { color: var(--success); }

.vds-stats-card--purple {
    background: linear-gradient(145deg, rgba(91, 33, 182, 0.1) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(91, 33, 182, 0.14);
}

.vds-stats-card--purple .vds-stats-card__icon,
.vds-stats-card--purple .vds-stats-card__value { color: #5b21b6; }

.vds-stats-card--orange {
    background: linear-gradient(145deg, rgba(181, 71, 8, 0.1) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(181, 71, 8, 0.14);
}

.vds-stats-card--orange .vds-stats-card__icon,
.vds-stats-card--orange .vds-stats-card__value { color: var(--warning); }

.vds-stats-card--teal {
    background: linear-gradient(145deg, rgba(2, 106, 162, 0.1) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(2, 106, 162, 0.14);
}

.vds-stats-card--teal .vds-stats-card__icon,
.vds-stats-card--teal .vds-stats-card__value { color: var(--info); }

.vds-stats-card--indigo {
    background: linear-gradient(145deg, rgba(67, 56, 202, 0.1) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(67, 56, 202, 0.14);
}

.vds-stats-card--indigo .vds-stats-card__icon,
.vds-stats-card--indigo .vds-stats-card__value { color: var(--primary-hover); }

.vds-stats-card--rose {
    background: linear-gradient(145deg, rgba(190, 18, 60, 0.1) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(190, 18, 60, 0.14);
}

.vds-stats-card--rose .vds-stats-card__icon,
.vds-stats-card--rose .vds-stats-card__value { color: #be123c; }

.vds-activity-card {
    display: flex; flex-direction: column; gap: var(--space-4);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    padding: var(--space-4) var(--space-5);
}

@media (min-width: 992px) {
    .vds-activity-card { flex-direction: row; align-items: center; justify-content: space-between; }
}

.vds-activity-card__title { font-size: var(--font-card-title); font-weight: var(--weight-bold); color: var(--primary); margin: 0 0 var(--space-2); }
.vds-activity-card__text { font-size: var(--font-body); font-weight: var(--weight-semibold); margin: 0 0 var(--space-1); line-height: var(--line-height-relaxed); }
.vds-activity-card__meta { font-size: var(--font-small); color: var(--text-muted); margin: 0; font-weight: var(--weight-semibold); }
.vds-activity-card__actions { display: grid; gap: var(--space-2); min-width: 12rem; }

.vds-quick-action {
    display: block; height: 100%; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm); padding: var(--space-4) var(--space-5);
    text-decoration: none; color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}

.vds-quick-action--large {
    min-height: 7.5rem;
    padding: var(--space-5) var(--space-6);
}

.vds-quick-action--large .vds-quick-action__icon {
    font-size: 1.75rem;
    margin-bottom: var(--space-3);
}

.vds-quick-action--large .vds-quick-action__title {
    font-size: 1.125rem;
}

.vds-quick-action--large .vds-quick-action__description {
    font-size: var(--font-body);
    line-height: var(--line-height-relaxed);
}

.vds-quick-action--link:hover,
.vds-quick-action:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.vds-quick-action__icon { color: var(--primary); margin-bottom: var(--space-2); font-size: 1.375rem; }
.vds-quick-action__title { font-size: var(--font-card-title); font-weight: var(--weight-bold); margin: 0 0 var(--space-2); }
.vds-quick-action__description { font-size: var(--font-small); color: var(--text-muted); margin: 0; }

.vds-empty-state {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    padding: var(--space-8) var(--space-6);
    color: var(--text-primary);
    cursor: default;
    box-shadow: var(--shadow-sm);
    /* Informational only — do not inherit card/link/button hover treatments */
    transition: none;
}

.vds-empty-state:hover,
.vds-empty-state:focus,
.vds-empty-state:focus-visible {
    background: var(--surface);
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--border-subtle) 90%, transparent);
    box-shadow: var(--shadow-sm);
    transform: none;
    outline: none;
    cursor: default;
}

/* Portal page rhythm — cohesive spacing across admin + clinical workspaces */
.vds-page--portal .row.g-3,
.vds-page--app .row.g-3 {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.25rem;
}

.vds-page--portal .row.g-4,
.vds-page--app .row.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.vds-page--portal .mb-3 { margin-bottom: 1.25rem !important; }
.vds-page--portal .mb-4 { margin-bottom: 2rem !important; }
.vds-page--portal .mb-5 { margin-bottom: 2.75rem !important; }

.vds-empty-state__icon { color: var(--text-muted); margin-bottom: var(--space-3); }
.vds-empty-state__title {
    font-size: var(--font-section-title);
    font-weight: var(--weight-bold);
    margin: 0 0 var(--space-2);
    color: var(--text-strong, var(--text-primary));
}
.vds-empty-state__description {
    font-size: var(--font-body);
    color: var(--text-muted);
    margin: 0 0 var(--space-4);
}

.vds-empty-state:hover .vds-empty-state__title,
.vds-empty-state:hover .vds-empty-state__description,
.vds-empty-state:hover .vds-empty-state__icon {
    color: inherit;
}

.vds-empty-state:hover .vds-empty-state__description,
.vds-empty-state:hover .vds-empty-state__icon {
    color: var(--text-muted);
}

.vds-empty-state:hover .vds-empty-state__title {
    color: var(--text-strong, var(--text-primary));
}

/* Nested empty states inside interactive parents must stay readable */
a .vds-empty-state,
button .vds-empty-state,
[role="button"] .vds-empty-state,
a:hover .vds-empty-state,
button:hover .vds-empty-state {
    background: var(--surface);
    color: var(--text-primary);
    cursor: default;
}

/* ---- Spinner, pagination, avatar, breadcrumb, tabs, tooltip, progress ---- */
.vds-spinner { display: inline-flex; align-items: center; gap: var(--space-2); }
.vds-spinner__ring {
    width: 1.25rem; height: 1.25rem; border: 2px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: vds-spin 0.65s linear infinite;
}

.vds-spinner__label { font-size: var(--font-small); color: var(--text-muted); }

.vds-pagination__list { display: flex; flex-wrap: wrap; gap: var(--space-1); list-style: none; padding: 0; margin: 0; }
.vds-pagination__link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2rem; min-height: 2rem; padding: 0 var(--space-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text-primary); font-size: var(--font-small); font-weight: var(--weight-semibold);
}

.vds-pagination__link:hover { background: var(--primary-soft); color: var(--primary); }
.vds-pagination__link.is-active { background: var(--primary); border-color: var(--primary); color: var(--text-inverse); }

.vds-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--discipline-speech-soft, var(--primary-soft));
    color: var(--discipline-speech, var(--primary));
    font-weight: var(--weight-bold);
    overflow: hidden;
    font-size: var(--font-small);
    letter-spacing: 0.02em;
    line-height: 1;
}

.vds-avatar--sm { width: 2rem; height: 2rem; font-size: var(--font-caption); }
.vds-avatar--md { width: 2.5rem; height: 2.5rem; font-size: var(--font-small); }
.vds-avatar--lg { width: 3.25rem; height: 3.25rem; font-size: var(--font-body); }
.fb-mdt-identity .vds-avatar--lg {
    background: linear-gradient(145deg, #1E3A8A 0%, var(--discipline-speech) 100%);
    color: #ffffff;
}
.vds-avatar__image { width: 100%; height: 100%; object-fit: cover; }

.vds-breadcrumb__list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
.vds-breadcrumb__item { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--font-caption); color: var(--text-muted); }
.vds-breadcrumb__item:not(:last-child)::after { content: "/"; opacity: 0.5; margin-left: var(--space-2); }
.vds-breadcrumb__link { color: var(--text-muted); text-decoration: none; font-weight: var(--weight-medium); }
.vds-breadcrumb__link:hover { color: var(--text-strong); text-decoration: underline; }

.vds-tabs__list { display: flex; flex-wrap: wrap; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); }
.vds-tabs__trigger {
    border: none; background: transparent; padding: var(--space-2) var(--space-4);
    font-size: var(--font-small); font-weight: var(--weight-semibold); color: var(--text-muted);
    border-bottom: 2px solid transparent; cursor: pointer;
}

.vds-tabs__trigger.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.vds-tabs__panel { display: none; }
.vds-tabs__panel.is-active { display: block; }

.vds-tooltip { position: relative; display: inline-flex; }
.vds-tooltip__bubble {
    position: absolute; bottom: calc(100% + 0.35rem); left: 50%; transform: translateX(-50%);
    padding: 0.35rem 0.55rem; border-radius: var(--radius-sm);
    background: var(--text-primary); color: var(--text-inverse);
    font-size: var(--font-caption); white-space: nowrap; opacity: 0; pointer-events: none;
    transition: opacity var(--transition);
}

.vds-tooltip:hover .vds-tooltip__bubble, .vds-tooltip:focus-within .vds-tooltip__bubble { opacity: 1; }

.vds-progress {
    position: relative; height: 0.65rem; background: var(--surface-muted);
    border-radius: var(--radius-full); overflow: hidden;
}

.vds-progress__bar { height: 100%; background: var(--primary); border-radius: inherit; transition: width var(--transition); }
.vds-progress--success .vds-progress__bar { background: var(--success); }
.vds-progress--warning .vds-progress__bar { background: var(--warning); }
.vds-progress--danger .vds-progress__bar { background: var(--danger); }

/* ---- Legacy class compatibility ---- */
.page-heading, .vds-page-title { font-size: var(--font-page-title); font-weight: var(--weight-bold); }
.section-heading, .vds-section-title { font-size: var(--font-section-title); font-weight: var(--weight-bold); }

.btn-finchbridge, .btn.btn-primary.btn-finchbridge {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: 2.375rem; padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    font-size: var(--font-button); font-weight: var(--weight-semibold);
    background: var(--primary); border-color: var(--primary); color: var(--text-inverse);
}

.btn-outline-finchbridge {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 2.25rem; padding: 0.45rem 0.9rem; border-radius: var(--radius-sm);
    font-size: var(--font-button); font-weight: var(--weight-semibold);
    color: var(--primary); border: 1px solid var(--primary); background: transparent;
}

.btn-outline-finchbridge:hover, .btn-outline-finchbridge.active { background: var(--primary-soft); color: var(--primary); }

.auth-card, .info-card, .feature-card, .profile-card, .history-card, .board-creator-card {
    border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); background: var(--surface);
}

.profile-card:not(.vds-card), .info-card:not(.vds-card), .history-card:not(.vds-card), .auth-card:not(.vds-card) { padding: var(--space-4) var(--space-5); }
.feature-card { padding: var(--space-4); min-height: auto; transition: transform var(--transition), box-shadow var(--transition); }
.feature-card:hover, .feature-card:focus-within { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.alert-finchbridge, .vds-alert { /* styled above */ }

.form-label, .vds-label { font-size: var(--font-label); font-weight: var(--weight-semibold); }
.form-control, .form-select, .vds-input, .vds-select {
    min-height: 2.375rem; font-size: var(--font-body); border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
}

.history-stack, .vds-stack-md { display: flex; flex-direction: column; gap: var(--space-3); }
.detail-label { font-size: var(--font-small); font-weight: var(--weight-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-value { font-size: var(--font-body); font-weight: var(--weight-semibold); }

.therapist-stat-value, .vds-stats-card__value { font-size: 1.375rem; font-weight: var(--weight-bold); color: var(--primary); }
.therapist-stat-label, .vds-stats-card__label { font-size: var(--font-small); color: var(--text-muted); font-weight: var(--weight-semibold); }

.history-card-title, .vds-activity-card__title { font-size: var(--font-card-title); font-weight: var(--weight-bold); color: var(--primary); }
.history-card-sentence, .vds-activity-card__text { font-size: var(--font-body); font-weight: var(--weight-semibold); }
.history-card-meta, .vds-activity-card__meta { font-size: var(--font-small); color: var(--text-muted); }

.vb-data-table-wrap, .vds-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }

main .fs-4, main .fs-5, .vds-page-subtitle { font-size: var(--font-body); color: var(--text-muted); }
#main-content.py-5, main.py-5, .vds-page { padding-top: 0; padding-bottom: 0; }
/* .vds-page--blank-canvas / .vds-page--app: markers only — horizontal inset is --shell-gutter on .vb-main-content */

@media (max-width: 575.98px) {
    /* Legacy body only — shell pages must NOT double-pad .vds-container */
    .vb-page-body { padding-left: var(--space-3); padding-right: var(--space-3); }
    body:not(.vb-has-shell):not(.vds-has-shell) .vds-container {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
    .history-card-actions, .vds-activity-card__actions { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Board & tile editors ---- */
.vds-board-editor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4) var(--space-5);
}

.vds-board-editor {
    display: grid;
    gap: var(--space-5);
    align-items: start;
}

@media (min-width: 992px) {
    .vds-board-editor {
        grid-template-columns: minmax(0, 1.15fr) minmax(14rem, 0.85fr);
    }
}

.vds-board-editor__controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

.vds-board-editor__preview {
    position: sticky;
    top: calc(var(--topbar-height) + var(--space-3));
}

.vds-board-editor__fields {
    display: grid;
    gap: var(--space-3);
}

@media (min-width: 768px) {
    .vds-board-editor__fields {
        grid-template-columns: 1fr 1fr;
    }
}

.vds-editor-section {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
}

.vds-editor-section__title {
    font-size: var(--font-card-title);
    font-weight: var(--weight-bold);
    color: var(--primary);
    margin: 0 0 var(--space-3);
}

.vds-editor-section__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.vds-form-field__label,
.vds-icon-picker__legend,
.vds-colour-picker__legend {
    display: block;
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.vds-form-field__required { color: var(--danger); margin-left: 0.1rem; }
.vds-form-field__help { font-size: var(--font-small); color: var(--text-muted); margin: var(--space-1) 0 0; }
.vds-form-field__error { font-size: var(--font-small); color: var(--danger); margin: var(--space-1) 0 0; }

.vds-icon-picker,
.vds-colour-picker {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.vds-icon-picker__search {
    width: 100%;
    min-height: 2.25rem;
    margin-bottom: var(--space-3);
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    font-size: var(--font-small);
}

.vds-icon-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
    gap: var(--space-2);
}

.vds-colour-picker__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

.vds-icon-picker__option,
.vds-colour-picker__option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-height: 4rem;
    padding: var(--space-2) var(--space-1);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--primary);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.vds-icon-picker__option:hover,
.vds-colour-picker__option:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: var(--shadow-sm);
}

.vds-icon-picker__option:focus-visible,
.vds-colour-picker__option:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.vds-icon-picker__option.is-selected,
.vds-colour-picker__option.is-selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}

.vds-icon-picker__visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
    font-size: 1.25rem;
}

.vds-icon-picker__label,
.vds-colour-picker__label {
    font-size: var(--font-caption);
    line-height: 1.2;
    text-align: center;
    color: var(--text-muted);
}

.vds-colour-picker__swatch {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    border: 2px solid color-mix(in srgb, var(--surface) 90%, var(--border));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent);
}

.vds-icon-picker__check,
.vds-colour-picker__check {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--text-inverse);
    font-size: 0.65rem;
}

.vds-icon-picker__option.is-selected .vds-icon-picker__check,
.vds-colour-picker__option.is-selected .vds-colour-picker__check {
    display: inline-flex;
}

.vds-live-preview__heading {
    font-size: var(--font-small);
    font-weight: var(--weight-bold);
    color: var(--primary);
    margin: 0 0 var(--space-3);
}

.vds-live-preview__board {
    max-width: 12rem;
    margin-inline: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.vds-live-preview__board-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4rem;
    transition: background-color var(--transition);
}

.vds-live-preview__board-icon { font-size: 1.75rem; line-height: 1; }
.vds-live-preview__board-body { padding: var(--space-3); text-align: center; }
.vds-live-preview__board-name { font-size: var(--font-body); font-weight: var(--weight-bold); margin: 0 0 var(--space-1); }
.vds-live-preview__board-colour { font-size: var(--font-caption); color: var(--text-muted); }

.vds-live-preview__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 7rem;
    width: 100%;
    max-width: 14rem;
    margin-inline: auto;
    padding: var(--space-4);
    text-align: center;
    transition: background-color var(--transition), color var(--transition);
}

.vds-live-preview__tile-icon { font-size: 1.75rem; }
.vds-live-preview__tile-label { font-size: var(--font-body); font-weight: var(--weight-bold); line-height: 1.3; }
.vds-live-preview__tile-image { max-width: 3rem; max-height: 3rem; object-fit: cover; border-radius: var(--radius-sm); }

.vds-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.vds-action-bar--secondary {
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.personal-board-manage-item.vds-board-editor-card {
    margin-bottom: var(--space-4);
}

@media (max-width: 991.98px) {
    .vds-board-editor__preview {
        position: static;
    }
}

/* ---- Editor page layout (Create Board, future editors) ---- */
.vds-editor-page-shell {
    max-width: var(--content-max);
    margin-top: var(--space-6);
    padding-bottom: 5.5rem;
}

.vds-editor-page-form {
    display: block;
}

.vds-editor-page-header {
    margin-bottom: var(--space-6);
}

.vds-editor-page-header__breadcrumb {
    margin-bottom: var(--space-3);
}

.vds-editor-page-header__breadcrumb .vds-breadcrumb__item {
    font-size: 0.875rem;
}

.vds-editor-page-header__title {
    font-size: 2rem;
    font-weight: var(--weight-bold);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--space-2);
    letter-spacing: -0.02em;
}

.vds-editor-page-header__description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 42rem;
}

.vds-editor-page {
    display: grid;
    gap: var(--space-6);
    align-items: start;
}

@media (min-width: 992px) {
    .vds-editor-page {
        grid-template-columns: minmax(0, 65%) minmax(0, 35%);
    }
}

.vds-editor-page__main,
.vds-editor-page__sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    min-width: 0;
}

.vds-editor-page__sidebar {
    position: sticky;
    top: calc(var(--topbar-height) + var(--space-4));
}

.vds-editor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}

.vds-editor-card__header {
    margin-bottom: var(--space-4);
}

.vds-editor-card__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.125rem;
    font-weight: var(--weight-bold);
    margin: 0;
    color: var(--text-primary);
}

.vds-editor-card__title-icon {
    color: var(--primary);
}

.vds-editor-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.vds-editor-form-grid {
    display: grid;
    gap: var(--space-4);
}

@media (min-width: 768px) {
    .vds-editor-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.vds-editor-appearance__group-title {
    font-size: 0.875rem;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 var(--space-3);
}

/* Editor icon picker — 5/4/2 columns, 56px icons */
.vds-icon-picker--editor .vds-icon-picker__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .vds-icon-picker--editor .vds-icon-picker__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .vds-icon-picker--editor .vds-icon-picker__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.vds-icon-picker--editor .vds-icon-picker__option {
    min-height: 5.5rem;
    padding: var(--space-2);
    transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.vds-icon-picker--editor .vds-icon-picker__option:hover:not(.is-selected) {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    box-shadow: var(--shadow-sm);
}

.vds-icon-picker--editor .vds-icon-picker__visual {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.75rem;
    border-radius: var(--radius-sm);
}

.vds-icon-picker--editor .vds-icon-picker__option.is-selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.vds-icon-picker--editor .vds-icon-picker__check {
    background: var(--primary);
    width: 1.15rem;
    height: 1.15rem;
}

/* Editor colour picker — round 40px swatches */
.vds-colour-picker--editor .vds-colour-picker__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

.vds-colour-picker--editor .vds-colour-picker__option {
    min-height: auto;
    padding: var(--space-2) var(--space-1);
    border: none;
    background: transparent;
    box-shadow: none;
}

.vds-colour-picker--editor .vds-colour-picker__option:hover {
    transform: none;
    background: transparent;
}

.vds-colour-picker--editor .vds-colour-picker__swatch-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.vds-colour-picker--editor .vds-colour-picker__swatch {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    border: 2px solid color-mix(in srgb, var(--surface) 85%, var(--border));
    transition: transform 150ms ease;
}

.vds-colour-picker--editor .vds-colour-picker__ring {
    position: absolute;
    inset: -4px;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    transition: border-color 150ms ease, transform 150ms ease;
}

.vds-colour-picker--editor .vds-colour-picker__option.is-selected .vds-colour-picker__ring {
    border-color: var(--primary);
}

.vds-colour-picker--editor .vds-colour-picker__option.is-selected .vds-colour-picker__swatch {
    transform: scale(0.92);
}

.vds-colour-picker--editor .vds-colour-picker__check {
    top: -0.1rem;
    right: -0.1rem;
    width: 1rem;
    height: 1rem;
    background: var(--primary);
}

.vds-colour-picker--editor .vds-colour-picker__label {
    font-size: var(--font-label);
    margin-top: var(--space-1);
}

/* Editor live preview card */
.vds-live-preview--editor .vds-live-preview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}

.vds-live-preview-card__title {
    font-size: 1.125rem;
    font-weight: var(--weight-bold);
    margin: 0 0 var(--space-4);
}

.vds-live-preview-card__canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 14rem;
    padding: var(--space-4);
}

.vds-live-preview__board--editor {
    width: 100%;
    max-width: 16rem;
    margin-inline: auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.vds-live-preview__board--editor .vds-live-preview__board-banner {
    min-height: 6.5rem;
}

.vds-live-preview__board--editor .vds-live-preview__board-icon {
    font-size: 2.5rem;
}

.vds-live-preview__board--editor .vds-live-preview__board-body {
    padding: var(--space-4);
    text-align: center;
}

.vds-live-preview__board--editor .vds-live-preview__board-name {
    font-size: 1.0625rem;
    margin-bottom: var(--space-2);
}

.vds-live-preview__board-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: var(--line-height-relaxed);
}

/* Preview details card */
.vds-preview-details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}

.vds-preview-details__title {
    font-size: 1.125rem;
    font-weight: var(--weight-bold);
    margin: 0 0 var(--space-4);
}

.vds-preview-details__list {
    margin: 0;
}

.vds-preview-details__row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}

.vds-preview-details__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.vds-preview-details__row:first-child {
    padding-top: 0;
}

.vds-preview-details__label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    margin: 0;
}

.vds-preview-details__label-icon {
    color: var(--primary);
}

.vds-preview-details__value {
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin: 0;
    text-align: right;
    word-break: break-word;
}

/* Sticky editor footer */
.vds-editor-sticky-footer {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 1020;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.vds-editor-sticky-footer__inner {
    max-width: var(--content-max);
    margin-inline: auto;
    padding: var(--space-4) var(--space-6);
}

.vds-editor-sticky-footer__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-3);
}

.vds-editor-sticky-footer__actions .vds-btn--outline {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.vds-editor-sticky-footer__actions .vds-btn--outline:hover {
    background: var(--surface-muted, var(--primary-soft));
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--border) 70%, var(--text-muted));
}

.vds-editor-sticky-footer--static {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    margin-top: var(--space-4);
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    box-shadow: none;
}

.vds-editor-sticky-footer--static .vds-editor-sticky-footer__inner {
    padding-inline: 0;
    padding-bottom: 0;
}

.vds-editor-page-shell:has(.vds-editor-sticky-footer--static) {
    padding-bottom: 0;
}

@media (max-width: 991.98px) {
    .vds-editor-page__sidebar {
        position: static;
    }

    .vds-editor-sticky-footer {
        left: 0;
    }

    .vds-editor-sticky-footer__actions {
        justify-content: stretch;
    }

    .vds-editor-sticky-footer__actions .vds-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .vds-preview-details__row {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }

    .vds-preview-details__value {
        text-align: left;
    }
}

@media (max-width: 575.98px) {
    .vds-editor-card,
    .vds-live-preview--editor .vds-live-preview-card,
    .vds-preview-details {
        padding: var(--space-4);
    }

    .vds-editor-page-header__title {
        font-size: 1.625rem;
    }

    .vds-editor-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Tile editor (shared with board editor shell) ---- */
.vds-tile-image-upload {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.vds-tile-image-upload__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 12rem;
    min-height: 7rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--surface) 92%, var(--border));
    overflow: hidden;
}

.vds-tile-image-upload__preview.is-empty .vds-tile-image-upload__thumb {
    display: none;
}

.vds-tile-image-upload__thumb {
    width: 100%;
    height: 100%;
    max-height: 7rem;
    object-fit: cover;
}

.vds-tile-image-upload__placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.vds-tile-image-upload__placeholder .bi {
    font-size: 1.5rem;
    color: var(--primary);
}

.vds-tile-image-upload__preview.is-empty .vds-tile-image-upload__placeholder {
    display: flex;
}

.vds-tile-image-upload__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.vds-tile-image-upload__help {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.vds-live-preview__tile--editor {
    width: 100%;
    max-width: 14rem;
    min-height: 10rem;
    margin-inline: auto;
    padding: var(--space-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition), color var(--transition);
}

.vds-live-preview__tile--editor .vds-live-preview__tile-icon {
    font-size: 2.25rem;
}

.vds-live-preview__tile--editor .vds-live-preview__tile-image {
    max-width: 4rem;
    max-height: 4rem;
}

.vds-live-preview__tile--editor .vds-live-preview__tile-label {
    font-size: 1.0625rem;
    font-weight: var(--weight-bold);
}

.vds-live-preview__tile-speech {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--font-small);
    font-weight: var(--weight-semibold);
    line-height: 1.35;
    opacity: 0.92;
}

.personal-board-manage-item {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
}

.personal-board-manage-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.vds-editor-list-item__title {
    font-size: 1.25rem;
    font-weight: var(--weight-bold);
    margin: 0;
}

.vds-editor-card--danger {
    border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 8%, transparent);
}

.vds-editor-card--danger .vds-editor-card__title-icon {
    color: var(--danger);
}

.vds-danger-zone__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.vds-editor-page__sidebar .vds-preview-details + .vds-preview-details {
    margin-top: 0;
}

/* ---- Sidebar profile mini card ---- */
.vb-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--sidebar-ink-border);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    text-decoration: none;
    color: inherit;
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.vb-sidebar-profile:hover {
    background: var(--sidebar-ink-hover);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: none;
    color: inherit;
}

.vb-sidebar-profile.is-active {
    border-color: var(--discipline-speech);
    box-shadow: 0 0 0 1px var(--sidebar-ink-active);
}

.vb-sidebar-profile:focus-visible {
    outline: 2px solid var(--discipline-speech);
    outline-offset: 2px;
}

.vb-sidebar-profile__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.vb-sidebar-profile__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: var(--radius-full);
    background: linear-gradient(145deg, #1E3A8A 0%, #3B82F6 100%);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: var(--weight-bold);
    letter-spacing: 0.02em;
}

.vb-sidebar-profile__status {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: var(--radius-full);
    background: var(--success);
    border: 2px solid var(--sidebar-ink);
}

.vb-sidebar-profile__body {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
    overflow: hidden;
}

.vb-sidebar-profile__name {
    font-size: 0.92rem;
    font-weight: var(--weight-bold);
    line-height: 1.25;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vb-sidebar-profile__role {
    font-size: var(--font-label);
    color: var(--sidebar-ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vb-sidebar-profile__link {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.2rem;
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    color: #93C5FD;
}

.vb-sidebar-profile__link i {
    font-size: 0.7rem;
}

/* ---- Dashboard layout ---- */
.vds-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.vds-dashboard__top {
    display: grid;
    gap: var(--space-4);
}

@media (min-width: 1200px) {
    .vds-dashboard__top {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: start;
    }
}

.vds-dashboard-grid {
    display: grid;
    gap: var(--space-3);
}

.vds-dashboard-grid__item {
    min-width: 0;
    height: 100%;
}

.vds-dashboard-grid--actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vds-dashboard-grid--stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vds-dashboard-grid--communications {
    grid-template-columns: 1fr;
}

.vds-dashboard-grid--boards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 992px) {
    .vds-dashboard-grid--boards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vds-dashboard-grid--communications {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .vds-dashboard-grid--communications {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .vds-dashboard-grid--actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .vds-dashboard-grid--communications {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vds-dashboard-grid--promo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .vds-dashboard-grid--actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .vds-dashboard-grid--stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vds-dashboard-grid--communications {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .vds-dashboard-grid--boards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1400px) {
    .vds-dashboard-grid--communications {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.vds-dashboard-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.vds-dashboard-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.vds-dashboard-card__title {
    font-size: 1.125rem;
    font-weight: var(--weight-bold);
    margin: 0;
}

.vds-dashboard-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.vds-dashboard-card__body {
    min-width: 0;
}

/* Compact quick actions */
.vds-quick-action--compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 6.5rem;
    padding: var(--space-3);
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.vds-quick-action--compact.vds-quick-action--link:hover,
.vds-quick-action--compact.vds-quick-action--link:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.vds-quick-action--compact .vds-quick-action__icon {
    margin-bottom: var(--space-2);
    font-size: 1.5rem;
}

.vds-quick-action--compact .vds-quick-action__title {
    font-size: var(--font-small);
    margin: 0;
    line-height: 1.3;
}

/* Stats cards on dashboard */
.vds-stats-card--link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.vds-stats-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

/* Communication cards */
.vds-communication-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 11rem;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.vds-communication-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
}

.vds-communication-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.vds-communication-card__icon {
    color: var(--primary);
}

.vds-communication-card__favourite {
    color: var(--danger);
}

.vds-communication-card__source {
    margin: 0 0 var(--space-1);
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vds-communication-card__phrase {
    flex: 1;
    margin: 0 0 var(--space-3);
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vds-communication-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    font-size: var(--font-label);
    color: var(--text-muted);
}

.vds-communication-card__date {
    font-weight: var(--weight-semibold);
}

.vds-communication-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: auto;
}

.vds-communication-card__actions .vds-btn {
    flex: 1 1 auto;
    justify-content: center;
}

/* Board cards */
.vds-board-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.vds-board-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.vds-board-card__banner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.5rem;
    font-size: 1.75rem;
}

.vds-board-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: var(--space-2);
    padding: var(--space-4);
}

.vds-board-card__name {
    font-size: 1rem;
    font-weight: var(--weight-bold);
    margin: 0;
}

.vds-board-card__description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vds-board-card__meta {
    margin: 0;
    font-size: var(--font-small);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}

.vds-board-card__actions {
    margin-top: auto;
    padding-top: var(--space-2);
}

/* ---- Aphasia-friendly communication home dashboard ---- */
.vds-dashboard-page--home .vds-container {
    max-width: 93.75rem;
}

.vds-dashboard--home {
    display: flex;
    flex-direction: column;
    gap: var(--dashboard-section-gap, var(--space-6));
}

.vds-dashboard__welcome {
    margin-bottom: 0;
}

.vds-dashboard__footer-link {
    margin: var(--space-4) 0 0;
    text-align: center;
}

.vds-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-3);
}

.vds-section-header__title {
    font-size: 1.125rem;
    font-weight: var(--weight-bold);
    margin: 0;
    color: var(--text-primary);
}

.vds-section-header__title--page {
    font-size: clamp(1.375rem, 2.5vw, 1.75rem);
    font-weight: var(--weight-bold);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.vds-section-header__subtitle {
    margin: var(--space-1) 0 0;
    font-size: var(--font-small);
    color: var(--text-muted);
    max-width: 36rem;
}

.vds-action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 5.5rem;
    padding: var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.vds-action-button:hover,
.vds-action-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.vds-action-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.vds-action-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    font-size: 1.25rem;
}

.vds-action-button__title {
    font-size: var(--font-small);
    font-weight: var(--weight-semibold);
    line-height: 1.35;
    color: var(--text-primary);
}

.vds-action-button--blue {
    background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface));
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}
.vds-action-button--blue .vds-action-button__icon { color: var(--primary); }

.vds-action-button--green {
    background: linear-gradient(145deg, color-mix(in srgb, var(--success) 14%, var(--surface)), var(--surface));
    border-color: color-mix(in srgb, var(--success) 25%, var(--border));
}
.vds-action-button--green .vds-action-button__icon { color: var(--success); }

.vds-action-button--teal {
    background: linear-gradient(145deg, color-mix(in srgb, var(--accent-teal) 14%, var(--surface)), var(--surface));
    border-color: color-mix(in srgb, var(--accent-teal) 25%, var(--border));
}

.vds-action-button--teal .vds-action-button__icon { color: var(--accent-teal); }

.vds-action-button--slate {
    background: linear-gradient(145deg, color-mix(in srgb, var(--secondary) 12%, var(--surface)), var(--surface));
    border-color: color-mix(in srgb, var(--secondary) 22%, var(--border));
}
.vds-action-button--slate .vds-action-button__icon { color: var(--secondary); }

.vds-dashboard-grid--primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 992px) {
    .vds-dashboard-grid--primary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.vds-dashboard-page--home .vds-dashboard-card__title {
    font-size: var(--font-section-title);
    font-weight: var(--weight-bold);
}

.vds-dashboard-page--home .vds-dashboard-card {
    gap: var(--space-3);
}

.vds-communication-card--calm {
    background: color-mix(in srgb, var(--surface) 98%, var(--border));
    border-color: color-mix(in srgb, var(--border) 90%, transparent);
    box-shadow: none;
}

.vds-communication-card--calm:hover {
    border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
    box-shadow: var(--shadow-sm);
}

.vds-communication-card--calm .vds-communication-card__icon {
    color: color-mix(in srgb, var(--primary) 80%, var(--text-muted));
}

.vds-communication-card--large {
    min-height: 12rem;
}

.vds-communication-card--large .vds-communication-card__phrase {
    font-size: 1.0625rem;
    -webkit-line-clamp: 4;
}

.vds-communication-card--large .vds-communication-card__actions .vds-btn {
    min-height: 2.75rem;
    font-size: var(--font-body);
}

.vb-nav-link--secondary {
    min-height: 2.25rem;
    font-size: var(--font-small);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}

.vb-nav-link--secondary i {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.vb-nav-link--secondary:hover,
.vb-nav-link--secondary.is-active {
    color: var(--text-primary);
    background: var(--surface-muted, var(--primary-soft));
}

/* ---- Help tooltip ---- */
.vds-help-tooltip {
    position: relative;
    display: inline-flex;
}

.vds-help-tooltip__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-muted);
    cursor: help;
    transition: color 150ms ease, background-color 150ms ease;
}

.vds-help-tooltip__trigger:hover,
.vds-help-tooltip__trigger:focus-visible,
.vds-help-tooltip.is-open .vds-help-tooltip__trigger {
    color: var(--primary);
    background: var(--primary-soft);
}

.vds-help-tooltip__trigger:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.vds-help-tooltip--link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    text-decoration: none;
    transition: color 150ms ease, background-color 150ms ease;
}

.vds-help-tooltip--link:hover,
.vds-help-tooltip--link:focus-visible {
    color: var(--primary);
    background: var(--primary-soft);
}

.vds-help-tooltip--section.vds-help-tooltip--link {
    width: 1.35rem;
    height: 1.35rem;
}

.vds-help-tooltip__bubble {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 0.45rem);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 14rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    background: var(--text-primary);
    color: var(--text-inverse);
    font-size: var(--font-small);
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.vds-help-tooltip:hover .vds-help-tooltip__bubble,
.vds-help-tooltip:focus-within .vds-help-tooltip__bubble,
.vds-help-tooltip.is-open .vds-help-tooltip__bubble {
    opacity: 1;
    visibility: visible;
}

/* ---- Action cards (communication home) ---- */
.vds-action-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 6.5rem;
    padding: var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.vds-action-card:hover,
.vds-action-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.vds-action-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.vds-action-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.vds-action-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}

.vds-action-card__title {
    font-size: 1.0625rem;
    font-weight: var(--weight-bold);
    line-height: 1.3;
    color: var(--text-primary);
}

.vds-action-card__description {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.vds-action-card__arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 150ms ease, color 150ms ease;
}

.vds-action-card:hover .vds-action-card__arrow,
.vds-action-card:focus-visible .vds-action-card__arrow {
    color: var(--primary);
    transform: translateX(2px);
}

.vds-action-card--blue {
    background: color-mix(in srgb, #3b82f6 8%, var(--surface));
    border-color: color-mix(in srgb, #3b82f6 16%, var(--border));
}

.vds-action-card--blue .vds-action-card__icon {
    background: color-mix(in srgb, #3b82f6 14%, var(--surface));
    color: #2563eb;
}

.vds-action-card--green {
    background: color-mix(in srgb, #22c55e 8%, var(--surface));
    border-color: color-mix(in srgb, #22c55e 16%, var(--border));
}

.vds-action-card--green .vds-action-card__icon {
    background: color-mix(in srgb, #22c55e 14%, var(--surface));
    color: #16a34a;
}

.vds-action-card--purple {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 16%, var(--border));
}

.vds-action-card--purple .vds-action-card__icon {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    color: var(--secondary);
}

.vds-action-card--orange {
    background: color-mix(in srgb, #f97316 8%, var(--surface));
    border-color: color-mix(in srgb, #f97316 16%, var(--border));
}

.vds-action-card--orange .vds-action-card__icon {
    background: color-mix(in srgb, #f97316 14%, var(--surface));
    color: #ea580c;
}

/* ---- Quick Communication workspace ---- */
.vds-quick-comm-workspace {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.vds-quick-comm-workspace__search-hint {
    margin: var(--space-2) 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.vds-quick-comm-workspace__selected-card {
    border: 2px solid var(--primary);
    background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}

.vds-quick-comm-workspace__selected-label {
    margin: 0 0 var(--space-2);
    font-size: 0.875rem;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.vds-quick-comm-workspace__selected-phrase {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: var(--weight-bold);
    line-height: 1.35;
    color: var(--text);
}

.vds-quick-comm-workspace__selected-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: stretch;
}

.vds-quick-comm-workspace__speak {
    min-height: 3rem;
    min-width: 10rem;
    font-size: 1.125rem;
    font-weight: var(--weight-semibold);
}

.vds-quick-comm-workspace__selected-actions .assistant-action-btn {
    min-height: 3rem;
}

.vds-quick-comm-workspace__favourite-form {
    display: inline-flex;
}

.vds-quick-comm-workspace__feedback {
    margin: var(--space-3) 0 0;
    font-size: var(--font-body);
}

.vds-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.vds-chip.vds-btn {
    min-height: 3rem;
    padding-inline: var(--space-4);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.vds-chip.vds-btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}

.vds-quick-comm-workspace__grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .vds-quick-comm-workspace__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .vds-quick-comm-workspace__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.vds-quick-comm-workspace__grid-item {
    min-width: 0;
    display: flex;
}

.vds-quick-phrase-card {
    width: 100%;
    min-height: 3rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-align: left;
    color: var(--text);
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.vds-quick-phrase-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}

.vds-quick-phrase-card:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.vds-quick-phrase-card.is-selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.vds-quick-phrase-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: var(--space-2);
}

.vds-quick-phrase-card__icon {
    color: var(--primary);
    flex-shrink: 0;
}

.vds-quick-phrase-card__badges {
    display: flex;
    gap: var(--space-1);
    margin-left: auto;
}

.vds-quick-phrase-card__badge {
    color: var(--text-muted);
}

.vds-quick-phrase-card__badge--favourite {
    color: var(--danger);
}

.vds-quick-phrase-card__phrase {
    font-size: 1.0625rem;
    font-weight: var(--weight-semibold);
    line-height: 1.45;
}

.vds-quick-comm-workspace__empty {
    padding: var(--space-6) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: center;
}

@media (max-width: 991.98px) {
    .vds-hub-secondary {
        gap: var(--space-5);
    }

    .vds-hub-secondary__item + .vds-hub-secondary__item {
        margin-top: 0;
    }
}

@media (max-width: 767.98px) {
    .vds-hub-secondary .vds-communication-card__actions,
    .vds-hub-secondary .vds-phrase-row__actions {
        grid-template-columns: 1fr;
    }

    .vds-hub-secondary .vds-board-card--link {
        min-height: auto;
    }
}

.profile-page .profile-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    width: 100%;
    min-width: 0;
}

.profile-clinical-roles {
    margin-top: var(--space-5);
    border: 0;
    padding: 0;
}

.profile-clinical-roles__group + .profile-clinical-roles__group {
    margin-top: var(--space-4);
}

.profile-clinical-roles__group-label {
    margin: 0 0 var(--space-2);
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.profile-clinical-roles__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: var(--space-2) var(--space-4);
}

.profile-photo-field__preview {
    margin-bottom: var(--space-3);
}

.profile-photo-field__avatar.vds-avatar--lg {
    width: 5rem;
    height: 5rem;
}

.profile-detail-item .detail-label {
    display: block;
    font-size: var(--font-caption);
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}

.profile-detail-item .detail-value {
    font-size: var(--font-body);
    color: var(--text-primary);
    line-height: 1.4;
}

.profile-detail-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

/* ---- Dashboard welcome + help card ---- */
.vds-dashboard-welcome {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-2);
}

.vds-dashboard-welcome__main {
    flex: 1 1 18rem;
    min-width: 0;
}

.vds-help-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-width: 9rem;
    min-height: 6.5rem;
    padding: var(--space-4);
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    text-align: center;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.vds-help-card:hover,
.vds-help-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
    color: inherit;
}

.vds-help-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.vds-help-card__icon {
    font-size: 1.75rem;
    color: var(--primary);
}

.vds-help-card__label {
    font-size: 1.125rem;
    font-weight: var(--weight-bold);
    color: var(--text-primary);
}

.vds-help-card__hint {
    font-size: var(--font-small);
    color: var(--text-muted);
}

.vds-section-header__title-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ---- Phrase rows ---- */
.vds-phrase-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.vds-phrase-list--promo {
    margin-top: var(--space-3);
}

.vds-phrase-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.vds-phrase-row:hover {
    border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
    box-shadow: var(--shadow-md);
}

.vds-phrase-row__heart {
    flex-shrink: 0;
    color: var(--danger);
}

.vds-phrase-row__phrase {
    flex: 1 1 12rem;
    margin: 0;
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
    line-height: 1.45;
}

.vds-phrase-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-left: auto;
}

/* ---- Communication list (row layout) ---- */
.vds-communication-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.vds-communication-card--row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    min-height: auto;
    padding: var(--space-3) var(--space-4);
}

.vds-communication-card--row .vds-communication-card__icon--row {
    flex-shrink: 0;
    color: color-mix(in srgb, var(--primary) 75%, var(--text-muted));
}

.vds-communication-card--row .vds-communication-card__content {
    flex: 1 1 12rem;
    min-width: 0;
}

.vds-communication-card--row .vds-communication-card__phrase {
    margin-bottom: var(--space-1);
    -webkit-line-clamp: 2;
}

.vds-communication-card--row .vds-communication-card__meta {
    margin-bottom: 0;
}

.vds-communication-card--row .vds-communication-card__actions {
    margin-top: 0;
    margin-left: auto;
}

/* ---- Board cards (link variant) ---- */
.vds-board-card--link {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.vds-board-card--link .vds-board-card__banner {
    min-height: 3.5rem;
    min-width: 3.5rem;
    border-radius: var(--radius-md);
    font-size: 1.35rem;
}

.vds-board-card__banner--blue { background: color-mix(in srgb, #3b82f6 85%, white); color: white; }
.vds-board-card__banner--green { background: color-mix(in srgb, #22c55e 80%, white); color: white; }
.vds-board-card__banner--purple { background: color-mix(in srgb, var(--accent) 80%, white); color: white; }
.vds-board-card__banner--orange { background: color-mix(in srgb, #f97316 80%, white); color: white; }
.vds-board-card__banner--primary { background: color-mix(in srgb, var(--primary) 85%, white); color: white; }

.vds-board-card--link .vds-board-card__body {
    padding: 0;
}

.vds-board-card--link .vds-board-card__name {
    font-size: var(--font-body);
}

.vds-board-card--link .vds-board-card__description {
    -webkit-line-clamp: 1;
}

.vds-board-card__arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 150ms ease, color 150ms ease;
}

/* Board card — workspace & featured layouts */
.vds-board-card--workspace,
.vds-board-card--featured {
    height: 100%;
}

.vds-board-card--workspace .vds-board-card__banner,
.vds-board-card--featured .vds-board-card__banner {
    min-height: 4rem;
    font-size: 1.5rem;
}

.vds-board-card--featured .vds-board-card__banner {
    min-height: 5rem;
    font-size: 2rem;
}

.vds-board-card--workspace .vds-board-card__body,
.vds-board-card--featured .vds-board-card__body {
    flex: 1;
}

.vds-board-card__footer {
    padding: 0 var(--space-4) var(--space-4);
    margin-top: auto;
}

.vds-board-card__footer .vds-board-card__open {
    width: 100%;
    min-height: 3rem;
    justify-content: center;
}

.vds-board-card--featured .vds-board-card__footer .vds-board-card__open {
    min-height: 3rem;
}

.vds-board-card--workspace .vds-board-card__footer .vds-board-card__open {
    min-height: 3rem;
}

.vds-board-card--featured .vds-board-card__name {
    font-size: 1.25rem;
}

.vds-board-card--featured .vds-board-card__meta {
    font-size: var(--font-body);
}

.vds-board-card--link:hover .vds-board-card__arrow,
.vds-board-card--link:focus-visible .vds-board-card__arrow {
    color: var(--primary);
    transform: translateX(2px);
}

.vds-dashboard-page--home .vds-dashboard-section,
.vds-dashboard-page--home .vds-dashboard-card {
    padding: var(--dashboard-card-padding, var(--space-6));
    border-radius: var(--dashboard-card-radius, 1rem);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.vds-help-tooltip--section .vds-help-tooltip__trigger {
    width: 1.35rem;
    height: 1.35rem;
    font-size: var(--font-caption);
}

.vds-help-tooltip--section .vds-help-tooltip__bubble {
    max-width: 14rem;
    white-space: normal;
    text-align: left;
}

.vds-tips-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--dashboard-card-padding, var(--space-6));
    border: 1px solid var(--warning-border);
    border-radius: var(--dashboard-card-radius, 1rem);
    background: var(--warning-soft);
    box-shadow: var(--shadow-sm);
}

.vds-tips-card__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--warning) 12%, white);
    color: var(--warning-on-soft);
}

.vds-tips-card__body {
    flex: 1;
    min-width: 0;
}

.vds-tips-card__title {
    margin: 0 0 var(--space-2);
    font-size: 1rem;
    font-weight: var(--weight-bold);
    color: var(--text-primary);
}

.vds-tips-card__text {
    margin: 0 0 var(--space-3);
    font-size: var(--font-body);
    line-height: 1.5;
    color: var(--text-primary);
}

.vds-tips-card__action {
    margin-top: var(--space-1);
}

@media (max-width: 767.98px) {
    .vds-dashboard-welcome {
        flex-direction: column;
    }

    .vds-help-card {
        width: 100%;
    }

    .vds-action-card {
        flex-wrap: wrap;
    }

    .vds-phrase-row__actions,
    .vds-communication-card--row .vds-communication-card__actions {
        width: 100%;
        margin-left: 0;
    }
}


/* ── Form layout & actions ───────────────────────────────────────── */

.vds-form-layout {
    --bs-gutter-x: var(--space-8, 2rem);
    --bs-gutter-y: var(--space-7, 1.75rem);
}

.vds-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    margin: 0 0 var(--page-header-gap);
    padding: 0;
}

.vds-page-toolbar__group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.vds-page-toolbar__group--primary {
    gap: var(--space-3);
}

.vds-page-toolbar__group--secondary {
    margin-inline-start: auto;
}

.vds-page-toolbar__group > .vds-btn {
    flex: 0 1 auto;
}

@media (max-width: 767.98px) {
    .vds-page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .vds-page-toolbar__group--secondary {
        margin-inline-start: 0;
    }

    .vds-page-toolbar__group > .vds-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

.vds-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    border-top: 2px solid var(--border);
    margin-top: var(--space-2);
    padding-top: var(--space-8);
}

.vds-page-actions--end {
    justify-content: flex-end;
}

.vds-page-actions--center {
    justify-content: center;
}

.vds-page-actions--between {
    justify-content: space-between;
}

.vds-page-actions > .vds-flex {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* ── File input ──────────────────────────────────────────────────── */

.vds-file-input__preview {
    margin-bottom: var(--space-3);
}

.vds-file-input__preview-image {
    object-fit: cover;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
}

.vds-file-input__control {
    width: 100%;
}

/* ── Validation messages ─────────────────────────────────────────── */

.vds-validation-message {
    margin: var(--space-2) 0 0;
    font-size: var(--font-body);
    line-height: 1.5;
}

.vds-validation-message--error {
    color: var(--danger, #c53030);
}

.vds-validation-message--help {
    color: var(--text-muted);
}

.vds-validation-message--success {
    color: var(--success, #2f855a);
}

.vds-validation-message--warning {
    color: var(--warning, #b7791f);
}

.vds-youtube-api-test {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.vds-youtube-api-test__status {
    margin-top: 0;
}

.vds-youtube-api-test__title {
    display: block;
    font-weight: var(--weight-semibold);
}

.vds-youtube-api-test__message {
    display: block;
    margin-top: 0.15rem;
    color: inherit;
    opacity: 0.92;
}

/* ── Help panel ──────────────────────────────────────────────────── */

.vds-help-panel {
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
}

.vds-help-panel__title {
    margin: 0 0 var(--space-2);
    font-size: 1rem;
    font-weight: var(--weight-bold);
}

.vds-help-panel__text {
    margin: 0 0 var(--space-3);
    font-size: var(--font-body);
    line-height: 1.55;
    color: var(--text-muted);
}

.vds-help-panel__link {
    font-size: 0.875rem;
    font-weight: var(--weight-semibold);
    color: var(--primary);
    text-decoration: none;
}

.vds-confirm-dialog__message {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    /* DeleteAction renders modals inside .vds-row-actions / table cells with nowrap. */
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .vds-page-actions {
        padding-top: var(--space-6);
    }
}

/* ── Progressive disclosure ──────────────────────────────────────── */

.vds-create-therapist__toggle {
    max-width: 100%;
}

.vds-disclosure-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* ── Clinical content presentation (progressive disclosure) ── */

.fb-cc-hub {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
}

.fb-cc-hub__intro {
    margin: 0 0 var(--space-5);
    max-width: 48rem;
    color: var(--text-muted, var(--text));
}

.fb-cc-hub__areas {
    margin: 0;
    padding-left: 1.25rem;
}

.fb-cc-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.fb-cc-item {
    min-width: 0;
}

.fb-cc-item__purpose {
    margin: 0 0 var(--space-4);
    color: var(--text);
}

.fb-cc-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.fb-cc-item__status {
    flex: 0 0 auto;
}

.fb-cc-item__disclosure + .fb-cc-item__disclosure {
    margin-top: var(--space-3);
}

.fb-cc-item .vds-card__body > .fb-cc-item__actions:last-child,
.fb-cc-item .vds-card__body > .fb-cc-item__purpose:last-child {
    margin-bottom: 0;
}

@media (max-width: 1024px) {
    .fb-cc-hub {
        grid-template-columns: 1fr;
    }
}

.vds-disclosure {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: var(--space-4) var(--space-5);
}

.vds-disclosure--nested {
    border: none;
    background: transparent;
    padding: 0;
}

/* Compact disclosure inside row action toolbars (People, Approvals) */
.vds-disclosure--inline {
    border: none;
    background: transparent;
    padding: 0;
    min-width: 0;
}

.vds-disclosure--inline > .vds-disclosure__summary {
    font-size: 0.875rem;
    font-weight: var(--weight-semibold);
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
}

.vds-disclosure--inline > .vds-disclosure__content {
    padding-top: var(--space-2);
    min-width: 12rem;
}

.vds-row-actions .vds-disclosure--inline {
    flex: 1 1 100%;
}

.vds-disclosure__summary {
    cursor: pointer;
    font-size: 1.0625rem;
    font-weight: var(--weight-bold);
    line-height: 1.4;
    list-style: none;
    padding: var(--space-2) 0;
}

.vds-disclosure__summary::-webkit-details-marker {
    display: none;
}

.vds-disclosure__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: var(--space-2);
    transition: transform 150ms ease;
}

.vds-disclosure[open] > .vds-disclosure__summary::before {
    transform: rotate(90deg);
}

.vds-disclosure__summary--split {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.vds-disclosure__summary--split::before {
    flex: 0 0 auto;
}

.vds-disclosure__summary-title {
    flex: 1 1 auto;
    min-width: 0;
}

.vds-disclosure__action-label {
    flex: 0 0 auto;
    font-size: 0.875rem;
    font-weight: var(--weight-semibold);
    color: var(--primary);
}

.vds-disclosure__action-label--open {
    display: none;
}

.vds-disclosure[open] > .vds-disclosure__summary .vds-disclosure__action-label--closed {
    display: none;
}

.vds-disclosure[open] > .vds-disclosure__summary .vds-disclosure__action-label--open {
    display: inline;
}

.vds-disclosure__summary:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.vds-disclosure__content {
    padding-top: var(--space-4);
}

.fb-add-person__legend {
    font-size: 0.9375rem;
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-2);
}

.fb-add-person__options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
}

.fb-add-person__options .vds-field--radio {
    margin: 0;
}

.fb-add-person-panel {
    padding: 0;
    overflow: hidden;
}

.fb-add-person-panel__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding: var(--space-4) var(--space-5);
}

.fb-add-person-panel__summary::-webkit-details-marker {
    display: none;
}

.fb-add-person-panel__summary:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

.fb-add-person-panel__intro {
    min-width: 0;
    flex: 1 1 16rem;
}

.fb-add-person-panel__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: var(--weight-bold);
    line-height: 1.3;
}

.fb-add-person-panel__subtitle {
    margin: var(--space-1) 0 0;
    color: var(--text-muted, #5b5675);
    font-size: 0.9375rem;
}

.fb-add-person-panel__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: var(--weight-semibold);
    flex: 0 0 auto;
}

.fb-add-person-panel__action--open {
    display: none;
}

.fb-add-person-panel[open] > .fb-add-person-panel__summary .fb-add-person-panel__action--closed {
    display: none;
}

.fb-add-person-panel[open] > .fb-add-person-panel__summary .fb-add-person-panel__action--open {
    display: inline;
}

.fb-add-person-panel[open] > .fb-add-person-panel__summary .fb-add-person-panel__action {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.fb-add-person-panel__content {
    padding: 0 var(--space-5) var(--space-5);
    border-top: 1px solid var(--border);
}

/* Admin Content Library — stage → activity browse */
.fb-content-library__summary-main {
    display: inline;
}

.fb-content-library__summary-meta {
    display: block;
    margin-top: var(--space-1);
    margin-left: 1.25rem;
    font-size: var(--font-body);
    font-weight: var(--weight-regular);
    color: var(--text-muted);
}

.fb-content-library__activities {
    gap: var(--space-3);
    padding-left: var(--space-2);
}

.fb-content-library__activity {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--surface) 92%, var(--primary) 4%);
}

.fb-content-library__activity > .vds-disclosure__summary {
    font-size: 1rem;
}

.fb-content-library__unlinked {
    border-style: dashed;
}

/* Platform Curriculum — single chevron disclosures (Stage / Module) */
.fb-curriculum-overview {
    --fb-catalogue-toggle-size: 2rem; /* 32px hit target */
    --fb-catalogue-toggle-gap: var(--space-2);
}

.fb-catalogue-disclosure.vds-disclosure {
    padding: 0;
}

.fb-catalogue-disclosure--module.vds-disclosure {
    border-style: solid;
    background: color-mix(in srgb, var(--surface) 94%, var(--primary) 3%);
}

.fb-catalogue-disclosure__summary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.3;
    border-radius: var(--radius-md);
}

/* Suppress the default ▸ marker — custom chevron is the only control */
.fb-catalogue-disclosure > .fb-catalogue-disclosure__summary::before,
.fb-catalogue-disclosure > .vds-disclosure__summary::before {
    content: none !important;
    display: none !important;
    margin: 0 !important;
}

.fb-catalogue-disclosure__row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--fb-catalogue-toggle-gap);
    width: 100%;
    min-width: 0;
}

.fb-catalogue-disclosure__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--fb-catalogue-toggle-size);
    height: var(--fb-catalogue-toggle-size);
    margin: 0;
    color: var(--text-muted);
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: transform 180ms ease, color 150ms ease, background-color 150ms ease;
}

.fb-catalogue-disclosure__toggle .bi {
    font-size: 1rem;
    line-height: 1;
}

.fb-catalogue-disclosure[open] > .fb-catalogue-disclosure__summary .fb-catalogue-disclosure__toggle {
    transform: rotate(90deg);
    color: var(--primary);
}

.fb-catalogue-disclosure__title {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 1.125rem;
    font-weight: var(--weight-bold);
    color: var(--text);
    line-height: 1.3;
}

.fb-catalogue-disclosure--module .fb-catalogue-disclosure__title {
    font-size: 1rem;
}

.fb-catalogue-disclosure__aside {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
}

.fb-catalogue-disclosure__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    /* Align chips with the title, not the chevron */
    padding-left: calc(var(--fb-catalogue-toggle-size) + var(--fb-catalogue-toggle-gap));
}

.fb-catalogue-disclosure__chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface) 88%, var(--bg) 12%);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: var(--weight-medium);
    line-height: 1.3;
    white-space: nowrap;
}

/* Only the Unpublished count pill — amber attention, not error / not row styling */
.fb-catalogue-disclosure__chip.fb-catalogue-disclosure__chip--unpublished {
    background: color-mix(in srgb, var(--warning) 20%, #ffffff);
    border-color: color-mix(in srgb, var(--warning) 70%, var(--warning-border));
    color: var(--warning-on-soft);
    font-weight: var(--weight-semibold);
}

.fb-catalogue-disclosure__content {
    padding: 0 var(--space-5) var(--space-5);
}

.fb-catalogue-disclosure__summary:hover .fb-catalogue-disclosure__title {
    color: var(--primary);
}

.fb-catalogue-disclosure__summary:hover .fb-catalogue-disclosure__toggle {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.fb-catalogue-status-pair {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: var(--space-2) var(--space-3);
}

.fb-catalogue-status-pair__item {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 6.5rem;
}

.fb-catalogue-status-pair__label {
    font-size: 0.6875rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.2;
}

.fb-catalogue-activity__main {
    min-width: 0;
    flex: 1 1 auto;
}

.fb-activities-catalogue__item .fb-catalogue-status-pair {
    justify-content: flex-start;
}

/* ── Delete confirmation modals ─────────────────────────────────── */

/*
 * DeleteAction nests confirm modals under .vds-row-actions / table cells
 * (white-space: nowrap). Reset wrapping on content only.
 *
 * Do NOT set max-width: 100% on .modal-dialog — that overrides Bootstrap's
 * compact panel max-width and stretches the dialog to the viewport.
 */
.vds-modal.vds-confirm-dialog,
.vds-modal.vds-confirm-dialog .modal-dialog,
.vds-modal.vds-confirm-dialog .modal-content,
.vds-modal.vds-confirm-dialog .vds-modal__body {
    white-space: normal;
}

.vds-confirm-dialog .vds-modal__footer {
    gap: var(--space-3);
    flex-wrap: wrap;
    white-space: normal;
}

/* ── Admin users bulk actions ───────────────────────────────────── */

.vds-users-bulk {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.vds-users-bulk__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.vds-users-bulk__count {
    font-size: 1rem;
    font-weight: var(--weight-semibold);
}

.vds-users-bulk__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.vds-users-bulk__header,
.vds-users-bulk__row {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
}

.vds-users-bulk__header {
    padding: 0 var(--space-2);
}

.vds-users-bulk__header-label {
    display: flex;
    align-items: center;
    min-height: 3rem;
}

.vds-users-bulk__checkbox-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    min-height: 3rem;
    margin: 0;
    cursor: pointer;
}

.vds-users-bulk__row + .vds-users-bulk__row {
    margin-top: var(--space-4);
}

.vds-users-bulk__card {
    min-width: 0;
}

.vds-users-bulk__card-inner {
    height: 100%;
}

.vds-users-bulk__modal .vds-modal__footer {
    gap: var(--space-3);
}

@media (max-width: 767.98px) {
    .vds-users-bulk__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .vds-users-bulk__actions {
        flex-direction: column;
    }

    .vds-users-bulk__actions .vds-btn {
        width: 100%;
        min-height: 3rem;
    }
}

.vds-btn:focus-visible,
.vds-disclosure__summary:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}


/* ==========================================================================
   Canonical recipes (Home refresh language)
   Use these instead of inventing new hex panels per feature page.
   Components: Card, Button, ReminderCard, PageHeader, shell nav (design-system baseline;
   patient theme quarantine/assistant-patient-theme.css is unloaded — see THEME_LOADING.md)
   ========================================================================== */

/* Soft panel — white surface, subtle border, soft shadow */
.vds-panel,
.vds-card--soft {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-panel);
}

.vds-panel {
    padding: var(--space-5);
}

.vds-panel__title,
.vds-section-title {
    margin: 0 0 var(--space-2);
    font-size: var(--font-section-title);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}

.vds-panel__lead,
.vds-section-lead {
    margin: 0 0 var(--space-4);
    font-size: var(--font-body);
    color: var(--text-muted);
    line-height: var(--line-height-body);
}

/* Soft action / “More options” list card */
.vds-soft-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: var(--touch-target-min);
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.vds-soft-card:hover,
.vds-soft-card:focus-visible {
    background: var(--nav-hover-bg);
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border-subtle));
    box-shadow: var(--shadow-md);
    outline: none;
}

.vds-soft-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.vds-soft-card__icon {
    flex-shrink: 0;
    color: var(--primary);
    font-size: 1.25rem;
}

.vds-soft-card__label {
    flex: 1;
    min-width: 0;
    font-size: var(--font-body);
    font-weight: var(--weight-semibold);
}

/* Lavender selected / active state (nav, chips, filters) */
.vds-is-active,
.vds-selected {
    background: var(--nav-active-bg) !important;
    color: var(--nav-active-text) !important;
    box-shadow: none;
}

.vds-is-active i,
.vds-selected i {
    color: var(--nav-active-icon);
}

/* Large speak / primary communication touch target */
.vds-speak-target,
.vds-btn--speak {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: var(--speak-target-size);
    min-height: var(--speak-target-size);
    padding: var(--space-4);
    border: none;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--text-inverse);
    font-size: var(--font-body);
    font-weight: var(--weight-bold);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.vds-speak-target:hover,
.vds-btn--speak:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-lg);
}

.vds-speak-target:focus-visible,
.vds-btn--speak:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.vds-btn--touch {
    min-height: var(--touch-target-min);
    padding-inline: var(--space-5);
    font-weight: var(--weight-semibold);
}

/* Open dashboard header band */
.vds-dash-open {
    display: grid;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.vds-dash-open__greeting {
    margin: 0;
    font-size: var(--font-display);
    font-weight: var(--weight-bold);
    color: var(--text-strong);
    line-height: var(--line-height-tight);
}

.vds-dash-open__meta {
    margin: 0;
    font-size: var(--font-body);
    color: var(--text-muted);
}

/* Expandable clinical note history (reusable) */
.vds-clinical-note-history,
.vds-therapist-note-history {
    display: grid;
    gap: var(--space-3);
    margin: 0 0 var(--space-3);
}

.vds-clinical-note-history__title {
    margin: 0;
    font-size: var(--font-body, 1rem);
    font-weight: var(--weight-semibold, 600);
    color: var(--text-strong, #1f1635);
    line-height: var(--line-height-tight, 1.25);
}

.vds-clinical-note-history__list {
    display: grid;
    gap: var(--space-3);
}

.vds-therapist-note-history__item {
    margin-bottom: 0;
}

.vds-clinical-note-history__details {
    margin: 0;
}

.vds-clinical-note-history__toggle {
    cursor: pointer;
    color: var(--primary, #5b3a9e);
    font-size: var(--font-small, 0.875rem);
    font-weight: var(--weight-semibold, 600);
    list-style: none;
    user-select: none;
}

.vds-clinical-note-history__toggle::-webkit-details-marker {
    display: none;
}

.vds-clinical-note-history__toggle:focus-visible {
    outline: 2px solid var(--accent, #7c5cbf);
    outline-offset: 2px;
    border-radius: 2px;
}

.vds-clinical-note-history__toggle-hide {
    display: none;
}

.vds-clinical-note-history__details[open] > .vds-clinical-note-history__toggle .vds-clinical-note-history__toggle-show {
    display: none;
}

.vds-clinical-note-history__details[open] > .vds-clinical-note-history__toggle .vds-clinical-note-history__toggle-hide {
    display: inline;
}

.vds-clinical-note-history__details[open] > .vds-clinical-note-history__list {
    margin-top: var(--space-3);
}

/* Therapist clinical note with permanent authorship */
.vds-therapist-note {
    display: grid;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface-muted, #f8f7fc);
}

.vds-therapist-note--empty {
    border: 0;
    background: transparent;
    padding: 0;
}

.vds-therapist-note__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
}

.vds-therapist-note__author {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
}

.vds-therapist-note__author-name {
    font-weight: var(--weight-semibold, 600);
    color: var(--text-strong, #1f1635);
    font-size: var(--font-body, 1rem);
    line-height: var(--line-height-tight, 1.25);
}

.vds-therapist-note__author-name--unknown {
    font-weight: var(--weight-medium, 500);
    color: var(--text-muted, #6b7280);
}

.vds-therapist-note__author-role {
    font-size: var(--font-small, 0.875rem);
    color: var(--text-muted, #6b7280);
    line-height: 1.3;
}

.vds-therapist-note__times {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: var(--font-small, 0.875rem);
    color: var(--text-muted, #6b7280);
}

.vds-therapist-note__edited {
    font-style: italic;
}

.vds-therapist-note__body {
    font-size: var(--font-body, 1rem);
    color: var(--text-primary, #2d2440);
    line-height: var(--line-height-body, 1.5);
    white-space: normal;
}

.vds-therapist-note__original {
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.vds-therapist-note__current {
    padding-top: var(--space-1);
}

.vds-therapist-note__version-label {
    margin: 0 0 var(--space-1);
    font-size: var(--font-small, 0.875rem);
    font-weight: var(--weight-semibold, 600);
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
}

.vds-therapist-note__version-label time {
    font-weight: var(--weight-medium, 500);
}

.vds-therapist-note__original-body {
    font-size: var(--font-body, 1rem);
    color: var(--text-muted, #4b5563);
    line-height: var(--line-height-body, 1.5);
    white-space: normal;
}

.vds-therapist-note__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.vds-therapist-note__delete {
    margin-left: auto;
}

.vds-therapist-note__edit {
    margin-top: var(--space-2);
}

.vds-therapist-note__edit-toggle {
    cursor: pointer;
    color: var(--primary, #5b3a9e);
    font-size: var(--font-small, 0.875rem);
    font-weight: var(--weight-semibold, 600);
    list-style: none;
}

.vds-therapist-note__edit-toggle::-webkit-details-marker {
    display: none;
}

.vds-therapist-note__edit-toggle:focus-visible {
    outline: 2px solid var(--accent, #7c5cbf);
    outline-offset: 2px;
}

.vds-therapist-note__edit-form {
    padding-top: var(--space-2);
    border-top: 1px solid var(--border, #e5e7eb);
}

/* Phase 148 — Evidence Response speed Stage → Module → Activity */
.fb-evidence-speed {
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 0.75rem);
}

.fb-evidence-speed__stage,
.fb-evidence-speed__module,
.fb-evidence-speed__activity {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface, #fff);
}

.fb-evidence-speed__module {
    margin-top: var(--space-2, 0.5rem);
    background: var(--surface-muted, #fafafa);
}

.fb-evidence-speed__activity {
    margin-top: var(--space-2, 0.5rem);
    border-style: dashed;
    background: transparent;
}

.fb-evidence-speed__summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
    font-weight: var(--weight-semibold, 600);
}

.fb-evidence-speed__summary::-webkit-details-marker {
    display: none;
}

.fb-evidence-speed__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: var(--space-2, 0.5rem);
    transition: transform 150ms ease;
}

.fb-evidence-speed__stage[open] > .fb-evidence-speed__summary::before,
.fb-evidence-speed__module[open] > .fb-evidence-speed__summary::before,
.fb-evidence-speed__activity[open] > .fb-evidence-speed__summary::before {
    transform: rotate(90deg);
}

.fb-evidence-speed__summary:focus-visible {
    outline: 2px solid var(--accent, #7c5cbf);
    outline-offset: 2px;
}

.fb-evidence-speed__title {
    flex: 1 1 12rem;
    min-width: 0;
}

.fb-evidence-speed__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    font-weight: var(--weight-regular, 400);
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    align-items: center;
}

.fb-evidence-speed__chip {
    white-space: normal;
}

.fb-evidence-speed__trend .vds-badge {
    font-weight: var(--weight-semibold, 600);
}

.fb-evidence-speed__body,
.fb-evidence-speed__module-body,
.fb-evidence-speed__activity-body {
    padding: 0 var(--space-4, 1rem) var(--space-3, 0.75rem);
}

.fb-evidence-speed__body {
    padding-left: calc(var(--space-4, 1rem) + 0.5rem);
    border-top: 1px solid var(--border, #e5e7eb);
}

.fb-evidence-audit__summary {
    cursor: pointer;
    list-style: none;
    font-weight: var(--weight-semibold, 600);
    padding: var(--space-2, 0.5rem) 0;
}

.fb-evidence-audit__summary::-webkit-details-marker {
    display: none;
}

.fb-evidence-audit__summary::before {
    content: '▸';
    display: inline-block;
    margin-right: var(--space-2, 0.5rem);
}

.fb-evidence-audit[open] > .fb-evidence-audit__summary::before {
    content: '▾';
}

.fb-evidence-audit__summary:focus-visible {
    outline: 2px solid var(--accent, #7c5cbf);
    outline-offset: 2px;
}

.fb-evidence-audit__hint {
    display: block;
    font-weight: var(--weight-regular, 400);
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
    margin-top: 0.15rem;
    margin-left: 1.25rem;
}

.fb-evidence-audit__list {
    padding-left: 1.1rem;
}

.fb-evidence-audit__list li {
    margin-bottom: 0.35rem;
}

/* ==========================================================================
   UX-1 — platform surface recipes
   Visual language shared across clinician, admin, and patient portals.
   Do not treat these classes as clinical meaning.
   .fb-mdt-* remains a feature alias of the same recipes.
   ========================================================================== */

.vds-surface-panel,
.fb-mdt-panel {
    padding: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    box-shadow: var(--shadow-sm);
}

.vds-surface-panel__title,
.fb-mdt-panel__title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: var(--weight-bold, 700);
    color: var(--text);
}

.vds-surface-panel__lede,
.fb-mdt-panel__lede {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.vds-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.vds-empty-inline,
.fb-mdt-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.vds-pre {
    margin: 0;
    white-space: pre-wrap;
}

.fb-mdt-workspace,
.fb-therapist-destination {
    display: grid;
    gap: var(--space-4);
}

.fb-mdt-workspace > .vds-section,
.fb-therapist-destination > .vds-section {
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 0.85rem);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.fb-mdt-workspace > .vds-section .vds-section__header,
.fb-therapist-destination > .vds-section .vds-section__header {
    margin-bottom: var(--space-3);
}

.fb-mdt-workspace > .vds-section .vds-section-subtitle,
.fb-therapist-destination > .vds-section .vds-section-subtitle {
    margin-bottom: var(--space-3);
}

.fb-mdt-workspace > .vds-section > .vds-card,
.fb-mdt-workspace > .vds-section .vds-section__content > .vds-card,
.fb-therapist-destination > .vds-section > .vds-card,
.fb-therapist-destination > .vds-section .vds-section__content > .vds-card {
    border: 0;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
}

.fb-mdt-workspace > .vds-section .vds-section__content > .vds-card > .vds-card__body,
.fb-mdt-workspace > .vds-section .vds-section__content > .vds-card > .vds-card__header,
.fb-mdt-workspace > .vds-section .vds-section__content > .vds-card > .vds-card__footer,
.fb-therapist-destination > .vds-section .vds-section__content > .vds-card > .vds-card__body,
.fb-therapist-destination > .vds-section .vds-section__content > .vds-card > .vds-card__header,
.fb-therapist-destination > .vds-section .vds-section__content > .vds-card > .vds-card__footer {
    padding-left: 0;
    padding-right: 0;
}

.fb-mdt-workspace > .vds-section .vds-section__content > .vds-card > .vds-card__body,
.fb-therapist-destination > .vds-section .vds-section__content > .vds-card > .vds-card__body {
    padding-top: 0;
    padding-bottom: 0;
}

.vds-action-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.vds-action-cluster__primary,
.vds-action-cluster__secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.vds-action-cluster__destructive {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-left: auto;
    padding-left: var(--space-3);
    border-left: 1px solid var(--border);
}

@media (max-width: 767px) {
    .vds-action-cluster__destructive {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
        padding-top: var(--space-2);
        border-top: 1px solid var(--border);
        width: 100%;
    }
}

.vds-stack-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
}

.vds-stack-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2) var(--space-3);
    min-width: 0;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.vds-stack-row__copy {
    min-width: 0;
    flex: 1 1 12rem;
}

.vds-stack-row__name,
.vds-wrap-name {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.vds-stack-row__meta {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: var(--font-small);
    line-height: 1.4;
}

.vds-stack-row > .vds-avatar {
    margin-top: 0.15rem;
}

.vds-record-identity,
.fb-mdt-identity {
    min-width: 0;
}

@media (max-width: 767px) {
    .vds-stack-row {
        padding: 0.7rem 0.8rem;
    }

    .vds-surface-panel,
    .fb-mdt-panel,
    .fb-mdt-workspace > .vds-section,
    .fb-therapist-destination > .vds-section {
        padding: var(--space-3);
    }
}

/* ==========================================================================
   UX-4 — final visual QA recipes
   Key/value blocks and two-column splits. v1.0 tokens only; not a v2.
   ========================================================================== */

.vds-meta-list {
    margin: 0;
    display: grid;
    gap: 0.4rem 0;
}

.vds-meta-list__row {
    display: grid;
    grid-template-columns: minmax(6.5rem, 10.5rem) minmax(0, 1fr);
    gap: var(--space-2);
    min-width: 0;
    align-items: baseline;
}

.vds-meta-list dt {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: var(--weight-semibold);
}

.vds-meta-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.vds-split {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}

.vds-split > .vds-section {
    margin-bottom: 0;
    min-width: 0;
}

.vds-section .vds-page-stats {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .vds-split {
        grid-template-columns: 1fr 1fr;
    }
}

/* Therapist Home — compact dashboard presentation (same v1.0 language) */
.fb-therapist-home {
    --section-gap: var(--space-5);
    --page-header-gap: 0.7rem;
}

.fb-therapist-home .vds-workspace-hero {
    --workspace-hero-padding-block: 0.6rem;
}

.fb-therapist-home .vds-workspace-hero__title {
    font-size: clamp(1.35rem, 2.2vw, 1.65rem);
}

.fb-therapist-home .vds-workspace-hero__date {
    margin-top: 0.15rem;
    font-size: 0.8125rem;
    font-weight: var(--weight-regular);
    color: var(--text-muted);
}

.fb-therapist-home .vds-workspace-hero__subtitle {
    margin-top: 0.15rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.fb-therapist-home .vds-page-stats--metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.fb-therapist-home .vds-page-stats--metrics .vds-page-stats__card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    padding: 0.8rem 1rem;
}

.fb-therapist-home .vds-page-stats--metrics .vds-page-stats__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    font-size: var(--font-caption);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.fb-therapist-home .vds-page-stats--metrics .vds-page-stats__icon {
    display: inline-flex;
    color: var(--primary);
    line-height: 1;
}

.fb-therapist-home .vds-page-stats--metrics .vds-page-stats__value {
    font-size: clamp(1.75rem, 3vw, 2.15rem);
}

.fb-therapist-home .vds-page-stats--metrics .vds-page-stats__hint {
    margin-top: 0.2rem;
}

.fb-therapist-home .vds-page-stats--metrics .vds-stats-card--link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.fb-therapist-home .vds-section__header {
    margin-bottom: var(--space-2);
}

.fb-therapist-home .vds-section-subtitle {
    margin: 0.2rem 0 var(--space-3);
    font-size: 0.92rem;
}

.fb-therapist-home .vds-split {
    align-items: stretch;
}

.fb-therapist-home .vds-split > .vds-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.fb-therapist-home .vds-split .vds-section__content,
.fb-therapist-home .vds-split .vds-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.fb-therapist-home .vds-split .vds-card__body {
    flex: 1 1 auto;
}

.fb-therapist-home .vds-card .vds-empty-state {
    padding: var(--space-4) var(--space-3);
    border: 0;
    box-shadow: none;
    background: transparent;
}

.fb-therapist-home .vds-card .vds-empty-state--clear {
    background: var(--success-soft, color-mix(in srgb, var(--success) 10%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--success) 22%, var(--border));
    border-radius: var(--radius-lg);
}

.fb-therapist-home .vds-card .vds-empty-state--clear .vds-empty-state__icon {
    color: var(--success);
    margin-bottom: var(--space-2);
}

.fb-therapist-home .vds-card .vds-empty-state--quiet .vds-empty-state__icon {
    margin-bottom: var(--space-2);
}

.fb-therapist-home .vds-card .vds-empty-state__title {
    font-size: 1rem;
}

.fb-therapist-home .vds-card .vds-empty-state__description {
    margin-bottom: 0;
    font-size: 0.92rem;
}

.fb-therapist-home .vds-stack-row--action {
    align-items: center;
    flex-wrap: nowrap;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.fb-therapist-home .vds-stack-row--action:hover {
    background: color-mix(in srgb, var(--primary) 4%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    box-shadow: var(--shadow-sm);
}

.fb-therapist-home .vds-stack-row--action:focus-within {
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.fb-therapist-home .vds-stack-row--action > .vds-avatar {
    margin-top: 0;
    flex: 0 0 auto;
}

.fb-therapist-home .vds-stack-row--action .vds-stack-row__name {
    font-size: 1rem;
    font-weight: var(--weight-bold);
    color: var(--text-strong);
    text-decoration: none;
}

.fb-therapist-home .vds-stack-row--action .vds-stack-row__name:hover,
.fb-therapist-home .vds-stack-row--action .vds-stack-row__name:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

.fb-therapist-home .vds-stack-row--action > .vds-btn {
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 479.98px) {
    .fb-therapist-home .vds-page-stats--metrics {
        grid-template-columns: 1fr;
    }

    .fb-therapist-home .vds-stack-row--action {
        flex-wrap: wrap;
    }

    .fb-therapist-home .vds-stack-row--action > .vds-btn {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 479px) {
    .vds-meta-list__row {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
}

.fb-authoring-checklist__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.fb-authoring-checklist__kicker,
.fb-authoring-checklist__count,
.fb-authoring-checklist__detail,
.fb-authoring-checklist__foot {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--font-small);
}

.fb-authoring-checklist__kicker {
    font-weight: var(--weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: var(--font-caption);
}

.fb-authoring-checklist__mark {
    color: var(--text-muted);
    font-weight: var(--weight-bold);
}

.fb-authoring-checklist__mark.is-ready {
    color: var(--success-on-soft);
}

.fb-authoring-checklist__detail,
.fb-authoring-checklist__foot {
    display: block;
    margin-top: 0.15rem;
}

.fb-authoring-checklist .vds-stack-row {
    align-items: flex-start;
}

/* Compact therapist clinical-journey stage tiles */
.fb-journey-nav {
    margin: var(--space-4) 0 var(--space-3);
}

.fb-journey-nav__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.fb-journey-nav__item {
    min-width: 0;
}

.fb-journey-nav__tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    height: 100%;
    padding: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.fb-journey-nav__tile .vds-card__body {
    padding: 0;
}

.fb-journey-nav__name {
    font-weight: var(--weight-semibold);
    font-size: var(--font-small);
    line-height: var(--line-height-tight);
}

.fb-journey-nav__tile.is-current {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.fb-journey-nav__tile:hover {
    border-color: var(--primary);
}

.fb-journey-nav__tile:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.fb-journey-stage {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-3);
    margin: 0 0 var(--space-4);
}

.fb-journey-stage__title {
    margin: 0;
    font-size: var(--font-section-title);
}

.fb-journey-stage__purpose {
    margin: 0;
    color: var(--text-muted);
}

.fb-journey-secondary {
    margin: var(--space-4) 0 0;
}

.fb-journey-secondary > summary {
    cursor: pointer;
    font-weight: var(--weight-semibold);
}

.fb-journey-secondary > summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Intake two-column workspace: question/answers left, compact Journey rail right */
.fb-journey-workspace {
    display: grid;
    gap: var(--space-4);
    align-items: start;
}

.fb-journey-workspace__main {
    min-width: 0;
}

.fb-journey-workspace__main > .vds-section {
    margin-bottom: var(--space-4);
}

.fb-journey-workspace__main > .vds-section .vds-section__header {
    margin-bottom: var(--space-2);
}

.fb-journey-workspace__main > .vds-section .vds-section-subtitle {
    margin: 0.15rem 0 var(--space-3);
}

.fb-journey-workspace__main .fb-journey-stage {
    margin-bottom: var(--space-3);
}

.fb-journey-workspace__aside {
    min-width: 0;
}

.fb-journey-nav--rail {
    margin: 0;
    padding: var(--space-3);
}

.fb-journey-nav__kicker {
    margin: 0 0 var(--space-2);
    font-size: var(--font-caption, 0.75rem);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fb-journey-nav--rail .fb-journey-nav__list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.fb-journey-nav--rail .fb-journey-nav__item-link {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm, 0.375rem);
    text-decoration: none;
    color: inherit;
    font-size: var(--font-small);
    line-height: 1.3;
}

.fb-journey-nav--rail .fb-journey-nav__item-link:hover {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.fb-journey-nav--rail .fb-journey-nav__item-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.fb-journey-nav--rail .fb-journey-nav__item-link.is-current {
    background: color-mix(in srgb, var(--primary) 7%, transparent);
    box-shadow: inset 2px 0 0 var(--primary);
    font-weight: var(--weight-semibold);
}

.fb-journey-nav--rail .fb-journey-nav__mark {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    margin-top: 0.05rem;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1;
    font-weight: var(--weight-bold);
}

.fb-journey-nav--rail .fb-journey-nav__mark::before {
    content: "\25CB";
}

.fb-journey-nav--rail .is-complete .fb-journey-nav__mark {
    color: var(--success);
}

.fb-journey-nav--rail .is-complete .fb-journey-nav__mark::before {
    content: "\2713";
}

.fb-journey-nav--rail .is-pending:not(.is-current) .fb-journey-nav__mark {
    color: var(--warning);
}

.fb-journey-nav--rail .is-current .fb-journey-nav__mark {
    color: var(--warning);
}

.fb-journey-nav--rail .is-current .fb-journey-nav__mark::before {
    content: "\25CF";
}

.fb-journey-nav--rail .fb-journey-nav__text {
    min-width: 0;
}

.fb-journey-nav--rail .fb-journey-nav__name {
    display: block;
}

.fb-journey-nav__meta {
    display: block;
    margin-top: 0.1rem;
    font-size: var(--font-caption, 0.75rem);
    font-weight: var(--weight-normal);
    color: var(--text-muted);
}

.fb-intake-form.vds-stack {
    gap: var(--space-2);
}

.fb-intake-form .fb-journey-secondary {
    margin: var(--space-2) 0;
}

.fb-intake-form .vds-expand-panel__actions {
    margin-top: var(--space-3);
}

.fb-intake-form .vds-expand-panel__actions--primary {
    gap: var(--space-2);
}

.fb-journey-nav-fold {
    margin: 0;
}

.fb-journey-nav-fold__summary {
    cursor: pointer;
    list-style: none;
    font-size: var(--font-small);
    font-weight: var(--weight-semibold);
    padding: 0.4rem 0.15rem;
}

.fb-journey-nav-fold__summary::-webkit-details-marker {
    display: none;
}

.fb-journey-workspace__assessment > .vds-section__header {
    margin-bottom: var(--space-2);
}

.fb-intake-question__lead {
    margin: 0 0 var(--space-2);
    color: var(--text-muted);
    font-size: var(--font-small);
}

@media (min-width: 992px) {
    .fb-journey-workspace {
        grid-template-columns: minmax(0, 7fr) minmax(13rem, 3fr);
    }

    .fb-journey-workspace__aside {
        position: sticky;
        top: calc(var(--topbar-height, 3.625rem) + var(--space-3));
        max-height: calc(100vh - var(--topbar-height, 3.625rem) - var(--space-4));
        overflow: auto;
    }

    .fb-journey-nav-fold > summary {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .fb-journey-nav-fold > .fb-journey-nav {
        display: block !important;
    }
}

@media (max-width: 991.98px) {
    .fb-journey-workspace {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
    }

    .fb-journey-workspace__aside {
        order: 0;
        position: sticky;
        bottom: 0;
        z-index: 4;
        background: var(--surface, #fff);
        border-top: 1px solid var(--border);
    }

    .fb-journey-nav--rail {
        padding: var(--space-2) 0 0;
        box-shadow: none;
    }

    .fb-journey-nav--rail .fb-journey-nav__list {
        flex-direction: column;
        gap: 0.125rem;
    }
}

.fb-intake-question {
    margin: 0 0 var(--space-2);
    font-size: var(--font-section-title);
}

.fb-intake-answers {
    margin: 0;
    padding: 0;
    border: 0;
}

/*
 * Compact EHR-style choice list (Yes/No, single, multiple, Not known /
 * Not assessed / Not applicable / Other). Target ~32px rows and 3px gaps.
 * Font size is unchanged. Scoped to the answer fieldset so start-intake
 * select forms keep normal .vds-stack spacing.
 */
fieldset.fb-intake-answers {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-inline-size: 0;
    width: 100%;
}

.fb-intake-answers > legend {
    padding: 0;
    margin: 0 0 var(--space-1);
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    line-height: 1.3;
}

.fb-intake-answers .vds-field--radio,
.fb-intake-answers .vds-field--checkbox {
    display: flex;
    margin: 0;
    padding: 0;
    min-height: 0;
    line-height: 1.25;
}

.fb-intake-answers .vds-field--radio + .vds-field--radio,
.fb-intake-answers .vds-field--checkbox + .vds-field--checkbox,
.fb-intake-answers .vds-field--radio + .vds-field--checkbox,
.fb-intake-answers .vds-field--checkbox + .vds-field--radio {
    margin-top: 0.1875rem; /* 3px between answer rows */
}

.fb-intake-answers .vds-radio-label,
.fb-intake-answers .vds-checkbox-label {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 2rem; /* 32px row; grows if a label wraps */
    margin: 0;
    padding: 0.3125rem 0.5rem; /* 5px 8px */
    gap: var(--space-2);
    border-radius: var(--radius-sm, 0.375rem);
    cursor: pointer;
    font-size: var(--font-body);
    line-height: 1.25;
}

.fb-intake-answers .vds-radio-text,
.fb-intake-answers .vds-checkbox-text {
    min-width: 0;
}

.fb-intake-answers .vds-radio,
.fb-intake-answers .vds-checkbox {
    margin: 0;
    flex-shrink: 0;
    align-self: center;
}

.fb-intake-answers .vds-radio-label:has(:checked),
.fb-intake-answers .vds-checkbox-label:has(:checked) {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.fb-intake-answers .vds-radio-label:has(:focus-visible),
.fb-intake-answers .vds-checkbox-label:has(:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.fb-intake-other {
    display: none;
}

.fb-intake-answers:has([value="other"]:checked) .fb-intake-other,
.fb-intake-answers:has(option[value="other"]:checked) .fb-intake-other {
    display: block;
    margin-top: var(--space-1);
}

.fb-programme-stage-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
}

.fb-programme-stage-tile {
    margin: 0;
}

.fb-programme-needs {
    margin: 0;
    padding-left: 1.25rem;
}

.fb-programme-flow {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
    font-size: var(--font-help, 0.95rem);
}

.fb-programme-flow li {
    font-weight: 600;
}

.fb-programme-flow li:not(:last-child)::after {
    content: "↓";
    display: block;
    font-weight: 400;
    color: var(--text-muted);
}

.fb-activity-card {
    margin: 0 0 var(--space-3);
}

.fb-assessment-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
}

.fb-assessment-summary > h3 {
    margin: var(--space-2) 0 0;
    font-size: var(--font-section-title, 1.15rem);
}

.fb-assessment-responses {
    display: grid;
    gap: 0;
    margin: 0;
}

.fb-assessment-response {
    display: grid;
    grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
    gap: var(--space-2) var(--space-4);
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}

.fb-assessment-response dt {
    margin: 0;
    font-weight: var(--weight-semibold);
}

.fb-assessment-response dd {
    margin: 0;
    min-width: 0;
}

.fb-assessment-response dd .vds-help {
    display: block;
    margin-top: 0.15rem;
}

.fb-assessment-considerations {
    margin: 0;
    padding-left: 1.25rem;
}

.fb-assessment-safety {
    margin: 0;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 0.5rem);
}

.fb-assessment-note {
    margin-top: var(--space-2);
}

.fb-programme-overview {
    margin: 0 0 var(--space-4);
}

.fb-programme-overview__header {
    margin: 0 0 var(--space-4);
}

.fb-programme-overview__header > p {
    margin: 0 0 var(--space-2);
}

.fb-programme-overview__identified {
    margin: var(--space-2) 0 0;
}

.fb-programme-stages {
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Working programme: keep heading/intro close to the first stage card. */
body.vb-has-shell .vds-section.fb-programme-working-section,
body.vds-has-shell .vds-section.fb-programme-working-section,
.vds-section.fb-programme-working-section {
    margin-bottom: var(--space-4);
}

.vds-section.fb-programme-working-section > .vds-section__header {
    margin-bottom: var(--space-2);
}

.fb-programme-working {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.fb-programme-working .fb-programme-overview__header {
    margin: 0;
}

.fb-programme-working .fb-programme-overview__header > p:last-child {
    margin-bottom: 0;
}

.fb-programme-working .fb-programme-stages--working {
    margin: 0;
    gap: var(--space-3);
}

.fb-programme-working .fb-programme-enable {
    margin-top: 0;
}

.fb-programme-enablement {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

.fb-programme-enablement__kicker {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: var(--weight-semibold, 600);
    color: var(--text-muted);
}

.fb-programme-enablement__access {
    margin: 0;
}

.fb-programme-enablement--pending {
    border-left-width: 4px;
    border-left-color: var(--warning);
}

.fb-programme-enablement--enabled {
    border-left-width: 4px;
    border-left-color: var(--success);
}

.fb-programme-enablement .fb-programme-enable {
    margin-top: var(--space-1);
}

.fb-programme-working > .fb-journey-secondary {
    margin-top: 0;
}

.fb-programme-stage-card__toolbar .fb-programme-stage__controls {
    margin-top: 0;
}

.fb-journey-nav:has(+ .fb-journey-stage + .fb-programme-working-section) {
    margin: var(--space-2) 0;
}

.fb-journey-stage:has(+ .fb-programme-working-section) {
    margin: 0 0 var(--space-2);
}

.vds-section.fb-programme-working-section > .vds-section-subtitle,
.fb-programme-working-section > .vds-section-subtitle {
    margin: 0 0 var(--space-2);
}

/* Working stages: screenshot two-box layout.
   Header box (summary) and exercise box (panel) are separate components. */
.fb-programme-stages--working {
    gap: var(--space-3);
}

.fb-programme-stages--working .fb-programme-stage-card {
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.fb-programme-stages--working .fb-programme-stage-card__details {
    min-width: 0;
}

.fb-programme-stages--working .fb-programme-stage-card__details[open] {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.fb-programme-stages--working .fb-programme-stage-card__details:not([open]) > .fb-programme-stage-card__panel {
    display: none;
}

.fb-programme-stages--working .fb-programme-stage-card__summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: var(--space-3);
    row-gap: 0.2rem;
    align-items: stretch;
    padding: 0.85rem 1rem;
    background: color-mix(in srgb, var(--primary-soft, rgba(109, 40, 217, 0.1)) 80%, var(--surface, #fff));
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    list-style: none;
    cursor: pointer;
}

.fb-programme-stages--working .fb-programme-stage-card__summary::-webkit-details-marker {
    display: none;
}

.fb-programme-stages--working .fb-programme-stage-card__icon {
    grid-column: 1;
    grid-row: 1 / span 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-top: 0.1rem;
    border: 2px solid var(--primary);
    border-radius: 50%;
    background: var(--surface, #fff);
    color: var(--primary);
    flex-shrink: 0;
}

.fb-programme-stages--working .fb-programme-stage-card__icon .vds-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.fb-programme-stages--working .fb-programme-stage-card__copy {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.fb-programme-stages--working .fb-programme-stage-card__title {
    line-height: 1.25;
}

.fb-programme-stages--working .fb-programme-stage-card__purpose {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    line-height: 1.35;
}

.fb-programme-stages--working .fb-programme-stage-card__counts {
    margin-top: 0.15rem;
    line-height: 1.3;
    font-weight: var(--weight-semibold);
    color: var(--text, #2b2440);
}

.fb-programme-stages--working .fb-programme-stage-card__aside {
    grid-column: 3;
    grid-row: 1 / span 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.55rem;
}

.fb-programme-stages--working .fb-programme-stage-card__toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

.fb-programme-stages--working .fb-programme-stage-card__toolbar .vds-action-cluster,
.fb-programme-stages--working .fb-programme-stage-card__toolbar .fb-programme-stage__controls {
    margin: 0;
    gap: var(--space-2);
}

.fb-programme-stages--working .fb-programme-stage-card__expand {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 600;
    color: var(--text, #2b2440);
    white-space: nowrap;
}

.fb-programme-stages--working .fb-programme-stage-card__expand-open {
    display: none;
}

.fb-programme-stages--working .fb-programme-stage-card__details[open] .fb-programme-stage-card__expand-closed {
    display: none;
}

.fb-programme-stages--working .fb-programme-stage-card__details[open] .fb-programme-stage-card__expand-open {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.fb-programme-stages--working .fb-programme-stage-card__panel {
    margin-top: 0;
    padding: 1rem 1.1rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    box-shadow: none;
}

.fb-programme-stages--working .fb-programme-activities {
    gap: 0;
}

.fb-programme-stages--working .fb-programme-limb-heading {
    margin: 0.85rem 0 0.35rem;
    padding: 0;
    border: 0;
}

.fb-programme-stages--working .fb-programme-limb-heading:first-child {
    margin-top: 0;
}

.fb-programme-stages--working .fb-programme-activity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: var(--space-3);
    align-items: start;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
}

.fb-programme-stages--working .fb-programme-limb-heading + .fb-programme-activity {
    border-top: 0;
    padding-top: 0.4rem;
}

.fb-programme-stages--working .fb-programme-activity:first-child {
    border-top: 0;
    padding-top: 0;
}

.fb-programme-stages--working .fb-programme-activity__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border: 1.5px solid var(--primary);
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary-soft, rgba(109, 40, 217, 0.1)) 70%, var(--surface, #fff));
    color: var(--primary);
}

.fb-programme-stages--working .fb-programme-activity__main {
    min-width: 0;
}

.fb-programme-stages--working .fb-programme-activity__name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem var(--space-2);
    margin: 0;
}

.fb-programme-stages--working .fb-programme-activity__actions {
    margin: 0;
    justify-content: flex-end;
}

.fb-programme-stages--working .fb-programme-activity__latest {
    margin-top: 0.35rem;
}

@media (max-width: 767.98px) {
    .fb-programme-stages--working .fb-programme-stage-card__summary {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .fb-programme-stages--working .fb-programme-stage-card__icon {
        grid-row: 1;
    }

    .fb-programme-stages--working .fb-programme-stage-card__copy {
        grid-column: 2;
    }

    .fb-programme-stages--working .fb-programme-stage-card__aside {
        grid-column: 1 / -1;
        grid-row: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        margin-top: 0.35rem;
    }

    .fb-programme-stages--working .fb-programme-activity {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .fb-programme-stages--working .fb-programme-activity__actions {
        grid-column: 2;
        justify-content: flex-start;
        margin-top: 0.35rem;
    }
}

.fb-programme-stage {
    margin: 0;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface, #fff);
}

.fb-programme-stage__header {
    margin: 0 0 var(--space-3);
}

.fb-programme-stage__kicker {
    margin: 0 0 var(--space-1);
    font-size: var(--font-help, 0.95rem);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}

.fb-programme-stage__header h3 {
    margin: 0 0 var(--space-1);
    font-size: var(--font-section-title, 1.15rem);
}

.fb-programme-activities {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.fb-programme-activity {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--border);
}

.fb-programme-limb-heading {
    list-style: none;
    margin: var(--space-3) 0 0;
    padding: var(--space-2) 0 0;
    border-top: 1px solid var(--border);
}

.fb-programme-limb-heading:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.fb-programme-limb-heading h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-strong, #151225);
}

.fb-programme-activity__body {
    min-width: 0;
    flex: 1 1 14rem;
}

.fb-programme-activity__name {
    margin: 0 0 0.15rem;
}

.fb-programme-activity__amount {
    margin: 0.15rem 0 0;
    font-size: 0.95rem;
}

.fb-programme-activity__practice {
    margin-top: var(--space-2);
}

.fb-programme-activity__practice > summary {
    cursor: pointer;
    font-weight: 600;
}

.fb-programme-activity__practice-form {
    margin-top: var(--space-2);
}

.fb-programme-activity__purpose {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--font-help, 0.95rem);
}

.fb-programme-stage__controls,
.fb-programme-activity__actions {
    margin-top: var(--space-2);
    flex: 0 0 auto;
}

.fb-programme-inline-action {
    display: inline-block;
    margin: 0;
}

.fb-programme-stage__review {
    margin-top: var(--space-3);
}

.fb-programme-assigned {
    margin: var(--space-4) 0;
}

.fb-programme-item-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem) auto;
    gap: var(--space-2);
    align-items: end;
    margin: 0 0 var(--space-3);
}

.fb-programme-item-control > p {
    margin: 0;
}

.fb-programme-enable {
    margin-top: var(--space-4);
}

.fb-programme-stage-card {
    margin: 0;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface, #fff);
}

.fb-programme-stage-card__toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 var(--space-2);
}

.fb-programme-stage-card__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    cursor: pointer;
    list-style: none;
}

.fb-programme-stage-card__summary::-webkit-details-marker {
    display: none;
}

.fb-programme-stage-card__copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.fb-programme-stage-card__title {
    font-size: 1.1rem;
    font-weight: 650;
}

.fb-programme-stage-card__purpose,
.fb-programme-stage-card__counts {
    color: var(--text-muted, #5b5670);
    font-size: var(--font-help, 0.95rem);
}

.fb-programme-stage-card__expand {
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--text, #2b2440);
}

.fb-programme-stage-card__panel {
    margin-top: var(--space-3);
}

.fb-programme-stage-card__order {
    margin: 0 0 var(--space-3);
}

.fb-programme-activity__latest {
    margin: var(--space-2) 0 0;
}

.fb-programme-activity__latest-kicker,
.fb-programme-activity__latest-empty {
    margin: 0.35rem 0 0;
    color: var(--text-muted, #5b5670);
    font-size: var(--font-help, 0.95rem);
}

.fb-programme-activity__latest blockquote {
    margin: 0.35rem 0 0;
    padding: 0;
    border: 0;
}

@media (max-width: 767.98px) {
    .fb-programme-stage-card__summary {
        flex-direction: column;
    }
}

@media (max-width: 1024px) {
    .fb-assessment-response {
        grid-template-columns: 1fr;
        gap: 0.15rem var(--space-2);
    }

    .fb-programme-item-control {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .fb-programme-stage {
        padding: var(--space-3);
    }
}

.fb-activity-media {
    margin: 0 0 var(--space-3);
}

.fb-media-unavailable {
    margin: 0 0 var(--space-3);
    color: var(--text-muted);
    font-size: var(--font-help, 0.95rem);
}

@media (max-width: 767.98px) {
    .fb-journey-nav:not(.fb-journey-nav--rail) .fb-journey-nav__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


