/**
 * Appointment Booking for CLS Booking — Public form styles.
 *
 * Minimal, themeable styles that work with any WordPress theme.
 * Uses BEM-like naming with .clsboco- prefix to avoid conflicts.
 */

/* Form container */
.clsboco-booking-form {
    max-width: 600px;
    margin: 0 auto;
}

/* Introduction Section */
.clsboco-booking-intro {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1.5rem;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.clsboco-booking-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.clsboco-booking-description {
    color: #6b7280;
    font-size: 1rem;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.clsboco-booking-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.clsboco-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.clsboco-feature-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.clsboco-feature-text {
    font-weight: 500;
}

.clsboco-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Field wrapper */
.clsboco-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.clsboco-field-row {
    display: flex;
    gap: 1rem;
}

.clsboco-field--half {
    flex: 1;
}

/* Labels */
.clsboco-label {
    font-weight: 600;
    font-size: 0.875rem;
}

.clsboco-required {
    color: #dc2626;
}

/* Inputs */
.clsboco-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.clsboco-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.clsboco-input--error {
    border-color: #dc2626;
}

.clsboco-input--error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

textarea.clsboco-input {
    resize: vertical;
    min-height: 80px;
}

select.clsboco-input {
    appearance: auto;
}

/* Field errors */
.clsboco-error {
    font-size: 0.8125rem;
    color: #dc2626;
    min-height: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.clsboco-error--visible {
    opacity: 1;
}

/* Form-level messages */
.clsboco-form-message {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-line; /* allow \n in API messages (e.g., alternative slots) */
}

.clsboco-form-message--success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.clsboco-form-message--error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Submit button */
.clsboco-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.clsboco-btn--primary {
    background-color: #2563eb;
    color: #fff;
}

.clsboco-btn--primary:hover {
    background-color: #1d4ed8;
}

.clsboco-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Privacy notice */
.clsboco-privacy-notice {
    padding: 0.5rem 0;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Notices (not connected / unavailable) */
.clsboco-notice {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    background-color: #fefce8;
    border: 1px solid #fde68a;
    color: #854d0e;
}

.clsboco-notice--error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.clsboco-notice--admin {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Services grid */
.clsboco-services--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.clsboco-services--list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.clsboco-service-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem;
    background-color: #fff;
    transition: box-shadow 0.15s ease;
}

.clsboco-service-card:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.clsboco-service-card__name {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.clsboco-service-card__desc {
    margin: 0 0 0.75rem;
    color: #4b5563;
    font-size: 0.9375rem;
}

.clsboco-service-card__meta {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.clsboco-service-card__features {
    list-style: none;
    margin: 0.75rem 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.clsboco-service-card__features li {
    padding: 0.125rem 0.5rem;
    background-color: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #374151;
}

/* Badges */
.clsboco-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.clsboco-badge--green {
    background-color: #dcfce7;
    color: #166534;
}

.clsboco-badge--gray {
    background-color: #f3f4f6;
    color: #6b7280;
}

.clsboco-badge--red {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Category summary */
.clsboco-categories-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.clsboco-category-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #fafafa;
    font-size: 0.875rem;
}

.clsboco-category-badge__name {
    font-weight: 600;
    color: #1f2937;
}

.clsboco-category-badge__count {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.clsboco-category-badge__count--available {
    background-color: #dcfce7;
    color: #166534;
}

.clsboco-category-badge__count--full {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Category headings in services list */
.clsboco-category-heading {
    margin: 1.5rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.375rem;
}

.clsboco-category-heading:first-child {
    margin-top: 0;
}

.clsboco-services-group {
    margin-bottom: 1.5rem;
}

/* Time slot loading state */
.clsboco-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f9fafb;
}

/* Visual Time Grid */
.clsboco-time-grid {
    margin-top: 0.5rem;
}

.clsboco-time-grid__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.clsboco-time-grid__slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.clsboco-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 4.5rem;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.3;
}

.clsboco-slot:hover:not(.clsboco-slot--disabled) {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.clsboco-slot__time {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #1f2937;
}

.clsboco-slot__avail {
    font-size: 0.6875rem;
    color: #6b7280;
}

/* Availability states */
.clsboco-slot--available {
    border-color: #86efac;
    background-color: #f0fdf4;
}

.clsboco-slot--limited {
    border-color: #fde68a;
    background-color: #fefce8;
}

.clsboco-slot--busy {
    border-color: #fed7aa;
    background-color: #fff7ed;
}

.clsboco-slot--full,
.clsboco-slot--disabled {
    border-color: #e5e7eb;
    background-color: #f9fafb;
    opacity: 0.5;
    cursor: not-allowed;
}

.clsboco-slot--full .clsboco-slot__time,
.clsboco-slot--disabled .clsboco-slot__time {
    color: #9ca3af;
    text-decoration: line-through;
}

/* Selected state */
.clsboco-slot--selected {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.clsboco-slot--selected .clsboco-slot__time {
    color: #2563eb;
}

/* When grid is active, hide the standard select */
.clsboco-field--grid-active select.clsboco-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

/* Responsive */
@media (max-width: 480px) {
    .clsboco-field-row {
        flex-direction: column;
        gap: 1rem;
    }

    .clsboco-services--grid {
        grid-template-columns: 1fr;
    }

    .clsboco-categories-summary {
        flex-direction: column;
    }

    .clsboco-slot {
        min-width: 3.75rem;
        padding: 0.25rem 0.375rem;
    }

    .clsboco-slot__time {
        font-size: 0.75rem;
    }

    .clsboco-slot__avail {
        font-size: 0.625rem;
    }
}

/* ═══════════════════════════════════════════════
   HORIZONTAL TIMELINE — Drag-to-Book Grid
   Rooms on Y-axis, Time on X-axis.
   ═══════════════════════════════════════════════ */

/* Step indicator */
.clsboco-step-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.clsboco-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background-color: #e5e7eb;
    color: #6b7280;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.clsboco-step--active {
    background-color: #2563eb;
    color: #fff;
}

.clsboco-step--done {
    background-color: #16a34a;
    color: #fff;
}

.clsboco-step-label {
    color: #9ca3af;
    font-weight: 500;
    transition: color 0.2s ease;
}

.clsboco-step-label--active {
    color: #1f2937;
    font-weight: 600;
}

.clsboco-step-label--done {
    color: #16a34a;
}

.clsboco-step-divider {
    flex: 0 0 2rem;
    height: 2px;
    background-color: #d1d5db;
    border-radius: 1px;
}

/* Grid wrapper */
/* Grid wrapper with enhanced styling */
.clsboco-grid-wrapper {
    margin-bottom: 1.5rem;
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

/* ── Horizontal Timeline container ── */
.clsboco-htl-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Scroll container — horizontal scroll for long timelines */
.clsboco-htl-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Inner grid — explicit width set by JS */
.clsboco-htl-grid {
    position: relative;
    min-width: 100%;
}

/* ── Time header row ── */
.clsboco-htl-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

/* Corner cell (top-left) */
.clsboco-htl-corner {
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    z-index: 20;
}

/* Time header track (holds time cells) */
.clsboco-htl-time-track {
    display: flex;
    flex: 0 0 auto;
}

/* Individual time cells in header */
.clsboco-htl-time-cell {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    border-left: 1px solid #f3f4f6;
    box-sizing: border-box;
    position: relative;
    background-color: #f8fafc;
    transition: background-color 0.2s ease;
}

.clsboco-htl-time-cell--hour {
    border-left: 1px solid #d1d5db;
}

.clsboco-htl-time-cell--half {
    border-left: 1px dashed #e5e7eb;
}

.clsboco-htl-time-text {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    line-height: 1;
}

.clsboco-htl-time-text--minor {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.625rem;
}

/* ── Room rows ── */
.clsboco-htl-row {
    display: flex;
    border-top: 1px solid #e5e7eb;
}

.clsboco-htl-row:first-of-type {
    border-top: none;
}

/* Room label (sticky left) */
.clsboco-htl-room-label {
    width: 140px;
    min-width: 140px;
    flex: 0 0 140px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background-color: #f8fafc;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    left: 0;
    z-index: 5;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-radius: 0.375rem 0 0 0.375rem;
}

.clsboco-htl-room-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.clsboco-htl-room-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clsboco-htl-room-cat {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.6875rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clsboco-htl-room-cap {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.625rem;
    flex-shrink: 0;
}

/* Cells track (holds the time cells for each room) */
.clsboco-htl-cells-track {
    display: flex;
    flex: 0 0 auto;
}

/* ── Time slot cells ── */
.clsboco-htl-cell {
    flex: 0 0 auto;
    box-sizing: border-box;
    border-left: 1px solid #f3f4f6;
    transition: background-color 0.08s ease;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.clsboco-htl-cell--hour-border {
    border-left: 1px solid #d1d5db;
}

/* Available — green, draggable */
.clsboco-htl-cell--available {
    background-color: #dcfce7;
    cursor: crosshair;
    border-radius: 2px;
}

.clsboco-htl-cell--available:hover {
    background-color: #bbf7d0;
    box-shadow: 0 0 0 2px #10b981;
}

/* Booked — solid red, blocked */
.clsboco-htl-cell--booked {
    background-color: #fee2e2;
    cursor: not-allowed;
    border-radius: 2px;
    opacity: 0.7;
}

/* Past — grey, blocked */
.clsboco-htl-cell--past {
    background-color: #f3f4f6;
    cursor: not-allowed;
    border-radius: 2px;
    opacity: 0.75;
}

/* Gap (setup/cleanup) — striped red, blocked */
.clsboco-htl-cell--gap {
    background-color: #fef2f2;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        rgba(239, 68, 68, 0.2) 3px,
        rgba(239, 68, 68, 0.2) 6px
    );
    cursor: not-allowed;
    border-radius: 2px;
    opacity: 0.8;
}

/* Dragging highlight — light blue during active drag */
.clsboco-htl-cell--dragging {
    background-color: #bfdbfe !important;
    box-shadow: inset 0 0 0 2px #3b82f6, 0 0 0 1px #3b82f6;
    transform: scale(1.05);
    z-index: 5;
    transition: all 0.1s ease;
}

/* Selected — confirmed blue highlight */
.clsboco-htl-cell--selected {
    background-color: #dbeafe !important;
    box-shadow: inset 0 0 0 2px #2563eb, 0 0 0 1px #2563eb;
    transform: scale(1.02);
    z-index: 3;
}

/* Conflict — yellow warning when drag overlaps booked/gap */
.clsboco-htl-cell--conflict {
    background-color: #fef3c7 !important;
    box-shadow: inset 0 0 0 1.5px #f59e0b;
    animation: clsboco-conflict-pulse 0.4s ease;
}

@keyframes clsboco-conflict-pulse {
    0%   { opacity: 0.7; }
    50%  { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Limited availability indicator (category mode) */
.clsboco-htl-cell--limited {
    background-color: #fefce8;
}

.clsboco-htl-cell--limited:hover {
    background-color: #fef08a;
}

/* Category count text inside cells */
.clsboco-htl-cat-count {
    font-size: 0.5rem;
    color: #374151;
    line-height: 48px;
    text-align: center;
    display: block;
    pointer-events: none;
}

/* ── Grid controls (selection info + confirm) ── */
.clsboco-grid-controls {
    padding: 1rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f8fafc;
    border-radius: 0 0 0.75rem 0.75rem;
}

.clsboco-htl-sel-info {
    font-size: 0.875rem;
    color: #1f2937;
    flex: 1;
    min-width: 200px;
}

.clsboco-htl-sel-info strong {
    color: #2563eb;
}

/* Conflict message */
.clsboco-grid-conflict {
    font-size: 0.8125rem;
    color: #b45309;
    background-color: #fef3c7;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    flex-basis: 100%;
}

/* Selection summary bar */
.clsboco-selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #1e40af;
}

.clsboco-selection-summary .clsboco-btn--link {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

.clsboco-selection-summary .clsboco-btn--link:hover {
    color: #1d4ed8;
}

/* Drag hint text below legend */
.clsboco-htl-drag-hint {
    width: 100%;
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 0.25rem;
}

/* ── Scroll indicators ── */
.clsboco-htl-scroll-wrap {
    position: relative;
}

.clsboco-htl-scroll-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clsboco-htl-scroll-indicator--visible {
    opacity: 1;
}

.clsboco-htl-scroll-indicator--right {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
}

.clsboco-htl-scroll-indicator--left {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
}

.clsboco-htl-scroll-indicator__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
    animation: clsboco-scroll-pulse 2s ease-in-out infinite;
}

@keyframes clsboco-scroll-pulse {
    0%, 100% { transform: translateX(0); opacity: 0.7; }
    50%      { transform: translateX(3px); opacity: 1; }
}

.clsboco-htl-scroll-indicator--left .clsboco-htl-scroll-indicator__chevron {
    animation: clsboco-scroll-pulse-left 2s ease-in-out infinite;
}

@keyframes clsboco-scroll-pulse-left {
    0%, 100% { transform: translateX(0); opacity: 0.7; }
    50%      { transform: translateX(-3px); opacity: 1; }
}

/* Scroll hint text below grid */
.clsboco-htl-scroll-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 0.375rem 0 0;
    transition: opacity 0.5s ease, max-height 0.5s ease;
    max-height: 2rem;
    overflow: hidden;
    opacity: 1;
}

.clsboco-htl-scroll-hint--hidden {
    opacity: 0;
    max-height: 0;
    padding: 0;
}

/* Legend */
.clsboco-grid-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0 0;
    font-size: 0.8125rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.clsboco-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.clsboco-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    border: 1px solid #d1d5db;
}

.clsboco-legend-swatch--available {
    background-color: #f0fdf4;
    border-color: #86efac;
}

.clsboco-legend-swatch--booked {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

.clsboco-legend-swatch--gap {
    background-color: #fef2f2;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 2px,
        rgba(239, 68, 68, 0.15) 2px,
        rgba(239, 68, 68, 0.15) 4px
    );
    border-color: #fca5a5;
}

.clsboco-legend-swatch--selected {
    background-color: #dbeafe;
    border-color: #3b82f6;
}

/* Grid state messages */
.clsboco-grid-loading,
.clsboco-grid-closed,
.clsboco-grid-empty,
.clsboco-grid-error {
    padding: 3rem 2rem;
    text-align: center;
    color: #6b7280;
    font-size: 1rem;
    border: 2px dashed #e5e7eb;
    border-radius: 0.75rem;
    margin: 1rem 0;
    background-color: #f8fafc;
    font-weight: 500;
}

.clsboco-grid-loading {
    color: #2563eb;
    position: relative;
}

.clsboco-grid-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: clsboco-spin 1s linear infinite;
    margin-right: 0.75rem;
    vertical-align: middle;
}

@keyframes clsboco-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.clsboco-grid-error {
    color: #dc2626;
    border-color: #fecaca;
    background-color: #fef2f2;
}

.clsboco-grid-closed {
    color: #b45309;
    border-color: #fde68a;
    background-color: #fefce8;
}

/* ═══ Responsive — Horizontal Timeline ═══ */

@media (max-width: 600px) {
    .clsboco-step-indicator {
        font-size: 0.8125rem;
        gap: 0.375rem;
    }

    .clsboco-step {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }

    .clsboco-step-divider {
        flex: 0 0 1rem;
    }

    .clsboco-htl-room-label {
        width: 90px;
        min-width: 90px;
        flex: 0 0 90px;
        padding: 0 6px;
        font-size: 0.6875rem;
    }

    .clsboco-htl-room-cap {
        display: none;
    }

    .clsboco-htl-time-text {
        font-size: 0.5625rem;
    }

    .clsboco-htl-time-text--minor {
        font-size: 0.5rem;
    }

    .clsboco-htl-cat-count {
        font-size: 0.4375rem;
    }

    .clsboco-grid-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 0.625rem 0.75rem;
    }

    .clsboco-htl-sel-info {
        font-size: 0.8125rem;
        min-width: 0;
        text-align: center;
    }

    .clsboco-grid-controls .clsboco-btn {
        width: 100%;
    }

    .clsboco-selection-summary {
        flex-direction: column;
        gap: 0.375rem;
        text-align: center;
    }

    .clsboco-grid-legend {
        gap: 0.5rem;
        font-size: 0.6875rem;
    }

    .clsboco-legend-swatch {
        width: 10px;
        height: 10px;
    }

    .clsboco-htl-scroll-indicator {
        width: 30px;
    }

    .clsboco-htl-scroll-indicator__chevron {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }

    .clsboco-htl-scroll-hint {
        font-size: 0.6875rem;
    }
}

@media (max-width: 380px) {
    .clsboco-htl-room-label {
        width: 70px;
        min-width: 70px;
        flex: 0 0 70px;
        padding: 0 4px;
        font-size: 0.625rem;
        gap: 3px;
    }

    .clsboco-htl-room-dot {
        width: 6px;
        height: 6px;
    }

    .clsboco-htl-time-text {
        font-size: 0.5rem;
    }

    .clsboco-htl-drag-hint {
        font-size: 0.6875rem;
    }
}

/* ═══════════════════════════════════════════════
   VIEW TOGGLE — Horizontal / Vertical switch
   ═══════════════════════════════════════════════ */

.clsboco-view-toggle {
    display: inline-flex;
    gap: 2px;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    padding: 2px;
    margin-bottom: 0.5rem;
}

.clsboco-view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: none;
    border-radius: 0.25rem;
    background-color: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    padding: 0;
    font-family: inherit;
}

.clsboco-view-toggle-btn:hover {
    background-color: #e5e7eb;
    color: #374151;
}

.clsboco-view-toggle-btn--active {
    background-color: #fff;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.clsboco-view-toggle-btn--active:hover {
    background-color: #fff;
    color: #2563eb;
}

.clsboco-view-toggle-btn svg {
    display: block;
}

/* ═══════════════════════════════════════════════
   VERTICAL TIMELINE — Drag-to-Book Grid
   Rooms as columns, Time flows top→bottom.
   ═══════════════════════════════════════════════ */

.clsboco-vtl-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #fff;
}

.clsboco-vtl-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 520px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.clsboco-vtl-grid {
    position: relative;
    min-width: 100%;
}

/* ── Room header row (sticky top) ── */
.clsboco-vtl-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.clsboco-vtl-corner {
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    z-index: 20;
    width: 64px;
    min-width: 64px;
    flex: 0 0 64px;
    box-sizing: border-box;
}

.clsboco-vtl-room-col-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    border-left: 1px solid #e5e7eb;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.clsboco-vtl-room-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    flex-shrink: 0;
}

.clsboco-vtl-room-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clsboco-vtl-room-cat {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.625rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clsboco-vtl-room-cap {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.625rem;
    flex-shrink: 0;
}

/* ── Time rows ── */
.clsboco-vtl-row {
    display: flex;
    border-top: 1px solid #f3f4f6;
}

.clsboco-vtl-row--hour {
    border-top: 1px solid #d1d5db;
}

/* Time label (sticky left) */
.clsboco-vtl-time-label {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 8px 0 4px;
    background-color: #fff;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    left: 0;
    z-index: 5;
    font-size: 0.6875rem;
    box-sizing: border-box;
}

.clsboco-vtl-time-text {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    line-height: 1;
}

.clsboco-vtl-time-text--minor {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.625rem;
}

/* ── Vertical cells ── */
.clsboco-vtl-cell {
    flex: 0 0 auto;
    box-sizing: border-box;
    border-left: 1px solid #e5e7eb;
    transition: background-color 0.08s ease;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.clsboco-vtl-cell--hour-border {
    border-top: 1px solid #d1d5db;
}

.clsboco-vtl-cell--available {
    background-color: #f0fdf4;
    cursor: crosshair;
}

.clsboco-vtl-cell--available:hover {
    background-color: #bbf7d0;
}

.clsboco-vtl-cell--booked {
    background-color: #fee2e2;
    cursor: not-allowed;
}

.clsboco-vtl-cell--past {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.8;
}

.clsboco-vtl-cell--gap {
    background-color: #fef2f2;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        rgba(239, 68, 68, 0.15) 3px,
        rgba(239, 68, 68, 0.15) 6px
    );
    cursor: not-allowed;
}

.clsboco-vtl-cell--dragging {
    background-color: #bfdbfe !important;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.clsboco-vtl-cell--selected {
    background-color: #dbeafe !important;
    box-shadow: inset 0 0 0 1.5px #3b82f6;
}

.clsboco-vtl-cell--conflict {
    background-color: #fef3c7 !important;
    box-shadow: inset 0 0 0 1.5px #f59e0b;
    animation: clsboco-conflict-pulse 0.4s ease;
}

/* ═══ Responsive — Vertical Timeline ═══ */

@media (max-width: 600px) {
    .clsboco-vtl-room-col-header {
        font-size: 0.6875rem;
        padding: 6px 4px;
    }

    .clsboco-vtl-room-cap {
        display: none;
    }

    .clsboco-vtl-time-label {
        font-size: 0.5625rem;
        padding: 0 4px 0 2px;
    }

    .clsboco-vtl-time-text--minor {
        font-size: 0.5rem;
    }

    .clsboco-view-toggle {
        margin-bottom: 0.375rem;
    }
}

@media (max-width: 380px) {
    .clsboco-vtl-room-col-header {
        font-size: 0.625rem;
        padding: 4px 2px;
        gap: 2px;
    }

    .clsboco-vtl-room-dot {
        width: 6px;
        height: 6px;
    }

    .clsboco-vtl-time-text {
        font-size: 0.5rem;
    }
}
