/* ═══════════════════════════════════════════════════════════
   RESPONSIVE.CSS — Sanraj Supplier Hub
   Mobile-First Breakpoint System
   Breakpoints: 320 | 480 | 768 | 1024 | 1440
   Decision: Tables → horizontal scroll with momentum (no card transform)
   ═══════════════════════════════════════════════════════════ */

/* ── 0. BASE OVERFLOW PROTECTION ── */
html {
  overflow-x: auto;
  width: 100%;
}
body {
  overflow-x: auto;
  width: 100%;
  max-width: none;
}

/* Mobile-only structures stay completely out of desktop layout. */
.mobile-bottom-nav,
.mobile-menu-close,
.mobile-page-header,
.mobile-seller-profile,
.cu-mobile-cat-header,
.cu-mobile-chevron {
  display: none;
}

/* ── 1. APP SHELL — MOBILE FOUNDATION ── */

/* On mobile: the app uses full-width single column */
#app {
  display: none; /* JS shows it */
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* App body: sidebar + main. Mobile = 1 col */
.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  position: relative;
}

/* ── 2. SIDEBAR DRAWER — MOBILE ── */

@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  /* Sidebar becomes an off-canvas drawer */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    min-width: unset !important;
    z-index: 1000 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15) !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Overlay backdrop */
  .sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .sb-overlay.open {
    display: block;
    opacity: 1;
  }

  /* App body goes full width — sidebar is out of normal flow */
  .app-body {
    grid-template-columns: 1fr !important;
    height: calc(100vh - var(--header-h));
  }

  /* Main content: full width */
  .main-content {
    grid-column: 1 !important;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile browsers with "Desktop site" enabled expose a desktop-width layout
   while still having coarse touch input. Keep the desktop shell intact and
   allow horizontal scroll instead of clipping half the dashboard. */
@media (min-width: 768px) and (pointer: coarse) {
  html,
  body {
    overflow-x: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  #app {
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
  }

  .app-body {
    max-width: none !important;
    overflow: visible !important;
  }

  .main-content {
    overflow-x: auto !important;
    max-width: none !important;
  }
}

/* ── 3. TOPNAV — MOBILE LAYOUT ── */

@media (max-width: 767px) {
  .topnav {
    padding: 0 12px !important;
    gap: 8px !important;
    height: var(--header-h) !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Show hamburger */
  .hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    font-size: 20px;
    padding: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
  }
  .hamburger:hover,
  .hamburger:active {
    background: rgba(0, 0, 0, 0.05);
  }

  /* Logo area: no fixed width, no border */
  .topnav-logo {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    border-right: none !important;
    padding: 0 8px !important;
    height: auto !important;
  }

  /* Hide "Growth Panel" label text on mobile */
  .topnav-logo > div > div[style*="Growth Panel"] {
    display: none !important;
  }

  /* Hide search center bar on mobile */
  .topnav-center {
    display: none !important;
  }

  /* Right icons: compact */
  .topnav-right {
    gap: 4px !important;
    padding: 0 !important;
    flex-shrink: 0;
  }

  /* Hide profile name text on mobile */
  .profile-name-sm {
    display: none !important;
  }

  /* Nav icon buttons: touch-friendly */
  .nav-icon-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    flex-shrink: 0;
  }

  /* Profile pill: compact */
  .profile-pill {
    padding: 5px !important;
    gap: 0 !important;
  }
}

/* ── 4. MAIN CONTENT & PAGE LAYOUT ── */

@media (max-width: 767px) {
  .main-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  .page {
    padding: 16px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .pg-hdr {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .pg-hdr > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pg-hdr > div:last-child button,
  .pg-hdr > div:last-child select {
    flex: 1;
    min-width: 120px;
  }

  .pg-title {
    font-size: clamp(16px, 4.5vw, 22px) !important;
  }
}

/* ── 5. STATS GRIDS — RESPONSIVE ── */

/* Mobile default: 1 column */
.stats-row,
.grid-4,
.pay-sum-grid {
  grid-template-columns: 1fr !important;
}

/* 480px+: 2 columns */
@media (min-width: 480px) {
  .stats-row,
  .grid-4,
  .pay-sum-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 1024px+: 4 columns (desktop) */
@media (min-width: 1024px) {
  .stats-row,
  .grid-4,
  .pay-sum-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Stat cards: always full width of their grid cell */
.stat-card,
.pay-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  min-width: 0 !important;
}

/* ── 6. PAGE-SPECIFIC LAYOUTS ── */

/* Home layout: 2-col desktop → 1-col mobile */
.home-layout,
.grid-2-1 {
  grid-template-columns: 1fr !important;
}

@media (min-width: 1024px) {
  .home-layout {
    grid-template-columns: 1fr 300px !important;
  }
  .grid-2-1 {
    grid-template-columns: 2fr 1fr !important;
  }
}

/* Analytics / Growth 2fr 1fr panels */
@media (max-width: 767px) {
  /* Any inline grid-template-columns: 2fr 1fr */
  .home-main,
  .home-side {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Three-column grids */
.three-col {
  grid-template-columns: 1fr !important;
}
@media (min-width: 480px) {
  .three-col {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (min-width: 1024px) {
  .three-col {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Support grid */
.support-grid {
  grid-template-columns: 1fr !important;
}
@media (min-width: 768px) {
  .support-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Form row (2 columns) */
.form-row,
.form-row-2 {
  grid-template-columns: 1fr !important;
}
@media (min-width: 768px) {
  .form-row,
  .form-row-2 {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Promo grid inside growth page */
.promo-grid {
  grid-template-columns: 1fr !important;
}
@media (min-width: 480px) {
  .promo-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ── 7. CARDS — FULL WIDTH ON MOBILE ── */

@media (max-width: 767px) {
  .card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 14px !important;
  }

  .insight-card {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ── 8. TABLES — HORIZONTAL SCROLL WITH MOMENTUM ── */

/* Wrap all table containers for scrolling */
.tbl-wrap {
  width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box;
}

.tbl-scroll {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
  scroll-snap-type: x proximity;
}

/* Ensure the table itself has a minimum width so columns don't squeeze */
.tbl-scroll table,
.tbl-wrap table {
  min-width: 560px;
}

/* Visual scroll hint: subtle fade on the right edge */
@media (max-width: 767px) {
  .tbl-wrap {
    position: relative;
  }

  /* Scroll indicator on orders/inventory tables */
  .tbl-scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; /* room for scrollbar */
  }

  /* Tabs: horizontal scroll, no wrap */
  .m-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    padding-bottom: 0;
    scrollbar-width: none; /* Firefox */
  }
  .m-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  .m-tab {
    flex-shrink: 0 !important;
    white-space: nowrap;
    padding: 10px 14px !important;
  }
}

/* ── 9. FILTER BAR — MOBILE STACK ── */

@media (max-width: 767px) {
  .m-filters {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .m-filters > div[style*="width: 250px"],
  .m-filters > div[style*="position: relative; width"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  .m-filters input[type="text"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  .m-filters .m-select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #ord-sla-filter,
  #inv-cat-filter {
    display: block !important;
    width: 100% !important;
    max-width: calc(100vw - 52px) !important;
    min-width: 0 !important;
  }

  /* "flex: 1" spacer divs: collapse on mobile */
  .m-filters > div[style="flex:1"] {
    display: none !important;
  }
}

/* ── 10. DROPDOWNS — CONSTRAIN TO VIEWPORT ── */

@media (max-width: 767px) {
  .notif-box,
  .dropdown-notif {
    position: fixed !important;
    top: calc(var(--header-h, 64px) + 8px) !important;
    width: min(320px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - var(--header-h, 64px) - 24px) !important;
    right: 12px !important;
    left: auto !important;
    overflow: hidden !important;
  }

  .notif-box .notif-list,
  .dropdown-notif .notif-list {
    max-height: calc(100dvh - var(--header-h, 64px) - 92px) !important;
    overflow-y: auto !important;
  }

  .profile-drop {
    width: min(220px, calc(100vw - 24px)) !important;
    right: 0 !important;
    left: auto !important;
  }
}

/* ── 11. MODALS — MOBILE SAFE ── */

@media (max-width: 767px) {
  .modal-bg {
    padding: 12px !important;
    align-items: flex-end !important; /* bottom sheet feel */
  }

  .modal {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 20px !important;
  }
}

/* ── 12. FORMS — MOBILE OPTIMIZED ── */

@media (max-width: 767px) {
  .form-input,
  .form-select,
  .m-select {
    font-size: 16px !important; /* Prevent iOS zoom on focus */
    min-height: 46px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .btn,
  .btn-orange,
  .btn-green,
  .btn-outline,
  .btn-primary {
    min-height: 44px;
    font-size: 14px;
  }

  .nav-item {
    min-height: 44px !important;
  }
}

/* ── 13. UPLOAD WIZARD — MOBILE ── */

@media (max-width: 767px) {
  .upload-wizard {
    max-width: 100% !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .wizard-step {
    padding: 16px !important;
    margin-bottom: 16px !important;
    border-radius: 12px !important;
  }

  .drag-drop-zone {
    padding: 24px 16px !important;
  }

  /* Stepper: compact on mobile */
  .v-stepper {
    padding: 0 4px !important;
    margin-bottom: 20px !important;
  }

  .v-step-lbl {
    font-size: 9px !important;
  }
}

/* ── 14. CATEGORY SELECTOR (MEESHO-STYLE) ── */

@media (max-width: 767px) {
  .meesho-cat-container {
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
  }

  .meesho-cat-col {
    min-width: unset !important;
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    max-height: 180px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .meesho-cat-col:last-child {
    border-bottom: none !important;
  }

  .cat-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 12px !important;
    gap: 10px !important;
  }

  .cat-card {
    padding: 12px 8px !important;
    min-height: 80px !important;
  }

  .cat-icon {
    width: 50px !important;
    height: 50px !important;
    line-height: 50px !important;
    font-size: 26px !important;
    margin-bottom: 8px !important;
  }

  .cat-name {
    font-size: 12px !important;
  }

  .cat-search-box {
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
  }
}

/* ── 15. PROFILE / SETTINGS SPLIT LAYOUT ── */

@media (max-width: 767px) {
  .meesho-split-layout {
    grid-template-columns: 1fr !important;
    max-height: none !important;
    overflow: visible !important;
    gap: 16px !important;
  }

  .meesho-sidebar-menu {
    position: static !important;
    border-radius: 10px !important;
    padding: 8px 0 !important;
  }

  /* Horizontal tabs on mobile for the menu */
  .meesho-sidebar-menu {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    white-space: nowrap;
    border-radius: 10px !important;
    padding: 8px !important;
    scrollbar-width: none;
    flex-direction: row !important;
  }
  .meesho-sidebar-menu::-webkit-scrollbar {
    display: none;
  }

  .meesho-menu-item {
    border-left: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 10px 14px !important;
    flex-shrink: 0 !important;
    font-size: 12px !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    border-radius: 8px !important;
  }

  .meesho-menu-item.active {
    border-left-color: transparent !important;
    border-bottom-color: var(--orange2) !important;
    background: #fff8f5 !important;
  }

  .meesho-menu-item svg {
    width: 18px !important;
    height: 18px !important;
  }

  .meesho-content-pane {
    max-height: none !important;
    overflow-y: visible !important;
    padding: 16px !important;
    border-radius: 10px !important;
  }
}

/* ── 16. HOME PAGE WELCOME BANNER ── */

@media (max-width: 767px) {
  /* Progress tracker steps: vertical on very small screens */
  #page-home > div:first-child {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: flex-start !important;
  }

  #page-home > div:first-child > div:last-child {
    align-self: flex-end;
  }
}

/* ── 17. HOME PAGE: Progress tracker 3-step row ── */

@media (max-width: 479px) {
  /* The 3-step flex row in home page progress card */
  div[style*="display: flex; border-bottom: 1px solid"] {
    flex-direction: column !important;
  }
}

/* ── 18. STICKY VERIFY BAR ── */

@media (max-width: 767px) {
  .sticky-verify-bar {
    margin: -16px -16px 16px !important;
    padding: 10px 16px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
}

/* ── 19. LEGAL MODAL ── */

@media (max-width: 767px) {
  .legal-overlay-modal {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .legal-modal-content {
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 85vh !important;
  }
}

/* ── 20. TOAST — BOTTOM CENTER ON MOBILE ── */

@media (max-width: 767px) {
  #toast-container {
    bottom: 16px !important;
    right: 12px !important;
    left: 12px !important;
    align-items: stretch !important;
  }

  .toast {
    min-width: unset !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ── 21. OTP BOXES — MOBILE SCALE ── */

@media (max-width: 479px) {
  .otp-box {
    width: 44px !important;
    height: 52px !important;
    font-size: 1.2rem !important;
  }
  .otp-inputs {
    gap: 8px !important;
  }
}

/* ── 22. AUTH PAGE — MOBILE ── */

@media (max-width: 479px) {
  #auth-page {
    padding: 16px !important;
    padding-top: 24px !important;
  }

  .auth-card,
  #auth-card-container {
    padding: 24px 16px !important;
    border-radius: 12px !important;
  }

  /* Full-width auth card below 480px */
  #auth-card-container {
    max-width: 100% !important;
  }

  /* Switcher section below auth card */
  div[style*="max-width: 420px"] {
    max-width: 100% !important;
  }
}

/* ── 23. INLINE GRID OVERRIDES (target anonymous inline grids) ── */

@media (max-width: 767px) {
  /* Business Insights 2-col grid inside dashboard card */
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Any 2fr 1fr analytics/growth grid */
  div[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Any explicit 260px sidebar grid (settings) */
  div[style*="grid-template-columns: 260px"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 24. SPECIFIC FIXED-WIDTH OVERRIDES ── */

@media (max-width: 767px) {
  /* Orders search input */
  #page-orders div[style*="width: 250px"],
  #page-inventory div[style*="width: 250px"] {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Growth panel label in topnav */
  div[style*="Growth Panel"] {
    display: none !important;
  }

  /* Page header action buttons: full width stack */
  .pg-hdr button {
    padding: 8px 14px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }

  /* Bar chart: ensure it doesn't overflow */
  .bar-chart {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Grid-specific inline styles override */
  .stats-row[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 374px) {
  .stats-row,
  .grid-4,
  .pay-sum-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── 25. CATALOG GRID — RESPONSIVE ── */

@media (max-width: 767px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-top: 16px !important;
  }

  .cat-card {
    padding: 16px 12px !important;
    min-height: 80px !important;
  }
}

@media (max-width: 374px) {
  .cat-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── 26. TABLET REFINEMENTS (768px – 1023px) ── */

@media (min-width: 768px) and (max-width: 1023px) {
  .stats-row,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .home-layout {
    grid-template-columns: 1fr !important;
  }

  .page {
    padding: 20px !important;
  }

  /* Sidebar: show permanently on tablet */
  .sidebar {
    position: fixed !important;
    transform: translateX(0) !important;
  }

  .app-body {
    grid-template-columns: var(--sidebar-w) 1fr !important;
  }

  .hamburger {
    display: none !important;
  }
}

/* ── 27. DESKTOP (1024px+) ── */

@media (min-width: 1024px) {
  .app-body {
    grid-template-columns: var(--sidebar-w) 1fr;
  }

  .hamburger {
    display: none !important;
  }

  .sidebar {
    position: fixed !important;
    transform: translateX(0) !important;
  }

  /* Sidebar collapsed state */
  .app-body.sidebar-collapsed {
    grid-template-columns: var(--sidebar-w-collapsed) 1fr;
  }
}

/* ── 28. MISC UTILITY OVERRIDES ── */

/* Ensure no element can cause horizontal overflow */
* {
  max-width: 100%;
}

/* Exception: allow tables to be wider than parent (scroll handles it) */
table {
  max-width: none;
}

/* Images always responsive */
img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Prevent white-space: nowrap overflow on small elements */
@media (max-width: 479px) {
  .breadcrumb {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
}

/* ── 29. SCROLLBAR STYLING FOR HORIZONTAL TABLES ── */

/* Show thin scrollbar on table containers (UX signal) */
.tbl-scroll::-webkit-scrollbar {
  height: 4px;
}
.tbl-scroll::-webkit-scrollbar-track {
  background: var(--gray-100, #f3f4f6);
  border-radius: 4px;
}
.tbl-scroll::-webkit-scrollbar-thumb {
  background: var(--primary, #F5A623);
  border-radius: 4px;
}

/* sanraj-mobile-tablet-fix: final responsive-only containment layer */
@media (max-width: 1024px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .app-body,
  .main-content,
  .page,
  .page.active {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .page:not(.active),
  .page[hidden] {
    display: none !important;
  }

  .page.active {
    display: block !important;
  }

  .main-content {
    overflow-x: hidden !important;
  }

  .card,
  .fg-card,
  .cu-card,
  .catreq-card,
  .settings-card,
  .verification-card,
  .adv-card,
  .sub-card,
  .ntf-card,
  .modal,
  .legal-modal-content {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  img,
  video,
  canvas {
    max-width: 100% !important;
    height: auto;
  }

  .tbl-scroll,
  .table-wrap,
  .table-responsive,
  .orders-table-wrap,
  .returns-table-wrap,
  .adv-table-wrap,
  .cu-cat-columns {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  table {
    width: max-content;
    min-width: 100%;
  }

  .notif-box,
  .notification-dropdown,
  .notifications-dropdown {
    position: fixed !important;
    top: calc(var(--header-h, 64px) + 8px) !important;
    width: min(320px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100dvh - var(--header-h, 64px) - 24px) !important;
    right: 16px !important;
    left: auto !important;
    overflow: hidden !important;
    z-index: 99999 !important;
  }

  .notif-box .notif-list,
  .notification-dropdown .notif-list,
  .notifications-dropdown .notif-list {
    max-height: calc(100dvh - var(--header-h, 64px) - 92px) !important;
    overflow-y: auto !important;
  }

  .modal,
  .modal-content,
  .legal-modal-content,
  .adv-modal,
  .adv-m,
  .adv-m-content {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    overflow: auto !important;
  }
}

@media (max-width: 768px) {
  .app-body {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: min(280px, 85vw) !important;
    max-width: 85vw !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    z-index: 1000 !important;
  }

  .sidebar.mobile-open,
  .sidebar.open,
  body.sidebar-open .sidebar {
    transform: translateX(0) !important;
  }

  .main-content {
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding-left: 0 !important;
  }

  .page {
    padding: 14px !important;
    overflow-x: hidden !important;
  }

  .form-row,
  .form-grid,
  .fg-form-grid,
  .fg-tools-grid,
  .cu-form-grid,
  .cu-preview-grid,
  .catreq-form-grid,
  .settings-grid,
  .support-grid,
  .home-layout,
  .adv-chart-row,
  .adv-mid-row,
  .grid-2,
  .grid-2-1,
  .three-col,
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 2fr 1fr"],
  div[style*="grid-template-columns: 260px"] {
    grid-template-columns: 1fr !important;
  }

  .form-group input,
  .form-group select,
  .form-group textarea,
  input,
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
  }

  button,
  .btn,
  .btn-orange,
  .btn-primary,
  input[type="button"],
  input[type="submit"],
  input[type="reset"] {
    max-width: 100%;
  }

  .pg-hdr,
  .sticky-header,
  .m-filters,
  .modal-hdr,
  .button-row {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .pg-hdr > *,
  .sticky-header > *,
  .m-filters > *,
  .modal-hdr > *,
  .button-row > * {
    min-width: 0 !important;
  }

  .modal-bg,
  .legal-overlay-modal,
  .adv-mbg.open {
    padding: 12px !important;
    align-items: center !important;
  }

  .modal,
  .legal-modal-content,
  .adv-m,
  .adv-modal {
    width: 100% !important;
  }

  .meesho-split-layout {
    grid-template-columns: 1fr !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .meesho-sidebar-menu {
    position: relative !important;
    top: auto !important;
    display: flex !important;
    overflow-x: auto !important;
    padding: 0 !important;
  }

  .meesho-menu-item {
    flex: 0 0 auto;
    white-space: nowrap;
    border-left: 0 !important;
    border-bottom: 4px solid transparent;
  }

  .meesho-menu-item.active {
    border-bottom-color: var(--orange2, #d97706);
  }

  .meesho-content-pane {
    max-height: none !important;
    overflow: visible !important;
    padding: 16px !important;
  }
}

@media (max-width: 480px) {
  .topnav,
  .topnav-left,
  .topnav-right {
    min-width: 0 !important;
  }

  .topnav-right {
    margin-left: auto !important;
  }

  .profile-pill {
    max-width: 44px !important;
    padding: 5px !important;
  }

  .profile-name-sm {
    display: none !important;
  }

  .page {
    padding: 10px !important;
  }

  .card,
  .fg-card,
  .wizard-step,
  .cu-card,
  .catreq-card,
  .settings-card,
  .verification-card {
    padding: 14px !important;
  }

  .stats-row,
  .grid-4,
  .pay-sum-grid,
  .ntf-stat-cards,
  .adv-kpi-grid,
  .adv-qa-grid,
  .sub-stats-grid {
    grid-template-columns: 1fr !important;
  }

  button,
  .btn,
  .btn-orange,
  .btn-primary {
    min-width: 0 !important;
    white-space: normal !important;
  }

  .otp-row,
  .button-row,
  .modal-hdr {
    flex-wrap: wrap !important;
  }

  .notif-box,
  .notification-dropdown,
  .notifications-dropdown {
    position: fixed !important;
    top: calc(var(--header-h, 64px) + 8px) !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - var(--header-h, 64px) - 24px) !important;
    overflow: hidden !important;
  }
}

/* sanraj-mobile-app-shell: rules below are isolated from desktop */
@media (max-width: 767px) {
  :root { --mobile-bottom-nav-h: 68px; }

  body { background: #f4f6f9; }
  #app { min-height: 100dvh; height: 100dvh; }
  .app-body { height: calc(100dvh - var(--header-h)) !important; }
  .main-content {
    padding-bottom: var(--mobile-bottom-nav-h) !important;
    overscroll-behavior-y: contain;
  }
  .page { padding: 14px 12px 24px !important; }

  .hamburger { display: none !important; }
  .topnav {
    position: relative;
    z-index: 900;
    min-width: 0;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .06);
  }
  .topnav-logo { padding-left: 0 !important; }
  .topnav-logo img { max-width: 132px !important; height: 36px !important; }
  .topnav-right .nav-icon-btn,
  .topnav-right .profile-pill { flex: 0 0 40px; }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    height: calc(var(--mobile-bottom-nav-h) + env(safe-area-inset-bottom));
    padding: 5px 4px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    background: #fff;
    border-top: 1px solid #dfe3e8;
    box-shadow: 0 -5px 18px rgba(15, 23, 42, .08);
  }
  .mobile-bottom-nav button {
    appearance: none;
    position: relative;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #6b7280;
    min-width: 0 !important;
    min-height: 56px;
    padding: 5px 2px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font: inherit;
    cursor: pointer;
  }
  .mobile-bottom-nav button::before {
    content: '';
    position: absolute;
    top: 0;
    width: 38px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: transparent;
  }
  .mobile-bottom-nav button.active {
    color: var(--orange-d, var(--primary-d, #d97706));
    background: var(--orange-l, #fff8ec);
  }
  .mobile-bottom-nav button.active::before { background: var(--orange, var(--primary, #f5a623)); }
  .mobile-nav-icon { font-size: 20px; line-height: 1; }
  .mobile-nav-label { font-size: 10px; line-height: 1.2; font-weight: 800; }

  .mobile-page-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 850;
    min-height: 54px;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    background: #fff;
    border-bottom: 1px solid #e8edf3;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .05);
  }
  .mobile-page-header.show {
    display: grid;
  }
  .mobile-page-back {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #475569;
    display: grid;
    place-items: center;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
  }
  .mobile-page-back:active {
    background: var(--orange-l, #fff8ec);
    color: var(--orange-d, #e68a00);
  }
  .mobile-page-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    font-weight: 900;
    color: #1f2937;
    letter-spacing: -.01em;
  }

  .sidebar {
    top: 0 !important;
    bottom: var(--mobile-bottom-nav-h) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100dvh - var(--mobile-bottom-nav-h)) !important;
    padding-bottom: 0 !important;
    background: #fff !important;
    color: #1f2937 !important;
    box-shadow: none !important;
    z-index: 1100 !important;
    transform: translateY(100%) !important;
    transition: transform .24s ease !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.mobile-open,
  .sidebar.open,
  body.sidebar-open .sidebar {
    transform: translateY(0) !important;
  }
  .sidebar-header {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: auto;
    padding: 18px 16px 18px !important;
    background: #fff !important;
    border-bottom: 1px solid #e5e7eb !important;
  }
  .sidebar-header::before {
    content: 'Menu';
    display: block;
    margin-bottom: 18px;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 900;
    color: #111827;
  }
  .sidebar-header.mobile-profile-ready > div:not(.mobile-seller-profile),
  .sidebar-header > div:not(.mobile-seller-profile) {
    display: none !important;
  }
  .mobile-seller-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
  }
  .mobile-seller-avatar {
    width: 78px;
    height: 78px;
    min-width: 78px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--orange-l, #fff8ec);
    color: var(--orange-d, #e68a00);
    border: 1px solid #ffe3b0;
    box-shadow: 0 3px 10px rgba(245, 166, 35, .12);
    font-size: 28px;
    font-weight: 950;
    letter-spacing: -.04em;
  }
  .mobile-seller-info {
    min-width: 0;
    flex: 1;
  }
  .mobile-seller-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 19px;
    line-height: 1.2;
    font-weight: 900;
    color: #111827;
  }
  .mobile-seller-meta {
    margin-top: 9px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: #8a93a3;
    font-size: 13px;
    font-weight: 700;
  }
  .mobile-rating-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--orange-l, #fff8ec);
    color: var(--orange-d, #e68a00);
    font-weight: 900;
  }
  .sidebar-header > div > div:last-child { color: #111827 !important; }
  .sidebar-header > div > div:last-child span { color: #64748b !important; }
  .mobile-menu-close {
    display: none !important;
  }
  .sidebar-body {
    padding: 10px 16px 10px !important;
    background: #fff;
  }
  .sidebar .nav-item[data-page="home"] {
    display: none !important;
  }
  .sidebar a.nav-item[href*="admin/dashboard.php"] {
    display: none !important;
  }
  .sidebar .nav-section-ttl {
    margin: 20px 0 8px !important;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    color: #8a93a3 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: .01em;
    text-transform: none !important;
  }
  .sidebar .nav-item {
    min-height: 58px !important;
    margin: 0 !important;
    padding: 11px 2px !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-bottom: 0 !important;
    color: #334155 !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
  }
  .sidebar .nav-item::after { content: none !important; }
  .sidebar .nav-item.active::before,
  .sidebar .nav-item.active::after {
    display: none !important;
    content: none !important;
  }
  .sidebar .nav-item:hover,
  .sidebar .nav-item:active {
    background: var(--orange-l, #fff8ec) !important;
  }
  .sidebar .nav-item.active {
    background: #fff !important;
    color: #334155 !important;
    border-left-color: transparent !important;
  }
  .sidebar .nav-icon-wrap {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 10px;
    display: grid !important;
    place-items: center !important;
    background: #f8fafc;
    color: inherit;
    font-size: 18px;
  }
  .sidebar .nav-label {
    font-size: 17px !important;
    line-height: 1.25;
    font-weight: 750 !important;
    color: inherit;
  }
  .sidebar .nav-badge {
    background: var(--orange-l, #fff8ec) !important;
    color: var(--orange-d, #e68a00) !important;
    border: 1px solid #ffd89a !important;
    font-weight: 900 !important;
  }
  #catalog-submenu,
  #promotions-submenu {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .22s ease, opacity .18s ease;
  }
  #catalog-submenu.mobile-expanded,
  #promotions-submenu.mobile-expanded {
    opacity: 1;
  }
  #catalog-submenu .nav-item,
  #promotions-submenu .nav-item {
    min-height: 46px !important;
    padding-left: 48px !important;
    font-size: 16px !important;
  }
  #catalog-arrow,
  #promotions-arrow {
    display: inline-grid !important;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: auto !important;
    padding: 0 !important;
    border-radius: 50%;
    color: #6b7280 !important;
    font-size: 12px !important;
    font-weight: 900;
    transition: transform .2s ease, background .2s ease;
  }
  #catalog-arrow:active,
  #promotions-arrow:active {
    background: var(--orange-l, #fff8ec);
  }
  .sidebar-footer { display: none !important; }
  .sb-overlay { display: none !important; }
  .sb-overlay.open { display: none !important; }

  .stats-row,
  .grid-4,
  .pay-sum-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .stats-row .card,
  .stats-row .stat-card,
  .grid-4 .card { padding: 13px 10px !important; }

  .page .card,
  .fg-card,
  .cu-card,
  .settings-card,
  .verification-card { border-radius: 12px !important; }

  .page .tbl-wrap,
  .page .tbl-scroll,
  .page .table-wrap,
  .page .table-responsive,
  .page .cu-upload-table-wrap,
  .page .qd-table-wrap,
  .page .adv-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .page table { min-width: 620px; }
  .pg-hdr > div:last-child,
  .button-row,
  .fg-actions,
  .cu-upload-actions { width: 100%; }
  .pg-hdr > div:last-child > button,
  .pg-hdr > div:last-child > select,
  .button-row > button { min-height: 44px; }

  /* Home mobile onboarding */
  #page-home {
    padding: 0 0 22px !important;
    background: #f3f6fb;
  }
  #page-home .home-welcome-card {
    margin: 0 !important;
    padding: 24px 16px 6px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  #page-home .home-welcome-card h1 {
    font-size: 21px !important;
    line-height: 1.18 !important;
    letter-spacing: -0.02em;
  }
  #page-home .home-welcome-card p {
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: #7b8190 !important;
  }
  #page-home .home-welcome-card .btn-orange {
    width: auto !important;
    height: 38px !important;
    min-width: 112px !important;
    max-width: 132px !important;
    padding: 7px 11px !important;
    border-radius: 20px !important;
    justify-content: center !important;
    gap: 7px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    color: var(--text, #1A202C) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
  }
  #page-home .home-welcome-card .btn-orange span {
    margin: 0 !important;
    font-size: 14px !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    display: inline-grid !important;
    place-items: center !important;
  }
  #page-home .home-mobile-grid {
    display: block !important;
    padding: 0 !important;
    gap: 0 !important;
  }
  #page-home .home-progress-card {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }
  #page-home .home-steps-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    border-bottom: 1px solid #eef1f5 !important;
    background: #fff !important;
  }
  #page-home .home-step-item {
    min-width: 0 !important;
    padding: 20px 4px 13px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    border-bottom-width: 3px !important;
    background: #fff !important;
    text-align: center !important;
  }
  #page-home .home-step-item > span:first-child {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    box-shadow: 0 3px 8px rgba(34, 197, 94, .12);
  }
  #page-home .home-step-done {
    border-bottom-color: transparent !important;
  }
  #page-home .home-step-done > span:first-child {
    background: #2eae3f !important;
    color: #fff !important;
    border: 0 !important;
  }
  #page-home .home-step-active {
    border-bottom-color: var(--orange, #f5a623) !important;
  }
  #page-home .home-step-active > span:first-child {
    background: var(--orange-l, #fff8ec) !important;
    color: var(--orange-d, #e68a00) !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  #page-home .home-step-label {
    display: block !important;
    max-width: 100% !important;
    font-size: 0 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    text-align: center !important;
  }
  #page-home .home-step-label::after {
    content: attr(data-mobile-label);
    font-size: 12px;
    font-weight: 800;
    color: #2f3747;
  }
  #page-home .home-step-done .home-step-label::after {
    color: #2f9e44;
  }
  #page-home .home-step-active .home-step-label::after {
    color: var(--orange-d, #e68a00);
  }
  #page-home .home-live-card {
    margin: 16px !important;
    padding: 18px !important;
    border: 1px solid #e8ebf0 !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    align-items: flex-start !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
  }
  #page-home .home-live-card > div:first-child {
    width: 92px !important;
    height: 92px !important;
    min-width: 92px !important;
    border-radius: 12px !important;
    font-size: 44px !important;
  }
  #page-home .home-live-card > div:nth-child(2) {
    min-width: 0 !important;
    flex: 1 1 calc(100% - 110px) !important;
  }
  #page-home .home-live-card > div:nth-child(2) > div:first-child {
    font-size: 19px !important;
    line-height: 1.2 !important;
  }
  #page-home .home-live-card > div:nth-child(2) > div:nth-child(2) {
    font-size: 13px !important;
  }
  #page-home .home-live-card > div:nth-child(2) > div:nth-child(3) {
    flex: 1 0 100% !important;
    margin-top: 18px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    display: block !important;
  }
  #page-home .home-live-card > div:nth-child(2) > div:nth-child(3) > span,
  #page-home .home-live-card > div:nth-child(2) > div:nth-child(3) > div {
    display: none !important;
  }
  #page-home .home-live-card > div:nth-child(2) > div:nth-child(3) button {
    width: 100% !important;
    min-height: 50px !important;
    border-radius: 7px !important;
    background: var(--orange, #f5a623) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 900 !important;
  }
  #page-home .home-live-card > div:nth-child(2) > div:nth-child(3) button::before {
    content: 'View / Manage Catalogs';
    font-size: 16px;
  }
  #page-home .home-live-card > div:nth-child(2) > div:nth-child(3) button {
    font-size: 0 !important;
  }
  #page-home .home-growth-card {
    margin: 0 0 14px !important;
    padding: 18px 16px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 14px !important;
  }
  #page-home .home-growth-card > div:first-child {
    align-items: flex-start !important;
    gap: 14px !important;
  }
  #page-home .home-growth-card > div:first-child > div:first-child {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 50% !important;
    font-size: 21px !important;
  }
  #page-home .home-growth-card > div:first-child > div:last-child > div:first-child {
    font-size: 16px !important;
    line-height: 1.25 !important;
  }
  #page-home .home-growth-card > div:first-child > div:last-child > div:last-child {
    margin-top: 5px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
  }
  #page-home .home-growth-card .btn-orange {
    margin-left: 58px !important;
    margin-top: 12px !important;
    min-height: 42px !important;
    padding: 8px 28px !important;
    border-radius: 7px !important;
    font-size: 17px !important;
    color: var(--orange-d, #e68a00) !important;
    border-color: var(--orange, #f5a623) !important;
    background: #fff !important;
  }
  #page-home .home-learn-card {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 12px 12px 0 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  #page-home .home-learn-card > div:first-child {
    padding: 18px 16px 10px !important;
    border-bottom: 0 !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
  }
  #page-home .home-learn-card > div:nth-child(2) > div {
    padding: 14px 16px !important;
  }
  #page-home .home-learn-card > div:nth-child(2) > div:first-child {
    align-items: flex-start !important;
  }
  #page-home .home-learn-card > div:nth-child(2) > div:first-child > div:first-child {
    width: 38px !important;
    height: 38px !important;
    display: grid !important;
    place-items: center !important;
    background: var(--orange-l, #fff8ec) !important;
    border-radius: 4px !important;
    font-size: 20px !important;
  }
  #page-home .home-learn-card > div:nth-child(2) > div:first-child div[style*="font-size: 13px"] {
    font-size: 15px !important;
    line-height: 1.35 !important;
  }
  #page-home .home-learn-card > div:nth-child(2) > div:first-child div[style*="font-size: 11px"] {
    margin-top: 6px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  /* Food & Grocery */
  #page-catalog-food .fg-header { margin-bottom: 14px; }
  #page-catalog-food .fg-stepper {
    padding: 12px 8px !important;
    gap: 4px !important;
    overflow: hidden !important;
  }
  #page-catalog-food .fg-step { min-width: 0 !important; }
  #page-catalog-food .fg-step-label { font-size: 9px !important; }
  #page-catalog-food .fg-step-circle { width: 28px !important; height: 28px !important; }
  #page-catalog-food .fg-card,
  #page-catalog-food .fg-key-form-panel,
  #page-catalog-food .fg-key-guide { padding: 15px !important; }
  #page-catalog-food .fg-cat-products { grid-template-columns: 1fr !important; padding: 8px !important; }
  #page-catalog-food .fg-key-payment-actions button,
  #page-catalog-food .fg-key-summary-action,
  #page-catalog-food .fg-key-action-btn { width: 100% !important; }

  /* Profile & Settings */
  #page-settings {
    padding-left: 12px !important;
    padding-right: 12px !important;
    overflow-x: hidden !important;
  }
  #page-settings .meesho-split-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #page-settings .meesho-sidebar-menu {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #page-settings .meesho-menu-item {
    min-width: 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
  #page-settings .meesho-content-pane {
    padding: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  #page-settings .meesho-tab-content,
  #page-settings .edit-form-wrapper,
  #page-settings .form-group,
  #page-settings .form-group-split,
  #page-settings .form-row-2,
  #page-settings .input-with-prefix {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  #page-settings .form-group-split,
  #page-settings .form-row-2,
  #page-settings .meesho-tab-content div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  #page-settings .meesho-tab-content div[style*="justify-content:space-between"] {
    align-items: flex-start !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
  }
  #page-settings .meesho-tab-content button,
  #page-settings .btn,
  #page-settings .btn-orange {
    max-width: 100% !important;
    white-space: normal !important;
  }
  #page-settings .meesho-tab-content input,
  #page-settings .meesho-tab-content select,
  #page-settings .meesho-tab-content textarea {
    font-size: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  #page-settings #sig-uploaded-preview {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Upload Catalog overview and tables */
  #page-catalog-upload .cu-upload-head,
  #page-catalog-upload .cu-upload-overview { padding: 16px 14px !important; }
  #page-catalog-upload .cu-upload-actions { grid-template-columns: 1fr !important; gap: 10px !important; }
  #page-catalog-upload .cu-upload-tabs { overflow-x: auto; padding: 0 6px; }
  #page-catalog-upload .cu-upload-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 14px 12px 10px;
  }
  #page-catalog-upload .cu-upload-filters { align-items: stretch; padding: 12px; }
  #page-catalog-upload .cu-filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 3px;
  }
  #page-catalog-upload .cu-filter-chip { flex: 0 0 auto; white-space: nowrap; }

  /* Add Single Catalog mobile category drill-down */
  #page-catalog-upload.mobile-single-active {
    padding: 0 0 20px !important;
    background: #fff;
  }
  #page-catalog-upload.mobile-single-active > .cu-cat-shell { gap: 0; }
  #page-catalog-upload.mobile-single-active .adv-hdr,
  #page-catalog-upload.mobile-single-active .cu-process-rail,
  #page-catalog-upload.mobile-single-active .cu-panel-intro { display: none !important; }
  #page-catalog-upload .cu-cat-panel.mobile-single-selector {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff;
    min-height: calc(100dvh - var(--header-h) - var(--mobile-bottom-nav-h));
  }
  #page-catalog-upload .mobile-single-selector .cu-mobile-cat-header {
    min-height: 64px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 4;
  }
  #page-catalog-upload .cu-mobile-cat-back,
  #page-catalog-upload .cu-mobile-cat-help {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #475569;
    font-size: 24px;
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  #page-catalog-upload .cu-mobile-cat-help { font-size: 19px; }
  #page-catalog-upload .cu-mobile-cat-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    font-size: 18px;
    font-weight: 900;
  }
  #page-catalog-upload .mobile-single-selector .cu-cat-toolbar {
    padding: 18px 14px !important;
    border-bottom: 8px solid #f1f5f9;
  }
  #page-catalog-upload .mobile-single-selector .cu-cat-toolbar::before { display: none; }
  #page-catalog-upload .mobile-single-selector .cu-cat-search {
    width: 100%;
    flex-basis: 100%;
    min-height: 50px;
    border-radius: 9px;
  }
  #page-catalog-upload .mobile-single-selector .cu-cat-body { display: block !important; }
  #page-catalog-upload .mobile-single-selector .cu-cat-columns {
    display: block !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }
  #page-catalog-upload .mobile-single-selector .cu-cat-col {
    display: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
  }
  #page-catalog-upload .mobile-single-selector .cu-cat-col.mobile-current { display: block !important; }
  #page-catalog-upload .mobile-single-selector .cu-cat-col-title { display: none !important; }
  #page-catalog-upload .mobile-single-selector .cu-cat-item,
  #page-catalog-upload .mobile-single-selector .cu-cat-item:not(.active) {
    min-height: 58px;
    padding: 15px 18px !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: #fff !important;
    color: #1f2937 !important;
    font-size: 15px;
    font-weight: 700;
  }
  #page-catalog-upload .mobile-single-selector .cu-cat-item.active { border-left: 0 !important; }
  #page-catalog-upload .mobile-single-selector .cu-cat-item.active::after { display: none; }
  #page-catalog-upload .mobile-single-selector .cu-mobile-chevron {
    display: inline-block;
    flex: 0 0 auto;
    color: #64748b;
    font-size: 24px;
    font-weight: 400;
  }
  #page-catalog-upload .mobile-single-selector.mobile-leaf-selected .cu-cat-toolbar,
  #page-catalog-upload .mobile-single-selector.mobile-leaf-selected .cu-cat-columns { display: none !important; }
  #page-catalog-upload .mobile-single-selector .cu-selected-panel {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  #page-catalog-upload .mobile-single-selector .cu-selected-panel.open { display: flex !important; }
  #page-catalog-upload .mobile-single-selector #cu-single-panel-host { width: 100%; min-width: 0; }
}

@media (max-width: 374px) {
  .stats-row,
  .grid-4,
  .pay-sum-grid { grid-template-columns: 1fr !important; }
}

/* Final override for mobile Chrome "Desktop site".
   Do not force a fake desktop width here; Android Chrome already provides a
   desktop-style layout viewport. Only undo clipping rules from mobile/tablet
   CSS so Chrome can scale/scroll the desktop layout naturally. */
@media (min-width: 768px) and (pointer: coarse) {
  :root {
    --desktop-site-min-w: 1200px;
  }

  html,
  body {
    width: 100vw !important;
    min-height: 100vh !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #app {
    width: var(--desktop-site-min-w) !important;
    min-width: var(--desktop-site-min-w) !important;
    min-height: var(--desktop-site-layout-h, 100vh) !important;
    max-width: none !important;
    overflow: visible !important;
    zoom: 0.64;
    zoom: calc(100vw / var(--desktop-site-min-w));
  }

  .topnav,
  .app-body {
    width: var(--desktop-site-min-w) !important;
    min-width: var(--desktop-site-min-w) !important;
    max-width: none !important;
  }

  .topnav .hamburger {
    display: none !important;
  }

  .app-body {
    grid-template-columns: var(--sidebar-w) minmax(calc(var(--desktop-site-min-w) - var(--sidebar-w)), 1fr) !important;
    min-height: calc(var(--desktop-site-layout-h, 100vh) - var(--header-h)) !important;
    overflow: visible !important;
  }

  .desktop-site-page-menu-btn {
    display: inline-flex !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    margin-right: 8px !important;
    border: 1px solid #fed7aa !important;
    background: #fff7ed !important;
    color: var(--primary) !important;
    border-radius: 10px !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
  }

  .desktop-site-header-strip {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 38px !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 90 !important;
    box-sizing: border-box !important;
  }

  .desktop-site-header-strip .desktop-site-page-menu-btn {
    margin: 0 !important;
    flex: 0 0 34px !important;
  }

  .desktop-site-header-title {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: var(--text) !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
  }

  .desktop-site-title-original {
    display: none !important;
  }

  #page-catalog-food .fg-inner {
    width: calc(100% - 42px) !important;
    max-width: 900px !important;
    margin-left: 42px !important;
    margin-right: auto !important;
  }

  #page-catalog-food .fg-header {
    margin: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  .page:not(.active) .desktop-site-page-menu-btn {
    display: none !important;
  }

  .topnav-logo {
    gap: 10px !important;
  }

  .sidebar {
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
    height: 100% !important;
    min-height: calc(100vh - var(--header-h)) !important;
    overflow: hidden !important;
    transform: none !important;
  }

  .main-content {
    grid-column: 2 !important;
    width: auto !important;
    min-width: calc(var(--desktop-site-min-w) - var(--sidebar-w)) !important;
    max-width: none !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
  }

  body.desktop-site-sidebar-collapsed .app-body {
    grid-template-columns: 0 minmax(var(--desktop-site-min-w), 1fr) !important;
  }

  body.desktop-site-sidebar-collapsed .sidebar {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    border-right: 0 !important;
    overflow: hidden !important;
    transform: translateX(-100%) !important;
    pointer-events: none !important;
  }

  body.desktop-site-sidebar-collapsed .main-content {
    grid-column: 2 !important;
    width: var(--desktop-site-min-w) !important;
    min-width: var(--desktop-site-min-w) !important;
    max-width: none !important;
  }

  body.desktop-site-sidebar-collapsed .topnav-logo {
    width: auto !important;
    min-width: 0 !important;
    border-right: 0 !important;
  }

  .page,
  .page.active {
    max-width: none !important;
    overflow-x: auto !important;
  }

  #page-catalog-upload.mobile-single-active .cu-process-rail,
  #page-catalog-upload.mobile-single-active .cu-panel-intro {
    display: grid !important;
  }

  #page-catalog-upload .cu-cat-panel.mobile-single-selector {
    padding: 0 22px 22px !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    background: #fff !important;
    min-height: 0 !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-mobile-cat-header,
  #page-catalog-upload .mobile-single-selector .cu-mobile-chevron {
    display: none !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-toolbar {
    padding: 18px 0 !important;
    border-bottom: 0 !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-toolbar::before {
    display: block !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-search {
    width: auto !important;
    flex-basis: auto !important;
    min-height: 44px !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 360px !important;
    align-items: stretch !important;
    gap: 22px !important;
    min-width: 0 !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-columns,
  #page-catalog-upload .mobile-single-selector.mobile-leaf-selected .cu-cat-columns {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 430px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-col,
  #page-catalog-upload .mobile-single-selector .cu-cat-col.mobile-current {
    display: block !important;
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 145px !important;
    max-width: none !important;
    max-height: 520px !important;
    overflow-y: auto !important;
    border: 0 !important;
    border-right: 1px solid #e5e7eb !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-col:nth-child(4) {
    flex: 1.25 1 0 !important;
    min-width: 185px !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-col-title {
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    min-height: 46px !important;
    padding: 14px !important;
    align-items: center !important;
    background: #fff !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: var(--text2) !important;
    font-size: 13px !important;
    font-weight: 900 !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-item,
  #page-catalog-upload .mobile-single-selector .cu-cat-item:not(.active) {
    min-height: 49px !important;
    padding: 14px !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: #fff !important;
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-item.active {
    background: #f59e0b !important;
    color: #fff !important;
    border-left: 4px solid var(--primary) !important;
    padding-left: 8px !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-cat-item.active::after {
    display: block !important;
  }

  #page-catalog-upload .mobile-single-selector.mobile-leaf-selected .cu-cat-toolbar {
    display: flex !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-selected-panel {
    display: none !important;
    width: 360px !important;
    min-width: 360px !important;
    min-height: 520px !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  #page-catalog-upload .mobile-single-selector .cu-selected-panel.open,
  #page-catalog-upload .mobile-single-selector.mobile-leaf-selected .cu-selected-panel.open {
    display: flex !important;
  }

  #page-catalog-upload .mobile-single-selector #cu-single-panel-host {
    width: 360px !important;
    min-width: 360px !important;
  }
}
