/* Final mobile polish shared by every page. */
@media (max-width: 760px) {
  :root {
    --container-pad: calc(100% - 24px);
    --touch-size: 44px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;
  }

  main {
    width: 100%;
    min-width: 0;
  }

  .container {
    width: calc(100% - 24px) !important;
    max-width: none !important;
  }

  .section {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .nav-inner {
    min-height: 62px;
    padding: 8px 14px !important;
  }

  .brand {
    min-width: 0;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  .brand-title {
    font-size: 16px !important;
    line-height: 1.05;
  }

  .brand-sub {
    margin-top: 3px;
    font-size: 10px !important;
  }

  .navbar .nav-icon-btn.nav-icon-btn.nav-icon-btn,
  .navbar .nav-profile-link.nav-profile-link.nav-profile-link {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  input,
  select,
  textarea,
  .login-form input,
  .login-form textarea,
  .submit-card input,
  .submit-card select,
  .submit-card textarea {
    max-width: 100%;
    font-size: 16px !important;
  }

  .btn,
  .login-tab,
  .filter-btn,
  .photos-sort-btn {
    min-height: 44px;
  }

  .card,
  .submit-card,
  .login-card,
  .settings-card,
  .photos-command,
  .topics-list-panel,
  .topics-detail-panel {
    border-radius: 18px !important;
  }

  .login-section {
    padding-top: 14px !important;
    padding-bottom: 36px !important;
  }

  .login-card {
    padding: 16px !important;
  }

  .photos-command {
    padding: 14px !important;
  }

  .photos-layout,
  .photos-gallery-shell,
  .settings-grid,
  .settings-main,
  .profile-grid,
  .messages-layout,
  .moderation-layout,
  .submit-page-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .footer-inner {
    padding: 22px 16px calc(18px + var(--safe-bottom, 0px)) !important;
  }

  .footer-top {
    gap: 18px;
  }

  .footer-left p {
    max-width: 44ch;
    line-height: 1.6;
  }

  .icons {
    display: grid !important;
    grid-template-columns: repeat(7, 42px) !important;
    gap: 7px !important;
  }

  .icons a {
    width: 42px !important;
    height: 42px !important;
  }

  .footer-bottom {
    margin-top: 18px;
    padding-top: 14px;
  }
}

@media (max-width: 380px) {
  .container {
    width: calc(100% - 20px) !important;
  }

  .nav-inner {
    padding-inline: 10px !important;
  }

  .brand-title {
    font-size: 15px !important;
  }

  .icons {
    grid-template-columns: repeat(7, 38px) !important;
    gap: 6px !important;
  }

  .icons a {
    width: 38px !important;
    height: 38px !important;
  }
}
