/* OncoFlow Assist - Visual Foundation V1.
   Authoritative reference: docs/ux/ONCOFLOW_UI_STYLE_GUIDE.md */

:root {
    /* Brand ink / navy */
    --ofa-ink-950: #0B1748;
    --ofa-ink-900: #10245F;
    --ofa-ink-800: #1A2C68;

    /* Primary blue */
    --ofa-blue-600: #2563EB;
    --ofa-blue-500: #3478F6;
    --ofa-blue-400: #5B8DFB;
    --ofa-blue-100: #E7EFFE;
    --ofa-blue-50: #F2F6FF;

    /* Violet - the AI colour */
    --ofa-violet-700: #6D35E8;
    --ofa-violet-600: #7C3AED;
    --ofa-violet-500: #8B5CF6;
    --ofa-violet-100: #EFE9FE;

    /* Purple accent */
    --ofa-purple-500: #A23AF0;

    /* Teal - the human colour */
    --ofa-teal-700: #087F78;
    --ofa-teal-600: #0F948B;
    --ofa-teal-100: #DDF6F2;

    /* Status */
    --ofa-success-600: #15956B;
    --ofa-success-100: #DCF6EA;
    --ofa-warning-600: #D98A16;
    --ofa-warning-100: #FFF2D9;
    --ofa-danger-600: #D94C57;
    --ofa-danger-100: #FDE7EA;

    /* Accessibility-normalised text variants. The base status colours above are
       calibrated for fills, icons and borders and do not all reach AA at body
       size; these do. */
    --ofa-success-700: #0F7A57;
    --ofa-warning-700: #8A5A0B;
    --ofa-danger-700: #B33642;

    /* Semantic surface, border and text tokens. Components consume these
       aliases so Light and Dark remain the same product rather than separate
       one-off palettes. */
    --ofa-background: #F5F7FC;
    --ofa-surface-elevated: #FFFFFF;
    --ofa-surface-subtle: #FAFBFE;
    --ofa-hover-surface: #F0F3F9;
    --ofa-selected-surface: #EAF0FF;
    --ofa-border: #DFE5F0;
    --ofa-border-strong: #CCD6E6;
    --ofa-text-primary: #111A3A;
    --ofa-text-secondary: #53617D;
    --ofa-text-muted: #68728D;
    --ofa-text-subtle: #8B94A9;
    --ofa-brand-primary: #315FCE;
    --ofa-brand-primary-hover: #244DAF;
    --ofa-focus-ring: #4E7CF0;
    --ofa-on-brand: #FFFFFF;
    --ofa-on-human: #FFFFFF;
    --ofa-topbar: rgba(255, 255, 255, .90);
    --ofa-scrim: rgba(11, 23, 72, .42);
    --ofa-canvas: var(--ofa-background);
    --ofa-canvas-soft: var(--ofa-surface-subtle);
    --ofa-surface: var(--ofa-surface-elevated);
    --ofa-text: var(--ofa-text-primary);

    --ofa-gradient: linear-gradient(135deg, #1F6BFF 0%, #635BEE 52%, #A22CF2 100%);

    --ofa-space-1: 4px;
    --ofa-space-2: 8px;
    --ofa-space-3: 12px;
    --ofa-space-4: 16px;
    --ofa-space-5: 20px;
    --ofa-space-6: 24px;
    --ofa-space-7: 32px;
    --ofa-space-8: 40px;
    --ofa-space-9: 48px;

    --ofa-radius-control: 9px;
    --ofa-radius-card: 14px;
    --ofa-radius-panel: 16px;
    --ofa-radius-pill: 999px;

    --ofa-shadow-card: 0 6px 24px rgba(24, 39, 90, .055);
    --ofa-shadow-raised: 0 20px 48px rgba(24, 39, 90, .16);

    --ofa-rail-width: 264px;
    --ofa-topbar-height: 60px;

    color: var(--ofa-text);
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system,
        BlinkMacSystemFont, Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

html[data-theme="dark"] {
    --ofa-ink-950: #F5F7FF;
    --ofa-ink-900: #E4E9F7;
    --ofa-ink-800: #CFD8EC;
    --ofa-blue-600: #83A9FF;
    --ofa-blue-500: #6F98F5;
    --ofa-blue-400: #6389E3;
    --ofa-blue-100: #1C315F;
    --ofa-blue-50: #162541;
    --ofa-violet-700: #C1ABFF;
    --ofa-violet-600: #B69BFF;
    --ofa-violet-500: #9D7DF4;
    --ofa-violet-100: #2B2350;
    --ofa-purple-500: #C58AFF;
    --ofa-teal-700: #74D7CA;
    --ofa-teal-600: #45BDAF;
    --ofa-teal-100: #173F3E;
    --ofa-success-600: #4AC59A;
    --ofa-success-700: #75DCB8;
    --ofa-success-100: #153B31;
    --ofa-warning-600: #E9AD51;
    --ofa-warning-700: #F3C779;
    --ofa-warning-100: #49351E;
    --ofa-danger-600: #F07B88;
    --ofa-danger-700: #FF9AA5;
    --ofa-danger-100: #4C2730;
    --ofa-background: #0E1527;
    --ofa-surface-elevated: #161F35;
    --ofa-surface-subtle: #121A2E;
    --ofa-hover-surface: #1C2842;
    --ofa-selected-surface: #20345F;
    --ofa-border: #293753;
    --ofa-border-strong: #3B4B6C;
    --ofa-text-primary: #F4F7FF;
    --ofa-text-secondary: #CBD4E8;
    --ofa-text-muted: #A5B1CA;
    --ofa-text-subtle: #7886A6;
    --ofa-brand-primary: #7199F2;
    --ofa-brand-primary-hover: #8EB0FF;
    --ofa-focus-ring: #8EB0FF;
    --ofa-on-brand: #0A1224;
    --ofa-on-human: #071F20;
    --ofa-topbar: rgba(14, 21, 39, .91);
    --ofa-scrim: rgba(1, 5, 15, .68);
    --ofa-shadow-card: 0 10px 30px rgba(0, 0, 0, .18);
    --ofa-shadow-raised: 0 24px 60px rgba(0, 0, 0, .42);
}

.staff-assist__summary {
    color: var(--ofa-text-muted);
    font-size: 12px;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

* {
    box-sizing: border-box;
}

html,
body {
    background: var(--ofa-canvas);
    color: var(--ofa-text);
    margin: 0;
    min-height: 100%;
}

body,
.ofa-card,
.ofa-table-wrap,
.ofa-drawer,
.ofa-dialog,
.workspace__panel {
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

h1, h2, h3, h4 {
    color: var(--ofa-text);
    line-height: 1.25;
    margin: 0;
}

a {
    color: var(--ofa-blue-600);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--ofa-focus-ring);
    outline-offset: 2px;
}

h1:focus {
    outline: none;
}

/* ---------------------------------------------------------------- layout */

.ofa-page {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-6);
    margin: 0 auto;
    max-width: 1400px;
    padding: var(--ofa-space-7) var(--ofa-space-7) var(--ofa-space-9);
    width: 100%;
}

.ofa-page-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-4);
    justify-content: space-between;
}

.ofa-page-header__text {
    flex: 1 1 auto;
    min-width: 0;
}

.ofa-eyebrow {
    color: var(--ofa-text-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .07em;
    margin: 0 0 var(--ofa-space-2);
    text-transform: uppercase;
}

.ofa-page-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.015em;
}

.ofa-page-purpose {
    color: var(--ofa-text-muted);
    margin: var(--ofa-space-2) 0 0;
    max-width: 72ch;
}

.ofa-breadcrumb {
    align-items: center;
    color: var(--ofa-text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: var(--ofa-space-1);
    margin-bottom: var(--ofa-space-3);
}

.ofa-breadcrumb__sep {
    color: var(--ofa-text-subtle);
}

.ofa-section-title {
    font-size: 19px;
    font-weight: 700;
}

.ofa-grid {
    display: grid;
    gap: var(--ofa-space-4);
}

@media (min-width: 900px) {
    .ofa-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ofa-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ----------------------------------------------------------------- cards */

.ofa-card {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-card);
    padding: var(--ofa-space-6);
}

.ofa-card--raised {
    box-shadow: var(--ofa-shadow-card);
}

.ofa-card__header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
    justify-content: space-between;
    margin-bottom: var(--ofa-space-4);
}

.ofa-card__title {
    font-size: 16px;
    font-weight: 700;
}

.ofa-card__hint {
    color: var(--ofa-text-muted);
    font-size: 13px;
    margin: var(--ofa-space-1) 0 0;
}

.ofa-facts {
    display: grid;
    gap: var(--ofa-space-4);
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin: 0;
}

.ofa-fact__label {
    color: var(--ofa-text-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ofa-fact__value {
    font-size: 15px;
    font-weight: 600;
    margin: var(--ofa-space-1) 0 0;
    overflow-wrap: anywhere;
}

/* A short list inside a fact or card: one item per line, no bullets. */
.ofa-list {
    display: grid;
    gap: var(--ofa-space-1);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Badges side by side inside a fact keep a small gap. */
.ofa-fact__value .ofa-badge + .ofa-badge {
    margin-left: var(--ofa-space-2);
}
/* --------------------------------------------------------------- buttons */

.ofa-btn {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: var(--ofa-radius-control);
    color: var(--ofa-text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    gap: var(--ofa-space-1);
    justify-content: center;
    line-height: 1;
    min-height: 40px;
    padding: 0 var(--ofa-space-4);
    text-decoration: none;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease,
        box-shadow .14s ease, transform .14s ease;
    white-space: nowrap;
}

.ofa-btn:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-border-strong);
    text-decoration: none;
}

.ofa-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.ofa-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.ofa-btn--primary {
    background: var(--ofa-brand-primary);
    border-color: var(--ofa-brand-primary);
    box-shadow: 0 5px 14px rgba(49, 95, 206, .18);
    color: var(--ofa-on-brand);
}

.ofa-btn--primary:hover:not(:disabled) {
    background: var(--ofa-brand-primary-hover);
    border-color: var(--ofa-brand-primary-hover);
}

/* The gradient is a brand accent: at most one per entry surface. */
.ofa-btn--brand {
    background: var(--ofa-gradient);
    border: none;
    color: #fff;
}

.ofa-btn--brand:hover:not(:disabled) {
    filter: brightness(.94);
}

.ofa-btn--subtle {
    background: transparent;
    border-color: transparent;
    color: var(--ofa-blue-600);
}

.ofa-btn--subtle:hover:not(:disabled) {
    background: var(--ofa-selected-surface);
}

.ofa-btn--danger {
    background: var(--ofa-danger-100);
    border-color: transparent;
    color: var(--ofa-danger-700);
}

.ofa-btn--danger:hover:not(:disabled) {
    background: color-mix(in srgb, var(--ofa-danger-100) 82%, var(--ofa-danger-600));
}

.ofa-btn--sm {
    font-size: 13px;
    min-height: 34px;
    padding: 0 var(--ofa-space-3);
}

.ofa-btn--icon {
    border-radius: 50%;
    height: 34px;
    min-height: 34px;
    min-width: 34px;
    padding: 0;
    width: 34px;
}

/* ----------------------------------------------------------------- forms */

.ofa-field {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    margin-bottom: var(--ofa-space-4);
}

.ofa-label {
    font-size: 13.5px;
    font-weight: 600;
}

.ofa-required {
    color: var(--ofa-text-muted);
    font-weight: 500;
}

.ofa-input,
.ofa-select {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: var(--ofa-radius-control);
    color: var(--ofa-text);
    font: inherit;
    font-size: 14.5px;
    min-height: 42px;
    padding: 0 var(--ofa-space-3);
    width: 100%;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
}

textarea.ofa-input {
    line-height: 1.5;
    min-height: 84px;
    padding: 10px var(--ofa-space-3);
    resize: vertical;
}

.ofa-input:focus,
.ofa-select:focus {
    border-color: var(--ofa-focus-ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ofa-focus-ring) 18%, transparent);
    outline: none;
}

.ofa-help {
    color: var(--ofa-text-muted);
    font-size: 12.5px;
    margin: 0;
}

.ofa-field-error {
    color: var(--ofa-danger-700);
    font-size: 12.5px;
    font-weight: 600;
    margin: 0;
}

.ofa-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    justify-content: space-between;
}

.ofa-search {
    flex: 1 1 260px;
    max-width: 380px;
    position: relative;
}

.ofa-search .ofa-input {
    padding-left: 38px;
}

.ofa-search__icon {
    color: var(--ofa-text-subtle);
    left: 11px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

/* ------------------------------------------------------------ filter set */

.ofa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
}

.ofa-chip {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-text-muted);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    gap: var(--ofa-space-2);
    min-height: 34px;
    padding: 0 var(--ofa-space-3);
}

.ofa-chip:hover {
    background: var(--ofa-hover-surface);
}

.ofa-chip[aria-pressed="true"] {
    background: var(--ofa-selected-surface);
    border-color: transparent;
    color: var(--ofa-brand-primary);
}

.ofa-chip__count {
    background: rgba(17, 26, 58, .06);
    border-radius: var(--ofa-radius-pill);
    font-size: 12px;
    font-weight: 700;
    padding: 1px 7px;
}

.ofa-chip[aria-pressed="true"] .ofa-chip__count {
    background: rgba(109, 53, 232, .14);
}

/* ---------------------------------------------------------------- badges */

.ofa-badge {
    align-items: center;
    border-radius: var(--ofa-radius-pill);
    display: inline-flex;
    font-size: 12.5px;
    font-weight: 600;
    gap: 6px;
    line-height: 1;
    padding: 5px 10px;
    white-space: nowrap;
}

.ofa-badge--neutral {
    background: color-mix(in srgb, var(--ofa-text) 8%, transparent);
    color: var(--ofa-text-muted);
}

.ofa-badge--info {
    background: var(--ofa-blue-100);
    color: var(--ofa-blue-600);
}

.ofa-badge--ai {
    background: var(--ofa-violet-100);
    color: var(--ofa-violet-600);
}

.ofa-badge--human {
    background: var(--ofa-teal-100);
    color: var(--ofa-teal-700);
}

.ofa-badge--success {
    background: var(--ofa-success-100);
    color: var(--ofa-success-700);
}

.ofa-badge--warning {
    background: var(--ofa-warning-100);
    color: var(--ofa-warning-700);
}

.ofa-badge--danger {
    background: var(--ofa-danger-100);
    color: var(--ofa-danger-700);
}

.ofa-badge--noshow {
    background: #FFEDD5;
    color: #9A3412;
}

.ofa-badge--outcome {
    background: var(--ofa-warning-100);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ofa-warning-600) 45%, transparent);
    color: var(--ofa-warning-700);
}

html[data-theme="dark"] .ofa-badge--noshow {
    background: #4A2410;
    color: #FDBA74;
}

/* --------------------------------------------------------------- avatars */

.ofa-avatar {
    align-items: center;
    background: var(--ofa-blue-100);
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-ink-900);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    letter-spacing: .02em;
    width: 36px;
}

.ofa-avatar--lg {
    font-size: 18px;
    height: 56px;
    width: 56px;
}
/* ---------------------------------------------------------------- tables */

.ofa-table-wrap {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-card);
    overflow: hidden;
}

.ofa-table {
    border-collapse: collapse;
    width: 100%;
}

.ofa-table th {
    background: var(--ofa-canvas-soft);
    border-bottom: 1px solid var(--ofa-border);
    color: var(--ofa-text-muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    padding: 14px var(--ofa-space-5);
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.ofa-table td {
    border-bottom: 1px solid var(--ofa-border);
    padding: 15px var(--ofa-space-5);
    vertical-align: middle;
}

.ofa-table tbody tr:last-child td {
    border-bottom: none;
}

.ofa-table tbody tr:hover {
    background: var(--ofa-hover-surface);
}

.ofa-table td.ofa-table__actions {
    text-align: right;
    white-space: nowrap;
}

.ofa-identity {
    align-items: center;
    display: flex;
    gap: var(--ofa-space-3);
}

.ofa-identity--hero {
    align-items: center;
    gap: var(--ofa-space-4);
}

.ofa-identity__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-width: 0;
}

.ofa-identity__title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
}

.ofa-identity__title-row .ofa-page-title {
    line-height: 1.15;
    margin: 0;
}

.ofa-identity__subtitle {
    color: var(--ofa-text-muted);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
}

.ofa-identity__name {
    display: block;
    font-weight: 650;
}

.ofa-identity__ref {
    color: var(--ofa-text-muted);
    display: block;
    font-size: 12.5px;
}

/* ------------------------------------------- patient communication panel */

.ofa-comm-sections {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-6);
    margin-top: var(--ofa-space-4);
}

.ofa-comm-section {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
}

.ofa-comm-section__header {
    align-items: center;
    display: flex;
    gap: var(--ofa-space-2);
    justify-content: space-between;
}

.ofa-comm-section__title-wrap {
    align-items: center;
    display: inline-flex;
    gap: var(--ofa-space-2);
}

.ofa-comm-section__icon {
    align-items: center;
    border-radius: 7px;
    display: inline-flex;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.ofa-comm-section__icon--blue {
    background: var(--ofa-blue-100);
    color: var(--ofa-blue-600);
}

.ofa-comm-section__icon--teal {
    background: var(--ofa-teal-100);
    color: var(--ofa-teal-700);
}

.ofa-comm-section__title {
    color: var(--ofa-text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    margin: 0;
}

.ofa-comm-section__count {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-text-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 9px;
}

.ofa-comm-empty {
    background: var(--ofa-surface-subtle);
    border: 1px dashed var(--ofa-border-strong);
    border-radius: var(--ofa-radius-control);
    padding: var(--ofa-space-4);
}

.ofa-comm-empty .ofa-meta {
    margin: 0;
}

.ofa-comm-list {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ofa-comm-card {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-left: 4px solid var(--ofa-blue-500);
    border-radius: var(--ofa-radius-card);
    color: var(--ofa-text);
    display: flex;
    gap: var(--ofa-space-3);
    justify-content: space-between;
    padding: var(--ofa-space-3) var(--ofa-space-4);
    text-decoration: none;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease,
        transform .14s ease;
}

.ofa-comm-card--support {
    border-left-color: var(--ofa-teal-600);
}

.ofa-comm-card:hover {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-border-strong);
    box-shadow: var(--ofa-shadow-card);
    text-decoration: none;
    transform: translateY(-1px);
}

.ofa-comm-card__icon {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    flex: 0 0 auto;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.ofa-comm-card__icon--blue {
    background: var(--ofa-blue-100);
    color: var(--ofa-blue-600);
}

.ofa-comm-card__icon--teal {
    background: var(--ofa-teal-100);
    color: var(--ofa-teal-700);
}

.ofa-comm-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ofa-comm-card__title {
    color: var(--ofa-text);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.ofa-comm-card:hover .ofa-comm-card__title {
    color: var(--ofa-blue-600);
}

.ofa-comm-card__meta {
    align-items: center;
    color: var(--ofa-text-secondary);
    display: flex;
    flex-wrap: wrap;
    font-size: 12.5px;
    gap: 6px;
    line-height: 1.35;
}

.ofa-comm-card__meta strong {
    color: var(--ofa-text);
    font-weight: 650;
}

.ofa-comm-card__sep {
    color: var(--ofa-text-subtle);
}

.ofa-comm-card__aside {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: var(--ofa-space-2);
}

.ofa-comm-card__chevron {
    color: var(--ofa-text-subtle);
    display: inline-flex;
    transition: color .14s ease, transform .14s ease;
}

.ofa-comm-card:hover .ofa-comm-card__chevron {
    color: var(--ofa-blue-600);
    transform: translateX(2px);
}

.ofa-cell-link {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-align: left;
}

.ofa-cell-link:hover {
    color: var(--ofa-blue-600);
}

.ofa-meta {
    color: var(--ofa-text-muted);
    font-size: 13px;
}

/* Narrow viewports read the same table as stacked cards. */
@media (max-width: 767px) {
    .ofa-table thead {
        border: 0;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    .ofa-table,
    .ofa-table tbody,
    .ofa-table tr,
    .ofa-table td {
        display: block;
        width: 100%;
    }

    .ofa-table tr {
        border-bottom: 1px solid var(--ofa-border);
        padding: var(--ofa-space-3) 0;
    }

    .ofa-table tbody tr:last-child {
        border-bottom: none;
    }

    .ofa-table td {
        border: none;
        display: flex;
        gap: var(--ofa-space-4);
        justify-content: space-between;
        padding: var(--ofa-space-2) var(--ofa-space-4);
    }

    .ofa-table td::before {
        color: var(--ofa-text-muted);
        content: attr(data-label);
        font-size: 11.5px;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .ofa-table td.ofa-table__actions {
        justify-content: flex-end;
        text-align: right;
    }
}

/* --------------------------------------------------------------- banners */

.ofa-banner {
    border-radius: var(--ofa-radius-card);
    display: flex;
    gap: var(--ofa-space-3);
    padding: var(--ofa-space-4) var(--ofa-space-5);
}

.ofa-banner p {
    margin: 0;
}

.ofa-banner p + p {
    margin-top: var(--ofa-space-2);
}

.ofa-banner--info {
    background: var(--ofa-blue-100);
    color: var(--ofa-ink-900);
}

.ofa-banner--success {
    background: var(--ofa-success-100);
    color: var(--ofa-success-700);
}

.ofa-banner--warning {
    background: var(--ofa-warning-100);
    color: var(--ofa-warning-700);
}

.ofa-banner--danger {
    background: var(--ofa-danger-100);
    color: var(--ofa-danger-700);
}

/* ------------------------------------------------------- one-time secret */

.ofa-secret {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-violet-500);
    border-radius: var(--ofa-radius-card);
    padding: var(--ofa-space-5);
}

.ofa-secret__title {
    align-items: center;
    display: flex;
    font-size: 15px;
    font-weight: 700;
    gap: var(--ofa-space-2);
}

.ofa-secret__code {
    background: var(--ofa-canvas);
    border: 1px dashed var(--ofa-border-strong);
    border-radius: var(--ofa-radius-control);
    display: block;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 15px;
    margin: var(--ofa-space-3) 0;
    overflow-wrap: anywhere;
    padding: var(--ofa-space-3);
    user-select: all;
}

.ofa-secret__notes {
    color: var(--ofa-text-muted);
    font-size: 13px;
    margin: 0;
    padding-left: var(--ofa-space-5);
}

/* ------------------------------------------------- states: empty/loading */

.ofa-state {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
    padding: var(--ofa-space-9) var(--ofa-space-6);
    text-align: center;
}

.ofa-state__title {
    font-size: 16px;
    font-weight: 700;
}

.ofa-state__body {
    color: var(--ofa-text-muted);
    margin: 0;
    max-width: 46ch;
}

.ofa-skeleton {
    background: linear-gradient(90deg, #EEF1F8 25%, #F6F8FD 37%, #EEF1F8 63%);
    background-size: 400% 100%;
    border-radius: 8px;
    height: 14px;
}

.ofa-skeleton-row {
    align-items: center;
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    gap: var(--ofa-space-4);
    padding: var(--ofa-space-4) var(--ofa-space-5);
}

.ofa-skeleton-row:last-child {
    border-bottom: none;
}

@media (prefers-reduced-motion: no-preference) {
    .ofa-skeleton {
        animation: ofa-shimmer 1.4s ease-in-out infinite;
    }
}

@keyframes ofa-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ------------------------------------------------------------- busy state */

.ofa-busy {
    align-items: center;
}

/* Static under reduced motion, where the ring plus its sentence still say that
   something is running. */
.ofa-busy__spinner {
    border: 2px solid var(--ofa-blue-400);
    border-radius: 50%;
    border-top-color: var(--ofa-blue-600);
    flex: 0 0 auto;
    height: 16px;
    width: 16px;
}

@media (prefers-reduced-motion: no-preference) {
    .ofa-busy__spinner {
        animation: ofa-spin .9s linear infinite;
    }
}

@keyframes ofa-spin {
    to { transform: rotate(360deg); }
}
/* ---------------------------------------------------------------- drawer */

.ofa-scrim {
    background: var(--ofa-scrim);
    border: 0;
    inset: 0;
    padding: 0;
    position: fixed;
    z-index: 40;
}

.ofa-drawer {
    background: var(--ofa-surface);
    border-left: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-panel) 0 0 var(--ofa-radius-panel);
    bottom: 0;
    box-shadow: var(--ofa-shadow-raised);
    display: flex;
    flex-direction: column;
    max-width: 100vw;
    position: fixed;
    right: 0;
    top: 0;
    width: 420px;
    z-index: 41;
    animation: ofa-drawer-in .18s ease-out;
}

.ofa-drawer__header {
    align-items: flex-start;
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    gap: var(--ofa-space-3);
    justify-content: space-between;
    padding: var(--ofa-space-5) var(--ofa-space-6);
}

.ofa-drawer__title {
    font-size: 18px;
    font-weight: 700;
}

.ofa-drawer__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--ofa-space-6);
    scrollbar-color: rgba(100, 116, 139, .30) transparent;
    scrollbar-width: thin;
}

.ofa-drawer__body::-webkit-scrollbar {
    width: 5px;
}

.ofa-drawer__body::-webkit-scrollbar-track {
    background: transparent;
}

.ofa-drawer__body::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, .28);
    border-radius: 999px;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes ofa-drawer-in {
        from { opacity: 0; transform: translateX(18px); }
        to { opacity: 1; transform: translateX(0); }
    }
}

.ofa-drawer__footer {
    border-top: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    gap: var(--ofa-space-3);
    justify-content: flex-end;
    padding: var(--ofa-space-4) var(--ofa-space-6);
}

/* ---------------------------------------------------------------- dialog */

.ofa-dialog {
    background: var(--ofa-surface);
    border-radius: var(--ofa-radius-panel);
    box-shadow: var(--ofa-shadow-raised);
    left: 50%;
    max-width: calc(100vw - 32px);
    padding: var(--ofa-space-6);
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(480px, calc(100vw - 32px));
    z-index: 41;
}

.ofa-dialog--wide {
    width: min(640px, calc(100vw - 32px));
}

.ofa-dialog__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--ofa-space-3);
}

.ofa-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
    margin-block: var(--ofa-space-4);
}

.ofa-dialog__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
    justify-content: flex-end;
    margin-top: var(--ofa-space-5);
}

/* ------------------------------------------------------ entry / branding */

.ofa-entry {
    display: grid;
    gap: var(--ofa-space-6);
    margin: 0 auto;
    max-width: 560px;
    padding: var(--ofa-space-8) var(--ofa-space-5) var(--ofa-space-9);
}

.ofa-entry__brand {
    display: block;
    height: auto;
    margin: 0 auto;
    width: 240px;
}

.ofa-entry__tagline {
    color: var(--ofa-text-muted);
    margin: 0;
    text-align: center;
}

/* Decorative only: never over navigation, tables, forms or error text. */
.ofa-orbit {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

.ofa-orbit::before {
    background: radial-gradient(circle, rgba(124, 58, 237, .13) 0%, rgba(124, 58, 237, 0) 70%);
    border-radius: 50%;
    content: "";
    height: 420px;
    position: absolute;
    right: -140px;
    top: -180px;
    width: 420px;
}

.ofa-orbit::after {
    border: 1px solid rgba(37, 99, 235, .12);
    border-radius: 50%;
    content: "";
    height: 320px;
    position: absolute;
    right: -80px;
    top: -60px;
    width: 320px;
}

/* ------------------------------------------------------------------ tabs */

.ofa-tabs {
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-1);
}

.ofa-tab {
    align-items: center;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--ofa-radius-control) var(--ofa-radius-control) 0 0;
    color: var(--ofa-text-muted);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 600;
    gap: var(--ofa-space-2);
    margin-bottom: -1px;
    padding: var(--ofa-space-3) var(--ofa-space-4);
}

.ofa-tab:hover {
    background: var(--ofa-hover-surface);
    color: var(--ofa-text);
}

.ofa-tab[aria-selected="true"] {
    border-bottom-color: var(--ofa-blue-600);
    color: var(--ofa-blue-600);
}

/* ------------------------------------------------------------------ care */

.ofa-journey-summary {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-6);
    justify-content: space-between;
}

.ofa-journey-summary__name {
    font-size: 18px;
    font-weight: 650;
    margin: var(--ofa-space-1) 0 var(--ofa-space-1);
}

.ofa-progress {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    min-width: 220px;
}

.ofa-progress__track {
    background: var(--ofa-blue-100);
    border-radius: var(--ofa-radius-pill);
    height: 8px;
    overflow: hidden;
}

.ofa-progress__fill {
    background: var(--ofa-gradient);
    border-radius: var(--ofa-radius-pill);
    display: block;
    height: 100%;
}

/* A journey step is coordination state, so the accent tracks progress only:
   violet for what is happening now, green for what is done, neutral for the
   rest. No colour here carries clinical meaning. */
.ofa-steps {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
    list-style: none;
    margin: var(--ofa-space-5) 0 var(--ofa-space-5);
    padding: 0;
}

.ofa-step {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-left: 3px solid var(--ofa-border-strong);
    border-radius: var(--ofa-radius-card);
    display: flex;
    gap: var(--ofa-space-4);
    padding: var(--ofa-space-4) var(--ofa-space-5);
}

.ofa-step--inprogress {
    border-left-color: var(--ofa-violet-600);
}

.ofa-step--completed {
    border-left-color: var(--ofa-success-600);
}

.ofa-step--skipped {
    border-left-color: var(--ofa-warning-600);
}

.ofa-step__marker {
    align-items: center;
    background: var(--ofa-canvas);
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-text-muted);
    display: flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 650;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.ofa-step--inprogress .ofa-step__marker {
    background: var(--ofa-violet-100);
    color: var(--ofa-violet-700);
}

.ofa-step--completed .ofa-step__marker {
    background: var(--ofa-success-100);
    color: var(--ofa-success-700);
}

.ofa-step__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--ofa-space-2);
    min-width: 0;
}

.ofa-step__title {
    font-weight: 600;
    margin: 0;
}

.ofa-step__text {
    color: var(--ofa-text-muted);
    margin: 0;
}

.ofa-step__actions {
    margin-top: var(--ofa-space-1);
}

.ofa-step-form {
    border-top: 1px solid var(--ofa-border);
    margin-top: var(--ofa-space-6);
    padding-top: var(--ofa-space-5);
}

.ofa-appointments {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
    list-style: none;
    margin: var(--ofa-space-3) 0 var(--ofa-space-5);
    padding: 0;
}

.ofa-appointment {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-left: 4px solid var(--ofa-blue-500);
    border-radius: var(--ofa-radius-card);
    box-shadow: var(--ofa-shadow-card);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    padding: var(--ofa-space-4) var(--ofa-space-5);
    position: relative;
}

.ofa-appointment--menu-open {
    z-index: 25;
}

.ofa-appointment--completed {
    border-left-color: var(--ofa-success-600);
}

.ofa-appointment--cancelled {
    border-left-color: var(--ofa-danger-600);
}

.ofa-appointment--noshow {
    border-left-color: #EA580C;
}

.ofa-appointment--outcome {
    border-left-color: var(--ofa-warning-600);
}

.ofa-appointment__header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
    justify-content: space-between;
}

.ofa-appointment__header-right {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    margin-left: auto;
}

.ofa-appointment__menu-wrap {
    position: relative;
}

.ofa-appointment__menu-trigger {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 9px;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    padding: 0;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease,
        box-shadow .15s ease, transform .15s ease;
    width: 34px;
}

.ofa-appointment__menu-trigger:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-border-strong);
    color: var(--ofa-text);
}

.ofa-appointment__menu-trigger.is-open {
    background: var(--ofa-selected-surface);
    border-color: var(--ofa-blue-400);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ofa-blue-500) 16%, transparent);
    color: var(--ofa-blue-600);
}

.ofa-appointment__menu-trigger:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.ofa-appointment__menu-backdrop {
    background: transparent;
    border: none;
    cursor: default;
    inset: 0;
    margin: 0;
    padding: 0;
    position: fixed;
    z-index: 29;
}

.ofa-appointment__menu {
    animation: ofa-menu-pop .16s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .16), 0 3px 10px rgba(15, 23, 42, .07);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    transform-origin: top right;
    z-index: 30;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes ofa-menu-pop {
        from {
            opacity: 0;
            transform: translateY(-6px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

.ofa-appointment__menu-item {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--ofa-text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    gap: 10px;
    padding: 8px 10px;
    text-align: left;
    transition: background-color .13s ease, color .13s ease, transform .13s ease;
    width: 100%;
}

.ofa-appointment__menu-item:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
    transform: translateX(1px);
}

.ofa-appointment__menu-item:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.ofa-appointment__menu-item--danger {
    color: var(--ofa-danger-700);
}

.ofa-appointment__menu-item--danger:hover:not(:disabled) {
    background: var(--ofa-danger-100);
    color: var(--ofa-danger-700);
}

.ofa-appointment__menu-icon {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 7px;
    color: var(--ofa-text-secondary);
    display: inline-flex;
    flex: 0 0 auto;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.ofa-appointment__menu-icon--blue {
    background: var(--ofa-blue-100);
    border-color: color-mix(in srgb, var(--ofa-blue-600) 24%, transparent);
    color: var(--ofa-blue-600);
}

.ofa-appointment__menu-icon--success {
    background: var(--ofa-success-100);
    border-color: color-mix(in srgb, var(--ofa-success-600) 24%, transparent);
    color: var(--ofa-success-700);
}

.ofa-appointment__menu-icon--noshow {
    background: #FFEDD5;
    border-color: rgba(234, 88, 12, .25);
    color: #C2410C;
}

html[data-theme="dark"] .ofa-appointment__menu-icon--noshow {
    background: #432010;
    border-color: rgba(251, 146, 60, .3);
    color: #FDBA74;
}

.ofa-appointment__menu-icon--danger {
    background: var(--ofa-danger-100);
    border-color: color-mix(in srgb, var(--ofa-danger-600) 24%, transparent);
    color: var(--ofa-danger-700);
}

.ofa-appointment__menu-label {
    flex: 1;
    white-space: nowrap;
}

.ofa-appointment__menu-divider {
    background: var(--ofa-border);
    height: 1px;
    margin: 4px 6px;
}

.ofa-appointment__heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ofa-appointment__body {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ofa-appointment__side {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    justify-content: space-between;
}

.ofa-appointment__title {
    color: var(--ofa-text);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.ofa-appointment__when {
    align-items: center;
    color: var(--ofa-blue-600);
    display: inline-flex;
    font-size: 13.5px;
    font-weight: 650;
    gap: 6px;
    margin: 0;
}

.ofa-appointment__location {
    align-items: center;
    color: var(--ofa-text-secondary);
    display: inline-flex;
    font-size: 13.5px;
    font-weight: 600;
    gap: 6px;
    margin: 0;
}

.ofa-appointment__detail {
    color: var(--ofa-text-secondary);
    font-size: 13.5px;
    line-height: 1.45;
    margin: 0;
}

.ofa-appointment__detail strong {
    color: var(--ofa-text);
    font-weight: 700;
    margin-right: 4px;
}

.ofa-appointment__notes {
    color: var(--ofa-text-secondary);
    font-size: 13.5px;
    margin: 0;
}

.ofa-appointment__actions {
    align-items: center;
    border-top: 1px solid var(--ofa-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    justify-content: flex-end;
    margin-top: var(--ofa-space-1);
    padding-top: var(--ofa-space-3);
}

.ofa-btn--soft-blue {
    background: var(--ofa-blue-100);
    border-color: color-mix(in srgb, var(--ofa-blue-600) 28%, var(--ofa-border));
    color: var(--ofa-blue-600);
}

.ofa-btn--soft-blue:hover:not(:disabled) {
    background: color-mix(in srgb, var(--ofa-blue-600) 18%, var(--ofa-blue-100));
    border-color: var(--ofa-blue-500);
}

.ofa-btn--soft-success {
    background: var(--ofa-success-100);
    border-color: color-mix(in srgb, var(--ofa-success-600) 32%, var(--ofa-border));
    color: var(--ofa-success-700);
}

.ofa-btn--soft-success:hover:not(:disabled) {
    background: color-mix(in srgb, var(--ofa-success-600) 18%, var(--ofa-success-100));
    border-color: var(--ofa-success-600);
}

.ofa-btn--soft-noshow {
    background: #FFEDD5;
    border-color: #FDBA74;
    color: #9A3412;
}

.ofa-btn--soft-noshow:hover:not(:disabled) {
    background: #FED7AA;
    border-color: #FB923C;
}

html[data-theme="dark"] .ofa-btn--soft-noshow {
    background: #4A2410;
    border-color: #9A3412;
    color: #FDBA74;
}

.scheduling-narrative {
    background: var(--ofa-surface-subtle);
    border-left: 3px solid var(--ofa-brand-primary);
    border-radius: var(--ofa-radius-control);
    color: var(--ofa-text-secondary);
    font-size: 13px;
    line-height: 1.45;
    margin-top: var(--ofa-space-2);
    padding: var(--ofa-space-2) var(--ofa-space-3);
}

.ofa-drawer--wide {
    width: min(580px, 100vw);
}

.scheduling-ai {
    background: color-mix(in srgb, var(--ofa-violet-100) 45%, var(--ofa-surface));
    border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 38%, var(--ofa-border));
    border-radius: var(--ofa-radius-card);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
    padding: var(--ofa-space-4);
}

.scheduling-ai__head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    justify-content: space-between;
}

.scheduling-ai__title {
    align-items: center;
    color: var(--ofa-violet-700);
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    margin: 0;
}

.scheduling-ai__messages {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    max-height: 17rem;
    overflow-y: auto;
    padding-right: 4px;
}

.scheduling-ai__bubble {
    border-radius: var(--ofa-radius-control);
    font-size: 13.5px;
    line-height: 1.45;
    padding: var(--ofa-space-3);
}

.scheduling-ai__bubble--assistant {
    background: var(--ofa-surface);
    border: 1px solid color-mix(in srgb, var(--ofa-violet-500) 35%, var(--ofa-border));
    color: var(--ofa-text);
}

.scheduling-ai__bubble--user {
    align-self: flex-end;
    background: var(--ofa-teal-700);
    color: var(--ofa-on-human);
    max-width: 88%;
}

.scheduling-ai__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--ofa-space-2);
}

.scheduling-ai__chip {
    background: var(--ofa-violet-100);
    border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 38%, transparent);
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-violet-700);
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 11px;
    text-align: left;
    transition: background-color .14s ease, border-color .14s ease;
}

.scheduling-ai__chip:hover {
    background: color-mix(in srgb, var(--ofa-violet-600) 18%, var(--ofa-violet-100));
    border-color: var(--ofa-violet-600);
}

.scheduling-ai__composer {
    align-items: center;
    display: flex;
    gap: var(--ofa-space-2);
}

.scheduling-ai__composer .ofa-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* A change request is a message from the patient, never a schedule change, so
   it is flagged as an open question rather than as a new time. */
.ofa-appointment__request {
    align-items: center;
    color: var(--ofa-warning-700);
    display: flex;
    font-size: 13px;
    gap: var(--ofa-space-2);
    margin: var(--ofa-space-2) 0 0;
}

/* --------------------------------------------------------------- helpers */

.ofa-visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.ofa-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-4);
}

/* Separate sections (each itself a stack) inside one surface, such as a drawer body. */
.ofa-stack--sections {
    gap: var(--ofa-space-6);
}

.ofa-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
}

.ofa-row--end {
    justify-content: flex-end;
}

.ofa-icon {
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: middle;
}

.ofa-form-status {
    margin: var(--ofa-space-4) 0 0;
}

@media (max-width: 767px) {
    .ofa-page {
        padding: var(--ofa-space-5) var(--ofa-space-4) var(--ofa-space-8);
    }

    .ofa-page-title {
        font-size: 25px;
    }

    .ofa-card {
        padding: var(--ofa-space-5);
    }

    .ofa-drawer {
        border-radius: var(--ofa-radius-panel) var(--ofa-radius-panel) 0 0;
        border-left: none;
        border-top: 1px solid var(--ofa-border);
        bottom: 0;
        max-height: calc(100dvh - 16px);
        overflow: hidden;
        top: auto;
        width: 100%;
    }

    .ofa-drawer__header {
        padding: 14px 16px;
    }

    .ofa-drawer__body {
        padding: 14px 16px;
    }

    .ofa-drawer__footer {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    /* On a phone the care lists become single-column blocks so nothing is
       squeezed into an unreadable column. */
    .ofa-journey-summary,
    .ofa-appointment {
        flex-direction: column;
        align-items: stretch;
    }

    .ofa-appointment__side {
        align-items: flex-start;
    }

    .ofa-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .ofa-tab {
        white-space: nowrap;
    }
}

/* --------------------------------------------------------- framework ui */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--ofa-success-600);
}

.invalid {
    outline: 1px solid var(--ofa-danger-600);
}

.validation-message {
    color: var(--ofa-danger-700);
}

.blazor-error-boundary {
    background: var(--ofa-danger-700);
    border-radius: var(--ofa-radius-card);
    color: #fff;
    padding: var(--ofa-space-4) var(--ofa-space-5);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ------------------------------------------------------- care workspace */

/* Chat owns 70% of the workspace. Patient details are an optional companion,
   never a permanent column. Small screens keep one conversation pane at a time. */

.workspace__grid {
    display: grid;
    gap: var(--ofa-space-5);
    grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
    align-items: stretch;
}

.workspace__grid--two {
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
}

.workspace--conversation {
    gap: var(--ofa-space-2);
    height: calc(100dvh - var(--ofa-topbar-height));
    min-height: 40rem;
    padding-top: var(--ofa-space-2);
    padding-bottom: var(--ofa-space-2);
}

.workspace--conversation .ofa-page-title {
    font-size: 24px;
}

.workspace--conversation .ofa-page-header__text {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--ofa-space-2) var(--ofa-space-4);
}

.workspace--conversation .ofa-eyebrow {
    display: none;
}

.workspace--conversation .ofa-page-purpose {
    margin: 0;
}

.workspace--conversation > .workspace__grid {
    flex: 1;
    min-height: 0;
}

.workspace--conversation .workspace__col {
    height: 100%;
    min-height: 0;
    min-width: 0;
}

.workspace--conversation .workspace__col > .workspace__panel {
    height: 100%;
    min-height: 0;
}

.workspace--conversation .workspace__list {
    flex: 1;
    min-height: 0;
    max-height: none;
}

.workspace__connection {
    margin: 0;
}

.workspace__panel {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-panel);
    box-shadow: var(--ofa-shadow-card);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-4);
    padding: var(--ofa-space-5);
}

.workspace__panel--empty {
    justify-content: center;
    min-height: 320px;
}

.workspace__panel--thread {
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.workspace__main > :not(.workspace__transcript) {
    flex-shrink: 0;
}

.workspace__conversation-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    flex: 1;
    min-height: 0;
}

.workspace__conversation-body--context {
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 34%);
}

.workspace__main {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    min-width: 0;
    min-height: 0;
    padding: var(--ofa-space-3) var(--ofa-space-4);
}

.workspace__context {
    background: var(--ofa-canvas-soft);
    border-left: 1px solid var(--ofa-border);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-4);
    padding: var(--ofa-space-3) var(--ofa-space-4);
    min-width: 0;
    min-height: 0;
}

.workspace__context-body:focus-visible,
.workspace__messages:focus-visible {
    outline: 2px solid var(--ofa-blue-600);
    outline-offset: 2px;
}

.workspace__context-body {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-4);
    overflow-y: auto;
    overflow-wrap: anywhere;
    padding: var(--ofa-space-1);
}

.workspace__context-item {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-1);
    font-size: 13px;
}

.workspace__context .workspace__facts {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ofa-space-1);
}

.workspace__context .workspace__facts dd {
    margin-bottom: var(--ofa-space-2);
}

.workspace__search {
    display: flex;
    align-items: center;
    gap: var(--ofa-space-2);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-control);
    background: var(--ofa-canvas);
    padding: var(--ofa-space-2) var(--ofa-space-3);
    color: var(--ofa-text-muted);
}

.workspace__search input {
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 13px;
    min-width: 0;
    width: 100%;
    color: var(--ofa-text);
}

.workspace__panel-head {
    align-items: center;
    display: flex;
    gap: var(--ofa-space-3);
    justify-content: space-between;
}

.workspace__panel-title {
    font-size: 16px;
    font-weight: 700;
}

.workspace__subhead {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ofa-text-muted);
}

.workspace__toggle {
    align-items: center;
    color: var(--ofa-text-muted);
    display: flex;
    font-size: 13px;
    gap: var(--ofa-space-2);
}

.workspace__scopes {
    align-items: center;
    display: flex;
    gap: var(--ofa-space-2);
    flex-wrap: wrap;
}

.workspace__refresh-btn {
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-text-muted);
    height: 34px;
    margin-left: auto;
    min-height: 34px;
    padding: 0;
    width: 34px;
}

.workspace__refresh-btn:hover:not(:disabled) {
    background: var(--ofa-canvas);
    color: var(--ofa-blue-600);
}

.workspace__alerts-nudge {
    align-items: center;
    background: var(--ofa-blue-100);
    border: 1px solid color-mix(in srgb, var(--ofa-blue-400) 40%, var(--ofa-border));
    border-radius: 10px;
    color: var(--ofa-ink-900);
    display: flex;
    font-size: 12.5px;
    gap: 8px;
    justify-content: space-between;
    padding: 7px 11px;
}

.workspace__alerts-nudge-text {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.workspace__alerts-nudge-link {
    color: var(--ofa-blue-600);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.workspace__alerts-nudge-link:hover {
    text-decoration: underline;
}

.workspace__scope {
    background: var(--ofa-canvas);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: var(--ofa-space-2) var(--ofa-space-3);
}

.workspace__scope--current {
    background: var(--ofa-blue-100);
    border-color: var(--ofa-blue-400);
    color: var(--ofa-ink-900);
}

.workspace__list {
    display: flex;
    flex-direction: column;
    max-height: 62vh;
    overflow-y: auto;
}

.workspace__item {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-control);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: var(--ofa-space-1);
    padding: var(--ofa-space-3);
    text-align: left;
    width: 100%;
}

.workspace__item:hover {
    background: var(--ofa-canvas);
}

.workspace__item--current {
    background: var(--ofa-blue-100);
    box-shadow: inset 3px 0 var(--ofa-blue-600);
}

.workspace__item-top {
    align-items: baseline;
    display: flex;
    gap: var(--ofa-space-3);
    justify-content: space-between;
}

.workspace__item-patient {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.workspace__item-age {
    color: var(--ofa-text-muted);
    font-size: 12.5px;
    white-space: nowrap;
}

.workspace__item-subject {
    color: var(--ofa-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace__item-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
}

.workspace__unassigned {
    font-size: 12px;
    color: var(--ofa-text-muted);
}

.workspace__thread-head {
    align-items: center;
    display: flex;
    gap: var(--ofa-space-3);
    flex-wrap: wrap;
    padding: var(--ofa-space-4);
    border-bottom: 1px solid var(--ofa-border);
}

.workspace__thread-title {
    flex: 1 1 15rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.workspace__patient-heading {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.workspace__patient-name-link {
    background: transparent;
    border: 0;
    color: var(--ofa-blue-600);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    margin: 0;
    padding: 0;
    text-align: left;
    transition: color .14s ease;
}

.workspace__patient-name-link:hover,
.workspace__patient-name-link:focus-visible {
    color: var(--ofa-brand-primary-hover);
    text-decoration: underline;
}

.workspace__patient-ref {
    font-size: 13px;
    font-weight: 500;
}

.workspace__patient-info-btn {
    align-items: center;
    background: color-mix(in srgb, var(--ofa-blue-600) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--ofa-blue-600) 22%, transparent);
    border-radius: 8px;
    color: var(--ofa-blue-600);
    cursor: pointer;
    display: inline-flex;
    height: 26px;
    justify-content: center;
    margin-left: 2px;
    min-height: 26px;
    padding: 0;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
    width: 26px;
}

.workspace__patient-info-btn:hover,
.workspace__patient-info-btn--active {
    background: var(--ofa-blue-100);
    border-color: var(--ofa-blue-500);
    color: var(--ofa-ink-900);
}

.workspace__subject {
    color: var(--ofa-text-muted);
    font-size: 13px;
    margin: var(--ofa-space-1) 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace__thread-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    align-items: center;
    align-self: center;
}

.workspace__thread-badges .ofa-badge {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    line-height: 1.2;
}

/* The back affordance only exists when the two panes have collapsed into one. */
.workspace__back {
    display: none;
}

.workspace__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
}

.workspace__transfer {
    margin-left: auto;
    font-size: 13px;
    max-width: 100%;
}

.workspace__transfer summary {
    cursor: pointer;
    min-height: 40px;
    padding: var(--ofa-space-1) var(--ofa-space-2);
    color: var(--ofa-blue-600);
    font-weight: 600;
}

.workspace__transfer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    padding: var(--ofa-space-2) 0;
}

.workspace__transfer .ofa-select {
    max-width: 18rem;
    min-width: 0;
}

.workspace__ownership {
    display: flex;
    align-items: center;
    gap: var(--ofa-space-2);
    margin: 0;
    font-size: 12px;
    color: var(--ofa-text-muted);
}

.workspace__ownership p {
    margin: 0;
}

.workspace__section {
    border-top: 1px solid var(--ofa-border);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    padding-top: var(--ofa-space-4);
}

.workspace__details {
    margin: 0;
    white-space: pre-wrap;
}

.workspace__facts {
    display: grid;
    gap: var(--ofa-space-1) var(--ofa-space-4);
    grid-template-columns: auto 1fr;
    margin: 0;
}

.workspace__facts dt {
    color: var(--ofa-text-muted);
    font-size: 12.5px;
}

.workspace__facts dd {
    margin: 0;
}

.workspace__minimum {
    border-left: 2px solid var(--ofa-border-strong);
    padding-left: var(--ofa-space-3);
}

.workspace__linked {
    border-top: 1px solid var(--ofa-border);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    padding-top: var(--ofa-space-4);
}

.workspace__linked-list {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.workspace__linked-link {
    background: none;
    border: 0;
    color: var(--ofa-blue-600);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-align: left;
}

.workspace__linked-link:hover {
    text-decoration: underline;
}

.workspace__trail {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.workspace__trail li {
    align-items: baseline;
    display: flex;
    gap: var(--ofa-space-3);
    justify-content: space-between;
}

.workspace__trail-label {
    font-size: 14px;
}

.workspace__messages {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
    max-height: 48vh;
    overflow-y: auto;
    padding: var(--ofa-space-3) var(--ofa-space-2);
}

.workspace__transcript {
    flex: 1;
    min-height: 8rem;
    position: relative;
    display: flex;
}

.workspace--conversation .workspace__messages {
    flex: 1;
    min-height: 8rem;
    max-height: none;
    overscroll-behavior: contain;
    width: 100%;
}

.workspace__day {
    align-self: center;
    color: var(--ofa-text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: var(--ofa-space-2);
}

.workspace__new-messages {
    position: absolute;
    bottom: var(--ofa-space-2);
    left: 50%;
    transform: translateX(-50%);
    box-shadow: var(--ofa-shadow-raised);
}

.workspace__new-messages[hidden] {
    display: none;
}

.workspace--conversation .workspace__composer-input {
    max-height: 8rem;
}

.workspace__closed {
    border-top: 1px solid var(--ofa-border);
    padding-top: var(--ofa-space-4);
}

.workspace__composer {
    border-top: 1px solid var(--ofa-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
}

.workspace__composer--internal {
    background: transparent;
}

.workspace__composer-row {
    align-items: flex-end;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    display: flex;
    gap: 10px;
    padding: 6px 8px 6px 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.workspace__composer-row:focus-within {
    border-color: var(--ofa-blue-600);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ofa-blue-600) 14%, transparent);
}

.workspace__composer-row--internal,
.workspace__composer-row--internal:focus-within {
    background: var(--ofa-surface);
    border-color: #E5A93C;
    box-shadow: 0 0 0 2px rgba(229, 169, 60, .14);
}

.workspace__composer-row--locked {
    background: var(--ofa-canvas-soft);
    border-style: dashed;
    opacity: .75;
}

.workspace__note-toggle-wrap {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    position: relative;
}

.workspace__note-toggle {
    align-items: center;
    background: color-mix(in srgb, var(--ofa-text) 6%, transparent);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ofa-text-muted);
    cursor: pointer;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    min-height: 38px;
    padding: 0;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
    width: 34px;
}

.workspace__note-toggle:hover:not(:disabled),
.workspace__note-toggle:focus-visible:not(:disabled) {
    background: #FDE68A;
    border-color: #F59E0B;
    color: #78350F;
}

.workspace__note-toggle--active,
.workspace__note-toggle--active:hover:not(:disabled) {
    background: #FCD34D;
    border-color: #E5A93C;
    color: #1E293B;
}

.workspace__note-toggle:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.workspace__note-tooltip {
    background: #0F172A;
    border-radius: 8px;
    bottom: calc(100% + 9px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .22);
    color: #FFFFFF;
    font-size: 11.5px;
    font-weight: 500;
    left: 50%;
    line-height: 1.35;
    opacity: 0;
    padding: 6px 10px;
    pointer-events: none;
    position: absolute;
    text-align: center;
    transform: translateX(-50%) translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    visibility: hidden;
    white-space: nowrap;
    z-index: 40;
}

.workspace__note-tooltip::after {
    border-color: #0F172A transparent transparent transparent;
    border-style: solid;
    border-width: 5px 5px 0 5px;
    content: "";
    left: 50%;
    position: absolute;
    top: 100%;
    transform: translateX(-50%);
}

.workspace__note-toggle-wrap:hover .workspace__note-tooltip,
.workspace__note-toggle:focus-visible + .workspace__note-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    visibility: visible;
}

.workspace__claim-gate {
    align-items: center;
    background: var(--ofa-teal-100);
    border: 1px solid var(--ofa-teal-600);
    border-radius: var(--ofa-radius-control);
    color: var(--ofa-teal-700);
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 500;
    gap: var(--ofa-space-2);
    justify-content: space-between;
    padding: 8px 12px;
}

.workspace__claim-gate-text {
    align-items: center;
    display: flex;
    flex: 1 1 240px;
    gap: var(--ofa-space-2);
}

.workspace__composer-input,
.workspace__composer-input.ofa-input {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--ofa-text);
    field-sizing: content;
    flex: 1 1 auto;
    font-size: 16px;
    line-height: 1.5;
    max-height: 160px;
    min-height: 40px;
    overflow-y: auto;
    padding: 8px 0;
    resize: none;
}

.workspace__composer-input::placeholder,
.workspace__composer-input.ofa-input::placeholder {
    color: var(--ofa-text-muted);
    font-size: 16px;
    opacity: 1;
}

.workspace__composer-input:focus,
.workspace__composer-input.ofa-input:focus {
    border: 0;
    box-shadow: none;
    outline: none;
}

.workspace__send-btn {
    border-radius: 9px;
    flex: 0 0 auto;
    font-size: 14.5px;
    height: 40px;
    min-height: 40px;
    padding: 0 16px;
    white-space: nowrap;
}

.workspace__send-btn--internal {
    background: #F6C453;
    border: 1px solid #E5A93C;
    color: #111A3A;
    font-weight: 600;
}

.workspace__send-btn--internal:hover:not(:disabled) {
    background: #F5B82E;
    border-color: #D98A16;
    color: #111A3A;
}

.workspace__send-btn--internal:disabled {
    background: #FDE68A;
    border-color: #FCD34D;
    color: #78350F;
    opacity: .65;
}

.workspace__composer-hint {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
}

.workspace__composer-hint--internal strong {
    color: var(--ofa-text);
    font-weight: 600;
}

/* Private assistance stays directly above the draft, integrated with the composer. */
.staff-assist {
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    background: var(--ofa-surface);
    min-width: 0;
}

.staff-assist__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: var(--ofa-space-2);
    padding: 7px 12px;
    min-width: 0;
}

.staff-assist__quick {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.staff-assist__quick::-webkit-scrollbar {
    display: none;
}

.staff-assist__quick .ofa-btn--sm,
.staff-assist__tools .ofa-btn--sm {
    min-height: 34px;
    padding: 5px 13px;
    font-size: 13.75px;
    font-weight: 560;
    white-space: nowrap;
    flex-shrink: 0;
}

.staff-assist__tab {
    background: var(--ofa-surface);
    border-color: var(--ofa-border-strong);
    color: var(--ofa-text);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.staff-assist__tab--ask {
    background: var(--ofa-surface);
    border-color: color-mix(in srgb, var(--ofa-violet-600) 42%, var(--ofa-border));
    color: var(--ofa-violet-700);
}

.staff-assist__tab--active,
.staff-assist__tab--ask.staff-assist__tab--active {
    background: var(--ofa-violet-100);
    border-color: var(--ofa-violet-500);
    box-shadow: 0 1px 2px rgba(109, 53, 232, .12);
    color: var(--ofa-violet-700);
    font-weight: 650;
}

.staff-assist__close {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    flex-shrink: 0;
}

.staff-assist__send {
    min-height: 36px;
    padding: 5px 14px;
    font-size: 13.75px;
    flex-shrink: 0;
}

.staff-assist__toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--ofa-violet-700);
    font: inherit;
    font-size: 14.5px;
    cursor: pointer;
    min-height: 34px;
    flex-shrink: 0;
    white-space: nowrap;
}

.staff-assist__private,
.staff-assist__count {
    font-size: 12.5px;
    color: var(--ofa-violet-700);
    background: var(--ofa-violet-100);
    border-radius: var(--ofa-radius-pill);
    padding: 3px 9px;
}

.staff-assist__mobile-chevron {
    display: none;
}

.staff-assist__content {
    border-top: 1px solid var(--ofa-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
    max-height: 24dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.staff-assist__content > p,
.staff-assist__source p {
    margin: 0;
}

.staff-assist__tools,
.staff-assist__ask {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
}

.staff-assist__ask input {
    flex: 1 1 12rem;
    min-width: 0;
    font-size: 14.5px;
    min-height: 36px;
    padding: 5px 12px;
}

.staff-assist__card {
    border: 1px solid var(--ofa-border);
    background: var(--ofa-surface);
    border-radius: var(--ofa-radius-control);
}

.staff-assist__card > summary {
    cursor: pointer;
    padding: 9px 12px;
    color: var(--ofa-violet-700);
    font-size: 13.5px;
    font-weight: 650;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    list-style: none;
}

.staff-assist__card > summary::-webkit-details-marker {
    display: none;
}

.staff-assist__card-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.staff-assist__refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 2px 8px;
    border: 1px solid color-mix(in srgb, var(--ofa-blue-600) 28%, var(--ofa-border));
    border-radius: var(--ofa-radius-pill);
    background: var(--ofa-blue-50);
    color: var(--ofa-blue-600);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease;
}

.staff-assist__refresh:hover:not(:disabled) {
    background: var(--ofa-blue-100);
    border-color: var(--ofa-blue-500);
}

.staff-assist__refresh:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.staff-assist__sources > summary {
    cursor: pointer;
    padding: 8px 10px;
    color: var(--ofa-violet-700);
    font-size: 12.5px;
    font-weight: 650;
}

.staff-assist__card > summary span {
    float: right;
    color: var(--ofa-text-muted);
    font-size: 12px;
    margin-left: var(--ofa-space-2);
}

.staff-assist__preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 10px;
}

.staff-assist__body,
.staff-assist__draft p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 13.5px;
    line-height: 1.45;
    margin: 0;
}

.staff-assist__draft {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    border-left: 3px solid var(--ofa-violet-500);
    padding: var(--ofa-space-3);
    background: var(--ofa-canvas);
}

.staff-assist__source {
    font-size: 13px;
    padding: var(--ofa-space-3);
    border-top: 1px solid var(--ofa-border);
    overflow-wrap: anywhere;
}

.staff-assist__notice {
    display: flex;
    align-items: center;
    gap: var(--ofa-space-2);
    color: var(--ofa-text-muted);
    font-size: 13px;
}

.staff-assist__footnote {
    color: var(--ofa-text-muted);
    font-size: 12px;
}

.workspace__handoff-review {
    border-left: 3px solid var(--ofa-teal-600);
    border-radius: var(--ofa-radius-control);
    padding: var(--ofa-space-3);
    background: var(--ofa-teal-100);
}

.workspace__handoff-review p {
    margin: var(--ofa-space-2) 0;
}

@media (max-width: 767px) {
    .staff-assist:not(.staff-assist--expanded) .staff-assist__private {
        display: none;
    }
}

/* --------------------------------------------------- routing policy */

.routing-policy {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-4);
}

.routing-policy__row {
    align-items: start;
    display: grid;
    gap: var(--ofa-space-6);
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 24rem);
}

.routing-policy__copy,
.routing-policy__control {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
}

.routing-policy__title-line {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
}

.routing-policy__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
}

.routing-policy__clinical {
    background: var(--ofa-warning-100);
    border-left: 3px solid var(--ofa-warning-600);
    color: var(--ofa-warning-700);
    margin: 0;
    padding: var(--ofa-space-3);
}

@media (max-width: 767px) {
    .routing-policy__row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------- messages */

/* Alignment, actor labels and shape reinforce colour. Staff AI never appears
   in this public log; the violet treatment is for existing patient AI only. */

.msg {
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-card);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-2);
    max-width: 70%;
    padding: var(--ofa-space-3) var(--ofa-space-4);
    flex-shrink: 0;
    font-size: 14px;
}

.msg--patient {
    align-self: flex-start;
    background: var(--ofa-canvas);
    border-bottom-left-radius: var(--ofa-space-1);
}

.msg--human {
    align-self: flex-end;
    background: var(--ofa-teal-700);
    border-color: var(--ofa-teal-700);
    color: var(--ofa-on-human);
    border-bottom-right-radius: var(--ofa-space-1);
}

.msg--pending {
    opacity: .72;
}

.msg--ai {
    align-self: flex-start;
    background: var(--ofa-violet-100);
    border-color: var(--ofa-violet-500);
}

.msg--ai .msg__actor {
    background: color-mix(in srgb, var(--ofa-violet-600) 14%, var(--ofa-surface));
    border-color: color-mix(in srgb, var(--ofa-violet-600) 38%, transparent);
    color: var(--ofa-violet-700);
}

.msg--note {
    align-self: flex-end;
    background: var(--ofa-warning-100);
    border-color: var(--ofa-warning-600);
    border-style: dashed;
}

.msg--system {
    align-self: center;
    max-width: 90%;
    background: transparent;
    border: 0;
    color: var(--ofa-text-muted);
    text-align: center;
    font-size: 12px;
    padding: var(--ofa-space-2) var(--ofa-space-3);
    gap: var(--ofa-space-1);
}

.msg--system .msg__head {
    justify-content: center;
}

.msg--system .msg__time {
    margin-left: 0;
}

.msg__actor {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(16, 36, 95, .04);
    color: var(--ofa-text-secondary);
    display: inline-flex;
    font-size: 11px;
    font-weight: 650;
    height: 20px;
    justify-content: center;
    letter-spacing: .02em;
    line-height: 1;
    min-width: 32px;
    padding: 0 8px;
    vertical-align: middle;
    white-space: nowrap;
}

.msg--human .msg__actor {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .36);
    box-shadow: none;
    color: var(--ofa-on-human);
}

.msg--note .msg__actor {
    background: var(--ofa-warning-100);
    border-color: var(--ofa-warning-600);
    box-shadow: none;
    color: var(--ofa-warning-700);
}

.msg--system .msg__actor {
    background: color-mix(in srgb, var(--ofa-text) 6%, var(--ofa-surface));
    border-color: var(--ofa-border);
    box-shadow: none;
    color: var(--ofa-text-muted);
}

.msg__privacy {
    display: flex;
    align-items: center;
    gap: var(--ofa-space-1);
    margin: 0;
    color: var(--ofa-warning-700);
    font-size: 12px;
    font-weight: 600;
}

.msg__head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 22px;
}

.msg__author {
    align-items: center;
    display: inline-flex;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.2;
}

.msg__team {
    align-items: center;
    color: var(--ofa-teal-700);
    display: inline-flex;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
}

.msg__note-flag {
    align-items: center;
    color: var(--ofa-warning-700);
    display: inline-flex;
    font-size: 12.5px;
    font-weight: 700;
    gap: 4px;
}

.msg__time {
    align-items: center;
    color: var(--ofa-text-muted);
    display: inline-flex;
    font-size: 12px;
    line-height: 1.2;
    margin-left: auto;
}

.msg--human .msg__team,
.msg--human .msg__time {
    color: var(--ofa-on-human);
}

.msg__body {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

@media (max-width: 1199px) {
    .workspace__grid--two {
        grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    }

    .workspace__conversation-body--context {
        grid-template-columns: minmax(0, 1fr);
    }

    .workspace__context {
        order: -1;
        border-left: 0;
        border-bottom: 1px solid var(--ofa-border);
        max-height: 20rem;
    }

    .workspace--conversation:has(.workspace__context) {
        height: auto;
    }

    .workspace--conversation:has(.workspace__context) .workspace__transcript {
        min-height: 20rem;
        max-height: 45dvh;
    }
}

@media (max-width: 899px) {
    .workspace__grid,
    .workspace__grid--two {
        grid-template-columns: minmax(0, 1fr);
    }

    /* One pane at a time on a phone: the queue until something is chosen, then
       the thread and its context with a way back. Nothing is squeezed into an
       unreadable column, and nothing is hidden behind a horizontal scroll. */
    .workspace__grid--detail .workspace__col--queue {
        display: none;
    }

    .workspace--conversation .workspace__grid:not(.workspace__grid--detail) .workspace__col--thread {
        display: none;
    }

    .workspace__back {
        display: inline-flex;
    }

    .workspace__list {
        max-height: none;
    }

    .workspace__messages {
        max-height: none;
    }

    .msg {
        max-width: 85%;
    }

    .workspace__composer-row {
        flex-wrap: wrap;
    }

    .workspace__thread-head {
        gap: var(--ofa-space-2);
    }

    .workspace__composer-row .ofa-btn {
        min-height: 44px;
    }

    .workspace button,
    .workspace summary {
        min-height: 44px;
    }
}

@media (max-height: 700px) {
    .workspace--conversation {
        height: auto;
        min-height: 0;
    }

    .workspace--conversation .workspace__messages {
        flex: none;
        max-height: 40dvh;
    }
}

/* Mobile / narrow-viewport chat shell: full-screen ChatGPT/Mobile-app style
   without top page chrome or bottom composer clipping. Placed after the
   max-height rule so compact phone screens keep the composer anchored. */
@media (max-width: 899px) {
    .workspace--conversation {
        gap: 0;
        height: calc(100dvh - var(--ofa-topbar-height));
        min-height: 0;
        padding: 0;
    }

    .workspace--conversation .workspace__page-header,
    .workspace--conversation .workspace__connection {
        display: none;
    }

    .workspace--conversation .workspace__col > .workspace__panel {
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
        border-right: 0;
        box-shadow: none;
    }

    .workspace--conversation .workspace__col--queue > .workspace__panel {
        gap: var(--ofa-space-3);
        padding: var(--ofa-space-3);
    }

    .workspace--conversation .workspace__thread-head {
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px 10px;
    }

    .workspace--conversation .workspace__back {
        height: 34px;
        min-height: 34px;
        padding: 0;
        width: 34px;
    }

    .workspace--conversation .workspace__thread-title {
        flex: 1 1 auto;
    }

    .workspace--conversation .workspace__panel-title {
        font-size: 15px;
    }

    .workspace--conversation .workspace__subject {
        font-size: 12px;
        margin-top: 1px;
    }

    .workspace--conversation .workspace__thread-badges {
        flex-shrink: 0;
        gap: 4px;
    }

    .workspace--conversation .workspace__thread-badges .ofa-badge {
        font-size: 11px;
        padding: 2px 7px;
    }

    .workspace--conversation .workspace__main {
        gap: 6px;
        padding: 6px 10px 8px;
    }

    .workspace--conversation .workspace__ownership {
        font-size: 11.5px;
        gap: 5px;
        margin: 0;
    }

    .workspace--conversation .workspace__actions {
        gap: 6px;
    }

    .workspace--conversation .workspace__actions .ofa-btn,
    .workspace--conversation .workspace__actions summary {
        font-size: 12.5px;
        min-height: 32px;
        padding: 4px 10px;
    }

    .workspace--conversation .workspace__patient-name-link,
    .workspace--conversation .workspace__patient-info-btn,
    .workspace--conversation .workspace__refresh-btn {
        min-height: 28px;
    }

    .workspace--conversation .workspace__transcript {
        flex: 1 1 0%;
        min-height: 0;
    }

    .workspace--conversation .workspace__messages {
        flex: 1 1 0%;
        max-height: none;
        min-height: 0;
        padding: 4px 2px;
    }

    .workspace--conversation .workspace__composer {
        gap: 5px;
        padding-top: 6px;
    }

    .workspace--conversation .workspace__composer-row {
        align-items: flex-end;
        border-radius: 14px;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 5px 6px 5px 12px;
    }

    .workspace--conversation .workspace__composer-input,
    .workspace--conversation .workspace__composer-input.ofa-input {
        font-size: 15.5px;
        max-height: 112px;
        min-height: 38px;
        padding: 6px 0;
    }

    .workspace--conversation .workspace__note-toggle {
        height: 36px;
        min-height: 36px;
        width: 34px;
    }

    .workspace--conversation .workspace__send-btn {
        border-radius: 10px;
        height: 36px;
        min-height: 36px;
        padding: 0 12px;
    }

    .workspace--conversation .workspace__send-label {
        display: none;
    }

    .workspace--conversation .workspace__composer-hint {
        font-size: 11px;
    }

    .workspace--conversation [data-role="composer-shortcut-hint"] {
        display: none;
    }

    /* Collapsible AI Assist tray on mobile: hidden behind a slim AI Assist bar
       until tapped, and wrapped cleanly when opened so no button clips off-screen. */
    .staff-assist__head {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
    }

    .staff-assist__toggle {
        justify-content: flex-start;
        min-height: 34px;
        padding: 4px 10px;
        width: 100%;
    }

    .staff-assist__mobile-chevron {
        align-items: center;
        display: inline-flex;
        margin-left: auto;
    }

    .staff-assist__quick {
        display: none;
        flex-wrap: wrap;
        gap: 6px;
        margin-left: 0;
        overflow-x: visible;
        padding: 0 10px 8px;
    }

    .staff-assist--mobile-open .staff-assist__quick {
        display: flex;
    }

    .staff-assist__quick .ofa-btn--sm {
        font-size: 12.5px;
        min-height: 32px;
        padding: 4px 10px;
    }

    .staff-assist__content {
        max-height: 30dvh;
    }
}

@media (forced-colors: active) {
    .msg--human { border: 2px solid CanvasText; }
    .msg--patient { border: 1px solid CanvasText; }
    .msg--note { border: 2px dashed CanvasText; }
    .workspace__item--current { outline: 2px solid Highlight; }
}

/* Hospital queue topology: eligibility is distinct from actual membership. */
.orchestration__nav,
.orchestration__toolbar,
.orchestration__row-actions {
    display: flex;
    align-items: center;
    gap: var(--ofa-space-2);
    flex-wrap: wrap;
}

.orchestration__toolbar {
    justify-content: space-between;
}

.orchestration__toolbar [role="group"] {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    gap: 2px;
    padding: 3px;
}

.orchestration__toolbar [role="group"] .ofa-btn {
    background: transparent;
    border-color: transparent;
    min-height: 34px;
}

.orchestration__toolbar [role="group"] .ofa-btn[aria-pressed="true"] {
    background: var(--ofa-selected-surface);
    color: var(--ofa-brand-primary);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ofa-brand-primary) 18%, transparent);
}

.orchestration__toolbar p { margin: 0; }
.orchestration__search { flex: 1 1 14rem; max-width: 28rem; }
.orchestration__table-card { padding: 0; overflow: hidden; }
.orchestration .ofa-table th { vertical-align: top; }
.orchestration .ofa-table td { vertical-align: middle; }
.orchestration .ofa-table .ofa-meta { margin: var(--ofa-space-1) 0 0; }
.orchestration .ofa-badge { margin: var(--ofa-space-1); }
.orchestration .ofa-table-wrap { max-width: 100%; }

.orchestration__link {
    border: 0;
    padding: var(--ofa-space-1) 0;
    color: var(--ofa-blue-600);
    background: transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.orchestration__link:hover { text-decoration: underline; }
.orchestration__matrix th { min-width: 7rem; }
.orchestration__matrix td { text-align: center; }
.orchestration__matrix th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 12rem;
    background: var(--ofa-surface);
}
.orchestration__matrix input,
.orchestration__check input { width: 18px; height: 18px; accent-color: var(--ofa-blue-600); }
.orchestration__matrix caption { text-align: left; padding: var(--ofa-space-4); font-size: 13px; }
.orchestration__drawer { width: min(560px, 100vw); }
.orchestration__fieldset {
    padding: var(--ofa-space-4);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-card);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
    min-width: 0;
}
.orchestration__fieldset legend { font-weight: 600; padding: 0 var(--ofa-space-2); }
.orchestration__check { display: flex; align-items: center; gap: var(--ofa-space-2); min-height: 32px; }
.orchestration__impact {
    background: var(--ofa-warning-100);
    color: var(--ofa-warning-700);
    padding: var(--ofa-space-3);
    border-radius: var(--ofa-radius-control);
}
.orchestration__section { border-top: 1px solid var(--ofa-border); margin-top: var(--ofa-space-5); padding-top: var(--ofa-space-4); }
.orchestration__section h3 { font-size: 16px; margin-bottom: var(--ofa-space-3); }
.orchestration__member { display: flex; align-items: center; justify-content: space-between; gap: var(--ofa-space-3); padding: var(--ofa-space-2) 0; }
.orchestration__member > div { min-width: 0; overflow-wrap: anywhere; }
.orchestration__member p { margin: var(--ofa-space-1) 0 0; }
.orchestration__picker { margin-top: var(--ofa-space-3); }
.orchestration__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--ofa-space-4); }
.orchestration__simulator { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ofa-space-4); }
.orchestration__simulator > div:first-child { grid-column: 1 / -1; }
.orchestration__simulator-input.ofa-input {
    line-height: 1.5;
    min-height: 108px;
    padding: 12px 14px;
    resize: vertical;
}
.orchestration__result { display: grid; grid-template-columns: auto 1fr; gap: var(--ofa-space-2) var(--ofa-space-4); margin: 0; }
.orchestration__result dt { color: var(--ofa-text-muted); }
.orchestration__result dd { margin: 0; font-weight: 600; }
@media (max-width: 767px) {
    .orchestration__simulator { grid-template-columns: minmax(0, 1fr); }
    .orchestration__check { min-height: 44px; }
    .orchestration__matrix { display: table; }
    .orchestration__matrix thead { display: table-header-group; }
    .orchestration__matrix tr { display: table-row; }
    .orchestration__matrix th,
    .orchestration__matrix td { display: table-cell; }
}

/* ------------------------------------------------ premium theme layer */

input[type="checkbox"] {
    appearance: none;
    background: var(--ofa-surface);
    border: 1.5px solid var(--ofa-border-strong);
    border-radius: 5px;
    cursor: pointer;
    display: inline-grid;
    flex: 0 0 auto;
    height: 19px;
    margin: 0;
    place-content: center;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
    width: 19px;
}

input[type="checkbox"]::after {
    border: solid var(--ofa-on-brand);
    border-width: 0 2px 2px 0;
    content: "";
    height: 9px;
    opacity: 0;
    transform: rotate(45deg) scale(.65) translate(-1px, -1px);
    transition: opacity .12s ease, transform .12s ease;
    width: 4px;
}

input[type="checkbox"]:hover:not(:disabled) {
    border-color: var(--ofa-brand-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ofa-brand-primary) 10%, transparent);
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--ofa-focus-ring);
    outline-offset: 3px;
}

input[type="checkbox"]:checked {
    background: var(--ofa-brand-primary);
    border-color: var(--ofa-brand-primary);
}

input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: rotate(45deg) scale(1) translate(-1px, -1px);
}

input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.appearance-card {
    padding: var(--ofa-space-6);
}

.appearance-selector {
    border: 0;
    margin: 0;
    padding: 0;
}

.appearance-selector > legend {
    padding: 0;
}

.appearance-selector__options {
    display: grid;
    gap: var(--ofa-space-3);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: var(--ofa-space-5);
}

.appearance-option {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-card);
    cursor: pointer;
    display: grid;
    gap: var(--ofa-space-3);
    grid-template-columns: auto auto minmax(0, 1fr);
    min-height: 82px;
    padding: var(--ofa-space-3);
    transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease,
        transform .14s ease;
}

.appearance-option:hover {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-border-strong);
    transform: translateY(-1px);
}

.appearance-option:has(input:checked) {
    background: var(--ofa-selected-surface);
    border-color: var(--ofa-brand-primary);
    box-shadow: 0 0 0 1px var(--ofa-brand-primary);
}

.appearance-option input[type="radio"] {
    accent-color: var(--ofa-brand-primary);
    height: 18px;
    margin: 0;
    width: 18px;
}

.appearance-option__preview {
    background: #F6F8FC;
    border: 1px solid #D7DEEA;
    border-radius: 7px;
    display: grid;
    grid-template-columns: 8px 20px;
    height: 30px;
    overflow: hidden;
    width: 30px;
}

.appearance-option__preview span:first-child {
    background: #FFFFFF;
    border-right: 1px solid #D7DEEA;
}

.appearance-option__preview--dark {
    background: #11182B;
    border-color: #344362;
}

.appearance-option__preview--dark span:first-child {
    background: #18233B;
    border-color: #344362;
}

.appearance-option__preview--system {
    background: linear-gradient(135deg, #F6F8FC 0 49%, #11182B 51% 100%);
}

.appearance-option__preview--system span:first-child {
    background: linear-gradient(135deg, #FFFFFF 0 49%, #18233B 51% 100%);
}

.appearance-option__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.appearance-option__copy span {
    color: var(--ofa-text-muted);
    font-size: 12px;
}

.ofa-toast-region {
    bottom: var(--ofa-space-6);
    display: flex;
    justify-content: center;
    left: var(--ofa-rail-width);
    pointer-events: none;
    position: fixed;
    right: 0;
    z-index: 60;
}

.ofa-toast {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 12px;
    box-shadow: var(--ofa-shadow-raised);
    display: flex;
    gap: var(--ofa-space-3);
    max-width: min(440px, calc(100vw - 32px));
    min-height: 52px;
    padding: var(--ofa-space-2) var(--ofa-space-2) var(--ofa-space-2) var(--ofa-space-4);
    pointer-events: auto;
}

.ofa-toast__icon {
    align-items: center;
    border-radius: var(--ofa-radius-pill);
    display: inline-flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.ofa-toast__message {
    flex: 1;
    font-size: 14px;
    font-weight: 650;
}

.ofa-toast--success .ofa-toast__icon {
    background: var(--ofa-success-100);
    color: var(--ofa-success-700);
}

.ofa-toast--error .ofa-toast__icon {
    background: var(--ofa-danger-100);
    color: var(--ofa-danger-700);
}

.ofa-toast--warning .ofa-toast__icon {
    background: var(--ofa-warning-100);
    color: var(--ofa-warning-700);
}

.ofa-toast--information .ofa-toast__icon {
    background: var(--ofa-blue-100);
    color: var(--ofa-blue-600);
}

.ofa-toast__dismiss {
    min-height: 36px;
    width: 36px;
}

.ofa-toast__action {
    align-items: center;
    border-radius: 8px;
    color: var(--ofa-blue-600);
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    min-height: 36px;
    padding: 0 var(--ofa-space-3);
    text-decoration: none;
}

.nav-link__badge[hidden],
.workspace__unread-popover[hidden] {
    display: none !important;
}

.nav-link__badge--dot,
.nav-link__badge.nav-link__badge--dot {
    width: 10px !important;
    min-width: 10px !important;
    max-width: 10px !important;
    height: 10px !important;
    min-height: 10px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1;
}

.workspace__item-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

.workspace__item--unread .workspace__item-patient {
    font-weight: 750;
}

.workspace__unread-popover {
    position: fixed;
    z-index: 120;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 10px;
    box-shadow: var(--ofa-shadow-raised);
    padding: 4px;
    min-width: 152px;
}

.workspace__unread-popover-btn {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 6px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ofa-text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}

.workspace__unread-popover-btn:hover,
.workspace__unread-popover-btn:focus-visible {
    background: var(--ofa-selected-surface);
    color: var(--ofa-brand-primary);
    outline: none;
}

.ofa-toast__action:hover,
.ofa-toast__action:focus-visible {
    background: var(--ofa-blue-100);
}

@media (prefers-reduced-motion: no-preference) {
    .ofa-toast {
        animation: ofa-toast-in .18s ease-out;
    }

    @keyframes ofa-toast-in {
        from { opacity: 0; transform: translateY(10px) scale(.98); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
}

.notification-preference {
    align-items: flex-start;
    display: grid;
    gap: var(--ofa-space-4);
    grid-template-columns: auto minmax(0, 1fr);
    max-width: 840px;
}

.notification-preference__icon {
    align-items: center;
    background: var(--ofa-blue-100);
    border-radius: 12px;
    color: var(--ofa-blue-600);
    display: inline-flex;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.notification-preference__status {
    color: var(--ofa-text-secondary);
    font-size: 13px;
    margin: 0 0 var(--ofa-space-3);
}

.orchestration {
    gap: var(--ofa-space-5);
}

.orchestration__nav {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 12px;
    gap: var(--ofa-space-1);
    padding: var(--ofa-space-1);
    width: fit-content;
}

.orchestration__tab {
    border-radius: 8px;
    color: var(--ofa-text-muted);
    font-size: 13px;
    font-weight: 650;
    min-height: 36px;
    padding: 8px 13px;
    transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
}

.orchestration__tab:hover {
    background: var(--ofa-hover-surface);
    color: var(--ofa-text);
    text-decoration: none;
}

.orchestration__tab[aria-current="page"] {
    background: var(--ofa-surface);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--ofa-text) 11%, transparent);
    color: var(--ofa-brand-primary);
}

.orchestration__toolbar {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-card);
    padding: var(--ofa-space-3);
}

.orchestration__table-card,
.orchestration .ofa-table-wrap {
    box-shadow: var(--ofa-shadow-card);
}

.orchestration .ofa-table tbody tr {
    transition: background-color .12s ease;
}

.orchestration__queue-table {
    table-layout: fixed;
}

.orchestration__queue-table th:nth-child(1) { width: 22%; }
.orchestration__queue-table th:nth-child(2) { width: 22%; }
.orchestration__queue-table th:nth-child(3) { width: 10%; }
.orchestration__queue-table th:nth-child(4) { width: 13%; }
.orchestration__queue-table th:nth-child(5) { width: 33%; }
.orchestration__queue-table td:nth-child(3),
.orchestration__queue-table td:nth-child(4) {
    white-space: nowrap;
}

.orchestration__profile-table th:nth-child(2),
.orchestration__profile-table th:nth-child(3),
.orchestration__profile-table td:nth-child(2),
.orchestration__profile-table td:nth-child(3) {
    text-align: right;
}

.orchestration__need-table th:nth-child(2),
.orchestration__need-table td:nth-child(2) {
    text-align: center;
}

.orchestration .ofa-table th:nth-last-child(-n+3),
.orchestration .ofa-table td:nth-last-child(-n+3) {
    text-align: right;
}

.orchestration__matrix th,
.orchestration__matrix td,
.orchestration__matrix th:nth-last-child(-n+3),
.orchestration__matrix td:nth-last-child(-n+3) {
    text-align: center;
    vertical-align: middle;
}

.orchestration__matrix th:first-child,
.orchestration__matrix td:first-child {
    text-align: left;
}

.orchestration__drawer .ofa-drawer__body > form,
.orchestration__drawer .orchestration__section,
.orchestration__drawer .orchestration__fieldset {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-card);
    padding: var(--ofa-space-4);
}

.orchestration__drawer .orchestration__section {
    margin-top: var(--ofa-space-4);
}

.orchestration__member + .orchestration__member {
    border-top: 1px solid var(--ofa-border);
}

.orchestration__result {
    background: var(--ofa-selected-surface);
    border: 1px solid color-mix(in srgb, var(--ofa-brand-primary) 32%, var(--ofa-border));
    border-radius: var(--ofa-radius-card);
    padding: var(--ofa-space-4);
}

.orchestration-program {
    box-shadow: var(--ofa-shadow-card);
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-4);
}

.orchestration-program__header {
    align-items: flex-start;
    display: flex;
    gap: var(--ofa-space-3);
    justify-content: space-between;
}

.orchestration-program__description {
    color: var(--ofa-text-secondary);
    margin: 0;
    max-width: 62ch;
}

.orchestration-program__metrics {
    display: flex;
    gap: var(--ofa-space-6);
    margin: 0;
}

.orchestration-program__metrics div {
    display: flex;
    flex-direction: column;
}

.orchestration-program__metrics dt {
    color: var(--ofa-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.orchestration-program__metrics dd {
    font-size: 20px;
    font-weight: 750;
    margin: 2px 0 0;
}

.orchestration-program__action {
    align-self: flex-start;
}

html[data-theme="dark"] select,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea {
    color-scheme: dark;
}

html[data-theme="dark"] .ofa-skeleton {
    background: linear-gradient(90deg, #1B2740 25%, #24314C 37%, #1B2740 63%);
    background-size: 400% 100%;
}

html[data-theme="dark"] .rail__brand img,
html[data-theme="dark"] .topbar__brand img {
    background: #FFFFFF;
    border-radius: 10px;
    padding: 2px;
}

html[data-theme="dark"] .msg--human {
    background: #2FAD9F;
    border-color: #2FAD9F;
}

html[data-theme="dark"] .ofa-btn--brand {
    color: #FFFFFF;
}

#blazor-error-ui {
    background: var(--ofa-warning-100);
    color: var(--ofa-warning-700);
}

@media (max-width: 1023px) {
    .ofa-toast-region {
        left: 0;
    }
}

@media (max-width: 767px) {
    .appearance-selector__options {
        grid-template-columns: minmax(0, 1fr);
    }

    .notification-preference {
        grid-template-columns: minmax(0, 1fr);
    }

    .orchestration__nav {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        width: 100%;
    }

    .orchestration__tab {
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* ------------------------------------------------------------ analytics */

.analytics-page .ofa-tabs {
    margin-top: calc(-1 * var(--ofa-space-2));
}

.analytics-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-6);
}

.analytics-filter {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-4);
    justify-content: space-between;
}

.analytics-filter__summary,
.analytics-freshness,
.analytics-insufficient,
.analytics-responsibility {
    color: var(--ofa-text-muted);
    margin: 0;
}

.analytics-period,
.analytics-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
}

.analytics-custom {
    align-items: end;
    display: grid;
    gap: var(--ofa-space-3);
    grid-template-columns: auto minmax(9rem, 12rem) minmax(9rem, 12rem) auto;
    width: 100%;
}

.analytics-field-error {
    color: var(--ofa-danger-700);
    grid-column: 1 / -1;
    margin: 0;
}

.analytics-kpis {
    display: grid;
    gap: var(--ofa-space-4);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-kpi {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-card);
    box-shadow: var(--ofa-shadow-card);
    min-height: 150px;
    padding: var(--ofa-space-5);
    position: relative;
}

.analytics-kpi::before {
    background: var(--ofa-border-strong);
    border-radius: var(--ofa-radius-pill);
    content: "";
    height: 4px;
    left: var(--ofa-space-5);
    position: absolute;
    right: var(--ofa-space-5);
    top: 0;
}

.analytics-kpi--ai::before { background: var(--ofa-violet-600); }
.analytics-kpi--human::before { background: var(--ofa-teal-700); }

.analytics-kpi__label {
    color: var(--ofa-text-muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    margin: 0 0 var(--ofa-space-2);
    text-transform: uppercase;
}

.analytics-kpi__value {
    align-items: baseline;
    color: var(--ofa-text);
    display: flex;
    flex-wrap: wrap;
    font-size: 30px;
    font-weight: 750;
    gap: var(--ofa-space-2);
    letter-spacing: -.02em;
}

.analytics-kpi__rate {
    color: var(--ofa-text-muted);
    font-size: 15px;
    font-weight: 700;
}

.analytics-kpi__subline,
.analytics-change {
    color: var(--ofa-text-muted);
    margin: var(--ofa-space-2) 0 0;
}

.analytics-change {
    font-size: 13px;
    font-weight: 650;
}

.analytics-chart-card {
    overflow: hidden;
}

.analytics-plot {
    column-gap: var(--ofa-space-2);
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-rows: 220px auto;
}

.analytics-plot__y {
    grid-column: 1;
    grid-row: 1;
    position: relative;
}

.analytics-plot__y span,
.analytics-plot__x span {
    color: var(--ofa-text-muted);
    font-size: 12px;
    line-height: 1;
    position: absolute;
    white-space: nowrap;
}

.analytics-plot__y span {
    right: 0;
    transform: translateY(-50%);
}

.analytics-plot__x {
    grid-column: 2;
    grid-row: 2;
    height: 16px;
    margin-top: var(--ofa-space-2);
    position: relative;
}

.analytics-plot__x span {
    transform: translateX(-50%);
}

.analytics-plot__x span:first-child {
    transform: none;
}

.analytics-plot__x span:last-child:not(:first-child) {
    transform: translateX(-100%);
}

.analytics-chart {
    display: block;
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    overflow: visible;
    width: 100%;
}

.analytics-chart__grid {
    stroke: var(--ofa-border);
    stroke-width: 1px;
    vector-effect: non-scaling-stroke;
}

.analytics-chart__line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5px;
    vector-effect: non-scaling-stroke;
}

.analytics-chart__line--needs {
    stroke: var(--ofa-ink-900);
}

.analytics-chart__line--ai {
    stroke: var(--ofa-violet-600);
    stroke-dasharray: 8 6;
}

.analytics-chart__line--human {
    stroke: var(--ofa-teal-700);
    stroke-dasharray: 1 6;
}

.analytics-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-4);
    margin-top: var(--ofa-space-3);
}

.analytics-observed {
    white-space: nowrap;
}

/* A table wider than its card scrolls within it instead of losing its last columns. */
.analytics-page .ofa-table-wrap {
    overflow-x: auto;
}

.analytics-legend span::before {
    border-top: 3px solid var(--ofa-ink-900);
    content: "";
    display: inline-block;
    width: 22px;
}

.analytics-legend .analytics-legend__ai::before {
    border-top: 3px dashed var(--ofa-violet-600);
}

.analytics-legend .analytics-legend__human::before {
    border-top: 3px dotted var(--ofa-teal-700);
}

.analytics-legend span,
.analytics-trend {
    align-items: center;
    color: var(--ofa-text-muted);
    display: inline-flex;
    font-size: 13px;
    gap: var(--ofa-space-2);
}

.analytics-rate-bar {
    background: var(--ofa-hover-surface);
    border-radius: var(--ofa-radius-pill);
    display: block;
    height: 6px;
    margin-top: var(--ofa-space-2);
    min-width: 5rem;
    overflow: hidden;
}

.analytics-rate-bar span {
    background: var(--ofa-blue-600);
    display: block;
    height: 100%;
}

.analytics-sort {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 44px;
    padding: 0;
    text-transform: inherit;
}

.analytics-bars,
.analytics-list,
.analytics-interventions {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
}

.analytics-bar-row {
    align-items: center;
    display: grid;
    gap: var(--ofa-space-3);
    grid-template-columns: minmax(0, 1fr) auto minmax(6rem, 12rem);
}

.analytics-list {
    margin: 0;
    padding-left: var(--ofa-space-5);
}

.analytics-intervention {
    border-top: 1px solid var(--ofa-border);
    padding-top: var(--ofa-space-4);
}

.analytics-intervention h3,
.analytics-intervention p {
    margin: 0 0 var(--ofa-space-2);
}

@media (max-width: 1199px) {
    .analytics-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .analytics-kpis,
    .analytics-custom,
    .analytics-bar-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .analytics-filter {
        align-items: stretch;
    }

    .analytics-period .ofa-chip,
    .analytics-toggle .ofa-chip {
        min-height: 44px;
    }

    /* The two views share the row and wrap their names, so neither is cut off or scrolls away. */
    .analytics-page .ofa-tabs {
        min-width: 0;
        overflow-x: visible;
    }

    .analytics-page .ofa-tab {
        flex: 1 1 0;
        justify-content: center;
        min-height: 44px;
        min-width: 0;
        padding-inline: var(--ofa-space-2);
        text-align: center;
        white-space: normal;
    }
}

/* ----------------------------------------------------- hospital schedule */

.schedule-kpis {
    display: grid;
    gap: var(--ofa-space-4);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.schedule-kpis--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.schedule-kpi-tile {
    background: none;
    border: 0;
    border-radius: var(--ofa-radius-card);
    color: inherit;
    cursor: pointer;
    display: block;
    font: inherit;
    padding: 0;
    text-align: left;
    transition: transform .14s ease, box-shadow .14s ease;
    width: 100%;
}

.schedule-kpi-tile .analytics-kpi {
    height: 100%;
    transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}

.schedule-kpi-tile:hover .analytics-kpi,
.schedule-kpi-tile:focus-visible .analytics-kpi {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-brand-primary);
}

.schedule-kpi-tile--active .analytics-kpi {
    background: var(--ofa-selected-surface);
    border-color: var(--ofa-brand-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ofa-brand-primary) 35%, transparent), var(--ofa-shadow-card);
}

.schedule-card--scheduled {
    border-left: 3px solid var(--ofa-blue-600);
}

.schedule-card--completed {
    border-left: 3px solid var(--ofa-success-600);
}

.schedule-card--cancelled {
    background: var(--ofa-surface);
    border-color: var(--ofa-border);
    border-left: 3px solid var(--ofa-text-subtle);
}

.schedule-card--Cancelled .schedule-card__time,
.schedule-card--cancelled .schedule-card__time,
.schedule-card--cancelled .schedule-card__patient {
    color: var(--ofa-text-muted);
}

.schedule-card--noshow {
    background: var(--ofa-surface);
    border-color: var(--ofa-border);
    border-left: 3px solid var(--ofa-danger-600);
}

.schedule-card--outcome {
    background: var(--ofa-surface);
    border-color: var(--ofa-border);
    border-left: 3px solid var(--ofa-warning-600);
}

html[data-theme="dark"] .schedule-card--noshow {
    background: var(--ofa-surface);
    border-color: var(--ofa-border);
    border-left: 3px solid var(--ofa-danger-600);
}

.schedule-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
    justify-content: space-between;
}

.schedule-toolbar__group {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
}

.schedule-week-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    overflow-x: auto;
    padding-bottom: var(--ofa-space-2);
}

.schedule-day-col {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 20rem;
    padding: 8px 8px 12px;
}

.schedule-day-col--today {
    border-color: var(--ofa-border-strong);
}

.schedule-day-col__head {
    align-items: center;
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 2px 4px 8px;
}

.schedule-day-col__title {
    background: none;
    border: 0;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 0;
    text-align: left;
    text-transform: uppercase;
}

.schedule-day-col--today .schedule-day-col__title {
    color: var(--ofa-text);
}

.schedule-day-col__title:hover {
    color: var(--ofa-blue-600);
}

.schedule-day-col__today-pill {
    align-items: center;
    background: var(--ofa-blue-600);
    border-radius: 999px;
    color: #FFFFFF;
    display: inline-flex;
    font-size: 10.5px;
    font-weight: 700;
    height: 18px;
    padding: 0 8px;
}

.schedule-day-col__count {
    color: var(--ofa-text-subtle);
    font-size: 11.5px;
}

.schedule-day-col__empty {
    color: var(--ofa-text-subtle);
    font-size: 11.5px;
    margin: 36px 0 0;
    text-align: center;
}

.schedule-day-col__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.schedule-card {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-left: 3px solid var(--ofa-blue-600);
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    text-align: left;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
    width: 100%;
}

.schedule-card:hover,
.schedule-card:focus-visible {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-blue-600);
    box-shadow: var(--ofa-shadow-card);
}

.schedule-card__top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.schedule-card__time {
    color: var(--ofa-text);
    font-size: 11.5px;
    font-weight: 700;
}

.schedule-card__patient {
    color: var(--ofa-text);
    font-size: 12.5px;
    font-weight: 700;
    margin-top: 2px;
}

.schedule-card__title {
    color: var(--ofa-text-muted);
    font-size: 11.5px;
}

.schedule-card__status {
    color: var(--ofa-text-secondary);
    font-size: 10.5px;
    font-weight: 700;
    margin-top: 2px;
}

@media (max-width: 1199px) {
    .schedule-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .schedule-kpis {
        grid-template-columns: minmax(0, 1fr);
    }

    .schedule-week-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .schedule-day-col {
        min-height: auto;
    }
}

/* ------------------------------------------- Appointments Hub V2 & OncoFlow Hub */

.ofa-page--fluid {
    max-width: none;
    padding: var(--ofa-space-5) var(--ofa-space-6) var(--ofa-space-8);
    width: 100%;
}

.nav-link__label {
    flex: 1 1 auto;
}

.nav-link__badge {
    align-items: center;
    background: var(--ofa-danger-600);
    border-radius: 999px;
    color: #FFFFFF;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    justify-content: center;
    line-height: 1;
    margin-left: auto;
    min-width: 20px;
    padding: 3px 7px;
}

/* 4-Column Executive KPI Strip (Mockup 2 Stripe / One Medical Clarity) */
.hub-kpi-strip {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    box-shadow: var(--ofa-shadow-card);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
}

.hub-kpi-cell {
    background: transparent;
    border: 0;
    border-left: 1px solid var(--ofa-border);
    color: var(--ofa-text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: 6px;
    padding: 12px 18px;
    text-align: left;
    transition: background-color .14s ease;
}

.hub-kpi-cell:first-child {
    border-left: 0;
}

.hub-kpi-cell:hover {
    background: var(--ofa-surface-subtle);
}

.hub-kpi-cell.is-selected {
    background: color-mix(in srgb, var(--ofa-blue-50) 45%, var(--ofa-surface));
}

.hub-kpi-cell__eyebrow {
    align-items: center;
    color: var(--ofa-text-muted);
    display: inline-flex;
    font-size: 10.5px;
    font-weight: 700;
    gap: 6px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hub-kpi-cell__row {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hub-kpi-cell__num {
    color: var(--ofa-text);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.1;
}

.hub-kpi-cell__sub {
    color: var(--ofa-text-secondary);
    font-size: 11.5px;
    line-height: 1.35;
}

/* 6px Semantic Micro-Dots */
.hub-dot {
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    height: 6px;
    width: 6px;
}

.hub-dot--blue { background: var(--ofa-blue-600); }
.hub-dot--teal { background: var(--ofa-teal-600); }
.hub-dot--green { background: var(--ofa-success-600); }
.hub-dot--amber { background: var(--ofa-warning-600); }
.hub-dot--rose { background: var(--ofa-danger-600); }
.hub-dot--violet { background: var(--ofa-violet-600); }
.hub-dot--muted { background: var(--ofa-text-subtle); }

/* Resizable Split Workspace (30%..70% with Draggable Vertical Splitter) */
.hub-split-workspace {
    align-items: stretch;
    display: grid;
    gap: 0;
    grid-template-columns: minmax(280px, var(--hub-calendar-pct, 60%)) 18px minmax(280px, var(--hub-queue-pct, 40%));
    width: 100%;
}

.hub-split-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px 18px;
}

.hub-splitter {
    align-items: center;
    cursor: col-resize;
    display: flex;
    justify-content: center;
    position: relative;
    user-select: none;
    width: 18px;
}

.hub-splitter::before {
    background: var(--ofa-border-strong);
    border-radius: 999px;
    bottom: 16px;
    content: "";
    left: 50%;
    position: absolute;
    top: 16px;
    transform: translateX(-50%);
    transition: background-color .15s ease, width .15s ease;
    width: 1.5px;
}

.hub-splitter:hover::before,
.hub-splitter:focus-visible::before,
.hub-splitter.is-dragging::before {
    background: var(--ofa-blue-600);
    width: 2.5px;
}

.hub-splitter__grip {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 7px;
    color: var(--ofa-text-muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    height: 44px;
    justify-content: center;
    position: relative;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    width: 14px;
    z-index: 2;
}

.hub-splitter:hover .hub-splitter__grip,
.hub-splitter.is-dragging .hub-splitter__grip {
    background: var(--ofa-blue-50);
    border-color: var(--ofa-blue-600);
    color: var(--ofa-blue-600);
}

.hub-panel-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.hub-panel-head__title-wrap {
    align-items: center;
    display: flex;
    gap: 10px;
}

.hub-panel-head__period {
    color: var(--ofa-text-muted);
    font-size: 12.5px;
    font-weight: 400;
}

.hub-count-pill {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 999px;
    color: var(--ofa-text-secondary);
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 700;
    height: 20px;
    padding: 0 9px;
    white-space: nowrap;
}

.hub-status-pill {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 999px;
    color: var(--ofa-text-secondary);
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 500;
    gap: 6px;
    height: 22px;
    padding: 0 10px;
    white-space: nowrap;
}

.hub-toolbar-pills {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Segmented Control Groups (Day | Week and Last 7d | Last 30d | All) */
.hub-seg-group {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 6px;
    display: inline-flex;
    gap: 2px;
    height: 28px;
    padding: 2px;
}

.hub-seg-btn {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 11.5px;
    font-weight: 500;
    height: 22px;
    justify-content: center;
    padding: 0 10px;
    transition: background-color .14s ease, color .14s ease;
    white-space: nowrap;
}

.hub-seg-btn.is-active {
    background: var(--ofa-surface);
    border-color: var(--ofa-border);
    color: var(--ofa-text);
    font-weight: 700;
}

.hub-pill-btn {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 6px;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    height: 28px;
    padding: 0 11px;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
    white-space: nowrap;
}

.hub-pill-btn:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
    color: var(--ofa-text);
}

.hub-date-input {
    font-size: 11.5px;
    height: 28px;
    min-height: 28px;
    padding: 0 8px;
    width: auto;
}

.hub-input--compact {
    font-size: 11.5px;
    height: 28px;
    min-height: 28px;
}

/* Calendar Status Filter Chips (Mockup 2 Soft Royal Blue Active All + Monochrome Dot Chips) */
.hub-calendar-chips-bar {
    align-items: center;
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    padding-bottom: 12px;
}

.hub-status-chips {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hub-s-chip {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 999px;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 11.5px;
    font-weight: 500;
    gap: 6px;
    height: 28px;
    padding: 0 11px;
    transition: background-color .14s ease, border-color .14s ease;
    white-space: nowrap;
}

.hub-s-chip::before {
    border-radius: 999px;
    content: "";
    display: none;
    height: 6px;
    width: 6px;
}

.hub-s-chip.is-active-all,
.hub-s-chip.is-selected {
    background: var(--ofa-blue-50);
    border: 1.5px solid var(--ofa-blue-600);
    color: var(--ofa-blue-600);
    font-weight: 700;
}

.hub-s-chip--sched::before {
    background: var(--ofa-blue-600);
    display: inline-block;
}

.hub-s-chip--outcome::before {
    background: var(--ofa-warning-600);
    display: inline-block;
}

.hub-s-chip--done::before {
    background: var(--ofa-success-600);
    display: inline-block;
}

.hub-s-chip--noshow::before {
    background: var(--ofa-danger-600);
    display: inline-block;
}

.hub-s-chip--cancel::before {
    background: var(--ofa-text-subtle);
    display: inline-block;
}

.hub-s-chip__count {
    background: var(--ofa-surface-subtle);
    border-radius: 999px;
    color: var(--ofa-text-secondary);
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
}

.hub-s-chip.is-active-all .hub-s-chip__count,
.hub-s-chip.is-selected .hub-s-chip__count {
    background: rgba(37, 99, 235, .14);
    color: var(--ofa-blue-600);
}

.hub-calendar-search {
    min-width: 170px;
}

/* Priority Action Queue 4-Tab Segmented Control Bar (Mockup 2) */
.hub-seg-bar {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 8px;
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 3px;
}

.hub-seg-bar__item {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 11.5px;
    font-weight: 500;
    height: 28px;
    justify-content: center;
    padding: 0 6px;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
    white-space: nowrap;
}

.hub-seg-bar__item.is-active {
    background: var(--ofa-surface);
    border-color: var(--ofa-border);
    color: var(--ofa-text);
    font-weight: 700;
}

.hub-action-queue-list {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 10px;
    max-height: none;
    min-height: 440px;
    overflow-y: auto;
    padding-right: 2px;
}

.hub-queue-card {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 14px;
}

.hub-queue-card__top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 2px;
}

.hub-queue-card__identity {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.hub-queue-card__patient {
    color: var(--ofa-text);
    font-size: 13.5px;
    font-weight: 700;
}

.hub-ref-pill {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border-radius: 4px;
    color: var(--ofa-text-secondary);
    display: inline-flex;
    font-size: 10.5px;
    font-weight: 700;
    height: 17px;
    padding: 0 7px;
}

.hub-queue-card__line1 {
    color: var(--ofa-text);
    font-size: 12.5px;
    line-height: 1.4;
    margin: 0;
}

.hub-queue-card__line2 {
    color: var(--ofa-text-muted);
    font-size: 11.5px;
    line-height: 1.4;
    margin: 0;
}

.hub-queue-card__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.hub-btn-xs {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 6px;
    color: var(--ofa-text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    gap: 5px;
    height: 28px;
    padding: 0 12px;
    text-decoration: none;
    transition: background-color .14s ease, border-color .14s ease;
    white-space: nowrap;
}

.hub-btn-xs:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
}

.hub-btn-xs--primary {
    background: var(--ofa-blue-600);
    border-color: var(--ofa-blue-600);
    color: #FFFFFF;
}

.hub-btn-xs--primary:hover:not(:disabled) {
    background: var(--ofa-brand-primary-hover);
}

/* Bottom Full-Width Audit Trail (Mockup 2) */
.hub-audit-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
}

.hub-audit-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hub-audit-search-group {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.hub-audit-search-select {
    border-color: var(--ofa-border-strong);
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    height: 28px;
    min-height: 28px;
    padding: 0 10px;
    width: auto;
}

.hub-audit-search-box {
    min-width: 190px;
}

.hub-audit-table thead th {
    background: var(--ofa-surface-subtle);
    color: var(--ofa-text-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 4px 8px;
    text-transform: uppercase;
}

.hub-sort-btn {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 5px;
    color: var(--ofa-text-muted);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
    gap: 5px;
    letter-spacing: .04em;
    padding: 4px 6px;
    text-transform: uppercase;
    transition: background-color .14s ease, color .14s ease;
    white-space: nowrap;
}

.hub-sort-btn:hover {
    background: var(--ofa-hover-surface);
    color: var(--ofa-text);
}

.hub-sort-btn.is-active {
    color: var(--ofa-text);
}

.hub-sort-icon {
    color: var(--ofa-text-subtle);
    font-size: 11px;
    line-height: 1;
}

.hub-sort-btn.is-active .hub-sort-icon {
    color: var(--ofa-blue-600);
}

.hub-audit-table tbody td {
    padding: 8px 14px;
    vertical-align: middle;
}

.hub-audit-patient-cell {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 7px;
}

.hub-audit-patient-link {
    color: var(--ofa-text);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: color .14s ease;
}

.hub-audit-patient-link:hover {
    color: var(--ofa-blue-600);
    text-decoration: underline;
}

.hub-audit-patient {
    color: var(--ofa-text);
    font-size: 12px;
    font-weight: 700;
}

.hub-audit-event {
    align-items: center;
    color: var(--ofa-text);
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 700;
    gap: 7px;
}

.hub-diff-wrap {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hub-diff-old {
    background: var(--ofa-surface-subtle);
    border-radius: 4px;
    color: var(--ofa-text-muted);
    font-size: 11.5px;
    padding: 2px 8px;
}

.hub-diff-arrow {
    color: var(--ofa-text-subtle);
    font-size: 11.5px;
    font-weight: 700;
}

.hub-diff-new {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 4px;
    color: var(--ofa-text);
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
}

.hub-audit-actor {
    color: var(--ofa-text-secondary);
    font-size: 11.5px;
}

.hub-record-link {
    color: var(--ofa-blue-600);
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.hub-record-link:hover {
    text-decoration: underline;
}

/* OncoFlow Hub (AI) Fullscreen Command Shell */
.hub-page-full {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 76px);
}

.hub-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hub-shell--fullscreen {
    flex: 1 1 auto;
    justify-content: space-between;
    min-height: calc(100vh - 210px);
}

.hub-thread {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 14px;
    min-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

.hub-shell__footer {
    border-top: 1px solid var(--ofa-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
}

/* Modern Spinners & Waiting States */
@keyframes ofa-spin {
    to {
        transform: rotate(360deg);
    }
}

.ofa-spinner {
    animation: ofa-spin .75s linear infinite;
    border: 2.5px solid color-mix(in srgb, var(--ofa-blue-600) 22%, transparent);
    border-radius: 999px;
    border-top-color: var(--ofa-blue-600);
    display: inline-block;
    flex: 0 0 auto;
    height: 20px;
    width: 20px;
}

.ofa-spinner--sm {
    border-width: 2px;
    height: 15px;
    width: 15px;
}

.ofa-spinner--lg {
    border-width: 3px;
    height: 28px;
    width: 28px;
}

.ofa-spinner--ai {
    border-color: color-mix(in srgb, var(--ofa-violet-600) 22%, transparent);
    border-top-color: var(--ofa-violet-600);
}

.ofa-spinner--light {
    border-color: rgba(255, 255, 255, .3);
    border-top-color: #FFFFFF;
}

.ofa-spinner-badge {
    align-items: center;
    background: transparent;
    border: 0;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    margin-bottom: 4px;
    width: 36px;
}

.ofa-loading-panel {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    padding: 36px 24px;
    text-align: center;
}

.ofa-loading-inline {
    align-items: center;
    color: var(--ofa-text-secondary);
    display: inline-flex;
    font-size: 12.5px;
    font-weight: 600;
    gap: 8px;
    padding: 8px 4px;
}

.ofa-loading-thread-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    max-width: 420px;
     opacity: .65;
    width: 100%;
}

.hub-thinking {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    color: var(--ofa-text-secondary);
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    gap: 10px;
    padding: 10px 14px;
    width: fit-content;
}

@media (prefers-reduced-motion: reduce) {
    .ofa-spinner {
        animation-duration: 2s;
    }
}

.hub-welcome {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px dashed var(--ofa-border-strong);
    border-radius: 12px;
    display: flex;
    gap: 14px;
    padding: 18px 20px;
}

.hub-welcome__icon {
    align-items: center;
    background: var(--ofa-violet-100);
    border-radius: 12px;
    color: var(--ofa-violet-600);
    display: inline-flex;
    flex: 0 0 auto;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.hub-turn {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hub-turn__user {
    display: flex;
    justify-content: flex-end;
}

.hub-turn__user-bubble {
    background: var(--ofa-selected-surface);
    border: 1px solid color-mix(in srgb, var(--ofa-blue-500) 28%, var(--ofa-border));
    border-radius: 12px 12px 2px 12px;
    color: var(--ofa-text);
    font-size: 13.5px;
    font-weight: 600;
    max-width: 75%;
    padding: 8px 13px;
}

.hub-turn__assistant {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-left: 4px solid var(--ofa-violet-600);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px 16px;
}

.hub-turn__assistant-head {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.hub-action-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.hub-action-card {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-left: 4px solid var(--ofa-blue-500);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 11px 13px;
}

.hub-action-card--danger { border-left-color: var(--ofa-danger-600); }
.hub-action-card--warning { border-left-color: var(--ofa-warning-600); }
.hub-action-card--success { border-left-color: var(--ofa-success-600); }

.hub-action-card__top {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.hub-action-card__title {
    font-size: 13.5px;
}

.hub-action-card__sub {
    color: var(--ofa-text-secondary);
    font-size: 12.5px;
    margin: 0;
}

.hub-action-card__footer {
    margin-top: auto;
    padding-top: 4px;
}

.hub-patient-card {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-left: 4px solid var(--ofa-teal-600);
    border-radius: 11px;
    padding: 12px 15px;
}

.hub-patient-card__head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.hub-patient-card__name {
    font-size: 16px;
    margin: 0;
}

.hub-patient-card__grid {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 4px;
}

.hub-prompts {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hub-prompt-chip {
    font-size: 12px;
}

.hub-composer {
    align-items: center;
    display: flex;
    gap: 8px;
    width: 100%;
}

.hub-composer__box {
    align-items: flex-end;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    display: flex;
    gap: 10px;
    padding: 8px 10px 8px 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
    width: 100%;
}

.hub-composer__box:focus-within {
    border-color: var(--ofa-blue-600);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ofa-blue-600) 14%, transparent);
}

.hub-composer__input,
.hub-composer__input.ofa-input {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--ofa-text);
    field-sizing: content;
    flex: 1 1 auto;
    font-size: 15.5px;
    line-height: 1.5;
    max-height: 160px;
    min-height: 54px;
    overflow-y: auto;
    padding: 6px 0;
    resize: none;
}

.hub-composer__input:focus,
.hub-composer__input.ofa-input:focus {
    border: 0;
    box-shadow: none;
    outline: none;
}

.hub-composer__submit {
    border-radius: 10px;
    flex: 0 0 auto;
    height: 42px;
    min-height: 42px;
    padding: 0 16px;
    white-space: nowrap;
}

@media (max-width: 899px) {
    .hub-page-full {
        gap: var(--ofa-space-2);
        height: calc(100dvh - var(--ofa-topbar-height));
        min-height: 0;
        padding: var(--ofa-space-2);
    }

    .hub-page-full .ofa-page-header {
        display: none;
    }

    .hub-shell--fullscreen {
        flex: 1 1 0%;
        min-height: 0;
    }

    .hub-thread {
        flex: 1 1 0%;
        min-height: 0;
    }

    .hub-prompts {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .hub-prompts::-webkit-scrollbar {
        display: none;
    }

    .hub-prompt-chip {
        flex-shrink: 0;
    }

    .hub-composer__box {
        padding: 6px 8px 6px 12px;
    }

    .hub-composer__input,
    .hub-composer__input.ofa-input {
        min-height: 44px;
    }
}

@media (max-width: 1023px) {
    .hub-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hub-kpi-cell:nth-child(3) {
        border-left: 0;
    }

    .hub-kpi-cell:nth-child(n+3) {
        border-top: 1px solid var(--ofa-border);
    }

    .hub-split-workspace {
        gap: 14px;
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-splitter {
        display: none;
    }

    .hub-seg-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ----------------------------------------------------- demo outreach */

.outreach-header {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-4);
    justify-content: space-between;
}

.outreach-kpis {
    display: grid;
    gap: var(--ofa-space-4);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.outreach-kpi {
    border-top: 3px solid var(--ofa-border-strong);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.outreach-kpi--blue { border-top-color: var(--ofa-blue-600); }
.outreach-kpi--violet { border-top-color: var(--ofa-violet-600); }
.outreach-kpi--teal { border-top-color: var(--ofa-teal-700); }

.outreach-kpi__value {
    color: var(--ofa-ink-950);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin: 0;
}

.outreach-countries {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-3);
    list-style: none;
    margin: 0;
    padding: 0;
}

.outreach-country {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.outreach-country__top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    justify-content: space-between;
}

.outreach-country__name {
    align-items: center;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: var(--ofa-space-2);
}

.outreach-bar {
    background: var(--ofa-hover-surface);
    border-radius: var(--ofa-radius-pill);
    height: 7px;
    overflow: hidden;
    width: 100%;
}

.outreach-bar__fill {
    background: var(--ofa-blue-600);
    border-radius: var(--ofa-radius-pill);
    height: 100%;
}

.outreach-generated {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-control);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--ofa-space-3);
}

.outreach-generated__row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
    justify-content: space-between;
}

.outreach-generated__url {
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.outreach-link-cell {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-2);
}

.outreach-retention {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.outreach-row--direct {
    background: var(--ofa-surface-subtle);
    cursor: pointer;
}

.outreach-filters {
    align-items: flex-end;
    display: grid;
    gap: var(--ofa-space-4);
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
}

.outreach-filters .ofa-field {
    margin-bottom: 0;
}

.outreach-checkbox {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: var(--ofa-space-2);
    min-height: 42px;
}

.outreach-manage {
    display: flex;
    flex-direction: column;
    gap: var(--ofa-space-4);
}

.outreach-manage__rename {
    align-items: flex-end;
    display: grid;
    gap: var(--ofa-space-3);
    grid-template-columns: minmax(0, 1fr) auto;
}

.outreach-manage__rename .ofa-field {
    margin-bottom: 0;
}

.outreach-manage__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ofa-space-3);
}

.outreach-confirm {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border-strong);
    border-radius: var(--ofa-radius-control);
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    gap: var(--ofa-space-3);
    justify-content: space-between;
    padding: var(--ofa-space-3) var(--ofa-space-4);
    width: 100%;
}

.outreach-confirm--danger {
    border-color: var(--ofa-danger-600);
}

.outreach-confirm__buttons {
    display: inline-flex;
    gap: var(--ofa-space-2);
}

@media (max-width: 1100px) {
    .outreach-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .outreach-kpis,
    .outreach-filters,
    .outreach-manage__rename {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ------------------------------------------- Edge-to-Edge Chats Workspace V2
   Approved Option 2 Messenger + Option 1 Queue Chips + Clean 2-Icon Header.
   Placed after .ofa-page--fluid so outer margins/padding stay strictly 0px. */

.ofa-page.ofa-page--fluid.workspace--conversation {
    background: var(--ofa-surface);
    gap: 0;
    height: calc(100dvh - var(--ofa-topbar-height));
    margin: 0;
    max-width: none;
    min-height: 0;
    padding: 0;
    width: 100%;
}

.workspace--conversation > .workspace__page-header,
.workspace--conversation > .workspace__connection {
    display: none;
}

.workspace--conversation > .ofa-banner {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin: 0;
}

.workspace--conversation > .workspace__grid {
    gap: 0;
    grid-template-columns: minmax(280px, 316px) minmax(0, 1fr);
    min-height: 0;
}

.workspace--conversation .workspace__col--queue {
    border-right: 1px solid var(--ofa-border);
}

.workspace--conversation .workspace__col > .workspace__panel {
    background: var(--ofa-surface);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 0;
    padding: 0;
}

/* Left Conversations column — Option 1 style (no initials circles, chips under topic) */
.workspace--conversation .workspace__panel--queue {
    background: var(--ofa-surface-subtle);
}

.workspace__queue-top {
    align-items: center;
    background: var(--ofa-surface);
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    height: 54px;
    justify-content: space-between;
    padding: 0 12px;
}

.workspace--conversation .workspace__scopes {
    background: var(--ofa-hover-surface);
    border-radius: 8px;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 2px;
}

.workspace--conversation .workspace__scope {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--ofa-text-secondary);
    display: inline-flex;
    font-size: 12.5px;
    font-weight: 600;
    min-height: 30px;
    padding: 4px 10px;
    white-space: nowrap;
}

.workspace--conversation .workspace__scope--current {
    background: var(--ofa-surface);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    color: var(--ofa-ink-950);
}

.workspace__queue-tools {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    gap: 4px;
}

.workspace__tool-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ofa-text-muted);
    height: 30px;
    min-height: 30px;
    padding: 0;
    width: 30px;
}

.workspace__tool-btn:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
    color: var(--ofa-blue-600);
}

.workspace__tool-btn--active {
    background: var(--ofa-selected-surface);
    border-color: color-mix(in srgb, var(--ofa-blue-500) 35%, var(--ofa-border));
    color: var(--ofa-blue-600);
}

.workspace--conversation .workspace__alerts-nudge {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    border-top: 0;
    margin: 0;
}

.workspace__search-wrap {
    background: var(--ofa-surface-subtle);
    border-bottom: 1px solid var(--ofa-border);
    flex-shrink: 0;
    padding: 10px 12px;
}

.workspace--conversation .workspace__search {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 9px;
    padding: 6px 10px;
}

.workspace--conversation .workspace__list {
    padding: 0;
}

.workspace--conversation .workspace__item {
    background: var(--ofa-surface-subtle);
    border-bottom: 1px solid var(--ofa-border);
    border-radius: 0;
    gap: 4px;
    padding: 12px 14px;
}

.workspace--conversation .workspace__item:hover {
    background: var(--ofa-hover-surface);
}

.workspace--conversation .workspace__item--current,
.workspace--conversation .workspace__item--current:hover {
    background: var(--ofa-selected-surface);
    box-shadow: inset 3px 0 0 var(--ofa-blue-600);
}

.workspace--conversation .workspace__item-patient {
    font-size: 13.5px;
    font-weight: 700;
}

.workspace--conversation .workspace__item-subject {
    color: var(--ofa-text-secondary);
    font-size: 12.5px;
}

.workspace--conversation .workspace__item-meta {
    gap: 7px;
    margin-top: 2px;
}

/* Thread Header — Single 54px row with Patient Details panel icon + ⋯ menu ONLY */
.workspace--conversation .workspace__thread-head {
    align-items: center;
    background: var(--ofa-surface);
    border-bottom: 1px solid var(--ofa-border);
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 10px;
    min-height: 54px;
    padding: 6px 18px;
    position: relative;
}

.workspace--conversation .workspace__thread-title {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.workspace--conversation .workspace__patient-heading {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    font-size: 15px;
    gap: 7px;
    min-width: 0;
}

.workspace--conversation .workspace__patient-name-link {
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace--conversation .workspace__patient-ref {
    flex-shrink: 0;
    font-size: 12px;
}

.workspace__head-queue-badge {
    flex-shrink: 0;
    font-size: 11px;
    padding: 2px 9px;
}

.workspace__subject-row {
    align-items: center;
    color: var(--ofa-text-muted);
    display: flex;
    font-size: 12px;
    gap: 6px;
    margin: 0;
    min-width: 0;
}

.workspace--conversation .workspace__subject {
    margin: 0;
    min-width: 0;
}

.workspace__subject-sep {
    flex-shrink: 0;
    opacity: .6;
}

.workspace__subject-status {
    flex-shrink: 0;
    font-weight: 600;
}

.workspace__subject-status--info {
    color: var(--ofa-blue-600);
}

.workspace__subject-status--success {
    color: var(--ofa-success-700);
}

.workspace__head-actions {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    gap: 6px;
}

.workspace__head-icon-btn {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 8px;
    color: var(--ofa-text-secondary);
    height: 32px;
    min-height: 32px;
    padding: 0;
    width: 32px;
}

.workspace__head-icon-btn:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-border-strong);
    color: var(--ofa-blue-600);
}

.workspace__head-icon-btn--active {
    background: var(--ofa-selected-surface);
    border-color: color-mix(in srgb, var(--ofa-blue-500) 45%, var(--ofa-border));
    color: var(--ofa-blue-600);
}

.workspace__more-wrap {
    position: relative;
}

.workspace__menu-backdrop {
    background: transparent;
    border: 0;
    cursor: default;
    inset: 0;
    position: fixed;
    z-index: 35;
}

.workspace__more-dropdown {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 12px;
    box-shadow: var(--ofa-shadow-raised);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 224px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
}

.workspace__more-dropdown[hidden] {
    display: none;
}

.workspace__menu-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--ofa-text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 13px;
    font-weight: 550;
    gap: 9px;
    list-style: none;
    min-height: 36px;
    padding: 7px 10px;
    text-align: left;
    width: 100%;
}

.workspace__menu-item::-webkit-details-marker {
    display: none;
}

.workspace__menu-item:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
}

.workspace__menu-item--primary {
    color: var(--ofa-blue-600);
    font-weight: 650;
}

.workspace__menu-item--danger {
    color: var(--ofa-danger-700);
}

.workspace__menu-item--danger:hover:not(:disabled) {
    background: var(--ofa-danger-100);
}

.workspace__menu-sep {
    background: var(--ofa-border);
    height: 1px;
    margin: 4px 6px;
}

.workspace__menu-transfer {
    margin-left: 0;
    width: 100%;
}

.workspace__menu-transfer > summary {
    color: var(--ofa-text);
    font-weight: 550;
    min-height: 36px;
    padding: 7px 10px;
}

.workspace__menu-transfer .workspace__transfer-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 10px 8px;
}

.workspace__menu-transfer .ofa-select {
    font-size: 13px;
    max-width: none;
    min-height: 36px;
    width: 100%;
}

/* Messages canvas & quiet centered ownership pill */
.workspace--conversation .workspace__main {
    background: var(--ofa-surface);
    gap: 0;
    padding: 0;
}

.workspace--conversation .workspace__messages {
    padding: 14px 26px 10px;
}

.workspace__ownership-pill {
    align-items: center;
    align-self: center;
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-text-muted);
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 550;
    gap: 6px;
    margin: 0 0 4px;
    padding: 4px 12px;
}

.workspace--conversation .workspace__closed {
    border-top: 1px solid var(--ofa-border);
    margin: 0;
    padding: 12px 24px;
}

/* Flush Right Patient Details Drawer */
.workspace--conversation .workspace__context {
    background: var(--ofa-surface);
    border-left: 1px solid var(--ofa-border);
    padding: 14px 16px;
}

/* Bottom Floating ChatGPT-Style Pill Composer + On-Demand AI Popover */
.workspace--conversation .workspace__composer {
    background: linear-gradient(180deg, color-mix(in srgb, var(--ofa-surface) 0%, transparent) 0%, var(--ofa-surface) 22%);
    border-top: 0;
    gap: 6px;
    padding: 6px 24px 12px;
    position: relative;
}

.workspace--conversation .workspace__composer-row {
    align-items: flex-end;
    background: var(--ofa-surface);
    border: 1.5px solid var(--ofa-border-strong);
    border-radius: 26px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, .065);
    gap: 8px;
    padding: 6px 8px 6px 8px;
}

.workspace--conversation .workspace__composer-row:focus-within {
    border-color: var(--ofa-blue-600);
    box-shadow: 0 6px 24px color-mix(in srgb, var(--ofa-blue-600) 14%, transparent);
}

.workspace--conversation .workspace__composer-row--internal,
.workspace--conversation .workspace__composer-row--internal:focus-within {
    background: color-mix(in srgb, var(--ofa-warning-100) 45%, var(--ofa-surface));
    border-color: var(--ofa-warning-600);
    box-shadow: 0 4px 18px color-mix(in srgb, var(--ofa-warning-600) 18%, transparent);
}

.workspace__ai-trigger {
    align-items: center;
    background: color-mix(in srgb, var(--ofa-violet-100) 75%, var(--ofa-surface));
    border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 28%, var(--ofa-border));
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-violet-700);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    gap: 5px;
    height: 36px;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    position: relative;
    transition: background-color .14s ease, border-color .14s ease;
    white-space: nowrap;
}

.workspace__ai-trigger:hover {
    background: var(--ofa-violet-100);
    border-color: var(--ofa-violet-500);
}

.workspace__ai-trigger--active {
    background: var(--ofa-violet-100);
    border-color: var(--ofa-violet-600);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ofa-violet-600) 16%, transparent);
}

.workspace__ai-dot {
    background: var(--ofa-violet-600);
    border-radius: 50%;
    height: 7px;
    position: absolute;
    right: 4px;
    top: 4px;
    width: 7px;
}

.workspace--conversation .workspace__composer-input,
.workspace--conversation .workspace__composer-input.ofa-input {
    font-size: 14.5px;
    line-height: 1.45;
    max-height: 136px;
    min-height: 36px;
    padding: 6px 4px;
}

.workspace--conversation .workspace__note-toggle {
    background: transparent;
    border-radius: 50%;
    height: 34px;
    min-height: 34px;
    width: 34px;
}

.workspace__send-btn--circle {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    min-height: 36px;
    padding: 0;
    width: 36px;
}

.workspace__composer-footer {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 0 10px;
}

.workspace--conversation .workspace__composer-hint {
    font-size: 11.5px;
}

.workspace__live-pill {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    font-size: 11.5px;
    gap: 6px;
    white-space: nowrap;
}

.workspace__live-pill::before {
    background: var(--ofa-text-subtle);
    border-radius: 50%;
    content: "";
    height: 6px;
    width: 6px;
}

.workspace__live-pill--on::before {
    background: var(--ofa-success-600);
}

/* On-Demand AI Assist Popover docked cleanly above the pill */
.staff-assist--popover {
    background: var(--ofa-surface);
    border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 32%, var(--ofa-border));
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(109, 53, 232, .14);
    margin-bottom: 4px;
}

.staff-assist--popover[hidden] {
    display: none;
}

.staff-assist--popover .staff-assist__head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
}

.staff-assist--popover .staff-assist__toggle {
    justify-content: flex-start;
    min-height: 24px;
    padding: 0;
}

.staff-assist--popover .staff-assist__quick {
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 0;
    overflow-x: visible;
    padding: 0;
}

.staff-assist--popover .staff-assist__close {
    margin-left: auto;
}

/* Mobile / iPhone (< 900px): True 100% edge-to-edge native messenger feel */
@media (max-width: 899px) {
    /* When inside an active conversation on phone, hide the outer Portal topbar so
       the single 54px thread header sits flush at the top (Back restores topbar). */
    .shell:has(.workspace--conversation .workspace__grid--detail) .topbar {
        display: none;
    }

    .ofa-page.ofa-page--fluid.workspace--conversation {
        height: calc(100dvh - var(--ofa-topbar-height));
        padding: 0;
    }

    .ofa-page.ofa-page--fluid.workspace--conversation:has(.workspace__grid--detail) {
        height: 100dvh;
    }

    .workspace--conversation > .workspace__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .workspace--conversation .workspace__col--queue {
        border-right: 0;
    }

    .workspace--conversation .workspace__col--queue > .workspace__panel {
        gap: 0;
        padding: 0;
    }

    .workspace--conversation .workspace__thread-head {
        gap: 6px;
        min-height: calc(52px + env(safe-area-inset-top, 0px));
        padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 6px;
    }

    .workspace--conversation .workspace__back {
        border: 0;
        height: 34px;
        min-height: 34px;
        width: 32px;
    }

    .workspace--conversation .workspace__patient-heading {
        font-size: 14.5px;
        gap: 6px;
    }

    .workspace--conversation .workspace__patient-name-link {
        font-size: 14.5px;
    }

    .workspace--conversation .workspace__patient-ref {
        display: none;
    }

    .workspace--conversation .workspace__head-queue-badge {
        font-size: 10px;
        padding: 1px 7px;
    }

    .workspace--conversation .workspace__subject-row {
        font-size: 11px;
    }

    .workspace--conversation .workspace__head-icon-btn {
        border-color: transparent;
        height: 34px;
        min-height: 34px;
        width: 34px;
    }

    .workspace--conversation .workspace__messages {
        padding: 10px 12px 6px;
    }

    .workspace--conversation .workspace__composer {
        padding: 4px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .workspace--conversation .workspace__composer-row {
        border-radius: 24px;
        gap: 6px;
        padding: 5px 6px 5px 7px;
    }

    .workspace--conversation .workspace__ai-trigger {
        height: 32px;
        min-height: 32px;
        padding: 0;
        width: 32px;
    }

    .workspace--conversation .workspace__ai-trigger-label {
        display: none;
    }

    .workspace--conversation .workspace__composer-input,
    .workspace--conversation .workspace__composer-input.ofa-input {
        font-size: 15px;
        max-height: 104px;
        min-height: 34px;
        padding: 5px 2px;
    }

    .workspace--conversation .workspace__note-toggle {
        height: 32px;
        min-height: 32px;
        width: 32px;
    }

    .workspace--conversation .workspace__send-btn--circle {
        height: 34px;
        min-height: 34px;
        width: 34px;
    }

    .workspace--conversation .workspace__composer-footer {
        display: none;
    }

    .workspace--conversation:has(.workspace__context) {
        height: 100dvh;
    }

    .workspace--conversation .workspace__context {
        background: var(--ofa-surface);
        border: 0;
        display: flex;
        flex-direction: column;
        height: 100dvh;
        inset: 0;
        max-height: none;
        overflow: hidden;
        padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
        position: fixed;
        z-index: 60;
    }

    .workspace--conversation .workspace__context .workspace__context-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: 16px;
    }

    .workspace--conversation .workspace__ctx-head .ofa-btn--icon {
        aspect-ratio: 1 / 1;
        border-radius: 50%;
        flex: 0 0 36px;
        height: 36px;
        min-height: 36px;
        min-width: 36px;
        padding: 0;
        width: 36px;
    }

    .staff-assist--popover .staff-assist__quick {
        display: flex;
    }
}

/* iOS 26/27 standalone Home Screen PWAs draw a soft translucent status-bar feather
   across the top edge; keep the thread header and full-screen patient details below it. */
@media (display-mode: standalone) and (max-width: 899px) {
    .workspace--conversation .workspace__thread-head {
        min-height: calc(66px + env(safe-area-inset-top, 0px));
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
    }

    .workspace--conversation .workspace__context {
        padding-top: calc(24px + env(safe-area-inset-top, 0px));
    }
}

/* ------------------------------------------- Right Panel: Care Journey Vertical Timeline & Overview */

.workspace__ctx-head {
    align-items: center;
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    padding-bottom: 10px;
}

.workspace__ctx-back {
    height: 30px;
    min-height: 30px;
    padding: 0;
    width: 30px;
}

.workspace__ctx-head-title {
    flex: 1 1 auto;
    margin: 0;
}

.workspace__linked-head {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.workspace__see-all-btn {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--ofa-blue-600);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    gap: 3px;
    padding: 3px 6px;
    transition: background-color .14s ease;
    white-space: nowrap;
}

.workspace__see-all-btn:hover,
.workspace__see-all-btn:focus-visible {
    background: var(--ofa-blue-50);
    text-decoration: underline;
}

.ctx-journey-preview {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 12px;
}

.ctx-journey-preview__top {
    align-items: flex-start;
    display: flex;
    font-size: 13px;
    gap: 8px;
    justify-content: space-between;
}

.ctx-journey-preview__current {
    border-top: 1px solid var(--ofa-border);
    color: var(--ofa-text-secondary);
    font-size: 12.5px;
    margin: 2px 0 0;
    padding-top: 7px;
}

.ctx-journey-preview__current strong {
    color: var(--ofa-text);
}

.ctx-journey-summary {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

.ctx-journey-summary__top {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.ctx-journey-summary__name {
    color: var(--ofa-ink-950);
    font-size: 13.5px;
    line-height: 1.3;
}

.ctx-journey-summary__dates {
    display: flex;
    flex-wrap: wrap;
    font-size: 11.5px;
    gap: 4px;
}

.ctx-journey-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ctx-journey-progress__track {
    background: var(--ofa-hover-surface);
    border-radius: var(--ofa-radius-pill);
    height: 6px;
    overflow: hidden;
    width: 100%;
}

.ctx-journey-progress__fill {
    background: var(--ofa-teal-600);
    border-radius: var(--ofa-radius-pill);
    display: block;
    height: 100%;
    transition: width .2s ease;
}

.ctx-journey-progress__counts {
    color: var(--ofa-text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 11.5px;
    font-weight: 600;
    gap: 5px;
}

.ctx-journey-timeline {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 2px 0 0;
}

.ctx-jstep {
    display: flex;
    gap: 10px;
}

.ctx-jstep__rail {
    align-items: center;
    display: flex;
    flex: 0 0 24px;
    flex-direction: column;
}

.ctx-jstep__node {
    align-items: center;
    background: var(--ofa-surface);
    border: 2px solid var(--ofa-border-strong);
    border-radius: 50%;
    color: var(--ofa-text-muted);
    display: inline-flex;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.ctx-jstep__line {
    background: var(--ofa-border);
    flex: 1 1 auto;
    min-height: 14px;
    width: 2px;
}

.ctx-jstep:last-child .ctx-jstep__line {
    display: none;
}

.ctx-jstep--completed .ctx-jstep__node {
    background: var(--ofa-success-600);
    border-color: var(--ofa-success-600);
    color: #FFFFFF;
}

.ctx-jstep--completed .ctx-jstep__line {
    background: color-mix(in srgb, var(--ofa-success-600) 45%, var(--ofa-border));
}

.ctx-jstep--inprogress .ctx-jstep__node {
    background: var(--ofa-blue-600);
    border-color: var(--ofa-blue-600);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ofa-blue-600) 18%, transparent);
    color: #FFFFFF;
}

.ctx-jstep--skipped .ctx-jstep__node {
    border-style: dashed;
    opacity: .65;
}

.ctx-jstep__card {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    min-width: 0;
    padding: 10px 11px;
}

.ctx-jstep--inprogress .ctx-jstep__card {
    background: color-mix(in srgb, var(--ofa-blue-50) 70%, var(--ofa-surface));
    border-color: color-mix(in srgb, var(--ofa-blue-500) 45%, var(--ofa-border));
}

.ctx-jstep--completed .ctx-jstep__card {
    background: var(--ofa-surface-subtle);
}

.ctx-jstep__head {
    align-items: flex-start;
    display: flex;
    gap: 6px;
    justify-content: space-between;
}

.ctx-jstep__title {
    color: var(--ofa-text);
    font-size: 13px;
    line-height: 1.3;
}

.ctx-jstep__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ctx-jstep__chip {
    background: var(--ofa-hover-surface);
    border-radius: var(--ofa-radius-pill);
    color: var(--ofa-text-secondary);
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
}

.ctx-jstep__chip--info {
    background: var(--ofa-blue-100);
    color: var(--ofa-blue-600);
}

.ctx-jstep__chip--ai {
    background: var(--ofa-violet-100);
    color: var(--ofa-violet-700);
}

.ctx-jstep__desc {
    color: var(--ofa-text-secondary);
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
}

.ctx-jstep__appt {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-left: 3px solid var(--ofa-blue-500);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 9px;
}

.ctx-jstep__appt-top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: space-between;
}

.ctx-jstep__appt-title {
    align-items: center;
    display: inline-flex;
    font-size: 12px;
    gap: 5px;
}

.ctx-jstep__pending-booking {
    align-items: flex-start;
    background: var(--ofa-surface-subtle);
    border: 1px dashed var(--ofa-border-strong);
    border-radius: 8px;
    color: var(--ofa-text-secondary);
    display: flex;
    font-size: 11.5px;
    gap: 6px;
    padding: 7px 9px;
}

.ctx-jstep__pending-booking--warn {
    background: var(--ofa-warning-100);
    border-color: var(--ofa-warning-600);
    color: var(--ofa-warning-700);
}

.ctx-jstep__avail {
    margin: 3px 0 0;
}

.ctx-jstep__guidance {
    background: color-mix(in srgb, var(--ofa-violet-100) 45%, var(--ofa-surface));
    border-radius: 7px;
    color: var(--ofa-text-secondary);
    font-size: 11.5px;
    line-height: 1.4;
    margin: 0;
    padding: 6px 8px;
}

.ctx-jstep__stamp {
    color: var(--ofa-text-subtle);
    font-size: 11px;
}

.ctx-journey-footer {
    padding-top: 2px;
}

.ctx-other-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ctx-other-item {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    text-align: left;
    transition: background-color .14s ease, border-color .14s ease;
    width: 100%;
}

.ctx-other-item:hover {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-border-strong);
    text-decoration: none;
}

.ctx-other-item__subject {
    color: var(--ofa-blue-600);
    font-size: 13px;
    font-weight: 650;
}

.ctx-other-item__meta {
    align-items: center;
    color: var(--ofa-text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 11.5px;
    gap: 6px;
}

/* ------------------------------------------- Close conversation confirmation dialog */

.workspace__close-dialog {
    border: 1px solid var(--ofa-border);
    padding: 22px 24px;
    width: min(490px, calc(100vw - 32px));
}

.workspace__close-dialog-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.workspace__close-dialog-icon {
    align-items: center;
    background: var(--ofa-danger-100);
    border-radius: 10px;
    color: var(--ofa-danger-700);
    display: inline-flex;
    flex-shrink: 0;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.workspace__close-dialog-icon--primary {
    background: var(--ofa-blue-100);
    color: var(--ofa-blue-700);
}

.workspace__close-dialog-title {
    margin-bottom: 3px;
}

.workspace__close-dialog-subject {
    margin: 0;
    word-break: break-word;
}

.workspace__close-dialog-lead {
    color: var(--ofa-text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px;
}

.workspace__close-dialog-list {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    color: var(--ofa-text-secondary);
    display: flex;
    flex-direction: column;
    font-size: 13.5px;
    gap: 9px;
    line-height: 1.48;
    list-style: disc;
    margin: 0;
    padding: 12px 14px 12px 30px;
}

.workspace__close-dialog-list strong {
    color: var(--ofa-text);
}

/* ==================== PRE-HYDRATION COLLAPSED SIDEBAR ==================== */
@media (min-width: 1024px) {
    html[data-sidebar="collapsed"] .shell__rail-anchor {
        flex-basis: 64px;
        width: 64px;
    }

    html[data-sidebar="collapsed"] .shell__rail-anchor .rail {
        width: 64px;
    }

    html[data-sidebar="collapsed"] .shell__rail-anchor .rail__header {
        justify-content: center;
        padding: 0;
    }

    html[data-sidebar="collapsed"] .shell__rail-anchor .rail__brand-text,
    html[data-sidebar="collapsed"] .shell__rail-anchor .rail__collapse-btn,
    html[data-sidebar="collapsed"] .shell__rail-anchor .rail__footer,
    html[data-sidebar="collapsed"] .shell__rail-anchor .nav-group__title,
    html[data-sidebar="collapsed"] .shell__rail-anchor .nav-link__label {
        display: none;
    }

    html[data-sidebar="collapsed"] .shell__rail-anchor .nav-link {
        gap: 0;
        height: 36px;
        justify-content: center;
        margin: 2px auto;
        min-height: 36px;
        padding: 0;
        width: 42px;
    }

    html[data-sidebar="collapsed"] .topbar__expand-btn {
        align-items: center;
        display: inline-flex;
        justify-content: center;
    }
}

/* ==================== APPOINTMENTS FINAL — EDGE-TO-EDGE FULL-SCREEN ==================== */
.ofa-page.ofa-page--fluid.appt-workspace {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100dvh - var(--ofa-topbar-height));
    max-width: none;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.appt-state-wrap {
    padding: var(--ofa-space-6);
}

.appt-inline-banner {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin: 0;
}

.appt-row1 {
    align-items: center;
    background: var(--ofa-surface);
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    gap: 10px;
    justify-content: space-between;
    min-height: 48px;
    padding: 6px 16px;
}

.appt-row1__left {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 10px;
    min-width: 0;
}

.appt-title {
    color: var(--ofa-text);
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -.01em;
    margin: 0 2px 0 0;
    white-space: nowrap;
}

.appt-row1__cal-controls {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 8px;
    min-width: 0;
}

.appt-date-nav {
    align-items: center;
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
}

.appt-nav-step {
    min-width: 28px;
    padding: 0 8px;
}

.appt-date-input {
    font-size: 12px;
    height: 28px;
    min-height: 28px;
    padding: 0 8px;
    width: 136px;
}

.appt-search {
    flex: 0 1 210px;
    min-width: 130px;
}

.appt-search .ofa-input {
    height: 28px;
    min-height: 28px;
}

.appt-audit-crumb {
    align-items: center;
    background: var(--ofa-blue-50);
    border: 1px solid color-mix(in srgb, var(--ofa-blue-600) 24%, var(--ofa-border));
    border-radius: 999px;
    color: var(--ofa-blue-700);
    display: inline-flex;
    font-size: 12px;
    font-weight: 650;
    gap: 6px;
    padding: 4px 11px;
}

.appt-row1__actions {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    gap: 6px;
}

.appt-icon-btn {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 8px;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    min-height: 32px;
    padding: 0;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
    width: 32px;
}

.appt-icon-btn:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
    color: var(--ofa-text);
}

.appt-icon-btn.is-active {
    background: var(--ofa-blue-50);
    border-color: var(--ofa-blue-600);
    color: var(--ofa-blue-700);
}

.appt-schedule-btn {
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
}

/* Row 2: Calendar Status Filter Chips ONLY */
.appt-row2 {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    gap: 10px;
    justify-content: space-between;
    min-height: 40px;
    padding: 5px 16px;
}

.appt-row2 .hub-status-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.appt-row2 .hub-status-chips::-webkit-scrollbar {
    display: none;
}

.appt-row2__period {
    color: var(--ofa-text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Mobile-only switch & compact date bar (hidden on desktop >= 1024px) */
.appt-mobile-switch,
.appt-mobile-datebar {
    display: none;
}

/* Edge-to-Edge Split */
.appt-split {
    flex: 1;
    grid-template-columns: minmax(320px, var(--hub-calendar-pct, 64%)) 8px minmax(310px, var(--hub-queue-pct, 36%));
    min-height: 0;
    overflow: hidden;
}

.appt-split.appt-split--queue-hidden {
    grid-template-columns: minmax(0, 1fr) !important;
}

.appt-split.appt-split--queue-hidden .appt-splitter,
.appt-split.appt-split--queue-hidden .appt-queue-pane {
    display: none;
}

.appt-main-pane {
    background: var(--ofa-surface);
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.appt-day-scroll,
.appt-week-scroll,
.appt-queue-list,
.hub-v2-feed {
    scrollbar-color: rgba(100, 116, 139, .28) transparent;
    scrollbar-width: thin;
}

.appt-day-scroll::-webkit-scrollbar,
.appt-week-scroll::-webkit-scrollbar,
.appt-queue-list::-webkit-scrollbar,
.hub-v2-feed::-webkit-scrollbar {
    height: 5px;
    width: 5px;
}

.appt-day-scroll::-webkit-scrollbar-track,
.appt-week-scroll::-webkit-scrollbar-track,
.appt-queue-list::-webkit-scrollbar-track,
.hub-v2-feed::-webkit-scrollbar-track {
    background: transparent;
}

.appt-day-scroll::-webkit-scrollbar-thumb,
.appt-week-scroll::-webkit-scrollbar-thumb,
.appt-queue-list::-webkit-scrollbar-thumb,
.hub-v2-feed::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, .28);
    border-radius: 999px;
}

.appt-day-scroll::-webkit-scrollbar-thumb:hover,
.appt-week-scroll::-webkit-scrollbar-thumb:hover,
.appt-queue-list::-webkit-scrollbar-thumb:hover,
.hub-v2-feed::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, .48);
}

.appt-day-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px;
}

/* Week Calendar: Non-overlapping Mon-Fri + Edge-to-Edge Sat-Sun below (switches to 7 columns automatically on wide monitors or when Queue is hidden!) */
.appt-week-scroll {
    container-type: inline-size;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.appt-week-canvas {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.appt-week-row {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.appt-week-row--weekdays {
    min-height: max(76%, 540px);
}

.appt-week-row--weekend {
    border-top: 2px solid var(--ofa-border-strong);
    min-height: 240px;
}

.appt-weekend-filler {
    background: var(--ofa-surface-subtle);
    grid-column: 3 / -1;
}

.appt-week-scroll .schedule-day-col {
    background: var(--ofa-surface-subtle);
    border: 0;
    border-radius: 0;
    border-right: 1px solid var(--ofa-border);
    min-height: auto;
    min-width: 0;
    overflow: hidden;
    padding: 0;
}

.appt-week-row--weekdays .schedule-day-col:last-child {
    border-right: 0;
}

.appt-week-scroll .schedule-day-col--today {
    background: color-mix(in srgb, var(--ofa-blue-50) 55%, var(--ofa-surface));
}

.appt-week-scroll .schedule-day-col__head {
    background: var(--ofa-surface);
    border-bottom: 1px solid var(--ofa-border);
    margin: 0;
    padding: 8px 10px;
}

.appt-week-scroll .schedule-day-col--today .schedule-day-col__head {
    background: var(--ofa-blue-50);
}

.appt-week-scroll .schedule-day-col__list {
    padding: 8px;
}

.appt-week-scroll .schedule-day-col__empty {
    padding: 16px 10px;
}

/* Automatic 7-day single row when calendar pane is wide (large monitors, zoom-out, or Queue hidden!) */
@container (min-width: 1120px) {
    .appt-week-canvas {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        min-height: 100%;
    }

    .appt-week-row--weekdays,
    .appt-week-row--weekend {
        border-top: 0;
        display: contents;
        min-height: 0;
    }

    .appt-weekend-filler {
        display: none;
    }

    .appt-week-row--weekdays .schedule-day-col:last-child {
        border-right: 1px solid var(--ofa-border);
    }

    .appt-week-row--weekend .schedule-day-col:last-of-type {
        border-right: 0;
    }
}

/* Reorganized Appointment, New-Visit Context & Activity Drawers */
.appt-drawer-outcome-box {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 12px;
    gap: 10px;
    padding: 12px 14px;
}

.appt-drawer-outcome-box.is-urgent {
    background: color-mix(in srgb, var(--ofa-warning-100) 45%, var(--ofa-surface));
    border-color: color-mix(in srgb, var(--ofa-warning-600) 36%, var(--ofa-border));
}

.appt-outcome-btn-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.appt-outcome-btn {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 9px;
    color: var(--ofa-text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    gap: 5px;
    height: 36px;
    justify-content: center;
    padding: 0 8px;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
    white-space: nowrap;
}

.appt-outcome-btn--complete {
    background: var(--ofa-teal-100);
    border-color: color-mix(in srgb, var(--ofa-teal-600) 38%, transparent);
    color: var(--ofa-teal-700);
}

.appt-outcome-btn--complete:hover:not(:disabled) {
    background: color-mix(in srgb, var(--ofa-teal-600) 18%, var(--ofa-teal-100));
}

.appt-outcome-btn--noshow {
    background: var(--ofa-warning-100);
    border-color: color-mix(in srgb, var(--ofa-warning-600) 38%, transparent);
    color: var(--ofa-warning-700);
}

.appt-outcome-btn--noshow:hover:not(:disabled) {
    background: color-mix(in srgb, var(--ofa-warning-600) 18%, var(--ofa-warning-100));
}

.appt-outcome-btn--cancel {
    background: var(--ofa-danger-100);
    border-color: color-mix(in srgb, var(--ofa-danger-600) 35%, transparent);
    color: var(--ofa-danger-700);
}

.appt-outcome-btn--cancel:hover:not(:disabled) {
    background: color-mix(in srgb, var(--ofa-danger-600) 16%, var(--ofa-danger-100));
}

.appt-drawer-confirm {
    border-radius: 10px;
    margin-top: 2px;
    padding: 12px 14px;
}

.appt-drawer-confirm .ofa-state__title {
    font-size: 14.5px;
    line-height: 1.3;
    margin: 0 0 4px;
}

.appt-drawer-confirm .ofa-help {
    font-size: 12.5px;
    line-height: 1.45;
    margin: 0;
}

.hub-queue-card--busy {
    opacity: .55;
    pointer-events: none;
    transition: opacity .15s ease;
}

.appt-drawer-advanced {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    padding: 10px 12px;
}

.appt-drawer-advanced summary {
    color: var(--ofa-text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.appt-drawer-context {
    background: var(--ofa-blue-50);
    border: 1px solid color-mix(in srgb, var(--ofa-blue-600) 28%, var(--ofa-border));
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 11px 13px;
}

.appt-drawer-context--warn {
    background: color-mix(in srgb, var(--ofa-warning-100) 60%, var(--ofa-surface));
    border-color: color-mix(in srgb, var(--ofa-warning-600) 40%, var(--ofa-border));
}

.appt-drawer-context__title {
    align-items: center;
    color: var(--ofa-text);
    display: flex;
    font-size: 13px;
    font-weight: 750;
    gap: 6px;
}

.appt-drawer-context__line {
    color: var(--ofa-text-secondary);
    font-size: 12.5px;
    line-height: 1.45;
    margin: 0;
}

.appt-activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.appt-activity-item {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
}

.appt-activity-item__top {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.appt-activity-item__title {
    color: var(--ofa-text);
    font-size: 13px;
    font-weight: 650;
    margin: 2px 0 0;
}

.appt-activity-diffs {
    color: var(--ofa-text-secondary);
    font-size: 12px;
    line-height: 1.45;
    margin: 4px 0 0;
    padding-left: 16px;
}

.appt-splitter {
    background: var(--ofa-surface);
    border-left: 1px solid var(--ofa-border);
    border-right: 1px solid var(--ofa-border);
    width: 8px;
}

.appt-splitter::before {
    display: none;
}

.appt-splitter .hub-splitter__grip {
    border: 0;
    background: transparent;
    font-size: 11px;
    height: 36px;
    width: 8px;
}

/* Right Priority Action Queue */
.appt-queue-pane {
    background: var(--ofa-surface);
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.appt-queue-head {
    align-items: center;
    background: var(--ofa-surface);
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    justify-content: space-between;
    padding: 10px 14px;
}

.appt-queue-title {
    color: var(--ofa-text);
    font-size: 13.5px;
    font-weight: 750;
    margin: 0;
}

.appt-live-pill {
    background: var(--ofa-teal-100);
    border-color: color-mix(in srgb, var(--ofa-teal-600) 24%, transparent);
    color: var(--ofa-teal-700);
    font-weight: 700;
}

/* 4-Column Count-Over-Label Segmented Queue Tabs + Hover Tooltips */
.appt-q-tabs {
    background: var(--ofa-surface-subtle);
    border-bottom: 1px solid var(--ofa-border);
    display: grid;
    flex-shrink: 0;
    gap: 4px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 7px 10px;
}

.appt-q-tab {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: 1px;
    justify-content: center;
    line-height: 1.2;
    padding: 5px 4px;
    position: relative;
    transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}

.appt-q-tab:hover {
    background: var(--ofa-hover-surface);
    color: var(--ofa-text);
}

.appt-q-tab.is-active {
    background: var(--ofa-surface);
    border-color: var(--ofa-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    color: var(--ofa-blue-700);
}

.appt-q-tab__count {
    color: var(--ofa-text);
    font-size: 13px;
    font-weight: 750;
}

.appt-q-tab.is-active .appt-q-tab__count {
    color: var(--ofa-blue-700);
}

.appt-q-tab__label {
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.appt-q-tab--tooltip::after {
    background: var(--ofa-ink-950, #121B2E);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .22);
    color: #FFFFFF;
    content: attr(data-tooltip);
    font-size: 11px;
    font-weight: 600;
    left: 50%;
    opacity: 0;
    padding: 4px 8px;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 6px);
    transform: translateX(-50%) translateY(-2px);
    transition: opacity .12s ease, transform .12s ease;
    white-space: nowrap;
    z-index: 30;
}

.appt-q-tab--tooltip:hover::after,
.appt-q-tab--tooltip:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.appt-queue-list {
    flex: 1;
    gap: 0;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
}

.appt-queue-list .hub-queue-card {
    border: 0;
    border-bottom: 1px solid var(--ofa-border);
    border-radius: 0;
    box-shadow: none;
    padding: 11px 14px;
}

.appt-queue-list .hub-queue-card:hover {
    background: var(--ofa-surface-subtle);
}

/* In-Place Audit Trail Pane */
.appt-audit-pane {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.appt-audit-bar {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    padding: 8px 16px;
}

.appt-audit-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* ==================== APPOINTMENTS MOBILE RESPONSIVE (< 1024px) ==================== */
@media (max-width: 1023px) {
    .appt-row1 {
        min-height: 46px;
        padding: 6px 12px;
    }

    .appt-row1__cal-controls,
    .appt-queue-toggle,
    .appt-schedule-btn__label,
    .appt-row2__period,
    .appt-splitter {
        display: none;
    }

    .appt-schedule-btn {
        min-width: 32px;
        padding: 0;
        width: 32px;
    }

    .appt-mobile-switch {
        background: var(--ofa-surface-subtle);
        border-bottom: 1px solid var(--ofa-border);
        display: grid;
        flex-shrink: 0;
        gap: 4px;
        grid-template-columns: 1fr 1fr;
        padding: 7px 12px;
    }

    .appt-mobile-switch__btn {
        background: transparent;
        border: 1px solid transparent;
        border-radius: 8px;
        color: var(--ofa-text-secondary);
        cursor: pointer;
        font: inherit;
        font-size: 12.5px;
        font-weight: 650;
        padding: 6px 8px;
    }

    .appt-mobile-switch__btn.is-active {
        background: var(--ofa-surface);
        border-color: var(--ofa-border);
        box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
        color: var(--ofa-blue-700);
    }

    .appt-mobile-datebar {
        align-items: center;
        background: var(--ofa-surface);
        border-bottom: 1px solid var(--ofa-border);
        display: flex;
        flex-shrink: 0;
        gap: 6px;
        padding: 6px 12px;
    }

    .appt-mobile-datebar__label {
        background: transparent;
        border: 0;
        color: var(--ofa-text);
        cursor: pointer;
        flex: 1;
        font: inherit;
        font-size: 12.5px;
        font-weight: 700;
        min-width: 0;
        overflow: hidden;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .appt-row2 {
        padding: 5px 12px;
    }

    .appt-row2--mobile-hidden {
        display: none;
    }

    .appt-split {
        display: flex;
        flex-direction: column;
    }

    .appt-split--mobile-main .appt-queue-pane {
        display: none;
    }

    .appt-split--mobile-main .appt-main-pane {
        display: flex;
        flex: 1;
    }

    .appt-split--mobile-queue .appt-main-pane {
        display: none;
    }

    .appt-split--mobile-queue .appt-queue-pane {
        display: flex;
        flex: 1;
    }

    .appt-week-row,
    .appt-week-row--weekdays,
    .appt-week-row--weekend {
        border-top: 0;
        display: flex;
        flex-direction: column;
        min-height: auto;
    }

    .appt-weekend-filler {
        display: none;
    }

    .appt-week-scroll .schedule-day-col {
        border-bottom: 1px solid var(--ofa-border);
        border-right: 0;
        min-height: auto;
    }
}

/* ==================== ONCOFLOW HUB FINAL — FULL-SCREEN COMMAND CANVAS ==================== */
.ofa-page.ofa-page--fluid.hub-workspace {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: calc(100dvh - var(--ofa-topbar-height));
    max-width: none;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.hub-v2-notice-wrap {
    padding: 12px 16px 0;
}

.hub-v2-shell {
    background: var(--ofa-surface);
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Top Live Pulse Bar */
.hub-pulse-bar {
    align-items: center;
    background: var(--ofa-surface-subtle);
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    min-height: 46px;
    padding: 6px 16px;
}

.hub-pulse-bar__title-group {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    gap: 7px;
}

.hub-pulse-bar__title {
    color: var(--ofa-text);
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -.01em;
    margin: 0;
    white-space: nowrap;
}

.hub-ai-pill {
    align-items: center;
    background: var(--ofa-violet-100);
    border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 24%, transparent);
    border-radius: 999px;
    color: var(--ofa-violet-700);
    display: inline-flex;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 750;
    gap: 4px;
    height: 22px;
    justify-content: center;
    line-height: 1;
    padding: 0 9px;
    white-space: nowrap;
}

.hub-ai-pill svg {
    display: block;
    flex-shrink: 0;
    overflow: visible;
}

.hub-pulse-bar__sep {
    background: var(--ofa-border-strong);
    flex-shrink: 0;
    height: 16px;
    margin: 0 2px;
    width: 1px;
}

.hub-pulse-pills {
    align-items: center;
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.hub-pulse-pills::-webkit-scrollbar {
    display: none;
}

.hub-pulse-pill {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 999px;
    color: var(--ofa-text-secondary);
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    gap: 5px;
    padding: 4px 10px;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
    white-space: nowrap;
}

.hub-pulse-pill strong {
    color: var(--ofa-text);
    font-weight: 750;
}

.hub-pulse-pill:hover:not(:disabled) {
    background: var(--ofa-hover-surface);
    border-color: var(--ofa-border-strong);
}

.hub-pulse-pill--warn {
    background: color-mix(in srgb, var(--ofa-warning-100) 65%, var(--ofa-surface));
    border-color: color-mix(in srgb, var(--ofa-warning-600) 35%, var(--ofa-border));
}

.hub-pulse-pill.is-active {
    background: var(--ofa-violet-100);
    border-color: var(--ofa-violet-600);
    color: var(--ofa-violet-700);
}

.hub-pulse-pill.is-active strong {
    color: var(--ofa-violet-700);
}

.hub-pulse-pill__short {
    display: none;
}

.hub-pulse-bar__spacer {
    flex: 1;
}

.hub-new-chat-btn {
    flex-shrink: 0;
    height: 30px;
    min-height: 30px;
    padding: 0 10px;
}

/* Main Feed */
.hub-v2-feed {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px 48px;
}

/* Clean Initial Start View */
.hub-v2-start {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: auto;
    max-width: 980px;
    width: 100%;
}

.hub-v2-start__head {
    align-items: center;
    display: flex;
    gap: 12px;
}

.hub-v2-start__orb {
    align-items: center;
    background: linear-gradient(135deg, var(--ofa-violet-100) 0%, var(--ofa-blue-100) 100%);
    border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 24%, var(--ofa-border));
    border-radius: 12px;
    color: var(--ofa-violet-700);
    display: inline-flex;
    flex-shrink: 0;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.hub-v2-start__title {
    color: var(--ofa-text);
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.015em;
    margin: 0;
}

.hub-v2-start__sub {
    color: var(--ofa-text-muted);
    font-size: 13px;
    margin: 3px 0 0;
}

.hub-v2-start__sub code {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 5px;
    padding: 1px 5px;
}

.hub-v2-starter-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hub-v2-starter-card {
    align-items: flex-start;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 11px;
    color: var(--ofa-text);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 10px;
    padding: 11px 13px;
    text-align: left;
    transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}

.hub-v2-starter-card:hover:not(:disabled) {
    background: var(--ofa-surface-subtle);
    border-color: color-mix(in srgb, var(--ofa-blue-600) 40%, var(--ofa-border));
    box-shadow: 0 4px 12px rgba(15, 23, 42, .05);
}

.hub-v2-starter-card__ic {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex-shrink: 0;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.hub-v2-starter-card__ic--violet { background: var(--ofa-violet-100); color: var(--ofa-violet-700); }
.hub-v2-starter-card__ic--blue { background: var(--ofa-blue-100); color: var(--ofa-blue-700); }
.hub-v2-starter-card__ic--amber { background: var(--ofa-warning-100); color: var(--ofa-warning-700); }
.hub-v2-starter-card__ic--teal { background: var(--ofa-teal-100); color: var(--ofa-teal-700); }

.hub-v2-starter-card__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hub-v2-starter-card__title {
    color: var(--ofa-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.hub-v2-starter-card__desc {
    color: var(--ofa-text-muted);
    font-size: 11.5px;
    line-height: 1.35;
}

.hub-v2-mobile-starters {
    display: none;
}

/* Conversation Turns & Structured Result Rows */
.hub-v2-turns {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 auto;
    max-width: 980px;
    width: 100%;
}

.hub-v2-turn {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hub-v2-user-row {
    display: flex;
    justify-content: flex-end;
}

.hub-v2-user-bubble {
    background: var(--ofa-blue-600);
    border-radius: 16px 16px 4px 16px;
    color: #FFFFFF;
    font-size: 13.5px;
    line-height: 1.45;
    max-width: min(76%, 620px);
    padding: 9px 14px;
}

.hub-v2-ai-card {
    background: var(--ofa-surface-subtle);
    border: 1px solid var(--ofa-border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px 16px;
}

.hub-v2-ai-card__head {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.hub-v2-ai-card__head-l {
    align-items: center;
    display: flex;
    gap: 8px;
}

.hub-v2-ai-summary {
    color: var(--ofa-text-secondary);
    font-size: 13.5px;
    line-height: 1.5;
}

.hub-v2-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.hub-v2-row,
.hub-v2-snapshot {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border);
    border-radius: 10px;
    padding: 10px 12px;
}

.hub-v2-row {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.hub-v2-row__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hub-v2-row__title-wrap {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hub-v2-row__name {
    color: var(--ofa-text);
    font-size: 13.5px;
    font-weight: 700;
}

.hub-v2-row__sub {
    color: var(--ofa-text-secondary);
    font-size: 12.5px;
    line-height: 1.38;
    margin: 0;
}

.hub-v2-row__meta {
    color: var(--ofa-text-muted);
    font-size: 11.5px;
    margin: 0;
}

.hub-v2-snapshot {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hub-v2-snapshot__top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.hub-v2-bullets {
    color: var(--ofa-text-secondary);
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 4px;
    line-height: 1.48;
    list-style: disc;
    margin: 0;
    padding-left: 18px;
}

.hub-v2-bullets strong {
    color: var(--ofa-text);
}

/* Fixed-track 3-column action grid — keeps Appointments, Patient & Chat perfectly aligned across every row even when Chat has a badge! */
.hub-v2-actions {
    align-items: center;
    display: grid;
    flex-shrink: 0;
    gap: 6px;
    grid-template-columns: 124px 74px 82px;
}

.hub-v2-actions--single {
    grid-template-columns: auto;
}

.hub-v2-act {
    align-items: center;
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 7px;
    color: var(--ofa-text);
    display: inline-flex;
    font-size: 12px;
    font-weight: 650;
    gap: 5px;
    height: 28px;
    justify-content: center;
    padding: 0 9px;
    text-decoration: none;
    transition: background-color .14s ease, border-color .14s ease;
    white-space: nowrap;
    width: 100%;
}

.hub-v2-act:hover {
    background: var(--ofa-hover-surface);
    text-decoration: none;
}

.hub-v2-act--primary {
    background: var(--ofa-blue-600);
    border-color: var(--ofa-blue-600);
    color: #FFFFFF;
}

.hub-v2-act--primary:hover {
    background: var(--ofa-blue-700);
    border-color: var(--ofa-blue-700);
    color: #FFFFFF;
}

.hub-v2-act--disabled {
    background: var(--ofa-surface-subtle);
    border-color: var(--ofa-border);
    color: var(--ofa-text-subtle);
    cursor: default;
    opacity: .62;
    pointer-events: none;
}

/* Modern Inline 3-Step Reasoning Indicator (no bulky purple card) */
.hub-v2-reasoning {
    align-items: center;
    display: inline-flex;
    gap: 10px;
    padding: 6px 4px;
}

.hub-v2-reasoning__orb {
    align-items: center;
    animation: hub-pulse-glow 1.3s ease-in-out infinite;
    background: linear-gradient(135deg, var(--ofa-violet-100) 0%, var(--ofa-blue-100) 100%);
    border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 30%, transparent);
    border-radius: 50%;
    color: var(--ofa-violet-700);
    display: inline-flex;
    flex-shrink: 0;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.hub-v2-reasoning__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hub-v2-reasoning__current {
    color: var(--ofa-text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.hub-v2-reasoning__steps {
    align-items: center;
    display: flex;
    gap: 5px;
}

.hub-v2-reasoning__dot {
    background: var(--ofa-border-strong);
    border-radius: 999px;
    height: 4px;
    transition: width .2s ease, background-color .2s ease;
    width: 14px;
}

.hub-v2-reasoning__dot.is-done {
    background: var(--ofa-violet-600);
    width: 14px;
}

.hub-v2-reasoning__dot.is-active {
    background: var(--ofa-blue-600);
    width: 26px;
}

@keyframes hub-pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ofa-violet-600) 22%, transparent); transform: scale(1); }
    50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ofa-violet-600) 0%, transparent); transform: scale(1.04); }
}

.hub-v2-act__badge {
    align-items: center;
    background: var(--ofa-blue-100);
    border-radius: 999px;
    color: var(--ofa-blue-700);
    display: inline-flex;
    font-size: 10px;
    font-weight: 750;
    height: 16px;
    justify-content: center;
    min-width: 16px;
    padding: 0 4px;
}

.hub-v2-list-foot {
    align-items: center;
    color: var(--ofa-text-muted);
    display: flex;
    font-size: 12px;
    gap: 10px;
    justify-content: space-between;
    padding-top: 2px;
}

.hub-v2-list-foot a {
    color: var(--ofa-blue-600);
    font-weight: 650;
    text-decoration: none;
}

.hub-v2-list-foot a:hover {
    text-decoration: underline;
}

/* Bottom-Docked Floating WhatsApp-Style Composer with Soft Top Fade Gradient (no hard gray border) */
.hub-v2-dock {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--ofa-surface) 0%, transparent) 0%,
        color-mix(in srgb, var(--ofa-surface) 88%, transparent) 38%,
        var(--ofa-surface) 64%);
    border-top: 0;
    flex-shrink: 0;
    margin-top: -32px;
    padding: 28px 24px 14px;
    pointer-events: none;
    position: relative;
    z-index: 6;
}

.hub-v2-composer-form {
    margin: 0 auto;
    max-width: 980px;
    pointer-events: auto;
    width: 100%;
}

.hub-composer__box.hub-v2-pill {
    align-items: flex-end;
    background: var(--ofa-surface);
    border: 1.5px solid var(--ofa-border-strong);
    border-radius: 26px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, .065);
    display: flex;
    gap: 8px;
    padding: 6px 8px 6px 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.hub-composer__box.hub-v2-pill:focus-within {
    border-color: var(--ofa-blue-600);
    box-shadow: 0 6px 24px color-mix(in srgb, var(--ofa-blue-600) 14%, transparent);
}

.hub-v2-sparkle-btn {
    align-items: center;
    background: var(--ofa-violet-100);
    border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 28%, var(--ofa-border));
    border-radius: 50%;
    color: var(--ofa-violet-700);
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    height: 36px;
    justify-content: center;
    padding: 0;
    transition: background-color .14s ease, color .14s ease, border-color .14s ease;
    width: 36px;
}

.hub-v2-sparkle-btn:hover:not(:disabled) {
    border-color: var(--ofa-violet-600);
}

.hub-v2-sparkle-btn.is-active {
    background: var(--ofa-violet-600);
    border-color: var(--ofa-violet-600);
    color: #FFFFFF;
}

.hub-v2-input.ofa-input {
    background: transparent;
    border: 0;
    box-shadow: none;
    flex: 1;
    font-size: 14.5px;
    line-height: 1.45;
    max-height: 136px;
    min-height: 36px;
    min-width: 0;
    padding: 6px 4px;
    resize: none;
}

.hub-v2-input.ofa-input:focus {
    border: 0;
    box-shadow: none;
    outline: none;
}

.hub-v2-submit {
    border-radius: 999px;
    flex-shrink: 0;
    height: 36px;
    min-height: 36px;
    padding: 0 15px;
}

.hub-v2-submit__desktop {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.hub-v2-submit__mobile {
    display: none;
}

/* Floating Grouped Menu */
.hub-v2-popover-backdrop {
    background: transparent;
    border: 0;
    inset: 0;
    pointer-events: auto;
    position: fixed;
    z-index: 25;
}

.hub-v2-popover {
    background: var(--ofa-surface);
    border: 1px solid var(--ofa-border-strong);
    border-radius: 14px;
    bottom: calc(100% - 18px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
    display: flex;
    flex-direction: column;
    gap: 2px;
    left: max(24px, calc(50% - 490px));
    max-height: 62dvh;
    overflow-y: auto;
    padding: 10px;
    pointer-events: auto;
    position: absolute;
    width: min(420px, calc(100% - 32px));
    z-index: 30;
}

.hub-v2-popover__head {
    align-items: center;
    border-bottom: 1px solid var(--ofa-border);
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    padding: 2px 6px 7px;
}

.hub-v2-popover__title {
    color: var(--ofa-violet-700);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.hub-v2-popover__close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--ofa-text-muted);
    cursor: pointer;
    display: inline-flex;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.hub-v2-popover__close:hover {
    background: var(--ofa-hover-surface);
    color: var(--ofa-text);
}

.hub-v2-popover__sec {
    color: var(--ofa-text-subtle);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .06em;
    padding: 6px 8px 2px;
    text-transform: uppercase;
}

.hub-v2-popover__item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--ofa-text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 12.5px;
    font-weight: 550;
    gap: 8px;
    padding: 7px 9px;
    text-align: left;
    transition: background-color .12s ease, color .12s ease;
    width: 100%;
}

.hub-v2-popover__item svg {
    color: var(--ofa-violet-600);
}

.hub-v2-popover__item:hover:not(:disabled) {
    background: var(--ofa-violet-100);
    color: var(--ofa-violet-700);
}

/* ==================== ONCOFLOW HUB MOBILE RESPONSIVE (< 768px) ==================== */
@media (max-width: 767px) {
    .hub-pulse-bar {
        flex-wrap: wrap;
        gap: 6px 8px;
        padding: 7px 12px;
    }

    .hub-pulse-bar__sep {
        display: none;
    }

    .hub-pulse-pills {
        flex-basis: 100%;
        order: 3;
    }

    .hub-pulse-pill {
        font-size: 11px;
        padding: 3px 8px;
    }

    .hub-pulse-pill__long {
        display: none;
    }

    .hub-pulse-pill__short {
        display: inline;
    }

    .hub-new-chat-btn {
        min-width: 30px;
        padding: 0;
        width: 30px;
    }

    .hub-new-chat-btn__label {
        display: none;
    }

    .hub-v2-feed {
        padding: 12px 10px 44px;
    }

    .hub-v2-start {
        align-items: center;
        text-align: center;
    }

    .hub-v2-start__head {
        flex-direction: column;
        gap: 8px;
    }

    .hub-v2-start__title {
        font-size: 17px;
    }

    .hub-v2-starter-grid {
        display: none;
    }

    .hub-v2-mobile-starters {
        display: flex;
        flex-direction: column;
        gap: 7px;
        width: 100%;
    }

    .hub-v2-mobile-chip {
        align-items: center;
        background: var(--ofa-surface);
        border: 1px solid color-mix(in srgb, var(--ofa-violet-600) 24%, var(--ofa-border));
        border-radius: 11px;
        color: var(--ofa-text);
        cursor: pointer;
        display: flex;
        font: inherit;
        font-size: 12.5px;
        font-weight: 600;
        gap: 8px;
        padding: 9px 12px;
        text-align: left;
        width: 100%;
    }

    .hub-v2-mobile-chip svg {
        color: var(--ofa-violet-600);
    }

    .hub-v2-mobile-hint {
        color: var(--ofa-text-muted);
        font-size: 11px;
        margin: 4px 0 0;
        text-align: center;
    }

    .hub-v2-ai-card {
        padding: 10px;
    }

    .hub-v2-row {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        padding: 9px 10px;
    }

    .hub-v2-snapshot__top {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .hub-v2-actions {
        grid-template-columns: 1.35fr 1fr 1fr;
        width: 100%;
    }

    .hub-v2-actions--single {
        grid-template-columns: 1fr;
    }

    .hub-v2-dock {
        margin-top: -26px;
        padding: 22px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .hub-v2-popover {
        left: 10px;
        right: 10px;
        width: auto;
    }

    .hub-v2-sparkle-btn {
        height: 34px;
        width: 34px;
    }

    .hub-v2-submit {
        height: 34px;
        min-height: 34px;
        padding: 0;
        width: 34px;
    }

    .hub-v2-submit__desktop,
    .hub-v2-submit__label {
        display: none;
    }

    .hub-v2-submit__mobile {
        align-items: center;
        display: inline-flex;
        justify-content: center;
    }
}
