:root {
    /* ClassFlow Calm Professional. TenantTheme overrides only the brand tokens. */
    --cf-color-primary: #315FBE;
    --cf-color-on-primary: #FFFFFF;
    --cf-color-secondary: #6A5ACD;
    --cf-color-on-secondary: #FFFFFF;

    --cf-color-primary-soft: color-mix(in srgb, var(--cf-color-primary) 9%, #FFFFFF);
    --cf-color-primary-subtle: color-mix(in srgb, var(--cf-color-primary) 5%, #FFFFFF);
    --cf-color-primary-hover: color-mix(in srgb, var(--cf-color-primary) 88%, #000000);
    --cf-color-primary-active: color-mix(in srgb, var(--cf-color-primary) 78%, #000000);
    --cf-color-secondary-soft: color-mix(in srgb, var(--cf-color-secondary) 9%, #FFFFFF);

    --cf-color-background: #F6F8FB;
    --cf-color-surface: #FFFFFF;
    --cf-color-surface-muted: #F8FAFC;
    --cf-color-surface-strong: #F1F5F9;
    --cf-color-text: #17263A;
    --cf-color-text-muted: #5F6F82;
    --cf-color-text-subtle: #7B8998;
    --cf-color-border: #E2E8F0;
    --cf-color-border-strong: #CBD5E1;

    /* Semantic colors are ClassFlow-owned and are not tenant branding tokens. */
    --cf-color-success: #0F7A4D;
    --cf-color-warning: #A15C00;
    --cf-color-danger: #B42318;
    --cf-color-info: #0B63CE;
    --cf-color-focus: #0B63CE;

    --cf-radius-sm: 8px;
    --cf-radius-md: 12px;
    --cf-radius-lg: 16px;
    --cf-radius-xl: 20px;
    --cf-radius-round: 999px;

    --cf-space-1: 4px;
    --cf-space-2: 8px;
    --cf-space-3: 12px;
    --cf-space-4: 16px;
    --cf-space-5: 20px;
    --cf-space-6: 24px;
    --cf-space-8: 32px;
    --cf-space-10: 40px;
    --cf-space-12: 48px;
    --cf-space-16: 64px;

    --cf-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --cf-shadow-1: 0 1px 2px rgba(23, 38, 58, .06), 0 4px 12px rgba(23, 38, 58, .04);
    --cf-shadow-2: 0 12px 32px rgba(23, 38, 58, .12);
    --cf-motion-fast: 120ms;
    --cf-motion-base: 180ms;
    --cf-motion-panel: 230ms;
    --cf-ease-standard: cubic-bezier(.2, 0, 0, 1);

    --cf-content-reading: 760px;
    --cf-content-standard: 1120px;
    --cf-content-wide: 1280px;

    color: var(--cf-color-text);
    background: var(--cf-color-background);
    font-family: var(--cf-font-family);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    min-width: 320px;
    background: var(--cf-color-background);
    color: var(--cf-color-text);
    font-size: 16px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--cf-color-focus) 72%, #FFFFFF);
    outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
    font-size: clamp(1.875rem, 2.4vw, 2rem);
    font-weight: 750;
    letter-spacing: -.028em;
    line-height: 1.15;
    margin-bottom: var(--cf-space-2);
}
h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.25;
}
.material-symbols-rounded { vertical-align: middle; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.cf-tenant-theme,
.cf-shell { min-height: 100dvh; }

.cf-tenant-theme { font-family: var(--cf-font-family); }

/* Future style-template hook. Active Studio is the initial ClassFlow default. */
.cf-tenant-theme[data-cf-template="active-studio"],
.cf-branding-preview-card[data-cf-template="active-studio"] {
    --cf-template-card-radius: var(--cf-radius-lg);
    --cf-template-nav-radius: 10px;
    --cf-template-icon-radius: 12px;
}

.cf-tenant-theme[data-cf-template="calm-flow"],
.cf-branding-preview-card[data-cf-template="calm-flow"] {
    --cf-template-card-radius: 20px;
    --cf-template-nav-radius: 16px;
    --cf-template-icon-radius: 999px;
}

.cf-public-page,
.cf-entry-main {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(48px, 12vh, 120px) var(--cf-space-6);
}

.cf-eyebrow,
.cf-menu-label,
.cf-admin-nav p {
    color: var(--cf-color-text-subtle);
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.cf-lead { color: var(--cf-color-text-muted); font-size: 1.0625rem; line-height: 1.65; }

/* Reusable page-intro pattern. */
.cf-page-intro {
    max-width: 720px;
    margin-bottom: var(--cf-space-6);
}
.cf-page-intro .cf-eyebrow { margin-bottom: var(--cf-space-2); }
.cf-page-title { margin-bottom: var(--cf-space-2); }
.cf-page-title:focus { outline: none; }
.cf-page-subtitle,
.cf-page-date {
    color: var(--cf-color-text-muted);
    font-size: .975rem;
    line-height: 1.55;
    margin: 0;
    max-width: 620px;
}
.cf-page-date {
    font-weight: 500;
    text-transform: capitalize;
}

/* Calm Professional landing canvas: wider than reading content, centered in the application viewport. */
.cf-home-stage {
    margin: 0 auto;
    max-width: 920px;
    width: 100%;
}
.cf-home-stage .cf-page-intro {
    margin-bottom: 22px;
    max-width: 720px;
}

.cf-button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    gap: var(--cf-space-2);
    justify-content: center;
    min-height: 44px;
    padding: 9px 16px;
    text-decoration: none;
    font-weight: 700;
    transition: background-color var(--cf-motion-fast) var(--cf-ease-standard), border-color var(--cf-motion-fast) var(--cf-ease-standard), color var(--cf-motion-fast) var(--cf-ease-standard), box-shadow var(--cf-motion-fast) var(--cf-ease-standard), transform var(--cf-motion-fast) var(--cf-ease-standard);
}
.cf-button .material-symbols-rounded { font-size: 19px; }
.cf-button:active { transform: translateY(1px); }
.cf-button-primary {
    background: var(--cf-color-primary);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--cf-color-primary) 20%, transparent);
    color: var(--cf-color-on-primary);
}
.cf-button-primary:hover { background: var(--cf-color-primary-hover); box-shadow: 0 3px 8px color-mix(in srgb, var(--cf-color-primary) 18%, transparent); }
.cf-button-primary:active { background: var(--cf-color-primary-active); }
.cf-button-secondary { background: var(--cf-color-secondary); color: var(--cf-color-on-secondary); }
.cf-button-ghost { background: transparent; border-color: var(--cf-color-border); }
.cf-button-ghost:hover { background: var(--cf-color-surface-muted); border-color: var(--cf-color-border-strong); }
.cf-button-danger { background: var(--cf-color-danger); color: #FFFFFF; }

/* App shell */
.cf-header {
    align-items: center;
    backdrop-filter: blur(14px);
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid color-mix(in srgb, var(--cf-color-border) 90%, transparent);
    display: grid;
    gap: var(--cf-space-4);
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    min-height: 68px;
    padding: 0 clamp(var(--cf-space-4), 2.5vw, var(--cf-space-8));
    position: sticky;
    top: 0;
    z-index: 40;
}

.cf-wordmark {
    color: var(--cf-color-primary);
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1;
    text-decoration: none;
}

.cf-header-divider {
    align-self: stretch;
    background: var(--cf-color-border);
    height: 22px;
    margin: auto 4px;
    width: 1px;
}

.cf-header-actions { align-items: center; display: flex; gap: var(--cf-space-1); justify-self: end; }
.cf-switcher,
.cf-account-menu { position: relative; }

.cf-switcher summary,
.cf-account-menu summary,
.cf-admin-drawer summary {
    align-items: center;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    gap: var(--cf-space-1);
    list-style: none;
    min-height: 44px;
    padding: 0 var(--cf-space-2);
    transition: background-color var(--cf-motion-fast) var(--cf-ease-standard), border-color var(--cf-motion-fast) var(--cf-ease-standard), color var(--cf-motion-fast) var(--cf-ease-standard);
}
.cf-switcher summary:hover,
.cf-account-menu summary:hover { background: var(--cf-color-surface-strong); }
summary::-webkit-details-marker { display: none; }

.cf-switcher-menu {
    background: var(--cf-color-surface);
    border: 1px solid var(--cf-color-border);
    border-radius: var(--cf-radius-lg);
    box-shadow: var(--cf-shadow-2);
    min-width: 280px;
    padding: var(--cf-space-2);
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;
}

.cf-switcher-menu a,
.cf-switcher-menu button {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 10px;
    color: inherit;
    display: flex;
    gap: var(--cf-space-3);
    min-height: 44px;
    padding: 10px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}
.cf-switcher-menu a:hover,
.cf-switcher-menu button:hover { background: var(--cf-color-surface-muted); }
.cf-switcher-menu small { color: var(--cf-color-text-muted); display: block; margin-top: 2px; }
.cf-org-mark {
    align-items: center;
    background: var(--cf-color-primary-soft);
    border-radius: 10px;
    color: var(--cf-color-primary);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}
.cf-switcher-menu .is-current { background: var(--cf-color-primary-subtle); }

.cf-primary-nav,
.cf-desktop-nav {
    align-items: center;
    display: flex;
    gap: 2px;
    justify-content: center;
    min-width: 0;
}

.cf-primary-nav a,
.cf-desktop-nav a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--cf-template-nav-radius, 10px);
    color: var(--cf-color-text-muted);
    display: inline-flex;
    gap: 7px;
    min-height: var(--cf-control-height, 44px);
    padding: 0 12px;
    text-decoration: none;
    transition: background-color var(--cf-motion-fast) var(--cf-ease-standard), border-color var(--cf-motion-fast) var(--cf-ease-standard), color var(--cf-motion-fast) var(--cf-ease-standard);
    white-space: nowrap;
}
.cf-primary-nav a .material-symbols-rounded,
.cf-desktop-nav a .material-symbols-rounded { font-size: 19px; }
.cf-primary-nav a:hover,
.cf-desktop-nav a:hover { background: var(--cf-color-surface-muted); color: var(--cf-color-text); }
.cf-primary-nav a.active,
.cf-desktop-nav a.active {
    background: var(--cf-color-primary-subtle);
    border-color: color-mix(in srgb, var(--cf-color-primary) 10%, var(--cf-color-border));
    color: var(--cf-color-primary);
    font-weight: 700;
}

.cf-main { padding: var(--cf-space-10) clamp(var(--cf-space-4), 3vw, var(--cf-space-8)); }
.cf-participant-main { margin: 0 auto; max-width: 90%; }
.cf-instructor-main { margin: 0 auto; max-width: 90%; }
.cf-admin-main { margin-left: 256px; max-width: 90%; }

/* Compact, reusable empty state. */
.cf-empty-state {
    background: var(--cf-color-surface);
    border: 1px solid color-mix(in srgb, var(--cf-color-border) 88%, transparent);
    border-radius: var(--cf-template-card-radius, var(--cf-radius-lg));
    box-shadow: 0 1px 2px rgba(23, 38, 58, .035);
    margin-inline: auto;
    max-width: 840px;
    padding: 30px var(--cf-space-8) 32px;
    text-align: center;
    width: 100%;
}
.cf-home-stage > .cf-empty-state { max-width: none; }
.cf-empty-state h2 {
    font-size: 1.0625rem;
    line-height: 1.35;
    margin-bottom: 10px;
}
.cf-empty-state p {
    color: var(--cf-color-text-muted);
    font-size: .9375rem;
    line-height: 1.55;
    margin: 0 auto;
    max-width: 500px;
}
.cf-empty-icon-wrap {
    align-items: center;
    background: var(--cf-color-primary-subtle);
    border: 1px solid color-mix(in srgb, var(--cf-color-primary) 8%, var(--cf-color-border));
    border-radius: 11px;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    margin-bottom: 18px;
    width: 38px;
}
.cf-empty-icon { color: var(--cf-color-primary); font-size: 21px; }
.cf-empty-action { margin-top: 18px; }
.cf-home-primary-action { min-height: 42px; padding: 8px 14px; font-size: .9375rem; }
.cf-alert { border-radius: var(--cf-radius-sm); padding: var(--cf-space-3); }
.cf-alert-info { background: #E7F0FB; }
.cf-skeleton { animation: cf-pulse 1.5s ease-in-out infinite; background: linear-gradient(90deg,#edf1f5,#f7f9fb,#edf1f5); border-radius: var(--cf-radius-sm); }
.cf-toast { background: var(--cf-color-text); border-radius: var(--cf-radius-sm); bottom: auto; color: #FFFFFF; max-width: min(360px, calc(100vw - 48px)); padding: var(--cf-space-3); position: fixed; right: 24px; top: calc(68px + var(--cf-space-4)); z-index: 60; }
.cf-toast-error { background: var(--cf-color-danger); }

.cf-role-grid { display: grid; gap: var(--cf-space-4); grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); margin-top: var(--cf-space-8); }
.cf-role-card { background: var(--cf-color-surface); border: 1px solid var(--cf-color-border); border-radius: var(--cf-radius-lg); display: grid; gap: var(--cf-space-2); min-height: 190px; padding: var(--cf-space-6); text-decoration: none; }
.cf-role-card:hover { border-color: var(--cf-color-primary); box-shadow: var(--cf-shadow-1); }
.cf-role-card .material-symbols-rounded:first-child { color: var(--cf-color-primary); font-size: 32px; }
.cf-role-card .material-symbols-rounded:last-child { justify-self: end; }

.cf-admin-sidebar { background: #102A43; color: #EAF2F8; bottom: 0; left: 0; overflow-y: auto; padding: var(--cf-space-6) var(--cf-space-3); position: fixed; top: 68px; width: 256px; }
.cf-admin-sidebar .cf-wordmark { color: #FFFFFF; }
.cf-sidebar-tenant { color: #B7C7D6; font-size: .9rem; margin: var(--cf-space-2) 0 var(--cf-space-6); overflow: hidden; text-overflow: ellipsis; }
.cf-admin-nav { display: grid; gap: 2px; }
.cf-admin-nav a { align-items: center; border-radius: var(--cf-radius-sm); display: flex; gap: var(--cf-space-2); min-height: var(--cf-control-height, 44px); padding: 0 var(--cf-space-2); text-decoration: none; }
.cf-admin-nav a.active,
.cf-admin-nav a:hover { background: rgba(255,255,255,.14); }
.cf-admin-nav p { color: #AFC3D5; margin: var(--cf-space-4) var(--cf-space-2) var(--cf-space-1); }
.cf-admin-nav > p:first-child { margin-top: 0; }
.cf-admin-drawer { display: none; }

.cf-bottom-nav {
    backdrop-filter: blur(14px);
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--cf-color-border);
    bottom: 0;
    box-shadow: 0 -4px 16px rgba(23,38,58,.04);
    display: none;
    justify-content: space-around;
    left: 0;
    padding: var(--cf-space-1) var(--cf-space-2) calc(var(--cf-space-1) + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 40;
}
.cf-bottom-nav a {
    align-items: center;
    color: var(--cf-color-text-muted);
    display: flex;
    flex: 1;
    flex-direction: column;
    font-size: .72rem;
    gap: 2px;
    justify-content: center;
    min-height: 56px;
    text-decoration: none;
}
.cf-bottom-nav a > * { pointer-events: none; }
.cf-bottom-nav a .material-symbols-rounded {
    align-items: center;
    border-radius: 10px;
    display: inline-flex;
    font-size: 21px;
    height: 28px;
    justify-content: center;
    transition: background-color var(--cf-motion-fast) var(--cf-ease-standard), color var(--cf-motion-fast) var(--cf-ease-standard);
    width: 36px;
}
.cf-bottom-nav a.active { color: var(--cf-color-primary); font-weight: 700; }
.cf-bottom-nav a.active .material-symbols-rounded { background: var(--cf-color-primary-subtle); }

#blazor-error-ui { background: #FFF4E5; bottom: 0; display: none; left: 0; padding: 12px 16px; position: fixed; right: 0; z-index: 100; }

@keyframes cf-pulse { 50% { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Tablet: identity/actions on the first row, primary navigation on the second row. */
@media (min-width: 640px) and (max-width: 959.98px) {
    .cf-header {
        gap: 0 var(--cf-space-4);
        grid-template-columns: minmax(0,1fr) auto;
        min-height: 104px;
        padding: 0 var(--cf-space-6);
    }
    .cf-header-identity,
    .cf-header-actions { min-height: 56px; }
    .cf-primary-nav,
    .cf-desktop-nav {
        border-top: 1px solid var(--cf-color-border);
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin: 0 calc(var(--cf-space-6) * -1);
        min-height: 48px;
        overflow-x: auto;
        padding: 0 var(--cf-space-6);
        scrollbar-width: none;
    }
    .cf-primary-nav::-webkit-scrollbar,
    .cf-desktop-nav::-webkit-scrollbar { display: none; }
    .cf-primary-nav a,
    .cf-desktop-nav a { min-height: var(--cf-control-height, 44px); }
    .cf-admin-sidebar { top: 104px; }
    .cf-toast { top: calc(104px + var(--cf-space-4)); }
    .cf-main { padding: var(--cf-space-8) var(--cf-space-6); }
}

/* Mobile: compact top bar + fixed bottom navigation. */
@media (max-width: 639.98px) {
    .cf-header {
        display: flex;
        gap: var(--cf-space-2);
        justify-content: space-between;
        min-height: 58px;
        padding: 0 var(--cf-space-4);
    }
    .cf-header-divider { height: 20px; margin-left: 0; margin-right: 0; }
    .cf-primary-nav,
    .cf-desktop-nav { display: none; }
    .cf-bottom-nav { display: flex; }
    .cf-main { padding: var(--cf-space-6) var(--cf-space-4) calc(88px + env(safe-area-inset-bottom)); }
    .cf-page-intro { margin-bottom: var(--cf-space-5); }
    .cf-page-subtitle,
    .cf-page-date { font-size: .925rem; }
    .cf-home-stage .cf-page-intro { margin-bottom: var(--cf-space-5); }
    .cf-empty-state { padding: var(--cf-space-6) var(--cf-space-4); }
    .cf-admin-sidebar { display: none; }
    .cf-admin-drawer { background: var(--cf-color-surface); border-bottom: 1px solid var(--cf-color-border); display: block; }
    .cf-admin-drawer summary { padding: 0 var(--cf-space-4); }
    .cf-admin-drawer .cf-admin-nav { background: var(--cf-color-surface); padding: var(--cf-space-2) var(--cf-space-4) var(--cf-space-4); }
    .cf-admin-drawer .cf-admin-nav p { color: var(--cf-color-text-muted); }
    .cf-admin-main { margin-left: 0; }
    .cf-toast { bottom: auto; left: auto; max-width: calc(100vw - var(--cf-space-8)); right: var(--cf-space-4); top: calc(58px + var(--cf-space-3) + env(safe-area-inset-top)); }
}

/* ==========================================================================
   CF-UI-01 — Calm Professional 2.0 prototype foundation
   Approved design-system prototype. Brand tokens remain tenant-controlled by
   TenantTheme/BrandTheme; these additions define ClassFlow-owned semantics.
   ========================================================================== */
:root {
    --cf-color-success-text: #0B6B43;
    --cf-color-success-surface: #EAF8F1;
    --cf-color-success-border: #B8E1CA;
    --cf-color-warning-text: #8A4B00;
    --cf-color-warning-surface: #FFF6E8;
    --cf-color-warning-border: #F1D39B;
    --cf-color-danger-text: #A61B1B;
    --cf-color-danger-surface: #FFF1F1;
    --cf-color-danger-border: #F0C2C2;
    --cf-color-info-text: #0B5CAD;
    --cf-color-info-surface: #EDF5FF;
    --cf-color-info-border: #C9DDF7;

    --cf-font-caption: .75rem;
    --cf-font-label: .8125rem;
    --cf-font-body-sm: .875rem;
    --cf-font-body: 1rem;
    --cf-font-title-sm: 1.125rem;
    --cf-font-title: 1.25rem;
    --cf-font-kpi: 1.875rem;

    --cf-control-height: 44px;
    --cf-shadow-float: 0 18px 48px rgba(23, 38, 58, .16);
}

.cf-page-intro {
    max-width: var(--cf-content-reading);
}

.cf-page-title {
    text-wrap: balance;
}

.cf-page-subtitle,
.cf-page-date {
    text-wrap: pretty;
}

.cf-button {
    min-height: var(--cf-control-height);
}

.cf-button-secondary {
    background: var(--cf-color-surface);
    border-color: color-mix(in srgb, var(--cf-color-secondary) 35%, var(--cf-color-border));
    color: var(--cf-color-secondary);
}

.cf-button-secondary:hover {
    background: var(--cf-color-secondary-soft);
    border-color: color-mix(in srgb, var(--cf-color-secondary) 52%, var(--cf-color-border));
}

.cf-alert-info {
    background: var(--cf-color-info-surface);
    border: 1px solid var(--cf-color-info-border);
    color: var(--cf-color-info-text);
}

.cf-toast {
    border: 1px solid color-mix(in srgb, #FFFFFF 14%, transparent);
    box-shadow: var(--cf-shadow-2);
}

.cf-toast-success {
    background: var(--cf-color-success-text);
    color: #FFFFFF;
}

.cf-toast-error {
    background: var(--cf-color-danger);
    color: #FFFFFF;
}

.cf-admin-sidebar {
    border-right: 1px solid rgba(255,255,255,.08);
}

.cf-admin-nav a {
    position: relative;
}

.cf-admin-nav a.active {
    background: rgba(255,255,255,.16);
    color: #FFFFFF;
}

.cf-admin-nav a.active::before {
    background: #FFFFFF;
    border-radius: 0 3px 3px 0;
    content: "";
    height: 22px;
    left: calc(var(--cf-space-3) * -1);
    position: absolute;
    width: 3px;
}

/* Admin switches from fixed sidebar to drawer before the workspace becomes cramped. */
@media (max-width: 1023.98px) {
    .cf-admin-sidebar {
        display: none;
    }

    .cf-admin-drawer {
        background: var(--cf-color-surface);
        border-bottom: 1px solid var(--cf-color-border);
        display: block;
    }

    .cf-admin-drawer summary {
        min-height: 48px;
        padding: 0 var(--cf-space-6);
    }

    .cf-admin-drawer .cf-admin-nav {
        background: var(--cf-color-surface);
        border-top: 1px solid var(--cf-color-border);
        padding: var(--cf-space-2) var(--cf-space-6) var(--cf-space-4);
    }

    .cf-admin-drawer .cf-admin-nav a {
        color: var(--cf-color-text);
    }

    .cf-admin-drawer .cf-admin-nav a.active,
    .cf-admin-drawer .cf-admin-nav a:hover {
        background: var(--cf-color-primary-subtle);
        color: var(--cf-color-primary);
    }

    .cf-admin-drawer .cf-admin-nav a.active::before {
        display: none;
    }

    .cf-admin-drawer .cf-admin-nav p {
        color: var(--cf-color-text-subtle);
    }

    .cf-admin-main {
        margin-left: 0;
        max-width: none;
    }
}

@media (max-width: 639.98px) {
    .cf-admin-drawer summary {
        padding: 0 var(--cf-space-4);
    }

    .cf-admin-drawer .cf-admin-nav {
        padding-left: var(--cf-space-4);
        padding-right: var(--cf-space-4);
    }

    .cf-admin-main {
        padding-bottom: var(--cf-space-6);
    }
}


/* CF-PATH-01C EXEC-1B — role-scoped, six-destination mobile navigation. */
@media (max-width: 639.98px) {
    .cf-instructor-shell .cf-bottom-nav,
    .cf-participant-shell .cf-bottom-nav { justify-content: space-between; }
    .cf-instructor-shell .cf-bottom-nav > a,
    .cf-participant-shell .cf-bottom-nav > a,
    .cf-instructor-shell .cf-bottom-nav > .cf-bottom-more,
    .cf-participant-shell .cf-bottom-nav > .cf-bottom-more {
        flex: 1 1 0;
        min-width: 0;
    }
    .cf-instructor-shell .cf-bottom-nav > a,
    .cf-participant-shell .cf-bottom-nav > a { overflow: hidden; font-size: .68rem; }
    .cf-bottom-more { position: relative; }
    .cf-bottom-more-trigger {
        align-items: center;
        background: transparent;
        border: 0;
        color: var(--cf-color-text-muted);
        cursor: pointer;
        display: flex;
        flex-direction: column;
        font: inherit;
        font-size: .68rem;
        gap: 2px;
        justify-content: center;
        min-height: 56px;
        padding: 0;
        width: 100%;
    }
    .cf-bottom-more-trigger .material-symbols-rounded {
        align-items: center;
        border-radius: 10px;
        display: inline-flex;
        font-size: 21px;
        height: 28px;
        justify-content: center;
        width: 36px;
    }
    .cf-bottom-more-trigger.active { color: var(--cf-color-primary); font-weight: 700; }
    .cf-bottom-more-trigger.active .material-symbols-rounded { background: var(--cf-color-primary-subtle); }
    .cf-bottom-more-trigger:focus-visible,
    .cf-bottom-more-panel a:focus-visible { outline: 3px solid var(--cf-color-primary); outline-offset: 2px; }
    .cf-bottom-more-panel {
        background: var(--cf-color-surface);
        border: 1px solid var(--cf-color-border);
        border-radius: var(--cf-radius-md);
        bottom: calc(68px + env(safe-area-inset-bottom));
        box-shadow: 0 8px 32px rgba(12,31,52,.18);
        display: grid;
        gap: 2px;
        max-height: calc(100dvh - 154px - env(safe-area-inset-bottom));
        overflow-y: auto;
        padding: var(--cf-space-2);
        position: fixed;
        right: var(--cf-space-3);
        width: min(260px, calc(100vw - 24px));
        z-index: 41;
    }
    .cf-bottom-more-panel a {
        align-items: center;
        border-radius: var(--cf-radius-sm);
        color: var(--cf-color-text);
        display: flex;
        gap: var(--cf-space-3);
        min-height: 44px;
        padding: 0 var(--cf-space-3);
        text-decoration: none;
    }
    .cf-bottom-more-panel a.active,
    .cf-bottom-more-panel a:hover { background: var(--cf-color-primary-subtle); color: var(--cf-color-primary); }
    .cf-bottom-more-panel a .material-symbols-rounded { font-size: 20px; }
}

/* CF-NAV-01 — responsive role sidebar navigation. */
.cf-role-nav-trigger { align-items: center; display: flex; justify-content: center; left: calc(246px - var(--cf-control-height, 44px) - var(--cf-space-2)); position: fixed; top: calc(68px + var(--cf-space-2)); z-index: 46; }
.cf-role-nav-toggle { align-items: center; background: var(--cf-color-surface-muted); border: 1px solid var(--cf-color-border); border-radius: 10px; color: var(--cf-color-text); cursor: pointer; display: inline-flex; height: var(--cf-control-height, 44px); justify-content: center; padding: 0; width: var(--cf-control-height, 44px); }
.cf-role-nav-toggle:hover, .cf-role-nav-toggle:focus-visible { background: var(--cf-color-surface-strong); border-color: var(--cf-color-focus); outline: 2px solid transparent; }
.cf-role-nav-toggle-medium, .cf-role-nav-toggle-mobile { display: none; }
.cf-role-sidebar { background: var(--cf-color-secondary); bottom: 0; color: var(--cf-color-on-secondary); left: 0; overflow-x: hidden; overflow-y: auto; padding: calc(var(--cf-space-6) + var(--cf-control-height, 44px) + var(--cf-space-2)) var(--cf-space-3) var(--cf-space-6); position: fixed; top: 68px; transition: transform var(--cf-motion-fast) var(--cf-ease-standard), width var(--cf-motion-fast) var(--cf-ease-standard); width: 246px; z-index: 45; }
.cf-role-sidebar-nav { display: grid; gap: 2px; }
.cf-role-sidebar-nav p { color: #AFC3D5; font-size: .75rem; font-weight: 750; letter-spacing: .09em; margin: var(--cf-space-4) var(--cf-space-2) var(--cf-space-1); text-transform: uppercase; }
.cf-role-sidebar-nav p:first-child { margin-top: 0; }
.cf-role-sidebar-nav a { align-items: center; border-radius: var(--cf-radius-sm); color: inherit; display: flex; gap: var(--cf-space-2); min-height: var(--cf-control-height, 44px); padding: 0 var(--cf-space-2); position: relative; text-decoration: none; }
.cf-role-sidebar-nav a.active, .cf-role-sidebar-nav a:hover { background: rgba(255,255,255,.16); color: #FFFFFF; }
.cf-role-sidebar-nav a.active::before { background: #FFFFFF; border-radius: 0 3px 3px 0; content: ""; height: 22px; left: calc(var(--cf-space-3) * -1); position: absolute; width: 3px; }
.cf-instructor-main, .cf-participant-main { margin-left: calc(246px + var(--cf-space-4)); max-width: calc(100% - 270px); }
.cf-role-sidebar-backdrop { display: none; }

@media (min-width: 1101px) {
    .cf-role-sidebar-tenantadmin,
    .cf-role-sidebar-platform {
        display: none;
    }

    .cf-role-sidebar.is-wide-collapsed { padding-left: var(--cf-space-2); padding-right: var(--cf-space-2); width: 72px; }
    .cf-role-sidebar.is-wide-collapsed .cf-role-sidebar-nav p, .cf-role-sidebar.is-wide-collapsed .cf-role-nav-label, .cf-role-sidebar.is-wide-collapsed .cf-chat-unread-badge { display: none; }
    .cf-role-sidebar.is-wide-collapsed .cf-role-sidebar-nav a { justify-content: center; padding: 0; }
    .cf-role-sidebar.is-wide-collapsed .cf-role-sidebar-nav a.active::before { left: calc(var(--cf-space-2) * -1); }
    body:has(.cf-role-sidebar.is-wide-collapsed) .cf-role-nav-trigger { left: var(--cf-space-2); }
    body:has(.cf-role-sidebar.is-wide-collapsed) .cf-instructor-main, body:has(.cf-role-sidebar.is-wide-collapsed) .cf-participant-main { margin-left: calc(72px + var(--cf-space-4)); max-width: calc(100% - 96px); }
    body:has(.cf-role-sidebar-tenantadmin.is-wide-collapsed) .cf-admin-sidebar,
    body:has(.cf-role-sidebar-platform.is-wide-collapsed) .cf-admin-sidebar { padding-left: var(--cf-space-2); padding-right: var(--cf-space-2); width: 72px; }
    body:has(.cf-role-sidebar-tenantadmin.is-wide-collapsed) .cf-admin-sidebar .cf-admin-nav p,
    body:has(.cf-role-sidebar-tenantadmin.is-wide-collapsed) .cf-admin-sidebar .cf-admin-nav-label,
    body:has(.cf-role-sidebar-platform.is-wide-collapsed) .cf-admin-sidebar .cf-admin-nav p,
    body:has(.cf-role-sidebar-platform.is-wide-collapsed) .cf-admin-sidebar .cf-admin-nav-label { display: none; }
    body:has(.cf-role-sidebar-tenantadmin.is-wide-collapsed) .cf-admin-sidebar .cf-admin-nav a,
    body:has(.cf-role-sidebar-platform.is-wide-collapsed) .cf-admin-sidebar .cf-admin-nav a { justify-content: center; padding: 0; }
    body:has(.cf-role-sidebar-tenantadmin.is-wide-collapsed) .cf-admin-main,
    body:has(.cf-role-sidebar-platform.is-wide-collapsed) .cf-admin-main { margin-left: calc(72px + var(--cf-space-4)); max-width: calc(100% - 96px); }
}

@media (min-width: 740px) and (max-width: 1100px) {
    .cf-role-sidebar-tenantadmin,
    .cf-role-sidebar-platform {
        display: none;
    }

    .cf-role-nav-toggle-wide { display: none; }
    .cf-role-nav-toggle-medium { display: inline-flex; }
    .cf-role-nav-trigger { left: var(--cf-space-2); }
    .cf-role-sidebar { padding-left: var(--cf-space-2); padding-right: var(--cf-space-2); width: 72px; }
    .cf-role-sidebar .cf-role-sidebar-nav p, .cf-role-sidebar .cf-role-nav-label, .cf-role-sidebar .cf-chat-unread-badge { display: none; }
    .cf-role-sidebar .cf-role-sidebar-nav a { justify-content: center; padding: 0; }
    .cf-role-sidebar .cf-role-sidebar-nav a.active::before { left: calc(var(--cf-space-2) * -1); }
    .cf-role-sidebar.is-medium-expanded { padding-left: var(--cf-space-3); padding-right: var(--cf-space-3); width: 246px; }
    .cf-role-sidebar.is-medium-expanded .cf-role-sidebar-nav p, .cf-role-sidebar.is-medium-expanded .cf-role-nav-label, .cf-role-sidebar.is-medium-expanded .cf-chat-unread-badge { display: initial; }
    .cf-role-sidebar.is-medium-expanded .cf-role-sidebar-nav p { display: block; }
    .cf-role-sidebar.is-medium-expanded .cf-role-sidebar-nav a { justify-content: flex-start; padding: 0 var(--cf-space-2); }
    .cf-role-sidebar.is-medium-expanded .cf-role-sidebar-nav a.active::before { left: calc(var(--cf-space-3) * -1); }
    body:has(.cf-role-sidebar.is-medium-expanded) .cf-role-nav-trigger { left: calc(246px - var(--cf-control-height, 44px) - var(--cf-space-2)); }
    body:has(.cf-role-sidebar.is-medium-expanded) .cf-instructor-main, body:has(.cf-role-sidebar.is-medium-expanded) .cf-participant-main { margin-left: calc(246px + var(--cf-space-4)); max-width: calc(100% - 270px); }
    body:has(.cf-role-sidebar-tenantadmin.is-medium-expanded) .cf-admin-sidebar,
    body:has(.cf-role-sidebar-platform.is-medium-expanded) .cf-admin-sidebar { padding-left: var(--cf-space-3); padding-right: var(--cf-space-3); width: 246px; }
    body:has(.cf-role-sidebar-tenantadmin.is-medium-expanded) .cf-admin-sidebar .cf-admin-nav p,
    body:has(.cf-role-sidebar-tenantadmin.is-medium-expanded) .cf-admin-sidebar .cf-admin-nav-label,
    body:has(.cf-role-sidebar-platform.is-medium-expanded) .cf-admin-sidebar .cf-admin-nav p,
    body:has(.cf-role-sidebar-platform.is-medium-expanded) .cf-admin-sidebar .cf-admin-nav-label { display: initial; }
    body:has(.cf-role-sidebar-tenantadmin.is-medium-expanded) .cf-admin-sidebar .cf-admin-nav p,
    body:has(.cf-role-sidebar-platform.is-medium-expanded) .cf-admin-sidebar .cf-admin-nav p { display: block; }
    body:has(.cf-role-sidebar-tenantadmin.is-medium-expanded) .cf-admin-sidebar .cf-admin-nav a,
    body:has(.cf-role-sidebar-platform.is-medium-expanded) .cf-admin-sidebar .cf-admin-nav a { justify-content: flex-start; padding: 0 var(--cf-space-2); }
    body:has(.cf-role-sidebar-tenantadmin.is-medium-expanded) .cf-admin-main,
    body:has(.cf-role-sidebar-platform.is-medium-expanded) .cf-admin-main { margin-left: calc(246px + var(--cf-space-4)); max-width: calc(100% - 270px); }
    .cf-instructor-main, .cf-participant-main { margin-left: calc(72px + var(--cf-space-4)); max-width: calc(100% - 96px); }
    .cf-admin-shell .cf-admin-sidebar { display: block; padding-left: var(--cf-space-2); padding-right: var(--cf-space-2); top: 68px; width: 72px; }
    .cf-admin-shell .cf-admin-drawer { display: none; }
    .cf-admin-shell .cf-admin-sidebar .cf-admin-nav p, .cf-admin-shell .cf-admin-sidebar .cf-admin-nav-label, .cf-admin-shell .cf-admin-sidebar .cf-chat-unread-badge { display: none; }
    .cf-admin-shell .cf-admin-sidebar .cf-admin-nav a { justify-content: center; padding: 0; }
    .cf-admin-shell .cf-admin-sidebar .cf-admin-nav a.active::before { left: calc(var(--cf-space-2) * -1); }
    .cf-admin-shell .cf-admin-main { margin-left: calc(72px + var(--cf-space-4)); max-width: calc(100% - 96px); }
}

@media (max-width: 739.98px) {
    .cf-role-nav-toggle-wide, .cf-role-nav-toggle-medium { display: none; }
    .cf-role-nav-toggle-mobile { display: inline-flex; }
    .cf-role-nav-trigger { left: auto; right: calc(2 * var(--cf-control-height, 44px) + var(--cf-space-5)); top: var(--cf-space-2); z-index: 46; }
    .cf-instructor-shell .cf-header-identity, .cf-participant-shell .cf-header-identity { max-width: calc(100% - 200px); }
    .cf-role-sidebar { bottom: calc(72px + env(safe-area-inset-bottom)); box-shadow: var(--cf-shadow-float); max-width: min(290px, calc(100vw - var(--cf-space-6))); padding-top: var(--cf-space-6); top: 0; transform: translateX(-105%); width: 290px; z-index: 65; }
    .cf-role-sidebar.is-mobile-open { transform: translateX(0); }
    .cf-role-sidebar-backdrop { background: rgba(15,37,59,.48); border: 0; bottom: calc(72px + env(safe-area-inset-bottom)); cursor: pointer; display: block; left: 0; padding: 0; position: fixed; right: 0; top: 0; z-index: 60; }
    body:has(.cf-role-sidebar.is-mobile-open) { overflow: hidden; }
    .cf-instructor-main, .cf-participant-main { margin-left: auto; max-width: 90%; }
    body:has(.cf-role-sidebar-tenantadmin) .cf-admin-drawer,
    body:has(.cf-role-sidebar-platform) .cf-admin-drawer { display: none; }
}

/* Existing Admin/Platform navigation remains the source of their links. */
@media (min-width: 1101px) {
    .cf-admin-shell .cf-admin-sidebar { top: 68px; }
}

/* CF-NAV-01-R2 — Instructor/Participant match the accepted Admin sidebar. */
.cf-role-sidebar-with-footer {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.cf-role-sidebar-with-footer .cf-role-sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--cf-space-6) var(--cf-space-3);
}

.cf-role-sidebar-footer {
    align-items: center;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    padding: var(--cf-space-2);
}

.cf-instructor-shell .cf-role-sidebar-with-footer,
.cf-participant-shell .cf-role-sidebar-with-footer {
    background: #102A43;
    color: #EAF2F8;
}

.cf-instructor-shell .cf-role-sidebar-with-footer .cf-role-sidebar-nav p,
.cf-participant-shell .cf-role-sidebar-with-footer .cf-role-sidebar-nav p {
    color: #AFC3D5;
}

.cf-instructor-shell .cf-role-sidebar-with-footer .cf-role-sidebar-nav a.active,
.cf-instructor-shell .cf-role-sidebar-with-footer .cf-role-sidebar-nav a:hover,
.cf-participant-shell .cf-role-sidebar-with-footer .cf-role-sidebar-nav a.active,
.cf-participant-shell .cf-role-sidebar-with-footer .cf-role-sidebar-nav a:hover {
    background: rgba(255,255,255,.14);
    color: #FFFFFF;
}

.cf-instructor-shell .cf-role-sidebar-with-footer .cf-role-nav-toggle,
.cf-participant-shell .cf-role-sidebar-with-footer .cf-role-nav-toggle {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #EAF2F8;
}

.cf-instructor-shell .cf-role-sidebar-with-footer .cf-role-nav-toggle .material-symbols-rounded,
.cf-participant-shell .cf-role-sidebar-with-footer .cf-role-nav-toggle .material-symbols-rounded {
    font-size: 20px;
}

.cf-instructor-shell .cf-role-sidebar-with-footer .cf-role-nav-toggle:hover,
.cf-participant-shell .cf-role-sidebar-with-footer .cf-role-nav-toggle:hover {
    background: rgba(255,255,255,.14);
}

.cf-instructor-shell .cf-role-sidebar-with-footer .cf-role-nav-toggle:focus-visible,
.cf-participant-shell .cf-role-sidebar-with-footer .cf-role-nav-toggle:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
}

@media (min-width: 1101px) {
    body:has(.cf-role-sidebar-with-footer) .cf-role-nav-trigger {
        display: none;
    }

    .cf-role-sidebar-with-footer.is-wide-collapsed .cf-role-sidebar-nav {
        padding-left: var(--cf-space-2);
        padding-right: var(--cf-space-2);
    }

    .cf-role-sidebar-with-footer.is-wide-collapsed .cf-role-sidebar-footer {
        justify-content: center;
    }
}

@media (min-width: 740px) and (max-width: 1100px) {
    body:has(.cf-role-sidebar-with-footer) .cf-role-nav-trigger {
        display: none;
    }

    .cf-role-sidebar-with-footer .cf-role-sidebar-nav {
        padding-left: var(--cf-space-2);
        padding-right: var(--cf-space-2);
    }

    .cf-role-sidebar-with-footer .cf-role-sidebar-footer {
        justify-content: center;
    }

    .cf-role-sidebar-with-footer.is-medium-expanded .cf-role-sidebar-nav {
        padding-left: var(--cf-space-3);
        padding-right: var(--cf-space-3);
    }

    .cf-role-sidebar-with-footer.is-medium-expanded .cf-role-sidebar-footer {
        justify-content: flex-end;
    }
}

@media (max-width: 739.98px) {
    .cf-role-sidebar-with-footer .cf-role-sidebar-footer {
        display: none;
    }

    .cf-role-sidebar-with-footer .cf-role-sidebar-nav {
        padding: var(--cf-space-6) var(--cf-space-3);
    }
}
