/* DEC mobile layout — distinct from desktop (≤991.98px) */

@media (max-width: 991.98px) {
  .site-shell-inner,
  .container,
  .container-fluid.buy-nav-container,
  .site-public-nav__shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* —— Public top nav —— */
  .site-public-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
  }

  .site-public-nav__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .site-public-nav .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .site-public-nav.site-public-nav--convert {
    min-height: 0;
  }

  .site-public-nav .site-public-nav__logo-icon {
    height: 22px;
  }

  .site-public-nav .site-public-nav__logo-word {
    font-size: 0.95rem;
  }

  .site-public-nav .site-public-nav__brand-tag {
    font-size: 0.9rem;
    color: var(--nmy-ink, #1a1a1a);
  }

  .site-public-nav__shell {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .site-public-nav__toggler {
    flex-shrink: 0;
    order: 2;
    border: 1px solid #dee2e6;
    padding: 0.35rem 0.55rem;
  }

  .site-public-nav__actions {
    order: 3;
    margin-left: 0 !important;
    flex: 0 0 auto;
    gap: 0.35rem;
  }

  .site-public-nav__actions .site-nav-search {
    width: 118px;
    min-width: 100px;
    flex: 0 1 118px;
  }

  .site-public-nav__collapse {
    order: 4;
    flex: 1 0 100%;
    width: 100%;
  }

  .site-public-nav__links {
    width: 100%;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid #eef0f3;
    margin-top: 0.25rem;
  }

  .site-public-nav__actions .site-nav-locale-select {
    width: auto;
    min-width: 4.5rem;
    height: 34px;
    font-size: 12px;
    padding: 0 0.35rem;
  }

  .site-public-nav__links .nav-link {
    padding: 0.65rem 0.25rem;
    font-size: 0.9375rem;
    border-radius: 0.375rem;
  }

  .site-public-nav__links .nav-link.active {
    color: #212529 !important;
    background: #f5f6f8;
    padding-left: 0.75rem;
  }

  .site-public-nav__auth {
    width: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .site-public-nav__auth .nav-auth-guest {
    width: 100%;
    justify-content: stretch;
    gap: 0.5rem;
  }

  .site-public-nav__auth .nav-auth-guest .nav-link {
    flex: 1;
    text-align: center;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 40px;
    background: #fff !important;
    border: 1.5px solid var(--nmy-green, #00c35a) !important;
    border-radius: 999px;
    padding: 0 0.75rem !important;
    margin: 0 !important;
    color: var(--nmy-green, #00c35a) !important;
    font-weight: 600;
    box-sizing: border-box !important;
  }

  .site-public-nav__auth .nav-auth-guest .nav-link:last-child {
    background: #fff !important;
    border-color: var(--nmy-green, #00c35a) !important;
    color: var(--nmy-green, #00c35a) !important;
  }

  .site-public-nav__cta {
    width: 100%;
    margin-top: 0.5rem;
  }

  .site-public-nav__cta-btn {
    width: 100%;
    height: 40px !important;
    text-align: center;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box !important;
  }

  .site-public-nav__auth .nav-user-menu {
    width: auto;
    margin: 0.35rem 0 0 auto;
  }

  .site-public-nav__auth .nav-user-menu__dropdown {
    right: 0;
    left: auto;
    min-width: 240px;
  }

  .site-public-nav__auth .nav-user-panel {
    width: 100%;
    justify-content: space-between;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
  }

  .site-public-nav__auth .nav-user-panel .nav-link {
    padding: 0 !important;
  }

  /* —— Homepage fallback hero —— */
  .page-home-fallback {
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
  }

  .page-home-fallback__title {
    font-size: 1.5rem !important;
    line-height: 1.25;
    margin-bottom: 0.75rem;
  }

  .page-home-fallback__lead {
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
  }

  .page-home-fallback__actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
  }

  .page-home-fallback__actions .btn {
    width: 100%;
    margin: 0 !important;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-size: 0.9375rem;
  }

  .page-home-fallback__card {
    border-radius: 0.75rem;
  }

  .page-home-fallback__card .card-body {
    padding: 1.125rem;
  }

  /* —— Homepage modules —— */
  .hp-hero-split__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hp-hero-split__btn {
    width: 100%;
    text-align: center;
  }

  .hp-hero-split {
    padding: 1.75rem 0 2rem;
  }

  .hp-hero-split__heading {
    font-size: 1.625rem;
  }

  .hp-layout-module {
    padding: 2rem 0;
  }

  .hp-layout-stack__media .hp-layout-img {
    max-width: 100%;
  }

  /* —— Buy page —— */
  .page-buy .buy-pricing-header {
    padding: 1.5rem 0.75rem 1rem;
  }

  .page-buy .buy-pricing-title {
    font-size: 1.5rem;
  }

  .page-buy .buy-checkout-card {
    border-radius: 0.75rem;
    padding: 1.125rem;
  }

  .page-buy .buy-btn-primary {
    width: 100%;
    min-width: 0;
  }

  .page-buy .buy-payment-row {
    flex-direction: column;
  }

  .page-buy .payment-method {
    max-width: none;
    width: 100%;
  }

  /* —— Download page —— */
  .page-download .dl-hero {
    padding: 2rem 0 1.25rem;
  }

  .page-download .dl-hero-title {
    font-size: 1.625rem;
  }

  .page-download .dl-feature-body .nmy-btn {
    width: 100%;
    justify-content: center;
  }

  /* —— Auth modal (homepage) —— */
  .user-auth-modal .modal-dialog {
    margin: 0.75rem;
    max-width: calc(100% - 1.5rem);
  }

  .user-auth-modal .modal-content {
    border-radius: 0.75rem;
  }

  .user-auth-modal .auth-btn {
    width: 100%;
    min-width: 0;
  }

  .user-auth-modal .input-group-row {
    flex-wrap: wrap;
  }

  .user-auth-modal .phone-field-row {
    flex-wrap: nowrap;
  }

  .user-auth-modal .phone-country-select {
    max-width: 42%;
    min-width: 6.5rem;
    font-size: 12px;
  }

  .user-auth-modal .btn-send-code {
    flex: 1 1 auto;
    min-width: 6rem;
  }

  /* —— Standalone login/register —— */
  body.user-auth-page {
    padding: 0;
    align-items: stretch;
  }

  .user-auth-panel {
    max-width: none;
    min-height: 100vh;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .user-auth-panel .info-wrap {
    padding: 1.25rem 1rem 2rem;
  }

  .user-auth-panel .auth-btn,
  .user-auth-panel .btn-wrap .btn {
    width: 100%;
  }

  /* —— User center —— */
  .user-center-shell {
    padding: 0;
  }

  .user-center-frame {
    box-shadow: none;
    max-width: none;
  }

  .user-center-topbar__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    color: #303133;
    flex-shrink: 0;
  }

  .user-center-topbar__menu:hover {
    background: #f5f6f8;
  }

  .user-center-topbar__brand {
    font-size: 0.9375rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-center-topbar .nav-user-panel {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem 0.25rem 0.35rem;
  }

  .user-center-topbar .nav-user-name {
    display: none;
  }

  .user-center-topbar .nav-user-logout {
    display: none;
  }

  .user-center-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .user-center-sidebar-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  .user-center-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 1050;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
    padding-top: 0.5rem;
  }

  .user-center-sidebar.is-open {
    transform: translateX(0);
  }

  .user-center-sidebar .nav {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
  }

  .user-center-sidebar .nav-link {
    padding: 0.7rem 1.25rem;
    border-left-width: 3px;
  }

  .user-center-sidebar__close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem 0.25rem;
  }

  .user-center-sidebar__close-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
  }

  .user-center-main {
    padding: 1rem 0.875rem 1.5rem;
    width: 100%;
  }

  .user-center-frame > .d-flex.flex-grow-1 {
    flex-direction: column;
  }

  body.user-sidebar-open {
    overflow: hidden;
  }

  /* —— Footer —— */
  .site-footer-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.75rem !important;
    justify-items: center;
    align-items: center;
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .site-footer-sep {
    display: none;
  }

  .site-footer-link,
  .site-footer-text {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.15rem 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.35;
  }

  .site-footer-copy {
    font-size: 0.75rem;
    padding: 0 0.5rem;
  }
}

@media (max-width: 575.98px) {
  .user-auth-modal .modal-dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100%;
    display: flex;
    align-items: stretch;
  }

  .user-auth-modal .modal-content {
    min-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .user-auth-modal .form-item {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }

  .user-auth-modal .form-item__label {
    flex: none;
    text-align: left;
    padding-top: 0;
  }

  .user-auth-modal .form-item__content {
    width: 100%;
    align-self: stretch;
  }
}

@media (min-width: 992px) {
  .user-center-topbar__menu,
  .user-center-sidebar__close,
  .user-center-sidebar-backdrop {
    display: none !important;
  }
}
