/* ========================================================================== 
   APD 40.0.0 · final desktop refinement from the supplied Airbnb/APD videos.
   ========================================================================== */
:root {
    --apd40-content: 1376px;
    --apd40-ink: #222222;
    --apd40-muted: #6a6a6a;
    --apd40-border: #dddddd;
    --apd40-blue: #0d6efd;
    --apd40-blue-dark: #0756c8;
    --apd40-shadow: 0 3px 14px rgba(0,0,0,.12);
    --apd40-popover: 0 12px 42px rgba(0,0,0,.18);
}

body.apd40-video-reference {
    overflow-x: clip;
}
body.apd40-video-reference.apd40-modal-open {
    overflow: hidden !important;
}

/* Header, icon hover and search alignment. */
@media (min-width: 1180px) {
    body.apd40-video-reference .apd5-header-row {
        width: min(calc(100vw - 96px), var(--apd40-content)) !important;
        max-width: var(--apd40-content) !important;
        grid-template-columns: 184px minmax(610px, 1fr) 260px !important;
        margin-inline: auto !important;
    }

    body.apd40-video-reference .apd5-main-nav > a > span:first-child,
    body.apd40-video-reference .apd5-main-nav > a > span:first-child svg {
        transform-origin: 50% 60% !important;
        transition: transform .18s cubic-bezier(.2,.75,.2,1), filter .18s ease !important;
    }
    body.apd40-video-reference .apd5-main-nav > a:hover > span:first-child {
        transform: translateY(-1px) scale(1.065) !important;
    }
    body.apd40-video-reference .apd5-main-nav > a:active > span:first-child {
        transform: translateY(0) scale(.98) !important;
    }

    body.apd40-video-reference .apd5-header.is-discovery-context > .apd5-header-search-row {
        left: 50% !important;
        right: auto !important;
        width: 680px !important;
        max-width: 680px !important;
        margin: 0 !important;
        transform: translateX(-50%) !important;
    }
    body.apd40-video-reference .apd5-header.is-discovery-context.is-compact:not(.is-search-expanded) > .apd5-header-search-row {
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    body.apd40-video-reference .apd5-search {
        isolation: isolate !important;
        width: 680px !important;
        max-width: 680px !important;
        grid-template-columns: minmax(0,1.18fr) 1px minmax(0,1fr) 1px minmax(0,1fr) 48px !important;
        overflow: visible !important;
    }
    body.apd40-video-reference .apd5-search.has-open-panel {
        grid-template-columns: minmax(0,1.18fr) 1px minmax(0,1fr) 1px minmax(0,.93fr) 94px !important;
    }
    body.apd40-video-reference .apd5-search-field,
    body.apd40-video-reference .apd5-search-field > button:first-child {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    body.apd40-video-reference .apd5-search-field > button:first-child {
        position: relative !important;
        z-index: 2 !important;
        padding-inline: 19px !important;
        cursor: pointer !important;
        transition: background .16s ease, box-shadow .16s ease, transform .1s ease !important;
    }
    body.apd40-video-reference .apd5-search-field > button:first-child:active {
        transform: scale(.985) !important;
    }
    body.apd40-video-reference .apd5-search-field.is-open > button:first-child {
        background: #fff !important;
        box-shadow: 0 3px 16px rgba(0,0,0,.17) !important;
    }
    body.apd40-video-reference .apd5-search.has-open-panel .apd5-search-field:not(.is-open):hover > button:first-child {
        background: rgba(255,255,255,.54) !important;
    }

    /* The submit icon always remains above the traveler field. */
    body.apd40-video-reference .apd5-search-submit {
        position: relative !important;
        z-index: 12 !important;
        justify-self: end !important;
        align-self: center !important;
        flex: 0 0 auto !important;
        overflow: hidden !important;
        box-shadow: 0 1px 4px rgba(13,111,232,.16) !important;
    }
    body.apd40-video-reference .apd5-search-submit svg,
    body.apd40-video-reference .apd5-search-submit .apd5-icon {
        display: block !important;
        flex: 0 0 16px !important;
        width: 16px !important;
        height: 16px !important;
        overflow: visible !important;
    }
    body.apd40-video-reference .apd5-search.has-open-panel .apd5-search-submit {
        width: 88px !important;
        min-width: 88px !important;
        padding: 0 13px !important;
    }
    body.apd40-video-reference .apd5-search-field[data-search-field="guests"] > button:first-child,
    body.apd40-video-reference .apd5-search-field[data-search-field="service"] > button:first-child {
        padding-right: 15px !important;
    }
    body.apd40-video-reference .apd16-search-clear {
        z-index: 14 !important;
        right: 8px !important;
    }

    body.apd40-video-reference .apd5-search-panel {
        border: 1px solid rgba(0,0,0,.08) !important;
        box-shadow: var(--apd40-popover) !important;
    }
    body.apd40-video-reference .apd5-location-panel {
        left: 0 !important;
        width: 408px !important;
        min-height: 300px !important;
    }
    body.apd40-video-reference .apd5-date-panel {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }
    body.apd40-video-reference .apd5-guests-panel,
    body.apd40-video-reference .apd5-service-panel {
        left: auto !important;
        right: 0 !important;
        width: 390px !important;
    }
}

/* Worldwide destination results. */
.apd40-world-results {
    display: grid;
    gap: 2px;
    margin: 0 0 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid #ebebeb;
}
.apd40-world-results[hidden] { display: none !important; }
.apd40-world-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 26px;
    padding: 0 7px 4px;
    color: #717171;
    font-size: 11px;
    font-weight: 650;
}
.apd40-world-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid #ddd;
    border-top-color: var(--apd40-blue);
    border-radius: 50%;
    animation: apd40Spin .65s linear infinite;
}
.apd40-world-option {
    width: 100%;
    min-height: 55px;
    padding: 7px 8px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr);
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #222;
    text-align: left;
    cursor: pointer;
    transition: background .14s ease, transform .1s ease;
}
.apd40-world-option:hover,
.apd40-world-option.is-active { background: #f5f5f5; }
.apd40-world-option:active { transform: scale(.99); }
.apd40-world-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #f2f2f2;
    color: #222;
}
.apd40-world-icon svg { width: 21px; height: 21px; }
.apd40-world-option strong,
.apd40-world-option small {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.apd40-world-option strong { font-size: 13px; line-height: 1.25; font-weight: 600; }
.apd40-world-option small { margin-top: 2px; color: #717171; font-size: 11px; }
.apd40-world-message { padding: 12px 8px; color: #717171; font-size: 12px; }
@keyframes apd40Spin { to { transform: rotate(360deg); } }

/* Homepage cards: real and demo cards use the same visual treatment. */
body.home.apd40-video-reference .apd5-card.is-demo .apd5-card-media {
    outline: 0 !important;
}
body.home.apd40-video-reference .apd5-card.is-demo .apd5-demo-edit {
    display: none !important;
}
body.home.apd40-video-reference .apd5-card,
body.home.apd40-video-reference .apd29-topic-rail a,
body.home.apd40-video-reference .apd29-continue-strip a {
    transition: transform .18s cubic-bezier(.2,.75,.2,1), filter .18s ease !important;
}
body.home.apd40-video-reference .apd5-card:hover,
body.home.apd40-video-reference .apd29-topic-rail a:hover {
    transform: translateY(-2px) !important;
}
body.home.apd40-video-reference .apd5-card:active,
body.home.apd40-video-reference .apd29-topic-rail a:active,
body.home.apd40-video-reference .apd29-continue-strip a:active {
    transform: scale(.992) !important;
}
body.home.apd40-video-reference .apd5-card-media {
    background: #ededed !important;
    box-shadow: none !important;
}
body.home.apd40-video-reference .apd5-card:hover .apd5-card-media {
    box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
}
body.home.apd40-video-reference .apd5-card-media img {
    transform: scale(1.001) !important;
    transition: transform .28s cubic-bezier(.2,.75,.2,1), filter .2s ease !important;
}
body.home.apd40-video-reference .apd5-card:hover .apd5-card-media img {
    transform: scale(1.025) !important;
}

/* Footer legal line: exact horizontal alignment and spacing. */
body.apd40-video-reference .apd5-footer {
    overflow: visible !important;
}
body.apd40-video-reference .apd24-footer-bottom {
    width: min(calc(100vw - 96px), var(--apd40-content)) !important;
    max-width: var(--apd40-content) !important;
    min-height: 68px !important;
    margin: 0 auto !important;
    padding: 18px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 26px !important;
    border-top: 1px solid #dddddd !important;
}
body.apd40-video-reference .apd24-footer-legal,
body.apd40-video-reference .apd24-footer-controls {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}
body.apd40-video-reference .apd24-footer-legal > * {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 24px !important;
    margin: 0 !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
}
body.apd40-video-reference .apd24-footer-legal a {
    color: #222 !important;
    text-underline-offset: 2px !important;
}
body.apd40-video-reference .apd24-footer-control {
    min-height: 34px !important;
    padding: 0 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    border-radius: 8px !important;
    transition: background .15s ease !important;
}
body.apd40-video-reference .apd24-footer-control:hover { background: #f2f2f2 !important; }

/* Host chooser. */
.apd40-host-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 24px;
}
.apd40-host-modal[hidden] { display: none !important; }
.apd40-host-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0,0,0,.48);
    backdrop-filter: blur(1px);
    cursor: default;
}
.apd40-host-dialog {
    position: relative;
    z-index: 1;
    width: min(610px, calc(100vw - 32px));
    padding: 30px 30px 22px;
    border-radius: 22px;
    background: #fff;
    color: #222;
    box-shadow: 0 24px 80px rgba(0,0,0,.28);
    animation: apd40ModalIn .19s cubic-bezier(.2,.75,.2,1) both;
}
.apd40-host-dialog h2 {
    margin: 0 42px 6px;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 650;
    letter-spacing: -.02em;
    text-align: center;
}
.apd40-host-dialog > p {
    margin: 0 24px 22px;
    color: #717171;
    font-size: 13px;
    text-align: center;
}
.apd40-host-close {
    position: absolute;
    top: 17px;
    right: 17px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #222;
    font-size: 24px;
    cursor: pointer;
}
.apd40-host-close:hover { background: #f2f2f2; }
.apd40-host-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
}
.apd40-host-options > button {
    min-height: 180px;
    padding: 22px 14px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 1px solid #dddddd;
    border-radius: 15px;
    background: #fff;
    color: #222;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease, background .15s ease;
}
.apd40-host-options > button:hover {
    border-color: #222;
    transform: translateY(-1px);
}
.apd40-host-options > button.is-selected {
    border: 2px solid #222;
    background: #f7f7f7;
    box-shadow: 0 0 0 1px #222 inset;
}
.apd40-host-visual {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
}
.apd40-host-visual svg { width: 68px; height: 68px; }
.apd40-host-options strong { font-size: 13px; font-weight: 650; }
.apd40-host-footer {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}
.apd40-host-next {
    min-width: 104px;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 9px;
    background: #222;
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: transform .1s ease, background .15s ease, opacity .15s ease;
}
.apd40-host-next:disabled { opacity: .28; cursor: not-allowed; }
.apd40-host-next:not(:disabled):hover { background: #000; }
.apd40-host-next:not(:disabled):active { transform: scale(.98); }
@keyframes apd40ModalIn {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1179px) {
    body.apd40-video-reference .apd24-footer-bottom {
        width: 100% !important;
        padding: 20px 18px calc(20px + env(safe-area-inset-bottom)) !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    body.apd40-video-reference .apd24-footer-legal,
    body.apd40-video-reference .apd24-footer-controls {
        flex-wrap: wrap !important;
    }
}

@media (max-width: 700px) {
    .apd40-host-modal { padding: 0; align-items: end; }
    .apd40-host-dialog {
        width: 100%;
        max-height: 92vh;
        overflow: auto;
        padding: 26px 18px calc(20px + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
    }
    .apd40-host-options { grid-template-columns: 1fr; }
    .apd40-host-options > button {
        min-height: 92px;
        padding: 12px 18px;
        flex-direction: row;
        justify-content: flex-start;
    }
    .apd40-host-visual { width: 58px; height: 58px; }
    .apd40-host-visual svg { width: 54px; height: 54px; }
    .apd40-host-footer { position: sticky; bottom: 0; padding-top: 15px; background: #fff; }
    .apd40-host-next { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    body.apd40-video-reference *,
    .apd40-host-dialog,
    .apd40-world-spinner {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
