/* Trust — мини-приложение магазина. Акцентный цвет меняется в одном месте: --accent* и --grad. */
:root {
  --bg: #07070a;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --stroke: rgba(255, 255, 255, .075);
  --stroke-2: rgba(255, 255, 255, .14);
  --text: #f5f5f7;
  --text-2: rgba(235, 235, 245, .66);
  --text-3: rgba(235, 235, 245, .4);

  --accent: #3b7bff;
  --accent-bright: #5c9dff;
  --accent-soft: rgba(59, 123, 255, .16);
  --accent-shadow: rgba(52, 104, 255, .38);
  --grad: linear-gradient(135deg, #62b2ff 0%, #3b7bff 48%, #4c3cff 100%);

  --green: #32d583;
  --green-soft: rgba(50, 213, 131, .14);
  --green-grad: linear-gradient(135deg, #5be9a4 0%, #18b46b 100%);
  --red: #ff5a67;
  --red-soft: rgba(255, 90, 103, .14);
  --yellow: #ffc145;
  --yellow-soft: rgba(255, 193, 69, .14);

  --radius: 22px;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
input, textarea { font: inherit; color: inherit; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-cancel-button { display: none; }
img { display: block; }
svg { display: block; flex: 0 0 auto; }
[hidden] { display: none !important; }

#bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 55% at 100% -8%, rgba(59, 123, 255, .3), transparent 62%),
    radial-gradient(90% 45% at -15% 0%, rgba(76, 60, 255, .2), transparent 60%);
}
#app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: 10px 16px calc(108px + var(--safe-bottom));
}
body.no-tabbar #app { padding-bottom: calc(32px + var(--safe-bottom)); }
body.no-tabbar.has-mb #app { padding-bottom: calc(96px + var(--safe-bottom)); }
body.tg.no-tabbar.has-mb #app { padding-bottom: calc(24px + var(--safe-bottom)); }

.view { animation: view-in .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.pressable { transition: transform .16s ease, background-color .2s ease, opacity .2s ease; }
.pressable:active { transform: scale(.975); }

.muted { color: var(--text-3); }
.small { font-size: 13px; }
.red { color: var(--red); }
.green { color: var(--green); }

/* ---------- Шапка ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 0; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 800; letter-spacing: -.035em; }
.brand svg { width: 38px; height: 38px; filter: drop-shadow(0 6px 16px var(--accent-shadow)); }
.balance-pill {
  display: flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 16px 0 7px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(76, 140, 255, .3), rgba(59, 123, 255, .14));
  border: 1px solid rgba(120, 165, 255, .38);
  box-shadow: 0 8px 28px rgba(40, 100, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .14);
  font-size: 18px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap;
}
.balance-pill .plus {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: 0 3px 12px rgba(59, 123, 255, .6), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.balance-pill .plus svg { width: 17px; height: 17px; }

.page-title { margin: 20px 0 14px; font-size: 31px; line-height: 1.07; font-weight: 800; letter-spacing: -.035em; }
.page-title span { color: var(--text-3); font-weight: 750; }
.page-title.small { margin: 8px 0 16px; font-size: 28px; }

.section-label {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 4px 10px; font-size: 13px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3);
}

/* ---------- Баннеры ---------- */
.carousel { position: relative; margin: 0 -16px; }
.slides {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 16px; scroll-padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.slides::-webkit-scrollbar { display: none; }
.slide {
  position: relative; isolation: isolate; overflow: hidden;
  flex: 0 0 100%; min-height: 152px; scroll-snap-align: center;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px; border-radius: 26px; color: #fff; text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.slide::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 90% at 85% 15%, rgba(255, 255, 255, .28), transparent 60%);
}
.slide.b1 { background-image: linear-gradient(120deg, #1d47ff 0%, #3b7bff 55%, #62b2ff 100%); }
.slide.b2 { background-image: linear-gradient(120deg, #3f22e8 0%, #7a4dff 55%, #b483ff 100%); }
.slide.b3 { background-image: linear-gradient(120deg, #07806f 0%, #14b394 55%, #4fe0b2 100%); }
.slide.b4 { background-image: linear-gradient(120deg, #b8e81a 0%, #cdfb24 55%, #e2ff7a 100%); color: #111; }
.slide.b5 { background-image: linear-gradient(120deg, #ff8c27 0%, #fca226 55%, #fcb825 100%); color: #111; }
.slide.b4 .st, .slide.b5 .st { text-shadow: none; }
.slide.b4 .slide-btn, .slide.b5 .slide-btn { background: rgba(17, 17, 17, .88); border-color: transparent; color: #fff; }
.slide.b4 .spark path { fill: #111; }
.slide .art.logo { width: 112px; height: 112px; right: 14px; bottom: 16px; transform: rotate(-8deg); }
.slide .art.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 26px; }
.slides { cursor: grab; }
.slides.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.slides.dragging .slide { pointer-events: none; }
.slide .st { display: block; position: relative; z-index: 1; max-width: 64%; margin: 0; font-size: 18.5px; line-height: 1.2; font-weight: 800; letter-spacing: -.015em; text-shadow: 0 1px 14px rgba(0, 0, 0, .15); }
.slide .slide-btn {
  position: relative; z-index: 1; align-self: flex-start; margin-top: 16px;
  height: 36px; padding: 0 15px; border-radius: 999px; display: inline-flex; align-items: center;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .24);
  font-size: 14px; font-weight: 650; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.slide .art { position: absolute; right: -4px; bottom: -6px; width: 136px; height: 136px; transform: rotate(-9deg); filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .3)); }
.slide .art svg { width: 100%; height: 100%; }
.spark { position: absolute; width: 14px; height: 14px; opacity: .9; animation: twinkle 2.6s ease-in-out infinite; }
.spark.s2 { animation-delay: -1.2s; width: 9px; height: 9px; }
.spark.s3 { animation-delay: -.6s; width: 11px; height: 11px; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
.dots {
  position: absolute; right: 30px; bottom: 14px; display: flex; gap: 5px;
  padding: 6px 8px; border-radius: 999px; background: rgba(0, 0, 0, .28);
}
.dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .42); transition: width .25s ease, background .25s ease; }
.dots i.on { width: 16px; background: #fff; }

/* ---------- Быстрые разделы ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.quick-card {
  position: relative; overflow: hidden; text-align: center;
  padding: 12px 6px 13px; border-radius: 22px;
  background: radial-gradient(120% 85% at 50% 0%, rgba(59, 123, 255, .26), transparent 70%), var(--surface);
  border: 1px solid var(--stroke);
}
.quick-card .ic { display: block; width: 66px; height: 66px; margin: 0 auto 7px; filter: drop-shadow(0 10px 16px rgba(30, 80, 255, .45)); }
.quick-card .ic svg { width: 100%; height: 100%; }
.quick-card b { display: block; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-card small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Поиск и сортировка ---------- */
.search { position: relative; display: block; margin-top: 14px; }
.search input {
  width: 100%; height: 54px; padding: 0 16px 0 48px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--stroke); outline: none;
  font-size: 16px; font-weight: 500; transition: border-color .2s, background .2s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: rgba(120, 165, 255, .5); background: var(--surface-2); }
.search svg { position: absolute; left: 17px; top: 50%; width: 21px; height: 21px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

.segmented { display: flex; gap: 4px; margin-top: 12px; padding: 5px; border-radius: 20px; background: var(--surface); border: 1px solid var(--stroke); }
.segmented button {
  flex: 1 1 auto; min-width: 0; height: 42px; padding: 0 10px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-3); font-size: 14.5px; font-weight: 650; white-space: nowrap;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.segmented button svg { width: 17px; height: 17px; }
.segmented button.active { color: #fff; background: var(--grad); box-shadow: 0 6px 18px var(--accent-shadow), inset 0 1px 0 rgba(255, 255, 255, .28); }
.segmented .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 12px; background: rgba(255, 255, 255, .14); }

/* ---------- Списки и карточки ---------- */
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pcard, .ocard, .ucard {
  position: relative; width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 22px; text-align: left;
  background: var(--surface); border: 1px solid var(--stroke);
}
.pcard { background: radial-gradient(90% 170% at 100% 50%, rgba(59, 123, 255, .2), transparent 55%), var(--surface); }
.meta { display: block; flex: 1; min-width: 0; }
.meta .name { font-size: 15.5px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.meta .sub { display: block; margin-top: 3px; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.right b { font-size: 15.5px; font-weight: 750; white-space: nowrap; }

.price-pill {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end;
  padding: 8px 13px; border-radius: 15px; color: #fff; white-space: nowrap;
  background: var(--grad); box-shadow: 0 6px 18px var(--accent-shadow), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.price-pill b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.price-pill s { font-size: 11.5px; font-weight: 600; opacity: .7; line-height: 1.15; }

.tile {
  position: relative; flex: 0 0 auto; overflow: hidden; display: grid; place-items: center;
  border-radius: var(--r, 16px); color: #fff; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 6px 16px rgba(0, 0, 0, .35);
}
.tile::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .24), transparent 48%); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile span { position: relative; z-index: 1; text-shadow: 0 2px 10px rgba(0, 0, 0, .2); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip.blue { background: var(--accent-soft); color: var(--accent-bright); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.yellow { background: var(--yellow-soft); color: var(--yellow); }
.chip.gray { background: rgba(255, 255, 255, .08); color: var(--text-2); }
.chip.big { height: 30px; padding: 0 12px; font-size: 13px; }

.card { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--stroke); }
.card + .card { margin-top: 10px; }
.rows { padding-top: 4px; padding-bottom: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 10px 0; }
.row + .row { border-top: 1px solid var(--stroke); }
.row .k { color: var(--text-2); flex: 0 0 auto; }
.row .v { font-weight: 650; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; word-break: break-word; }
.row .v.link { color: var(--accent-bright); }

.desc { white-space: pre-wrap; word-break: break-word; line-height: 1.5; color: var(--text-2); font-size: 15px; }
.note { margin: 14px 4px 0; font-size: 13px; line-height: 1.45; color: var(--text-3); }
.note.center { text-align: center; }

.menu { overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--stroke); }
.menu + .menu { margin-top: 10px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 13px; min-height: 60px; padding: 12px 16px; font-size: 16px; font-weight: 600; text-align: left; }
.menu-item + .menu-item { border-top: 1px solid var(--stroke); }
.menu-item:active { background: var(--surface-2); }
.menu-item .grow { flex: 1; min-width: 0; }
.menu-item .grow .muted { display: block; margin-top: 1px; font-size: 13px; font-weight: 500; }
.menu-item > svg { width: 18px; height: 18px; color: var(--text-3); }
.mi { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.mi svg { width: 19px; height: 19px; }
.mi.violet { background: linear-gradient(135deg, #b48bff, #6a3dff); }
.mi.teal { background: linear-gradient(135deg, #4fe0b2, #0e9c84); }
.mi.orange { background: linear-gradient(135deg, #ffc65a, #ff7a1f); }
.mi.pink { background: linear-gradient(135deg, #ff8ac8, #e0367f); }
.badge-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 13px; font-weight: 750; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: 17px;
  color: #fff; font-size: 16px; font-weight: 700; white-space: nowrap;
  background: var(--grad); box-shadow: 0 8px 24px var(--accent-shadow), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .16s ease, opacity .2s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 19px; height: 19px; }
.btn.block { width: 100%; }
.btn.small { height: 40px; padding: 0 15px; border-radius: 13px; font-size: 14.5px; }
.btn.secondary { background: var(--surface-2); border: 1px solid var(--stroke); box-shadow: none; color: var(--text); }
.btn.danger { background: var(--red-soft); box-shadow: none; color: var(--red); }
.btn.success { background: var(--green-grad); box-shadow: 0 8px 24px rgba(30, 190, 110, .35), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.white { background: #fff; color: #2350ff; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn.glass { background: rgba(255, 255, 255, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn + .btn, .card + .btn, .btn-stack { margin-top: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; min-width: 0; margin-top: 0; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--accent-bright); }
.link-btn.danger { color: var(--red); }

/* Запасная главная кнопка (вне Telegram) */
#mb {
  position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(14px + var(--safe-bottom));
  max-width: 528px; margin: 0 auto; height: 56px; border-radius: 18px;
  color: #fff; font-size: 16.5px; font-weight: 700; text-align: center;
  background: var(--grad); box-shadow: 0 10px 30px var(--accent-shadow), inset 0 1px 0 rgba(255, 255, 255, .28);
}
#mb:disabled { opacity: .5; }
#mb.loading { color: transparent; }
#mb.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Таб-бар: «жидкое стекло» ---------- */
#tabbar {
  position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom));
  max-width: 536px; margin: 0 auto; display: flex; padding: 6px;
  border-radius: 31px; border: 1px solid rgba(255, 255, 255, .11);
  background: rgba(22, 22, 28, .9);
  box-shadow: 0 16px 46px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -1px 0 rgba(255, 255, 255, .03);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: transform .55s cubic-bezier(.2, .9, .25, 1.08), opacity .3s ease;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  #tabbar { background: rgba(30, 30, 38, .52); -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%); }
}
#tabbar.tb-hidden, body.kb #tabbar { transform: translateY(calc(100% + 40px)) scale(.94); opacity: 0; pointer-events: none; }
#tabbar button {
  position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 7px; color: var(--text-3); font-size: 11.5px; font-weight: 650; text-align: center;
  transition: color .3s ease;
}
#tabbar button:focus { outline: none; }
#tabbar button:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: -2px; border-radius: 22px; }
#tabbar button svg { width: 26px; height: 26px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
#tabbar button.active { color: var(--accent-bright); }
#tabbar button.active svg { animation: tab-pop .55s cubic-bezier(.3, 1.5, .5, 1); filter: drop-shadow(0 3px 10px rgba(59, 123, 255, .55)); }
#tabbar button.peek { color: var(--text); }
#tabbar button.peek svg { transform: scale(1.1); }
@keyframes tab-pop { 0% { transform: scale(.8); } 55% { transform: scale(1.16); } 100% { transform: scale(1); } }

/* стеклянная линза под активной вкладкой: обёртка ездит, .lens — само стекло */
.tab-glass { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; width: 0; pointer-events: none; will-change: transform; }
.tab-glass .lens {
  position: absolute; inset: 0; border-radius: 25px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05) 52%, rgba(255, 255, 255, .1));
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .42), inset 0 -1px 1px rgba(255, 255, 255, .1),
    inset 0 0 14px rgba(120, 170, 255, .14), 0 8px 22px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(3px) saturate(180%) brightness(1.15); backdrop-filter: blur(3px) saturate(180%) brightness(1.15);
  transition: transform .5s cubic-bezier(.3, 1.55, .45, 1), background .3s ease, box-shadow .3s ease;
}
.tab-glass .lens::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(255, 255, 255, .2), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .1), transparent 45%);
}
.tab-glass .lens::after {
  content: ""; position: absolute; inset: 22% 14% -6%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(59, 123, 255, .5), transparent); filter: blur(9px);
}
.tab-glass.moving .lens, .tab-glass.pressed .lens {
  background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .07) 52%, rgba(255, 255, 255, .14));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .6), inset 0 -1px 2px rgba(255, 255, 255, .16),
    inset 0 0 20px rgba(140, 185, 255, .24), 0 14px 32px rgba(0, 0, 0, .45);
}
.tab-glass.pressed .lens { transform: scale(1.1, 1.18); }

/* ---------- Тосты и загрузка ---------- */
#toast {
  position: fixed; z-index: 60; left: 50%; top: calc(12px + var(--tg-content-safe-area-inset-top, 0px));
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px;
  background: rgba(38, 38, 46, .94); border: 1px solid var(--stroke-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  font-size: 14.5px; font-weight: 650; text-align: center;
  opacity: 0; transform: translate(-50%, -16px); transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.skel {
  border-radius: 22px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .085) 37%, rgba(255, 255, 255, .04) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel.card-h { height: 82px; }
.skel.line { height: 16px; border-radius: 8px; }

.empty { text-align: center; padding: 44px 16px 24px; color: var(--text-2); }
.empty .ic { display: block; width: 96px; height: 96px; margin: 0 auto 16px; filter: drop-shadow(0 14px 22px rgba(30, 80, 255, .35)); }
.empty .ic svg { width: 100%; height: 100%; }
.empty b { display: block; margin-bottom: 6px; color: var(--text); font-size: 19px; font-weight: 750; }
.empty span { display: block; max-width: 300px; margin: 0 auto; line-height: 1.45; }
.empty .btn { margin-top: 18px; }
.empty.compact { padding: 28px 16px 12px; }

/* ---------- Товар ---------- */
.hero {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 28px;
  display: grid; place-items: center; border: 1px solid var(--stroke);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .hero-art { position: relative; z-index: 1; width: 46%; max-width: 190px; aspect-ratio: 1; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); animation: float 5s ease-in-out infinite; }
.hero .hero-art svg { width: 100%; height: 100%; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(-3deg); } }
.hero .letter { position: relative; z-index: 1; font-size: 96px; font-weight: 900; color: #fff; letter-spacing: -.04em; text-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 40%); }
.hero .spark { z-index: 1; }
.p-title { margin: 18px 2px 8px; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; word-break: break-word; }
.p-price { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 2px; }
.p-price .now { font-size: 30px; font-weight: 850; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.p-price s { font-size: 17px; font-weight: 600; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- Результат (успех / ожидание) ---------- */
.result { text-align: center; padding: 34px 8px 22px; }
.result .badge {
  width: 108px; height: 108px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 32% 26%, #7ff3b7, #18b46b 70%);
  box-shadow: 0 0 0 10px rgba(50, 213, 131, .1), 0 0 0 22px rgba(50, 213, 131, .05), 0 22px 50px rgba(30, 190, 110, .45);
  animation: pop .55s cubic-bezier(.2, 1.5, .4, 1);
}
.result .badge svg { width: 54px; height: 54px; }
.result .badge.ok path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .3s ease forwards; }
.result .badge.wait { background: radial-gradient(circle at 32% 26%, #9ccaff, #3b7bff 70%); box-shadow: 0 0 0 10px rgba(59, 123, 255, .1), 0 0 0 22px rgba(59, 123, 255, .05), 0 22px 50px var(--accent-shadow); }
.result .badge.fail { background: radial-gradient(circle at 32% 26%, #ff9aa3, #e8344a 70%); box-shadow: 0 0 0 10px rgba(255, 90, 103, .1), 0 22px 50px rgba(232, 52, 74, .4); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.result h2 { margin: 0; font-size: 27px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.result p { max-width: 330px; margin: 10px auto 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.status-line { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; padding: 9px 15px; border-radius: 999px; background: var(--yellow-soft); color: var(--yellow); font-size: 14px; font-weight: 650; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 193, 69, .55); } 70% { box-shadow: 0 0 0 10px rgba(255, 193, 69, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 193, 69, 0); } }

/* ---------- Профиль ---------- */
.profile-head { text-align: center; padding: 14px 0 4px; }
.avatar {
  width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  font-size: 34px; font-weight: 800; color: #fff; background: var(--grad);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(92, 157, 255, .5), 0 16px 40px var(--accent-shadow);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; animation: fade-in .35s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.avatar img.ready { animation: none; }
.avatar.sm { width: 76px; height: 76px; font-size: 30px; }
.profile-head h2 { margin: 14px 0 2px; font-size: 23px; font-weight: 800; letter-spacing: -.02em; word-break: break-word; }
.profile-head .muted { font-size: 15px; }
.profile-head .chip { margin-top: 10px; }
.inline-btn { color: var(--accent-bright); font-weight: 600; }

.wallet {
  position: relative; overflow: hidden; isolation: isolate; margin-top: 20px; padding: 20px 20px 18px; border-radius: 28px;
  background: var(--grad); box-shadow: 0 20px 44px rgba(50, 90, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .32);
}
.wallet::before { content: ""; position: absolute; z-index: -1; right: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .32), transparent 65%); }
.wallet::after { content: ""; position: absolute; z-index: -1; left: -40px; bottom: -110px; width: 240px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(20, 10, 120, .35), transparent 70%); }
.wallet .label { font-size: 14px; font-weight: 650; opacity: .82; }
.wallet .amount { margin-top: 2px; font-size: 40px; font-weight: 850; letter-spacing: -.035em; line-height: 1.1; }
.wallet .actions { display: flex; gap: 8px; margin-top: 18px; }
.wallet .art { position: absolute; z-index: -1; right: 6px; top: 10px; width: 108px; height: 108px; opacity: .95; transform: rotate(10deg); filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .25)); }
.wallet .art svg { width: 100%; height: 100%; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { min-width: 0; padding: 14px 13px; border-radius: 20px; background: var(--surface); border: 1px solid var(--stroke); }
.stat b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.stat em { display: block; margin-top: 6px; font-size: 12px; font-style: normal; font-weight: 650; color: var(--green); }
.foot { margin: 22px 0 0; text-align: center; font-size: 12.5px; color: var(--text-3); }

.ref-hero { text-align: center; padding: 6px 4px 4px; }
.ref-hero .ic { display: block; width: 124px; height: 124px; margin: 0 auto 6px; filter: drop-shadow(0 16px 26px rgba(30, 80, 255, .45)); }
.ref-hero .ic svg { width: 100%; height: 100%; }
.ref-hero h1 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -.025em; }
.ref-hero p { max-width: 340px; margin: 8px auto 0; color: var(--text-2); line-height: 1.5; }
.progress { height: 8px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.progress i { display: block; height: 100%; min-width: 8px; border-radius: 99px; background: var(--grad); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link-box { margin-bottom: 12px; padding: 13px 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--stroke); font: 500 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); word-break: break-all; }

/* ---------- Пополнение ---------- */
.amount-box { padding: 26px 16px 20px; text-align: center; }
.amount-input { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.amount-input input {
  width: 1ch; min-width: 1ch; max-width: 80%; padding: 0; border: 0; outline: 0; background: transparent;
  font-size: 54px; font-weight: 850; letter-spacing: -.03em; text-align: right; caret-color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}
.amount-input input::placeholder { color: var(--text-3); }
.amount-input .cur { font-size: 42px; font-weight: 800; color: var(--text-3); }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.presets button { height: 48px; border-radius: 15px; background: var(--surface); border: 1px solid var(--stroke); font-size: 15.5px; font-weight: 700; text-align: center; transition: background .2s, border-color .2s; }
.presets button.active { background: var(--accent-soft); border-color: rgba(120, 165, 255, .6); }
.info-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--stroke); color: var(--text-2); font-size: 14px; line-height: 1.4; }
.info-row svg { width: 22px; height: 22px; color: var(--green); }

/* ---------- Админка ---------- */
.rev-card {
  position: relative; overflow: hidden; isolation: isolate; padding: 20px; border-radius: 26px;
  background: var(--grad); box-shadow: 0 18px 40px rgba(50, 90, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.rev-card::before { content: ""; position: absolute; z-index: -1; right: -50px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .3), transparent 65%); }
.rev-card .label { font-size: 14px; font-weight: 650; opacity: .82; }
.rev-card .amount { margin-top: 2px; font-size: 36px; font-weight: 850; letter-spacing: -.035em; }
.rev-card .sub { margin-top: 6px; font-size: 13.5px; font-weight: 600; opacity: .85; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.funnel .step + .step { margin-top: 14px; }
.funnel .split { font-size: 14.5px; }
.funnel .split b { font-weight: 700; }
.funnel .pct { color: var(--text-3); font-size: 13px; font-weight: 600; }
.funnel .total { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--stroke); }

.form .field { display: block; padding: 11px 14px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--stroke); transition: border-color .2s; }
.form .field + .field, .form .field-row, .form .field-row + .field { margin-top: 10px; }
.form .field:focus-within { border-color: rgba(120, 165, 255, .55); }
.form .field.error { border-color: rgba(255, 90, 103, .7); background: var(--red-soft); }
.form .field > span { display: block; margin-bottom: 3px; font-size: 12.5px; font-weight: 650; color: var(--text-3); }
.form .field input, .form .field textarea { width: 100%; padding: 0; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 500; resize: none; line-height: 1.45; }
.form .field input::placeholder, .form .field textarea::placeholder { color: rgba(235, 235, 245, .25); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row .field + .field { margin-top: 0; }
.switch-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
.switch-row b { font-size: 15.5px; font-weight: 650; }
.switch { position: relative; flex: 0 0 auto; width: 51px; height: 31px; }
.switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: rgba(120, 120, 128, .36); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .22s cubic-bezier(.3, 1.3, .5, 1); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }

.image-picker { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 22px; border: 1.5px dashed var(--stroke-2); background: var(--surface); cursor: pointer; }
.image-picker.has-image { border-style: solid; border-color: var(--stroke); }
.image-picker img { width: 100%; height: 100%; object-fit: cover; }
.image-picker .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); font-size: 14px; font-weight: 600; }
.image-picker .ph svg { width: 34px; height: 34px; color: var(--accent-bright); }
.image-picker .edit { position: absolute; right: 10px; bottom: 10px; height: 34px; padding: 0 12px; border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .55); font-size: 13px; font-weight: 650; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.image-picker .edit svg { width: 15px; height: 15px; }
.image-actions { display: flex; justify-content: flex-end; margin: 8px 4px 0; }

.uava { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 19px; font-weight: 800; color: #fff; }

.outside { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.outside .brand { font-size: 40px; }
.outside .brand svg { width: 52px; height: 52px; }
.outside p { margin: 0 0 8px; color: var(--text-2); }

@media (max-width: 360px) {
  .page-title { font-size: 29px; }
  .brand { font-size: 27px; }
  .balance-pill { font-size: 16.5px; height: 42px; }
  .quick-card .ic { width: 56px; height: 56px; }
  .slide h3 { font-size: 17.5px; }
  .wallet .amount { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
