/* Keep the phone layout on a common gutter and let dense controls wrap. */
@media (max-width: 650px) {
  html.tb-android .site-header .nav .primary-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px 6px !important;
  }

  html.tb-android .site-header .nav .primary-nav > :nth-child(-n+3) {
    grid-column: span 2;
  }

  html.tb-android .site-header .nav .primary-nav > :nth-child(4) {
    grid-column: 2 / span 2;
  }

  html.tb-android .site-header .nav .primary-nav > :nth-child(5) {
    grid-column: 4 / span 2;
  }

  html.tb-android .site-header .nav .primary-nav > a,
  html.tb-android .site-header .nav .primary-nav .nav-dropdown > summary {
    font-size: clamp(11px, 2.9vw, 12px);
    white-space: nowrap;
    line-height: 1.2;
    padding-inline: 3px;
    gap: 3px;
    background: #edf1e7;
    border-radius: 8px;
  }

  html.tb-android .site-header .nav .primary-nav .nav-dropdown > summary > span {
    font-size: 9px;
  }

  html.tb-android body:has(.site-header) main .container,
  html.tb-android body:has(.site-header) .footer.container {
    width: calc(100% - 32px);
    margin-inline: auto;
  }

  html.tb-android .hero-actions,
  html.tb-android .connection-actions,
  html.tb-android .product-actions,
  html.tb-android .final-hero-actions {
    align-items: flex-start;
    gap: 12px 16px;
    flex-wrap: wrap;
  }

  html.tb-android .hero-actions .button,
  html.tb-android .connection-actions .button,
  html.tb-android .product-actions .button,
  html.tb-android .final-hero-actions .button {
    min-height: 44px;
  }

  html.tb-android .new-pathways .path-card {
    min-height: 0;
    padding: 18px;
  }

  html.tb-android .new-pathways .path-card > img {
    width: 64px;
    height: 64px;
    top: 12px;
    right: 14px;
  }

  html.tb-android .new-pathways .path-number {
    margin-bottom: 28px;
    padding-inline-end: 72px;
  }

  html.tb-android .new-pathways .path-card h3 {
    font-size: clamp(22px, 6.2vw, 27px);
  }

  html.tb-android .journey-copy {
    padding-inline: 18px;
  }

  html.tb-android .footer .footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 340px);
    margin-inline: auto;
    gap: 2px 6px;
  }

  html.tb-android .footer .footer-links > a:last-child[href="/donate/"],
  html.tb-iphone .footer .footer-links > a:last-child[href="/donate/"] {
    grid-column: 2;
  }

  html.tb-android .footer .footer-links a {
    padding-block: 8px;
    white-space: normal;
  }

  html.tb-android .tb-tool-page.tb-tool-speak-lab {
    min-width: 0;
  }

  html.tb-android .tb-tool-page .tb-tool-brand-inner {
    justify-content: center;
  }

  html.tb-android .tb-tool-brand-inner > nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    text-align: center;
  }

  html.tb-android .tb-tool-brand nav a {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 6px 4px;
    line-height: 1.35;
    white-space: normal;
  }

  html.tb-android .app-rail nav[aria-label="Điều hướng"] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    min-width: 0;
  }

  html.tb-android .app-rail nav[aria-label="Điều hướng"] button {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
    min-height: 44px;
  }

  html.tb-android .app-rail nav[aria-label="Điều hướng"] button span {
    margin-left: 2px;
  }
}

@media (max-width: 360px) {
  html.tb-android .hero-actions {
    flex-direction: column;
  }

  html.tb-android .connection-hero h1,
  html.tb-android .product-hero h1,
  html.tb-android .final-hero h1 {
    font-size: clamp(29px, 9.2vw, 34px);
  }
}
