/* Trip date & time picker: centred modal on desktop, bottom sheet on phones. */
.ys-trip-picker {
    position: fixed;
    inset: 0;
    z-index: 11050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 27, 51, .5);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ys-trip-picker.is-open {
    display: flex;
}

body.ys-date-time-sheet-open {
    overflow: hidden;
}

.ys-trip-picker button {
    font-family: inherit;
}

.ys-trip-picker__panel {
    width: 100%;
    max-width: 780px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    color: #0F1B33;
    background: #FFFFFF;
    border: 1px solid #E3E8F2;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 27, 51, .16);
}

.ys-trip-picker__grab {
    display: none;
}

.ys-trip-picker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 12px 24px;
    border-bottom: 1px solid #EDF1F7;
    font-size: 18px;
    font-weight: 800;
}

.ys-trip-picker__close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: #1B3566;
    background: #F1F4F9;
    cursor: pointer;
}

.ys-trip-picker__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    overflow-y: auto;
}

.ys-trip-picker__cal {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
    border-right: 1px solid #EDF1F7;
}





.ys-trip-picker__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ys-trip-picker__month {
    font-size: 16px;
    font-weight: 700;
}

.ys-trip-picker__arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #DCE3EE;
    border-radius: 10px;
    color: #1B3566;
    background: #FFFFFF;
    cursor: pointer;
}

.ys-trip-picker__arrow:disabled {
    color: #C3C9D4;
    cursor: default;
}

.ys-trip-picker__dow,
.ys-trip-picker__days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ys-trip-picker__dow span {
    padding-bottom: 4px;
    color: #5B6478;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.ys-trip-picker__days {
    /* Always six week rows so the popup height never changes between months. */
    grid-template-rows: repeat(6, 42px);
    row-gap: 4px;
    justify-items: center;
    align-items: center;
}

.ys-trip-picker__blank {
    height: 42px;
}

.ys-trip-picker__day {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: #0F1B33;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.ys-trip-picker__day:hover:not(:disabled):not(.is-selected) {
    background: #EEF2F8;
}

.ys-trip-picker__day.is-today {
    color: #2563EB;
    font-weight: 700;
    border: 1.5px solid #2563EB;
}

.ys-trip-picker__day.is-selected {
    color: #FFFFFF;
    background: #1B3566;
    border: 0;
    font-weight: 700;
}

.ys-trip-picker__day:disabled {
    color: #B4BBC8;
    border: 0;
    text-decoration: line-through;
    cursor: default;
}

.ys-trip-picker__time {
    width: 380px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 22px;
    background: #FAFBFD;
    /* The calendar sets the popup height; this column never grows it. */
    contain: size;
    overflow-y: auto;
}


















.ys-trip-picker__clock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border-radius: 14px;
    color: #FFFFFF;
    background: linear-gradient(90deg, #16294D, #22508F);
}

.ys-trip-picker__clock-label {
    color: rgba(255, 255, 255, .78);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ys-trip-picker__clock-value {
    margin-top: 1px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
}

.ys-trip-picker__ampm {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
}

.ys-trip-picker__ampm .ys-trip-picker__cell {
    width: 46px;
    height: 34px;
    border: 0;
    color: rgba(255, 255, 255, .85);
    background: transparent;
}

.ys-trip-picker__ampm .ys-trip-picker__cell.is-selected {
    color: #1B3566;
    background: #FFFFFF;
}

.ys-trip-picker__ampm .ys-trip-picker__cell:disabled {
    color: rgba(255, 255, 255, .4);
    background: transparent;
    text-decoration: line-through;
}

.ys-trip-picker__label {
    margin-bottom: -6px;
    color: #5B6478;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ys-trip-picker__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.ys-trip-picker__cell {
    height: 38px;
    padding: 0;
    border: 1px solid #DCE3EE;
    border-radius: 10px;
    color: #0F1B33;
    background: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.ys-trip-picker__cell:hover:not(:disabled):not(.is-selected) {
    border-color: #1B3566;
}

.ys-trip-picker__cell.is-selected {
    color: #FFFFFF;
    background: #1B3566;
    border-color: #1B3566;
}

.ys-trip-picker__cell:disabled {
    color: #B4BBC8;
    background: #F1F3F7;
    border-color: #F1F3F7;
    cursor: default;
}

.ys-trip-picker__note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #F7DDB8;
    border-radius: 10px;
    color: #4A5568;
    background: #FFF6EA;
    font-size: 12px;
    line-height: 1.45;
}

.ys-trip-picker__note[hidden],
.ys-trip-picker__warn[hidden] {
    display: none;
}

.ys-trip-picker__note svg {
    flex-shrink: 0;
}

.ys-trip-picker__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid #EDF1F7;
    background: #FFFFFF;
}

.ys-trip-picker__summary {
    font-size: 14px;
    font-weight: 600;
}

.ys-trip-picker__warn {
    margin-top: 4px;
    color: #B45309;
    font-size: 12px;
}

.ys-trip-picker__actions {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
}

.ys-trip-picker__reset,
.ys-trip-picker__done {
    height: 48px;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
}

.ys-trip-picker__reset {
    padding: 0 20px;
    border: 1px solid #DCE3EE;
    color: #1B3566;
    background: #FFFFFF;
    font-weight: 600;
}

.ys-trip-picker__done {
    padding: 0 28px;
    border: 0;
    color: #FFFFFF;
    background: linear-gradient(90deg, #16294D, #22508F);
    font-weight: 700;
}

.ys-trip-picker button:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .ys-trip-picker {
        align-items: flex-end;
        padding: 0;
    }

    /* Full screen on phones; the calendar and time scroll inside it when the screen is short. */
    .ys-trip-picker__panel {
        max-width: none;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .ys-trip-picker__head {
        padding: max(10px, env(safe-area-inset-top)) 12px 10px 16px;
        border-bottom: 1px solid #EDF1F7;
    }

    .ys-trip-picker__body {
        height: auto;
        flex-direction: column;
    }

    .ys-trip-picker__cal {
        flex: none;
        gap: 6px;
        padding: 8px 16px 0;
        border-right: 0;
    }

    /* Only the weeks the month needs, so no empty row above the time card. */
    .ys-trip-picker__days {
        grid-template-rows: none;
        grid-auto-rows: 36px;
        row-gap: 2px;
    }

    .ys-trip-picker__blank {
        height: 36px;
    }

    .ys-trip-picker__day {
        width: 34px;
        height: 34px;
    }

    .ys-trip-picker__time {
        flex: none;
        contain: none;
        overflow: visible;
        width: auto;
        gap: 10px;
        padding: 10px 16px 12px;
        background: #FFFFFF;
    }

    /* Compact sizes so the time choices fit under a six-week month. */
    .ys-trip-picker__close {
        width: 38px;
        height: 38px;
    }

    .ys-trip-picker__arrow {
        width: 36px;
        height: 36px;
    }

    .ys-trip-picker__clock {
        padding: 8px 10px 8px 14px;
    }

    .ys-trip-picker__clock-value {
        font-size: 22px;
    }

    .ys-trip-picker__ampm .ys-trip-picker__cell {
        height: 30px;
    }

    .ys-trip-picker__cell {
        height: 36px;
    }

    .ys-trip-picker__foot {
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
        padding: 10px 16px max(12px, env(safe-area-inset-bottom));
        box-shadow: 0 -4px 16px rgba(15, 27, 51, .06);
    }

    .ys-trip-picker__reset,
    .ys-trip-picker__done {
        height: 44px;
    }

    .ys-trip-picker__actions .ys-trip-picker__reset {
        flex: 1 1 auto;
    }

    .ys-trip-picker__actions .ys-trip-picker__done {
        flex: 2 1 auto;
    }
}

/* Short phones: hours and minutes become one swipeable row each so they stay on screen. */
@media (max-width: 768px) and (max-height: 760px) {
    .ys-trip-picker__grid {
        position: relative;
        display: flex;
        gap: 6px;
        margin: 0 -16px;
        padding: 0 16px 2px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-padding: 0 16px;
    }

    .ys-trip-picker__grid::-webkit-scrollbar {
        display: none;
    }

    .ys-trip-picker__grid .ys-trip-picker__cell {
        flex: 0 0 52px;
    }
}
