/* ================================================================ Tokens */
:root {
  --accent: #6a3df0;
  --accent-2: #e0457b;
  --accent-soft: rgba(106, 61, 240, .1);
  --grad: linear-gradient(120deg, #6a3df0 0%, #b04be6 55%, #e0457b 100%);
  --sale: #f0325a;
  --star: #ffae1f;
  --ok: #13a562;
  --warn: #f08c00;
  --danger: #e5484d;
  --blue: #2f7cf6;
  --teal: #0f9f9e;

  --bg: #f2f2f6;
  --surface: #ffffff;
  --surface-2: #f4f4f8;
  --surface-3: #ebebf1;
  --text: #16161a;
  --muted: #80808c;
  --border: #e6e6ee;
  --overlay: rgba(10, 10, 20, .45);
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 6px 20px rgba(20, 20, 40, .06);

  --r-lg: 20px;
  --r: 16px;
  --r-sm: 12px;
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent: #8d68ff;
  --accent-soft: rgba(141, 104, 255, .18);
  --bg: #0e0e12;
  --surface: #19191f;
  --surface-2: #222229;
  --surface-3: #2b2b33;
  --text: #f3f3f6;
  --muted: #9b9ba8;
  --border: #2b2b34;
  --overlay: rgba(0, 0, 0, .6);
  --shadow: none;
  color-scheme: dark;
}

/* ================================================================ Base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 750; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pad { padding: 0 16px; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 20px; }
.sale { color: var(--sale); }
.ok { color: var(--ok); }
.nowrap { white-space: nowrap; }

#app { height: 100%; max-width: 640px; margin: 0 auto; position: relative; }

/* ================================================================ Pages & navigation */
.page {
  position: absolute; inset: 0 0 calc(var(--tabbar-h) + var(--safe-b)) 0;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  background: var(--bg); visibility: hidden; z-index: 0;
}
.page.active { visibility: visible; z-index: 1; }
.page.no-tabbar { bottom: 0; }
.page > div { min-height: 100%; display: flex; flex-direction: column; }
.page-body { padding-bottom: 24px; }

.header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  min-height: 54px; padding: 8px 12px 8px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.header h1 { font-size: 21px; }
.header .title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  color: var(--text); background: transparent; transition: background .15s;
}
.icon-btn:active { background: var(--surface-3); }
.icon-btn.filled { background: var(--surface); box-shadow: var(--shadow); }
.back-btn { margin-left: -8px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 640px; margin: 0 auto;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--muted); position: relative;
}
.tab.active { color: var(--accent); }
.tab .tab-badge {
  position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--sale); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}
.seller .tab.active { color: var(--text); }

/* ================================================================ Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px;
  border-radius: 14px; font-weight: 700; font-size: 15px; background: var(--accent); color: #fff;
  transition: transform .1s, opacity .15s; white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.grad { background: var(--grad); }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.danger { background: rgba(229, 72, 77, .12); color: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn.xs { height: 30px; padding: 0 10px; border-radius: 9px; font-size: 13px; }
.btn .btn-sub { font-weight: 600; opacity: .85; }
.btn-col { display: flex; flex-direction: column; line-height: 1.15; align-items: center; }

.link-btn { color: var(--accent); font-weight: 600; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.input, .textarea, .select {
  width: 100%; border: 1.5px solid var(--border); background: var(--surface); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color .15s; font-size: 16px;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.textarea { min-height: 88px; resize: vertical; }
.input.error { border-color: var(--danger); }
.input-row { display: flex; gap: 8px; }
.input-row > * { flex: 1; min-width: 0; }

.search-field {
  flex: 1; width: 100%; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 13px;
  background: var(--surface); color: var(--muted); box-shadow: var(--shadow); border: 1.5px solid transparent;
}
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; color: var(--text); }
.search-field.focus { border-color: var(--accent); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--surface); font-size: 14px;
  font-weight: 600; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border);
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { color: var(--muted); font-weight: 600; }
.chip.active .count { color: inherit; opacity: .7; }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-3); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }

.check { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--border); flex: none;
  display: grid; place-items: center; color: #fff; transition: all .15s; background: var(--surface); }
.check.on { background: var(--accent); border-color: var(--accent); }

.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 12px; height: 36px; }
.stepper button { width: 36px; height: 36px; display: grid; place-items: center; color: var(--text); }
.stepper button[disabled] { opacity: .3; }
.stepper span { min-width: 22px; text-align: center; font-weight: 700; font-size: 15px; }

.radio-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1.5px solid var(--border);
  background: var(--surface); text-align: left; width: 100%;
}
.radio-card.active { border-color: var(--accent); background: var(--accent-soft); }
.radio-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); flex: none; margin-top: 1px; position: relative; }
.radio-card.active .radio-dot { border-color: var(--accent); }
.radio-card.active .radio-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }

.segmented { display: flex; background: var(--surface-3); border-radius: 12px; padding: 3px; }
.segmented button { flex: 1; height: 34px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ================================================================ Cards & lists */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.cards { display: flex; flex-direction: column; gap: 10px; padding: 0 12px; }
.card-title { font-size: 17px; font-weight: 750; margin-bottom: 12px; }

.list { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; width: 100%; text-align: left; position: relative; }
.list-item + .list-item::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: 1px; background: var(--border); }
.list-item.no-icon + .list-item.no-icon::before { left: 16px; }
.list-item:active { background: var(--surface-2); }
.list-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 16px; color: #fff; }
.list-item .chev { color: var(--muted); flex: none; }
.list-item .value { color: var(--muted); font-size: 14px; }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 700; }
.badge.sale { background: var(--sale); color: #fff; }
.badge.soft { background: var(--surface-3); color: var(--muted); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.demo { background: rgba(240, 140, 0, .14); color: var(--warn); }
.count-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--sale); color: #fff;
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

.status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 13px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { background: var(--accent-soft); color: var(--accent); }
.st-confirmed { background: rgba(47, 124, 246, .12); color: var(--blue); }
.st-paid { background: rgba(15, 159, 158, .12); color: var(--teal); }
.st-shipped { background: rgba(240, 140, 0, .13); color: var(--warn); }
.st-completed { background: rgba(19, 165, 98, .12); color: var(--ok); }
.st-cancelled { background: var(--surface-3); color: var(--muted); }

.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 16px; margin-bottom: 12px; }
.section-head a, .section-head button { font-size: 14px; font-weight: 600; color: var(--accent); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 32px; }
.empty-emoji { font-size: 56px; line-height: 1; margin-bottom: 6px; }
.empty h3 { font-size: 19px; }
.empty p { margin: 0; color: var(--muted); }

.divider { height: 1px; background: var(--border); margin: 12px 0; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 15px; }
.kv > :first-child { color: var(--muted); }
.kv.total { font-size: 18px; font-weight: 800; padding-top: 10px; }
.kv.total > :first-child { color: var(--text); }

/* ================================================================ Home */
.home-top { padding: 12px 16px 6px; display: flex; align-items: center; gap: 10px; }
.logo { font-weight: 900; font-size: 22px; letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.home-search { padding: 4px 16px 10px; position: sticky; top: 0; z-index: 5; background: var(--bg); }

.banners { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px; scrollbar-width: none; }
.banners::-webkit-scrollbar { display: none; }
.banner {
  flex: none; width: calc(100% - 28px); height: 150px; border-radius: var(--r-lg); padding: 18px; scroll-snap-align: center;
  color: #fff; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; text-align: left;
}
.banner h2 { font-size: 23px; font-weight: 850; max-width: 70%; }
.banner p { margin: 6px 0 0; font-size: 14px; opacity: .92; max-width: 70%; }
.banner::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); }
.banner::before { content: ""; position: absolute; right: 30px; bottom: -60px; width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255, 255, 255, .1); }
.tone-violet { background: linear-gradient(125deg, #5b2ee8, #a445e0); }
.tone-coral { background: linear-gradient(125deg, #ff5e62, #ff9966); }
.tone-dark { background: linear-gradient(125deg, #17171d, #3a2a6b); }
.banner-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.banner-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-3); transition: all .2s; }
.banner-dots i.on { width: 16px; background: var(--accent); }

.perks { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
.perks::-webkit-scrollbar { display: none; }
.perk { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--surface); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.perk b { font-size: 18px; }

.cat-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat-bubble { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px;
  font-weight: 600; text-align: center; line-height: 1.2; }
.cat-bubble .img { width: 72px; height: 72px; border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.cat-bubble .img img { width: 100%; height: 100%; object-fit: cover; }
.cat-bubble .img.all { display: grid; place-items: center; background: var(--grad); color: #fff; }

/* ================================================================ Product cards */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 8px; padding: 0 8px; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .pcard { flex: none; width: 150px; }

.pcard { display: flex; flex-direction: column; text-align: left; min-width: 0; position: relative; }
.pcard-img { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: var(--surface-3); }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.pcard-img .fav { position: absolute; top: 6px; right: 6px; }
.pcard-img .badge { position: absolute; left: 8px; bottom: 8px; }
.pcard-img.out img { opacity: .45; filter: grayscale(.4); }
.pcard-img .out-label { position: absolute; left: 8px; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .6); color: #fff;
  font-size: 12px; font-weight: 700; text-align: center; border-radius: 8px; padding: 4px; }
.pcard-body { padding: 8px 4px 0; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.price.sale { color: var(--sale); }
.old-price { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.pcard-name { font-size: 13px; line-height: 1.3; }
.pcard-name b { font-weight: 700; }
.rating { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.rating .star { color: var(--star); }
.rating b { color: var(--text); font-weight: 700; }
.pcard .btn { margin-top: auto; }
.pcard .add-row { margin-top: auto; padding-top: 8px; }

.fav { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .85);
  color: #1a1a1f; backdrop-filter: blur(6px); transition: transform .15s; }
.fav:active { transform: scale(.85); }
.fav.on { color: var(--sale); }

/* ================================================================ Catalog */
.catalog { display: grid; grid-template-columns: 104px 1fr; min-height: calc(100% - 60px); }
.cat-side { background: var(--surface); border-radius: 0 var(--r) var(--r) 0; padding: 6px 0; align-self: start; position: sticky; top: 60px; }
.cat-side button { display: block; width: 100%; text-align: left; padding: 12px 12px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-left: 3px solid transparent; line-height: 1.25; }
.cat-side button.active { color: var(--text); border-left-color: var(--accent); background: var(--accent-soft); }
.cat-main { padding: 4px 12px 24px; }
.cat-main h2 { margin: 4px 4px 12px; }
.cat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-tile { background: var(--surface); border-radius: var(--r); overflow: hidden; text-align: left; box-shadow: var(--shadow); }
.cat-tile .img { aspect-ratio: 1; background: var(--surface-3); }
.cat-tile .img img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile .name { padding: 8px 10px 10px; font-size: 13px; font-weight: 700; line-height: 1.25; }
.cat-tile .name small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* ================================================================ Listing toolbar */
.toolbar { position: sticky; top: 54px; z-index: 4; display: flex; gap: 8px; padding: 6px 16px 10px; background: var(--bg); overflow-x: auto;
  scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.result-count { padding: 0 16px 10px; font-size: 13px; color: var(--muted); }
.sentinel { height: 1px; }
.loader { display: flex; justify-content: center; padding: 24px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ================================================================ Product page */
.gallery { position: relative; background: var(--surface-3); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: none; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: center; }
.gallery-dots { position: absolute; bottom: 30px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.gallery-dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(0, 0, 0, .2); transition: all .2s; }
.gallery-dots i.on { width: 18px; background: rgba(0, 0, 0, .65); }
.gallery-actions { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; }
.gallery-back { position: absolute; top: 12px; left: 12px; }

.pd { background: var(--bg); border-radius: 22px 22px 0 0; margin-top: -18px; position: relative; padding-top: 6px; }
.pd-block { background: var(--surface); border-radius: var(--r-lg); padding: 16px; margin: 8px 8px 0; box-shadow: var(--shadow); }
.pd-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pd-price .price { font-size: 28px; }
.my-price { margin-top: 10px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.pd-name { margin-top: 10px; font-size: 18px; font-weight: 650; line-height: 1.3; }
.pd-brand { color: var(--accent); font-weight: 700; font-size: 14px; }
.pd-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size {
  min-width: 52px; height: 46px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface); font-weight: 700; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.1;
}
.size small { font-size: 10px; font-weight: 600; color: var(--warn); }
.size.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.size.disabled { color: var(--muted); background: var(--surface-2); text-decoration: line-through; border-style: dashed; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.specs { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; text-align: right; }
.desc { white-space: pre-line; font-size: 15px; line-height: 1.5; }
.desc.collapsed { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.info-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.info-row .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.seller-card { display: flex; align-items: center; gap: 12px; }
.seller-logo { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 900;
  display: grid; place-items: center; font-size: 18px; flex: none; }

.bottom-bar {
  position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); border-top: 1px solid var(--border); margin-top: auto;
}
.bottom-bar .btn { flex: 1; }
.bottom-bar .bb-price { display: flex; flex-direction: column; line-height: 1.15; }
.bottom-bar .bb-price b { font-size: 19px; }

/* ================================================================ Reviews */
.rating-summary { display: flex; gap: 18px; align-items: center; }
.rating-big { font-size: 42px; font-weight: 850; line-height: 1; }
.stars { display: inline-flex; gap: 1px; color: var(--star); }
.stars .empty-star { color: var(--surface-3); }
.dist { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dist-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: var(--star); border-radius: 3px; }
.review { padding: 14px 0; border-top: 1px solid var(--border); }
.review:first-child { border-top: 0; }
.review-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800;
  display: grid; place-items: center; flex: none; overflow: hidden; font-size: 15px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.review-text { margin-top: 8px; font-size: 15px; }
.reply { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.reply b { display: block; font-size: 13px; margin-bottom: 2px; }
.star-input { display: flex; gap: 6px; justify-content: center; }
.star-input button { color: var(--surface-3); transition: transform .1s; }
.star-input button.on { color: var(--star); }
.star-input button:active { transform: scale(.85); }

/* ================================================================ Cart */
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.cart-item:first-child, .divider + .cart-item { border-top: 0; }
.cart-item .thumb { width: 84px; flex: none; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item.unavailable .thumb, .cart-item.unavailable .ci-info { opacity: .5; }
.ci-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ci-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.ci-actions .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.free-hint { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft);
  color: var(--accent); font-size: 14px; font-weight: 600; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 3px; transition: width .3s; }

.sticky-cta { position: sticky; bottom: 0; z-index: 6; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--border); margin-top: auto; }
.cards:has(+ .sticky-cta), .pd > :nth-last-child(2) { margin-bottom: 16px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs img, .thumbs .more { width: 52px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-3); }
.thumbs .more { display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ================================================================ Success */
.success { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px 24px; gap: 12px; }
.success-icon { width: 96px; height: 96px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }

/* ================================================================ Profile */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 16px; }
.level-card { margin: 0 12px; border-radius: 22px; padding: 18px; color: #fff; position: relative; overflow: hidden; text-align: left; width: calc(100% - 24px); display: block; }
.level-card::after { content: ""; position: absolute; right: -30px; top: -50px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.lvl-bronze { background: linear-gradient(130deg, #8c5a36, #d59a63); }
.lvl-silver { background: linear-gradient(130deg, #5f6878, #b8c0cc); }
.lvl-gold { background: linear-gradient(130deg, #a8741a, #f1c55a); }
.level-card .lc-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.level-card .lc-nums { display: flex; gap: 24px; margin-top: 18px; }
.level-card .lc-nums b { display: block; font-size: 26px; font-weight: 850; line-height: 1.1; }
.level-card .lc-nums span { font-size: 13px; opacity: .85; }
.level-card .lc-progress { margin-top: 16px; font-size: 13px; }
.level-card .progress { background: rgba(255, 255, 255, .3); margin-top: 6px; }
.level-card .progress i { background: #fff; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 12px; margin-top: 10px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 20px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--muted); }
.seller-entry { display: flex; align-items: center; gap: 14px; margin: 12px; padding: 16px; border-radius: var(--r-lg); background: #17171d;
  color: #fff; text-align: left; width: calc(100% - 24px); }
:root[data-theme="dark"] .seller-entry { background: var(--surface-3); }
.seller-entry .se-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--grad); display: grid; place-items: center; flex: none; }

/* ================================================================ Order */
.order-card { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); text-align: left; width: 100%; display: block; }
.timeline { display: flex; flex-direction: column; }
.tl-step { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); flex: none; display: grid; place-items: center; color: #fff; z-index: 1; }
.tl-step.done .tl-dot { background: var(--ok); }
.tl-step.current .tl-dot { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-step.cancel .tl-dot { background: var(--danger); }
.tl-step::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--surface-3); }
.tl-step.done::before { background: var(--ok); }
.tl-step:last-child::before { display: none; }
.tl-step .tl-text { padding-top: 1px; }
.tl-step:not(.done):not(.current):not(.cancel) .tl-text { color: var(--muted); }
.copy-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.copy-box code { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); text-align: left; width: 100%; }
.order-item:first-child { border-top: 0; }
.order-item img { width: 56px; height: 70px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; }

/* ================================================================ Referral */
.ref-hero { margin: 0 12px; padding: 22px 18px; border-radius: 24px; background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.ref-hero h2 { font-size: 24px; font-weight: 850; max-width: 85%; }
.ref-hero p { margin: 8px 0 0; opacity: .92; }
.ref-hero::after { content: "🤝"; position: absolute; right: 14px; top: 10px; font-size: 44px; opacity: .9; }
.levels-table { display: flex; flex-direction: column; gap: 8px; }
.level-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.level-row.current { background: var(--accent-soft); outline: 1.5px solid var(--accent); }
.level-chip { width: 40px; height: 40px; border-radius: 12px; flex: none; }

/* ================================================================ Sheet, toast */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--overlay); animation: fade .2s; display: flex; align-items: flex-end; justify-content: center; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(20px + var(--safe-b)); animation: slideup .25s cubic-bezier(.2, .9, .3, 1); }
@keyframes slideup { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 12px; }
.sheet-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-title h2 { font-size: 20px; }
.option { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 4px; font-size: 16px;
  border-top: 1px solid var(--border); text-align: left; }
.option:first-of-type { border-top: 0; }
.option.active { color: var(--accent); font-weight: 700; }

.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 60;
  max-width: 560px; padding: 12px 16px; border-radius: 14px; background: #1c1c22; color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); animation: toastin .25s; }
.toast.error { background: var(--danger); }
.toast.success .t-ic { color: #3ee08f; }
@keyframes toastin { from { transform: translateY(20px); opacity: 0; } }

.splash { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.splash .logo { font-size: 34px; }
.browser-note { margin: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(240, 140, 0, .13); color: var(--warn); font-size: 13px; font-weight: 600; }

/* ================================================================ Seller */
.seller-head { padding: 14px 16px 6px; display: flex; align-items: center; gap: 10px; }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px;
  background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px; }
.kpi { background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 21px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 170px; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 6px 10px;
  border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.bar { flex: 1; min-width: 0; background: var(--accent); opacity: .55; border-radius: 5px 5px 2px 2px; transition: opacity .15s; }
.bar.sel { opacity: 1; background: var(--grad); }
.bar-labels { display: flex; gap: 3px; margin-top: 6px; }
.bar-labels span { flex: 1; min-width: 0; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: visible; }
.attn { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); width: 100%; text-align: left; }
.attn:first-of-type { border-top: 0; }
.attn .n { min-width: 36px; height: 36px; padding: 0 8px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); width: 100%; text-align: left; }
.mini-row:first-of-type { border-top: 0; }
.mini-row img { width: 44px; height: 55px; border-radius: 9px; object-fit: cover; background: var(--surface-3); flex: none; }
.prod-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow); text-align: left; width: 100%; }
.prod-row img { width: 60px; height: 75px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; }
.prod-row.hidden-p img { opacity: .5; }
.fab { position: sticky; bottom: 16px; margin-left: auto; margin-right: 16px; z-index: 6; width: 58px; height: 58px; border-radius: 50%;
  background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(106, 61, 240, .4); }
.fab-wrap { display: flex; justify-content: flex-end; pointer-events: none; position: sticky; bottom: 16px; padding-right: 16px; }
.fab-wrap .fab { pointer-events: auto; position: static; margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photo-cell { position: relative; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell .rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff;
  display: grid; place-items: center; }
.photo-cell .main-label { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px;
  background: var(--accent); color: #fff; }
.photo-add { border: 2px dashed var(--border); background: var(--surface); display: grid; place-items: center; color: var(--muted);
  text-align: center; font-size: 12px; font-weight: 600; cursor: pointer; }
.photo-add input { display: none; }
.dyn-row { display: flex; gap: 8px; align-items: center; }
.dyn-row .input { padding: 10px 12px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.bubble-preview { background: var(--surface-2); border-radius: 16px 16px 16px 4px; padding: 12px 14px; white-space: pre-wrap; font-size: 15px; }
.tree-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--border); }
.tree-item.child { padding-left: 38px; font-size: 14px; }
.tree-item:first-child { border-top: 0; }
