/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #1a1a1a;
    background: #f3f4f6;
    overflow: hidden;
}

/* ===== CSS VARIABLES ===== */
:root {
    --teal: #14b8a6;
    --teal-dark: #0f766e;
    --teal-light: #5eead4;
    --orange: #ea580c;
    --green: #10b981;
    --green-dark: #059669;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --red: #ef4444;
    --yellow: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Layout dimensions */
    --global-nav-height: 48px;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 60px;
    --context-sidebar-width: 320px;
}

/* ===== APP CONTAINER ===== */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ============================================================
   GLOBAL NAVIGATION (Top Bar) — Sprint 3 restyle
   Authority: Sprint 3 brief §3.1, Decision Document v1.2 §4.1, §4.2, §4.4.
   ============================================================ */
.global-nav {
    background: var(--cf-surface-card);
    border-bottom: 1px solid var(--cf-border-subtle);
    height: var(--global-nav-height);
    flex-shrink: 0;
}

.global-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 100%;
}

.global-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Brand — logomark + wordmark.
   Logomark: sharp 28px square, --cf-teal fill, white "CF" in display type.
   Wordmark: --cf-ink, body font, normal weight, sentence case. */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding-right: 16px;
    border-right: 1px solid var(--cf-border-subtle);
    color: var(--cf-ink);
}

.brand-icon {
    width: 28px;
    height: 28px;
    background: var(--cf-teal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    /* Display type per brief §3.1 — Bebas Neue (hero face). */
    font-family: var(--cf-display-face);
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 0.02em;
    line-height: 1;
    border-radius: 0;
    flex-shrink: 0;
}

.brand-wordmark {
    font-family: var(--font-family-primary);
    font-size: 16px;
    font-weight: 500;
    color: var(--cf-ink);
    line-height: 1;
}

/* Portal Switcher Pills.
   Each pill carries a data-portal code (ATHLETE/COACH/SYSTEM/BUSINESS_OPS/
   CONTENT/DEVELOPER). Active state is portal-specific via the
   data-portal attribute selectors below.

   Sprint 3 OPEN ITEM (logged in implementation report): only four
   portal-colour tokens are defined in design-tokens.css per Decision §4.2
   (athlete/coach/business/system). CONTENT and DEVELOPER pills fall back
   to --cf-ink for active state until tokens are added in a later sprint. */
.fe-nav-icons {
    display: flex;
    align-items: center;
    gap: 2px;
}

.fe-nav-btn {
    min-width: 28px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    cursor: pointer;
    color: var(--cf-text-mute);
    font-family: var(--font-family-primary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
    transition: color 120ms ease, border-color 120ms ease;
}

.fe-nav-btn:hover:not(.active) {
    color: var(--cf-ink);
}

/* Active pill — colour + underline drive identity. No fill. */
.fe-nav-btn.active {
    color: var(--cf-ink);
    border-bottom-color: var(--cf-ink);
}

.fe-nav-btn[data-portal="ATHLETE"].active {
    color: var(--cf-portal-athlete);
    border-bottom-color: var(--cf-portal-athlete);
}

.fe-nav-btn[data-portal="COACH"].active {
    color: var(--cf-portal-coach);
    border-bottom-color: var(--cf-portal-coach);
}

.fe-nav-btn[data-portal="SYSTEM"].active {
    color: var(--cf-portal-system);
    border-bottom-color: var(--cf-portal-system);
}

.fe-nav-btn[data-portal="BUSINESS_OPS"].active {
    color: var(--cf-portal-business);
    border-bottom-color: var(--cf-portal-business);
}

.fe-nav-btn[data-portal="CONTENT"].active {
    color: var(--cf-portal-content);
    border-bottom-color: var(--cf-portal-content);
}

.fe-nav-btn[data-portal="DEVELOPER"].active {
    color: var(--cf-portal-developer);
    border-bottom-color: var(--cf-portal-developer);
}

.fe-nav-btn:focus-visible {
    outline: 2px solid var(--cf-teal);
    outline-offset: -2px;
}

.global-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search Box — 0.5px subtle border, sharp corners, body text. */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--cf-border-subtle);
    border-radius: 0;
    width: 280px;
    transition: border-color 120ms ease;
}

.search-box:focus-within {
    border-color: var(--cf-ink);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-family: var(--font-family-primary);
    font-size: 13px;
    line-height: 1.4;
    flex: 1;
    color: var(--cf-ink);
}

.search-box input::placeholder {
    color: var(--cf-text-mute);
}

.global-search-icon {
    color: var(--cf-text-mute);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* Alert Bell — Phosphor ph-bell line icon. */
.alert-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
    color: var(--cf-text-mute);
    font-size: 18px;
    position: relative;
    transition: color 120ms ease;
}

.alert-btn:hover { color: var(--cf-ink); }
.alert-btn:focus-visible {
    outline: 2px solid var(--cf-teal);
    outline-offset: -2px;
}

/* Notification dot — small filled circle in --cf-status-warning when
   unread. CIRCLE EXCEPTION: this is the second documented circle in the
   Visual Design Overhaul (the first is the focal-point dot from Sprint 2).
   Per brief §3.1: circle is the legitimate visual primitive for an
   unread-state indicator on a bell icon — a square would read as a
   numeric badge instead of a presence indicator. */
.alert-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--cf-status-warning);
    border-radius: 50%;
    /* Hidden by default; JS toggles visibility when there are unread alerts. */
    display: none;
}

.alert-badge.has-unread { display: block; }

/* Menu Notification Badge */
.menu-notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    background: var(--red);
    color: white;
    border-radius: 0;
    line-height: 1;
}

/* ============================================================
   MAIN LAYOUT (Three Columns)
   ============================================================ */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================================
   LEFT COLUMN: PORTAL NAVIGATION
   ============================================================ */
.portal-nav {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.portal-nav.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header — Sprint 3 restyle */
.portal-nav-header {
    padding: 0 12px;
    border-bottom: 1px solid var(--cf-border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 49px;
}

.portal-nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-700);
    letter-spacing: 0.5px;
}

.portal-nav.collapsed .portal-nav-title {
    display: none;
}

.sidebar-controls {
    display: flex;
    gap: 4px;
}

.sidebar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    color: var(--gray-500);
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-btn:hover {
    color: var(--teal);
}

/* Expand button (triangle) - only visible when collapsed */
.expand-btn {
    color: var(--teal);
}

.portal-nav .expand-btn {
    display: none;
}

.portal-nav.collapsed .expand-btn {
    display: flex;
}

/* Pin button - only visible when expanded */
.pin-btn {
    display: flex;
}

.portal-nav.collapsed .pin-btn {
    display: none;
}

.pin-btn.pinned {
    background: var(--teal);
    color: white;
}

.pin-btn.pinned:hover {
    background: var(--teal-dark);
}

/* Center controls when collapsed */
.portal-nav.collapsed .sidebar-controls {
    width: 100%;
    justify-content: center;
}

.portal-nav.collapsed .portal-nav-header {
    justify-content: center;
}

/* Navigation Menu */
.portal-nav-menu {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    position: relative;
}

.portal-section {
    margin-bottom: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Menu Item (Parent) — Sprint 3 restyle.
   Sub-nav rows. Inactive: ink-mute. Active: ink semibold + 2px portal-coloured
   left border (set per portal section via .portal-section[data-portal] below).
   The teal background fill of the previous active state is removed —
   colour-on-fill is too heavy for chrome and conflicted with the eyebrow
   pattern carrying section context. */
.menu-item {
    margin-bottom: 0;
}

.menu-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--cf-ink-mute);
    text-decoration: none;
    cursor: pointer;
    border-left: 2px solid transparent;
    border-radius: 0;
    transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
    font-family: var(--font-family-primary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.menu-item-header:hover:not(.active) {
    color: var(--cf-ink);
    background: var(--cf-surface-page);
}

.menu-item-header.active {
    color: var(--cf-ink);
    font-weight: 600;
    background: var(--cf-surface-page);
    /* Portal-coloured left accent set per section below. */
    border-left-color: var(--cf-ink);
}

.menu-icon {
    font-size: 16px;
    min-width: 18px;
    color: inherit;
    text-align: center;
    line-height: 1;
}

.menu-label {
    flex: 1;
}

.portal-nav.collapsed .menu-label,
.portal-nav.collapsed .menu-expand-icon {
    display: none;
}

.menu-expand-icon {
    font-size: 10px;
    color: var(--cf-text-mute);
    transition: transform 200ms ease;
    line-height: 1;
}

.menu-item.expanded .menu-expand-icon {
    transform: rotate(90deg);
}

/* Sub-Menu */
.sub-menu {
    display: none;
    padding-left: 28px;
}

.menu-item.expanded .sub-menu {
    display: block;
}

.portal-nav.collapsed .sub-menu {
    display: none !important;
}

.sub-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: var(--cf-ink-mute);
    text-decoration: none;
    font-family: var(--font-family-primary);
    font-size: 12px;
    line-height: 1.4;
    border-left: 2px solid transparent;
    border-radius: 0;
    transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.sub-menu-item:hover:not(.active) {
    color: var(--cf-ink);
    background: var(--cf-surface-page);
}

.sub-menu-item.active {
    color: var(--cf-ink);
    background: var(--cf-surface-page);
    font-weight: 600;
    /* Portal colour set per portal-section below. */
    border-left-color: var(--cf-ink);
}

/* Portal Sections (Multi-Portal Navigation) — Sprint 3 restyle.
   Section header is the eyebrow-style row that names the portal
   (ATHLETE PORTAL, COACH PORTAL, etc.). 11px tracked caps in mute colour
   per brief §3.2. Active (expanded) section gets a 2px portal-coloured
   left-border accent. */
.portal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    background: transparent;
    border-bottom: 1px solid var(--cf-border-subtle);
    border-left: 2px solid transparent;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.portal-section-header:hover {
    background: var(--cf-surface-page);
}

.portal-section-header.active {
    background: var(--cf-surface-page);
    /* Portal-coloured left accent set per data-portal section below. */
    border-left-color: var(--cf-ink);
}

/* Drag Handle */
.drag-handle {
    font-size: 12px;
    color: var(--gray-300);
    cursor: grab;
    padding: 0 4px;
    margin-right: 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    user-select: none;
}

.portal-section-header:hover .drag-handle {
    opacity: 1;
}

.drag-handle:hover {
    color: var(--gray-500);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Bottom Drop Zone */
.portal-drop-zone {
    height: 60px;
    transition: background 0.2s, border 0.2s;
}

.portal-drop-zone.drag-over {
    background: var(--gray-100);
    border-top: 4px solid var(--teal);
}

.portal-nav.collapsed .portal-drop-zone {
    display: none;
}

/* Drag Placeholder - Spotify-style insertion indicator */
.portal-drag-placeholder {
    background: rgba(20, 184, 166, 0.15);
    border: 2px dashed var(--teal);
    overflow: hidden;
    /* Start at 0 height, will be animated via JS */
}

/* Dragging state */
.portal-section.dragging {
    opacity: 0.4;
    position: relative;
    z-index: 1000;
}

/* Touch dragging - element follows finger */
.portal-section.touch-dragging,
.widget-placeholder.touch-dragging {
    position: fixed !important;
    z-index: 2000;
    pointer-events: none;
    opacity: 0.9;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transform: scale(1.02);
}

.portal-section-title {
    font-family: var(--font-family-primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--cf-text-mute);
    flex: 1;
    line-height: 1;
}

.portal-section-header.active .portal-section-title {
    /* Same mute colour as inactive — the left-border accent carries
       the active signal, not a colour change on the label. */
    color: var(--cf-text-mute);
}

.portal-section-icon {
    font-size: 11px;
    color: var(--cf-text-mute);
    transition: transform 200ms ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.portal-section.expanded .portal-section-icon {
    transform: rotate(90deg);
}

.portal-section-content {
    display: none;
    padding: 4px 0;
}

.portal-section.expanded .portal-section-content {
    display: block;
}

/* Collapsed sidebar: hide section content and titles */
.portal-nav.collapsed .portal-section-content {
    display: none !important;
}

.portal-nav.collapsed .portal-section-title {
    display: none;
}

.portal-nav.collapsed .portal-section-header {
    justify-content: center;
    padding: 8px;
}

.portal-nav.collapsed .portal-section-icon {
    display: none;
}

.portal-nav.collapsed .drag-handle {
    display: none;
}

/* Show abbreviated label when collapsed */
.portal-section-abbrev {
    display: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--cf-text-mute);
    letter-spacing: 0.1em;
}

.portal-nav.collapsed .portal-section-abbrev {
    display: block;
}

.portal-nav.collapsed .portal-section-header.active .portal-section-abbrev {
    color: var(--cf-ink);
}

/* ============================================================
   PORTAL-COLOURED ACCENTS — Sprint 3 §3.2
   Each portal section's active state gets its portal colour as a 2px
   left-border accent. Only four portal-colour tokens exist per Decision
   §4.2 (athlete/coach/business/system). CONTENT and DEVELOPER inherit
   the default --cf-ink accent from .portal-section-header.active above
   until tokens are added in a later sprint (logged in implementation
   report as Open Question 1).
   Portal colours appear ONLY in chrome (sidebar accent + portal
   switcher) per Champion Standard. */

.portal-section[data-portal="ATHLETE"] .portal-section-header.active,
.portal-section[data-portal="ATHLETE"] .menu-item-header.active,
.portal-section[data-portal="ATHLETE"] .sub-menu-item.active {
    border-left-color: var(--cf-portal-athlete);
}

.portal-section[data-portal="COACH"] .portal-section-header.active,
.portal-section[data-portal="COACH"] .menu-item-header.active,
.portal-section[data-portal="COACH"] .sub-menu-item.active {
    border-left-color: var(--cf-portal-coach);
}

.portal-section[data-portal="SYSTEM"] .portal-section-header.active,
.portal-section[data-portal="SYSTEM"] .menu-item-header.active,
.portal-section[data-portal="SYSTEM"] .sub-menu-item.active {
    border-left-color: var(--cf-portal-system);
}

.portal-section[data-portal="BUSINESS_OPS"] .portal-section-header.active,
.portal-section[data-portal="BUSINESS_OPS"] .menu-item-header.active,
.portal-section[data-portal="BUSINESS_OPS"] .sub-menu-item.active {
    border-left-color: var(--cf-portal-business);
}

.portal-section[data-portal="CONTENT"] .portal-section-header.active,
.portal-section[data-portal="CONTENT"] .menu-item-header.active,
.portal-section[data-portal="CONTENT"] .sub-menu-item.active {
    border-left-color: var(--cf-portal-content);
}

.portal-section[data-portal="DEVELOPER"] .portal-section-header.active,
.portal-section[data-portal="DEVELOPER"] .menu-item-header.active,
.portal-section[data-portal="DEVELOPER"] .sub-menu-item.active {
    border-left-color: var(--cf-portal-developer);
}

/* Tooltip for collapsed portal sections */
.portal-section-header {
    position: relative;
}

.portal-nav.collapsed .portal-section-header::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-800);
    color: white;
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-left: 8px;
    z-index: 1000;
}

.portal-nav.collapsed .portal-section-header:hover::after {
    opacity: 1;
}

/* User Footer — Sprint 3 restyle.
   Avatar uses the cf-avatar primitive (slot 1 = self = ink) declared in
   markup; the legacy .user-avatar alias rule from cf-primitives.css
   doesn't apply here because the markup no longer carries that class.
   Name + roles layout per brief §3.2. */
.portal-nav-footer {
    padding: 12px;
    border-top: 1px solid var(--cf-border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.portal-nav.collapsed .user-info {
    display: none;
}

.user-name {
    font-family: var(--font-family-primary);
    font-size: 13px;
    font-weight: 600;
    color: var(--cf-ink);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-family: var(--font-family-primary);
    font-size: 10px;
    font-weight: 500;
    color: var(--cf-text-mute);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1.4;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User Menu Dropdown */
.user-menu-container {
    position: relative;
}

.portal-nav-footer {
    cursor: pointer;
    transition: background-color 120ms ease;
}

.portal-nav-footer:hover {
    background: var(--cf-surface-page);
}

.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    display: none;
    z-index: 100;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-header {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.user-dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
}

.user-dropdown-email {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.15s;
}

.user-dropdown-item:hover {
    background: var(--gray-100);
}

.user-dropdown-item.logout:hover {
    background: #fef2f2;
    color: var(--red);
}

.user-dropdown-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

/* ============================================================
   CENTER COLUMN: PORTAL CANVAS
   ============================================================ */
.portal-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ============================================================
   PAGE-HEADER STRIP (.canvas-toolbar) — Sprint 3 §3.3
   The decision per Sprint 3 audit: stay page-driven. Existing
   page-loaders write into `.toolbar-title` (page title) and
   `.toolbar-breadcrumb` (eyebrow). Those selectors keep working;
   they get the new visual treatment in place.

   New canonical slot names live alongside as aliases so future
   pages can target `.cf-page-header__title` / `__eyebrow` /
   `__actions` directly. Rename happens on per-page touch in
   Sprints 4–7.

   Layout: eyebrow (top, small, tracked caps with ::before square)
   + page title (below, larger, ink) + right-aligned actions slot.
   ============================================================ */
.canvas-toolbar,
.cf-page-header {
    background: var(--cf-surface-card);
    border-bottom: 1px solid var(--cf-border-subtle);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    flex-shrink: 0;
}

.toolbar-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

/* Page title slot — body face, ink, semibold (Bebas Neue is hero-only
   per Decision §5.1; page titles are not hero moments). */
.toolbar-title,
.cf-page-header__title {
    font-family: var(--font-family-primary);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--cf-ink);
    margin: 0;
    /* Allow long titles to ellipsis rather than wrap. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Eyebrow slot — section context. 8px teal square via ::before
   matches .cf-eyebrow--card from cf-primitives.css. */
.toolbar-breadcrumb,
.cf-page-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family-primary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cf-text-mute);
    line-height: 1;
    margin: 0;
}

.toolbar-breadcrumb::before,
.cf-page-header__eyebrow::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--cf-teal);
    flex-shrink: 0;
}

/* Inner span (when used) — page-loaders sometimes split breadcrumb
   into multiple spans. Keep tracking and colour consistent. */
.toolbar-breadcrumb span {
    color: var(--cf-text-mute);
    margin: 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

/* Right-aligned actions slot. */
.toolbar-right,
.cf-page-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Toolbar Buttons — Sprint 3 token sweep (page-header chrome).
   Primary now uses --cf-ink per Decision §6.2. */
.toolbar-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--cf-border-subtle);
    border-radius: 0;
    cursor: pointer;
    font-family: var(--font-family-primary);
    font-size: 12px;
    font-weight: 500;
    color: var(--cf-ink);
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.toolbar-btn:hover {
    background: var(--cf-surface-page);
    border-color: var(--cf-ink);
}

.toolbar-btn.primary {
    background: var(--cf-ink);
    color: #ffffff;
    border-color: var(--cf-ink);
}

.toolbar-btn.primary:hover {
    background: var(--cf-ink-soft);
    border-color: var(--cf-ink-soft);
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 0;
    background: var(--gray-100);
    padding: 2px;
}

.view-btn {
    padding: 6px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
}

.view-btn.active {
    background: white;
    color: var(--teal);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ===== Date/Time Widget — Sprint 3 token sweep =====
   Sharp-cornered, --cf-text-mute per brief §3.3. */
.toolbar-datetime-widget {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--cf-border-subtle);
    position: relative;
    flex-shrink: 0;
}

.datetime-display {
    font-family: var(--font-family-primary);
    font-size: 11px;
    font-weight: 500;
    color: var(--cf-text-mute);
    white-space: nowrap;
    user-select: none;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.datetime-calendar-btn {
    padding: 4px;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--cf-text-mute);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
    border-radius: 0;
}

.datetime-calendar-btn:hover {
    color: var(--cf-ink);
    border-color: var(--cf-border-subtle);
    background: var(--cf-surface-page);
}

.datetime-calendar-btn.active {
    color: var(--cf-ink);
    border-color: var(--cf-ink);
    background: var(--cf-surface-page);
}

/* Calendar Popup */
.datetime-popup {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    width: 280px;
    padding: 14px;
    box-sizing: border-box;
}

.datetime-popup .cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.datetime-popup .cal-month-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
}

.datetime-popup .cal-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 2px 8px;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 3px;
}

.datetime-popup .cal-nav-btn:hover {
    color: var(--teal);
    background: var(--gray-50);
}

.datetime-popup .cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 2px;
    width: 100%;
}

.datetime-popup .cal-weekday {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    text-align: center;
    padding: 4px 0;
    text-transform: uppercase;
}

.datetime-popup .cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
}

.datetime-popup .cal-day {
    font-size: 11px;
    color: var(--gray-700);
    text-align: center;
    padding: 5px 0;
    cursor: default;
    border-radius: 3px;
    display: block;
}

.datetime-popup .cal-day.other-month {
    color: var(--gray-300);
}

.datetime-popup .cal-day.today {
    background: var(--teal);
    color: white;
    font-weight: 600;
}

/* Timezone Section */
.datetime-popup .tz-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.datetime-popup .tz-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.datetime-popup .tz-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.datetime-popup .tz-source {
    font-size: 10px;
    color: var(--gray-400);
    font-style: italic;
}

.datetime-popup .tz-change-link {
    font-size: 10px;
    color: var(--teal);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-weight: 500;
}

.datetime-popup .tz-change-link:hover {
    text-decoration: underline;
}

.datetime-popup .tz-picker {
    margin-top: 8px;
}

.datetime-popup .tz-select {
    width: 100%;
    padding: 6px 8px;
    font-size: 11px;
    border: 1px solid var(--gray-200);
    border-radius: 3px;
    color: var(--gray-700);
    background: white;
}

.datetime-popup .tz-save-btn {
    margin-top: 6px;
    padding: 5px 12px;
    background: var(--teal);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.datetime-popup .tz-save-btn:hover {
    background: var(--teal-dark);
}

/* Canvas Content Area */
.canvas-content {
    flex: 1;
    overflow: auto;
    padding: 16px;
    background: var(--gray-100);
}

/* Placeholder Content */
.placeholder-content {
    background: white;
    border: 2px dashed var(--gray-300);
    padding: 60px 40px;
    text-align: center;
    color: var(--gray-500);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.placeholder-text {
    font-size: 13px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================================
   RIGHT COLUMN: CONTEXTUAL SIDEBAR
   ============================================================ */
.context-sidebar {
    width: var(--context-sidebar-width);
    background: white;
    border-left: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.context-sidebar.collapsed {
    width: 0;
    border-left: none;
}

/* Expand Tab (visible when collapsed) */
.expand-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: var(--teal);
    color: white;
    border: none;
    padding: 16px 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 1px;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    transition: all 0.2s;
    display: none;
    z-index: 100;
}

.expand-tab:hover {
    background: var(--teal-dark);
    padding-right: 10px;
}

.context-sidebar.collapsed ~ .expand-tab {
    display: block;
}

/* Context Sidebar Header */
.context-header {
    padding: 0 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 49px;
}

.context-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-900);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--gray-500);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.collapse-btn:hover {
    color: var(--gray-700);
}

/* Context Sidebar Content */
.context-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Widget Placeholder — base card style */
.widget-placeholder {
    background: white;
    border: 1px solid var(--gray-200);
    padding: 0;
    text-align: left;
    margin-bottom: 10px;
}

/* Fallback label shown for unrecognised widget keys */
.widget-placeholder-label {
    padding: 20px 14px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-400);
    letter-spacing: 0.5px;
    text-align: center;
}

/* ── Widget content structure ──────────────────────────────────────────────── */

.widget-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--gray-100);
}

.widget-icon {
    font-size: 13px;
    color: var(--teal);
    flex-shrink: 0;
}

.widget-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-500);
}

.widget-body {
    padding: 10px 14px 12px;
}

/* Data rows — training-load, athlete-summary */
.widget-data-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.widget-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.widget-data-label {
    color: var(--gray-500);
}

.widget-data-value {
    font-weight: 600;
    color: var(--gray-700);
}

/* Note text below data rows or empty states */
.widget-note {
    font-size: 11px;
    color: var(--gray-400);
    font-style: italic;
    margin-top: 6px;
}

/* Upcoming sessions skeleton rows */
.widget-empty-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.widget-row--empty {
    height: 26px;
    background: var(--gray-100);
}

.widget-empty-msg {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.widget-action-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
}

.widget-action-link:hover {
    color: var(--teal-dark);
    text-decoration: underline;
}

/* Quick notes textarea */
.widget-notes-textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--gray-200);
    padding: 8px;
    font-family: inherit;
    font-size: 12px;
    color: var(--gray-700);
    background: var(--gray-50);
    resize: none;
    overflow: hidden;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.widget-notes-textarea:focus {
    border-color: var(--teal);
    background: white;
}

/* ============================================================
   WIDGET EDIT MODE
   ============================================================ */

/* Edit mode toggle button */
.edit-mode-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-400);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.edit-mode-btn:hover {
    color: var(--gray-600);
}

/* Done button (in edit mode) */
.done-btn {
    background: var(--teal);
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: white;
    padding: 4px 10px;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.done-btn:hover {
    background: var(--teal-dark);
}

/* Hide/show based on edit mode */
.context-sidebar:not(.edit-mode) .done-btn,
.context-sidebar:not(.edit-mode) .widget-drag-handle,
.context-sidebar:not(.edit-mode) .widget-remove-btn,
.context-sidebar:not(.edit-mode) .add-widget-btn,
.context-sidebar:not(.edit-mode) .widget-drop-zone {
    display: none;
}

/* Show + Add Widget when the panel has no widgets, even outside edit mode */
.context-sidebar.widgets-empty:not(.edit-mode) .add-widget-btn {
    display: block;
}

.context-sidebar.edit-mode .edit-mode-btn {
    display: none;
}

/* Widget structure in edit mode */
.widget-placeholder {
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease, margin 0.2s ease, padding-left 0.2s ease;
}

.context-sidebar.edit-mode .widget-placeholder {
    padding-left: 32px;
}

/* Drag handle for widgets */
.widget-drag-handle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    color: var(--gray-400);
    font-size: 12px;
    letter-spacing: 2px;
    padding: 4px;
    user-select: none;
    transition: color 0.2s;
}

.widget-drag-handle:hover {
    color: var(--gray-600);
}

.widget-drag-handle:active {
    cursor: grabbing;
}

/* Remove button for widgets */
.widget-remove-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gray-200);
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.widget-remove-btn:hover {
    background: #dc2626;
    color: white;
}

/* Add widget button */
.add-widget-btn {
    background: white;
    border: 2px dashed var(--gray-300);
    padding: 16px;
    text-align: center;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-widget-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: rgba(20, 184, 166, 0.05);
}

.add-widget-btn-icon {
    font-size: 20px;
    font-weight: 300;
    display: block;
    margin-bottom: 4px;
}

/* Widget drop zone */
.widget-drop-zone {
    height: 60px;
    transition: background 0.2s, border 0.2s;
}

.widget-drop-zone.drag-over {
    background: var(--gray-100);
    border-top: 4px solid var(--teal);
}

/* Drag placeholder for widgets */
.widget-drag-placeholder {
    background: rgba(20, 184, 166, 0.15);
    border: 2px dashed var(--teal);
    overflow: hidden;
    margin-bottom: 12px;
}

/* Widget dragging state */
.widget-placeholder.dragging {
    opacity: 0.4;
    position: relative;
    z-index: 1000;
}

/* Widget picker dropdown */
.widget-picker {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.widget-picker-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    font-size: 12px;
    color: var(--gray-700);
    transition: background 0.15s;
}

.widget-picker-item:hover {
    background: var(--gray-50);
}

.widget-picker-item:last-child {
    border-bottom: none;
}

.widget-picker-item.disabled {
    color: var(--gray-400);
    cursor: not-allowed;
}

.widget-picker-item.disabled:hover {
    background: transparent;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden {
    display: none !important;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   TOOLTIPS (for collapsed sidebar)
   ============================================================ */
.menu-item-header {
    position: relative;
}

.portal-nav.collapsed .menu-item-header::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-800);
    color: white;
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-left: 8px;
    z-index: 1000;
}

.portal-nav.collapsed .menu-item-header:hover::after {
    opacity: 1;
}

/* ============================================================
   MOBILE STYLES
   ============================================================ */

/* Mobile Bottom Bar */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    border-top: 1px solid var(--gray-200);
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 48px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    gap: 2px;
    transition: color 0.2s;
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
    color: var(--teal);
}

.mobile-nav-btn .icon {
    font-size: 20px;
    line-height: 1;
}

.mobile-nav-btn .label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Hamburger icon lines */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 20px;
    height: 20px;
}

.hamburger-icon span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
}

/* Context icon (sidebar lines) */
.context-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    width: 20px;
    height: 20px;
}

.context-icon span {
    display: block;
    height: 2px;
    background: currentColor;
}

.context-icon span:nth-child(1) { width: 18px; }
.context-icon span:nth-child(2) { width: 14px; }
.context-icon span:nth-child(3) { width: 18px; }

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.visible {
    opacity: 1;
}

/* Mobile Media Query - includes tablet portrait
   Breakpoint: 1024px
   Rationale: Portal nav (220px) + Context sidebar (320px) = 540px
   At 1024px with both open, canvas = 484px (marginal)
   At 768px with both open, canvas = 228px (unusable)
   Mobile pattern gives full canvas width with slide-in panels */
@media (max-width: 1024px) {
    /* Show mobile elements */
    .mobile-bottom-bar {
        display: flex;
    }
    
    .mobile-overlay {
        display: block;
        pointer-events: none;
    }
    
    .mobile-overlay.visible {
        pointer-events: auto;
    }
    
    /* Adjust main layout for bottom bar */
    .main-layout {
        padding-bottom: 56px;
    }

    /* Content area needs bottom padding too — it scrolls independently */
    .canvas-content {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 16px) !important;
    }

    /* Compact plan grid toggle buttons on mobile */
    .view-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

    .nav-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }
    
    /* Hide desktop sidebar controls */
    .sidebar-controls {
        display: none !important;
    }
    
    /* Hide expand tab on mobile */
    .expand-tab {
        display: none !important;
    }
    
    /* Hide FE nav on mobile (keep brand) */
    .fe-nav-icons {
        display: none;
    }
    
    /* Simplify global nav */
    .global-nav-inner {
        padding: 0 12px;
    }
    
    .brand {
        padding-right: 0;
        border-right: none;
    }
    
    .search-box,
    .search-box .global-search-icon {
        display: none;
    }
    
    /* Portal Nav - slide in from left */
    .portal-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 1002;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .portal-nav.mobile-open {
        transform: translateX(0);
    }
    
    .portal-nav.collapsed {
        width: 280px;
    }
    
    .portal-nav.collapsed .menu-label,
    .portal-nav.collapsed .submenu,
    .portal-nav.collapsed .sidebar-header-title,
    .portal-nav.collapsed .user-name,
    .portal-nav.collapsed .user-role {
        display: block;
        opacity: 1;
    }
    
    .portal-nav.collapsed .sidebar-header {
        justify-content: flex-start;
        padding: 0 16px;
    }
    
    .portal-nav.collapsed .user-info {
        display: flex;
    }
    
    .portal-nav.collapsed .menu-item-header {
        justify-content: flex-start;
        padding: 0 16px;
    }
    
    .portal-nav.collapsed .menu-icon {
        margin-right: 12px;
    }
    
    /* Add close button to portal nav on mobile */
    .mobile-close-btn {
        display: flex;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        background: var(--gray-100);
        border: none;
        cursor: pointer;
        font-size: 18px;
        color: var(--gray-600);
        z-index: 10;
    }
    
    .mobile-close-btn:hover {
        background: var(--gray-200);
        color: var(--gray-800);
    }
    
    /* Context Sidebar - slide in from right */
    .context-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 300px;
        z-index: 1002;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .context-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .context-sidebar.collapsed {
        width: 300px;
        transform: translateX(100%);
    }
    
    .context-sidebar.collapsed.mobile-open {
        transform: translateX(0);
    }
    
    /* Canvas takes full width */
    .portal-canvas {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Canvas toolbar adjustments */
    .canvas-toolbar {
        flex-wrap: wrap;
        gap: 4px;
        height: auto;
        min-height: 49px;
        padding: 8px 16px;
    }
    
    .canvas-toolbar-left {
        flex: 1;
        min-width: 100%;
    }
    
    .canvas-toolbar-right {
        flex: 1;
        min-width: 100%;
        justify-content: flex-start;
    }
    
    /* Breadcrumb wrapping */
    .breadcrumb {
        flex-wrap: wrap;
    }
    
    /* Always show drag handles on mobile */
    .drag-handle {
        opacity: 1;
    }

    /* Date/Time Widget - compact on small screens */
    .toolbar-datetime-widget {
        border-left: none;
        margin-left: 8px;
        padding-left: 0;
    }

    .datetime-display {
        font-size: 10px;
    }

    .canvas-content {
        padding: 8px;
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 8px);
    }
}

@media (max-width: 480px) {
    .canvas-content {
        padding: 4px;
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 4px);
    }
}

/* Hide mobile close button on desktop */
@media (min-width: 1025px) {
    .mobile-close-btn {
        display: none;
    }
}

/* ============================================================
   NAV SECTION LABELS, DIVIDERS & SUB-MENU GROUPS
   ============================================================ */
.nav-section-label {
    padding: 8px 12px 2px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray-300);
}

.nav-section-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}

.sub-menu-group-label {
    padding: 8px 12px 2px 12px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--gray-300);
}

/* Muted nav items (roadmap placeholders) */
.sub-menu-item.muted {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.menu-item-header.muted {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

/* Phosphor Icon styles in nav menu headers */
.menu-icon.ph {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
    color: var(--gray-400);
    flex-shrink: 0;
}

.menu-item-header.active .menu-icon.ph {
    color: white;
}

/* Phosphor Icon styles in sub-menu items */
.sub-menu-item i.ph {
    font-size: 13px;
    min-width: 14px;
    text-align: center;
    color: var(--gray-300);
    flex-shrink: 0;
}

.sub-menu-item.active i.ph {
    color: var(--teal);
}

/* ── Admin-disabled context panel ─────────────────────────────────────────── */
/* Applied by _reloadContextWidgets() when slideractive=false for this page. */
/* Separate from the user-controlled .collapsed class so they do not conflict. */
.panel-admin-off {
    display: none !important;
}
