:root {
  --bg: #000;
  --card: #151516;
  --card-hi: #1d1d1f;
  --card2: #232325;
  --card3: #2e2e31;
  --line: rgba(255, 255, 255, .07);
  --text: #fff;
  --muted: #8e8e93;
  --muted2: #5d5d62;
  --ok: #34c759;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --r: 26px;
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --ease: cubic-bezier(.2, .9, .3, 1);
  --safe-top: calc(env(safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 16px; line-height: 1.3;
  overscroll-behavior-y: none; min-height: 100vh;
  -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
input, textarea { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
svg { display: block; }
a { color: inherit; }
.sel { -webkit-user-select: text; user-select: text; }

html, * { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

#app { max-width: 540px; margin: 0 auto; padding: calc(var(--safe-top) + 12px) 14px calc(118px + var(--safe-bottom)); }
body.has-buybar #app { padding-bottom: calc(112px + var(--safe-bottom)); }
body.editing #app { padding-top: calc(var(--safe-top) + 64px); }
body.editor-open #app { padding-bottom: 58vh; }

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 200; transition: opacity .35s; }
#boot.gone { opacity: 0; pointer-events: none; }
.boot-dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #2a2a2c; border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-err { text-align: center; padding: 30px; color: var(--muted); line-height: 1.45; }
.boot-err b { color: #fff; display: block; font-size: 19px; margin-bottom: 8px; }

/* ---------- motion ---------- */
.view > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.view.still > * { animation: none; }
.view.push { animation: pushIn .42s var(--ease) both; }
.view.push > * { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes pushIn { from { opacity: 0; transform: translateX(34px); } }
.grid > * { animation: tilePop .5s var(--spring) both; animation-delay: calc(var(--k, 0) * 40ms + 80ms); }
.view.still .grid > *, .view.push .grid > * { animation: none; }
@keyframes tilePop { from { opacity: 0; transform: scale(.88) translateY(10px); } }
.press { transition: transform .3s var(--spring), background .2s, filter .2s; }
.press:active { transform: scale(.955); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

/* ---------- cards ---------- */
.card {
  position: relative; background: linear-gradient(180deg, var(--card-hi) 0%, var(--card) 100%);
  border-radius: var(--r); overflow: hidden; margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 0 0 1px rgba(255, 255, 255, .03);
}
.pad { padding: 18px; }
.section-title { font-size: 14px; font-weight: 600; color: var(--muted); margin: 22px 6px 10px; }
.muted { color: var(--muted); }

/* hero (shop / balance) */
.hero { min-height: 196px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-bg { position: absolute; inset: 0; background:
  radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.10) 0%, transparent 55%),
  radial-gradient(90% 80% at 0% 100%, rgba(255,255,255,.05) 0%, transparent 60%),
  linear-gradient(160deg, #202022 0%, #121213 100%); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.55) 100%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .09) 50%, transparent 65%); transform: translateX(-120%); animation: shine 5s ease-in-out infinite 1.4s; pointer-events: none; }
@keyframes shine { 0% { transform: translateX(-120%); } 28%, 100% { transform: translateX(120%); } }
.hero-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; z-index: 2; }
.hero-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; padding-top: 4px; }
.hero-ava { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero-bottom { position: relative; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; }
.cap { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: rgba(255,255,255,.62); text-transform: uppercase; }
.bal { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-top: 4px; display: flex; align-items: baseline; gap: 8px; }
.bal .cur { font-size: 32px; color: rgba(255,255,255,.55); font-weight: 700; }
.plus { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); margin-bottom: 6px; }
.plus:active { transform: scale(.88); }

/* ---------- product / category grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pc {
  position: relative; overflow: hidden; border-radius: 24px; min-height: 172px; padding: 16px 14px 14px;
  display: flex; flex-direction: column; background: linear-gradient(180deg, var(--card-hi) 0%, var(--card) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 0 0 1px rgba(255, 255, 255, .03);
  transition: transform .32s var(--spring);
}
.pc:active { transform: scale(.955); }
.pc-icon-wrap { height: 50px; display: flex; align-items: flex-start; position: relative; z-index: 1; }
.pc-name { position: relative; z-index: 3; font-size: 15px; font-weight: 600; line-height: 1.25; margin-top: 12px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-foot { position: relative; z-index: 3; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 10px; }
.pc-price { font-size: 21px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.pc-price small { font-size: 14px; color: rgba(255,255,255,.55); font-weight: 650; margin-left: 2px; }
.pc-price .from { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 3px; }
.pc-stock { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pc-stock.low { color: var(--warn); }
.pc-stock.out { color: var(--bad); }
.pc-bar { position: relative; z-index: 3; height: 3px; border-radius: 3px; background: rgba(255,255,255,.1); margin-top: 8px; overflow: hidden; }
.pc-bar i { position: absolute; inset: 0; right: auto; width: calc(var(--w, 1) * 100%); background: rgba(255,255,255,.85); border-radius: 3px; transform-origin: left; animation: barGrow 1s var(--ease) both .35s; }
.pc-bar.low i { background: var(--warn); }
@keyframes barGrow { from { transform: scaleX(0); } }
.pc.soldout .pc-name, .pc.soldout .pc-icon-wrap { opacity: .45; }
.pc-arrow { position: absolute; top: 16px; right: 14px; color: var(--muted); z-index: 3; }
.pc-sub { position: relative; z-index: 3; font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.deco-anchor { position: absolute; right: 0; bottom: 0; z-index: 2; pointer-events: none; }
.deco-anchor .slot { pointer-events: none; }
body.editing .deco-anchor, body.editing .deco-anchor .slot { pointer-events: auto; }

/* ---------- slots (stickers the admin can place) ---------- */
.slot {
  display: inline-block; position: relative; flex: none; line-height: 0;
  width: var(--s, 40px); height: var(--s, 40px);
  transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--r, 0deg)) scaleX(var(--f, 1));
  opacity: var(--o, 1);
}
.slot.hid { display: none; }
.deco-anchor .slot { transform-origin: 100% 100%; }
.slot.cover { position: absolute; inset: 0; width: 100%; height: 100%; transform: translate(var(--x, 0px), var(--y, 0px)) scale(var(--k, 1)) rotate(var(--r, 0deg)) scaleX(var(--f, 1)); }
.slot.cover .stk img, .slot.cover .stk video { object-fit: cover; }
.stk { display: block; width: 100%; height: 100%; position: relative; line-height: 0; color: inherit; }
.stk svg { width: 100% !important; height: 100% !important; }
.stk img, .stk video { width: 100%; height: 100%; object-fit: contain; display: block; -webkit-user-drag: none; pointer-events: none; }
.stk .fb { display: grid; place-items: center; width: 100%; height: 100%; font-size: calc(var(--s, 40px) * .7); line-height: 1; }
.float { animation: floaty 3.4s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* custom emoji inside text */
.ce { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.24em; line-height: 0; margin: 0 .04em; }
.ce .stk { width: 100%; height: 100%; }
.ce-fb { line-height: 1.2em; font-size: 1em; }

/* ---------- product page ---------- */
.p-hero { position: relative; aspect-ratio: 16 / 10.5; border-radius: 28px; overflow: hidden; margin-bottom: 18px;
  background: radial-gradient(70% 70% at 50% 45%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 70%), linear-gradient(180deg, #1b1b1d, #0e0e0f);
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.p-hero .glow { position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%); filter: blur(10px); animation: pulse 4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .7; } }
.p-title { display: flex; align-items: center; gap: 12px; margin: 0 4px 10px; }
.p-title h1 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; font-weight: 750; }
.p-price { display: flex; align-items: center; gap: 12px; margin: 0 4px 18px; }
.p-price b { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.chip-stock { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--card2); color: #c7c7cc; font-size: 14px; font-weight: 600; }
.chip-stock.low { color: var(--warn); }
.chip-stock.out { color: var(--bad); }
.qblock { position: relative; background: linear-gradient(180deg, var(--card-hi), var(--card)); border-radius: 20px; padding: 14px 16px 14px 20px; margin-bottom: 10px; font-size: 16px; line-height: 1.45; color: #e5e5ea;
  -webkit-user-select: text; user-select: text; }
.qblock::before { content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: rgba(255,255,255,.28); }
.rich b { font-weight: 700; color: #fff; }
.rich code, .rich pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: rgba(255,255,255,.08); border-radius: 6px; padding: 1px 5px; }
.rich pre { display: block; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; margin: 6px 0; }
.rich blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid rgba(255,255,255,.25); }
.rich a { text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 2px; }
.spoiler { background: rgba(255,255,255,.22); color: transparent; border-radius: 4px; transition: color .3s, background .3s; cursor: pointer; }
.spoiler.open { background: transparent; color: inherit; }

.denoms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.denom { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s, background .2s, transform .3s var(--spring); }
.denom b { display: block; font-size: 19px; font-weight: 750; }
.denom span { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.denom.on { background: var(--card2); box-shadow: inset 0 0 0 1.5px #fff; }
.denom:active { transform: scale(.95); }
.custom-amt { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 18px; padding: 6px 6px 6px 16px; }
.custom-amt input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 19px; font-weight: 650; padding: 10px 0; }
.custom-amt input::placeholder { color: var(--muted2); font-weight: 500; }
.custom-amt .cur { color: var(--muted); font-weight: 650; }
.hint { color: var(--muted); font-size: 13.5px; line-height: 1.4; margin: 8px 6px 0; }

/* buy bar */
#buybar { position: fixed; left: 50%; bottom: calc(12px + var(--safe-bottom)); transform: translate(-50%, 140%); width: min(calc(100% - 24px), 520px); z-index: 30;
  display: flex; gap: 8px; align-items: stretch; transition: transform .45s var(--spring); pointer-events: none; }
body.has-buybar #buybar { transform: translate(-50%, 0); pointer-events: auto; }
.stepper { display: flex; align-items: center; background: rgba(38,38,40,.78); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); border-radius: 99px; height: 60px; padding: 0 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.stepper button { width: 32px; height: 48px; display: grid; place-items: center; color: #fff; border-radius: 99px; }
.stepper button:disabled { color: #555; }
.stepper span { min-width: 22px; text-align: center; font-size: 19px; font-weight: 650; }
.buy { flex: 1; min-width: 0; height: 60px; border-radius: 99px; background: #f5f5f7; color: #0a0a0a; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 16px; white-space: nowrap; padding: 0 10px; font-weight: 700; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: transform .3s var(--spring), opacity .2s; }
.buy:active { transform: scale(.96); }
.buy:disabled { background: #2c2c2e; color: #8e8e93; box-shadow: none; }
.round-glass { width: 54px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(38,38,40,.78); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); flex: none; }
.round-glass:active { transform: scale(.9); }

/* ---------- lists / rows ---------- */
.rows { background: linear-gradient(180deg, var(--card-hi), var(--card)); border-radius: 22px; overflow: hidden; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; min-height: 66px; position: relative; }
.row + .row::before { content: ""; position: absolute; left: 66px; right: 0; top: 0; height: 1px; background: var(--line); }
.row:active { background: rgba(255,255,255,.035); }
.row .ri { width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 16.5px; font-weight: 650; }
.row .s { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.row .end { text-align: right; font-weight: 650; }
.chev { width: 30px; height: 30px; border-radius: 50%; background: var(--card3); display: grid; place-items: center; color: #d1d1d6; flex: none; }
.row.card-row { background: linear-gradient(180deg, var(--card-hi), var(--card)); border-radius: 22px; margin-bottom: 10px; }
.row.card-row + .row.card-row::before { display: none; }
.row.dim { opacity: .5; }

/* ---------- tiles (info / profile) ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tile { position: relative; background: linear-gradient(180deg, var(--card-hi), var(--card)); border-radius: 22px; padding: 16px; min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transition: transform .3s var(--spring); }
.tile:active { transform: scale(.955); }
.tile .ti { height: 36px; display: flex; align-items: center; }
.tile .tt { font-size: 16px; font-weight: 700; margin-top: 12px; }
.tile .ts { font-size: 13px; color: var(--muted); margin-top: 3px; }
.tile .ta { position: absolute; top: 14px; right: 14px; color: var(--muted2); }
.stat { background: linear-gradient(180deg, var(--card-hi), var(--card)); border-radius: 22px; padding: 16px; min-height: 104px; }
.stat .k { font-size: 13.5px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 10px; }
.stat .v small { font-size: 18px; color: rgba(255,255,255,.55); }
.stat .n { font-size: 12.5px; color: var(--muted2); margin-top: 3px; font-weight: 500; }
.stat:active { transform: scale(.97); }

.about { display: flex; justify-content: space-between; min-height: 170px; }
.about-left { display: flex; flex-direction: column; justify-content: space-between; position: relative; z-index: 2; }
.about h2 { margin: 0; font-size: 27px; line-height: 1.05; letter-spacing: -.02em; font-weight: 800; }
.about h2 .sub { display: block; color: rgba(255,255,255,.42); font-weight: 750; }
.about .badge { align-self: flex-start; margin-bottom: 26px; }
.about-left { flex: 1; min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: rgba(255,255,255,.08); font-size: 13.5px; font-weight: 600; color: #d1d1d6; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.quote { position: relative; padding: 14px 16px 14px 22px; font-size: 15.5px; font-weight: 600; line-height: 1.4; color: #e5e5ea; }
.quote::before { content: ""; position: absolute; left: 12px; top: 13px; bottom: 13px; width: 3px; border-radius: 3px; background: rgba(255,255,255,.3); }

.prof-head { display: flex; align-items: center; gap: 14px; }
.ava { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #3a3a3c, #1c1c1e); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.prof-name { font-size: 19px; font-weight: 750; }
.prof-user { font-size: 14px; color: var(--muted); margin-top: 2px; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.btn-tile { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; border-radius: 22px; background: linear-gradient(180deg, var(--card-hi), var(--card)); font-size: 16.5px; font-weight: 700; transition: transform .3s var(--spring); }
.btn-tile:active { transform: scale(.95); }

/* orders */
.orders-hero { min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; }
.orders-hero h2 { margin: 0; font-size: 30px; line-height: 1.08; letter-spacing: -.02em; font-weight: 800; max-width: 62%; position: relative; z-index: 2; }
.hero-deco { position: absolute; right: 18px; bottom: 16px; z-index: 1; }
.o-date { font-size: 12.5px; color: var(--muted2); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; padding: 3px 9px; border-radius: 99px; background: var(--card3); color: #d1d1d6; }
.status-pill.ok { background: rgba(52,199,89,.14); color: var(--ok); }
.status-pill.wait { background: rgba(255,159,10,.14); color: var(--warn); }
.status-pill.bad { background: rgba(255,69,58,.14); color: var(--bad); }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 0 20px; border-radius: 18px; font-weight: 700; font-size: 17px; text-align: center; background: var(--card3); color: #fff; transition: transform .3s var(--spring), opacity .2s, filter .2s; }
.btn:active { transform: scale(.965); filter: brightness(.92); }
.btn.primary { background: #f5f5f7; color: #0a0a0a; }
.btn.ghost { background: var(--card2); }
.btn.sm { min-height: 44px; font-size: 15.5px; border-radius: 14px; width: auto; padding: 0 18px; }
.btn:disabled, .btn.disabled { opacity: .4; pointer-events: none; }
.btn.center-pill { width: auto; margin: 18px auto 0; border-radius: 99px; padding: 0 26px; min-height: 48px; background: #e5e5ea; color: #0a0a0a; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.4px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .8; }

/* ---------- tab bar (liquid glass) ---------- */
#nav {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%);
  width: min(calc(100% - 40px), 360px); height: 66px; z-index: 25; padding: 5px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(34, 34, 36, .64); backdrop-filter: blur(26px) saturate(1.7); -webkit-backdrop-filter: blur(26px) saturate(1.7);
  border-radius: 999px; box-shadow: 0 14px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 255, 255, .07);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .45s var(--spring), box-shadow .3s, opacity .3s;
  animation: navIn .7s cubic-bezier(.2, 1.2, .3, 1) both .15s;
}
body.has-buybar #nav { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }
#nav.dragging { transform: translateX(-50%) scale(1.03); box-shadow: 0 20px 50px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .14); }
@keyframes navIn { from { transform: translate(-50%, 90px) scale(.9); opacity: 0; } }
#nav .ind { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 4); transform: translateX(var(--x, 0px)); transition: transform .5s cubic-bezier(.3, 1.35, .5, 1); pointer-events: none; }
#nav.dragging .ind { transition: transform .09s linear; }
#nav .ind i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .13); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(0, 0, 0, .2);
  transition: transform .42s cubic-bezier(.3, 1.6, .5, 1), background .25s, box-shadow .25s; }
#nav.dragging .ind i { transform: scale(1.2, 1.15); background: rgba(255, 255, 255, .22); backdrop-filter: blur(6px) brightness(1.25); -webkit-backdrop-filter: blur(6px) brightness(1.25);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5), inset 0 1.5px 0 rgba(255, 255, 255, .4), inset 0 0 0 1px rgba(255, 255, 255, .12); }
#nav button { position: relative; z-index: 1; display: grid; place-items: center; border-radius: 999px; color: #8e8e93; transition: color .25s; }
#nav button .ni { display: grid; place-items: center; width: 28px; height: 28px; transition: transform .45s cubic-bezier(.3, 1.8, .5, 1); }
#nav button .ni .slot { --s: 28px; }
#nav button.on, #nav button.hot { color: #fff; }
#nav button.hot .ni { transform: scale(1.18); }
#nav button.pop .ni { animation: navPop .55s cubic-bezier(.3, 1.8, .5, 1); }
#nav button .dot { position: absolute; top: 12px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px rgba(34,34,36,1); }
@keyframes navPop { 0% { transform: scale(1); } 35% { transform: scale(1.3) translateY(-3px); } 100% { transform: scale(1); } }

/* ---------- sheets ---------- */
#sheets { position: relative; z-index: 50; }
.sheet-wrap { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: sfade .25s ease both; }
.sheet {
  position: relative; width: 100%; max-width: 540px; max-height: calc(100% - var(--safe-top) - 8px); overflow-y: auto; overscroll-behavior: contain;
  background: #111112; border-radius: 30px 30px 0 0; padding: 8px 16px calc(22px + var(--safe-bottom));
  animation: sup .34s var(--ease) both; box-shadow: 0 -12px 40px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255,255,255,.06);
}
.sheet-wrap.full .sheet { min-height: calc(100% - var(--safe-top) - 8px); }
.sheet-wrap.out .sheet { animation: sdown .22s ease both; }
.sheet-wrap.out .scrim { animation: sfadeout .22s ease both; }
.sheet.drag { transition: none !important; animation: none; }
.sheet.snap { transition: transform .38s var(--spring); }
@keyframes sup { from { transform: translateY(100%); } }
@keyframes sdown { to { transform: translateY(100%); } }
@keyframes sfade { from { opacity: 0; } }
@keyframes sfadeout { to { opacity: 0; } }
.grab { width: 38px; height: 5px; border-radius: 3px; background: #3a3a3c; margin: 4px auto 12px; touch-action: none; }
.grab-zone { padding: 2px 0 6px; margin: -8px -16px 0; touch-action: none; cursor: grab; }
.sheet .x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; color: #aeaeb2; z-index: 3; transition: transform .3s var(--spring); }
.sheet .x:active { transform: scale(.85) rotate(90deg); }
.sheet .body > * { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 38ms + 50ms); }
.sheet .body.still > * { animation: none; }
.sh-hero { display: grid; place-items: center; margin: 12px 0 6px; min-height: 100px; }
.sh-title { text-align: center; font-size: 25px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin: 8px 26px 6px; }
.sh-sub { text-align: center; color: var(--muted); margin: 0 12px 18px; font-size: 15px; line-height: 1.4; }
.sh-label { font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 18px 6px 8px; }
.amount-box { background: var(--card); border-radius: 24px; padding: 18px; display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.amount-box input { width: 100%; max-width: 70%; text-align: center; background: none; border: 0; outline: 0; font-size: 50px; font-weight: 800; letter-spacing: -.03em; padding: 0; caret-color: #fff; }
.amount-box input::placeholder { color: #48484a; }
.amount-box .cur { font-size: 34px; font-weight: 800; color: #636366; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.chip { height: 44px; border-radius: 99px; background: var(--card2); font-weight: 650; font-size: 15px; color: #c7c7cc; display: grid; place-items: center; transition: background .2s, color .2s, transform .3s var(--spring); }
.chip:active { transform: scale(.92); }
.chip.on { background: #f5f5f7; color: #0a0a0a; }
.legal { color: var(--muted2); font-size: 12.5px; line-height: 1.45; text-align: center; margin: 14px 8px 0; }
.legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.sum-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 14px 16px; }
.sum-row .grow { flex: 1; min-width: 0; }
.sum-row .t { font-weight: 650; font-size: 16px; }
.sum-row .s { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.sum-row .p { font-weight: 800; font-size: 19px; white-space: nowrap; }
.big-amt { text-align: center; font-size: 52px; font-weight: 800; letter-spacing: -.03em; margin: 2px 0 18px; }
.big-amt small { font-size: 36px; color: #8e8e93; }
.status-line { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 14.5px; margin: 14px 0 4px; }
.content-box { background: var(--card); border-radius: 18px; padding: 14px 16px; font-size: 15.5px; line-height: 1.45; word-break: break-word; -webkit-user-select: text; user-select: text; }
.content-box + .content-box { margin-top: 8px; }
.copy-row { display: flex; gap: 8px; margin-top: 10px; justify-content: center; }
.pop { animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; line-height: 1.45; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 300;
  background: rgba(245, 245, 247, .97); color: #111; padding: 12px 18px; border-radius: 16px; font-weight: 650; font-size: 15px; max-width: min(90%, 420px);
  text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--spring); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #ff453a; color: #fff; }

/* ---------- layout editor (admins) ---------- */
.edit-fab { position: fixed; top: calc(var(--safe-top) + 10px); right: 12px; z-index: 40; height: 34px; padding: 0 12px; border-radius: 99px; display: flex; align-items: center; gap: 6px;
  background: rgba(40,40,42,.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 13.5px; font-weight: 650; color: #e5e5ea; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
#editbar { position: fixed; top: 0; left: 0; right: 0; z-index: 45; display: none; padding: calc(var(--safe-top) + 8px) 12px 8px; }
body.editing #editbar { display: block; }
.editbar-in { max-width: 540px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 18px;
  background: rgba(255,214,10,.14); box-shadow: inset 0 0 0 1px rgba(255,214,10,.35); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); color: #ffd60a; font-size: 13.5px; font-weight: 600; }
.editbar-in span { flex: 1; line-height: 1.3; }
.editbar-in button { background: #ffd60a; color: #000; border-radius: 12px; padding: 8px 14px; font-weight: 750; font-size: 14px; }
body.editing .slot { outline: 1.5px dashed rgba(255,214,10,.75); outline-offset: 2px; border-radius: 8px; cursor: pointer; touch-action: none; }
body.editing .slot.hid { display: inline-block; opacity: .3; }
body.editing .slot.ghost { display: inline-block; outline-color: rgba(255,214,10,.45); background: rgba(255,214,10,.06); }
body.editing .slot.ghost::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,214,10,.8); font-size: 20px; font-weight: 600; line-height: 1; }
body.editing .slot.cover.ghost::after { content: "+ фон"; font-size: 14px; }
body.editing .slot.sel-slot { outline: 2px solid #ffd60a; background: rgba(255,214,10,.08); }
body.editing [data-tslot] { outline: 1.5px dashed rgba(100,210,255,.7); outline-offset: 3px; border-radius: 6px; cursor: text; }
.slot.ghost { display: none; }
.ed-sheet .sheet { max-height: 52vh; padding-bottom: 0; border-radius: 26px 26px 0 0; background: rgba(17,17,18,.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.ed-sheet { pointer-events: none; }
.ed-sheet .sheet { pointer-events: auto; }
.ed-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.ed-head .ed-prev { width: 46px; height: 46px; border-radius: 14px; background: var(--card2); display: grid; place-items: center; flex: none; overflow: hidden; }
.ed-head .ed-prev .stk { width: 36px; height: 36px; }
.ed-head .grow { flex: 1; min-width: 0; padding-right: 36px; }
.ed-head .t { font-weight: 750; font-size: 15.5px; line-height: 1.25; }
.ed-head .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ed-media { display: flex; gap: 8px; margin-bottom: 8px; }
.ed-media .btn { min-height: 40px; font-size: 15px; border-radius: 13px; }
.slider { display: grid; grid-template-columns: 88px 1fr 46px; align-items: center; gap: 8px; padding: 1px 2px; font-size: 14px; color: #d1d1d6; font-weight: 600; }
.slider output { text-align: right; font-variant-numeric: tabular-nums; color: #fff; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: #3a3a3c; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; margin-top: -10px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: #3a3a3c; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: var(--card2); font-size: 14px; font-weight: 600; color: #c7c7cc; }
.check.on { background: #f5f5f7; color: #000; }
.ed-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; position: sticky; bottom: 0; z-index: 3; margin: 0 -16px; padding: 12px 16px calc(12px + var(--safe-bottom)); background: linear-gradient(180deg, rgba(17,17,18,0), rgba(17,17,18,.97) 28%); }
.ed-actions .btn { min-height: 48px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px -16px 12px; padding: 0 16px; }
.tabs button { flex: none; height: 36px; padding: 0 14px; border-radius: 99px; background: var(--card2); font-size: 14px; font-weight: 650; color: #aeaeb2; }
.tabs button.on { background: #f5f5f7; color: #000; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.pick-grid button { aspect-ratio: 1; border-radius: 16px; background: var(--card); display: grid; place-items: center; padding: 8px; position: relative; transition: transform .3s var(--spring); color: #fff; }
.pick-grid button:active { transform: scale(.9); }
.pick-grid button.on { box-shadow: inset 0 0 0 2px #ffd60a; }
.pick-grid .stk { width: 100%; height: 100%; }
.pick-grid .nm { position: absolute; left: 0; right: 0; bottom: 3px; font-size: 9.5px; color: var(--muted); text-align: center; line-height: 1; overflow: hidden; white-space: nowrap; }
.field { display: flex; gap: 8px; }
.field input, .tarea { flex: 1; min-width: 0; background: var(--card); border: 0; outline: 0; border-radius: 14px; padding: 12px 14px; font-size: 15.5px; }
.tarea { width: 100%; min-height: 110px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.45; }
.drop { border: 1.5px dashed #48484a; border-radius: 18px; padding: 22px; text-align: center; color: var(--muted); font-size: 14.5px; line-height: 1.4; display: block; }
.drop input { display: none; }
.tip { background: rgba(255,214,10,.08); color: #e5d38a; border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.4; margin-top: 12px; }

/* ---------- misc ---------- */
.cat-head { display: flex; align-items: center; gap: 14px; margin: 6px 4px 16px; }
.cat-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.cat-head .muted { font-size: 14px; margin-top: 3px; }
.ce .fb { font-size: 1em; }
.edit-fab.hid { display: none; }
body.admin #app { padding-top: calc(var(--safe-top) + 52px); }
body.admin.editing #app { padding-top: calc(var(--safe-top) + 70px); }
.p-title .slot { flex: none; }
.row .ri .stk { color: #fff; }
.buy .slot { margin-right: 1px; }
.buy .lbl { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.orders-hero .hero-top { margin-bottom: 18px; }

body.editing .slot.ghost:not(.cover) { width: 44px; height: 44px; }
.ed-sheet .sheet .body > * { animation: none; }
.deco-anchor:has(.slot.ontop) { z-index: 4; }
