/**
 * ShopGlowsy App Shell — native iOS chrome for the seller web dashboard
 * Matches: GlassBottomNav + Sell sheet + home card proportions
 */

/* —— App top bar —— */
.sg-app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  border-bottom: 1px solid rgba(232, 232, 237, 0.7);
}

.sg-app-header-inner {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  min-height: 52px;
  padding: 6px 14px 10px;
}

.sg-app-header-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(106, 35, 69, 0.18);
}
.sg-app-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sg-app-header-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.35rem, 5.2vw, 1.7rem);
  font-weight: 850;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-app-header-action {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e8e8ed;
  color: #111;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sg-app-header-action:active {
  transform: scale(0.94);
}

.sg-app-header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #ff3b5c;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #f8f9fc, 0 2px 8px rgba(255, 59, 92, 0.45);
  animation: sg-header-badge-pulse 1s ease-in-out infinite alternate;
  z-index: 2;
}

.sg-app-header-badge.is-pop {
  animation: sg-badge-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sg-header-badge-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.14); }
}

@keyframes sg-badge-pop {
  0% { transform: scale(0.6); }
  55% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@keyframes sgBadgePulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

body.sg-dashboard-premium {
  padding-top: 0 !important;
  background:
    radial-gradient(ellipse 120% 70% at 50% -20%, rgba(255, 255, 255, 0.95), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(0, 0, 0, 0.04), transparent 50%),
    radial-gradient(ellipse 70% 45% at 0% 15%, rgba(0, 0, 0, 0.03), transparent 45%),
    #f8f9fc !important;
}

html.sg-dashboard-premium-root {
  background: #f8f9fc;
}

/* Frosted white cover — hides broken/partial HTML on slow or bad network (iOS overlay parity) */
.sg-app-cover {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.sg-app-cover.is-ready {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sg-app-cover.is-offline {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sg-app-cover-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.8px solid rgba(255, 79, 163, 0.18);
  border-top-color: #ff4fa3;
  animation: sgCoverSpin 0.75s linear infinite;
}

.sg-app-cover-msg {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #636366;
  text-align: center;
  max-width: 260px;
  line-height: 1.4;
}

.sg-app-cover-retry {
  margin-top: 4px;
  min-height: 44px;
  padding: 10px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6a2345, #2a0f24);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: none;
}

.sg-app-cover.is-offline .sg-app-cover-retry {
  display: inline-flex;
  align-items: center;
}

.sg-app-cover.is-offline .sg-app-cover-spinner {
  display: none;
}

@keyframes sgCoverSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sg-app-cover-spinner { animation: none; border-top-color: #ff4fa3; }
}


body.sg-dashboard-premium .seller-main {
  padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
}

body.sg-dashboard-premium .sg-store-url-bar,
body.sg-dashboard-premium .sg-float-wa-support {
  display: none !important;
}

/* —— Dashboard layout: immediate + wide —— */
body.sg-dashboard-premium .sd-page {
  padding-top: calc(env(safe-area-inset-top, 0px) + 58px) !important;
  padding-bottom: 8px;
  background: transparent !important;
}

body.sg-dashboard-premium .sd-wrap {
  max-width: 560px !important;
  width: 100% !important;
  padding: 0 10px !important; /* phone: ~92–95% */
}

body.sg-dashboard-premium .sd-band {
  padding: 10px 0 18px !important;
}

body.sg-dashboard-premium .sd-band-hero {
  padding-top: 4px !important;
}

/* —— Heavier cards —— */
body.sg-dashboard-premium .sd-command {
  border-radius: 24px !important;
  padding: 22px 20px 20px !important;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.03),
    0 12px 32px -8px rgba(0, 0, 0, 0.08) !important;
  margin-bottom: 14px !important;
  animation: sgCardIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.sg-dashboard-premium .sd-command-store {
  font-size: clamp(1.55rem, 6vw, 1.85rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.55px !important;
}

body.sg-dashboard-premium .sd-command-status {
  font-size: 16px !important;
  margin-top: 10px !important;
}

body.sg-dashboard-premium .sd-command-sub {
  margin-top: 6px !important;
  font-size: 14.5px !important;
}

body.sg-dashboard-premium .sd-command-capsule {
  margin-top: 18px !important;
  border-radius: 18px !important;
  padding: 8px !important;
}

body.sg-dashboard-premium .sd-command-capsule a,
body.sg-dashboard-premium .sd-command-capsule button {
  padding: 12px 4px !important;
}

body.sg-dashboard-premium .sd-command-capsule i {
  font-size: 1.15rem !important;
}

body.sg-dashboard-premium .sd-sales-hero {
  border-radius: 24px !important;
  padding: 28px 22px 26px !important;
  margin-bottom: 14px !important;
  box-shadow:
    0 12px 28px rgba(255, 79, 163, 0.22),
    0 4px 12px rgba(255, 79, 163, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.04) !important;
  animation: sgCardIn 480ms cubic-bezier(0.22, 1, 0.36, 1) 60ms both;
}

body.sg-dashboard-premium .sd-sales-hero-icon {
  width: 50px !important;
  height: 50px !important;
  border-radius: 16px !important;
  font-size: 1.25rem !important;
}

body.sg-dashboard-premium .sd-sales-hero-value {
  margin-top: 22px !important;
  font-size: clamp(2.1rem, 8.5vw, 2.65rem) !important;
}

body.sg-dashboard-premium .sd-sales-hero-label {
  margin-top: 8px !important;
  font-size: 14px !important;
}

body.sg-dashboard-premium .sd-stat-row {
  gap: 12px !important;
  margin-bottom: 24px !important;
  animation: sgCardIn 500ms cubic-bezier(0.22, 1, 0.36, 1) 100ms both;
}

body.sg-dashboard-premium .sd-stat-mini {
  border-radius: 18px !important;
  padding: 18px 16px !important;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.03),
    0 10px 24px -6px rgba(0, 0, 0, 0.07) !important;
}

body.sg-dashboard-premium .sd-stat-mini-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 13px !important;
}

body.sg-dashboard-premium .sd-stat-mini-value {
  font-size: 1.65rem !important;
}

body.sg-dashboard-premium .sd-ios-action {
  border-radius: 18px !important;
  padding: 18px 16px !important;
  min-height: 84px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.03),
    0 10px 26px -6px rgba(0, 0, 0, 0.08) !important;
  animation: sgCardIn 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.sg-dashboard-premium .sd-ios-action:nth-child(1) { animation-delay: 120ms; }
body.sg-dashboard-premium .sd-ios-action:nth-child(2) { animation-delay: 160ms; }
body.sg-dashboard-premium .sd-ios-action:nth-child(3) { animation-delay: 200ms; }
body.sg-dashboard-premium .sd-ios-action:nth-child(4) { animation-delay: 240ms; }

body.sg-dashboard-premium .sd-ios-action:active {
  transform: scale(0.97) !important;
}

body.sg-dashboard-premium .sd-ios-action-icon {
  width: 54px !important;
  height: 54px !important;
  border-radius: 16px !important;
  font-size: 1.3rem !important;
}

body.sg-dashboard-premium .sd-ios-action-copy strong {
  font-size: 17px !important;
}

body.sg-dashboard-premium .sd-ios-action-copy small {
  font-size: 13.5px !important;
  margin-top: 5px !important;
}

body.sg-dashboard-premium .sd-reach-card,
body.sg-dashboard-premium .sd-stat-card,
body.sg-dashboard-premium .sd-tool-card,
body.sg-dashboard-premium .sd-sub-card {
  border-radius: 20px !important;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.03),
    0 10px 26px -6px rgba(0, 0, 0, 0.08) !important;
}

body.sg-dashboard-premium .sg-section-label,
body.sg-dashboard-premium .sd-section-title {
  margin-top: 8px !important;
  margin-bottom: 14px !important;
}

@keyframes sgCardIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Bottom glass nav + FAB —— */
.sg-glass-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  padding: 0 14px calc(8px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.sg-glass-nav-stack {
  position: relative;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  height: 108px;
  pointer-events: none;
}

.sg-glass-nav-bar {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 8px 2px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  border-radius: 18px 18px 0 0;
  border: 1px solid #e8e8ed;
  border-bottom: none;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  pointer-events: auto;
}

.sg-glass-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px;
  text-decoration: none;
  color: #5c5c5c;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease;
}

.sg-glass-nav-item:active {
  transform: scale(0.9);
}

.sg-glass-nav-item.is-active {
  color: #ff4fa3;
}

.sg-glass-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 14px;
  font-size: 1.25rem;
  transition: padding 240ms cubic-bezier(0.22, 1, 0.36, 1), background 240ms ease;
}

.sg-glass-nav-item.is-active .sg-glass-nav-icon {
  padding: 6px 14px;
  background: rgba(255, 79, 163, 0.14);
  border: 1px solid rgba(255, 79, 163, 0.22);
}

.sg-glass-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sg-glass-nav-item.is-active .sg-glass-nav-label {
  font-weight: 900;
  letter-spacing: 0.15em;
  letter-spacing: 0.05em;
}

.sg-glass-nav-dot {
  width: 0;
  height: 0;
  border-radius: 50%;
  background: #ff4fa3;
  margin-top: 3px;
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1), height 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sg-glass-nav-item.is-active .sg-glass-nav-dot {
  width: 4px;
  height: 4px;
}

.sg-glass-nav-spacer {
  width: 50px;
  flex: 0 0 50px;
}

.sg-sell-fab {
  position: absolute;
  left: 50%;
  bottom: 38px;
  transform: translateX(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: #ff4fa3;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(255, 79, 163, 0.28);
  z-index: 2;
  animation: none;
  transition: transform 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.sg-sell-fab i {
  font-size: 1.2rem;
  line-height: 1;
}

.sg-sell-fab span {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1;
  margin-top: 1px;
}

.sg-sell-fab:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(255, 79, 163, 0.35);
}

.sg-sell-fab:active {
  transform: translateX(-50%) scale(0.94);
}

@keyframes sgFabPulse {
  0%, 100% {
    box-shadow: 0 4px 10px rgba(255, 79, 163, 0.28), 0 0 0 0 rgba(255, 79, 163, 0.3);
  }
  50% {
    box-shadow: 0 6px 16px rgba(255, 79, 163, 0.32), 0 0 0 10px rgba(255, 79, 163, 0);
  }
}

/* —— Sell action sheet —— */
.sg-sell-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(10, 10, 12, 0.45);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.sg-sell-sheet-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sg-sell-sheet {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 1401;
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  border-radius: 28px;
  padding: 14px 22px 22px;
  box-shadow: 0 16px 40px rgba(255, 79, 163, 0.18), 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(110%);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sg-sell-sheet-overlay.is-open + .sg-sell-sheet,
.sg-sell-sheet.is-open {
  transform: translateY(0);
}

.sg-sell-sheet-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 99px;
  background: rgba(92, 92, 92, 0.25);
}

.sg-sell-sheet-kicker {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.4px;
  color: #ff4fa3;
}

.sg-sell-sheet-lead {
  margin: 6px 0 22px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #636366;
}

.sg-sell-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 79, 163, 0.2);
  background: rgba(240, 241, 245, 0.55);
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease;
}

.sg-sell-option:last-child {
  margin-bottom: 0;
}

.sg-sell-option:active {
  transform: scale(0.97);
}

.sg-sell-option.is-accent {
  background: linear-gradient(135deg, #6a2345, #2a0f24);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.sg-sell-option-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #ff4fa3;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.sg-sell-option.is-accent .sg-sell-option-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.sg-sell-option strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.sg-sell-option small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
}

body.sg-sell-open {
  overflow: hidden;
}

/* Phone stays app-narrow; tablet/desktop use real screen width */
@media (min-width: 768px) {
  body.sg-dashboard-premium .sd-wrap {
    max-width: 900px !important;
    padding: 0 28px !important;
  }

  .sg-app-header-inner {
    max-width: 900px;
    padding: 10px 28px 12px;
  }

  .sg-app-header-title {
    font-size: 1.85rem;
  }

  .sg-glass-nav-stack {
    max-width: 900px;
  }

  body.sg-dashboard-premium .sd-ios-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  body.sg-dashboard-premium .sd-stat-row {
    gap: 16px !important;
  }
}

@media (min-width: 1100px) {
  body.sg-dashboard-premium .sd-wrap {
    max-width: 1120px !important;
    padding: 0 32px !important;
  }

  .sg-app-header-inner {
    max-width: 1120px;
    padding: 12px 32px 14px;
  }

  .sg-glass-nav-stack {
    max-width: 640px; /* keep bottom nav comfortable, not stretched wall-to-wall */
  }

  body.sg-dashboard-premium .sd-band-hero .sd-wrap {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px 20px;
    align-items: start;
  }

  /* Keep alerts/sub/actions spanning full width under the hero pair */
  body.sg-dashboard-premium .sd-band-hero .sd-wrap > .sd-alert,
  body.sg-dashboard-premium .sd-band-hero .sd-wrap > .sd-revenue-warning,
  body.sg-dashboard-premium .sd-band-hero .sd-wrap > .sd-sub-card,
  body.sg-dashboard-premium .sd-band-hero .sd-wrap > .sg-section-label,
  body.sg-dashboard-premium .sd-band-hero .sd-wrap > .sd-ios-actions,
  body.sg-dashboard-premium .sd-band-hero .sd-wrap > .sd-actions-compact {
    grid-column: 1 / -1;
  }

  body.sg-dashboard-premium .sd-command {
    margin-bottom: 0 !important;
  }

  body.sg-dashboard-premium .sd-sales-hero {
    margin-bottom: 0 !important;
    height: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  body.sg-dashboard-premium .sd-stat-row {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
    max-width: none;
  }

  body.sg-dashboard-premium .sd-ios-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-sell-fab,
  .sg-app-header-badge,
  body.sg-dashboard-premium .sd-command,
  body.sg-dashboard-premium .sd-sales-hero,
  body.sg-dashboard-premium .sd-ios-action {
    animation: none !important;
  }
}

/* ============================================================
   WEB APP — SPA stage, store hub, skeletons, transitions
   ============================================================ */

body.sg-webapp-shell {
  overscroll-behavior-y: auto;
  background: #f8f9fc !important;
}

body.sg-webapp-shell .seller-main,
.sg-webapp-stage {
  position: relative;
  min-height: 60vh;
  will-change: auto;
  transform: none;
}

.sg-webapp-stage.is-leave-left { animation: sgLeaveLeft 160ms ease forwards; }
.sg-webapp-stage.is-leave-right { animation: sgLeaveRight 160ms ease forwards; }
.sg-webapp-stage.is-leave-fade { animation: sgLeaveFade 140ms ease forwards; }
.sg-webapp-stage.is-enter-left { animation: sgEnterLeft 280ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.sg-webapp-stage.is-enter-right { animation: sgEnterRight 280ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.sg-webapp-stage.is-enter-fade { animation: sgEnterFade 240ms ease both; }

@keyframes sgLeaveLeft {
  to { opacity: 0; transform: translateX(-18px) scale(0.99); }
}
@keyframes sgLeaveRight {
  to { opacity: 0; transform: translateX(18px) scale(0.99); }
}
@keyframes sgLeaveFade {
  to { opacity: 0; transform: translateY(8px); }
}
@keyframes sgEnterLeft {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes sgEnterRight {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes sgEnterFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.sg-webapp-skel {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 14px 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sg-webapp-skel-card,
.sg-webapp-skel-row > div {
  border-radius: 20px;
  background: linear-gradient(90deg, #eee 25%, #f7f7f9 37%, #eee 63%);
  background-size: 400% 100%;
  animation: sgSkel 1.2s ease infinite;
}

.sg-webapp-skel-card { height: 148px; }
.sg-webapp-skel-card--sm { height: 88px; }
.sg-webapp-skel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sg-webapp-skel-row > div { height: 96px; }

@keyframes sgSkel {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.sg-webapp-error {
  max-width: 420px;
  margin: 48px auto;
  padding: 28px 22px;
  text-align: center;
  background: #fff;
  border: 1px solid #e8e8ed;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}
.sg-webapp-error p {
  margin: 0 0 16px;
  font-weight: 600;
  color: #636366;
}

/* Store hub — matches iOS StoreProfileScreen */
.sg-store-hub {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 22px 120px;
}

.sg-sp-profile {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #e8e8ed;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  text-align: center;
  margin-bottom: 16px;
}

.sg-sp-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6a2345, #2a0f24);
  color: #fff;
  font-size: 1.7rem;
  box-shadow: 0 10px 24px rgba(106, 35, 69, 0.4);
}

.sg-sp-name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #111;
}

.sg-sp-url {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #636366;
  word-break: break-all;
}

.sg-sp-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.sg-sp-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 160ms ease;
}

.sg-sp-cta:active { transform: scale(0.97); }

.sg-sp-cta-primary {
  background: linear-gradient(135deg, #6a2345, #2a0f24);
  color: #fff;
}

.sg-sp-cta-ghost {
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  border: 1px solid rgba(255, 79, 163, 0.2);
}

.sg-sp-cta-ghost.is-copied {
  color: #059669;
  border-color: rgba(5, 150, 105, 0.35);
}

.sg-sp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.sg-sp-stats strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
  color: #111;
  letter-spacing: -0.02em;
}

.sg-sp-stats span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #636366;
}

.sg-sp-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.sg-sp-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 79, 163, 0.15);
  color: #111;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  transition: transform 160ms ease;
}

.sg-sp-mini i {
  font-size: 1.15rem;
  color: #ff4fa3;
}

.sg-sp-mini:active { transform: scale(0.97); }

.sg-sp-setup {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #e8e8ed;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 8px;
}

.sg-sp-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sg-sp-setup-head strong {
  font-size: 16px;
  font-weight: 900;
  color: #111;
}

.sg-sp-setup-head span {
  font-weight: 900;
  color: #ff4fa3;
}

.sg-sp-progress {
  height: 8px;
  border-radius: 99px;
  background: #f0f1f5;
  overflow: hidden;
  margin-bottom: 12px;
}

.sg-sp-progress > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: #ff4fa3;
  transition: width 280ms ease;
}

.sg-sp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sg-sp-chip {
  padding: 6px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255, 79, 163, 0.25);
  background: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 800;
  color: #111;
  font-family: inherit;
  cursor: pointer;
}

.sg-sp-chip.is-done {
  background: #ecfdf5;
  border-color: #059669;
  color: #059669;
  cursor: default;
}

.sg-store-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0 14px;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  box-shadow: none;
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  z-index: 40;
  background: rgba(248, 249, 252, 0.96);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sg-store-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #5c5c5c;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  box-shadow: none !important;
}

.sg-store-tab i { display: none; }

.sg-store-tab.is-active {
  background: transparent;
  color: #ff4fa3;
}

.sg-store-tab.is-active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2.5px;
  border-radius: 99px;
  background: #ff4fa3;
}

.sg-store-tab-panel {
  min-height: 40vh;
  transition: opacity 200ms ease, transform 200ms ease;
}
.sg-store-tab-panel.is-swap {
  animation: sgEnterFade 240ms ease both;
}

.sg-sp-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-sp-tool {
  display: grid;
  grid-template-columns: 40px 1fr 16px;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: #111;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.sg-sp-tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 79, 163, 0.1);
  color: #ff4fa3;
}

.sg-sp-tool > .fa-chevron-right {
  color: #c7c7cc;
  font-size: 0.85rem;
}

.sg-sp-logout {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #111;
  text-decoration: none;
  font-weight: 800;
}

/* Hide nested page chrome when loaded inside SPA stage */
.sg-webapp-stage .pc-back,
.sg-webapp-stage .seller-nav,
.sg-webapp-stage .sg-app-header {
  display: none !important;
}

body.sg-webapp-shell .pc-page {
  padding-top: 8px !important;
}

@media (min-width: 768px) {
  .sg-store-hub { padding: 16px 28px 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-webapp-stage.is-leave-left,
  .sg-webapp-stage.is-leave-right,
  .sg-webapp-stage.is-leave-fade,
  .sg-webapp-stage.is-enter-left,
  .sg-webapp-stage.is-enter-right,
  .sg-webapp-stage.is-enter-fade,
  .sg-store-tab-panel.is-swap,
  .sg-webapp-skel-card,
  .sg-webapp-skel-row > div {
    animation: none !important;
  }
}

/* Web App shell — persistent chrome on all primary tabs */
body.sg-webapp-shell {
  padding-top: 0 !important;
}

body.sg-webapp-shell .seller-main,
body.sg-webapp-shell.sg-product-create .seller-main,
body.sg-webapp-shell.sg-import-center .seller-main {
  padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important;
}

body.sg-webapp-shell .sg-app-header ~ .seller-main,
body.sg-webapp-shell.sg-product-create .seller-main {
  padding-top: calc(62px + env(safe-area-inset-top, 0px));
}

body.sg-webapp-shell .pc-back,
body.sg-webapp-shell .seller-nav {
  display: none !important;
}

body.sg-webapp-shell .pc-page {
  padding-top: 8px !important;
}

body.sg-webapp-shell.sg-import-center .sg-glass-nav-bar {
  background: rgba(28, 18, 32, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
}

body.sg-webapp-shell.sg-import-center .sg-glass-nav-label,
body.sg-webapp-shell.sg-import-center .sg-glass-nav-icon {
  color: rgba(255, 255, 255, 0.55);
}

body.sg-webapp-shell.sg-import-center .sg-glass-nav-item.is-active .sg-glass-nav-label,
body.sg-webapp-shell.sg-import-center .sg-glass-nav-item.is-active .sg-glass-nav-icon {
  color: #ff4fa3;
}

/* —— iOS Products grid (Store → Products) —— */
.sg-ios-products-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.sg-ios-products-head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: #111;
  letter-spacing: -0.03em;
}
.sg-ios-products-head p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #636366;
}
.sg-ios-products-add {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6a2345, #2a0f24);
  color: #fff;
  text-decoration: none;
  border: none;
  box-shadow: 0 8px 18px rgba(106, 35, 69, 0.28);
  font-size: 1rem;
  cursor: pointer;
}

.sg-ios-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sg-ios-product-card {
  position: relative;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
}

.sg-ios-product-hit {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-height: 210px;
}

.sg-ios-product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, rgba(255,79,163,0.12), rgba(106,35,69,0.08));
  overflow: hidden;
}
.sg-ios-product-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #f0f1f5;
}
.sg-ios-product-media.is-empty::after,
.sg-ios-product-ph {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,79,163,0.12), rgba(106,35,69,0.08));
}

.sg-ios-product-meta {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sg-ios-product-meta strong {
  font-size: 13px;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-ios-product-price {
  font-size: 14px;
  font-weight: 900;
  color: #ff4fa3;
}
.sg-ios-product-hidden {
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  margin-top: 2px;
}

.sg-ios-product-more-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  -webkit-tap-highlight-color: transparent;
}
.sg-ios-product-more-btn:active { transform: scale(0.94); }
.sg-ios-product-media.is-empty {
  background: linear-gradient(135deg, rgba(255,79,163,0.12), rgba(106,35,69,0.08));
}

.sg-ios-empty {
  text-align: center;
  padding: 40px 24px;
}
.sg-ios-empty-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 14px;
  opacity: 0.7;
}
.sg-ios-empty h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 900;
  color: #111;
}
.sg-ios-empty p {
  margin: 0 0 20px;
  color: #636366;
  font-weight: 600;
  line-height: 1.4;
}
.sg-ios-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6a2345, #2a0f24);
  color: #fff !important;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 18px rgba(106, 35, 69, 0.25);
}
.sg-ios-btn-text {
  display: inline-block;
  margin-top: 10px;
  font-weight: 800;
  color: #ff4fa3;
  text-decoration: none;
}

/* —— iOS Imports list (Store → Imports) —— */
.sg-ios-imports.is-hub,
.sg-webapp-stage .sg-ios-imports {
  background: transparent !important;
  color: #111;
  padding: 0;
}
.sg-webapp-stage .sg-ios-imports .ic-back,
.sg-webapp-stage .sg-ios-imports .ic-hero,
.sg-webapp-stage .sg-ios-imports .ic-quick-actions,
.sg-webapp-stage .sg-ios-imports .ic-stats-grid,
.sg-webapp-stage .sg-ios-imports .ic-perf-row {
  display: none !important;
}

.sg-ios-import-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-ios-import-row {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.sg-ios-import-main {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}

.sg-ios-import-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #f0f1f5;
}

.sg-ios-import-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sg-ios-import-copy strong {
  font-size: 14px;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-ios-import-copy span {
  font-size: 12px;
  font-weight: 600;
  color: #636366;
}

.sg-ios-import-trail {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sg-ios-import-trail em {
  font-style: normal;
  font-weight: 900;
  color: #ff4fa3;
  font-size: 14px;
}
.sg-ios-import-trail i {
  color: rgba(99, 99, 102, 0.7);
  font-size: 0.85rem;
}

.sg-ios-import-edit {
  border-top: 1px solid #f0f1f5;
  padding: 0 14px 12px;
}
.sg-ios-import-edit > summary {
  padding: 10px 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: #636366;
  cursor: pointer;
  list-style: none;
}
.sg-ios-import-edit > summary::-webkit-details-marker { display: none; }

.sg-ios-import-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #636366;
  margin-bottom: 6px;
}
.sg-ios-import-price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.sg-ios-import-price-row input {
  border: 1px solid #e8e8ed;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
}
.sg-ios-import-price-row button,
.sg-ios-btn-ghost,
.sg-ios-btn-danger {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.sg-ios-import-price-row button {
  background: linear-gradient(135deg, #6a2345, #2a0f24);
  color: #fff;
}
.sg-ios-btn-ghost {
  width: 100%;
  margin-top: 8px;
  background: #f5f5f7;
  color: #111;
}
.sg-ios-btn-danger {
  width: 100%;
  margin-top: 8px;
  background: #fff1f2;
  color: #b91c1c;
}
.sg-ios-import-status {
  display: inline-block;
  margin: 0 14px 12px;
  padding: 4px 10px;
  border-radius: 99px;
  background: #fff7ed;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
}
.sg-ios-import-foot {
  margin-top: 16px;
  text-align: center;
}

body.sg-webapp-shell .sg-ios-products .pc-settings-head,
.sg-webapp-stage .sg-ios-products-head h1 {
  /* keep compact inside hub */
}
.sg-webapp-stage .sg-ios-products .pc-back {
  display: none !important;
}
.sg-webapp-stage .sg-ios-imports-head { display: none !important; }
.sg-webapp-stage .sg-ios-products .sg-ios-products-head { margin-top: 4px; }
.sg-webapp-stage .sg-ios-products .sg-ios-products-head { display: none !important; }
.sg-webapp-stage .sg-ios-import-foot { margin-bottom: 8px; }


/* —— PERF: disable heavy entrance motion on phones —— */
@media (max-width: 768px) {
  .sd-hero-card,
  .sd-action-tile,
  .sd-compact-card,
  .sd-reach-card,
  .sg-sp-profile,
  .sg-sp-setup {
    animation: none !important;
  }
  html.sg-premium-mode .sg-app-header {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  html.sg-premium-mode .sg-glass-nav-bar {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* Dashboard share sheet leftovers — never paint as raw page content on Orders/etc */
.sg-share-overlay,
.sg-share-celebrate-overlay {
  position: fixed !important;
  inset: 0;
  z-index: 100050;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.sg-share-overlay.open,
.sg-share-celebrate-overlay.open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
