/* Public marketing controls only; authored previews and owner workspaces stay isolated. */
@media (max-width: 760px) {
  /* Keep editable controls readable without mobile browsers zooming into small text. */
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-core-contact-form :is(.lf-marketing-input, .lf-marketing-textarea, .lf-marketing-select-trigger),
  .lf-marketing .lf-doc-search input,
  .lf-templates-marketing :is(.template-library-search input, .template-library-category select, .template-preview-page select) {
    font-size: 16px;
  }

  .lf-marketing .lf-doc-search input { padding-inline-end: 52px; }
  .lf-marketing .lf-doc-search > button { width: 44px; height: 44px; }

  /* A chosen support topic or urgency must remain readable at narrow widths. */
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-core-contact-form .lf-marketing-select-trigger {
    height: auto;
    min-height: 48px;
    white-space: normal;
    text-align: start;
  }
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-core-contact-form .lf-marketing-select-trigger [data-slot="select-value"] {
    display: block;
    min-width: 0;
    -webkit-line-clamp: unset;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body:has(:is(.lf-marketing, .lumasaur-marketing-page)) .lf-marketing-select-content .lf-marketing-select-item {
    min-height: 44px;
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  /* Directory links already have touch sizing; these are the smaller legal/status links. */
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-footer-directory .lf-footer-bottom nav a {
    min-height: 44px;
    padding-inline: 2px;
  }

  /* The screenshot viewer is portalled outside the page root. Reserve its close target. */
  body:has(:is(.lf-marketing, .lumasaur-marketing-page)) .lf-real-shot-dialog > button {
    display: grid;
    place-items: center;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    opacity: 1;
  }
  body:has(:is(.lf-marketing, .lumasaur-marketing-page)) .lf-real-shot-dialog .lf-real-shot-dialog-heading {
    padding-inline-end: 52px;
  }
}

/* The beta disclosure can change height; the menu uses the space that actually remains. */
@media (max-width: 900px) {
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-header {
    display: flex;
    flex-direction: column;
    max-height: 100dvh;
  }
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-header > .lf-wrap {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-header-row,
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-header > .lf-pilot-banner {
    flex-shrink: 0;
  }
  :is(.lf-marketing, .lumasaur-marketing-page) .lf-header > .lf-wrap .lf-mobile-nav {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    scroll-padding-block: 12px max(24px, env(safe-area-inset-bottom));
  }
}

/* Keep installation available at the end of the public page without covering its controls. */
@media (max-width: 760px) {
  body:has(:is(.lf-marketing, .lumasaur-marketing-page)) [data-web-app-install-support="platform"] {
    display: flex;
    justify-content: center;
    padding: 18px 16px max(18px, env(safe-area-inset-bottom));
    background: #071322;
  }
  body:has(:is(.lf-marketing, .lumasaur-marketing-page)) [data-web-app-install-support="platform"] > button {
    position: static;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:has(:is(.lf-marketing, .lumasaur-marketing-page)) :is(.lf-real-shot-dialog, .lf-marketing-select-content) {
    animation: none !important;
    transition: none !important;
  }
}
