/**
 * Mobile-app shell — login, signup, and client dashboard always render as a
 * phone app. Wide screens get a centered device frame; real phones are full-bleed.
 * Loaded last so these rules win over desktop media queries (which still see
 * the real viewport width).
 */

html.mobile-app {
  --app-width: 430px;
  height: 100%;
  background: #05060a;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.mobile-app body.sinqlo-page {
  position: relative;
  width: 100%;
  max-width: var(--app-width);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  display: flex;
  flex-direction: column;
}

html.mobile-app body.sinqlo-page > .container-fluid {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

html.mobile-app body.sinqlo-page > .container-fluid > .layout-row {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

html.mobile-app .mobile-menu-btn {
  display: flex !important;
}

html.mobile-app .sinqlo-appearance-toggle,
body.sinqlo-page .sinqlo-appearance-toggle {
  display: none !important;
}

html.mobile-app .dash-topbar .bento-pill.d-none,
html.mobile-app .dash-topbar .bento-pill.d-md-inline-flex {
  display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Always-on mobile chrome (sidebar drawer, stacked layout)                    */
/* -------------------------------------------------------------------------- */

html.mobile-app body.sinqlo-page .layout-row {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

html.mobile-app body.sinqlo-page .app-sidebar {
  position: absolute !important;
  top: 0;
  left: 0;
  width: min(280px, 86%);
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 999;
  transform: translateX(-110%);
  transition: transform 0.35s ease;
  border-right: 1px solid var(--sidebar-border, rgba(255, 255, 255, 0.08));
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.28);
}

html.mobile-app.sidebar-open,
html.mobile-app.sidebar-open body.sinqlo-page {
  overflow: hidden;
}

html.mobile-app body.sinqlo-page .app-sidebar.is-open {
  transform: translateX(0);
}

html.mobile-app body.sinqlo-page .sidebar-copyright {
  margin-top: auto;
  padding: 0.85rem 0.65rem calc(1rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted, #cbd5e1);
  border-top: 1px solid var(--sidebar-border, rgba(255, 255, 255, 0.08));
}

html.mobile-app body.sinqlo-page .sidebar-overlay {
  position: absolute !important;
  inset: 0;
  z-index: 998;
}

html.mobile-app body.sinqlo-page .sidebar-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Action drawers/modals must sit above sidebar (999) and sticky topbar (80). */
html.mobile-app body.sinqlo-page.sinqlo-drawer-open .app-sidebar,
html.mobile-app body.sinqlo-page.sinqlo-drawer-open .sidebar-overlay {
  pointer-events: none;
}

/*
 * Phone shell bottom-sheets.
 * Overlay MUST be explicit 100% height (height:auto + inset collapses the
 * sheet to content height and leaves a black gap under the panel).
 */
html.mobile-app body.sinqlo-page .sinqlo-drawer {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1100 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

html.mobile-app body.sinqlo-page .sinqlo-drawer.is-open {
  visibility: visible !important;
  pointer-events: auto !important;
}

html.mobile-app body.sinqlo-page .sinqlo-drawer-backdrop {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 0;
  width: auto !important;
  height: auto !important;
}

html.mobile-app body.sinqlo-page .sinqlo-drawer-panel {
  position: absolute !important;
  z-index: 1;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: min(92%, calc(100% - 0.5rem)) !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: 14px 14px 0 0 !important;
  opacity: 0;
  transform: translate3d(0, 110%, 0) !important;
  transition: opacity 0.22s ease, transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

html.mobile-app body.sinqlo-page .sinqlo-drawer.is-open .sinqlo-drawer-panel {
  opacity: 1 !important;
  transform: none !important;
}

html.mobile-app body.sinqlo-page .sinqlo-drawer-inner {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

html.mobile-app body.sinqlo-page .activation-drawer .sinqlo-drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  background: var(--card, #10131a);
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

html.mobile-app body.sinqlo-page .activation-drawer .sinqlo-drawer-inner,
html.mobile-app body.sinqlo-page .buy-score-drawer .sinqlo-drawer-inner {
  padding-top: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

html.mobile-app body.sinqlo-page .buy-score-drawer .sinqlo-drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  background: var(--card, #10131a);
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

html.mobile-app body.sinqlo-page .activation-drawer .sinqlo-drawer-form {
  gap: 0.85rem;
}

html.mobile-app body.sinqlo-page .activation-drawer .sinqlo-drawer-field {
  margin-bottom: 0;
}

html.mobile-app body.sinqlo-page .activation-drawer .sinqlo-drawer-submit {
  margin-top: 0.35rem;
}

html.mobile-app body.sinqlo-page.sinqlo-drawer-open .sinqlo-theme-customizer {
  display: none !important;
}

html.mobile-app body.sinqlo-page .main-wrap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 0 !important;
  padding-left: 0.9rem !important;
  padding-right: 0.9rem !important;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

html.mobile-app body.sinqlo-page .main-wrap--dashboard {
  padding: 0 0.9rem calc(1rem + env(safe-area-inset-bottom)) !important;
}

html.mobile-app body.sinqlo-page .dash-topbar,
html.mobile-app body.sinqlo-page .dash-topbar--bento,
html.mobile-app body.sinqlo-page .dash-topbar--plain,
html.mobile-app body.sinqlo-page .main-wrap > header.dash-topbar,
html.mobile-app body.sinqlo-page[data-appearance="dark"] .dash-topbar--bento {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  grid-template-columns: none;
  grid-template-areas: none;
  margin: 0 -0.9rem 0.65rem;
  padding: 0.45rem 1.1rem;
  min-height: 3.5rem;
  height: auto;
  position: sticky;
  top: 0;
  z-index: 80;
  overflow: visible;
  background: var(--page, #08090d);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

html.mobile-app body.sinqlo-page .dash-topbar > .mobile-menu-btn,
html.mobile-app body.sinqlo-page .dash-topbar__bar .mobile-menu-btn {
  display: flex !important;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  grid-area: auto;
  order: 1;
  z-index: 1;
}

html.mobile-app body.sinqlo-page .dash-topbar__brand {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 42px;
  line-height: 0;
  grid-area: auto;
  order: 2;
}

html.mobile-app body.sinqlo-page .dash-topbar__brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 11rem);
  max-height: 2.4rem;
  object-fit: contain;
  object-position: center;
}

html.mobile-app body.sinqlo-page .dash-topbar__greeting,
html.mobile-app body.sinqlo-page .dash-topbar__page-title {
  position: static;
  min-width: 0;
  margin: 0 0 0.75rem;
}

html.mobile-app body.sinqlo-page .dash-topbar__page-title {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--deep);
  line-height: 1.2;
}

html.mobile-app body.sinqlo-page .dash-topbar__page-title:empty {
  display: none;
}

html.mobile-app body.sinqlo-page .dash-topbar__actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: 0;
  gap: 0.35rem;
  grid-area: auto;
  order: 3;
}

html.mobile-app body.sinqlo-page .dash-topbar__actions > .d-flex {
  display: flex !important;
  align-items: center;
  gap: 0.35rem !important;
}

html.mobile-app body.sinqlo-page .dash-topbar .circle-btn,
html.mobile-app body.sinqlo-page .dash-topbar .user-menu__toggle {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  font-size: 0.95rem;
}

html.mobile-app body.sinqlo-page .notification-dropdown,
html.mobile-app body.sinqlo-page .user-menu-dropdown {
  left: auto;
  right: 0;
  z-index: 200;
  box-sizing: border-box;
}

html.mobile-app body.sinqlo-page .notification-dropdown {
  width: 17.5rem;
  min-width: 17.5rem;
  max-width: 17.5rem;
}

html.mobile-app body.sinqlo-page .user-menu-dropdown {
  width: 15rem;
  min-width: 15rem;
  max-width: 15rem;
}

/* Bento / dashboard stacks */
html.mobile-app body.sinqlo-page .bento-insight-row,
html.mobile-app body.sinqlo-page .bento-spotlight-row,
html.mobile-app body.sinqlo-page .bento-top-row {
  grid-template-columns: 1fr !important;
}

html.mobile-app body.sinqlo-page .bento-cell--span-5,
html.mobile-app body.sinqlo-page .bento-cell--span-6,
html.mobile-app body.sinqlo-page .bento-cell--span-7,
html.mobile-app body.sinqlo-page .bento-cell--span-4,
html.mobile-app body.sinqlo-page .bento-cell--span-8,
html.mobile-app body.sinqlo-page .bento-cell--row-span-2,
html.mobile-app body.sinqlo-page .profile-page .bento-cell--span-5,
html.mobile-app body.sinqlo-page .profile-page .bento-cell--span-6,
html.mobile-app body.sinqlo-page .profile-page .bento-cell--span-7,
html.mobile-app body.sinqlo-page .withdraw-page .bento-cell--span-5,
html.mobile-app body.sinqlo-page .withdraw-page .bento-cell--span-7,
html.mobile-app body.sinqlo-page .deposit-breakdown,
html.mobile-app body.sinqlo-page .deposit-steps {
  grid-column: span 12 !important;
  grid-row: span 1 !important;
}

html.mobile-app body.sinqlo-page .bento-game-panel__stats {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.mobile-app body.sinqlo-page .games-card-grid {
  grid-template-columns: 1fr !important;
}

html.mobile-app body.sinqlo-page .deposit-hero__grid,
html.mobile-app body.sinqlo-page .deposit-kpi-row,
html.mobile-app body.sinqlo-page .withdraw-hero,
html.mobile-app body.sinqlo-page .withdraw-kpis,
html.mobile-app body.sinqlo-page .wallet-scope-layout,
html.mobile-app body.sinqlo-page .wallet-scope-left,
html.mobile-app body.sinqlo-page .profile-page__row--credentials,
html.mobile-app body.sinqlo-page .deposit-address-body {
  grid-template-columns: 1fr !important;
}

/* FD orders: phone shell is narrow; never keep 2/3-col desktop grid. */
html.mobile-app body.sinqlo-page .fd-orders-list {
  grid-template-columns: 1fr !important;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

html.mobile-app body.sinqlo-page .fd-order-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 0;
}

html.mobile-app body.sinqlo-page .fd-order-card__body {
  min-width: 0;
  overflow-wrap: anywhere;
}

html.mobile-app body.sinqlo-page .fd-order-card__id {
  word-break: break-all;
}

html.mobile-app body.sinqlo-page .fd-order-card__date {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

html.mobile-app body.sinqlo-page .deposit-hero--binary .binary-stats-grid.binary-stats-grid--hero,
html.mobile-app body.sinqlo-page .binary-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.mobile-app body.sinqlo-page .downline-toolbar {
  grid-template-columns: 1fr !important;
}

html.mobile-app body.sinqlo-page .bento-insight,
html.mobile-app body.sinqlo-page .bento-spotlight {
  min-height: 0;
}

/* Bootstrap md/lg/xl columns collapse to the xs rule (col-6 stays half). */
html.mobile-app .row > [class*="col-md-"],
html.mobile-app .row > [class*="col-lg-"],
html.mobile-app .row > [class*="col-xl-"] {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
}

html.mobile-app .row > .col-6 {
  width: 50%;
  max-width: 50%;
}

html.mobile-app .row > .col-12 {
  width: 100%;
  max-width: 100%;
}

/* -------------------------------------------------------------------------- */
/* Auth — always the stacked mobile screen                                     */
/* -------------------------------------------------------------------------- */

html.mobile-app body.auth-v2-page--split {
  height: auto !important;
  min-height: 100dvh !important;
  max-height: none !important;
  overflow: auto !important;
}

html.mobile-app .auth-v2--split {
  display: flex !important;
  flex-direction: column;
  grid-template-columns: 1fr !important;
  width: 100%;
  max-width: none;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 1.1rem 1.25rem;
  gap: 0;
  align-items: stretch;
}

html.mobile-app .auth-v2__desktop-only {
  display: none !important;
}

html.mobile-app .auth-v2__mobile-only {
  display: flex !important;
}

html.mobile-app .auth-v2__hero {
  display: block;
  height: auto !important;
  max-height: none !important;
  padding: 1.15rem 0 0.7rem;
  overflow: visible;
  border-right: 0 !important;
}

html.mobile-app .auth-v2__hero-inner {
  margin: 0;
  max-width: none;
  overflow: visible;
}

html.mobile-app .auth-v2__hero-title {
  font-size: 1.65rem;
  margin-bottom: 0.4rem;
}

html.mobile-app .auth-v2__hero-text {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

html.mobile-app .auth-v2__form-side {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  padding: 0 0 0.5rem;
}

html.mobile-app .auth-v2__card,
html.mobile-app .auth-v2__card--auth {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none;
  overflow: visible;
  border-radius: 18px;
  padding: 1.1rem 1rem;
  box-sizing: border-box;
}

html.mobile-app .auth-v2__form-grid {
  grid-template-columns: 1fr !important;
}

html.mobile-app .auth-v2__brand-logo {
  max-width: min(160px, 52vw);
  max-height: 2.5rem;
}

html.mobile-app .auth-v2__mobile-foot {
  flex-direction: column;
  align-items: center;
  margin-top: 1.1rem;
  padding-bottom: env(safe-area-inset-bottom);
  text-align: center;
}

html.mobile-app body.sinqlo-page.auth-v2-page[data-appearance="dark"] .auth-v2__hero {
  min-height: 0;
  background:
    radial-gradient(520px 240px at 18% 0%, rgb(var(--color-primary-rgb) / 0.32), transparent 62%),
    transparent;
}

html.mobile-app body.sinqlo-page.auth-v2-page[data-appearance="dark"] .auth-v2__form-side {
  background: transparent;
}

/* -------------------------------------------------------------------------- */
/* Desktop / tablet: centered phone device                                     */
/* -------------------------------------------------------------------------- */

@media (min-width: 481px) {
  html.mobile-app {
    overflow: hidden;
  }

  html.mobile-app body.sinqlo-page {
    position: relative;
    height: min(calc(100dvh - 24px), 920px);
    min-height: 0;
    margin: 12px auto;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.04),
      0 28px 80px rgba(0, 0, 0, 0.55);
    /* Absolute drawers/sidebar are contained by position:relative + overflow. */
  }

  html.mobile-app body.sinqlo-page > .container-fluid,
  html.mobile-app body.sinqlo-page .layout-row {
    height: 100%;
    min-height: 0 !important;
  }

  html.mobile-app body.sinqlo-page .main-wrap {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  html.mobile-app body.sinqlo-page .app-sidebar {
    height: 100%;
  }

  html.mobile-app body.auth-v2-page--split {
    height: min(calc(100dvh - 24px), 920px) !important;
    max-height: min(calc(100dvh - 24px), 920px) !important;
    overflow: hidden !important;
  }

  html.mobile-app body.auth-v2-page .auth-v2--split {
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  html.mobile-app {
    background: var(--page, #08090d);
  }

  html.mobile-app body.sinqlo-page {
    max-width: none;
    border-radius: 0;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.mobile-app body.sinqlo-page .app-sidebar {
    transition: none;
  }
}
