/* Calendar design aligned with ab-machupicchu-tickets */
.ably_calendar_wrapper {
    max-width: 1500px;
    width: 100%;
    margin: 24px auto;
    padding: 22px 22px 20px;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    background: #fff;
    color: #1e293b;
    font-family: inherit;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.ably_calendar_wrapper,
.ably_calendar_wrapper * {
    box-sizing: border-box;
}

.ably_calendar_wrapper p {
    margin: 0;
}

.ably_calendar_wrapper a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.ably_hidden {
    display: none !important;
}

.ably_calendar_wrapper button,
.ably_calendar_wrapper select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: normal;
    text-transform: none;
    box-shadow: none;
    margin: 0;
}

.ably_board {
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    background: transparent;
}

.ably_toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
}

.ably_selectors {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 280px;
}

.ably_selector_field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
}

.ably_selector_field:focus-within {
    z-index: 2;
    border-color: #64748b;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.ably_selector_icon {
    display: inline-flex;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.ably_selector_icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.ably_tour_picker {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.ably_calendar_wrapper .ably_select_service {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 38px;
    padding: 0 22px 0 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    color: #1e293b;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 38px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.ably_calendar_wrapper .ably_select_service:focus {
    outline: none;
}

.ably_select_chevron {
    position: absolute;
    top: 50%;
    right: 0;
    width: 15px;
    height: 15px;
    pointer-events: none;
    fill: none;
    stroke: #1e293b;
    stroke-width: 2.5;
    transform: translateY(-50%);
}

.ably_month_grid_row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.ably_calendar_wrapper .ably_month_nav_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid #d5dbe3;
    border-radius: 50%;
    background: #f8fafc;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.ably_calendar_wrapper .ably_month_nav_btn:hover:not(:disabled) {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.ably_calendar_wrapper .ably_month_nav_btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ably_month_select_panel {
    width: 100%;
    min-width: 0;
    padding: 14px 16px 16px;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    background: #fff;
}

.ably_month_select_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ably_month_select_label {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ably_year_tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: #f1f5f9;
    flex: 0 0 auto;
}

.ably_calendar_wrapper .ably_year_tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    padding: 7px 14px;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.ably_calendar_wrapper .ably_year_tab.is-active {
    background: #0f172a;
    color: #fff;
}

.ably_year_tab_dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    flex: 0 0 auto;
}

.ably_month_grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.ably_calendar_wrapper .ably_month_tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 10px 4px;
    border: 1px solid #e7ebf1;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.ably_calendar_wrapper .ably_month_tile:hover {
    border-color: #cbd5e1;
}

.ably_month_tile_name {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ably_month_tile_count {
    font-size: 11px;
    font-weight: 800;
    color: #16a34a;
    min-height: 14px;
}

.ably_calendar_wrapper .ably_month_tile.is-zero .ably_month_tile_count {
    color: #cbd5e1;
}

.ably_calendar_wrapper .ably_month_tile.is-active {
    background: #0f172a;
    border-color: #0f172a;
}

.ably_calendar_wrapper .ably_month_tile.is-active .ably_month_tile_name,
.ably_calendar_wrapper .ably_month_tile.is-active .ably_month_tile_count {
    color: #fff;
}

.ably_calendar_wrapper .ably_month_tile:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ably_month_summary {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
    color: #166534;
    text-align: center;
}

.ably_month_summary.is-visible {
    display: flex;
}

.ably_month_overview_icon {
    display: inline-flex;
    flex: 0 0 auto;
    color: #16a34a;
}

.ably_month_overview_icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.ably_month_overview_copy {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
}

.ably_month_overview_label {
    color: #14532d;
    font-size: 12px;
    font-weight: 700;
}

.ably_month_overview_text {
    color: #14532d;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.ably_month_overview_count {
    color: #16a34a;
    font-weight: 800;
}

.ably_day_names {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 8px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.ably_weekday_short {
    display: none;
}

.ably_calendar_grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    position: relative;
    min-height: 300px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.ably_calendar_grid.ably_grid_loading {
    opacity: 0;
    transform: translateY(6px);
}

.ably_day_cell {
    position: relative;
    display: flex;
    min-height: 124px;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.ably_hover_tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    padding: 5px 10px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 0) scale(0.94);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.ably_hover_tooltip.is-visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.ably_day_link,
.ably_day_link:hover {
    color: inherit;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.ably_day_link:hover .ably_status_text {
    text-decoration: underline;
}

.ably_day_link:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 1px;
}

.ably_day_empty {
    visibility: hidden;
}

.ably_cell_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    padding: 0 9px;
    border-bottom: 1px solid #e5e7eb;
    background: #f3f4f6;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.ably_cell_header svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.ably_cell_body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px 12px;
}

.ably_day_status_row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.ably_day_number_val {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.ably_status_icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.ably_status_text {
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
}

.ably_day_cell.ably_status_available .ably_cell_header {
    border-bottom-color: #bbf7d0;
    background: #ecfdf5;
    color: #047857;
}

.ably_day_cell.ably_status_available .ably_day_number_val,
.ably_day_cell.ably_status_available .ably_status_text,
.ably_day_cell.ably_status_available .ably_status_icon {
    color: #059669;
}

.ably_day_cell.ably_status_low {
    border-color: #fed7aa;
    background: #fff7ed;
}

.ably_day_cell.ably_status_low .ably_cell_header {
    border-bottom-color: #fed7aa;
    background: #ffedd5;
    color: #c2410c;
}

.ably_day_cell.ably_status_low .ably_day_number_val,
.ably_day_cell.ably_status_low .ably_status_text,
.ably_day_cell.ably_status_low .ably_status_icon {
    color: #ea580c;
}

.ably_day_cell.ably_status_soldout {
    border-color: #fecaca;
    background: #fff5f5;
}

.ably_day_cell.ably_status_soldout .ably_cell_header {
    border-bottom-color: #fecaca;
    background: #fee2e2;
    color: #b91c1c;
}

.ably_day_cell.ably_status_soldout .ably_day_number_val,
.ably_day_cell.ably_status_soldout .ably_status_text,
.ably_day_cell.ably_status_soldout .ably_status_icon {
    color: #dc2626;
}

.ably_day_cell.ably_status_blocked {
    border-color: #e5e7eb;
    background: #f8fafc;
    cursor: not-allowed;
}

.ably_day_cell.ably_status_blocked .ably_cell_header {
    border-bottom-color: #e2e8f0;
    background: #eef2f7;
    color: #94a3b8;
}

.ably_day_cell.ably_status_blocked .ably_day_number_val,
.ably_day_cell.ably_status_blocked .ably_status_text,
.ably_day_cell.ably_status_blocked .ably_status_icon {
    color: #94a3b8;
}

.ably_day_cell.ably_status_accent:not(.ably_status_blocked) {
    box-shadow: 0 0 0 2px #16a34a;
}

.ably_spaces_legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.ably_spaces_legend_items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.ably_spaces_legend_item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ably_spaces_legend_swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
    border: 0;
}

.ably_spaces_legend_available {
    background: #059669;
}

.ably_spaces_legend_low {
    background: #ea580c;
}

.ably_spaces_legend_soldout {
    background: #dc2626;
}

.ably_spaces_legend_blocked {
    background: #cbd5e1;
}

.ably_loader_overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 8px;
}

.ably_spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #16a34a;
    border-radius: 50%;
    animation: ably_spin 1s linear infinite;
}

@keyframes ably_spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ably_shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.ably_skeleton_cell {
    min-height: 124px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    position: relative;
}

.ably_skeleton_cell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: ably_shimmer 1.2s infinite;
}

.ably_skeleton_header {
    height: 22px;
    margin: 8px;
    border-radius: 4px;
    background: #e2e8f0;
}

.ably_skeleton_body {
    display: flex;
    min-height: 70px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ably_skeleton_circle {
    width: 30px;
    height: 18px;
    border-radius: 5px;
    background: #e2e8f0;
}

.ably_skeleton_line {
    width: 45px;
    height: 10px;
    border-radius: 5px;
    background: #e2e8f0;
}

.ably_plan_branding {
    margin-top: 18px;
    padding: 12px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
}

.ably_plan_branding a {
    color: #059669;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.ably_plan_branding a:hover,
.ably_plan_branding a:focus {
    color: #047857;
    text-decoration: underline;
}

.ably_plan_branding_upgrade {
    color: #0369a1;
    text-decoration: none;
}

.ably_plan_branding_upgrade:hover,
.ably_plan_branding_upgrade:focus {
    color: #0c4a6e;
    text-decoration: underline;
}

@media (max-width: 680px) {
    .ably_calendar_wrapper {
        margin: 12px 0;
        padding: 12px 10px 14px;
        border-radius: 12px;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
    }

    .ably_calendar_wrapper,
    .ably_board,
    .ably_toolbar,
    .ably_selectors,
    .ably_day_names,
    .ably_calendar_grid {
        max-width: 100%;
        min-width: 0;
    }

    .ably_selector_field {
        min-width: 0;
        min-height: 40px;
        padding: 0 10px;
    }

    .ably_calendar_wrapper .ably_select_service {
        height: 36px;
        font-size: 13px;
        line-height: 36px;
    }

    .ably_board {
        margin: 0 0 12px;
        padding: 0;
    }

    .ably_toolbar,
    .ably_toolbar.ably_toolbar_with_tour {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
    }

    .ably_selectors,
    .ably_toolbar.ably_toolbar_with_tour .ably_selectors {
        flex: 1 1 auto;
        width: auto;
        max-width: 100%;
        min-width: 0;
    }

    .ably_selector_field {
        gap: 6px;
        min-height: 36px;
        padding: 0 8px;
    }

    .ably_calendar_wrapper .ably_select_service {
        height: 32px;
        font-size: 12px;
        line-height: 32px;
        padding-right: 18px;
    }

    .ably_month_grid_row {
        gap: 6px;
    }

    .ably_calendar_wrapper .ably_month_nav_btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        font-size: 18px;
    }

    .ably_month_select_panel {
        padding: 12px 10px 14px;
    }

    .ably_month_select_head {
        margin-bottom: 10px;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .ably_month_select_label {
        font-size: 10px;
    }

    .ably_year_tabs {
        flex: 0 0 auto;
        gap: 2px;
        padding: 3px;
    }

    .ably_calendar_wrapper .ably_year_tab {
        padding: 5px 7px;
        font-size: 11px;
        gap: 4px;
    }

    .ably_month_grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(58px, 1fr);
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .ably_calendar_wrapper .ably_month_tile {
        padding: 8px 4px;
    }

    .ably_month_tile_name {
        font-size: 11px;
    }

    .ably_month_tile_count {
        font-size: 10px;
    }

    .ably_month_summary {
        margin-top: 10px;
        min-width: 0;
        padding: 8px 10px;
    }

    .ably_month_overview_copy {
        white-space: nowrap;
    }

    .ably_month_overview_label,
    .ably_month_overview_text {
        font-size: 11px;
    }

    .ably_day_names,
    .ably_calendar_grid {
        width: 100%;
        gap: 4px;
    }

    .ably_day_names > *,
    .ably_calendar_grid > * {
        min-width: 0;
    }

    .ably_calendar_grid {
        min-height: 0;
        padding-bottom: 12px;
    }

    .ably_day_names {
        margin-bottom: 6px;
        font-size: 11px;
    }

    .ably_weekday_full {
        display: none;
    }

    .ably_weekday_short {
        display: inline;
    }

    .ably_day_cell,
    .ably_skeleton_cell {
        min-width: 0;
        min-height: 72px;
        border-radius: 8px;
    }

    .ably_cell_header {
        justify-content: center;
        height: 24px;
        padding: 0 4px;
        font-size: 12px;
    }

    .ably_cell_header svg {
        display: none;
    }

    .ably_cell_body {
        padding: 7px 3px 8px;
        gap: 0;
    }

    .ably_day_status_row {
        gap: 0;
    }

    .ably_day_number_val {
        font-size: 15px;
    }

    .ably_status_icon,
    .ably_status_text {
        display: none;
    }

    .ably_spaces_legend {
        margin-top: 12px;
        font-size: 11px;
    }

    .ably_spaces_legend_items {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
    }

    .ably_spaces_legend_item {
        min-width: 0;
    }

    .ably_skeleton_header {
        height: 24px;
        margin: 0;
    }

    .ably_skeleton_body {
        min-height: 48px;
    }

    .ably_skeleton_line {
        display: none;
    }
}

@media (max-width: 400px) {
    .ably_calendar_wrapper {
        padding: 10px 8px 12px;
    }

    .ably_selector_icon {
        display: none;
    }

    .ably_calendar_wrapper .ably_select_service {
        font-size: 11px;
    }

    .ably_calendar_wrapper .ably_year_tab {
        padding: 5px 6px;
        font-size: 10px;
    }

    .ably_month_grid {
        grid-auto-columns: minmax(50px, 1fr);
    }

    .ably_day_names,
    .ably_calendar_grid {
        gap: 3px;
    }

    .ably_day_cell,
    .ably_skeleton_cell {
        min-height: 66px;
    }

    .ably_day_number_val {
        font-size: 14px;
    }

    .ably_spaces_legend_items {
        grid-template-columns: 1fr;
    }
}
