/* Ease picker override */
 :host{
    --color-fg-primary: #333;
    --color-bg-inrange:#dadada;
    --color-bg-locked: #c3c4c7;
    --day-width: 42px;
    --day-height: 37px;
 }

/* Core grid layout (fallback if bundle index.css fails to load in shadow root) */
.calendars {
    display: grid;
}

/* Inline calendar shortcode: fill containing block, no popup shadow */
.container.avchk-inline-calendar-embed.inline {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: none !important;
}
.container.avchk-inline-calendar-embed.inline > main {
    width: 100%;
    box-sizing: border-box;
}

/* Multi-month inline: full width; horizontal scroll (~3 months visible) */
.container.avchk-multi-month-scroll.inline {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: none !important;
}
.container.avchk-multi-month-scroll > main {
    width: 100%;
    background: transparent;
    padding: 0;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.container.avchk-multi-month-scroll .calendars {
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
}
.container.avchk-multi-month-scroll.avchk-rolling-3m-gap .calendars {
    column-gap: 12px;
    row-gap: 12px;
}
.container.avchk-multi-month-scroll .calendars > .calendar {
    background: var(--color-bg-default, #fff);
    border-radius: 6px;
    box-sizing: border-box;
}
.calendar > .daynames-row,
.calendar > .days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 2px;
}
.calendar > .days-grid > .day {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: var(--day-height);
    min-width: var(--day-width);
}

/* Selectable (available) nights */
.container .day:not(.locked):not(.not-available):not(.avchk-day-pending) {
    color: #000;
    font-weight: 600;
}
.container {
    position: relative;
    transition: transform 150ms ease-out 0ms;
    font-family: inherit;
}

@media (max-width: 768px) {
    .container.avchk-inline-calendar-embed.inline {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Multi-month on mobile: vertical peek scroll inside main (one month + hint of next) */
    .container.avchk-inline-calendar-embed.avchk-multi-month-mobile-peek.inline > main {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    .container.avchk-inline-calendar-embed.avchk-multi-month-mobile-peek .calendars {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        grid-template-columns: 1fr !important;
    }
    .container.avchk-inline-calendar-embed.avchk-multi-month-mobile-peek .calendars > .calendar {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    .container.avchk-inline-calendar-embed.avchk-multi-month-mobile-peek .calendars > .calendar:nth-child(n) {
        display: block !important;
    }

    /*
     * Inline calendar (single month + mobile peek multi-month): square day cells.
     */
    .container.avchk-inline-calendar-embed.inline:not(.avchk-multi-month-scroll) .calendar,
    .container.avchk-inline-calendar-embed.inline.avchk-multi-month-mobile-peek .calendar {
        padding: 8px 4px;
        width: 100% !important;
        max-width: 100% !important;
    }
    .container.avchk-inline-calendar-embed.inline:not(.avchk-multi-month-scroll) .calendar > .daynames-row,
    .container.avchk-inline-calendar-embed.inline:not(.avchk-multi-month-scroll) .calendar > .days-grid,
    .container.avchk-inline-calendar-embed.inline.avchk-multi-month-mobile-peek .calendar > .daynames-row,
    .container.avchk-inline-calendar-embed.inline.avchk-multi-month-mobile-peek .calendar > .days-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        column-gap: 3px;
        row-gap: 3px;
    }
    .container.avchk-inline-calendar-embed.inline:not(.avchk-multi-month-scroll) .calendar > .days-grid,
    .container.avchk-inline-calendar-embed.inline.avchk-multi-month-mobile-peek .calendar > .days-grid {
        min-height: unset;
    }
    .container.avchk-inline-calendar-embed.inline:not(.avchk-multi-month-scroll) .calendar > .days-grid > .day,
    .container.avchk-inline-calendar-embed.inline.avchk-multi-month-mobile-peek .calendar > .days-grid > .day {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: 1 / 1;
        padding: 0;
        font-size: clamp(12px, 3.2vw, 15px);
    }
    .container.avchk-inline-calendar-embed.inline:not(.avchk-multi-month-scroll) .calendar > .daynames-row > .dayname,
    .container.avchk-inline-calendar-embed.inline.avchk-multi-month-mobile-peek .calendar > .daynames-row > .dayname {
        padding: 4px 0;
        font-size: 11px;
    }
}

/* Keep calendar block fixed height so arrows stay put when months have 5 vs 6 rows */
.calendars .calendar > .days-grid {
    min-height: calc(6 * var(--day-height, 37px) + 5 * 2px);
}
@media (max-width: 480px) {
    /* Mobile: day cells use height:auto (larger for touch), need taller min-height */
    .calendars .calendar > .days-grid {
        min-height: calc(6 * 48px + 5 * 2px);
    }
    .container.avchk-inline-calendar-embed.inline:not(.avchk-multi-month-scroll) .calendars .calendar > .days-grid,
    .container.avchk-inline-calendar-embed.inline.avchk-multi-month-mobile-peek .calendars .calendar > .days-grid {
        min-height: unset;
    }
}

/* Availability not loaded yet: dim, no diagonal sold hatch */
.container .day.avchk-day-pending:not(.locked) {
    opacity: 0.45;
    color: #666;
    font-weight: 400;
    pointer-events: none;
    cursor: default;
}

.container.avchk-calendar-pending .day.avchk-day-pending.locked {
    opacity: 0.45;
}

.avchk-calendar-loading {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 100%;
    background: transparent;
    pointer-events: none;
    border-radius: inherit;
    box-sizing: border-box;
}

.avchk-calendar-loading__text {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.03em;
    text-align: center;
}

/* Booked nights: strikethrough instead of Easepick diagonal hatch (match LockPlugin specificity) */
.container.lock-plugin.avchk-blocked-date-style-strikethrough .calendar > .days-grid > .day.locked {
    border: none;
    background-color: transparent;
}
.container.lock-plugin.avchk-blocked-date-style-strikethrough .calendar > .days-grid > .day.locked:not(.start):not(.end) {
    background-image: none;
    font-style: normal;
    text-decoration: line-through;
    color: var(--color-fg-muted, #9e9e9e);
    font-weight: 500;
}