/* =========================================================
   SorryShop Storefront V2 — Digital Counter
   Clean consolidated storefront stylesheet
   ========================================================= */
.store-body {
  --store-max: 1320px;
  --store-gutter: 22px;
  padding-bottom: 0;
  background:
    linear-gradient(rgba(var(--action-500-rgb), .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--action-500-rgb), .025) 1px, transparent 1px),
    var(--ink-950);
  background-size: 48px 48px;
}
.store-body.app-loading { overflow: hidden; }
.store-body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: -1;
  height: 300px;
  pointer-events: none;
  background: radial-gradient(circle at 30% 0%, rgba(var(--action-500-rgb), .105), transparent 54%);
}

/* Header -------------------------------------------------- */
.storefront-header { padding: 0; }
.store-header-inner {
  width: min(100%, var(--store-max));
  min-height: var(--header-h);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px var(--store-gutter);
}
.store-logo { gap: 11px; }
.store-logo-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.08; }
.store-logo-copy strong { overflow: hidden; font-size: 18px; letter-spacing: -.03em; text-overflow: ellipsis; }
.store-logo-copy small {
  display: block;
  margin-top: 4px;
  color: var(--text-500);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.store-header-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  padding: 5px 8px;
  border: 1px solid rgba(var(--success-500-rgb), .18);
  border-radius: var(--radius-sm);
  color: var(--success-500);
  background: rgba(var(--success-500-rgb), .045);
  font-size: 10px;
  font-weight: 600;
}
.live-dot,
.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--success-500);
  box-shadow: 0 0 10px rgba(var(--success-500-rgb), .55);
}
.status-dot.loading { background: var(--text-500); box-shadow: none; }
.status-dot.error { background: var(--danger-500); box-shadow: 0 0 10px rgba(var(--danger-500-rgb), .45); }
.status-dot.warning { background: var(--warning-500); box-shadow: 0 0 10px rgba(var(--warning-500-rgb), .4); }
.header-login { min-width: 104px; border-color: rgba(var(--action-500-rgb), .38); background: rgba(var(--action-500-rgb), .08); }

/* Main shell --------------------------------------------- */
.store-shell {
  width: min(100%, var(--store-max));
  margin: 0 auto;
  padding: 28px var(--store-gutter) 72px;
  animation: store-shell-in .36s ease-out both;
}
@keyframes store-shell-in { from { opacity: 0; } to { opacity: 1; } }

/* Hero ---------------------------------------------------- */
.store-hero {
  position: relative;
  isolation: isolate;
  min-height: 276px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  align-items: stretch;
  gap: 32px;
  margin-bottom: 22px;
  padding: 34px 38px;
  border: 1px solid rgba(var(--action-500-rgb), .22);
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) var(--radius-xs);
  background: rgba(var(--surface-800-rgb), .96);
  box-shadow: 0 24px 72px rgba(var(--ink-950-rgb), .26);
}
.store-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--action-500);
}
.hero-glow { display: none; }
.hero-copy { min-width: 0; align-self: center; }
.hero-kicker {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-300);
  font-size: 11px;
  font-weight: 500;
}
.store-hero h1 {
  max-width: 800px;
  margin: 0 0 16px;
  color: var(--text-100);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.hero-gradient { color: rgba(var(--text-100-rgb), .76); }
.store-hero p { max-width: 700px; color: var(--text-500); font-size: 14px; line-height: 1.72; }
.hero-badges {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  max-width: 700px;
  margin-top: 25px;
  border-top: 1px solid rgba(var(--line-600-rgb), .72);
}
.hero-badges span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 12px 0 0;
  color: var(--text-300);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}
.hero-badges i {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--action-500-rgb), .38);
  border-radius: 50%;
  color: var(--text-100);
  background: rgba(var(--action-500-rgb), .09);
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
}
.hero-status {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(var(--line-600-rgb), .72);
  border-radius: var(--radius-lg);
  background: rgba(var(--line-600-rgb), .62);
}
.hero-metric {
  min-height: 112px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 19px 17px;
  background: var(--ink-900);
}
.metric-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
}
.metric-icon.violet { color: var(--text-300); background: rgba(var(--action-500-rgb), .1); }
.metric-icon.green { color: var(--success-500); background: rgba(var(--success-500-rgb), .08); }
.hero-metric small { display: block; margin-bottom: 2px; color: var(--text-500); font-size: 10.5px; }
.hero-metric strong { display: flex; align-items: baseline; gap: 5px; color: var(--text-100); font-size: 24px; letter-spacing: -.025em; }
.hero-metric strong em,
.hero-metric > div > em { color: var(--text-500); font-size: 10px; font-style: normal; font-weight: 400; }
.metric-status { align-items: center !important; font-size: 12px !important; letter-spacing: 0 !important; }

/* Recent orders: canonical V7 definitions live in the unified component layer below. */

/* Store navigation --------------------------------------- */
.store-nav {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 3px;
  margin-bottom: 32px;
  padding: 5px;
  border: 1px solid rgba(var(--line-600-rgb), .7);
  border-radius: var(--radius-lg);
  background: rgba(var(--ink-950-rgb), .91);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(var(--ink-950-rgb), .16);
}
.tab {
  position: relative;
  min-width: 0;
  min-height: 46px;
  border-color: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-500);
  background: transparent;
  white-space: nowrap;
  font-weight: 600;
}
.tab:hover { border-color: transparent; background: rgba(var(--surface-700-rgb), .72); }
.tab.active { border-color: rgba(var(--action-500-rgb), .16); color: var(--text-100); background: rgba(var(--action-500-rgb), .09); }
.tab.active::after {
  content: "";
  position: absolute;
  inset: auto 24% 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--action-500);
}
.nav-icon { color: rgba(var(--action-500-rgb), .82); font-size: 16px; line-height: 1; }
.store-view { min-width: 0; }

/* Section headings --------------------------------------- */
.catalog-heading {
  align-items: flex-end;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(var(--line-600-rgb), .6);
}
.catalog-heading h2 { margin-bottom: 3px; font-size: 25px; }
.section-subtitle { max-width: 720px; color: var(--text-500); font-size: 11.5px; line-height: 1.6; }
.catalog-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }

/* Catalog controls --------------------------------------- */
.catalog-tools {
  margin-bottom: 22px;
  padding: 12px;
  overflow: visible;
  border-color: rgba(var(--line-600-rgb), .7);
  border-radius: var(--radius-lg);
  background: rgba(var(--surface-800-rgb), .94);
}
.catalog-search-row,
.catalog-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.catalog-search { min-width: 0; }
.catalog-search input { min-height: 48px; padding-right: 70px; }
.search-shortcut {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 6px;
  border: 1px solid rgba(var(--line-600-rgb), .85);
  border-radius: var(--radius-xs);
  color: var(--text-500);
  background: var(--surface-800);
  font: 600 9px/1.2 var(--font-mono);
}
.catalog-sort-group { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.catalog-sort-group select { width: 210px; min-height: 48px; }
.refresh-products { min-height: 48px; }
.refresh-products.is-loading span:first-child { animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.segmented {
  display: grid;
  grid-template-columns: repeat(3,minmax(110px,1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(var(--line-600-rgb), .9);
  border-radius: var(--radius-md);
  background: var(--ink-950);
}
.segment {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-500);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}
.segment b {
  min-width: 22px;
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  color: var(--text-500);
  background: rgba(var(--text-500-rgb), .06);
  font-size: 9px;
}
.segment.active { color: var(--text-100); background: rgba(var(--action-500-rgb), .1); box-shadow: inset 0 0 0 1px rgba(var(--action-500-rgb), .2); }
.segment.active b { color: var(--text-300); background: rgba(var(--action-500-rgb), .1); }
.filter-reset { min-height: 38px; padding-block: 7px; color: var(--text-500); background: transparent; }

/* Categories --------------------------------------------- */
.category-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 27px 0 10px; }
.category-heading h3 { font-size: 18px; }
.category-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(158px,184px);
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 12px;
  margin-bottom: 7px;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(var(--line-600-rgb), .95) transparent;
  scrollbar-width: thin;
}
.category-card {
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(var(--line-600-rgb), .82);
  border-radius: var(--radius-md);
  color: var(--text-300);
  background: var(--ink-900);
  text-align: left;
  scroll-snap-align: start;
}
.category-card:hover { border-color: rgba(var(--action-500-rgb), .35); background: var(--surface-800); }
.category-card.active { border-color: rgba(var(--action-500-rgb), .56); background: rgba(var(--action-500-rgb), .07); box-shadow: inset 3px 0 0 var(--action-500); }
.category-thumb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(var(--line-600-rgb), .6);
  border-radius: var(--radius-sm);
  background: var(--ink-950);
}
.category-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.category-thumb span { color: rgba(var(--action-500-rgb), .82); font-size: 16px; font-weight: 700; }
.category-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.category-copy b { overflow: hidden; color: var(--text-100); font-size: 12px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.category-copy small { overflow: hidden; color: var(--text-500); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }

/* Products ------------------------------------------------ */
.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(245px,1fr)); gap: 12px; }
.grid > .loading-card,
.grid > .empty-state { grid-column: 1 / -1; }
.product-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(var(--line-600-rgb), .72);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-xs);
  background: var(--surface-800);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
@media (hover:hover) {
  .product-card:hover { transform: translateY(-2px); border-color: rgba(var(--action-500-rgb), .4); box-shadow: 0 16px 36px rgba(var(--ink-950-rgb), .22); }
}
.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.5;
  min-height: 150px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 14px;
  border-bottom: 1px solid rgba(var(--line-600-rgb), .58);
  background: radial-gradient(circle at 50% 48%, rgba(var(--line-600-rgb), .42), var(--ink-950) 70%);
}
.product-open { min-height: 0; padding: 14px; border: 0; border-radius: 0; box-shadow: none; }
.product-open:hover { border: 0; transform: none; }
.product-open:disabled { opacity: 1; cursor: default; }
.product-image img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center; border-radius: var(--radius-sm); }
.product-badges {
  position: absolute;
  inset: 10px 10px auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  pointer-events: none;
}
.product-badge {
  max-width: 58%;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(var(--line-600-rgb), .75);
  border-radius: var(--radius-xs);
  color: var(--text-300);
  background: rgba(var(--ink-950-rgb), .88);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.product-badge.ready { color: var(--success-500); border-color: rgba(var(--success-500-rgb), .24); background: rgba(var(--success-500-rgb), .08); }
.product-badge.out { color: var(--danger-500); border-color: rgba(var(--danger-500-rgb), .24); background: rgba(var(--danger-500-rgb), .08); }
.product-badge.stock-count { margin-left: auto; color: var(--text-300); }
.image-placeholder {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--action-500-rgb), .28);
  border-radius: var(--radius-lg);
  color: var(--text-300);
  background: rgba(var(--action-500-rgb), .09);
  font-size: 22px;
  font-weight: 700;
}
.image-placeholder.small { width: 48px; height: 48px; border-radius: var(--radius-md); font-size: 16px; }
.product-body { min-height: 220px; display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 15px; }
.product-category { color: var(--text-500); font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.name {
  min-height: 43px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-100);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-desc {
  min-height: 34px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-500);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 9px; margin-top: auto; }
.price-block { min-width: 0; }
.price-label { display: block; margin-bottom: 1px; color: var(--text-500); font-size: 10px; }
.price { color: var(--success-500); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.price small { color: var(--text-500); font-size: 10px; font-weight: 400; }
.stock { padding: 4px 7px; border-radius: var(--radius-xs); font-size: 10px; font-weight: 600; white-space: nowrap; }
.stock.in { color: var(--success-500); background: rgba(var(--success-500-rgb), .07); }
.stock.out { color: var(--danger-500); background: rgba(var(--danger-500-rgb), .07); }
.product-card.sold-out { opacity: .7; }
.product-card.sold-out:hover { opacity: .9; }
.product-card.sold-out .product-image { filter: saturate(.45); }
.product-card .primary { min-height: 45px; margin-top: 3px; border-radius: var(--radius-sm); }

/* Purchase / license modal ------------------------------- */
.purchase-modal { gap: 14px; }
.purchase-head { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 14px; align-items: center; padding-right: 36px; }
.purchase-image { width: 88px; height: 88px; display: grid; place-items: center; overflow: hidden; padding: 7px; border: 1px solid rgba(var(--line-600-rgb), .85); border-radius: var(--radius-lg); background: var(--ink-900); }
.purchase-image img { width: 100%; height: 100%; object-fit: contain; }
.purchase-title { min-width: 0; }
.purchase-title h3 { margin: 2px 0 5px; font-size: 20px; line-height: 1.35; }
.purchase-title p { color: var(--text-500); font-size: 11px; line-height: 1.55; }
.purchase-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.purchase-fact { padding: 10px 11px; border: 1px solid rgba(var(--line-600-rgb), .72); border-radius: var(--radius-md); background: var(--ink-900); }
.purchase-fact span { display: block; margin-bottom: 2px; color: var(--text-500); font-size: 9.5px; }
.purchase-fact b { font-size: 13px; }
.purchase-fact b.good { color: var(--success-500); }
.purchase-fact b.bad { color: var(--danger-500); }
.purchase-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid rgba(var(--action-500-rgb), .24); border-radius: var(--radius-md); background: rgba(var(--action-500-rgb), .055); }
.purchase-total span { color: var(--text-500); font-size: 11px; }
.purchase-total b { color: var(--success-500); font-size: 21px; }
.product-details { padding: 10px 12px; border: 1px solid rgba(var(--line-600-rgb), .72); border-radius: var(--radius-md); background: var(--ink-900); }
.product-details summary { cursor: pointer; color: var(--text-300); font-size: 11px; font-weight: 600; }
.product-details p { margin-top: 8px; color: var(--text-500); font-size: 11px; white-space: pre-wrap; }
.purchase-actions { display: grid; grid-template-columns: .72fr 1.28fr; gap: 8px; }
.purchase-actions .primary { width: 100%; }

.license-inline { display: flex; flex-direction: column; gap: 8px; padding: 11px; border: 1px solid rgba(var(--action-500-rgb), .2); border-radius: var(--radius-md); background: rgba(var(--action-500-rgb), .055); }
.license-inline-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-500); font-size: 10px; font-weight: 600; }
.license-ready-dot { color: var(--success-500); }
.license-key-line { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; }
.license-key-line code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 9px 10px; }
.license-inline small { color: var(--text-500); font-size: 10px; line-height: 1.55; }
.license-modal-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-right: 34px; }
.license-modal-title .modal-title { padding-right: 0; }
.license-meta-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.license-meta-grid > div { min-width: 0; padding: 10px; border: 1px solid rgba(var(--line-600-rgb), .72); border-radius: var(--radius-md); background: var(--ink-900); }
.license-meta-grid span { display: block; margin-bottom: 4px; color: var(--text-500); font-size: 9px; }
.license-meta-grid b { display: block; overflow-wrap: anywhere; color: var(--text-300); font-size: 11px; }
.license-category-list { display: flex; flex-direction: column; gap: 9px; margin: 12px 0; }
.license-category-card { padding: 12px; border: 1px solid rgba(var(--line-600-rgb), .78); border-radius: var(--radius-lg); background: var(--ink-900); }
.license-category-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.license-category-head > div:last-child { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.license-category-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-300); font-size: 13px; }
.license-category-head small { color: var(--text-500); font-size: 10px; }
.license-category-media { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-sm); background: var(--ink-950); color: rgba(var(--action-500-rgb), .8); font-size: 9px; font-weight: 700; }
.license-category-media img { width: 100%; height: 100%; object-fit: contain; }
.license-credentials { display: flex; flex-direction: column; gap: 7px; }
.license-credential-row { display: grid; grid-template-columns: 92px minmax(0,1fr) auto; align-items: center; gap: 8px; }
.license-credential-row > span { color: var(--text-500); font-size: 10px; }
.license-credential-row > span small { display: block; margin-top: 2px; color: rgba(var(--text-500-rgb), .7); font-size: 8.5px; font-weight: 500; }
.license-credential-row code { min-width: 0; overflow-wrap: anywhere; padding: 8px 9px; }
.license-password-row { margin-top: 3px; padding: 10px; border: 1px solid rgba(var(--success-500-rgb), .28); border-radius: var(--radius-md); background: rgba(var(--success-500-rgb), .055); }
.license-password-row > span { color: var(--success-500); font-weight: 700; }
.license-password-row code { padding: 10px 11px; border-color: rgba(var(--success-500-rgb), .24); background: var(--ink-950); color: var(--text-100); font-size: 14px; font-weight: 700; }
.license-provider-note { margin-top: 3px; overflow: hidden; border: 1px solid rgba(var(--line-600-rgb), .72); border-radius: var(--radius-md); background: var(--ink-900); }
.license-provider-note summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; color: var(--text-300); font-size: 11px; font-weight: 600; list-style: none; }
.license-provider-note summary::-webkit-details-marker { display: none; }
.license-provider-note summary::after { content: '⌄'; flex: 0 0 auto; color: var(--text-500); font-size: 14px; transition: transform .18s ease; }
.license-provider-note[open] summary::after { transform: rotate(180deg); }
.license-provider-note summary span { min-width: 0; }
.license-provider-note summary small { margin-left: auto; color: var(--text-500); font-size: 9px; font-weight: 500; white-space: nowrap; }
.license-provider-note-body { display: flex; flex-direction: column; gap: 10px; padding: 0 11px 11px; }
.license-provider-images { display: grid; grid-template-columns: 1fr; gap: 8px; }
.license-provider-images img { width: 100%; height: auto; max-height: 520px; object-fit: contain; border: 1px solid rgba(var(--line-600-rgb), .8); border-radius: var(--radius-sm); background: var(--text-100); }
.license-provider-note pre { margin: 0; padding: 9px 10px; font: inherit; font-size: 10px; line-height: 1.65; }


/* Account details / provider guide ----------------------- */
.modal-box.account-detail-modal {
  width: min(94vw, 880px);
  max-height: min(92vh, 960px);
  gap: 16px;
}
.purchase-result-head { display: flex; align-items: center; gap: 12px; padding-right: 42px; }
.purchase-result-head .modal-title { padding-right: 0; }
.account-purchase-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.account-detail-product { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 12px; padding-right: 42px; }
.account-detail-product-media { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; padding: 5px; border: 1px solid rgba(var(--border-rgb), .66); border-radius: var(--radius-md); background: var(--surface-2); color: var(--action-500); font-weight: 700; }
.account-detail-product-media img { width: 100%; height: 100%; object-fit: contain; }
.account-detail-product-copy { min-width: 0; }
.account-detail-product-copy .modal-title { padding-right: 0; font-size: 20px; overflow-wrap: anywhere; }
.account-detail-product-copy p { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.account-detail-section { display: flex; flex-direction: column; gap: 11px; padding-top: 14px; border-top: 1px solid rgba(var(--border-rgb), .66); }
.account-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-section-head > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-section-head b { color: var(--text-primary); font-size: 15px; }
.account-section-head span { color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.account-credentials .license-credential-row { grid-template-columns: 110px minmax(0,1fr) auto; }
.account-meta-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.account-meta-grid > div { min-width: 0; padding: 10px 11px; border: 1px solid rgba(var(--border-rgb), .66); border-radius: var(--radius-md); background: var(--surface-2); }
.account-meta-grid span { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 10px; }
.account-meta-grid b { display: block; color: var(--text-secondary); font-size: 13px; overflow-wrap: anywhere; }
.account-otp-panel { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border: 1px solid rgba(var(--action-500-rgb), .20); border-radius: var(--radius-md); background: rgba(var(--action-500-rgb), .055); }
.account-otp-panel > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-otp-panel b { color: var(--text-primary); font-size: 13px; }
.account-otp-panel span { color: var(--text-muted); font-size: 10px; line-height: 1.55; }
.account-otp-link { flex: 0 0 auto; min-width: 116px; }
.account-guide-text { max-height: none; margin: 0; padding: 13px 14px; color: var(--text-secondary); background: var(--surface-2); font-family: var(--font-ui); font-size: 13px; line-height: 1.8; letter-spacing: .01em; }
.account-guide-images { display: flex; flex-direction: column; gap: 12px; }
.account-guide-images img { width: 100%; height: auto; border: 1px solid rgba(var(--border-rgb), .72); border-radius: var(--radius-md); background: var(--surface-1); }
.account-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid rgba(var(--action-500-rgb), .18); border-radius: var(--radius-md); background: rgba(var(--action-500-rgb), .045); }
.account-inline-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-inline-copy b { color: var(--text-secondary); font-size: 11px; }
.account-inline-copy small { color: var(--text-muted); font-size: 9.5px; line-height: 1.5; }
.account-inline-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }

@media (max-width: 720px) {
  .modal-box.account-detail-modal { width: 100%; max-height: min(94dvh, 820px); }
  .account-purchase-summary { grid-template-columns: 1fr; }
  .account-detail-product { grid-template-columns: 50px minmax(0,1fr); align-items: start; }
  .account-detail-product-media { width: 50px; height: 50px; }
  .account-detail-product > .status-pill { grid-column: 2; justify-self: start; }
  .account-credentials .license-credential-row { grid-template-columns: 1fr auto; }
  .account-credentials .license-credential-row > span { grid-column: 1 / -1; }
  .account-otp-panel { align-items: stretch; flex-direction: column; }
  .account-otp-link { width: 100%; min-width: 0; }
  .account-inline { align-items: stretch; flex-direction: column; }
  .account-inline-actions { justify-content: stretch; }
  .account-inline-actions > * { flex: 1 1 140px; }
  .account-guide-text { font-size: 12.5px; line-height: 1.8; }
}

@media (max-width: 420px) {
  .account-meta-grid { grid-template-columns: 1fr; }
  .account-detail-product-copy .modal-title { font-size: 18px; }
}

/* Social -------------------------------------------------- */
.social-grid { grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); }
.social-card { min-height: 215px; display: flex; flex-direction: column; gap: 10px; padding: 15px; }
.social-top { display: flex; justify-content: space-between; gap: 8px; }
.range { color: var(--text-500); font-size: 11px; }
.social-price { margin-top: auto; display: flex; align-items: end; justify-content: space-between; color: var(--text-500); font-size: 11px; }
.social-price b { color: var(--success-500); font-size: 16px; }
.social-price small { color: var(--text-500); font-size: 10px; }

/* Orders / history --------------------------------------- */
.orders-list,
.history-list { display: flex; flex-direction: column; gap: 9px; }
.order-card { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 14px; }
.order-media { width: 74px; height: 74px; display: grid; place-items: center; overflow: hidden; padding: 6px; border-radius: var(--radius-md); background: var(--ink-900); }
.order-media img { width: 100%; height: 100%; object-fit: contain; }
.order-content { min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-head > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.order-head b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.order-facts { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-500); font-size: 11px; }
.order-facts b { color: var(--text-300); }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.order-actions .license-action { border-color: rgba(var(--action-500-rgb), .34); color: var(--text-300); background: rgba(var(--action-500-rgb), .08); }
.history-sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid rgba(var(--border-rgb), .66);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.history-sync-bar p { margin: 0; line-height: 1.55; }
.history-sync-bar .btn { flex: 0 0 auto; min-height: 44px; }

.section-subnav {
  display: grid;
  gap: 5px;
  margin: -4px 0 18px;
  padding: 4px;
  border: 1px solid rgba(var(--line-600-rgb), .86);
  border-radius: var(--radius-md);
  background: var(--ink-950);
}
.history-subnav { grid-template-columns: repeat(3,minmax(0,1fr)); }
.topup-subnav { grid-template-columns: repeat(2,minmax(0,1fr)); }
.subnav-button {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-500);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}
.subnav-button > span { color: rgba(var(--action-500-rgb), .78); font-size: 15px; line-height: 1; }
.subnav-button.active { color: var(--text-100); border-color: rgba(var(--action-500-rgb), .22); background: rgba(var(--action-500-rgb), .09); }
.history-panel,
.topup-method-panel { min-width: 0; }
.history-card { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: start; gap: 11px; padding: 13px; }
.history-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(var(--action-500-rgb), .18); border-radius: var(--radius-md); color: var(--text-300); background: rgba(var(--action-500-rgb), .07); font-size: 15px; font-weight: 700; }
.history-content { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.history-head > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.history-head b { font-size: 12.5px; }
.history-head small { color: var(--text-500); font-size: 9.5px; }
.history-head strong { flex: 0 0 auto; font-size: 13px; }
.history-content p { color: var(--text-500); font-size: 10.5px; line-height: 1.45; }
.history-content code { width: fit-content; max-width: 100%; overflow-wrap: anywhere; color: var(--text-500); font-size: 9px; }

/* Topup --------------------------------------------------- */
.topup-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.topup-method-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.topup-card h3 { margin-bottom: 5px; font-size: 19px; }
.slip-field { margin-top: 15px; }
.info-card ul { margin: 6px 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text-300); font-size: 12px; }
.info-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(var(--success-500-rgb), .2); border-radius: var(--radius-md); color: var(--success-500); background: rgba(var(--success-500-rgb), .07); font-weight: 700; }
.slip-upload {
  margin-top: 16px;
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px;
  border: 1px dashed rgba(var(--line-600-rgb), .95);
  border-radius: var(--radius-lg);
  background: rgba(var(--ink-900-rgb), .72);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.slip-upload:hover { border-color: rgba(var(--success-500-rgb), .42); background: var(--surface-800); }
.slip-upload:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.slip-upload-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: var(--radius-md); background: rgba(var(--action-500-rgb), .09); color: var(--text-300); font-size: 21px; }
.slip-upload > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.slip-upload b { font-size: 14px; }
.slip-upload small { color: var(--text-500); font-size: 11px; line-height: 1.45; }
.slip-preview { margin-top: 12px; display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid rgba(var(--line-600-rgb), .7); border-radius: var(--radius-lg); background: var(--ink-900); }
.slip-preview[hidden] { display: none; }
.slip-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); background: var(--ink-950); }
.slip-preview-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.slip-preview-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.slip-preview-meta small { color: var(--text-500); font-size: 10px; line-height: 1.4; }
.manual-qr { margin-top: 12px; }
.manual-qr summary { color: var(--text-500); font-size: 11px; cursor: pointer; user-select: none; }
.manual-qr[open] summary { margin-bottom: 8px; color: var(--text-300); }
.topup-submit { width: 100%; margin-top: 14px; }
.topup-result-meta { display: block; margin-top: 5px; color: inherit; opacity: .78; overflow-wrap: anywhere; }
/* Payment destination: canonical V7 named-child grid is defined below. */
.soft-rule { margin: 15px 0; border: 0; border-top: 1px solid rgba(var(--line-600-rgb), .72); }
.privacy-payment-card { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 14px; padding: 13px; border: 1px solid rgba(var(--success-500-rgb), .18); border-radius: var(--radius-md); background: rgba(var(--success-500-rgb), .05); }
.privacy-payment-card b { color: var(--text-300); font-size: 12px; }
.privacy-payment-card small { color: var(--text-500); font-size: 10px; line-height: 1.5; }
.wallet-private-icon { color: var(--text-300); border-color: rgba(var(--action-500-rgb), .22); background: rgba(var(--action-500-rgb), .07); }
.angpao-card { position: relative; overflow: hidden; }
.angpao-field { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.angpao-field > span { color: var(--text-300); font-size: 11px; font-weight: 600; }
.angpao-field input { width: 100%; }
.angpao-field small { color: var(--text-500); font-size: 10px; line-height: 1.5; }
.angpao-safety { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 11px 12px; border: 1px solid rgba(var(--success-500-rgb), .16); border-radius: var(--radius-md); background: rgba(var(--success-500-rgb), .05); }
.angpao-safety > span { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--success-500); background: rgba(var(--success-500-rgb), .09); font-weight: 700; }
.angpao-safety p { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.angpao-safety b { font-size: 11px; }
.angpao-safety small { color: var(--text-500); font-size: 9.5px; line-height: 1.45; }
.angpao-card code { overflow-wrap: anywhere; }

/* Account sheet ------------------------------------------ */
.account-sheet { display: flex; flex-direction: column; gap: 12px; }
.account-profile { display: flex; align-items: center; gap: 12px; padding-right: 34px; }
.account-profile .account-avatar { width: 46px; height: 46px; border-radius: var(--radius-md); font-size: 17px; }
.account-profile h3 { font-size: 20px; }
.account-profile p { color: var(--text-500); font-size: 12px; }
.account-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Trust footer strip ------------------------------------- */
.store-trust {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  overflow: hidden;
  margin-top: 42px;
  border: 1px solid rgba(var(--line-600-rgb), .68);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-xs);
  background: var(--ink-900);
}
.store-trust > div { min-width: 0; display: flex; align-items: flex-start; gap: 11px; padding: 16px; border-right: 1px solid rgba(var(--line-600-rgb), .52); background: var(--ink-900); }
.store-trust > div:last-child { border-right: 0; }
.trust-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--success-500); background: rgba(var(--success-500-rgb), .07); font-weight: 700; }
.store-trust p { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.store-trust b { font-size: 12px; }
.store-trust small { color: var(--text-500); font-size: 10px; line-height: 1.45; }

/* Initial app loading ------------------------------------ */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(var(--ink-950-rgb), .97);
  transition: opacity .24s ease, visibility .24s ease;
}
.app-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.app-loader-card {
  width: min(360px,100%);
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) 28px;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(var(--line-600-rgb), .86);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-xs);
  background: var(--surface-800);
  box-shadow: var(--shadow-float);
}
.app-loader-mark { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(var(--action-500-rgb), .45); border-radius: var(--radius-md); color: var(--text-100); background: rgba(var(--action-500-rgb), .16); font-size: 18px; font-weight: 700; }
.app-loader-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.app-loader-copy b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
.app-loader-copy span { color: var(--text-500); font-size: 10.5px; }
.app-loader-spinner { width: 24px; height: 24px; border: 3px solid rgba(var(--text-500-rgb), .16); border-top-color: var(--action-500); border-radius: 50%; animation: app-loader-spin .72s linear infinite; }
@keyframes app-loader-spin { to { transform: rotate(360deg); } }

/* Responsive --------------------------------------------- */
@media (max-width: 1050px) {
  .store-hero { grid-template-columns: minmax(0,1fr) 270px; gap: 28px; padding: 34px; }
  .store-hero h1 { font-size: 40px; }
  .topup-layout { grid-template-columns: 1fr; }
  .store-trust { grid-template-columns: 1fr; }
  .store-trust > div { border-right: 0; border-bottom: 1px solid rgba(var(--line-600-rgb), .52); }
  .store-trust > div:last-child { border-bottom: 0; }
}

@media (max-width: 760px) {
  .store-body { --store-gutter: 12px; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .store-header-inner { padding-inline: var(--store-gutter); }
  .store-header-state { display: none; }
  .store-logo-copy small { display: none; }
  .store-shell { padding-top: 14px; padding-bottom: 32px; }

  .store-hero { min-height: auto; grid-template-columns: 1fr; gap: 18px; margin-bottom: 13px; padding: 22px 20px; border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-xs); }
  .store-hero::before { width: 2px; }
  .hero-kicker { margin-bottom: 11px; }
  .store-hero h1 { font-size: clamp(29px,9vw,39px); line-height: 1.1; }
  .hero-break { display: none; }
  .store-hero p { font-size: 12px; line-height: 1.65; }
  .hero-badges { margin-top: 18px; }
  .hero-badges span { padding-top: 10px; font-size: 10.5px; }
  .hero-status { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-metric { min-height: 78px; grid-template-columns: 36px minmax(0,1fr); gap: 9px; padding: 11px; }
  .metric-icon { width: 36px; height: 36px; }
  .hero-metric strong { font-size: 17px; }
  .hero-metric strong em { font-size: 9.5px; }
  .metric-status { font-size: 11px !important; }
  .hero-metric > div > em { display: none; }

  .store-nav {
    position: fixed;
    inset: auto 10px calc(8px + env(safe-area-inset-bottom)) 10px;
    z-index: 150;
    top: auto;
    height: auto;
    grid-template-columns: repeat(4,1fr);
    margin: 0;
    padding: 5px;
    border-color: rgba(var(--line-600-rgb), .92);
    border-radius: var(--radius-xl);
    background: rgba(var(--ink-950-rgb), .96);
    box-shadow: 0 18px 52px rgba(var(--ink-950-rgb), .58);
  }
  .tab { min-height: 56px; flex-direction: column; gap: 1px; padding: 6px 3px; border-radius: var(--radius-md); font-size: 10.5px; }
  .tab.active::after { inset: auto 28% 3px; }
  .nav-icon { font-size: 18px; }

  .catalog-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .catalog-heading h2 { font-size: 23px; }
  .section-subtitle { font-size: 11.5px; }
  .catalog-summary { justify-content: flex-start; }
  .catalog-tools { padding: 10px; }
  .catalog-search-row { align-items: stretch; flex-direction: column; }
  .catalog-sort-group { width: 100%; }
  .catalog-sort-group select { width: auto; flex: 1; min-width: 0; }
  .catalog-sort-group .btn { flex: 0 0 auto; }
  .catalog-filter-row { align-items: stretch; flex-direction: column; }
  .segmented { width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .segment { min-width: 0; flex-direction: column; gap: 2px; padding: 6px 3px; font-size: 10.5px; }
  .segment b { min-width: 0; padding: 1px 5px; font-size: 9.5px; }
  .filter-reset { width: 100%; }
  .category-hint { display: inline; font-size: 10px; white-space: nowrap; }
  .category-strip { grid-auto-columns: minmax(150px,170px); }

  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .product-image { min-height: 0; aspect-ratio: 1 / .78; padding: 8px; }
  .product-open { padding: 8px; }
  .product-badges { inset: 7px 7px auto; gap: 4px; }
  .product-badge { max-width: 60%; padding: 3px 5px; font-size: 9.5px; }
  .product-body { min-height: 205px; gap: 7px; padding: 11px; }
  .product-category { font-size: 10px; }
  .name { min-height: 41px; font-size: 13px; }
  .product-desc { min-height: 31px; font-size: 10.5px; }
  .price { font-size: 16px; }
  .price-label { font-size: 9.5px; }
  .stock { display: none; }
  .product-card .primary { min-height: 44px; padding: 8px 6px; font-size: 11.5px; }

  .purchase-head { grid-template-columns: 72px minmax(0,1fr); gap: 11px; }
  .purchase-image { width: 72px; height: 72px; }
  .purchase-title h3 { font-size: 17px; }
  .purchase-actions { grid-template-columns: 1fr; }
  .purchase-actions .ghost { order: 2; }

  .order-card { grid-template-columns: 58px 1fr; gap: 10px; padding: 11px; }
  .order-media { width: 58px; height: 58px; }
  .order-head { flex-direction: column; gap: 7px; }
  .order-head b { white-space: normal; }
  .order-actions .btn { flex: 1; }
  .history-sync-bar { align-items: stretch; flex-direction: column; }
  .history-sync-bar .btn { width: 100%; }
  .license-meta-grid { grid-template-columns: 1fr; }
  .license-credential-row { grid-template-columns: 1fr auto; }
  .license-credential-row > span { grid-column: 1 / -1; }
  .license-key-line { grid-template-columns: 1fr; }
  .license-key-line .btn { width: 100%; }
  .pagination .btn { min-width: 94px; }
  .store-trust { margin-top: 28px; }
  .subnav-button { min-height: 48px; flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 10.5px; }
  .subnav-button > span { font-size: 14px; }
  .history-card { grid-template-columns: 36px minmax(0,1fr); gap: 9px; padding: 11px; }
  .history-icon { width: 36px; height: 36px; }
}

@media (max-width: 560px) {
  .slip-upload { align-items: flex-start; justify-content: flex-start; padding: 15px; }
  .slip-preview { grid-template-columns: 58px 1fr; }
  .slip-preview img { width: 58px; height: 58px; }
  .slip-preview .btn.compact { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 480px) {
  .store-body { --store-gutter: 10px; }
  .store-logo { gap: 8px; }
  .store-logo-copy strong { font-size: 17px; }
  .bal { padding: 6px 8px; font-size: 11.5px; }
  .desktop-admin-link { display: none; }
  .account-trigger { width: 42px; min-width: 42px; padding: 0; }
  .account-trigger .account-name { display: none; }
  .store-hero { padding: 19px 17px; }
  .store-hero h1 { font-size: 29px; }
  .hero-badges { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .hero-badges span { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 3px 0 0; font-size: 10px; line-height: 1.4; }
  .hero-metric { grid-template-columns: 34px 1fr; }
  .metric-icon { width: 34px; height: 34px; }
  .category-card { grid-template-columns: 38px minmax(0,1fr); }
  .category-thumb { width: 38px; height: 38px; }
  .catalog-sort-group .refresh-products span:last-child { display: none; }
  .catalog-sort-group .refresh-products { width: 46px; padding-inline: 0; }
  .search-shortcut { display: none; }
  .product-desc { display: none; }
  .product-body { min-height: 168px; }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
  .product-image { aspect-ratio: 16 / 9; min-height: 155px; }
  .product-body { min-height: 190px; }
  .stock { display: inline-flex; }
  .hero-badges span { font-size: 10px; }
}

/* =========================================================
   Unified minimal storefront — canonical tokens from style.css
   Interaction level: L1, with one continuous recent-order marquee.
   ========================================================= */
.store-body {
  --store-max: 1320px;
  --store-gutter: 22px;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--action-500-rgb), .055), transparent 28%),
    var(--canvas);
}
.store-body::before { display: none; }
.store-body .card {
  border-color: rgba(var(--border-rgb), .70);
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
}
.storefront-header {
  border-bottom-color: rgba(var(--border-rgb), .72);
  background: rgba(var(--surface-1-rgb), .88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.store-logo-copy small,
.store-header-state,
.store-body .muted,
.store-body .eyebrow,
.store-body .section-subtitle { color: var(--text-muted); }
.store-header-state {
  border-color: rgba(var(--success-500-rgb), .16);
  color: var(--success-500);
  background: rgba(var(--success-500-rgb), .06);
}
.logo-mark,
.account-avatar {
  border-color: rgba(var(--action-500-rgb), .16);
  color: var(--action-500);
  background: rgba(var(--action-500-rgb), .07);
}
.header-login {
  border-color: rgba(var(--action-500-rgb), .20);
  color: var(--action-500);
  background: rgba(var(--action-500-rgb), .055);
}
.store-shell { padding-top: 24px; }

/* Hero */
.store-hero {
  min-height: 0;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 24px;
  padding: 36px;
  border: 1px solid rgba(var(--border-rgb), .55);
  border-radius: 30px;
  background: var(--surface-1);
  box-shadow: var(--shadow-float);
}
.store-hero::before {
  inset: auto auto 0 36px;
  width: 120px;
  height: 4px;
  border-radius: 999px;
  background: var(--action-500);
}
.store-hero h1 {
  max-width: 760px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.06;
  letter-spacing: -.045em;
}
.hero-gradient { color: var(--text-secondary); }
.store-hero p {
  max-width: 650px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.78;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-actions .btn,
.hero-actions .primary-inline { min-width: 170px; border-radius: 999px; }
.hero-secondary { color: var(--text-primary); background: var(--surface-1); }
.hero-badges {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
  border-top: 0;
}
.hero-badges span {
  padding: 13px 14px;
  border: 1px solid rgba(var(--border-rgb), .62);
  border-radius: 16px;
  color: var(--text-secondary);
  background: var(--surface-2);
}
.hero-badges i {
  border-color: rgba(var(--action-500-rgb), .15);
  color: var(--action-500);
  background: rgba(var(--action-500-rgb), .06);
}
.hero-status {
  gap: 12px;
  border: 0;
  background: transparent;
}
.hero-metric {
  min-height: 110px;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(var(--border-rgb), .62);
  border-radius: 20px;
  background: var(--surface-2);
}
.metric-icon.violet { color: var(--action-500); background: rgba(var(--action-500-rgb), .07); }
.metric-icon.green { color: var(--success-500); background: rgba(var(--success-500-rgb), .07); }
.hero-metric small,
.hero-metric strong em,
.hero-metric > div > em { color: var(--text-muted); }

/* Recent orders: continuous, self-filling marquee */
.recent-orders {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 0 0 18px;
  padding: 14px 16px;
  overflow: hidden;
  border-color: rgba(var(--border-rgb), .68);
  border-radius: 20px;
  background: rgba(var(--surface-1-rgb), .94);
  box-shadow: var(--shadow-soft);
}
.recent-orders-label {
  min-width: 238px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 2px;
  border-right: 1px solid rgba(var(--border-rgb), .62);
}
.recent-orders-label > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.recent-orders-label b,
.recent-order-item b { color: var(--text-primary); }
.recent-orders-label small,
.recent-order-item small,
.recent-order-item .recent-order-product { color: var(--text-muted); }
.recent-orders-viewport {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  outline: none;
  mask-image: linear-gradient(90deg, transparent 0, currentColor 14px, currentColor calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, currentColor 14px, currentColor calc(100% - 14px), transparent 100%);
}
.recent-orders-viewport:focus-visible {
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(var(--action-500-rgb), .42);
}
.recent-orders-track {
  width: max-content;
  display: flex;
  align-items: center;
  will-change: transform;
  animation: recent-orders-marquee var(--recent-duration, 60s) linear infinite;
}
.recent-orders-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding-right: 12px;
}
.recent-order-item {
  min-width: 286px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border: 1px solid rgba(var(--border-rgb), .64);
  border-radius: 16px;
  color: var(--text-secondary);
  background: var(--surface-2);
}
.recent-order-media {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(var(--border-rgb), .62);
  border-radius: 13px;
  background: var(--surface-1);
  color: var(--action-500);
  font-weight: 700;
}
.recent-order-media img { width: 100%; height: 100%; object-fit: contain; }
.recent-order-media-fallback { background: rgba(var(--action-500-rgb), .06); }
.recent-order-copy,
.recent-order-meta { min-width: 0; display: flex; flex-direction: column; }
.recent-order-copy { flex: 1; gap: 1px; }
.recent-order-meta { align-items: flex-end; gap: 2px; text-align: right; }
.recent-order-item .recent-order-product {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-order-item strong { color: var(--text-primary); }

@keyframes recent-orders-marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(var(--recent-loop-distance, 1000px) * -1), 0, 0); }
}

/* Navigation + catalog */
.store-nav {
  gap: 6px;
  padding: 6px;
  border-color: rgba(var(--border-rgb), .72);
  border-radius: 20px;
  background: rgba(var(--surface-1-rgb), .91);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tab { border-radius: 14px; color: var(--text-muted); }
.tab:hover { color: var(--text-primary); background: rgba(var(--action-500-rgb), .045); }
.tab.active {
  border-color: transparent;
  color: var(--text-primary);
  background: rgba(var(--action-500-rgb), .07);
}
.tab.active::after { background: var(--action-500); }
.nav-icon { color: var(--action-500); }
.catalog-heading { padding-bottom: 0; border-bottom: 0; }
.catalog-heading h2 { font-size: 29px; letter-spacing: -.035em; }
.catalog-tools,
.section-subnav {
  border-color: rgba(var(--border-rgb), .68);
  border-radius: 20px;
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
}
.search-shortcut { border-color: rgba(var(--border-rgb), .72); color: var(--text-muted); background: var(--surface-2); }
.segmented { border-color: rgba(var(--border-rgb), .72); background: var(--surface-3); }
.segment { color: var(--text-muted); }
.segment.active {
  color: var(--text-primary);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px rgba(var(--action-500-rgb), .12);
}
.segment.active b { color: var(--action-500); background: rgba(var(--action-500-rgb), .06); }
.category-card {
  min-height: 70px;
  border-color: rgba(var(--border-rgb), .68);
  border-radius: 16px;
  color: var(--text-secondary);
  background: var(--surface-1);
}
.category-card:hover { border-color: rgba(var(--action-500-rgb), .22); background: var(--surface-1); }
.category-card.active {
  border-color: rgba(var(--action-500-rgb), .20);
  background: rgba(var(--action-500-rgb), .055);
  box-shadow: none;
}
.category-thumb { border-color: rgba(var(--border-rgb), .62); border-radius: 12px; background: var(--surface-2); }
.category-copy b { color: var(--text-primary); }

/* Product cards */
.grid { gap: 16px; }
.product-card {
  border-color: rgba(var(--border-rgb), .66);
  border-radius: 22px;
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
}
@media (hover:hover) {
  .product-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--action-500-rgb), .20);
    box-shadow: var(--shadow-float);
  }
}
.product-image {
  border-bottom-color: rgba(var(--border-rgb), .55);
  background: radial-gradient(circle at 50% 45%, rgba(var(--action-500-rgb), .05), transparent 58%), var(--surface-2);
}
.product-badge {
  border-color: rgba(var(--border-rgb), .72);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(var(--surface-1-rgb), .94);
}
.product-badge.ready { color: var(--success-500); border-color: rgba(var(--success-500-rgb), .18); background: rgba(var(--success-500-rgb), .07); }
.product-badge.out { color: var(--danger-500); border-color: rgba(var(--danger-500-rgb), .18); background: rgba(var(--danger-500-rgb), .07); }
.image-placeholder { color: var(--action-500); border-color: rgba(var(--action-500-rgb), .15); background: rgba(var(--action-500-rgb), .055); }
.product-body { padding: 17px; gap: 9px; }
.name { color: var(--text-primary); font-size: 16px; }
.price { color: var(--text-primary); }
.stock.in { color: var(--success-500); background: rgba(var(--success-500-rgb), .07); }
.stock.out { color: var(--danger-500); background: rgba(var(--danger-500-rgb), .07); }

/* Purchase/modal internals inherit global light modal */
.purchase-image,
.purchase-fact,
.product-details,
.license-meta-grid > div,
.license-category-card,
.license-provider-note,
.slip-preview,
.history-card,
.order-card {
  border-color: rgba(var(--border-rgb), .66);
  background: var(--surface-2);
}
.purchase-total,
.license-inline {
  border-color: rgba(var(--action-500-rgb), .16);
  background: rgba(var(--action-500-rgb), .05);
}
.purchase-total b { color: var(--text-primary); }

/* Topup: consistent with store and admin */
.topup-subnav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.subnav-button {
  min-height: 68px;
  justify-content: flex-start;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text-secondary);
  background: transparent;
  text-align: left;
}
.subnav-button:hover { color: var(--text-primary); background: rgba(var(--action-500-rgb), .04); }
.subnav-button.active {
  color: var(--text-primary);
  border-color: rgba(var(--action-500-rgb), .14);
  background: rgba(var(--action-500-rgb), .06);
}
.subnav-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(var(--border-rgb), .62);
  border-radius: 13px;
  background: var(--surface-1);
  font-size: 0;
  line-height: 0;
}
.subnav-icon img { width: 100%; height: 100%; object-fit: contain; }
.subnav-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.subnav-copy small { color: var(--text-muted); font-size: 10px; }
.subnav-copy b { font-size: 13px; }
.topup-card h3 { font-size: 23px; letter-spacing: -.025em; }
.info-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.info-head h3 { margin: 0 0 2px; font-size: 18px; }
.info-icon,
.slip-upload-icon,
.payment-destination-brand {
  overflow: hidden;
  border-color: rgba(var(--border-rgb), .62);
  background: var(--surface-1);
}
.info-icon { width: 52px; height: 52px; border-radius: 16px; }
.info-icon img,
.slip-upload-icon img,
.payment-brand-pill img,
.payment-destination-brand img { width: 100%; height: 100%; object-fit: contain; }
.info-check { color: var(--success-500); background: rgba(var(--success-500-rgb), .07); }
.wallet-private-icon { color: var(--wallet-500); background: rgba(var(--wallet-500-rgb), .07); }
.payment-brand-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.payment-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(var(--border-rgb), .62);
  border-radius: 999px;
  background: var(--surface-2);
}
.payment-brand-pill img { width: 22px; height: 22px; }
.wallet-pill { border-color: rgba(var(--wallet-500-rgb), .20); background: rgba(var(--wallet-500-rgb), .06); }
.payment-destination {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-color: rgba(var(--border-rgb), .66);
  border-radius: 16px;
  background: var(--surface-2);
}
.payment-destination-brand {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--border-rgb), .62);
  border-radius: 13px;
}
.payment-destination-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.payment-destination-copy > span { color: var(--text-muted); font-size: 10px; font-weight: 600; }
.payment-destination-copy b { color: var(--text-primary); font-size: 13px; word-break: break-word; }
.payment-destination-copy small { color: var(--text-muted); font-size: 10px; }
.payment-destination > .btn { grid-column: 3; grid-row: 1; align-self: center; }
.slip-upload {
  border-style: solid;
  border-color: rgba(var(--border-rgb), .78);
  border-radius: 18px;
  background: var(--surface-2);
}
.slip-upload:hover { border-color: rgba(var(--action-500-rgb), .22); background: var(--surface-1); }
.slip-upload-icon { width: 52px; height: 52px; flex-basis: 52px; border: 1px solid rgba(var(--border-rgb), .62); border-radius: 15px; font-size: 0; }
.privacy-payment-card { border-color: rgba(var(--wallet-500-rgb), .18); background: rgba(var(--wallet-500-rgb), .05); }
.angpao-safety { border-color: rgba(var(--success-500-rgb), .16); background: rgba(var(--success-500-rgb), .05); }

/* Footer trust */
.store-trust {
  gap: 12px;
  border: 0;
  background: transparent;
}
.store-trust > div {
  border: 1px solid rgba(var(--border-rgb), .66);
  border-radius: 18px;
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
}
.store-trust > div:last-child { border-right: 1px solid rgba(var(--border-rgb), .66); }
.trust-icon { color: var(--action-500); background: rgba(var(--action-500-rgb), .06); }

/* Loading */
.app-loader { background: rgba(var(--canvas-rgb), .96); }
.app-loader-card { border-color: rgba(var(--border-rgb), .68); background: var(--surface-1); box-shadow: var(--shadow-float); }
.app-loader-mark { color: var(--action-500); border-color: rgba(var(--action-500-rgb), .16); background: rgba(var(--action-500-rgb), .07); }
.app-loader-spinner { border-color: rgba(var(--action-500-rgb), .14); border-top-color: var(--action-500); }

@media (max-width: 1050px) {
  .store-hero { grid-template-columns: 1fr; }
  .hero-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .store-hero { grid-template-columns: 1fr; padding: 24px 22px; border-radius: 24px; }
  .hero-actions .btn,
  .hero-actions .primary-inline { flex: 1; min-width: 0; }
  .hero-badges { grid-template-columns: 1fr; }
  .hero-status { grid-template-columns: 1fr; }
  .recent-orders { grid-template-columns: 1fr; gap: 8px; padding: 11px 12px; }
  .recent-orders-label { min-width: 0; border-right: 0; border-bottom: 1px solid rgba(var(--border-rgb), .58); }
  .recent-order-item { min-width: 252px; }
  .recent-order-item .recent-order-product { max-width: 120px; }
  .store-nav {
    background: rgba(var(--surface-1-rgb), .95);
    border-color: rgba(var(--border-rgb), .82);
    box-shadow: var(--shadow-float);
  }
  .product-card { border-radius: 20px; }
  .section-subnav,
  .catalog-tools { border-radius: 18px; }
}
@media (max-width: 560px) {
  .topup-subnav,
  .history-subnav { grid-template-columns: 1fr; }
  .payment-destination { grid-template-columns: 46px minmax(0, 1fr); }
  .payment-destination > .btn { grid-column: 1 / -1; grid-row: auto; width: 100%; }
}
@media (max-width: 480px) {
  .store-hero h1 { font-size: 31px; }
  .recent-order-item { min-width: 232px; }
  .recent-order-media { width: 38px; height: 38px; flex-basis: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .recent-orders-viewport { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
  .recent-orders-track { animation: none !important; transform: none !important; }
  .recent-orders-group[aria-hidden="true"] { display: none; }
}


/* V7: touch focus must never freeze the ambient order marquee. */
@media (hover:hover) and (pointer:fine) {
  .recent-orders:hover .recent-orders-track { animation-play-state: paused; }
}
