/**
 * Clinical rehabilitation programme dashboards (Phase 0 visual — match approved mockups).
 * Tokens from variables.css only.
 */

/* —— Shared —— */
.fb-rehab {
    --fb-rehab-purple: var(--primary);
    --fb-rehab-purple-soft: var(--primary-soft);
    --fb-rehab-radius: var(--radius-panel, 0.5rem);
}

.fb-rehab-layout {
    display: grid;
    gap: var(--space-6);
    align-items: start;
}

@media (min-width: 992px) {
    .fb-rehab-layout {
        grid-template-columns: minmax(0, 1.65fr) minmax(17rem, 0.9fr);
    }
}

.fb-rehab-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--fb-rehab-radius);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
}

.fb-rehab-card__title {
    margin: 0 0 var(--space-4);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.fb-rehab-card--recommend .fb-rehab-card__title {
    margin-bottom: var(--space-3);
}

.fb-rec__stage {
    margin: 0 0 var(--space-1);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.01em;
}

.fb-rec__stage--compact {
    font-size: 0.95rem;
}

.fb-rec__position {
    margin: 0 0 var(--space-2);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.fb-rec__module {
    margin: 0 0 var(--space-2);
    font-size: 1.25rem;
    line-height: 1.35;
    color: var(--text);
}

.fb-rec__reason {
    margin: 0 0 var(--space-4);
    color: var(--text-muted);
    line-height: 1.45;
}

.fb-rec__status {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-md, 0.5rem);
    background: rgba(91, 33, 182, 0.08);
    color: var(--text);
    font-weight: 600;
    line-height: 1.35;
}

.fb-rehab-back {
    margin-bottom: var(--space-4);
}

/* —— Therapist stage board —— */
.fb-stage-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.fb-stage {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--fb-rehab-radius);
    padding: var(--space-4) var(--space-5);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fb-stage--current {
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 var(--primary);
}

.fb-stage--ready {
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--primary) 55%, transparent);
}

/* Therapist only: ENABLED / AVAILABLE TO PATIENT (not Current, not Completed). */
.fb-stage--therapist.fb-stage--available {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--primary) 48%, transparent);
    background: color-mix(in srgb, var(--primary-soft, #ede9fe) 28%, var(--surface));
}

.fb-stage--therapist.fb-stage--current {
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 var(--primary);
    background: var(--surface);
}

.fb-stage--therapist.fb-stage--completed {
    border-color: var(--border);
    box-shadow: none;
    background: var(--surface);
}

.fb-stage--planned {
    border-color: var(--border);
}

.fb-stage--therapist.fb-stage--planned {
    background: var(--surface);
    opacity: 1;
    border-color: color-mix(in srgb, var(--border) 85%, var(--text-muted));
}

.fb-stage--completed {
    border-color: var(--border);
}

.fb-stage--locked {
    background: var(--surface-muted);
    opacity: 0.92;
}

.fb-stage--therapist.fb-stage--locked {
    background: var(--surface-muted);
    opacity: 0.88;
    box-shadow: none;
}

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

.fb-stage__identity {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    min-width: 0;
}

.fb-stage__num {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.fb-stage__num--on {
    background: var(--success);
    border-color: var(--success);
    color: var(--text-inverse);
}

.fb-stage__num--current {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}

.fb-stage__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-strong);
}

.fb-stage__meta {
    margin: 0.15rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.fb-stage__practice-mode,
.fb-practice-mode-note {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

.fb-practice-mode-note {
    margin-top: 0.35rem;
}

.fb-stage-complete-note {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
    background: color-mix(in srgb, var(--primary) 8%, #fff);
    color: var(--text-strong, #1f2937);
}

.fb-stage-complete-note p {
    font-size: 0.95rem;
    line-height: 1.45;
}

.fb-stage-complete-note__action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.fb-stage-complete-note__btn {
    display: inline-flex;
    flex-shrink: 0;
    white-space: nowrap;
}

.fb-partner-tip {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 0.35rem 0.85rem 0.55rem;
}

.fb-partner-tip__summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    list-style: none;
}

.fb-partner-tip__summary::-webkit-details-marker {
    display: none;
}

.fb-partner-tip__summary::before {
    content: "+ ";
    font-weight: 700;
    color: var(--primary);
}

.fb-partner-tip[open] .fb-partner-tip__summary::before {
    content: "– ";
}

.fb-partner-tip__body {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border, #e5e7eb);
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-strong, #1f2937);
}

.fb-stage__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.fb-stage-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.fb-stage-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.fb-stage-toggle__track {
    width: 2.75rem;
    height: 1.5rem;
    border-radius: var(--radius-full);
    background: var(--border-strong);
    position: relative;
    transition: background 0.15s ease;
    cursor: pointer;
}

.fb-stage-toggle__track::after {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: var(--radius-full);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease;
}

.fb-stage-toggle input:checked + .fb-stage-toggle__track {
    background: var(--primary);
}

.fb-stage-toggle input:checked + .fb-stage-toggle__track::after {
    transform: translateX(1.25rem);
}

.fb-stage-toggle input:focus-visible + .fb-stage-toggle__track {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.fb-stage__modules {
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: 0;
}

.fb-stage__modules li {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border-subtle);
}

/* Patient Home — stage boxes with module rows inside */
.fb-stage-list--patient {
    gap: var(--space-4);
}

.fb-stage-complete {
    padding: var(--space-3) var(--space-4);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--success-soft) 70%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--success) 25%, var(--border));
}

.fb-stage-complete__stats {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-primary);
    font-size: 0.925rem;
}

.fb-stage-complete__stats li {
    margin-bottom: 0.25rem;
}

.fb-stage__summary {
    list-style: none;
    cursor: pointer;
    display: block;
    margin: calc(var(--space-4) * -1) calc(var(--space-5) * -1);
    padding: var(--space-4) var(--space-5);
    min-height: 3.25rem;
    border-radius: var(--fb-rehab-radius);
}

.fb-stage__summary::-webkit-details-marker {
    display: none;
}

.fb-stage__summary::marker {
    content: '';
}

.fb-stage__summary:focus {
    outline: none;
}

.fb-stage__summary:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.fb-stage__summary .fb-stage__head {
    width: 100%;
}

.fb-stage__toggle-hint {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-brand, var(--primary));
}

.fb-stage__head--completed {
    align-items: flex-start;
}

.fb-stage__head--completed .fb-stage__identity {
    width: 100%;
    align-items: flex-start;
}

.fb-stage__copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.fb-stage__title-row,
.fb-stage__meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-3);
}

.fb-stage__title-row .fb-stage__title {
    margin: 0;
    flex: 1 1 10rem;
    min-width: 0;
}

.fb-stage__meta-row .fb-stage__meta {
    margin: 0;
    flex: 1 1 8rem;
    min-width: 0;
}

/* Practice Again is a stage-level action — visible only when the card is expanded. */
.fb-stage__practice-again {
    display: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.fb-stage[open] > .fb-stage__summary .fb-stage__practice-again {
    display: inline-flex;
}

.fb-stage__toggle-hint--open {
    display: none;
}

.fb-stage[open] > .fb-stage__summary .fb-stage__toggle-hint--closed {
    display: none;
}

.fb-stage[open] > .fb-stage__summary .fb-stage__toggle-hint--open {
    display: inline;
}

.fb-stage__chevron {
    font-size: 1rem;
    transition: transform 150ms ease;
}

.fb-stage[open] > .fb-stage__summary .fb-stage__chevron {
    transform: rotate(180deg);
}

.fb-stage-list--therapist {
    gap: var(--space-4);
}

.fb-stage--next {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}

.fb-stage--paused {
    border-color: color-mix(in srgb, var(--warning, #b45309) 40%, var(--border));
    background: color-mix(in srgb, var(--warning-soft) 55%, var(--surface));
}

.fb-status-paused {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--warning, #b45309);
}

.fb-stage__body {
    padding-top: var(--space-2);
}


.fb-stage__you {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.fb-module-list--in-stage {
    margin-top: var(--space-3);
}

.fb-module-list--in-stage > li:first-child {
    border-top: 1px solid var(--border-subtle);
}

.fb-mod-name {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: var(--text-primary);
}

.fb-mod-name i {
    color: var(--primary);
}

.fb-mod-curriculum {
    display: block;
    margin: 0.15rem 0 0 1.5rem;
    font-weight: 500;
}

.fb-mod-lock {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-3);
}

/* Therapist sidebar — stacked panels keep their own height */
.fb-rehab-side {
    display: flex;
    flex-direction: column;
    align-self: start;
    gap: var(--space-4);
}

/* Therapist Patient Progress — compact summary tiles (no percentage ring). */
.fb-progress-panel .fb-rehab-card__title {
    margin-bottom: var(--space-3);
}

.fb-progress-focus {
    margin-bottom: var(--space-3);
}

.fb-progress-focus__label {
    margin: 0 0 0.15rem;
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.fb-progress-focus__title {
    margin: 0 0 var(--space-2);
    font-size: 1.05rem;
    font-weight: var(--weight-bold);
    color: var(--text-strong);
    line-height: var(--line-height-tight);
}

.fb-progress-focus__badge {
    margin: 0;
}

.fb-progress-focus__note {
    margin: var(--space-2) 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.fb-progress-summary-label {
    margin: 0 0 var(--space-2);
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}

.fb-progress-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.fb-progress-tile {
    min-width: 0;
    padding: var(--space-3);
    border: 1px solid color-mix(in srgb, var(--border-subtle) 90%, transparent);
    border-radius: var(--radius-lg);
    background: var(--surface-muted);
    box-shadow: none;
}

.fb-progress-tile__label {
    margin: 0 0 0.2rem;
    font-size: var(--font-label);
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
}

.fb-progress-tile__value {
    margin: 0;
    font-size: 1.125rem;
    font-weight: var(--weight-bold);
    color: var(--primary);
    line-height: var(--line-height-tight);
    word-break: break-word;
}

.fb-progress-tile__meta {
    margin: 0.15rem 0 0;
    font-size: var(--font-label);
    color: var(--text-muted);
}

.fb-rec-callout {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: 0.85rem;
    background: var(--primary-soft);
    color: var(--text-brand);
    font-size: 0.9rem;
}

.fb-rec-callout strong {
    display: block;
    margin-bottom: 0.25rem;
}

.fb-assess-note {
    margin: var(--space-3) 0;
    padding: var(--space-3) var(--space-4);
    border-radius: 0.85rem;
    background: var(--surface-muted);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.fb-bar {
    height: 0.55rem;
    border-radius: var(--radius-full);
    background: var(--surface-muted);
    overflow: hidden;
}

.fb-bar > span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* —— Patient Home —— */
/* Interactive CTA only — empty informational panels use .fb-today-hero--empty */
a.fb-today-hero {
    display: block;
    text-decoration: none;
    color: var(--text-inverse);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-panel, 0.5rem);
    padding: var(--space-5) var(--space-6);
    min-height: 6.75rem;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-6);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

a.fb-today-hero:hover,
a.fb-today-hero:focus-visible {
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(79, 70, 229, 0.38);
    outline: none;
}

a.fb-today-hero:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
    filter: brightness(0.96);
}

a.fb-today-hero:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.fb-today-hero__row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    z-index: 1;
}

.fb-today-hero__copy {
    min-width: 0;
    flex: 1 1 auto;
}

.fb-today-hero__play {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.75rem;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.fb-today-hero__label {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    font-weight: 700;
    line-height: 1.25;
    opacity: 0.95;
}

.fb-today-hero__pathway {
    margin: 0.35rem 0 0;
}

.fb-today-hero__stage {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0.9;
}

.fb-today-hero__module {
    margin: 0.35rem 0 0;
    font-size: clamp(1.35rem, 2.6vw, 1.75rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.fb-today-hero__hint {
    margin: 0.35rem 0 0;
    font-size: 1.05rem;
    opacity: 0.92;
}

.fb-today-hero__action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: 0.85rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.95rem 0.45rem 1rem;
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--primary, #5b21b6);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.fb-today-hero__action-icon {
    font-size: 1.55rem;
    line-height: 1;
}

a.fb-today-hero:hover .fb-today-hero__action,
a.fb-today-hero:focus-visible .fb-today-hero__action {
    background: var(--surface);
    color: var(--primary-strong, #4c1d95);
}

a.fb-today-hero:active .fb-today-hero__action {
    transform: translateY(1px);
}

/* Informational empty Today panel — never inherits CTA hover (white text on light surface) */
.fb-today-hero.fb-today-hero__empty,
.fb-today-hero.fb-today-hero--empty,
.fb-today-hero.fb-today-hero--unfinished,
.fb-today-hero__empty,
.fb-today-hero--empty {
    display: block;
    text-decoration: none;
    border-radius: var(--radius-xl);
    padding: var(--space-6) var(--space-7);
    min-height: 7.5rem;
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: none;
    cursor: default;
    transform: none;
    transition: none;
}

.fb-today-hero.fb-today-hero--unfinished.fb-today-hero--attention {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.fb-today-hero.fb-today-hero__empty:hover,
.fb-today-hero.fb-today-hero__empty:focus,
.fb-today-hero.fb-today-hero__empty:focus-visible,
.fb-today-hero.fb-today-hero--empty:hover,
.fb-today-hero.fb-today-hero--empty:focus,
.fb-today-hero.fb-today-hero--empty:focus-visible,
.fb-today-hero.fb-today-hero--unfinished:hover,
.fb-today-hero.fb-today-hero--unfinished:focus,
.fb-today-hero__empty:hover,
.fb-today-hero__empty:focus,
.fb-today-hero--empty:hover,
.fb-today-hero--empty:focus {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: none;
    transform: none;
    outline: none;
    cursor: default;
}

.fb-today-hero__empty .fb-today-hero__play,
.fb-today-hero--empty .fb-today-hero__play {
    background: var(--primary-soft);
    color: var(--primary);
}

.fb-today-hero__empty .fb-today-hero__label,
.fb-today-hero--empty .fb-today-hero__label {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    opacity: 1;
}

.fb-today-hero__empty .fb-today-hero__hint,
.fb-today-hero--empty .fb-today-hero__hint {
    color: var(--text-muted);
    opacity: 1;
}

.fb-stage-hero {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
    margin-bottom: var(--space-5);
}

.fb-stage-hero__icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--text-inverse);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.fb-stage-hero__eyebrow {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.fb-stage-hero__title {
    margin: 0.2rem 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-strong);
}

.fb-stage-hero__summary {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.fb-module-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fb-module-list > li {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border-subtle);
}

.fb-module-list > li:first-child {
    border-top: 0;
    padding-top: 0;
}

.fb-module-list__main {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    justify-content: space-between;
}

.fb-module-list__left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.fb-module-list__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.fb-module-practice {
    width: 100%;
    max-width: 22rem;
}

.fb-module-practice__label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted, #5c5670);
}

.fb-module-practice__count {
    margin: 0.15rem 0 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-strong);
}

.fb-module-practice__bar {
    height: 0.55rem;
    border-radius: 999px;
    background: #ece8f8;
    overflow: hidden;
}

.fb-module-practice__bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    min-width: 0;
}

.fb-module-practice__status {
    margin: 0.45rem 0 0;
    font-size: 0.9rem;
}

.fb-module-practice--compact {
    margin-top: 0.35rem;
    max-width: 100%;
}

.fb-home-stage-card__practice {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted, #5c5670);
    line-height: 1.35;
}

.fb-home-stage-card__practice-label {
    font-weight: 700;
    color: var(--text-strong);
}

.fb-patient-progress__stage-practice {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted, #5c5670);
}

.fb-patient-progress__stage-practice-label {
    font-weight: 700;
    color: var(--text-strong);
}

.fb-module-list__icon {
    width: 2.75rem;
    height: 2.75rem;
    max-width: 2.75rem;
    max-height: 2.75rem;
    border-radius: var(--radius-md);
    background: #f5f2ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.75rem;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    padding: 0.2rem;
    box-sizing: border-box;
    margin: 0;
}

.fb-module-list__icon img,
.fb-module-list__icon .fb-rehab-media__img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    display: block;
}

.fb-module-list__name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-strong);
}

.fb-status-ok {
    color: var(--success-hover);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.fb-status-progress {
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.fb-achieve-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.fb-achieve-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-muted);
    border-radius: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fb-achieve-list i {
    color: var(--primary);
    font-size: 1.15rem;
}

.fb-achieve-list__thumb {
    width: 2rem;
    height: 2rem;
    max-width: 2rem;
    max-height: 2rem;
    border-radius: 0.55rem;
    overflow: hidden;
    flex: 0 0 2rem;
    background: #f5f2ff;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem;
    box-sizing: border-box;
    margin: 0;
}

.fb-achieve-list__thumb img,
.fb-achieve-list__thumb .fb-rehab-media__img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    display: block;
}

.fb-week-line {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    color: var(--text-muted);
    font-size: 0.925rem;
}

@media (max-width: 575.98px) {
    a.fb-today-hero,
    .fb-today-hero__empty,
    .fb-today-hero--empty {
        padding: var(--space-5);
    }

    .fb-today-hero__action {
        margin-top: 0.75rem;
        font-size: 1rem;
    }

    .fb-stage__head {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    a.fb-today-hero,
    a.fb-today-hero:hover,
    a.fb-today-hero:focus-visible,
    a.fb-today-hero:active {
        transition: none;
        transform: none;
    }
}

/* —— Practice session — page-specific content width (independent of shell gutter) —— */
body.vb-has-shell .vds-page--practice .vds-page-container,
body.vds-has-shell .vds-page--practice .vds-page-container {
    max-width: var(--practice-content-max, 40rem);
    margin-inline: 0;
    margin-right: auto;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Patient live stage-completion: WorkspaceHero omitted via Page::open showHeader=false.
   Use the reclaimed vertical space; avoid leftover header margin / empty top band. */
.vds-page--practice.vds-page--no-header > .vds-page-container {
    padding-top: 0;
}

body.fb-stage-completion.vb-has-shell .vb-main-content,
body.fb-stage-completion.vds-has-shell .vb-main-content {
    padding-top: var(--space-3);
}

.vds-page--practice .vds-section-header__title--page {
    font-size: var(--fb-practice-title-size, 1.4rem);
    margin-bottom: 0;
    letter-spacing: -0.015em;
}

.vds-page--practice .vds-section-header__subtitle {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.vds-page--practice .vds-page-header,
.vds-page--practice .vds-section-header {
    margin-bottom: var(--space-4);
}

.fb-practice-card.vds-card .vds-card__body {
    padding: var(--fb-practice-card-pad-y, var(--space-4)) var(--fb-practice-card-pad-x, var(--space-4));
}

.fb-practice {
    /* Shared chrome scale — phones/tablets use the same recipe, slightly tighter */
    --fb-practice-gap: var(--space-3);
    --fb-practice-title-size: 1.4rem;
    --fb-practice-card-pad-y: var(--space-4);
    --fb-practice-card-pad-x: var(--space-4);
    --fb-practice-progress-track-h: 0.625rem;
    --fb-practice-progress-value-size: 0.9375rem;
    /* Legacy single-prompt (short S1–S3 tasks) */
    --fb-practice-prompt-size: clamp(1.35rem, 2.8vw, 1.65rem);
    --fb-practice-prompt-weight: 800;
    --fb-practice-prompt-line-height: 1.25;
    /* Structured long-language roles — readable, not poster-weight */
    --fb-practice-passage-size: clamp(1.15rem, 2.2vw, 1.35rem);
    --fb-practice-passage-weight: 500;
    --fb-practice-passage-line-height: 1.5;
    --fb-practice-situation-size: clamp(1.15rem, 2.2vw, 1.35rem);
    --fb-practice-situation-weight: 500;
    --fb-practice-situation-line-height: 1.45;
    --fb-practice-question-size: clamp(1.2rem, 2.4vw, 1.45rem);
    --fb-practice-question-weight: 700;
    --fb-practice-question-line-height: 1.4;
    --fb-practice-selected-size: clamp(1.25rem, 2.6vw, 1.5rem);
    --fb-practice-selected-weight: 700;
    --fb-practice-selected-line-height: 1.35;
    --fb-practice-instruction-size: clamp(1rem, 1.6vw, 1.1rem);
    --fb-practice-feedback-size: 1.05rem;
    --fb-practice-option-min-h: 3.25rem;
    --fb-practice-option-pad-y: 0.65rem;
    --fb-practice-option-pad-x: 0.85rem;
    --fb-practice-option-font: 1.1rem;
    --fb-practice-option-radius: 0.85rem;
    --fb-practice-option-gap: var(--space-2);
    --fb-practice-action-min-h: 3rem;
    --fb-practice-action-font: 1rem;
    --fb-practice-nav-min-h: 2.5rem;
    --fb-practice-input-min-h: 3rem;
    --fb-practice-input-font: 1.2rem;
    --fb-practice-check-min-w: 7rem;
    --fb-practice-choice-max-w: 22rem;
    /* Rem-first caps (svh enhancement is separate) — never leave images unconstrained */
    --fb-practice-img-max-h: 7.5rem;
    --fb-practice-img-max-w: 14rem;
    --fb-practice-option-img-max-h: 5.75rem;

    display: flex;
    flex-direction: column;
    gap: var(--fb-practice-gap);
    align-items: stretch;
    text-align: left;
}

/* Phones — same layout, slightly smaller controls (still ≥ ~44px touch) */
@media (max-width: 767.98px) {
    .fb-practice {
        --fb-practice-gap: var(--space-3);
        --fb-practice-card-pad-y: var(--space-3);
        --fb-practice-card-pad-x: var(--space-3);
        --fb-practice-progress-track-h: 0.5625rem;
        --fb-practice-progress-value-size: 0.875rem;
        --fb-practice-prompt-size: 1.3rem;
        --fb-practice-passage-size: 1.15rem;
        --fb-practice-situation-size: 1.15rem;
        --fb-practice-question-size: 1.2rem;
        --fb-practice-selected-size: 1.25rem;
        --fb-practice-instruction-size: 1rem;
        --fb-practice-feedback-size: 1rem;
        --fb-practice-option-min-h: 2.875rem;
        --fb-practice-option-pad-y: 0.55rem;
        --fb-practice-option-pad-x: 0.7rem;
        --fb-practice-option-font: 1.05rem;
        --fb-practice-action-min-h: 2.875rem;
        --fb-practice-action-font: 0.95rem;
        --fb-practice-nav-min-h: 2.5rem;
        --fb-practice-input-min-h: 2.875rem;
        --fb-practice-input-font: 1.1rem;
        --fb-practice-check-min-w: 6.25rem;
        --fb-practice-img-max-h: 6.75rem;
        --fb-practice-option-img-max-h: 4.75rem;
    }
}

/* Phones in landscape / short viewports — keep room for answers */
@media (max-height: 520px), (orientation: landscape) and (max-height: 640px) {
    .fb-practice {
        --fb-practice-gap: var(--space-2);
        --fb-practice-option-min-h: 2.75rem;
        --fb-practice-option-pad-y: 0.45rem;
        --fb-practice-action-min-h: 2.75rem;
        --fb-practice-input-min-h: 2.75rem;
        --fb-practice-img-max-h: 5.5rem;
        --fb-practice-option-img-max-h: 4.25rem;
    }
}

/* Small / standard tablets — desktop look, modest scale */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .fb-practice {
        --fb-practice-option-min-h: 3.1rem;
        --fb-practice-option-font: 1.08rem;
        --fb-practice-action-min-h: 2.95rem;
        --fb-practice-img-max-h: 6.25rem;
        --fb-practice-img-max-w: 11rem;
        --fb-practice-option-img-max-h: 4.75rem;
    }
}

/* Large tablets / laptops / desktop */
@media (min-width: 1200px) {
    .fb-practice {
        --fb-practice-img-max-h: 8rem;
        --fb-practice-img-max-w: 14rem;
        --fb-practice-option-img-max-h: 5.5rem;
    }
}

/* Progressive enhancement only — never the sole max-height source */
@supports (height: 1svh) {
    .fb-practice {
        --fb-practice-img-max-h: min(26svh, 7.5rem);
        --fb-practice-option-img-max-h: min(18svh, 5.75rem);
    }

    @media (min-width: 768px) and (max-width: 1199.98px) {
        .fb-practice {
            --fb-practice-img-max-h: min(20svh, 6.25rem);
            --fb-practice-option-img-max-h: min(15svh, 4.75rem);
        }
    }

    @media (min-width: 1200px) {
        .fb-practice {
            --fb-practice-img-max-h: min(22svh, 8rem);
            --fb-practice-option-img-max-h: min(16svh, 5.5rem);
        }
    }

    @media (max-height: 640px) and (orientation: landscape) {
        .fb-practice {
            --fb-practice-img-max-h: min(22svh, 5.5rem);
            --fb-practice-option-img-max-h: min(16svh, 4.25rem);
        }
    }
}

/*
 * Practice progress — standard across all rehab activities.
 * Layout: full-width track + percentage on the same baseline (right).
 * Chosen over floating / mid-fill labels for stable alignment and readability.
 */
.fb-practice__progress {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.fb-practice__progress-track {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--fb-practice-progress-track-h, 0.625rem);
    border-radius: var(--radius-full, 999px);
    background: var(--surface-muted, #e8e4f3);
    overflow: hidden;
}

.fb-practice__progress-bar {
    display: block;
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.fb-practice__progress-value {
    flex: 0 0 auto;
    min-width: 2.75rem;
    margin: 0;
    padding: 0;
    font-size: var(--fb-practice-progress-value-size, 0.9375rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.01em;
    text-align: right;
    color: var(--text-strong);
    white-space: nowrap;
}

/* Standard Patient Activity Shell — progress → journey → title → instruction → task */
.fb-practice__chrome,
.fb-practice__header {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
}

.fb-practice__body {
    display: flex;
    flex-direction: column;
    gap: var(--fb-practice-gap);
    margin: 0;
    padding: 0;
}

.fb-practice__copy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    max-width: 36rem;
}

.fb-practice__sim-note {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}

/* Programme location — quiet CONTEXT; never compete with clinical TASK */
.fb-practice__journey {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0 0 0.35rem;
}

.fb-practice__journey-stage {
    margin: 0;
    font-size: var(--fb-practice-journey-stage-size, 0.8125rem);
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-muted, #64748b);
}

.fb-practice__journey-module {
    margin: 0;
    font-size: var(--fb-practice-journey-module-size, 0.9rem);
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary, #334155);
}

.fb-practice__journey-step,
.fb-practice__journey-bank {
    margin: 0;
    font-size: var(--fb-practice-journey-step-size, 0.8125rem);
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-muted, #64748b);
}

.fb-practice__journey-gate {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    max-width: 28rem;
    padding: 0.25rem 0 0.5rem;
}

.fb-practice__journey-gate-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-strong, #0f172a);
}

.fb-practice__journey-gate-body,
.fb-practice__journey-gate-line {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary, #334155);
}

.fb-practice__journey-gate-form {
    margin: 0.5rem 0 0;
}

.fb-patient-progress__module-journey {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-muted, #64748b);
}

/* Authored patient prompt — short/simple activities (backward compatible) */
.fb-practice__prompt,
.fb-practice__task {
    margin: 0.25rem 0 0;
    font-family: inherit;
    font-size: var(--fb-practice-prompt-size);
    font-weight: var(--fb-practice-prompt-weight, 800);
    color: var(--text-strong);
    line-height: var(--fb-practice-prompt-line-height, 1.25);
    letter-spacing: -0.01em;
    white-space: pre-line;
}

/* Structured clinical language (situation / passage / question) */
.fb-practice__language {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.35rem 0 0;
    max-width: 100%;
}

.fb-practice__passage,
.fb-practice__situation {
    margin: 0;
    font-family: inherit;
    color: var(--text-primary, #334155);
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.fb-practice__passage {
    font-size: var(--fb-practice-passage-size);
    font-weight: var(--fb-practice-passage-weight, 500);
    line-height: var(--fb-practice-passage-line-height, 1.5);
}

.fb-practice__situation {
    font-size: var(--fb-practice-situation-size);
    font-weight: var(--fb-practice-situation-weight, 500);
    line-height: var(--fb-practice-situation-line-height, 1.45);
}

/* Quiet goal context (Stage 8 Conversation Scripts) — supports, does not compete */
.fb-practice__goal {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0;
}

.fb-practice__goal-label,
.fb-practice__turns-label {
    margin: 0;
    font-size: clamp(0.78rem, 1.8vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-muted, #64748b);
    line-height: 1.3;
}

.fb-practice__goal-text {
    margin: 0;
    font-size: clamp(0.95rem, 2.2vw, 1.1rem);
    font-weight: 500;
    color: var(--text-primary, #334155);
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Speaker turns — scannable lines (“You: …”), not chat bubbles */
.fb-practice__turns {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.15rem 0 0;
}

.fb-practice__turn {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0;
}

/* Phase 259 — speaker labels match dialogue size; weight/colour distinguish role */
.fb-practice__turn-speaker {
    margin: 0;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: var(--fb-practice-situation-size);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: var(--fb-practice-situation-line-height, 1.45);
    color: var(--text-muted, #64748b);
}

.fb-practice__turn-text {
    margin: 0;
    flex: 1 1 12rem;
    min-width: 0;
    font-size: var(--fb-practice-situation-size);
    font-weight: var(--fb-practice-situation-weight, 500);
    line-height: var(--fb-practice-situation-line-height, 1.45);
    color: var(--text-primary, #334155);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.fb-practice__assist--inline {
    margin: 0.15rem 0 0.1rem;
}

.fb-practice__question {
    margin: 0;
    font-family: inherit;
    font-size: var(--fb-practice-question-size);
    font-weight: var(--fb-practice-question-weight, 700);
    line-height: var(--fb-practice-question-line-height, 1.4);
    color: var(--text-strong);
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Primary task stands after Hear / stimulus */
.fb-practice__language[data-fb-language-order="stimulus-then-task"] .fb-practice__question {
    margin-top: 0.35rem;
}

/* Phase 104D — three cognitive zones (S8 opt-in; quiet context → grouped stimulus → dominant action) */
.fb-practice--three-zone .fb-practice__language--three-zone {
    gap: 1rem;
}

.fb-practice__zone {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.fb-practice__zone--context {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fb-practice--three-zone .fb-practice__zone--context .fb-practice__goal-text {
    font-weight: 500;
    color: var(--text-muted, #64748b);
}

/* Stage 9 — opening context above the white activity card (shared practice frame) */
.fb-practice-opening {
    margin: 0 0 var(--space-3);
    padding: 0 var(--fb-practice-card-pad-x, var(--space-4));
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.fb-practice-opening__text {
    margin: 0;
    font-size: clamp(1.15rem, 2.4vw, 1.35rem);
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.fb-practice--context-above-card .fb-practice__language--three-zone {
    /* Context already above the card — keep stimulus/action spacing intact */
    gap: 1rem;
}

.fb-practice__zone--stimulus {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.65rem;
    background: color-mix(in srgb, var(--surface-muted, #f1f5f9) 88%, transparent);
    border-left: 3px solid color-mix(in srgb, var(--border-subtle, #cbd5e1) 90%, var(--primary, #6d28d9) 10%);
}

.fb-practice__zone--stimulus .fb-practice__turns {
    margin: 0;
    gap: 0.4rem;
}

.fb-practice__zone--stimulus .fb-practice__assist--inline {
    margin: 0.1rem 0 0;
}

.fb-practice__zone--action {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.85rem 0 0;
    padding: 0.15rem 0 0;
}

.fb-practice--three-zone .fb-practice__zone--action .fb-practice__question {
    margin: 0;
    font-size: clamp(1.2rem, 2.8vw, 1.4rem);
    font-weight: 800;
    letter-spacing: -0.015em;
}

.fb-practice--three-zone .fb-practice__zone--action .fb-practice__response {
    margin-top: 0;
}

@supports not (background: color-mix(in srgb, white 50%, black)) {
    .fb-practice__zone--stimulus {
        background: #f8fafc;
        border-left: 3px solid #cbd5e1;
    }
}

.fb-practice__selected {
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fb-practice__selected-label {
    margin: 0;
    font-size: var(--fb-practice-instruction-size);
    font-weight: 600;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.fb-practice__selected-value {
    margin: 0;
    font-family: inherit;
    font-size: var(--fb-practice-selected-size);
    font-weight: var(--fb-practice-selected-weight, 700);
    line-height: var(--fb-practice-selected-line-height, 1.35);
    color: var(--text-strong);
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.fb-practice--structured .fb-practice__language + .fb-practice__assist,
.fb-practice__selected + .fb-practice__feedback,
.fb-practice__feedback + .fb-practice__selected {
    margin-top: 0.5rem;
}

/* Construction: task instruction before sentence frame */
.fb-practice__language[data-fb-language-order="task-then-stimulus"] .fb-practice__question {
    margin-bottom: 0.35rem;
}

.fb-practice__assist {
    margin: 0.35rem 0 0;
}

.fb-practice__empty,
.fb-practice__speaking-hint,
.fb-practice__utility-hint {
    margin: 0;
    font-size: var(--fb-practice-instruction-size);
    color: var(--text-muted, #64748b);
    line-height: 1.4;
}

.fb-practice__input-label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: var(--fb-practice-instruction-size);
    font-weight: 600;
    color: var(--text-primary, #334155);
}

/* Standard response layouts (shell-owned; templates must not override) */
.fb-practice__options--single {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--fb-practice-option-gap, var(--space-2));
    max-width: var(--fb-practice-choice-max-w, 22rem);
}

.fb-practice__options--two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--fb-practice-option-gap, var(--space-2));
    max-width: var(--fb-practice-choice-max-w, 22rem);
}

.fb-practice--response-writing .fb-practice__text-row,
.fb-practice--writing .fb-practice__text-row {
    width: 100%;
    max-width: 28rem;
}

/* Written-word stimulus (e.g. Stage 3 R5 word → picture) — large sparse orthography */
.fb-practice__written-word {
    margin: 0.75rem 0 0;
    padding: 0.85rem 1.1rem;
    text-align: center;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--text-strong, #0f172a);
    background: #fff;
    border: 2px solid var(--fb-purple-200, #e9d5ff);
    border-radius: 1rem;
}

/*
 * Picture + written word as one learning concept (Stage 3 Module 3 R2).
 * Hear-word control stays outside this card in the stimulus column.
 */
.fb-practice__learning-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(0.85rem, 3vw, 1.5rem);
    width: 100%;
    max-width: 28rem;
    margin: 0 0 var(--space-3);
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    border: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
    background: color-mix(in srgb, var(--primary) 6%, #fff);
    box-sizing: border-box;
}

.fb-practice__learning-card__picture {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(100%, 11rem);
}

.fb-practice__learning-card__picture .fb-practice-media {
    margin: 0;
}

.fb-practice__learning-card__word {
    flex: 1 1 auto;
    margin: 0;
    min-width: 0;
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--text-strong, #0f172a);
    text-align: left;
}

@media (max-width: 360px) {
    .fb-practice__learning-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .fb-practice__learning-card__word {
        text-align: center;
    }
}

/* Stage 3 retrieval cue — supportive, never louder than the primary prompt */
.fb-practice__cue {
    margin: 0.5rem 0 0;
    font-size: clamp(1.05rem, 2.4vw, 1.25rem);
    font-weight: 600;
    color: var(--fb-purple-700, #5b21b6);
    line-height: 1.35;
}

.fb-practice__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--fb-practice-gap);
    align-items: start;
    min-height: 0;
}

.fb-practice__stimulus {
    min-width: 0;
}

/*
 * Canonical responsive practice media (stimulus + option images).
 * Sizes scale to the live visual viewport — never stretch, never overflow.
 */
.fb-practice-media {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0 0 var(--space-2);
    overflow: hidden;
    text-align: left;
}

.fb-practice-media--option {
    margin: 0;
    flex: 0 1 auto;
    width: auto;
    justify-content: center;
    text-align: center;
}

.fb-practice-media--thumb {
    /* Self-contained — never inherit practice stimulus max sizes */
    width: 2.75rem !important;
    height: 2.75rem !important;
    max-width: 2.75rem !important;
    max-height: 2.75rem !important;
    margin: 0 !important;
    flex: 0 0 2.75rem !important;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.fb-achieve-list__thumb.fb-practice-media--thumb {
    width: 2rem !important;
    height: 2rem !important;
    max-width: 2rem !important;
    max-height: 2rem !important;
    flex-basis: 2rem !important;
}

.fb-practice-media__img {
    display: block;
    width: auto;
    height: auto;
    max-width: var(--fb-practice-img-max-w, 14rem);
    max-height: var(--fb-practice-img-max-h, 7.5rem);
    min-width: 0;
    min-height: 0;
    margin-inline: 0;
    margin-right: auto;
    border-radius: 0.85rem;
    object-fit: contain;
    object-position: left center;
    image-rendering: auto;
    -webkit-user-drag: none;
}

.fb-practice-media--option .fb-practice-media__img {
    max-width: 100%;
    max-height: var(--fb-practice-option-img-max-h, 5.75rem);
    margin-inline: auto;
    border-radius: var(--radius-sm);
    object-position: center;
}

.fb-practice-media--thumb .fb-practice-media__img,
.fb-practice-media--thumb .fb-rehab-media__img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 0.35rem;
    object-position: center;
}

/* Legacy selectors → same system (previews / cached markup) */
.fb-practice__image {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 var(--space-2);
    overflow: hidden;
    text-align: left;
}

.fb-practice__image img,
.fb-practice__option-img {
    display: block;
    width: auto;
    height: auto;
    max-width: var(--fb-practice-img-max-w, 14rem);
    max-height: var(--fb-practice-img-max-h, 7.5rem);
    min-width: 0;
    min-height: 0;
    margin-inline: 0;
    margin-right: auto;
    border-radius: 0.85rem;
    object-fit: contain;
    object-position: left center;
}

.fb-practice__sample {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
    margin: 0 0 var(--space-3);
}

.fb-practice__sample--match {
    padding: 0.75rem 0.85rem;
    border-radius: 0.85rem;
    border: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
    background: color-mix(in srgb, var(--primary) 6%, #fff);
}

.fb-practice__sample-label {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.fb-practice--needs .fb-practice__options--pictures {
    gap: var(--space-3);
}

.fb-practice--needs .fb-practice__option-btn {
    min-height: 8.5rem;
}

.fb-practice__option-img,
.fb-practice--pictures .fb-practice__option-img {
    max-width: 100%;
    max-height: var(--fb-practice-option-img-max-h, 5.75rem);
    margin-inline: auto;
    border-radius: var(--radius-sm);
    object-position: center;
}

.fb-practice__feedback {
    margin: var(--space-2) 0 0;
    font-weight: 700;
    font-size: var(--fb-practice-feedback-size);
}

.fb-practice__feedback.is-correct {
    color: var(--success-hover);
}

.fb-practice__feedback.is-retry {
    color: var(--text-secondary);
}

/* Same flow as desktop on every device (no mobile-only sticky dock) */
.fb-practice__response {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--fb-practice-gap);
    align-items: flex-start;
    justify-content: flex-start;
    position: static;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: transparent;
    box-shadow: none;
    border-top: none;
}

.fb-practice__answer-form,
.fb-practice__options,
.fb-practice__text-row {
    width: 100%;
}

.fb-practice--yesno .fb-practice__options--choice {
    width: 100%;
    max-width: var(--fb-practice-choice-max-w);
    grid-template-columns: 1fr 1fr;
}

.fb-practice--pictures .fb-practice__options--pictures {
    width: 100%;
    max-width: var(--practice-options-max, 28rem);
    grid-template-columns: repeat(2, minmax(0, var(--practice-option-col-max, 13rem)));
    justify-content: start;
    justify-items: stretch;
}

.fb-practice--writing .fb-practice__text-row {
    max-width: 100%;
}

.fb-practice__text-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: stretch;
}

.fb-practice__text-input {
    flex: 1 1 12rem;
    min-height: var(--fb-practice-input-min-h);
    font-size: var(--fb-practice-input-font);
}

.fb-practice__check {
    flex: 0 0 auto;
    min-width: var(--fb-practice-check-min-w);
    min-height: var(--fb-practice-input-min-h);
}

.fb-practice__options {
    display: grid;
    gap: var(--fb-practice-option-gap);
}

/* Desktop-like two-column answers as soon as width allows */
.fb-practice__options--choice {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 359.98px) {
    .fb-practice:not(.fb-practice--yesno) .fb-practice__options--choice {
        grid-template-columns: 1fr;
    }
}

.fb-practice__options--pictures {
    grid-template-columns: 1fr 1fr;
}

.fb-practice__option {
    margin: 0;
    min-width: 0;
}

.fb-practice__option-btn {
    width: 100%;
    min-height: var(--fb-practice-option-min-h);
    padding: var(--fb-practice-option-pad-y) var(--fb-practice-option-pad-x);
    border-radius: var(--fb-practice-option-radius);
    border: 2px solid var(--primary);
    background: var(--surface);
    color: var(--primary);
    font-weight: 700;
    font-size: var(--fb-practice-option-font);
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    min-width: 0;
    overflow: hidden;
}

.fb-practice__option-btn:hover,
.fb-practice__option-btn:focus-visible {
    background: var(--primary-soft);
    outline: none;
}

.fb-practice__option-btn:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.fb-practice__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: flex-start;
}

.fb-practice__actions .vds-btn,
.fb-practice__actions .vds-btn--lg,
.fb-practice__actions .btn,
.fb-practice__actions .btn-lg {
    min-height: var(--fb-practice-action-min-h);
    font-size: var(--fb-practice-action-font);
}

.fb-practice__nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-1);
}

.fb-practice__nav .vds-btn,
.fb-practice__nav .btn {
    min-height: var(--fb-practice-nav-min-h);
}

.fb-practice__stimulus .btn,
.fb-practice__stimulus .vds-btn {
    min-height: var(--fb-practice-nav-min-h);
}

/* ── Patient Home — Speak / Help feature banners ────────────────────────── */
/* Workspace hero size is shared via --workspace-hero-* tokens (no page override). */

.fb-patient-home .vds-section,
.fb-patient-home .vds-card {
    margin-bottom: 0;
}

.fb-patient-home > .vds-section,
.fb-patient-home .fb-today-hero,
.fb-patient-home .fb-stage-list,
.fb-patient-home .fb-patient-encourage,
.fb-patient-home .fb-patient-more {
    margin-top: 0;
}

.fb-home-section-title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-strong, #151225);
}

.fb-home-section-lede {
    margin: 0 0 1.15rem;
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.45;
}

.fb-home-unfinished {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    margin: 0 0 1.15rem;
    color: var(--text);
    font-weight: 650;
}

.fb-home-practice {
    /* Phase 177: direct flow into Recovery Journey (no progress card between). */
    margin: 0 0 2rem;
}

.fb-home-practice-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem 1.25rem;
    align-items: center;
    padding: 1.5rem 1.65rem;
    background: #fff;
    border: 0;
    border-radius: 1.75rem;
    box-shadow: 0 12px 36px rgba(49, 46, 129, 0.07);
    text-decoration: none;
    color: inherit;
}

.fb-home-practice-card--link {
    position: relative;
}

/* Hover / focus come from shared .vds-interactive-surface (sidebar language). */
.fb-home-practice-card--link.vds-interactive-surface--elevated:hover,
.fb-home-practice-card--link.vds-interactive-surface--elevated:focus-visible,
.fb-home-practice-card--link.vds-interactive-surface--elevated:has(:focus-visible) {
    box-shadow: 0 8px 20px rgba(91, 63, 196, 0.14);
}

.fb-home-practice-card__secondary {
    position: relative;
    z-index: 2;
}

.fb-home-practice-card--attention {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent),
        0 12px 36px rgba(49, 46, 129, 0.08);
}

.fb-home-practice-card__icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, #fff);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.fb-home-practice-card__body {
    min-width: 0;
}

.fb-home-practice-card__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}

.fb-home-practice-card__text {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.45;
}

.fb-home-practice-card__text + .fb-home-practice-card__text {
    margin-top: 0.65rem;
}

.fb-home-practice-card__meta {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    padding-top: 0.15rem;
    border-top: 1px solid var(--border-subtle);
}

@media (min-width: 900px) {
    .fb-home-practice-card {
        grid-template-columns: auto minmax(0, 1.4fr) auto auto;
        gap: 1.25rem 1.5rem;
    }

    .fb-home-practice-card__meta {
        grid-column: auto;
        border-top: 0;
        border-left: 1px solid var(--border-subtle);
        padding: 0.25rem 0 0.25rem 1.25rem;
        min-width: 8.5rem;
    }
}

.fb-home-practice-card__cta {
    grid-column: 1 / -1;
}

@media (min-width: 900px) {
    .fb-home-practice-card__cta {
        grid-column: auto;
        justify-self: end;
    }
}

.fb-home-practice-card__cta--split {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.fb-home-practice-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(91, 63, 196, 0.22);
}

.fb-home-practice-card--link:hover .fb-home-practice-card__btn {
    background: var(--primary-hover);
}

.fb-home-stages {
    margin: 0 0 2.5rem;
}

/* Recovery Journey: fixed responsive columns; grow vertically as stages unlock. */
.fb-home-stages__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .fb-home-stages__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.15rem;
    }
}

@media (min-width: 1024px) {
    .fb-home-stages__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.fb-home-discipline-card .fb-home-stage-card__text {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
}

.fb-home-stages__grid.fb-speech-stage-tiles {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: 42rem;
}

.fb-home-stages__grid.fb-speech-stage-tiles--home {
    max-width: none;
    gap: 1rem;
}

@media (min-width: 768px) {
    .fb-home-stages__grid.fb-speech-stage-tiles--home {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .fb-home-stages__grid.fb-speech-stage-tiles--home {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.fb-speech-stage-tiles .fb-home-stage-card {
    padding: 0.9rem 1.05rem 0.85rem;
}

.fb-speech-stage-tiles--home .fb-home-stage-card {
    min-height: 18.5rem;
    padding: 1.25rem 1.2rem 1.15rem;
}

.fb-speech-stage-tiles--home .fb-home-stage-card__text {
    flex: 1 1 auto;
}

.fb-speech-stage-tiles--home .fb-home-stage-card__locked-note {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.fb-speech-stage-detail-back {
    margin: 0 0 0.85rem;
}

.fb-home-stage-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 100%;
    padding: 1.1rem 1.15rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
}

/* Hover / focus come from shared .vds-interactive-surface (sidebar language). */
.fb-home-stage-card.vds-interactive-surface--elevated:hover,
.fb-home-stage-card.vds-interactive-surface--elevated:focus-visible {
    box-shadow: 0 8px 20px rgba(91, 63, 196, 0.14);
}

.fb-home-stage-card--current {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 28%, transparent),
        0 12px 32px rgba(49, 46, 129, 0.08);
}

.fb-home-stage-card--ready,
.fb-home-stage-card--ready-to-start {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent),
        0 10px 28px rgba(49, 46, 129, 0.06);
}

.fb-home-stage-card--current.vds-interactive-surface--elevated:hover,
.fb-home-stage-card--current.vds-interactive-surface--elevated:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 28%, transparent),
        0 8px 20px rgba(91, 63, 196, 0.14);
}

.fb-home-stage-card--ready.vds-interactive-surface--elevated:hover,
.fb-home-stage-card--ready.vds-interactive-surface--elevated:focus-visible,
.fb-home-stage-card--ready-to-start.vds-interactive-surface--elevated:hover,
.fb-home-stage-card--ready-to-start.vds-interactive-surface--elevated:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent),
        0 8px 20px rgba(91, 63, 196, 0.12);
}

.fb-home-stage-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.fb-home-stage-card__icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, #fff);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.fb-home-stage-card__done {
    color: var(--success);
    font-size: 1.25rem;
    line-height: 1;
}

.fb-home-stage-card__current-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    border: 2px dashed var(--primary);
}

.fb-home-stage-card__eyebrow {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.fb-home-stage-card__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}

.fb-home-stage-card__text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 1 1 auto;
}

/* Shared Recovery Journey action invites — colour encodes meaning. */
.fb-stage-practice-panel--home,
.fb-home-stage-card__practice-again,
.fb-home-stage-card__continue,
.fb-home-stage-card__start,
.fb-home-stage-card__unavailable {
    margin: 0.15rem 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    flex: 1 1 auto;
}

/* Completed — practice again: pale yellow */
.fb-home-stage-card__practice-again,
.fb-home-stage-card__practice-again.fb-stage-practice-panel--home {
    background: #fff8e1;
    color: #7a5a00;
}

.fb-home-stage-card--complete:hover .fb-home-stage-card__practice-again,
.fb-home-stage-card--complete:focus-visible .fb-home-stage-card__practice-again {
    background: #ffefc2;
}

/* Current — continue stage: soft blue */
.fb-home-stage-card__continue,
.fb-home-stage-card__continue.fb-stage-practice-panel--home {
    background: #e8f1fb;
    color: #1e4b7a;
}

.fb-home-stage-card--current:hover .fb-home-stage-card__continue,
.fb-home-stage-card--current:focus-visible .fb-home-stage-card__continue {
    background: #d7e8f8;
}

/* Current — start stage (unstarted): soft green */
.fb-home-stage-card__start,
.fb-home-stage-card__start.fb-stage-practice-panel--home {
    background: #e7f6ed;
    color: #1f5c3a;
}

.fb-home-stage-card--current:hover .fb-home-stage-card__start,
.fb-home-stage-card--current:focus-visible .fb-home-stage-card__start {
    background: #d5efdf;
}

/* Locked / Planned / Ready / unavailable: muted warm brown-red */
.fb-home-stage-card__unavailable,
.fb-home-stage-card__unavailable.fb-stage-practice-panel--home {
    background: #f3e8e4;
    color: #7a3e32;
    font-weight: 500;
}

.fb-home-stage-card:hover .fb-home-stage-card__unavailable,
.fb-home-stage-card:focus-visible .fb-home-stage-card__unavailable {
    background: #ead9d3;
}

.fb-stage-practice-panel__action {
    margin: 0;
}

.fb-stage-practice-panel__hint {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
    color: inherit;
    opacity: 0.9;
}

/* Thin divider between description and module/session counts (not a progress meter). */
.fb-home-stage-card__divider {
    display: block;
    width: auto;
    height: 2px;
    margin: 0.85rem 0.35rem;
    border: 0;
    border-radius: 999px;
    background: #d1d5db;
    flex: 0 0 auto;
}

.fb-home-stage-card__divider--complete,
.fb-home-stage-card__divider--progress {
    background: var(--fb-rehab-purple, var(--primary));
}

.fb-home-stage-card__divider--idle {
    background: #d1d5db;
}

.fb-home-stage-card__progress-block {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Legacy progress bar / percent markup — no longer rendered on Home stage cards. */
.fb-home-stage-card__progress,
.fb-home-stage-card__bar,
.fb-home-stage-card__pct {
    display: none;
}

.fb-home-stage-card__status {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.3;
}

.fb-home-stage-card--complete .fb-home-stage-card__status {
    color: var(--success, #15803d);
}

.fb-home-stage-card--current .fb-home-stage-card__status,
.fb-home-stage-card--ready .fb-home-stage-card__status,
.fb-home-stage-card--ready-to-start .fb-home-stage-card__status {
    color: var(--primary);
}

.fb-home-stage-card--paused .fb-home-stage-card__status {
    color: var(--warning, #b45309);
}

.fb-home-stage-card--locked {
    cursor: default;
}

.fb-home-stage-card--locked .fb-home-stage-card__status {
    color: var(--text-secondary);
}

.fb-home-stage-card[aria-disabled="true"] {
    cursor: default;
    box-shadow: var(--shadow-sm);
}

.fb-patient-activity-group {
    margin: 0 0 var(--space-3);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.fb-patient-activity {
    max-width: 42rem;
}

.fb-patient-activity .vds-card__title {
    font-size: 1.35rem;
    line-height: 1.25;
    color: var(--text-strong, #151225);
}

.fb-patient-activity .vds-card__body {
    display: grid;
    gap: 1rem;
}

.fb-patient-activity__purpose,
.fb-patient-activity__how,
.fb-patient-activity__amount,
.fb-patient-activity__help,
.fb-patient-activity__media,
.fb-patient-activity__safety,
.fb-patient-activity__not-right {
    margin: 0;
}

.fb-patient-activity h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-strong, #151225);
}

.fb-patient-activity p {
    margin: 0;
    max-width: 38rem;
    line-height: 1.45;
}

.fb-patient-activity__purpose p {
    font-size: 1.05rem;
}

.fb-patient-activity__how {
    background: var(--surface-muted, #f8f7fb);
    border: 1px solid var(--border, #e4e8f0);
    border-radius: var(--radius-panel, 0.5rem);
    padding: 0.85rem 1rem;
}

.fb-patient-activity__steps {
    margin: 0;
    padding-left: 1.25rem;
}

.fb-patient-activity__steps li + li {
    margin-top: 0.45rem;
}

.fb-patient-activity__safety-alert {
    margin: 0;
}

.fb-patient-activity__figure {
    margin: 0.85rem 0 0;
    max-width: 32rem;
}

.fb-patient-activity__figure + .fb-patient-activity__figure {
    margin-top: 1.35rem;
}

.fb-patient-activity__figure-stage {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-strong, #151225);
}

.fb-patient-activity__figure--has-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 28rem;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #f6f4fb;
    border: 1px solid var(--border, #e4e8f0);
    border-radius: var(--radius-panel, 0.5rem);
}

.fb-patient-activity__figure figcaption {
    margin: 0.45rem 0 0;
    max-width: 38rem;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-secondary, #5c5875);
}

.fb-patient-activity__illustration-note {
    margin: 0.35rem 0 0;
    max-width: 38rem;
    line-height: 1.45;
}

.fb-patient-activity__practice {
    margin: 0;
}

.fb-patient-activity__latest {
    margin: 0 0 0.75rem;
}

.fb-patient-activity__latest:focus {
    outline: 2px solid var(--focus, #6c3ad1);
    outline-offset: 2px;
}

.fb-patient-activity__latest-result,
.fb-patient-activity__latest-kicker {
    margin: 0 0 0.25rem;
}

.fb-patient-activity__latest-note {
    margin: 0.25rem 0;
    padding: 0;
    border: 0;
}

.fb-media-unavailable {
    margin: 0;
    color: var(--text-secondary);
}

.fb-media-unavailable--compact {
    margin: 0.25rem 0 0;
    max-width: 38rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .fb-patient-activity {
        max-width: 100%;
    }

    .fb-patient-activity .vds-card__title {
        font-size: 1.2rem;
    }

    .fb-patient-activity__figure {
        max-width: 100%;
    }

    .fb-patient-activity__figure--has-image img {
        max-height: 18rem;
    }
}

.fb-home-stage-card__count {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
}

.fb-home-stage-card__empty {
    margin: auto 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.35;
}

.fb-home-rehab-discipline {
    margin: 0 0 1.5rem;
}

.fb-home-rehab-discipline > h3,
.fb-home-rehab-discipline-title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-strong, #151225);
}

.fb-home-rehab-actions {
    margin: 0.25rem 0 0;
}

.fb-home-rehab-discipline .fb-programme-stage-tile {
    display: block;
    text-decoration: none;
    color: inherit;
}

@media (max-width: 767px) {
    .fb-home-rehab-discipline .fb-programme-stage-tiles {
        grid-template-columns: 1fr;
    }
}

.fb-home-stages__footer {
    margin: 1.25rem 0 0;
    text-align: center;
}

.fb-home-stages__plan-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.fb-home-stages__plan-link:hover,
.fb-home-stages__plan-link:focus-visible {
    color: var(--primary-hover);
    text-decoration: underline;
}


.fb-patient-home .fb-today-hero,
.fb-patient-home a.fb-today-hero {
    border-radius: 2rem;
    margin-bottom: 2.75rem;
    min-height: 9.5rem;
    padding: 1.85rem 2.1rem;
    box-shadow: 0 12px 36px rgba(49, 46, 129, 0.07);
}

.fb-patient-home .fb-today-hero--empty,
.fb-patient-home .fb-today-hero__empty {
    border: 0;
    background: #fff;
    box-shadow: 0 12px 36px rgba(49, 46, 129, 0.07);
}

.fb-patient-home .fb-stage-list,
.fb-patient-home .fb-stage-list--patient {
    gap: var(--space-5, 1.25rem);
    margin-bottom: var(--space-10, 2.5rem);
}

.fb-patient-home .fb-stage {
    border-radius: var(--radius-panel, 0.5rem);
    border-color: color-mix(in srgb, var(--border-subtle) 90%, transparent);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5, 1.25rem);
}

/* ── Phase 3D — Patient journey calm surfaces ───────────────────────────── */

.fb-patient-encourage {
    padding: var(--space-6, 1.5rem) var(--space-6, 1.5rem);
    border-radius: var(--radius-panel, 0.5rem);
    background: var(--surface, #fff);
    border: 1px solid color-mix(in srgb, var(--border-subtle) 90%, transparent);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-8, 2rem);
}

.fb-patient-encourage__lead {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-strong, #151225);
    margin: 0;
    letter-spacing: -0.01em;
}

.fb-patient-more {
    background: var(--surface, #fff);
    border-color: color-mix(in srgb, var(--border-subtle) 90%, transparent) !important;
    border-radius: var(--radius-panel, 0.5rem) !important;
    box-shadow: var(--shadow-sm);
    padding: var(--space-5, 1.25rem) var(--space-6, 1.5rem);
    margin-bottom: var(--space-8, 2rem);
}

.fb-patient-more > summary {
    cursor: pointer;
    list-style-position: outside;
    padding: 0.15rem 0;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}

.fb-patient-more > summary:focus-visible {
    outline: 3px solid var(--primary-soft, #e9e0fb);
    outline-offset: 2px;
    border-radius: 0.35rem;
}

.fb-practice__more-leave {
    width: 100%;
    margin-top: 0.25rem;
}

.fb-practice__more-leave > summary {
    cursor: pointer;
    color: var(--text-muted, #6b6578);
    font-size: 0.95rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

.fb-practice__more-leave > summary:focus-visible {
    outline: 3px solid var(--primary-soft, #e9e0fb);
    outline-offset: 2px;
    border-radius: 0.35rem;
}

.fb-checkin__question {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-subtle, #e8e4f0);
}

.fb-checkin__question:last-of-type {
    border-bottom: 0;
}

.fb-checkin__options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.fb-checkin__option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.15rem;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--border-subtle, #e8e4f0);
    border-radius: 0.85rem;
    background: var(--surface, #fff);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.fb-checkin__option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft, #f3eefc);
}

.fb-checkin__option:focus-within {
    outline: 3px solid var(--primary-soft, #e9e0fb);
    outline-offset: 2px;
}

.fb-checkin__option input {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Larger patient nav targets — shared shell, patient portal only */
[data-portal="patient"] .vb-nav-link {
    min-height: 3rem;
    font-size: 1.05rem;
}

[data-portal="patient"] .vb-sidebar-profile {
    min-height: 3rem;
}

@media (prefers-reduced-motion: reduce) {
    .fb-practice__option-btn,
    .fb-today-hero {
        transition: none !important;
    }
}

/* ---- Patient Progress roadmap ---- */
.fb-patient-progress__lead {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.fb-patient-progress__roadmap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fb-patient-progress__stage {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.fb-patient-progress__stage--current {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent);
}

.fb-patient-progress__stage--ready {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 10%, transparent);
}

.fb-patient-progress__stage--complete {
    border-color: color-mix(in srgb, var(--success, #15803d) 35%, var(--border));
}

.fb-patient-progress__stage--locked {
    background: color-mix(in srgb, var(--surface-muted) 70%, var(--surface));
    opacity: 0.92;
}

.fb-patient-progress__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem;
    cursor: pointer;
    list-style: none;
}

.fb-patient-progress__summary::-webkit-details-marker,
.fb-patient-progress__summary::marker {
    display: none;
}

.fb-patient-progress__summary:focus {
    outline: none;
}

.fb-patient-progress__summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.fb-patient-progress__summary-main {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    min-width: 0;
    flex: 1 1 auto;
}

.fb-patient-progress__stage-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.95rem;
}

.fb-patient-progress__stage--complete .fb-patient-progress__stage-num {
    background: color-mix(in srgb, var(--success, #15803d) 18%, var(--surface));
    color: var(--success, #15803d);
}

.fb-patient-progress__stage--locked .fb-patient-progress__stage-num {
    background: var(--surface-muted);
    color: var(--text-muted);
}

.fb-patient-progress__summary-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.fb-patient-progress__stage-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-strong);
}

.fb-patient-progress__stage-meta {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* Legacy thick progress bar — replaced by thin divider on patient Progress stages. */
.fb-patient-progress__bar {
    display: none;
}

.fb-patient-progress__divider {
    display: block;
    width: 100%;
    max-width: 18rem;
    height: 2px;
    margin: 0.75rem 0;
    border: 0;
    border-radius: 999px;
    background: #d1d5db;
}

.fb-patient-progress__divider--complete,
.fb-patient-progress__divider--progress {
    background: var(--fb-rehab-purple, var(--primary));
}

.fb-patient-progress__divider--idle {
    background: #d1d5db;
}

.fb-patient-progress__badge {
    margin: 0.45rem 0 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
}

.fb-patient-progress__badge--done {
    color: var(--success, #15803d);
}

.fb-patient-progress__chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 150ms ease;
    margin-top: 0.35rem;
}

.fb-patient-progress__stage[open] > .fb-patient-progress__summary .fb-patient-progress__chevron {
    transform: rotate(180deg);
}

.fb-patient-progress__body {
    padding: 0 1.15rem 1.15rem;
}

.fb-patient-progress__locked-note,
.fb-patient-progress__paused-note,
.fb-patient-progress__empty {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.fb-patient-progress__modules {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.fb-patient-progress__module {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.fb-patient-progress__module--completed {
    border-color: color-mix(in srgb, var(--success, #15803d) 28%, var(--border));
    background: color-mix(in srgb, var(--success, #15803d) 6%, var(--surface));
}

.fb-patient-progress__module--current {
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
    background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

.fb-patient-progress__module--locked {
    background: var(--surface-muted);
    color: var(--text-muted);
}

.fb-patient-progress__module--paused {
    border-color: color-mix(in srgb, var(--warning, #b45309) 35%, var(--border));
}

.fb-patient-progress__module-mark {
    flex-shrink: 0;
    width: 1.5rem;
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.fb-patient-progress__module--completed .fb-patient-progress__module-mark {
    color: var(--success, #15803d);
}

.fb-patient-progress__module--current .fb-patient-progress__module-mark {
    color: var(--primary);
}

.fb-patient-progress__module--locked .fb-patient-progress__module-mark,
.fb-patient-progress__module--available .fb-patient-progress__module-mark {
    color: var(--text-muted);
}

.fb-patient-progress__module-body {
    min-width: 0;
    flex: 1 1 auto;
}

.fb-patient-progress__module-title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.3;
    color: var(--text-strong);
}

.fb-patient-progress__module--locked .fb-patient-progress__module-title {
    color: var(--text-muted);
}

.fb-patient-progress__module-status {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--text-secondary);
}

.fb-patient-progress__module--completed .fb-patient-progress__module-status {
    color: var(--success, #15803d);
}

.fb-patient-progress__module-when {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.fb-patient-progress__module-action {
    margin-top: 0.65rem;
}

.fb-patient-progress__goals {
    margin-top: 1.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    background: var(--surface);
}

.fb-patient-progress__goals-summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-primary);
}

.fb-patient-progress__goals-list {
    margin: 0.75rem 0 0;
    padding-left: 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
    .fb-patient-progress__chevron {
        transition: none;
    }
}

/* Therapist Programme — stage clinical summary (primary rehabilitation record) */
.fb-stage-clinical {
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: var(--radius-md, 0.75rem);
    padding: 0.85rem 1rem;
    background: var(--surface, #fff);
}

.fb-stage-clinical__title {
    margin: 0;
    font-size: 0.95rem;
}

.fb-stage-clinical__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.65rem 1rem;
    margin: 0;
}

.fb-stage-clinical__grid dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: none;
}

.fb-stage-clinical__grid dd {
    margin: 0.15rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.fb-stage-clinical__span {
    grid-column: 1 / -1;
}

.fb-stage-clinical__form {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
}

/* Add New Patient — compact two-column grid, not the inline search toolbar. */
#create-patient,
#create-patient .vds-disclosure__content,
#create-patient [data-create-patient-form],
#create-patient .vds-form-layout {
    max-width: 100%;
    min-width: 0;
}

#create-patient .vds-form-layout {
    --bs-gutter-x: var(--space-5, 1.25rem);
    --bs-gutter-y: var(--space-4, 1rem);
}

#create-patient .vds-form-layout > [class*="col-"] {
    min-width: 0;
    max-width: 100%;
}

#create-patient .vds-form-layout .vds-field,
#create-patient .vds-form-layout .vds-input,
#create-patient .vds-form-layout .vds-select {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    #create-patient .vds-form-layout {
        --bs-gutter-x: var(--space-3, 0.75rem);
        --bs-gutter-y: var(--space-3, 0.75rem);
    }
}

/* Phase 188–190 — therapist care team (read-only)
   Phase 190: expanded care team is a full-width <tr colspan>, not nested in Patient <td>. */
.fb-caseload-patient {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    min-width: 0;
}

.fb-caseload-patient__copy {
    min-width: 0;
    flex: 1 1 auto;
}

.fb-caseload-patient > .vds-avatar {
    margin-top: 0.15rem;
}

/* Caseload Unlink: text-link admin action — quieter than Programme/Progress buttons. */
.vds-row-actions .fb-caseload-unlink-form {
    margin: 0;
    margin-inline-start: var(--space-1);
}
.vds-row-actions .fb-caseload-unlink.vds-btn--link {
    min-height: 0;
    padding: 0.15rem 0;
    font-size: var(--font-caption, 0.8125rem);
    font-weight: var(--weight-medium, 500);
    line-height: 1.2;
    color: var(--text-muted);
    border: 0;
    box-shadow: none;
    white-space: nowrap;
}
.vds-row-actions .fb-caseload-unlink.vds-btn--link:hover,
.vds-row-actions .fb-caseload-unlink.vds-btn--link:focus-visible {
    color: var(--danger);
    background: transparent;
    transform: none;
    box-shadow: none;
}
.vds-row-actions .fb-caseload-unlink.vds-btn--link:focus-visible {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
    border-radius: var(--radius-sm, 0.35rem);
}

.fb-caseload-patient__name {
    display: inline-block;
    max-width: 100%;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--text-strong);
    text-decoration: none;
    font-weight: var(--weight-semibold);
}

.fb-caseload-patient__name:hover,
.fb-caseload-patient__name:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

.fb-care-team {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}

.fb-care-team__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.75rem;
}

.fb-care-team__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    padding: 0.35rem;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    min-height: 2.75rem;
    min-width: 2.75rem;
    flex-shrink: 0;
}

.fb-care-team__toggle:focus-visible,
.fb-caseload-care-team__toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm, 0.35rem);
}

.fb-care-team__toggle-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.fb-care-team__toggle .fb-mdt-panel__title {
    margin: 0;
}

.fb-care-team__chevron {
    color: var(--text-muted);
    transition: transform 0.18s ease;
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1;
}

.fb-care-team.is-expanded .fb-care-team__chevron {
    transform: rotate(180deg);
}

.fb-caseload-care-team.is-expanded .fb-care-team__chevron,
.fb-caseload-summary-row.is-care-team-open .fb-care-team__chevron {
    transform: rotate(180deg);
}

.fb-care-team__panel {
    margin-top: var(--space-3);
    border: 0;
    box-shadow: none;
    background: transparent;
}

.fb-care-team__panel .vds-expand-panel__section {
    padding: 0;
    border-bottom: 0;
}

.fb-care-team__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fb-care-team__member {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.fb-care-team__member:last-child {
    border-bottom: 0;
}

.fb-care-team__member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    min-width: 0;
}

.fb-care-team__member-row .vds-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 0.7rem;
}

.fb-care-team__who {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.fb-care-team__name {
    font-weight: 600;
    color: var(--text);
    min-width: 0;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.fb-care-team__bullet,
.fb-care-team__you-mark {
    display: inline-block;
    width: 1rem;
    text-align: center;
    margin-right: 0.15rem;
}

.fb-care-team__you-badge,
.fb-care-team__aside {
    flex: 0 1 auto;
    max-width: 55%;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: right;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.fb-care-team__you-badge {
    color: var(--primary);
    white-space: nowrap;
}

.fb-care-team__aside {
    color: var(--text-muted);
    font-weight: 500;
}

.fb-care-team__you-mark {
    color: var(--primary);
}

.fb-care-team__role {
    display: block;
    padding-left: 1.2rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.fb-care-team__count {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: var(--font-small, 0.875rem);
}

.fb-care-team__hint {
    margin-top: 0.85rem;
}

/* Compact Care team toggle under patient name; details + email open in a detail row. */
.fb-caseload-care-team {
    margin-top: 0.35rem;
    max-width: 18rem;
}

.fb-caseload-care-team__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 1.75rem;
    margin: 0;
    padding: 0.2rem 0.35rem;
    border-radius: var(--radius-md, 0.5rem);
    border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
    background: color-mix(in srgb, var(--primary) 5%, var(--surface));
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
}

.fb-caseload-care-team__toggle:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.fb-caseload-care-team__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem;
    min-width: 0;
}

.fb-caseload-care-team__label {
    font-weight: 600;
    color: var(--text);
}

.fb-caseload-care-team__meta {
    color: var(--text-muted);
    font-weight: 500;
}

.fb-caseload-patient__email {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--text-muted);
    word-break: break-word;
}

.fb-caseload-patient__email-label {
    font-size: 0.68rem;
    font-weight: var(--weight-bold, 700);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fb-caseload-patient__email-value {
    color: var(--text);
    font-weight: 500;
}

.vds-table-wrap--caseload .vds-table tbody tr.fb-caseload-summary-row > td:first-child {
    vertical-align: top;
    white-space: normal;
}

/* After Programme column removal — give Patient/Progress room; keep actions compact. */
.vds-table-wrap--caseload.vds-table-wrap--methodical .vds-table {
    table-layout: fixed;
    width: 100%;
}
.vds-table-wrap--caseload .vds-table th:nth-child(1),
.vds-table-wrap--caseload .vds-table td:nth-child(1) {
    width: 28%;
    white-space: normal;
}
.vds-table-wrap--caseload .vds-table th:nth-child(2),
.vds-table-wrap--caseload .vds-table td:nth-child(2) {
    width: 36%;
    white-space: normal;
}
.vds-table-wrap--caseload .vds-table th:nth-child(3),
.vds-table-wrap--caseload .vds-table td:nth-child(3) {
    width: 16%;
}
.vds-table-wrap--caseload .vds-table th:nth-child(4),
.vds-table-wrap--caseload .vds-table td:nth-child(4) {
    width: 20%;
    white-space: nowrap;
}

.vds-table-wrap--caseload .vds-table tbody tr.fb-caseload-care-team-row > td {
    white-space: normal !important;
    vertical-align: top;
    text-align: left !important;
    padding: 0;
    border-bottom: 1px solid var(--border-subtle, var(--border));
    background: color-mix(in srgb, var(--primary) 3.5%, var(--surface));
}

.vds-table-wrap--caseload .vds-table tbody tr.fb-caseload-care-team-row:hover > td {
    background: color-mix(in srgb, var(--primary) 3.5%, var(--surface));
}

.vds-table-wrap--caseload .vds-table tbody tr.fb-caseload-care-team-row[hidden] {
    display: none !important;
}

.fb-caseload-care-team-panel {
    margin: 0;
    padding: 0.85rem 1rem 1rem;
    position: static;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.fb-caseload-care-team__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: var(--weight-bold, 700);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.3;
}

.fb-caseload-care-team__support {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.fb-caseload-care-team-panel .fb-care-team__list {
    border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface);
    overflow: hidden;
    max-width: 40rem;
    width: 100%;
}

.fb-caseload-care-team-panel .fb-care-team__name {
    font-size: 0.9375rem;
}

.fb-caseload-care-team-panel .fb-care-team__aside {
    max-width: 14rem;
}

@media (max-width: 767.98px) {
    .fb-caseload-care-team {
        max-width: none;
    }

    .fb-care-team__member-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .fb-care-team__aside,
    .fb-care-team__you-badge {
        max-width: 100%;
        text-align: left;
        padding-left: 1.2rem;
    }

    .fb-care-team__name {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .fb-care-team__role {
        padding-left: 1.2rem;
    }
}

/* Phase 214 / 214B / 214C — Goals workspace compact expandable rows
   Visual: one container per goal; neutral in-row detail (no nested card). */
.fb-goals-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}

.fb-goals-list__item {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.fb-goals-list__item:last-child {
    border-bottom: 0;
}

.fb-goals-list__item.is-expanded {
    background: var(--surface);
}

.fb-goals-list__summary {
    display: block;
    padding: 0;
    min-height: 0;
}

.fb-goals-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.65rem 0.85rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.fb-goals-list__summary-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

.fb-goals-list__text {
    font-weight: var(--weight-bold, 700);
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--text);
    overflow-wrap: anywhere;
}

.fb-goals-list__summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}

.fb-goals-list__date,
.fb-goals-list__summary-status {
    font-size: var(--font-small, 0.8125rem);
    color: var(--text-muted);
    line-height: 1.3;
}

.fb-goals-list__summary-end {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.fb-goals-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-goals-list__toggle:hover {
    background: color-mix(in srgb, var(--text) 3.5%, var(--surface));
}

.fb-goals-list__toggle:hover .fb-goals-list__chevron {
    border-color: var(--primary);
    color: var(--primary);
}

.fb-goals-list__item.is-expanded > .fb-goals-list__summary .fb-goals-list__toggle {
    background: var(--surface-muted, color-mix(in srgb, var(--text) 2.5%, var(--surface)));
}

.fb-goals-list__toggle:focus {
    outline: none;
}

.fb-goals-list__toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.fb-goals-list__toggle:focus-visible .fb-goals-list__chevron {
    border-color: var(--primary);
    color: var(--primary);
}

/* Detail is flush via .vds-expand-panel--in-row (design-system). */
.fb-goals-list__panel.vds-expand-panel {
    margin: 0;
    padding: 0;
}

.fb-goals-list__panel .vds-expand-panel__actions--primary {
    justify-content: flex-end;
}

.fb-goals-list__field--full {
    grid-column: 1 / -1;
}

.fb-goals-list__meta {
    row-gap: var(--space-2);
}

/* Phase 214A — section headings stay distinct on tablet/iPad */
.fb-goals-section__title {
    margin: 0 0 var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--primary);
}

@media (max-width: 767.98px) {
    .fb-goals-list__toggle {
        align-items: flex-start;
        min-height: 3rem;
    }

    .fb-goals-list__summary-end {
        margin-top: 0.15rem;
    }

    .fb-goals-list__panel .vds-expand-panel__actions--primary {
        justify-content: stretch;
    }

    .fb-goals-list__item .vds-row-actions,
    .fb-goals-list__item .vds-expand-panel__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .fb-goals-list__item .vds-row-actions .d-inline,
    .fb-goals-list__item .vds-row-actions form,
    .fb-goals-list__item .vds-expand-panel__actions .d-inline,
    .fb-goals-list__item .vds-expand-panel__actions form {
        width: 100%;
    }

    .fb-goals-list__item .vds-row-actions .vds-btn,
    .fb-goals-list__item .vds-expand-panel__actions .vds-btn {
        width: 100%;
        min-height: 2.5rem;
    }

    .fb-goals-list__item .ms-md-auto {
        margin-left: 0 !important;
        margin-top: var(--space-2);
    }
}

/* ── Phase 217 — Patient Home Goals bell (under greeting) ───────────────── */

.vds-workspace-hero__below-title {
    margin: 0.55rem 0 0;
}

.fb-goals-bell {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    max-width: 100%;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle, #F0ECF7);
    background: var(--surface, #fff);
    color: var(--text-strong, #151225);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(21, 18, 37, 0.04);
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fb-goals-bell:hover,
.fb-goals-bell:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.fb-goals-bell__icon {
    display: inline-flex;
    flex-shrink: 0;
    font-size: 1.15rem;
    line-height: 1;
}

.fb-goals-bell__label {
    font-weight: 600;
    white-space: nowrap;
}

.fb-goals-bell__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 1.5rem;
    min-height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--surface-muted, #F1F2F7);
    color: var(--text-strong, #151225);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Phase 217A — active goals (≥1): persistent brand attention (not error/danger). */
.fb-goals-bell--active {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    background: var(--primary-soft);
    color: var(--text-brand);
}

.fb-goals-bell--active .fb-goals-bell__icon {
    color: var(--primary);
}

.fb-goals-bell--active .fb-goals-bell__count {
    background: var(--primary);
    color: var(--text-inverse);
}

.fb-goals-bell--active:hover,
.fb-goals-bell--active:focus-visible {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface-lavender));
    color: var(--primary-hover);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

.fb-goals-bell--active:hover .fb-goals-bell__count,
.fb-goals-bell--active:focus-visible .fb-goals-bell__count {
    background: var(--primary-hover);
    color: var(--text-inverse);
}

/* New/unreviewed — pulse only; colour comes from --active (new implies active). */
.fb-goals-bell--new .fb-goals-bell__icon {
    animation: fb-goals-bell-pulse 2.4s ease-in-out infinite;
}

@keyframes fb-goals-bell-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.82; }
}

@media (prefers-reduced-motion: reduce) {
    .fb-goals-bell--new .fb-goals-bell__icon {
        animation: none;
    }

    /* Static new-state cue without motion (additive to active colour). */
    .fb-goals-bell--new {
        box-shadow: inset 0 0 0 2px var(--primary);
    }
}

.fb-patient-goals__section {
    margin: 0 0 1.5rem;
}

.fb-patient-goals__heading {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.fb-patient-goals__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.fb-patient-goals__item {
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-subtle, #e4e0f0);
    border-radius: 0.85rem;
    background: var(--surface, #fff);
}

/* Phase 254 — goal is primary; date/author is secondary metadata. */
.fb-patient-goals__text {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text, #1f1933);
}

.fb-patient-goals__meta {
    margin: 0.55rem 0 0;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted, #6b657a);
    line-height: 1.4;
}

.fb-patient-goals__item--done .fb-patient-goals__text {
    font-weight: 600;
}

.fb-patient-goals__item--done .fb-patient-goals__meta {
    font-weight: 400;
}

.fb-patient-goals__empty {
    margin: 0;
    color: var(--text-muted, #6b657a);
}

/* MD-10 — clinician patient-record chrome and MDT dashboard */
.vds-page.fb-mdt-shell.vds-page--no-header > .vds-page-container {
    padding-top: var(--space-2);
}

.fb-mdt-record {
    display: grid;
    gap: var(--space-3);
}

.fb-mdt-identity {
    display: grid;
    gap: var(--space-2);
    padding: 0 0 var(--space-3);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
}

.fb-mdt-identity__kicker {
    margin: 0 0 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fb-mdt-identity__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3) var(--space-4);
}

.fb-mdt-identity__who {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    min-width: 0;
    flex: 1 1 16rem;
}

.fb-mdt-identity__copy {
    min-width: 0;
    flex: 1 1 auto;
}

.fb-mdt-identity__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.65rem;
    row-gap: 0.35rem;
    margin: 0 0 0.2rem;
    max-width: 100%;
}

.fb-mdt-identity__name {
    margin: 0;
    font-size: var(--workspace-hero-title-size, clamp(1.25rem, 1.8vw, 1.55rem));
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text);
    overflow-wrap: anywhere;
    max-width: 100%;
}

.fb-mdt-identity__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.85rem;
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--text);
    font-size: 0.88rem;
}

.fb-mdt-identity__key {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fb-mdt-identity__fact {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.fb-mdt-identity__fact i {
    color: var(--discipline-speech, var(--primary));
}

.fb-mdt-identity__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.fb-record-goals {
    flex: 0 0 auto;
    gap: 0.35rem;
}

.fb-record-goals .fb-goals-bell__count {
    min-width: 1.25rem;
    min-height: 1.25rem;
    font-size: 0.75rem;
}

.fb-mdt-tabs {
    margin: 0 0 var(--space-2);
    border-bottom: 1px solid var(--border);
}

.fb-mdt-tabs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fb-mdt-tabs__link {
    display: inline-flex;
    align-items: center;
    min-height: 2.4rem;
    padding: 0.4rem 0.85rem;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.fb-mdt-tabs__link:hover,
.fb-mdt-tabs__link:focus-visible {
    color: var(--discipline-speech, var(--primary));
    outline: none;
}

.fb-mdt-tabs__link:focus-visible {
    box-shadow: inset 0 0 0 2px var(--discipline-speech, var(--primary));
}

.fb-mdt-tabs__link.is-current {
    color: var(--text);
    border-bottom-color: var(--discipline-speech, var(--primary));
}

.fb-mdt-dash {
    display: grid;
    gap: var(--space-3);
}

.fb-mdt-dash__row {
    display: grid;
    gap: var(--space-3);
    align-items: start;
}

/* Overview: statistics full width; notes left; administration + episode right. */
.fb-slt-overview-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    min-width: 0;
    align-items: start;
}

.fb-slt-overview-stats,
.fb-slt-overview-page > .fb-rehab-card,
.fb-slt-overview-body {
    grid-column: 1 / -1;
    min-width: 0;
}

.fb-slt-overview-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
}

.fb-slt-overview-notes,
.fb-slt-overview-aside {
    min-width: 0;
    align-self: start;
    height: fit-content;
}

.fb-slt-overview-notes .vds-clinical-note-history__title {
    display: none;
}

.fb-slt-overview-aside {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    width: 100%;
}

.fb-slt-overview-episode,
.fb-slt-admin-panel {
    min-width: 0;
    width: 100%;
    height: fit-content;
}

.fb-slt-overview-episode > .fb-mdt-panel {
    width: 100%;
}

@media (min-width: 768px) {
    .fb-slt-overview-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

.fb-mdt-panel__head {
    margin-bottom: var(--space-2);
}

.fb-mdt-workspace__lede,
.fb-speech-workspace__lede {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.fb-mdt-timeline,
.fb-mdt-previous__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
}

.fb-mdt-previous__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 0.5rem);
    background: var(--surface);
    border-left: 4px solid var(--border);
}

.fb-mdt-previous__item--speech {
    border-left-color: var(--discipline-speech, var(--primary));
}

.fb-mdt-strip__meta {
    margin: 0;
    font-weight: 650;
    color: var(--text);
}

.fb-mdt-timeline li,
.fb-mdt-timeline__item {
    display: grid;
    grid-template-columns: 0.65rem minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.fb-mdt-timeline li:last-child,
.fb-mdt-timeline__item:last-child {
    border-bottom: 0;
}

.fb-mdt-timeline__dot {
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.4rem;
    border-radius: var(--radius-full);
    background: var(--discipline-speech, var(--primary));
}

.fb-mdt-previous {
    background: var(--surface-muted, #f8f7fb);
}

.fb-mdt-previous__list {
    margin-top: var(--space-3);
}

.fb-mdt-workspace__intro,
.fb-speech-workspace__intro {
    margin-bottom: var(--space-4);
}

.fb-mdt-workspace__title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.fb-mdt-workspace__status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: var(--space-3) 0 0;
}

.fb-speech-workspace {
    padding-top: 0;
}

@media (max-width: 767px) {
    .fb-mdt-identity__name {
        font-size: 1.3rem;
    }

    .fb-mdt-tabs__link {
        min-height: 2.5rem;
        padding: 0.45rem 0.75rem;
    }
}

.fb-mdt-workspace-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin: 0 0 var(--space-4);
}

.fb-mdt-workspace-jump__link,
.fb-mdt-workspace-jump__link:visited {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.fb-mdt-workspace-jump__link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.fb-mdt-workspace-jump-label {
    margin: 0 0 0.35rem;
    color: var(--text-muted, #5b6475);
    font-size: 0.9rem;
    font-weight: 600;
}

.fb-mdt-workspace-summary {
    margin: 0 0 var(--space-4);
    padding: var(--space-4);
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-panel, 8px);
}

.fb-mdt-workspace-summary__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.fb-mdt-workspace-summary__lede {
    margin: 0 0 var(--space-3);
    color: var(--text-muted, #5b6475);
    font-size: 0.95rem;
}

.fb-clinical-layers {
    margin: 0 0 var(--space-4);
}

.fb-clinical-layers__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

@media (max-width: 768px) {
    .fb-clinical-layers__grid {
        grid-template-columns: 1fr;
    }
}

.fb-clinical-layers__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.fb-clinical-layers__item {
    margin: 0 0 0.75rem;
    padding: 0.75rem 0 0;
    border-top: 1px solid var(--border);
}

.fb-clinical-layers__item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

/* Speech & Language therapist workspace (patient record Overview). */

.fb-slt-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.85rem;
}

.fb-slt-facts,
.fb-slt-rows {
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.fb-slt-facts > div,
.fb-slt-rows__row {
    margin: 0;
    display: grid;
    gap: 0.15rem;
}

.fb-slt-facts dt,
.fb-slt-rows__row dt {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fb-slt-facts dd,
.fb-slt-rows__row dd {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
}

.fb-slt-rows__row {
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}

.fb-slt-rows__row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.fb-slt-you {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: var(--radius-pill, 999px);
    background: var(--surface-muted, #f1eefb);
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--text-muted);
}

.fb-slt-facts__assigned {
    grid-column: 1 / -1;
}

.fb-slt-assigned {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.4rem;
}

.fb-slt-assigned li {
    margin: 0;
    display: grid;
    gap: 0.05rem;
}

.fb-slt-assigned__role {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.35;
}

.fb-slt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--space-3);
}

.fb-slt-inline-link,
.fb-slt-inline-link:visited {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    font-size: 0.9rem;
    white-space: nowrap;
}

.fb-slt-inline-link:focus-visible,
.fb-slt-flow__label:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Compact episode-progress status. Not a navigator. */

.fb-slt-panel--lead {
    border-left: 4px solid var(--discipline-speech, var(--primary));
}

.fb-slt-flow {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 0;
    padding: 0;
}

.fb-slt-flow--compact {
    display: grid;
    gap: 0.45rem;
}

.fb-slt-flow__step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.fb-slt-flow__marker {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    flex: none;
}

.fb-slt-flow__step--done .fb-slt-flow__marker {
    border-color: var(--discipline-speech, var(--primary));
    background: var(--discipline-speech, var(--primary));
}

.fb-slt-flow__step--current .fb-slt-flow__marker {
    border-color: var(--discipline-speech, var(--primary));
    box-shadow: 0 0 0 3px var(--discipline-speech-soft, rgba(109, 74, 214, 0.18));
}

.fb-slt-flow__step--current .fb-slt-flow__label {
    color: var(--text);
    font-weight: 700;
}

.fb-slt-flow__step--done .fb-slt-flow__label {
    color: var(--text);
}

a.fb-slt-flow__label {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.fb-slt-flow--compact .fb-slt-flow__label {
    text-decoration: none;
    font-size: 0.9rem;
}

/* Needs your attention */

.fb-slt-attention {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
}

.fb-slt-attention__item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

.fb-slt-attention__item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.fb-slt-attention__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex: none;
    background: var(--border);
}

.fb-slt-attention__item--todo .fb-slt-attention__dot {
    background: var(--warning, #b8860b);
}

.fb-slt-attention__item--ok .fb-slt-attention__dot {
    background: var(--success, #1f7a4d);
}

.fb-slt-attention__text {
    display: grid;
    gap: 0.1rem;
    flex: 1 1 10rem;
    min-width: 0;
}

.fb-slt-attention__label {
    font-weight: 650;
    color: var(--text);
}

.fb-slt-attention__value {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Communication profile */

.fb-slt-areas {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3);
    grid-template-columns: 1fr;
}

.fb-slt-area {
    display: grid;
    gap: 0.35rem;
    justify-items: start;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface);
}

.fb-slt-area--difficulty_identified,
.fb-slt-area--goal_active,
.fb-slt-area--reviewed {
    border-left-color: var(--discipline-speech, var(--primary));
}

.fb-slt-area__label {
    margin: 0;
    font-weight: 700;
    color: var(--text);
}

.fb-slt-area__summary,
.fb-slt-area__meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

/* Assessments, reviews and goals lists */

.fb-slt-list,
.fb-slt-goals {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fb-slt-list__item,
.fb-slt-goals__item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

.fb-slt-list__item:last-child,
.fb-slt-goals__item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.fb-slt-list__text,
.fb-slt-goals__item {
    min-width: 0;
}

.fb-slt-list__text {
    display: grid;
    gap: 0.1rem;
    flex: 1 1 10rem;
}

.fb-slt-list__label {
    font-weight: 650;
    color: var(--text);
}

.fb-slt-list__meta,
.fb-slt-goals__meta,
.fb-slt-more {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.fb-slt-goals__item {
    display: grid;
    gap: 0.15rem;
}

.fb-slt-goals__text {
    color: var(--text);
    line-height: 1.45;
}

.fb-slt-more {
    margin: 0.5rem 0 0;
}

.fb-slt-headline {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}

.fb-slt-subheading {
    margin: var(--space-3) 0 0;
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Overview Activity statistics — six compact cards; same Evidence figures. */
.fb-slt-stats .vds-page-stats {
    margin-bottom: 0;
    gap: var(--space-2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fb-slt-stats .vds-page-stats__card {
    --fb-slt-stat-accent: var(--primary);
    padding: 0.7rem 0.75rem 0.8rem;
    border-top: 3px solid var(--fb-slt-stat-accent);
    background: var(--surface);
}

.fb-slt-stats .vds-page-stats__card--primary { --fb-slt-stat-accent: var(--primary); }
.fb-slt-stats .vds-page-stats__card--success { --fb-slt-stat-accent: var(--success); }
.fb-slt-stats .vds-page-stats__card--info { --fb-slt-stat-accent: var(--info); }
.fb-slt-stats .vds-page-stats__card--accent { --fb-slt-stat-accent: var(--accent); }
.fb-slt-stats .vds-page-stats__card--teal { --fb-slt-stat-accent: var(--accent-teal); }
.fb-slt-stats .vds-page-stats__card--warning { --fb-slt-stat-accent: var(--warning); }
.fb-slt-stats .vds-page-stats__card--status { --fb-slt-stat-accent: var(--success); }
.fb-slt-stats .vds-page-stats__card--secondary { --fb-slt-stat-accent: var(--secondary); }

.fb-slt-stats .vds-page-stats__label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: var(--font-caption);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.fb-slt-stats .vds-page-stats__icon {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: var(--radius-md, 0.4rem);
    background: color-mix(in srgb, var(--fb-slt-stat-accent) 14%, var(--surface));
    color: var(--fb-slt-stat-accent);
    justify-content: center;
}

.fb-slt-stats .vds-page-stats__value {
    font-size: clamp(1.05rem, 1.4vw, 1.4rem);
    color: var(--text-strong);
    overflow-wrap: anywhere;
}

@media (min-width: 992px) {
    .fb-slt-stats .vds-page-stats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (min-width: 640px) {
    .fb-slt-areas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .fb-slt-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fb-slt-facts--episode {
        grid-template-columns: minmax(0, 1fr);
    }

    .fb-slt-rows--plan {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem 1.5rem;
    }

    .fb-slt-rows--plan .fb-slt-rows__row {
        padding-bottom: 0;
        border-bottom: 0;
    }
}

@media (min-width: 992px) {
    .fb-slt-row--split {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    }

    .fb-slt-row--even {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fb-slt-areas {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

/* Patient administration: collapsed blocks above the Speech episode. */
.fb-patient-admin {
    display: grid;
    gap: var(--space-2);
}

.fb-patient-admin__group {
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    background: var(--surface, #fff);
}

.fb-patient-admin__group > summary {
    cursor: pointer;
    padding: var(--space-3);
    font-weight: var(--weight-semibold, 600);
}

.fb-patient-admin__group > summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.fb-patient-admin__group[open] > summary {
    border-bottom: 1px solid var(--border);
}

.fb-patient-admin__body {
    padding: var(--space-3);
}


