/* Regelnest mobile interaction fixes */

body.fm-public-body,
body.auth-page,
body.family-theme {
  max-width: 100%;
  overflow-x: hidden;
}

.public-shell,
.auth-wrap,
.auth-saas-wrap,
.app-shell,
.main-content,
.content-frame {
  min-width: 0;
}

.public-nav .brand,
.public-nav-actions,
.topbar-actions,
.mobile-bottom-nav a {
  min-width: 0;
}

.public-nav .brand span,
.app-brand span,
.profile-chip strong,
.profile-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  body.auth-page {
    min-height: 100svh;
  }

  .auth-page .auth-wrap.auth-saas-wrap,
  .auth-page .auth-saas-wrap {
    width: min(520px, calc(100% - 24px)) !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: start !important;
    padding: 20px 0 32px !important;
  }

  .auth-page .auth-card,
  .auth-page .auth-saas-card,
  .auth-page .pro-register-card {
    width: 100% !important;
    max-width: 100% !important;
    order: 1;
  }

  .auth-page .auth-intro {
    order: 2;
    max-width: 100%;
  }

  .auth-page .auth-intro h1 {
    font-size: clamp(30px, 8vw, 40px) !important;
    line-height: 1.05 !important;
  }

  .auth-page .auth-preview-card {
    grid-template-columns: 1fr !important;
  }

  .family-theme .app-shell.pro-shell {
    width: 100%;
    overflow-x: hidden;
  }

  .family-theme .main-content.pro-main,
  .family-theme .main.pro-main {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  .app-topbar.topbar,
  .app-topbar {
    gap: 12px;
  }

  .topbar-actions {
    width: auto;
    max-width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  .public-nav {
    width: calc(100% - 18px) !important;
    min-height: 62px !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    border-radius: 22px !important;
  }

  .public-nav .brand {
    flex: 1 1 auto;
    gap: 8px;
  }

  .public-nav .brand-logo {
    width: 36px !important;
    height: 36px !important;
    border-radius: 12px;
  }

  .public-nav .brand span {
    max-width: 112px;
    font-size: 20px;
    line-height: 1;
  }

  .public-nav-actions {
    flex: 0 0 auto;
    gap: 6px !important;
  }

  .public-nav-actions .btn.small {
    min-height: 40px;
    padding: 8px 10px !important;
    font-size: 12px !important;
    line-height: 1.05;
    white-space: nowrap;
  }

  .fm-public-hero,
  .section,
  .feature-strip,
  .public-section {
    width: calc(100% - 24px) !important;
  }

  .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px !important;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .auth-page .auth-wrap.auth-saas-wrap,
  .auth-page .auth-saas-wrap {
    width: calc(100% - 24px) !important;
    padding-top: 12px !important;
  }

  .auth-page .auth-card,
  .auth-page .auth-saas-card,
  .auth-page .pro-register-card {
    padding: 22px 18px !important;
    border-radius: 26px !important;
  }

  .auth-page .auth-intro {
    display: none;
  }

  .auth-page .input,
  .auth-page .form-control,
  .auth-page textarea,
  .auth-page select {
    min-height: 52px;
    font-size: 16px;
  }

  .family-theme .main-content.pro-main,
  .family-theme .main.pro-main {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .content-frame {
    width: 100%;
    padding-top: 14px;
  }

  .mobile-bottom-nav {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    z-index: 1200 !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 380px) {
  .public-nav-actions .btn-light.small {
    display: none;
  }

  .public-nav .brand span {
    max-width: 138px;
  }
}
