/* Desktop keeps its existing heading, shortcuts and animation control. */
.infr-home-hero .infr-mobile-title,
.infr-home-hero .infr-mobile-quicklinks { display: none; }
@media (max-width: 767.98px) {
  .infr-home-hero .infr-desktop-title,
  html[data-infr-theme="light"] .infr-home-hero .infr-home-quicklinks:not(.infr-mobile-quicklinks),
  .infr-home-hero .infr-hero-pause { display: none; }
  .infr-home-hero .infr-mobile-title { display: inline; }
  html[data-infr-theme="light"] .infr-home-hero h1 {
    display: inline-grid;
    grid-template-columns: minmax(0, max-content);
    width: fit-content;
    max-width: 100%;
    font-size: clamp(25px, 7.8vw, 32px);
    line-height: 1.3;
    letter-spacing: -.025em;
  }
  .infr-home-hero h1 > br { display: none; }
  .infr-home-hero h1 > span {
    text-align: justify;
    text-align-last: justify;
    overflow-wrap: anywhere;
  }
  html[data-infr-theme="light"] .infr-home-hero .infr-mobile-quicklinks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 330px);
  }
  html[data-infr-theme="light"] .infr-home-hero .infr-mobile-quicklinks a {
    min-height: 46px;
    font-size: 13px;
    padding: 10px 6px;
    white-space: normal;
    text-align: center;
    touch-action: manipulation;
  }
  html[data-infr-theme="light"] .infr-home-hero .mt-16.grid {
    margin-top: 38px;
    width: min(204px, 50vw);
  }
  html[data-infr-theme="light"] .infr-home-hero .mt-16.grid > div {
    gap: 12px;
    padding: 11px 10px;
  }
  html[data-infr-theme="light"] .infr-home-hero .mt-16.grid .text-2xl { font-size: 20px; }
  html[data-infr-theme="light"] .infr-home-hero .mt-16.grid .text-sm { font-size: 11px; }
  html[data-infr-theme="light"] .infr-home-hero > .relative { padding-bottom: 32px; }
}

/* Existing mobile navigation only; the desktop navigation is unchanged. */
@media (max-width: 1023.98px) {
  .infr-site-header button[aria-label="Toggle menu"] {
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    touch-action: manipulation;
  }
  .infr-site-header > div[class~="lg:hidden"].overflow-hidden {
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    scroll-padding-block: 12px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media (max-width: 767.98px) {
  /* The existing 64px header keeps its content and logo; the control group
     needs less empty space when the menu touch target grows from 38 to 44px. */
  .infr-site-header > .max-w-7xl > .flex > .flex.items-center.gap-3 {
    gap: 8px;
  }
  .infr-site-header button[title="切换语言"],
  .infr-site-header button[title="Switch Language"] {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Only the public Contact form. Keep browser zoom available and avoid
     focus-triggered auto-zoom on iPhone without changing its fields. */
  #inquiry-form :is(input, select, textarea) {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
    scroll-margin-top: 80px;
  }
  #inquiry-form :is(input, select, textarea):focus {
    border-color: var(--theme-accent) !important;
  }
  #inquiry-form :is(input, select, textarea):focus-visible,
  .infr-site-header button[aria-label="Toggle menu"]:focus-visible {
    outline: 3px solid var(--theme-accent) !important;
    outline-offset: 3px;
  }

  /* Preserve the enlarged portrait/launcher. Grow only small dialog controls. */
  body .infr-chat-close,
  body .infr-chat-viewer-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
  body .infr-chat-actions button,
  body .infr-chat-viewer-tools :is(button, a) {
    min-height: 44px;
    touch-action: manipulation;
  }
}
