body.layout-landscape .header-search {
  max-width: 720px;
}

body.layout-landscape .results {
  padding-top: 8px;
}

/* Narrow layout: mobile + skinny desktop */
@media (max-width: 720px) {
  /* Vertical mode initial screen: split slogan into 3 centered lines */
  .hero-slogan-line {
    display: block;
  }

  /* Vertical mode results: keep header pinned and padded */
  body.state-results .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    padding: 18px;
  }

  .results {
    padding: 10px 12px 10px 12px;
  }

  /* Search forms: allow shrinking (no horizontal scroll) */
  .hero-fields,
  .header-search {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 8px;
  }

  /* Results: force single-column flow on small screens */
  .sections {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .section {
    width: 100%;
    padding: 10px 0;
  }

  .section-title {
    margin: 12px 0 8px 0;
    font-size: 16px;
    text-align: center;
  }

  /* Override the landscape-only flex title styling for the future section */
  body.layout-landscape #section-future .section-title {
    display: block;
    text-align: center;
  }

  .card-slot {
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .route-card {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Vertical cards: minimize side padding to prevent label clipping */
  .route-card-vertical {
    padding: 10px 3px;
  }

  .route-card-vertical .diagram {
    margin-top: 6px;
  }

  /* Center the vertical diagram inside the card */
  .route-card-vertical .diagram {
    justify-content: center;
  }

  .route-card-vertical .diagram-svg {
    margin: 0 auto;
  }

  /* Prevent meta row overflow; keep layout but allow wrapping */
  .route-top {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .route-top-right {
    flex-wrap: wrap;
    gap: 6px;
  }

  .route-meta,
  .route-meta-note,
  .route-future-info,
  .route-line-status {
    white-space: normal;
  }

  /* Top summary in vertical cards: centered stacked layout */
  .route-card-vertical .route-top {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .route-card-vertical .route-top-right {
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }

  .route-card-vertical .route-time {
    justify-content: center;
  }

  .route-card-vertical .route-meta {
    text-align: center;
  }

  .route-card-vertical .route-meta-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }

  .route-card-vertical .route-meta-note {
    text-align: center;
  }

  /* Future line status: 3-line centered block under the card */
  .route-line-statuses {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .route-line-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }
}
