.regal-cal-root {
    font-family: inherit;
    margin: 1.5em 0;
    color: inherit;
}

.regal-cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75em;
    gap: 0.5em;
}

.regal-cal-nav button {
    padding: 6px 14px;
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #222 !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    line-height: normal;
    font-family: inherit;
}

.regal-cal-nav button:hover {
    background: #f2f2f2;
}

.regal-cal-nav button:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 1px;
}

.regal-cal-label {
    font-weight: 600;
}

.regal-cal-status {
    margin-bottom: 0.75em;
    font-size: 0.9em;
}

.regal-cal-status.error {
    color: #a94442;
}

.regal-cal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.regal-cal-table {
    width: 100%;
    min-width: 640px; /* below this, columns become unreadable - switch to the mobile day list instead */
    border-collapse: collapse;
    table-layout: fixed;
}

.regal-cal-table th,
.regal-cal-table td {
    border: 1px solid #e5e5e5;
    padding: 6px;
    vertical-align: top;
    font-size: 0.85em;
    text-align: left;
}

.regal-cal-table th {
    background: #fafafa;
    font-weight: 600;
}

.regal-room-col {
    width: 100px;
    font-weight: 600;
    background: #fafafa;
    position: sticky;
    left: 0;
    z-index: 1;
}

/* Booking Cards (shared by table + mobile list) */
.regal-booking {
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 4px;
    border-left: 4px solid #888888; /* 4px solid border for prominent room color display */
}

.regal-booking:last-child {
    margin-bottom: 0;
}

.regal-booking.confirmed {
    background: #e6f4ea;
    border-left-color: #34a853; /* Fallback if no inline color is present */
}

.regal-booking.requested {
    background: #fef7e0;
    border-left-color: #f9ab00; /* Fallback if no inline color is present */
}

.regal-booking-time {
    font-weight: 600;
}

/* ── Mobile day-by-day view ─────────────────────────────────────────────
   Hidden on desktop; the table above is the primary view there. Below the
   breakpoint the table is hidden and this stacked, vertically-scrolling
   list takes over so nothing gets squished or needs sideways scrolling. */
.regal-cal-mobile {
    display: none;
}

.regal-day {
    margin-bottom: 0.9em;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.regal-day-head {
    padding: 8px 12px;
    background: #fafafa;
    font-weight: 600;
    font-size: 0.95em;
    border-bottom: 1px solid #e5e5e5;
}

.regal-day.is-today .regal-day-head {
    background: #eaf1fb;
    box-shadow: inset 3px 0 0 #1a73e8;
}

.regal-day.is-today .regal-day-head::after {
    content: "Today";
    float: right;
    font-weight: 600;
    font-size: 0.75em;
    color: #1a73e8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.regal-day-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.regal-day-empty {
    padding: 12px;
    color: #999;
    font-size: 0.88em;
    font-style: italic;
}

/* On mobile the room name isn't a row label anymore, so surface it on the card */
.regal-booking-room {
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.regal-booking-badge {
    font-weight: 600;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #8a6d00;
    white-space: nowrap;
}

.regal-day-body .regal-booking {
    padding: 8px 10px;
    font-size: 0.92em;
}

.regal-day-body .regal-booking-time {
    font-size: 0.86em;
    opacity: 0.85;
    margin: 1px 0 2px;
}

@media (prefers-reduced-motion: reduce) {
    .regal-cal-root * {
        transition: none !important;
    }
}

/* Switch layouts where the grid would otherwise overflow the viewport. */
@media (max-width: 640px) {
    .regal-cal-table-wrap {
        display: none;
    }

    .regal-cal-mobile {
        display: block;
    }

    .regal-cal-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.4em 0.75em;
    }

    .regal-cal-label {
        order: -1;
        width: 100%;
        text-align: center;
    }

    .regal-cal-nav button {
        padding: 6px 12px;
        font-size: 0.85em;
        flex: 1;
        min-width: 0;
    }
}
