#scheduler {
    border-radius: 5px;
    z-index: 120;
    width: 100%;
}

#scheduler.loading {
    pointer-events: none;
}

#scheduler .card-content {
    overflow-y: auto;
    max-height: calc(100% - 48px - 50px);
    /* minus card header & footer */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Hide the social-proof toast while the scheduler is open — its huge z-index
   otherwise covers the Book It footer on mobile */
html.scheduler-open #buzzfeed {
    display: none !important;
}

.select2-container--default .select2-selection--single {
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 3px #ddd;
    height: 36px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    height: 36px;
    text-align: left;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 8px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
    background-color: #47af20;
}

.timeslot>.button {
    min-width: 92px;
    margin-bottom: 5px;
    box-shadow: 0px 0px 2px #47af20;
    color: #47af20;
    text-transform: none;
}

.timeslot>.button:hover:not(.disabled):not(.selected) {
    background-color: #effaf5;
}

.timeslot>.button.selected {
    background-color: #47af20;
    border-color: transparent;
    color: #FFF;
}

#butScheduleOpen {
    transition: transform 250ms;
    margin-top: 20px;
}

#butScheduleOpen.poof {
    transform: scale3d(0, 0, 0);
    position: absolute;
}

.timeslot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: #6d6d6d;
    box-shadow: none;
}

/* mobile week nav (prev/next buttons above and below the slot list) —
   desktop uses the flanking chevrons instead */
.timeslot-weeknav {
    display: none;
}

@media screen and (max-width: 768px) {
    #scheduler {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        /* dvh: don't let the browser URL bar swallow the footer CTA */
        transform: translateY(100%);
        transition: transform 300ms ease;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        pointer-events: none;
    }

    #scheduler.open {
        transform: translateY(0);
        pointer-events: all;
    }

    /* lock the page behind the fullscreen scheduler */
    html.scheduler-open,
    html.scheduler-open body {
        overflow: hidden;
    }

    #scheduler .card-header {
        flex: 0 1 auto;
        padding-top: env(safe-area-inset-top);
    }

    #scheduler .card-content {
        flex: 1 0 auto;
        height: 0;
        max-height: unset;
    }

    #scheduler .card-footer {
        flex: 0 1 auto;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* flanking chevrons are too small to tap and unreachable once the
       stacked day list is scrolled — the weeknav buttons replace them */
    #scheduler .timeslot-nav {
        display: none;
    }

    .timeslot-weeknav {
        display: flex;
        gap: 8px;
        padding: 4px 0 12px;
    }

    .timeslot-weeknav-bottom {
        padding: 12px 0 4px;
    }

    .timeslot-weeknav .button {
        flex: 1;
        box-shadow: 0px 0px 2px #47af20;
        color: #47af20;
        text-transform: none;
    }

    .timeslot-weeknav [data-page^="-"] {
        visibility: hidden;
    }

    /* the template's inline overflow-x:auto breaks position:sticky; columns
       are stacked on mobile so horizontal overflow can't happen anyway */
    #timeslotTable .columns {
        overflow-x: visible !important;
    }

    /* day headers stay visible while scrolling that day's slots
       (#scheduler prefix outranks the base .timeslot-header rule below) */
    #scheduler .timeslot-header {
        position: sticky;
        top: 0;
        background: var(--scheduler-surface, #fff);
        z-index: 2;
    }

    /* comfortable touch targets */
    .timeslot>.button {
        min-height: 44px;
    }
}

#scheduler .card-footer .card-footer-item.is-active {
    background-color: #47af20;
    color: white !important;
}

#scheduler input.invalid {
    box-shadow: 0 0 0 0.125em rgb(241 70 104 / 25%);
    /* is-danger from bulma */
}

.timeslot-header {
    position: relative;
}

.timeslot-header .dayhint {
    position: absolute;
    right: 2px;
    bottom: 6px;
}

/* timeslot grid: chevrons flanking columns */
.timeslot-grid {
    display: flex;
    align-items: flex-start;
}

.timeslot-columns {
    flex: 1;
    min-width: 0;
}

.timeslot-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    flex-shrink: 0;
    color: #999;
    transition: color 150ms;
}

.timeslot-nav:hover {
    color: #47af20;
    background-color: #effaf5;
}

.timeslot-nav-prev {
    margin-right: -28px;
    z-index: 1;
}

.timeslot-nav-next {
    margin-left: -28px;
    z-index: 1;
}

/* height matches the 3 header rows (hint + day + date) */
.timeslot-header {
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.timeslot-nav {
    height: calc(1.5em + 1em + 8px);
    /* day + date + padding/margin */
}

/* disabled prev (page < 0) */
.timeslot-nav[data-page^="-"] {
    visibility: hidden;
}

#schedulerForm .iti__country-list {
    position: absolute;
}

#timeslotTable {
    min-height: 403px;
}
