/* Flight-only mobile containment and density correction (2026-08-03).
   Loaded last on Flight results and Flight booking-details pages. */

@media (max-width: 760px) {
  html,
  body.flight-results-page,
  body.mmt-flight-checkout-page {
    max-width: 100%;
    overflow-x: clip !important;
  }

  /* Flight results: remove legacy 46px gutters and restore the phone canvas. */
  body.flight-results-page .section.mmt-flight-flow-results,
  body.flight-results-page .section.mmt-flow-results {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px 10px 92px !important;
    overflow-x: clip !important;
  }

  body.flight-results-page :is(
    .mmt-results-main,
    .mmt-result-intro,
    .mmt-result-trust,
    .mmt-mobile-results-summary,
    .result-search-engine,
    .mmt-result-search,
    .mmt-result-flight-controls,
    .mmt-flight-fare-filter-row,
    .mmt-results-layout,
    .mmt-results-column,
    .live-results,
    .mmt-result-dashboard,
    .mmt-flight-listing-lead,
    .mmt-flight-listing-card,
    .mmt-result-card
  ) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.flight-results-page .mmt-results-layout {
    display: block !important;
    padding: 10px 0 0 !important;
  }

  body.flight-results-page .mmt-flight-filter-panel {
    display: none !important;
  }

  body.flight-results-page .mmt-result-search {
    padding: 10px !important;
    border-radius: 14px !important;
  }

  body.flight-results-page .mmt-result-search :is(input, select, button) {
    max-width: 100% !important;
  }

  body.flight-results-page .mmt-result-flight-controls,
  body.flight-results-page .mmt-flight-fare-filter-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body.flight-results-page .mmt-flight-fare-option {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 126px !important;
  }

  body.flight-results-page .mmt-flight-listing-card,
  body.flight-results-page .mmt-result-card {
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  body.flight-results-page .mmt-flight-row {
    min-width: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.flight-results-page :is(
    .mmt-flight-airline,
    .mmt-flight-route,
    .mmt-result-price,
    .mmt-flight-price-panel,
    .mmt-flight-card-footer,
    .mmt-flight-expanded
  ) {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Flight traveller page: compact lead/co-traveller fields without clipping. */
  body.mmt-flight-checkout-page .section.booking-plan {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 8px 10px 84px !important;
    overflow-x: clip !important;
  }

  body.mmt-flight-checkout-page :is(
    .plan-layout,
    .mmt-traveller-layout,
    .mmt-flight-guest-form,
    .mmt-flight-booking-card,
    .mmt-flight-booking-card-head,
    .mmt-flight-booking-itinerary,
    .mmt-flight-guest-details-card,
    .mmt-flight-simple-traveller-card,
    .mmt-flight-passenger-entry,
    .mmt-flight-co-traveller-card,
    .mmt-flight-co-passenger-card,
    .mmt-flight-addons-card,
    .mmt-flight-details-step-actions,
    #selectedSummary,
    .mmt-flight-price-breakup-v83,
    .mmt-flight-step-card,
    .mmt-flight-coupon-card,
    .mmt-flight-support-card
  ) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.mmt-flight-checkout-page :is(.plan-layout, .mmt-traveller-layout) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-guest-form {
    padding: 10px !important;
    overflow: hidden !important;
  }

  body.mmt-flight-checkout-page #selectedSummary {
    position: static !important;
    inset: auto !important;
    padding: 12px !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-name-row,
  body.mmt-flight-checkout-page .mmt-flight-co-passenger-card > .mmt-flight-name-row,
  body.mmt-flight-checkout-page .mmt-flight-co-traveller-card .mmt-flight-name-row {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 0 10px !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-name-row > :nth-child(5),
  body.mmt-flight-checkout-page .mmt-flight-co-passenger-card > .mmt-flight-name-row > :nth-child(5),
  body.mmt-flight-checkout-page .mmt-flight-co-traveller-card .mmt-flight-name-row > :nth-child(5) {
    grid-column: 1 / -1 !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-contact-row {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 0 10px !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-contact-row > :nth-child(3) {
    grid-column: 1 / -1 !important;
  }

  body.mmt-flight-checkout-page :is(.mmt-flight-name-row, .mmt-flight-contact-row) > label,
  body.mmt-flight-checkout-page :is(.mmt-flight-name-row, .mmt-flight-contact-row) > div {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 62px !important;
    height: auto !important;
    padding: 8px 10px !important;
    overflow: hidden !important;
  }

  body.mmt-flight-checkout-page :is(.mmt-flight-name-row, .mmt-flight-contact-row) :is(input, select) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 34px !important;
    height: 34px !important;
    padding: 4px 6px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-note-field {
    min-height: 76px !important;
    padding: 10px !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-price-breakup-v83 {
    overflow: hidden !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-price-row,
  body.mmt-flight-checkout-page .mmt-flight-price-total {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 12px 14px !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-price-row > *,
  body.mmt-flight-checkout-page .mmt-flight-price-total > * {
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-price-row strong {
    font-size: 17px !important;
    white-space: nowrap !important;
  }

  body.mmt-flight-checkout-page .mmt-flight-price-total strong {
    font-size: 20px !important;
    white-space: nowrap !important;
  }

  /* Runtime Flight renderers append legacy high-specificity rules. These
     repeated Flight-only scopes intentionally remain the final authority. */
  html body.flow-page.flight-results-page.flight-results-page[data-page="results"] .section.mmt-flow-results.mmt-flight-flow-results {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px 10px 92px !important;
    overflow-x: clip !important;
  }

  html body.flow-page.flight-results-page.flight-results-page[data-page="results"] .section.mmt-flight-flow-results :is(
    .mmt-results-main,
    .mmt-result-intro,
    .mmt-result-trust,
    .mmt-mobile-results-summary,
    .result-search-engine,
    .mmt-result-search,
    .mmt-result-flight-controls,
    .mmt-flight-fare-filter-row,
    .mmt-results-layout,
    .mmt-results-column,
    .live-results,
    .mmt-result-dashboard,
    .mmt-flight-listing-lead,
    .mmt-flight-listing-card,
    .mmt-result-card
  ) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  html body.flow-page.flight-results-page.flight-results-page[data-page="results"] .section.mmt-flight-flow-results .mmt-results-layout {
    display: block !important;
    padding: 10px 0 0 !important;
  }

  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .section.booking-plan {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 8px 10px 84px !important;
    overflow-x: clip !important;
  }

  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .mmt-flight-name-row,
  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .mmt-flight-co-passenger-card > .mmt-flight-name-row,
  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .mmt-flight-co-traveller-card .mmt-flight-name-row {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 0 10px !important;
  }

  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .mmt-flight-name-row > :nth-child(5),
  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .mmt-flight-co-passenger-card > .mmt-flight-name-row > :nth-child(5),
  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .mmt-flight-co-traveller-card .mmt-flight-name-row > :nth-child(5) {
    grid-column: 1 / -1 !important;
  }

  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .mmt-flight-contact-row {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 0 10px !important;
  }

  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] .mmt-flight-contact-row > :nth-child(3) {
    grid-column: 1 / -1 !important;
  }

  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] #selectedSummary .mmt-flight-price-row,
  html body.flow-page.mmt-flight-checkout-page.mmt-flight-checkout-page[data-page="details"] #selectedSummary .mmt-flight-price-total {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 12px 14px !important;
  }
}

@media (max-width: 340px) {
  body.mmt-flight-checkout-page .mmt-flight-name-row,
  body.mmt-flight-checkout-page .mmt-flight-co-passenger-card > .mmt-flight-name-row,
  body.mmt-flight-checkout-page .mmt-flight-co-traveller-card .mmt-flight-name-row,
  body.mmt-flight-checkout-page .mmt-flight-contact-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.mmt-flight-checkout-page :is(.mmt-flight-name-row, .mmt-flight-contact-row) > * {
    grid-column: 1 / -1 !important;
  }
}
