/* ============================================================
   Progress 786 — Mini App styles (dark theme)
   ============================================================ */
:root{
  --bg:        #0e131c;
  --bg-2:      #141a25;
  --card:      #1a2230;
  --card-2:    #202a3a;
  --line:      #2a3346;
  --text:      #eef1f6;
  --muted:     #8b94a7;
  --muted-2:   #626c80;
  --red:       #ff3b30;
  --red-2:     #ff5a4d;
  --blue:      #2e9bff;
  --blue-2:    #0a84ff;
  --green:     #30d158;
  --radius:    16px;
  --radius-sm: 12px;
  --nav-h:     68px;
  --header-h:  54px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ margin:0; padding:0; }
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  background:var(--bg);
  color:var(--text);
  overscroll-behavior-y:none;
  -webkit-font-smoothing:antialiased;
}
button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
input{ font-family:inherit; }
a{ color:inherit; text-decoration:none; }
::-webkit-scrollbar{ width:0; height:0; }

/* ================= HEADER ================= */
.app-header{
  position:sticky; top:0; z-index:40;
  height:calc(var(--header-h) + var(--safe-top));
  padding-top:var(--safe-top);
  display:flex; align-items:center; justify-content:space-between;
  padding-left:14px; padding-right:14px;
  background:rgba(14,19,28,.92);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}
.icon-btn{
  display:flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:12px; color:var(--text);
  transition:background .15s;
}
.icon-btn:active{ background:var(--card); }
.cart-header{ position:relative; }
.miniapp-pill{
  display:flex; align-items:center; gap:7px;
  background:linear-gradient(135deg,var(--blue),var(--blue-2));
  color:#fff; font-weight:700; font-size:15px;
  padding:8px 18px; border-radius:22px;
  box-shadow:0 4px 14px rgba(10,132,255,.35);
}
.badge{
  position:absolute; top:2px; right:2px;
  min-width:18px; height:18px; padding:0 5px;
  background:var(--red); color:#fff; font-size:11px; font-weight:700;
  border-radius:9px; display:flex; align-items:center; justify-content:center;
  border:2px solid var(--bg);
}

/* ================= MAIN ================= */
#app{
  padding:0 14px calc(var(--nav-h) + var(--safe-bottom) + 20px);
  min-height:100vh;
}
.view{ animation:fade .25s ease; }
@keyframes fade{ from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none} }
.page-title{ font-size:22px; font-weight:800; margin:18px 2px 14px; }

/* ================= BRAND ================= */
.brand{ display:flex; justify-content:center; padding:22px 4px 12px; }
.brand-logo{ display:flex; align-items:center; gap:13px; }
.mstripe{ display:flex; gap:4px; height:34px; transform:skewX(-20deg); flex-shrink:0; filter:drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.mstripe i{ display:block; width:7px; height:100%; background:var(--c); border-radius:1.5px; }
.mstripe i:nth-child(1){ height:64%; align-self:flex-end; }
.mstripe i:nth-child(2){ height:82%; align-self:flex-end; }
.mstripe i:nth-child(3){ height:100%; }
.mstripe i:nth-child(4){ height:100%; }
.mstripe i:nth-child(5){ height:82%; align-self:flex-end; }
.mstripe i:nth-child(6){ height:64%; align-self:flex-end; }
.brand-word{ font-family:'Saira Condensed','Inter',sans-serif; font-weight:800; font-size:32px; letter-spacing:.5px; color:#ececea; line-height:1; text-transform:uppercase; }

/* ================= SEARCH ================= */
.search-wrap{
  position:relative; display:flex; align-items:center;
  background:var(--card); border:1px solid var(--line);
  border-radius:14px; padding:0 10px; margin:14px 0 16px; height:52px;
}
.search-ic{ color:var(--muted-2); flex-shrink:0; }
.search-wrap input{
  flex:1; background:none; border:none; outline:none; color:var(--text);
  font-size:15px; padding:0 10px; min-width:0;
}
.search-wrap input::placeholder{ color:var(--muted-2); }
.scan-btn{ color:var(--muted); width:34px; height:34px; display:flex; align-items:center; justify-content:center; }

.search-suggest{
  position:absolute; left:0; right:0; top:calc(100% + 6px);
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  overflow:hidden; z-index:30;
  box-shadow:0 12px 32px rgba(0,0,0,.4);
}
.search-suggest .sg-label{
  font-size:10.5px; font-weight:700; color:var(--muted-2); text-transform:uppercase;
  letter-spacing:.4px; padding:9px 14px 4px;
}
.search-suggest .sg-item{
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  font-size:14px; color:var(--text);
}
.search-suggest .sg-item:active{ background:var(--bg-2); }
.search-suggest .sg-item svg{ color:var(--muted-2); flex-shrink:0; }
.search-suggest .sg-item b{ font-weight:700; }

/* ================= CATEGORY ROW ================= */
.cat-row{
  display:flex; gap:10px; overflow-x:auto; padding:2px 0 6px;
  scroll-snap-type:x proximity;
}
.cat-item{
  flex:0 0 auto; width:76px; display:flex; flex-direction:column; align-items:center; gap:7px;
}
.cat-ic{
  width:60px; height:60px; border-radius:16px;
  background:var(--card); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; color:var(--text);
  transition:transform .12s, border-color .15s, background .15s;
}
.cat-item.on .cat-ic{ background:var(--card-2); border-color:var(--blue); color:var(--blue); }
.cat-item:active .cat-ic{ transform:scale(.93); }
.cat-label{ font-size:11.5px; color:var(--muted); text-align:center; font-weight:500; }
.cat-item.on .cat-label{ color:var(--text); }

/* ================= TOOLBAR ================= */
.toolbar{
  display:flex; align-items:center; justify-content:space-between;
  margin:8px 0 12px; gap:8px;
}
.toolbar-title{ font-size:19px; font-weight:800; white-space:nowrap; }
.toolbar-actions{ display:flex; gap:8px; overflow-x:auto; }
.chip{
  display:flex; align-items:center; gap:5px; white-space:nowrap;
  background:var(--card); border:1px solid var(--line); color:var(--text);
  padding:8px 12px; border-radius:20px; font-size:13px; font-weight:600;
  transition:background .15s;
}
.chip:active{ background:var(--card-2); }
.chip.active{ border-color:var(--blue); color:var(--blue); }

.active-filters{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.af-tag{
  display:flex; align-items:center; gap:6px;
  background:var(--card-2); border:1px solid var(--blue); color:var(--blue);
  padding:6px 10px; border-radius:16px; font-size:12.5px; font-weight:600;
}
.af-tag button{ color:var(--blue); font-size:16px; line-height:1; display:flex; }
.af-clear{ color:var(--muted); font-size:12.5px; text-decoration:underline; align-self:center; }

/* ================= PRODUCT GRID ================= */
.grid{
  display:grid; grid-template-columns:repeat(2,1fr); gap:12px;
}
.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; display:flex; flex-direction:column; position:relative;
  transition:transform .12s;
}
.card:active{ transform:scale(.98); }
.card-img{
  position:relative; aspect-ratio:1/.82; background:var(--bg-2);
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.card-img img{ width:100%; height:100%; object-fit:cover; }
.card-img .ph{ width:64%; height:64%; opacity:.9; }
.card-tags{ position:absolute; top:8px; left:8px; display:flex; gap:6px; flex-wrap:wrap; }
.tag-hit{ background:var(--red); color:#fff; font-size:10px; font-weight:800; padding:3px 7px; border-radius:8px; letter-spacing:.3px; }
.tag-sale{ background:var(--green); color:#04210d; font-size:10px; font-weight:800; padding:3px 7px; border-radius:8px; }
.tag-out{ position:absolute; inset:0; background:rgba(14,19,28,.6); display:flex; align-items:center; justify-content:center; color:var(--muted); font-weight:700; font-size:13px; }
.card-body{ padding:10px 11px 12px; display:flex; flex-direction:column; gap:4px; flex:1; }
.card-name{ font-size:13.5px; font-weight:600; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:34px; }
.card-art{ font-size:11px; color:var(--muted-2); }
.card-price-row{ display:flex; align-items:baseline; gap:7px; margin-top:2px; flex-wrap:wrap; }
.card-price{ font-size:16px; font-weight:800; color:var(--red-2); }
.card-price.req{ font-size:13px; font-weight:700; color:var(--muted-2); }
.card-old{ font-size:12px; color:var(--muted-2); text-decoration:line-through; }
.card-add{
  margin-top:8px; display:flex; align-items:center; justify-content:center; gap:6px;
  background:linear-gradient(135deg,var(--blue),var(--blue-2)); color:#fff;
  height:40px; border-radius:11px; font-weight:700; font-size:13.5px;
  transition:filter .15s, transform .1s;
}
.card-add:active{ transform:scale(.96); filter:brightness(1.1); }
.card-add.in-cart{ background:var(--card-2); border:1px solid var(--green); color:var(--green); }

/* выбор количества прямо на карточке */
.card-actions{ display:flex; flex-direction:column; gap:7px; margin-top:8px; }
.card-actions .card-add{ margin-top:0; width:100%; }
.card-qty{ display:flex; align-items:center; justify-content:space-between; height:38px; background:var(--bg-2); border:1px solid var(--line); border-radius:11px; overflow:hidden; }
.card-qty .cq-btn{ width:40px; height:100%; flex-shrink:0; font-size:20px; font-weight:700; color:var(--text); display:flex; align-items:center; justify-content:center; }
.card-qty .cq-btn:active{ background:var(--card-2); }
.card-qty .qty-input{ flex:1; width:100%; min-width:0; height:100%; text-align:center; font-size:14px; font-weight:800; color:var(--text); background:transparent; border:none; outline:none; padding:0; -moz-appearance:textfield; }

.load-more-wrap{ display:flex; justify-content:center; padding:18px 0; }
.load-more{
  background:var(--card); border:1px solid var(--line); color:var(--text);
  padding:12px 28px; border-radius:14px; font-weight:600; font-size:14px;
}
.load-more:active{ background:var(--card-2); }

.empty{ text-align:center; padding:60px 20px; color:var(--muted-2); }
.empty p{ font-size:17px; font-weight:700; color:var(--muted); margin:14px 0 4px; }
.empty span{ font-size:13px; }

/* ================= CATEGORIES VIEW ================= */
.cat-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.cat-card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:20px 16px; display:flex; flex-direction:column; gap:12px; align-items:flex-start;
  transition:transform .12s;
}
.cat-card:active{ transform:scale(.97); }
.cat-card .cc-ic{ width:52px; height:52px; border-radius:14px; display:flex; align-items:center; justify-content:center; }
.cat-card .cc-name{ font-size:16px; font-weight:700; }
.cat-card .cc-count{ font-size:12.5px; color:var(--muted); }

/* ================= CART ================= */
.cart-item{
  display:flex; gap:12px; background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius-sm); padding:10px; margin-bottom:10px; align-items:center;
}
.cart-item .ci-img{ width:62px; height:62px; border-radius:10px; background:var(--bg-2); flex-shrink:0; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.cart-item .ci-img img{ width:100%; height:100%; object-fit:cover; }
.cart-item .ci-img svg{ width:60%; height:60%; }
.ci-info{ flex:1; min-width:0; }
.ci-name{ font-size:13.5px; font-weight:600; line-height:1.25; margin-bottom:3px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.ci-art{ font-size:11px; color:var(--muted-2); margin-bottom:5px; }
.ci-price{ font-size:15px; font-weight:800; color:var(--red-2); }
.ci-controls{ display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.qty{ display:flex; align-items:center; gap:0; background:var(--bg-2); border-radius:10px; border:1px solid var(--line); }
.qty button{ width:32px; height:32px; font-size:18px; font-weight:700; color:var(--text); display:flex; align-items:center; justify-content:center; }
.qty span{ min-width:26px; text-align:center; font-size:14px; font-weight:700; }
.qty .qty-input{ width:40px; min-width:40px; height:32px; text-align:center; font-size:14px; font-weight:700; color:var(--text); background:transparent; border:none; outline:none; padding:0; -moz-appearance:textfield; }

/* редактируемое поле количества — прячем стрелки-спиннеры */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.ci-remove{ color:var(--muted-2); font-size:12px; display:flex; align-items:center; gap:3px; }

.cart-empty{ text-align:center; padding:70px 20px; color:var(--muted-2); }
.cart-empty p{ font-size:18px; font-weight:700; color:var(--muted); margin:16px 0 20px; }

.cart-summary{
  position:sticky; bottom:calc(var(--nav-h) + var(--safe-bottom) + 8px);
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:16px; margin-top:16px; box-shadow:0 -6px 24px rgba(0,0,0,.35);
}
.summary-row{ display:flex; justify-content:space-between; font-size:14px; color:var(--muted); margin-bottom:8px; }
.summary-row.total{ font-size:18px; font-weight:800; color:var(--text); margin:12px 0 0; padding-top:12px; border-top:1px solid var(--line); }

.btn-primary{
  width:100%; height:52px; border-radius:14px; font-weight:700; font-size:16px;
  background:linear-gradient(135deg,var(--red),var(--red-2)); color:#fff;
  display:flex; align-items:center; justify-content:center; gap:8px;
  transition:filter .15s, transform .1s;
}
.btn-primary:active{ transform:scale(.98); filter:brightness(1.08); }
.btn-checkout{ margin-top:14px; }

/* ================= ORDERS ================= */
.order-card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:14px; margin-bottom:12px;
}
.order-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.order-id{ font-weight:700; font-size:15px; }
.order-status{ font-size:11.5px; font-weight:700; padding:4px 10px; border-radius:12px; background:rgba(48,209,88,.15); color:var(--green); }
.order-date{ font-size:12px; color:var(--muted-2); }
.order-items{ font-size:13px; color:var(--muted); line-height:1.6; }
.order-total{ margin-top:10px; padding-top:10px; border-top:1px solid var(--line); display:flex; justify-content:space-between; font-weight:800; }
.order-total span:last-child{ color:var(--red-2); }

/* ================= PROFILE ================= */
.profile-card{
  display:flex; align-items:center; gap:14px; background:var(--card);
  border:1px solid var(--line); border-radius:var(--radius); padding:18px; margin-bottom:16px;
}
.profile-card .pc-ava{
  width:60px; height:60px; border-radius:50%;
  background:linear-gradient(135deg,var(--blue),var(--blue-2));
  display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:800; color:#fff;
}
.pc-name{ font-size:18px; font-weight:800; }
.pc-sub{ font-size:13px; color:var(--muted); margin-top:2px; }
.profile-links{ display:flex; flex-direction:column; gap:1px; background:var(--line); border-radius:var(--radius); overflow:hidden; }
.p-link{ display:flex; justify-content:space-between; gap:12px; align-items:baseline; background:var(--card); padding:15px 16px; font-size:14px; }
.p-link span:first-child{ white-space:nowrap; }
.p-link span:last-child{ color:var(--muted); text-align:right; }
.profile-foot{ text-align:center; color:var(--muted-2); font-size:12px; margin-top:24px; }

/* ================= BOTTOM NAV ================= */
.bottom-nav{
  position:fixed; left:0; right:0; bottom:0; z-index:45;
  height:calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom:var(--safe-bottom);
  background:rgba(16,22,32,.96); backdrop-filter:blur(16px);
  border-top:1px solid var(--line);
  display:flex; align-items:flex-start; justify-content:space-around;
  padding-top:8px;
}
.nav-item{
  display:flex; flex-direction:column; align-items:center; gap:3px;
  color:var(--muted-2); font-size:10.5px; font-weight:500; flex:1; padding-top:2px;
  transition:color .15s;
}
.nav-item.active{ color:var(--blue); }
.nav-item span{ white-space:nowrap; }
.nav-fab{
  position:relative; flex:0 0 auto; transform:translateY(-16px);
  width:60px; height:60px; border-radius:50%;
  background:linear-gradient(135deg,var(--blue),var(--blue-2)); color:#fff;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 22px rgba(10,132,255,.45); border:4px solid var(--bg);
}
.nav-fab:active{ transform:translateY(-16px) scale(.94); }
.fab-badge{
  position:absolute; top:-2px; right:-2px; min-width:20px; height:20px; padding:0 5px;
  background:var(--red); color:#fff; font-size:11px; font-weight:800; border-radius:10px;
  display:flex; align-items:center; justify-content:center; border:2px solid var(--bg);
}

/* ================= SHEETS / MODALS ================= */
.sheet-overlay{
  position:fixed; inset:0; z-index:50; background:rgba(0,0,0,.6);
  backdrop-filter:blur(2px); animation:fadeOv .2s;
}
@keyframes fadeOv{ from{opacity:0} to{opacity:1} }
.sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:51;
  background:var(--bg-2); border-radius:22px 22px 0 0;
  border-top:1px solid var(--line);
  max-height:86vh; overflow-y:auto;
  padding:0 18px calc(24px + var(--safe-bottom));
  animation:slideUp .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideUp{ from{transform:translateY(100%)} to{transform:none} }
.sheet-tall{ min-height:60vh; }
.sheet-grip{ width:40px; height:4px; border-radius:2px; background:var(--line); margin:12px auto 6px; }
.sheet-title{ font-size:19px; font-weight:800; padding:6px 0 16px; position:sticky; top:0; background:var(--bg-2); z-index:2; }
.sheet-close{ position:absolute; top:14px; right:16px; width:32px; height:32px; border-radius:50%; background:var(--card); display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:20px; }

/* product sheet */
.ps-img{ width:100%; aspect-ratio:1/.7; border-radius:16px; background:var(--card); display:flex; align-items:center; justify-content:center; overflow:hidden; margin-bottom:16px; }
.ps-img img{ width:100%; height:100%; object-fit:cover; }
.ps-img .ph{ width:52%; height:52%; }
.ps-name{ font-size:20px; font-weight:800; line-height:1.25; margin-bottom:8px; }
.ps-meta{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.ps-meta .m{ font-size:12.5px; color:var(--muted); background:var(--card); border:1px solid var(--line); padding:6px 11px; border-radius:12px; }
.ps-row{ display:flex; justify-content:space-between; padding:11px 0; border-bottom:1px solid var(--line); font-size:14px; }
.ps-row span:first-child{ color:var(--muted); }
.ps-row span:last-child{ font-weight:600; }
.ps-price{ display:flex; align-items:baseline; gap:10px; margin:16px 0; }
.ps-price .p{ font-size:28px; font-weight:900; color:var(--red-2); }
.ps-price .p.req{ font-size:19px; font-weight:800; color:var(--muted-2); }
.ps-price .o{ font-size:16px; color:var(--muted-2); text-decoration:line-through; }
.ps-stock{ font-size:13px; font-weight:600; }
.ps-stock.in{ color:var(--green); }
.ps-stock.out{ color:var(--muted-2); }
.ps-actions{ display:flex; gap:10px; margin-top:18px; }
.ps-qty{ display:flex; align-items:center; background:var(--card); border:1px solid var(--line); border-radius:14px; }
.ps-qty button{ width:46px; height:52px; font-size:22px; font-weight:700; color:var(--text); }
.ps-qty span{ min-width:34px; text-align:center; font-weight:800; font-size:17px; }
.ps-qty .qty-input{ width:56px; min-width:56px; height:52px; text-align:center; font-weight:800; font-size:17px; color:var(--text); background:transparent; border:none; outline:none; padding:0; -moz-appearance:textfield; }

/* list options (sort/brand/filter) */
.opt{ display:flex; align-items:center; justify-content:space-between; padding:15px 4px; border-bottom:1px solid var(--line); font-size:15px; }
.opt:last-child{ border-bottom:none; }
.opt.on{ color:var(--blue); font-weight:700; }
.opt .check{ color:var(--blue); }
.brand-search{ width:100%; height:46px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:0 14px; color:var(--text); font-size:15px; outline:none; margin-bottom:10px; position:sticky; top:52px; z-index:2; }
.price-inputs{ display:flex; gap:12px; margin:16px 0; }
.price-inputs input{ flex:1; height:48px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:0 14px; color:var(--text); font-size:15px; outline:none; }
.stock-toggle{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; }
.switch{ width:48px; height:28px; border-radius:14px; background:var(--card); border:1px solid var(--line); position:relative; transition:background .2s; flex-shrink:0; }
.switch.on{ background:var(--green); border-color:var(--green); }
.switch::after{ content:''; position:absolute; top:2px; left:2px; width:22px; height:22px; border-radius:50%; background:#fff; transition:transform .2s; }
.switch.on::after{ transform:translateX(20px); }

/* checkout form */
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:13px; color:var(--muted); margin-bottom:7px; font-weight:600; }
.field input, .field textarea{
  width:100%; background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:14px; color:var(--text); font-size:15px; outline:none; transition:border-color .15s;
}
.field input:focus, .field textarea:focus{ border-color:var(--blue); }
.field textarea{ resize:none; min-height:70px; }
.field.err input, .field.err textarea, .field.err select, .field.err .acct-select{ border-color:var(--red); }
.delivery-opts{ display:flex; gap:10px; margin-bottom:14px; }
.delivery-opt{
  flex:1; padding:14px 10px; border-radius:12px; border:1px solid var(--line); background:var(--card);
  text-align:center; font-size:14px; font-weight:600; transition:all .15s;
}
.delivery-opt.on{ border-color:var(--blue); background:var(--card-2); color:var(--blue); }
.delivery-opt .di{ display:block; font-size:22px; margin-bottom:4px; }
.co-summary{ background:var(--card); border-radius:12px; padding:14px; margin:16px 0; }
.co-summary .cs-row{ display:flex; justify-content:space-between; font-size:14px; color:var(--muted); padding:4px 0; }
.co-summary .cs-row.tot{ font-size:17px; font-weight:800; color:var(--text); margin-top:8px; padding-top:10px; border-top:1px solid var(--line); }

/* toast */
.toast{
  position:fixed; left:50%; bottom:calc(var(--nav-h) + var(--safe-bottom) + 20px);
  transform:translateX(-50%); z-index:60;
  background:#fff; color:#0e131c; font-weight:600; font-size:14px;
  padding:12px 20px; border-radius:14px; box-shadow:0 8px 30px rgba(0,0,0,.4);
  animation:toastIn .25s; max-width:90vw; text-align:center;
}
@keyframes toastIn{ from{opacity:0; transform:translate(-50%,10px)} to{opacity:1; transform:translate(-50%,0)} }
.toast.ok{ border-left:4px solid var(--green); }

/* success screen inside checkout */
.co-success{ text-align:center; padding:40px 10px 20px; }
.co-success .cs-ic{ width:88px; height:88px; border-radius:50%; background:rgba(48,209,88,.15); display:flex; align-items:center; justify-content:center; margin:0 auto 20px; color:var(--green); }
.co-success h3{ font-size:22px; font-weight:800; margin:0 0 8px; }
.co-success p{ color:var(--muted); font-size:14px; line-height:1.5; margin:0 0 6px; }
.co-success .oid{ color:var(--blue); font-weight:800; font-size:16px; margin:12px 0 24px; }

/* ============================================================
   Accounts / cabinets
   ============================================================ */
.co-region{
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:11px 13px; font-size:12.5px; color:var(--muted); margin-bottom:14px; line-height:1.45;
}
.co-region b{ color:var(--blue); }

/* profile panel */
.acct-panel{ display:flex; flex-direction:column; gap:10px; margin:14px 0 20px; }
.acct-badge{
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:12px 14px; font-size:13.5px; font-weight:600; color:var(--text);
}
.acct-badge.admin{ border-color:#c9922e; color:#f0c24a; background:rgba(201,146,46,.10); }
.acct-badge.seller{ border-color:var(--blue); color:var(--blue); background:var(--card-2); }
.acct-badge.muted{ color:var(--muted-2); }
.acct-btn{
  width:100%; height:50px; border-radius:14px; background:var(--card);
  border:1px solid var(--line); color:var(--text); font-size:15px; font-weight:600;
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.acct-btn:active{ background:var(--card-2); transform:scale(.99); }
.acct-btn.primary{
  background:linear-gradient(135deg,var(--blue-2),var(--blue)); border:none; color:#fff;
  box-shadow:0 6px 18px rgba(10,132,255,.3);
}
.acct-btn.danger{
  background:rgba(255,69,58,.10); border-color:var(--red-2); color:var(--red-2);
}
.acct-btn.sm{ width:auto; height:38px; padding:0 16px; font-size:13.5px; }
.acct-switch{
  display:flex; align-items:center; gap:10px; padding:12px 14px; margin-bottom:12px;
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  font-size:14px; font-weight:600; color:var(--text); cursor:pointer;
}
.acct-switch input{ width:20px; height:20px; accent-color:var(--blue); }
.acct-hint{ font-size:13px; color:var(--muted); line-height:1.5; margin:-4px 0 16px; }
.acct-select{
  width:100%; background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:13px 14px; color:var(--text); font-size:15px; outline:none;
  -webkit-appearance:none; appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%238b94a7' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center;
}
.acct-select:focus{ border-color:var(--blue); }
.acct-loading, .acct-empty{ text-align:center; color:var(--muted-2); padding:34px 10px; font-size:14px; }
.acct-note{ background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; font-size:13px; color:var(--muted); line-height:1.55; margin-bottom:14px; }
.acct-count{ font-size:12.5px; color:var(--muted-2); margin:2px 0 12px; }
.acct-toolbar{ display:flex; gap:10px; align-items:center; margin-bottom:14px; }
.acct-toolbar .acct-select{ flex:1; }
.btn-primary.sm{ height:44px; font-size:14px; flex:1; }

/* admin tabs */
.acct-tabs{ display:flex; gap:8px; margin-bottom:16px; position:sticky; top:52px; background:var(--bg-2); z-index:2; padding-bottom:6px; }
.acct-tab{
  flex:1; padding:11px 4px; border-radius:12px; background:var(--card);
  border:1px solid var(--line); color:var(--muted); font-size:12.5px; font-weight:600;
}
.acct-tab.on{ background:var(--card-2); border-color:var(--blue); color:var(--blue); }

/* stats */
.stat-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:18px; }
.stat-card{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; text-align:center; }
.sc-num{ font-size:23px; font-weight:900; color:var(--text); }
.sc-lbl{ font-size:12px; color:var(--muted); margin-top:4px; }
.stat-sub{ font-size:13px; font-weight:700; color:var(--muted); margin:6px 0 8px; }
.stat-rows{ background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.stat-row{ display:flex; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--line); font-size:14px; }
.stat-row:last-child{ border-bottom:none; }
.stat-row span:last-child{ font-weight:700; }

/* order cards (staff) */
.ord-card{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; margin-bottom:12px; }
.ord-top{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.ord-id{ font-weight:800; font-size:14px; }
/* .ord-badge — единый стиль ниже, цвет приходит из справочника статусов */
.ord-date{ font-size:11.5px; color:var(--muted-2); margin-bottom:8px; }
.ord-cust{ font-size:14px; font-weight:600; margin-bottom:4px; }
.ord-contact{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.ord-call{ font-size:13px; color:var(--blue); font-weight:600; }
.ord-addr, .ord-note{ font-size:12.5px; color:var(--muted); margin-bottom:4px; }
.ord-items{ font-size:13px; color:var(--muted); line-height:1.6; margin:8px 0; padding:8px 0; border-top:1px dashed var(--line); border-bottom:1px dashed var(--line); }
.ord-total{ display:flex; justify-content:space-between; font-weight:800; font-size:15px; margin:8px 0; }
.ord-status-row{ display:flex; align-items:center; gap:10px; }
.ord-status-row label{ font-size:13px; color:var(--muted); }
.ord-status-row .acct-select{ flex:1; padding:10px 12px; }

/* order items editor (staff) */
.oi-row{ display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.oi-row:last-child{ border-bottom:none; }
.oi-name{ flex:1; min-width:0; font-size:14px; font-weight:600; display:flex; flex-direction:column; gap:2px; }
.oi-price{ font-size:12px; color:var(--muted); font-weight:500; }
.oi-qty{ display:flex; align-items:center; gap:8px; background:var(--bg-2); border-radius:10px; padding:4px 8px; flex-shrink:0; }
.oi-qty button{ width:26px; height:26px; font-size:16px; font-weight:700; color:var(--text); display:flex; align-items:center; justify-content:center; }
.oi-qty span{ min-width:18px; text-align:center; font-weight:700; font-size:14px; }
.oi-rm{ width:30px; height:30px; flex-shrink:0; color:var(--red-2); font-size:15px; display:flex; align-items:center; justify-content:center; }
.oi-search-results{
  position:absolute; left:0; right:0; top:calc(100% - 2px); z-index:20;
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 12px 28px rgba(0,0,0,.4); max-height:260px; overflow-y:auto;
}
.oi-sr-item{ display:flex; justify-content:space-between; gap:10px; padding:10px 14px; font-size:13.5px; }
.oi-sr-item:active{ background:var(--bg-2); }
.oi-sr-price{ color:var(--muted); flex-shrink:0; }
.oi-sr-empty{ padding:14px; text-align:center; color:var(--muted-2); font-size:13px; }

/* seller rows */
.srl{ display:flex; align-items:center; gap:10px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:10px; }
.srl-main{ flex:1; min-width:0; }
.srl-name{ font-size:14px; font-weight:700; }
.srl-meta{ font-size:11.5px; color:var(--muted-2); margin-top:3px; }
.srl-role{ color:var(--muted); }
.srl-role.admin{ color:#f0c24a; }
.srl-off{ color:var(--red-2); font-size:11px; }
.srl-bound{ font-size:11px; }
.srl-actions{ display:flex; gap:6px; }
.srl-btn{ width:36px; height:36px; border-radius:10px; background:var(--bg-2); border:1px solid var(--line); font-size:15px; display:flex; align-items:center; justify-content:center; }
.srl-btn:active{ background:var(--card-2); }

/* credentials */
.cred-box{ background:var(--card); border:1px solid var(--line); border-radius:12px; padding:6px 14px; margin-bottom:16px; }
.cred-line{ display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.cred-line:last-child{ border-bottom:none; }
.cred-line span{ color:var(--muted); font-size:13px; }
.cred-line code, .cred-row code{ font-family:ui-monospace,Menlo,monospace; font-size:14px; color:var(--green); font-weight:700; }
.cred-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:16px; max-height:48vh; overflow-y:auto; }
.cred-row{ display:grid; grid-template-columns:1fr auto auto; gap:10px; align-items:center; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:12.5px; }
.cred-row b{ color:var(--text); }

/* ============================================================
   Загрузка фото товара (админ): клик / drag&drop / вставка
   ============================================================ */
.img-drop{
  position:relative; display:flex; align-items:center; justify-content:center;
  min-height:150px; padding:14px; cursor:pointer;
  background:var(--bg-2); border:1.5px dashed var(--line); border-radius:var(--radius-sm);
  transition:border-color .15s, background .15s;
}
.img-drop:hover, .img-drop:focus-visible{ border-color:var(--blue); background:var(--card); outline:none; }
.img-drop.over{ border-color:var(--blue); border-style:solid; background:var(--card-2); }
.img-drop.busy{ pointer-events:none; }

.img-drop-empty{ display:flex; flex-direction:column; align-items:center; gap:5px; color:var(--muted-2); text-align:center; }
.img-drop-empty b{ color:var(--text); font-size:14px; font-weight:600; }
.img-drop-empty span{ font-size:12px; }

.img-drop-preview{ position:relative; width:100%; display:flex; justify-content:center; }
.img-drop-preview img{
  max-height:210px; max-width:100%; border-radius:10px; object-fit:contain;
  background:#fff;
}
.img-drop-x{
  position:absolute; top:-6px; right:-6px; width:30px; height:30px; border-radius:50%;
  background:var(--red); color:#fff; font-size:19px; line-height:1; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,.45); border:none; cursor:pointer;
}
.img-drop-x:active{ background:var(--red-2); }

.img-drop-busy{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(14,19,28,.72); border-radius:var(--radius-sm);
}
.img-spin{
  width:26px; height:26px; border-radius:50%;
  border:2.5px solid var(--line); border-top-color:var(--blue);
  animation:img-spin .7s linear infinite;
}
@keyframes img-spin{ to{ transform:rotate(360deg); } }

.img-url-input{ margin-top:8px; font-size:12.5px; }

/* ============================================================
   Баннеры главного экрана (управляются из админки)
   ============================================================ */
.banner-wrap{ margin:0 0 14px; }
.banner-track{
  display:flex; gap:10px; overflow-x:auto; scroll-snap-type:x mandatory;
  scrollbar-width:none; -ms-overflow-style:none;
}
.banner-track::-webkit-scrollbar{ display:none; }
.banner-slide{
  position:relative; flex:0 0 100%; scroll-snap-align:center;
  border-radius:var(--radius); overflow:hidden; background:var(--card);
  border:1px solid var(--line); min-height:120px; cursor:pointer;
}
.banner-slide img{ width:100%; height:100%; max-height:190px; object-fit:cover; display:block; }
.banner-body{
  position:absolute; inset:auto 0 0 0; padding:12px 14px;
  background:linear-gradient(to top, rgba(10,14,20,.92), rgba(10,14,20,0));
}
/* баннер без картинки — текст на карточке, а не поверх пустоты */
.banner-slide:not(:has(img)) .banner-body{ position:static; background:var(--card); padding:18px 16px; }
.banner-title{ font-size:16px; font-weight:800; color:#fff; }
.banner-text{ font-size:12.5px; color:rgba(255,255,255,.82); margin-top:3px; line-height:1.35; }
.banner-dots{ display:flex; gap:5px; justify-content:center; margin-top:8px; }
.banner-dot{ width:6px; height:6px; border-radius:50%; background:var(--line); transition:background .2s, width .2s; }
.banner-dot.on{ background:var(--blue); width:16px; border-radius:3px; }

/* ============================================================
   Плитки брендов (вместо категорий товаров)
   ============================================================ */
.brand-ic{ overflow:hidden; padding:0; background:var(--card); }
.brand-ic img{ width:100%; height:100%; object-fit:contain; padding:6px; background:#fff; }
.brand-initials{
  font-style:normal; font-weight:800; font-size:15px; letter-spacing:.5px; color:var(--muted);
}
.cat-item.on .brand-initials{ color:var(--blue); }
.cc-ic.brand-cc{ overflow:hidden; }
.cc-ic.brand-cc img{ width:100%; height:100%; object-fit:contain; padding:7px; background:#fff; border-radius:inherit; }
.cc-ic.brand-cc .brand-initials{ font-size:19px; }

/* ============================================================
   Плашка статуса заказа — только в админке/кабинете продавца.
   Покупателю статус не показывается (он узнаёт о смене из Telegram).
   ============================================================ */
.ord-badge{
  display:inline-flex; align-items:center; gap:5px;
  font-size:12px; font-weight:700; padding:5px 10px; border-radius:999px;
  color:var(--c, var(--muted)); background:color-mix(in srgb, var(--c, #8b94a7) 16%, transparent);
  border:1px solid color-mix(in srgb, var(--c, #8b94a7) 45%, transparent);
  white-space:nowrap;
}

/* Админ: списки брендов и баннеров */
.adm-actions{ display:flex; gap:8px; margin-bottom:12px; }
.adm-actions .acct-btn{ flex:1; }
.brand-row{ grid-template-columns:1fr auto auto; }
.br-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.br-left > span:last-child{ min-width:0; overflow:hidden; }
.br-logo{
  flex:0 0 auto; width:40px; height:40px; border-radius:9px; overflow:hidden;
  background:var(--bg-2); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:13px; color:var(--muted);
}
.br-logo.wide{ width:58px; }
.br-logo img{ width:100%; height:100%; object-fit:contain; background:#fff; }

/* ============================================================
   Бегунок быстрой прокрутки — виден постоянно (родной скроллбар
   выше скрыт), тянется пальцем/мышкой. Работает и на основной
   странице, и внутри открытого sheet-листа.

   Кликабелен ТОЛЬКО сам бегунок (.scroll-thumb), не вся полоса:
   .scroll-rail растянут на всю высоту экрана, и если сделать
   кликабельной всю эту полосу (было так раньше — "клик по треку —
   прыжок туда"), она перехватывает тапы по любым кнопкам, которые
   оказались рядом с правым краем (например «Saralash» в панели
   фильтров) — они переставали нажиматься. Бегунок сам по себе
   узкий и высотой всего 32-60px, поэтому такого перекрытия не даёт.
   ============================================================ */
.scroll-rail{
  position:fixed; right:1px; z-index:55;
  top:calc(var(--header-h) + var(--safe-top) + 10px);
  bottom:calc(var(--nav-h) + var(--safe-bottom) + 10px);
  width:16px;
  display:flex; justify-content:center;
  opacity:0; pointer-events:none; /* сама полоса кликов не ловит — только .scroll-thumb ниже */
  transition:opacity .2s;
}
.scroll-rail.show{ opacity:1; }
.scroll-thumb{
  width:16px; /* удобная область захвата пальцем */
  display:flex; justify-content:center;
  pointer-events:auto;
  touch-action:none; cursor:grab;
}
.scroll-thumb::before{
  content:""; width:5px; border-radius:3px;
  background:var(--muted-2); opacity:.55;
  transition:opacity .15s, width .15s, background .15s;
}
.scroll-thumb:hover::before,
.scroll-thumb:active::before{
  width:8px; opacity:.9; background:var(--blue);
}
.scroll-thumb:active{ cursor:grabbing; }
body.scroll-thumb-dragging{ user-select:none; -webkit-user-select:none; }
body.scroll-thumb-dragging .scroll-thumb::before{
  width:8px; opacity:.95; background:var(--blue);
}
