/*
 * Safari Connect Hub — responsive / accessibility hardening
 * v1.10.214
 *
 * Final launch-readiness layer. Keeps page-specific designs intact while
 * fixing cross-marketplace mobile/touch/text-overflow issues found in the
 * responsive UI audit.
 */

/* Flex/grid children containing real-world data (emails, URLs, long names)
 * must be allowed to shrink instead of widening the viewport. */
.traveler-marketplace-child .tmc-dashboard :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tod-directory :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tod-operator-profile :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tmc-accommodations :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tmc-accommodation-single :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tmc-all-tours :where(div,article,section,header,footer,li),
.traveler-marketplace-child .tmc-single-tour--clear :where(div,article,section,header,footer,li){min-width:0}

.traveler-marketplace-child :where(
    .tmc-dashboard,
    .tod-directory,
    .tod-operator-profile,
    .tmc-accommodations,
    .tmc-accommodation-single,
    .tmc-owned-accommodations,
    .tmc-all-tours,
    .tmc-single-tour--clear,
    .tmc-operator-auth
) :where(p,small,strong,span,a,dd,dt){overflow-wrap:anywhere}

/* One consistent keyboard focus treatment. Existing component focus styles
 * remain visible underneath; this mainly covers links/buttons that had none. */
.traveler-marketplace-child :where(a,button,input,select,textarea,summary):focus-visible{
    outline:3px solid rgba(22,128,60,.24);
    outline-offset:2px;
}

/* Authentication close controls and public inquiry modal close controls are
 * genuine touch targets, not 34–36px desktop-only icons. */
.tmc-operator-auth-modal .tmc-auth-modal-header .close,
.traveler-marketplace-child .tmc-single-tour--clear .tmc-d2-inquiry-modal__close,
.traveler-marketplace-child .tod-operator-inquiry-modal__close{
    min-width:44px!important;
    width:44px!important;
    min-height:44px!important;
    height:44px!important;
}

/* Public primary actions should meet a 44px touch target. */
.traveler-marketplace-child .tmc-tour-card__cta,
.traveler-marketplace-child .tod-button,
.traveler-marketplace-child .tod-profile-action,
.traveler-marketplace-child .tmc-accommodation-single__inquiry-cta,
.traveler-marketplace-child .tmc-owned-property-card__actions a,
.traveler-marketplace-child .tmc-dashboard-button,
.traveler-marketplace-child .tod-inquiry-reply,
.traveler-marketplace-child .tod-inquiry-source-link,
.traveler-marketplace-child .tod-promo-buy{
    min-height:44px!important;
}

/* Horizontal navigation rails remain usable on touch screens. */
.traveler-marketplace-child :where(
    .tod-profile-nav,
    .tod-promotion-hub__tabs,
    .tmc-destination-tabs,
    .tmc-cf-section-nav
){
    overscroll-behavior-inline:contain;
    scrollbar-width:thin;
    -webkit-overflow-scrolling:touch;
}

/* Dashboard utility copy was dipping below a comfortable readable size. */
.traveler-marketplace-child .tmc-dashboard :where(.tmc-stat-card small,.tmc-quick-action p,.tmc-panel-heading p),
.traveler-marketplace-child .tmc-owned-accommodations :where(.tmc-owned-property-card__completeness span,.tmc-owned-accommodations__profile-logo small),
.traveler-marketplace-child .tod-accommodation-promotion-hub :where(.tod-promotion-hub__summary span,.tod-promotion-hub__summary p){
    font-size:11px!important;
    line-height:1.5!important;
}

/* Prevent file inputs and long account data from escaping dashboard cards. */
.traveler-marketplace-child .tmc-dashboard input[type="file"],
.traveler-marketplace-child .tmc-owned-accommodations input[type="file"],
.traveler-marketplace-child .tmc-dashboard input[type="url"],
.traveler-marketplace-child .tmc-dashboard input[type="email"]{
    max-width:100%;
}

@media (max-width:767px){
    /* 16px mobile form text prevents Safari/iOS zoom and makes every major
     * marketplace form easier to complete. */
    .traveler-marketplace-child :where(
        .tmc-operator-auth,
        .tod-tour-inquiry,
        .tod-directory,
        .tmc-all-tours,
        .tmc-accommodations,
        .tmc-owned-accommodations,
        .tmc-dashboard,
        .tmc-single-tour--clear
    ) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
        font-size:16px!important;
    }

    .traveler-marketplace-child .tmc-operator-auth-modal .modal-dialog{
        width:calc(100% - 20px)!important;
        margin-left:auto;
        margin-right:auto;
    }

    .traveler-marketplace-child .tmc-operator-auth-modal .modal-body{
        padding-left:16px!important;
        padding-right:16px!important;
    }

    .traveler-marketplace-child .tmc-dashboard-hero__actions{
        width:100%;
    }

    .traveler-marketplace-child .tmc-dashboard-hero__actions .tmc-dashboard-button{
        flex:1 1 180px;
    }

    .traveler-marketplace-child .tmc-management-toolbar,
    .traveler-marketplace-child .tmc-management-header,
    .traveler-marketplace-child .tod-inquiry-detail__header,
    .traveler-marketplace-child .tod-inquiry-detail__actions{
        min-width:0;
    }

    .traveler-marketplace-child .tod-profile-action{
        justify-content:center;
    }

    .traveler-marketplace-child .tod-profile-hero-topbadges{
        max-width:calc(100% - 40px);
        flex-wrap:wrap;
    }

    .traveler-marketplace-child .tod-operator-profile-v2 .tod-profile-identity h1{
        font-size:clamp(31px,9vw,38px)!important;
        overflow-wrap:anywhere;
    }

    .traveler-marketplace-child .tmc-all-tours__results-tools select,
    .traveler-marketplace-child .tmc-tour-filter__control,
    .traveler-marketplace-child .tmc-accommodations__filters select,
    .traveler-marketplace-child .tmc-accommodations__filters input{
        width:100%;
        max-width:100%;
    }

    /* Public inquiry modals use the available screen height and retain access
     * to their close control even on short phones. */
    .traveler-marketplace-child .tmc-single-tour--clear .tmc-d2-inquiry-modal{
        padding:14px 10px!important;
    }
    .traveler-marketplace-child .tmc-single-tour--clear .tmc-d2-inquiry-modal__dialog{
        max-height:calc(100dvh - 28px);
        overflow:auto;
    }

    /* Accommodation management actions should not squeeze into tiny buttons. */
    .traveler-marketplace-child .tmc-owned-property-card__actions a{
        flex:1 1 150px;
        padding-left:12px;
        padding-right:12px;
    }
}

@media (max-width:640px){
    /* The dashboard previously held two columns until 480px.  On real devices
     * that left stats/actions cramped once the Traveler dashboard shell and
     * page padding were accounted for. */
    .traveler-marketplace-child .tmc-dashboard-stats,
    .traveler-marketplace-child .tmc-quick-actions,
    .traveler-marketplace-child .tmc-conversation-grid{
        grid-template-columns:1fr!important;
    }

    .traveler-marketplace-child .tmc-dashboard-hero__actions .tmc-dashboard-button{
        flex-basis:100%;
        width:100%;
    }

    .traveler-marketplace-child .tod-accommodation-promotion-hub .tod-promotion-hub__tabs a,
    .traveler-marketplace-child .tod-profile-nav a{
        min-height:44px;
        display:inline-flex;
        align-items:center;
    }

    .traveler-marketplace-child .tod-inquiry-detail__actions{
        align-items:stretch!important;
        width:100%;
    }
    .traveler-marketplace-child .tod-inquiry-detail__actions > :where(a,button,form){
        max-width:100%;
    }
}

@media (max-width:480px){
    .traveler-marketplace-child .tmc-auth-page__card,
    .traveler-marketplace-child .tmc-dashboard-panel,
    .traveler-marketplace-child .tmc-owned-accommodations__prerequisite-gate{
        border-radius:12px;
    }

    .traveler-marketplace-child .tod-review-score{
        text-align:left;
    }
}

@media (prefers-reduced-motion:reduce){
    .traveler-marketplace-child *,
    .traveler-marketplace-child *::before,
    .traveler-marketplace-child *::after{
        scroll-behavior:auto!important;
        transition-duration:.01ms!important;
        animation-duration:.01ms!important;
        animation-iteration-count:1!important;
    }
}

/* ========================================================================== */
/* v1.10.426 — marketplace-wide mobile refinement pass                        */
/* ========================================================================== */

/* Keep every major public shell inside the viewport even when content comes
 * from operator-entered titles, URLs, prices or destination names. */
.traveler-marketplace-child :where(
    .tmc-home-hero,
    .tmc-all-tours,
    .tmc-dest-landing,
    .tmc-exp,
    .tod-directory,
    .tod-operator-profile,
    .tmc-accommodations,
    .tmc-accommodation-single,
    .tmc-single-tour--clear,
    .tmc-dashboard
){max-width:100%;overflow-wrap:anywhere}

.traveler-marketplace-child :where(
    .tmc-home-search-shell,
    .tmc-all-tours__container,
    .tmc-dest-shell,
    .tmc-exp-shell,
    .tod-directory__container,
    .tmc-accommodations__container,
    .tmc-accommodation-single__container,
    .tmc-cf-main
){min-width:0}

@media (max-width:767px){
    /* Homepage: preserve readable search labels instead of compressing three
     * tabs into narrow equal columns on smaller phones. */
    .traveler-marketplace-child .tmc-home-search-tabs{
        display:flex!important;
        gap:7px!important;
        margin:0 -2px 8px!important;
        overflow-x:auto;
        padding:2px 2px 6px;
        scroll-snap-type:x proximity;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
    }
    .traveler-marketplace-child .tmc-home-search-tabs::-webkit-scrollbar{display:none}
    .traveler-marketplace-child .tmc-home-search-tab{
        flex:0 0 auto!important;
        font-size:11px!important;
        min-height:42px!important;
        padding:0 13px!important;
        scroll-snap-align:start;
        white-space:nowrap;
    }
    .traveler-marketplace-child .tmc-home-search-tab .tmc-icon{display:block!important}
    .traveler-marketplace-child .tmc-home-search-shell .tmc-home-search__field,
    .traveler-marketplace-child .tmc-home-search-shell .tmc-home-search__button-wrap{
        box-sizing:border-box;
        width:100%;
    }
    .traveler-marketplace-child .tmc-home-search__field input[type="search"]{
        font-size:16px!important;
        min-width:0;
    }

    /* All Tours: Quick Picks and active filters are discovery rails, not
     * stacked text blocks. Keep the label visible and let chips scroll. */
    .traveler-marketplace-child .tmc-all-tours__quick-picks,
    .traveler-marketplace-child .tmc-all-tours__active-filters{
        max-width:100%;
        min-width:0;
    }
    .traveler-marketplace-child .tmc-all-tours__quick-picks{
        align-items:center;
        display:flex!important;
        gap:8px;
        overflow-x:auto;
        padding-bottom:6px;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
    }
    .traveler-marketplace-child .tmc-all-tours__quick-picks::-webkit-scrollbar,
    .traveler-marketplace-child .tmc-all-tours__active-filters::-webkit-scrollbar{display:none}
    .traveler-marketplace-child .tmc-all-tours__quick-picks>span,
    .traveler-marketplace-child .tmc-all-tours__quick-picks>a{
        flex:0 0 auto;
        white-space:nowrap;
    }

    /* Destination/country tabs stay as a compact swipeable rail instead of
     * wrapping into several uneven rows. */
    .traveler-marketplace-child :where(.tmc-destination-tabs,.tmc-dest-tabs,.tmc-dest-guide-tabs){
        display:flex!important;
        flex-wrap:nowrap!important;
        gap:8px;
        max-width:100%;
        overflow-x:auto;
        padding-bottom:6px;
        scroll-snap-type:x proximity;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
    }
    .traveler-marketplace-child :where(.tmc-destination-tabs,.tmc-dest-tabs,.tmc-dest-guide-tabs)::-webkit-scrollbar{display:none}
    .traveler-marketplace-child :where(.tmc-destination-tabs,.tmc-dest-tabs,.tmc-dest-guide-tabs)>a,
    .traveler-marketplace-child :where(.tmc-destination-tabs,.tmc-dest-tabs,.tmc-dest-guide-tabs)>button{
        flex:0 0 auto;
        min-height:44px;
        scroll-snap-align:start;
        white-space:nowrap;
    }

    /* Safari Experience rail navigation is an explicit touch control and
     * should meet the same minimum target as the rest of the marketplace. */
    .traveler-marketplace-child .tmc-exp .tmc-exp-interest-nav button{
        height:44px!important;
        min-height:44px!important;
        min-width:44px!important;
        width:44px!important;
    }
    .traveler-marketplace-child .tmc-exp .tmc-exp-interest-grid{
        overscroll-behavior-inline:contain;
        scroll-padding-inline:18px;
    }

    /* Public operator directory/profile: actions use the screen width instead
     * of shrinking labels or pushing adjacent cards outside the viewport. */
    .traveler-marketplace-child .tod-directory :where(.tod-button,.tod-card-action),
    .traveler-marketplace-child .tod-operator-profile :where(.tod-profile-action,.tod-button){
        min-height:44px;
    }
    .traveler-marketplace-child .tod-operator-profile :where(.tod-profile-actions,.tod-c-hero-actions){
        max-width:100%;
    }

    /* Accommodation single: section navigation behaves like the Tour detail
     * navigation and every inquiry control respects the card width. */
    .traveler-marketplace-child .tmc-accommodation-single__section-nav>div{
        overscroll-behavior-inline:contain;
        scroll-snap-type:x proximity;
        -webkit-overflow-scrolling:touch;
    }
    .traveler-marketplace-child .tmc-accommodation-single__section-nav a{
        flex:0 0 auto;
        min-height:44px;
        scroll-snap-align:start;
        white-space:nowrap;
    }
    .traveler-marketplace-child .tmc-accommodation-single__inquiry-card :where(input,select,textarea,button){
        box-sizing:border-box;
        max-width:100%;
        min-width:0;
        width:100%;
    }
    .traveler-marketplace-child .tmc-accommodation-single__inquiry-card textarea{
        min-height:110px!important;
        resize:vertical;
    }

    /* Tour detail: keep the sticky section rail swipeable and prevent long
     * route/pricing/operator data from causing horizontal page overflow. */
    .traveler-marketplace-child .tmc-single-tour--clear .tmc-cf-nav{
        max-width:100%;
        overflow-x:auto!important;
        overscroll-behavior-inline:contain;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
    }
    .traveler-marketplace-child .tmc-single-tour--clear .tmc-cf-nav::-webkit-scrollbar{display:none}
    .traveler-marketplace-child .tmc-single-tour--clear .tmc-cf-nav a{
        flex:0 0 auto;
        min-height:44px;
        white-space:nowrap;
    }
    .traveler-marketplace-child .tmc-single-tour--clear :where(
        .tmc-cf-route-card,
        .tmc-cf-pricing-table,
        .tmc-cf-operator-profile,
        .tmc-cf-itinerary-mobile-panel
    ){max-width:100%;min-width:0}

    /* Partner/Traveler dashboards: avoid squeezed two-column utility areas and
     * make action clusters comfortable on real 360–430px phones. */
    .traveler-marketplace-child .tmc-dashboard :where(
        .tmc-dashboard-hero__actions,
        .tmc-management-toolbar,
        .tmc-management-header,
        .tmc-form-actions
    ){
        max-width:100%;
    }
    .traveler-marketplace-child .tmc-dashboard :where(.tmc-form-actions,.tmc-management-toolbar__actions){
        display:flex;
        flex-wrap:wrap;
        gap:8px;
    }
    .traveler-marketplace-child .tmc-dashboard :where(.tmc-form-actions,.tmc-management-toolbar__actions)>:where(a,button,input[type="submit"]){
        flex:1 1 150px;
        min-height:44px;
    }

    /* All marketplace modals must remain usable above mobile browser chrome. */
    .traveler-marketplace-child :where(
        .tmc-d2-inquiry-modal__dialog,
        .tod-operator-inquiry-modal__dialog,
        .tmc-accommodation-gallery__dialog
    ){
        max-height:calc(100dvh - 20px)!important;
        max-width:calc(100vw - 20px)!important;
        overflow:auto;
        overscroll-behavior:contain;
    }
}

@media (max-width:430px){
    .traveler-marketplace-child .tmc-home-hero__copy h1,
    .traveler-marketplace-child .tmc-all-tours__hero h1,
    .traveler-marketplace-child .tmc-exp-hero h1{
        overflow-wrap:normal;
        word-break:normal;
    }

    .traveler-marketplace-child .tmc-home-hero__trust{
        grid-template-columns:1fr!important;
    }

    .traveler-marketplace-child .tmc-accommodation-single--design-5 .tmc-accommodation-single__hero-actions,
    .traveler-marketplace-child .tmc-accommodation-single--design-5 .tmc-accommodation-single__feature-strip--quick-facts{
        grid-template-columns:1fr!important;
    }

    .traveler-marketplace-child .tmc-dashboard :where(.tmc-form-actions,.tmc-management-toolbar__actions)>:where(a,button,input[type="submit"]){
        flex-basis:100%;
        width:100%;
    }
}
