/* Mobile usability refinements for the public YUKAPP pages. */
@media (max-width: 620px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  #app,
  .container,
  .market-layout,
  .market-results,
  .form-layout,
  .form-section,
  .dashboard-main,
  .dash-columns {
    min-width: 0;
  }

  .nav-links.mobile-open {
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* Long translated tab names stay reachable without squeezing the search form. */
  .m-search .search-tabs {
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .m-search .search-tabs button {
    flex: 0 0 auto;
    min-height: 48px;
    white-space: nowrap;
  }

  .market-top {
    min-width: 0;
  }

  .market-top > .segmented {
    display: flex;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .market-top > .segmented button {
    flex: 0 0 auto;
  }

  .results-toolbar {
    flex-wrap: wrap;
  }

  .filters.open {
    max-width: 100%;
  }

  .filters .filter-fields {
    min-width: 0;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: thin;
  }

  .data-table {
    min-width: 620px;
  }

  .modal .details-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .trip-route {
    min-width: 0;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }

  .bottom-nav a {
    min-width: 0;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .filters .filter-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid:not(.three) {
    grid-template-columns: minmax(0, 1fr);
  }

  .radio-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .empty-state {
    padding: 36px 18px;
  }

  .form-section {
    padding: 17px 15px;
  }

  .modal-body {
    padding: 17px;
  }
}
