/* ============================================================
   Flexstructor Design System â€” Bootstrap 5 layer
   Tokens sourced from flexstructor/DESIGN.md (Stitch export)
   ============================================================ */

/* ---- Bootstrap 5 CSS variable overrides ---- */
:root {
    /* Core palette */
    --bs-primary:            #000000;
    --bs-primary-rgb:        0, 0, 0;
    --bs-secondary:          #a73b00;
    --bs-secondary-rgb:      167, 59, 0;
    --bs-success:            #05a357;
    --bs-danger:             #ba1a1a;
    --bs-warning:            #FF5F05;
    --bs-body-bg:            #f9f9f9;
    --bs-body-color:         #1a1c1c;
    --bs-border-color:       #e2e2e2;
    /* --bs-border-radius:      0; */
    /* --bs-border-radius-sm:   0; */
    /* --bs-border-radius-lg:   0; */
    /* --bs-border-radius-xl:   0; */
    /* --bs-border-radius-pill: 0; */
    --bs-body-font-family:   'Hanken Grotesk', system-ui, sans-serif;

    /* Flexstructor semantic tokens */
    --fx-primary:            #000000;
    --fx-primary-dark:       #1b1b1b;
    --fx-on-primary:         #ffffff;
    --fx-orange:             #FF5F05;
    --fx-orange-container:   #fe5f04;
    --fx-blue:               #276EF1;
    --fx-success:            #05a357;
    --fx-danger:             #ba1a1a;
    --fx-bg:                 #f9f9f9;
    --fx-surface:            #ffffff;
    --fx-surface-low:        #f3f3f3;
    --fx-surface-container:  #eeeeee;
    --fx-text:               #1a1c1c;
    --fx-muted:              #4c4546;
    --fx-border:             #e2e2e2;
    --fx-outline: #e2e2e2;

    /* Typography */
    --fx-font:               'Hanken Grotesk', system-ui, sans-serif;
    --fx-font-mono:          'JetBrains Mono', 'Courier New', monospace;

    /* Spacing (8px grid) */
    --fx-space-xs:           4px;
    --fx-space-sm:           8px;
    --fx-space-md:           16px;
    --fx-space-lg:           24px;
    --fx-space-xl:           48px;

    /* Elevation */
    --fx-shadow-card:        0px 4px 16px rgba(0, 0, 0, 0.12);
    --fx-shadow-float:       drop-shadow(0px 16px 48px rgba(0, 0, 0, 0.22));

    /* Mobile shell */
    --fx-nav-height:         60px;

    /* Touch target minimum */
    --fx-touch-min:          48px;
}

/* ---- Base reset ---- */
html, body {
    margin: 0;
    background: var(--fx-bg);
    color: var(--fx-text);
    font-family: var(--fx-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1[tabindex="-1"]:focus {
    outline: none;
}

/* Remove Bootstrap's rounded corners globally */
.rounded, .rounded-1, .rounded-2, .rounded-3, .rounded-4, .rounded-5,
.rounded-top, .rounded-bottom, .rounded-start, .rounded-end,
.btn, .card, .form-control, .form-select, .input-group,
.badge, .alert, .modal-content, .dropdown-menu, .list-group-item,
.nav-pills .nav-link, .toast, .popover, .tooltip-inner {
    /* border-radius: 0 !important; */
}

/* Avatar/map-pin circles are the only permitted radius */
.fx-avatar { border-radius: 50% !important; }

/* ---- Bootstrap component customisation ---- */

/* Buttons â€” minimum 48px height, sharp corners, black primary */
.btn {
    /* min-height: var(--fx-touch-min); */
    font-family: var(--fx-font);
    font-weight: 600;
    /* font-size: 1rem; */
    /* letter-spacing: 0.02em; */
    /* border-radius: 0; */
}

.btn-primary {
    --bs-btn-bg:           #000000;
    --bs-btn-border-color: #000000;
    --bs-btn-hover-bg:     #1b1b1b;
    --bs-btn-active-bg:    #1b1b1b;
    --bs-btn-color:        #ffffff;
}

.btn-outline-primary {
    --bs-btn-color:        #000000;
    --bs-btn-border-color: #000000;
    --bs-btn-hover-bg:     #000000;
    --bs-btn-hover-color:  #ffffff;
}

.btn-transparent {
    --bs-btn-hover-color:  #000000;
}

.btn-orange {
    background-color: var(--fx-orange);
    border-color: var(--fx-orange);
    color: #ffffff;
    font-weight: 600;
}
.btn-orange:hover, .btn-orange:active { background-color: #e55504; border-color: #e55504; color: #fff; }

/* Cards â€” white, shadow, sharp */
.card {
    background: var(--fx-surface);
    box-shadow: var(--fx-shadow-card);
    border: none;
}
.card:active { box-shadow: inset 0px 4px 100px rgba(0, 0, 0, 0.08); }

/* Form controls â€” sharp, focus ring black */
.form-control, .form-select {
    border: 1px solid var(--fx-border);
    min-height: var(--fx-touch-min);
}
.form-control:focus, .form-select:focus {
    border-color: #000000;
    border-width: 2px;
    box-shadow: none;
}

/* Status chips/badges */
.fx-badge {
    display: inline-block;
    padding: 4px 10px;
    font-family: var(--fx-font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.4;
}
.fx-badge--booked    { background: #000; color: #fff; }
.fx-badge--available { background: var(--fx-surface-container); color: #000; }
.fx-badge--confirmed { background: var(--fx-orange); color: #fff; }
.fx-badge--completed { background: var(--fx-success); color: #fff; }
.fx-badge--pending   { background: var(--fx-surface-container); color: var(--fx-muted); }
.fx-badge--cancelled { background: var(--fx-danger); color: #fff; }
.fx-badge--progress  { background: var(--fx-blue); color: #fff; }

/* Progress bars â€” Safety Orange, 4px */
.progress { height: 4px; background: var(--fx-surface-container); border-radius: 0; }
.progress-bar { background: var(--fx-orange); border-radius: 0; }

/* List group items â€” 1px border, no radius */
.list-group-item { border-color: var(--fx-border); }
.list-group-flush .list-group-item { border-left: 0; border-right: 0; }

/* ---- Typography utilities ---- */
.fx-label {
    font-family: var(--fx-font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fx-muted);
}

.fx-headline { font-weight: 600; letter-spacing: -0.01em; }
.fx-headline-lg { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; }

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: 600;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings:
        'FILL' 0,
        'wght' 100,
        'GRAD' 0,
        'opsz' 24;
}

.fx-filter-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scrollbar-width: none;
}

.fx-search-message-btn {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--fx-primary);
    text-decoration: none;
}

.fx-search-message-btn:hover,
.fx-search-message-btn:focus {
    background: rgba(0, 0, 0, 0.06);
    color: var(--fx-primary);
}

.fx-search-message-btn .badge {
    font-size: 0.62rem;
}

.fx-filter-strip::-webkit-scrollbar { display: none; }

.fx-filter-strip--open {
    overflow: visible;
    flex-wrap: wrap;
}

.fx-filter-strip--selected {
    overflow: visible;
    flex-wrap: wrap;
}

.fx-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    max-width: 100%;
    padding: 0 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.96);
    color: var(--fx-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.95rem;
}

.fx-filter-pill--selected {
    background: var(--fx-primary);
    color: var(--fx-on-primary);
    border-color: var(--fx-primary);
}

.fx-filter-icon {
    flex: 0 0 auto;
    font-size: 20px;
}

.fx-filter-combobox {
    position: relative;
    flex: 0 0 auto;
}

.fx-filter-input {
    width: 9rem;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.96);
    color: var(--fx-text);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    outline: none;
}

.fx-filter-input:focus {
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.fx-filter-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(280px, calc(100vw - 32px));
    max-height: 260px;
    overflow-y: auto;
    z-index: 1040;
    background: #fff;
    border: 1px solid var(--fx-border);
    box-shadow: var(--fx-shadow-card);
}

.fx-filter-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--fx-border);
    background: #fff;
    color: var(--fx-text);
    text-align: left;
}

.fx-filter-suggestion:hover,
.fx-filter-suggestion:focus {
    background: var(--fx-surface-low);
}

.fx-location-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(34rem, calc(100vw - 32px));
    max-height: min(22rem, 55vh);
    overflow-y: auto;
    z-index: 1040;
    background: #fff;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    box-shadow: var(--fx-shadow-card);
}

.fx-location-suggestion {
    display: block;
    width: 100%;
    min-height: 58px;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid var(--fx-border);
    background: #fff;
    color: var(--fx-text);
    text-align: left;
}

.fx-location-suggestion:hover,
.fx-location-suggestion:focus,
.fx-location-suggestion.is-active {
    background: var(--fx-surface-low);
    outline: none;
}

.fx-location-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 10px 12px;
    color: var(--fx-text-muted);
    font-size: 0.875rem;
}

.fx-profile-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---- Mobile app shell ---- */
.fx-app-surface {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fx-app-content {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--fx-nav-height) + env(safe-area-inset-bottom, 0px));
}

/* Map / canvas screens: edge-to-edge, no content padding */
.fx-app-content--bleed { padding-bottom: 0; }
.fx-app-content--focus { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---- Bottom tab bar ---- */
.fx-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    height: calc(var(--fx-nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--fx-border);
}

.fx-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 6px 0 4px;
    color: var(--fx-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 150ms ease, transform 150ms ease;
    -webkit-tap-highlight-color: transparent;
    border: none;
    background: transparent;
}
.fx-tab:active { transform: scale(0.94); }
.fx-tab svg { width: 24px; height: 24px; }
.fx-tab--active { color: var(--fx-primary); }
.fx-tab-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fx-tab-badge {
    position: absolute;
    top: -7px;
    right: -13px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--fx-danger);
    color: #fff;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    border: 2px solid #fff;
}

/* ---- App menu drawer ---- */
.fx-app-menu {
    --bs-offcanvas-width: min(360px, 88vw);
    border-right: 1px solid var(--fx-border);
}

.fx-menu-section {
    padding: 14px 0;
    border-top: 1px solid var(--fx-border);
}

.fx-menu-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.fx-menu-heading {
    margin-bottom: 8px;
    color: var(--fx-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fx-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 10px 0;
    color: var(--fx-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fx-menu-link:last-child {
    border-bottom: 0;
}

.fx-menu-link:hover,
.fx-menu-link:focus {
    color: var(--fx-primary);
}

.fx-menu-icon {
    flex: 0 0 auto;
    width: 28px;
    color: currentColor;
}

/* ---- Inbox ---- */
.fx-inbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px;
    margin-bottom: 8px;
    color: var(--fx-text);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--fx-border);
}

.fx-inbox-row:hover,
.fx-inbox-row:focus {
    color: var(--fx-primary);
    border-color: rgba(0, 0, 0, 0.18);
}

.fx-inbox-avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--fx-primary);
    color: var(--fx-on-primary);
    font-weight: 800;
}

/* ---- Skeleton loaders ---- */
.fx-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--fx-surface-container);
    border-radius: 0;
}
.fx-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    will-change: transform;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: fx-shimmer 1.2s infinite;
}
@keyframes fx-shimmer { 100% { transform: translateX(100%); } }

/* ---- Dividers ---- */
.fx-divider { height: 1px; background: var(--fx-border); }

/* ---- Availability preview ---- */
.fx-availability-preview {
    min-width: 146px;
    max-width: 170px;
}

.fx-availability-grid {
    display: grid;
    grid-template-columns: repeat(7, 14px);
    gap: 5px;
}

.fx-availability-day {
    width: 10px;
    height: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: #9aa0b5;
}

.fx-availability-day--available,
.fx-availability-dot {
    border-radius: 50%;
    background: var(--bs-success);
}

.fx-availability-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
}

.fx-availability-day--partial {
    color: #7dbeb8;
    font-weight: 700;
}

.fx-availability-day--full {
    color: #a5a8bb;
    font-weight: 500;
}

.fx-availability-mark {
    min-width: 9px;
    text-align: center;
    color: #9aa0b5;
    font-weight: 700;
}

/* ---- Page top padding (status-bar-safe-area for iOS) ---- */
.fx-page-top {
    padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
}

/* ---- Section header row ---- */
.fx-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--fx-space-md) var(--fx-space-md) var(--fx-space-sm);
}

/* ---- Empty state ---- */
.fx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--fx-space-xl) var(--fx-space-md);
    text-align: center;
    color: var(--fx-muted);
    gap: var(--fx-space-sm);
}

/* ---- Instructor scheduler ---- */
.fx-scheduler {
    /* min-height: 100%; */
    padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--fx-space-md) var(--fx-space-lg);
    background: var(--fx-bg);
}

.fx-scheduler [tabindex="-1"]:focus {
    outline: none;
}

.fx-scheduler-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--fx-space-md);
    padding: var(--fx-space-sm) 0 var(--fx-space-md);
    background: var(--fx-bg);
}

.fx-live-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    color: var(--fx-text);
    font-family: var(--fx-font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fx-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--fx-orange);
    animation: fx-live-pulse 1.6s ease-in-out infinite;
}

@keyframes fx-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.72); }
}

.fx-view-toggle .btn {
    min-height: 36px;
}

.fx-date-rail {
    display: flex;
    align-items: center;
    gap: var(--fx-space-sm);
    overflow-x: auto;
    padding: 2px 0 var(--fx-space-md);
    scrollbar-width: none;
}

.fx-date-rail::-webkit-scrollbar {
    display: none;
}

.fx-date-step {
    flex: 0 0 auto;
    width: 40px;
    min-height: 44px;
    padding: 0;
}

.fx-date-pill {
    flex: 0 0 auto;
    min-width: 66px;
    min-height: 54px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid var(--fx-border);
    background: var(--fx-surface);
    color: var(--fx-text);
}

.fx-date-pill span {
    font-family: var(--fx-font-mono);
    font-size: 11px;
    color: var(--fx-muted);
    text-transform: uppercase;
}

.fx-date-pill strong {
    font-size: 1.05rem;
    line-height: 1;
}

.fx-date-pill--active {
    background: var(--fx-primary);
    border-color: var(--fx-primary);
    color: var(--fx-on-primary);
}

.fx-date-pill--active span {
    color: rgba(255, 255, 255, 0.78);
}

.fx-scheduler-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: var(--fx-space-md);
    border: 1px solid var(--fx-border);
    background: var(--fx-border);
}

.fx-scheduler-summary > div {
    min-height: 74px;
    padding: var(--fx-space-md);
    background: var(--fx-surface);
}

.fx-next-lesson {
    margin-bottom: var(--fx-space-md);
    padding: var(--fx-space-md);
    background: var(--fx-surface);
    border-left: 4px solid var(--fx-orange) !important;
    /* box-shadow: var(--fx-shadow-card); */
}

.fx-mobile-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--fx-space-sm);
}

.fx-timeline-gap {
    align-self: center;
    padding: 4px;
    background: var(--bs-light);
    /* color: var(--fx-muted); */
    font-family: var(
    --fx-font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fx-lesson-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: var(--fx-space-md);
    padding: var(--fx-space-md);
    background: var(--fx-surface);
    /* border: 1px solid var(--fx-border); */
    /* box-shadow: var(--fx-shadow-card); */
}

.fx-lesson-card--live {
    border-left: 4px solid var(--fx-orange);
}

.fx-lesson-card--completed {
    opacity: 0.82;
}

.fx-lesson-card--cancelled {
    border-left: 4px solid var(--fx-danger);
}

.fx-lesson-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2px;
    border-right: 1px solid var(--fx-border);
}

.fx-lesson-time strong {
    font-size: 1.1rem;
    line-height: 1;
}

.fx-lesson-time span {
    margin-top: 6px;
    color: var(--fx-muted);
    font-family: var(--fx-font-mono);
    font-size: 11px;
}

.fx-lesson-body {
    min-width: 0;
}

.fx-lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: var(--fx-space-sm);
    color: var(--fx-muted);
    font-size: 0.84rem;
}

.fx-lesson-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.fx-lesson-meta .material-symbols-outlined {
    font-size: 16px;
}

.fx-lesson-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--fx-space-sm);
    margin-top: var(--fx-space-md);
}

.fx-lesson-actions .btn {
    min-height: 38px;
}

.fx-scheduler-board {
    overflow-x: auto;
    background: var(--fx-surface-low);
    background: #fff;
    border: 1px solid var(--fx-border);
    /* box-shadow: var(--fx-shadow-card); */
}

.fx-scheduler-grid {
    min-width: 1120px;
    display: grid;
    grid-template-columns: 220px minmax(900px, 1fr);
}

.fx-scheduler-grid--header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--fx-surface-container);
    border-bottom: 1px solid var(--fx-outline);
}

.fx-scheduler-person-cell {
    min-height: 72px;
    padding: var(--fx-space-md);
    border-right: 1px solid var(--fx-border);
    background: var(--fx-surface);
}

.fx-scheduler-hour-strip,
.fx-scheduler-lane {
    position: relative;
    display: grid;
    grid-template-columns: repeat(15, minmax(60px, 1fr));
    background-image: linear-gradient(to right, var(--fx-border) 1px, transparent 1px);
    background-size: calc(100% / 15) 100%;
}

.fx-scheduler-hour {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fx-muted);
    font-family: var(--fx-font-mono);
    font-size: 12px;
    font-weight: 700;
}

.fx-scheduler-hour--active {
    background: rgba(255, 95, 5, 0.08);
    color: var(--fx-primary);
}

.fx-scheduler-grid--availability,
.fx-scheduler-grid--lessons {
    border-bottom: 1px solid var(--fx-border);
}

.fx-scheduler-lane {
    min-height: 96px;
    background-color: var(--fx-surface);
    background-image:
        radial-gradient(var(--fx-border) 1px, transparent 1px),
        linear-gradient(to right, var(--fx-border) 1px, transparent 1px);
    background-size: 20px 20px, calc(100% / 15) 100%;
}

.fx-scheduler-lane--lesson {
    min-height: 142px;
}

.fx-availability-block,
.fx-scheduler-lesson-block {
    position: absolute;
    top: 16px;
    bottom: 16px;
    min-width: 86px;
    padding: 10px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fx-availability-block {
    border: 1px dashed var(--fx-outline);
    background: rgba(238, 238, 238, 0.72);
    color: var(--fx-muted);
    font-family: var(--fx-font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fx-scheduler-lesson-block {
    color: var(--fx-on-primary);
    border: 1px solid transparent;
    background: var(--fx-primary);
    box-shadow: var(--fx-shadow-card);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.fx-scheduler-lesson-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.fx-scheduler-lesson-block--live {
    background: var(--fx-orange);
}

.fx-scheduler-lesson-block--completed {
    background: var(--fx-success);
}

.fx-scheduler-lesson-block--cancelled {
    background: var(--fx-danger);
}

.fx-scheduler-mini-status {
    flex: 0 0 auto;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.18);
    font-family: var(--fx-font-mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fx-current-time {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--fx-orange);
    z-index: 3;
}

.fx-current-time::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--fx-orange);
}

.fx-scheduler-empty-lane {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fx-muted);
    font-family: var(--fx-font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.fx-scheduler-legend {
    min-width: 1120px;
    min-height: 48px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--fx-space-lg);
    padding: var(--fx-space-sm) var(--fx-space-md);
    background: var(--fx-surface-container);
    border-top: 1px solid var(--fx-outline);
}

.fx-scheduler-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--fx-muted);
    font-family: var(--fx-font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fx-legend-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 999px;
}

.fx-legend-dot--confirmed { background: var(--fx-primary); }
.fx-legend-dot--live { background: var(--fx-orange); }
.fx-legend-dot--completed { background: var(--fx-success); }
.fx-legend-dot--available { background: var(--fx-surface-container); border: 1px dashed var(--fx-outline); }

/* ---- Schedule snapshot ---- */
.fx-snapshot-weekdays,
.fx-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.fx-snapshot-scroll-wrap {
    position: relative;
}

.fx-snapshot-scroll-wrap::before,
.fx-snapshot-scroll-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 2;
}

.fx-snapshot-scroll-wrap::before {
    left: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0));
}

.fx-snapshot-scroll-wrap::after {
    right: 0;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0));
}

.fx-snapshot-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.fx-snapshot-scroll:active {
    cursor: grabbing;
}

.fx-snapshot-scroll::-webkit-scrollbar {
    display: none;
}

.fx-snapshot-scroll:focus-visible {
    outline: 2px solid var(--fx-primary);
    outline-offset: 2px;
}

.fx-snapshot-month {
    flex: 0 0 clamp(260px, 32vw, 320px);
    scroll-snap-align: start;
}

.fx-snapshot-scroll-cue {
    margin-top: 6px;
    color: var(--fx-muted);
    font-family: var(--fx-font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fx-snapshot-scroll-cue .material-symbols-outlined {
    font-size: 16px;
}

.fx-snapshot-scroll-cue-arrow {
    opacity: 0.65;
    animation: fx-snapshot-cue-nudge 1.35s ease-in-out infinite;
}

.fx-snapshot-scroll-cue-arrow:last-of-type {
    margin-left: -4px;
    animation-delay: 0.22s;
}

@keyframes fx-snapshot-cue-nudge {
    0% {
        transform: translateX(0);
        opacity: 0.35;
    }
    45% {
        transform: translateX(3px);
        opacity: 0.95;
    }
    100% {
        transform: translateX(0);
        opacity: 0.35;
    }
}

.fx-snapshot-weekdays span {
    color: var(--fx-muted);
    font-family: var(--fx-font-mono);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.fx-snapshot-day,
.fx-snapshot-empty,
.fx-snapshot-skeleton {
    min-width: 0;
    aspect-ratio: 1;
}

.fx-snapshot-day {
    width: 100%;
    border: 1px solid transparent;
    background: var(--fx-surface-container);
    color: var(--fx-text);
    font-family: var(--fx-font-mono);
    font-size: 12px;
    font-weight: 700;
}

.fx-snapshot-day--available,
.fx-snapshot-day--open {
    background: rgba(25, 135, 84, 0.14);
    color: var(--bs-success);
}

.fx-snapshot-day--partial,
.fx-snapshot-day--short {
    background: rgba(255, 193, 7, 0.18);
    color: #7a5a00;
}

.fx-snapshot-day--full,
.fx-snapshot-day--off {
    background: var(--fx-surface-container);
    color: var(--fx-muted);
}

.fx-snapshot-day--today {
    border-color: var(--fx-orange);
}

.fx-snapshot-day--selected {
    background: var(--fx-primary);
    border-color: var(--fx-primary);
    color: var(--fx-on-primary);
}

.fx-snapshot-legend {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid transparent;
}

.fx-snapshot-legend--available,
.fx-snapshot-legend--open {
    background: var(--bs-success);
    border-color: var(--bs-success);
}

.fx-snapshot-legend--partial,
.fx-snapshot-legend--short {
    background: var(--bs-warning);
    border-color: var(--bs-warning);
}

.fx-snapshot-legend--full,
.fx-snapshot-legend--off {
    background: var(--bs-danger);
    border-color: var(--bs-danger);
}

.fx-snapshot-skeleton {
    display: block;
    background: var(--fx-surface-container);
}

/* ---- Schedule vis timeline ---- */
.fx-schedule-timeline {
    min-height: 340px;
    background: #fff;
}

.fx-schedule-timeline-shell {
    display: grid;
    gap: 0.5rem;
}
.vis-panel.vis-top {
    box-shadow: inset 5px 0px 0px 0px #0000000f;
}
.vis-panel.vis-left {box-shadow: 6px 0px 0px 0px #0000000f;}
.fx-schedule-timeline-hint {
    font-family: var(--fx-font-sans);
    letter-spacing: 0.01em;
}

.fx-schedule-timeline .vis-item {
    border-radius: 10px;
    border-width: 1px;
    font-family: var(--fx-font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.fx-schedule-timeline .vis-item.fx-schedule-availability {
    background: rgba(25, 135, 84, 0.12);
    border-color: rgba(25, 135, 84, 0.28);
    color: var(--fx-success);
}

.fx-schedule-timeline .vis-label {
    min-width: 220px;
}

.fx-schedule-timeline .fx-schedule-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.fx-schedule-timeline .fx-schedule-group__avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}
.vis-labelset .vis-label {
    display: flex;
}
.vis-labelset .vis-label .vis-inner {
    display: flex !important;
    gap: .5rem;
}
.fx-schedule-timeline .fx-schedule-group__avatar--fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(255, 159, 28, 0.95), rgba(13, 110, 253, 0.9));
    color: var(--fx-on-primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.fx-schedule-timeline .fx-schedule-group__copy {
    min-width: 0;
    display: grid;
    gap: 0.1rem;
    align-content: center;
}

.fx-schedule-timeline .fx-schedule-group__name {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.2;
}

.fx-schedule-timeline .fx-schedule-group__meta {
    font-family: var(--fx-font-mono);
    font-size: 10px;
    opacity: 0.76;
}

.fx-schedule-timeline .vis-item.fx-schedule-item {
    color: var(--fx-on-primary);
    cursor: grab;
}

.fx-schedule-timeline .vis-item.fx-schedule-item.vis-dragging {
    cursor: grabbing;
}

.fx-schedule-timeline .fx-schedule-card {
    display: grid;
    gap: 2px;
    line-height: 1.2;
}

.fx-schedule-timeline .fx-schedule-card__name {
    font-weight: 700;
    font-size: 12px;
}

.fx-schedule-timeline .fx-schedule-card__meta {
    font-family: var(--fx-font-mono);
    font-size: 10px;
    opacity: 0.92;
}

.fx-schedule-timeline .vis-item.fx-schedule-item--confirmed {
    background: var(--fx-primary);
    border-color: var(--fx-primary);
}

.fx-schedule-timeline .vis-item.fx-schedule-item--live {
    background: var(--fx-orange);
    border-color: var(--fx-orange);
}

.fx-schedule-timeline .vis-item.fx-schedule-item--completed {
    background: var(--fx-success);
    border-color: var(--fx-success);
}

.fx-schedule-timeline .vis-item.fx-schedule-item--cancelled {
    background: var(--fx-danger);
    border-color: var(--fx-danger);
}

@media (min-width: 768px) {
    .fx-scheduler {
        /* padding-left: var(--fx-space-lg); */
        /* padding-right: var(--fx-space-lg); */
    }

    .fx-scheduler-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fx-mobile-timeline {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .fx-timeline-gap {
        /* grid-column: 1 / -1; */
    }
}

@media (max-width: 767.98px) {
    .fx-snapshot-month {
        flex-basis: min(82vw, 320px);
    }
}

@media (min-width: 992px) {
    .fx-scheduler {
        /* padding: var(--fx-space-lg) var(--fx-space-lg) var(--fx-space-xl); */
    }

    .fx-scheduler-toolbar {
        padding-top: 0;
    }
}

@media (max-width: 575.98px) {
    .fx-scheduler-toolbar {
        align-items: flex-start;
    }

    .fx-lesson-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: var(--fx-space-sm);
        padding: var(--fx-space-sm);
    }

    .fx-lesson-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fx-tab { transition: none; }
    .fx-skeleton::after { animation: none; }
    .fx-live-dot { animation: none; }
    .fx-snapshot-scroll-cue-arrow { animation: none; }
}
