/* ==========================================================================
   Plextor Shop — Telegram Mini App
   Tokens → base → layout → components → states
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #1a1a1c;
  --surface-2: #242427;
  --surface-3: #2f2f33;
  --sheet: #151517;
  --text: #f5f5f7;
  --text-2: #b4b4b9;
  --text-3: #8e8e93;
  --border: rgba(255, 255, 255, 0.08);
  --track: rgba(255, 255, 255, 0.14);
  --fill: #f5f5f7;
  --primary: #f5f5f7;
  --on-primary: #0b0b0c;
  --success: #32d74b;
  --danger: #ff6961;
  --star: #ffb800;
  --nav-bg: rgba(30, 30, 33, 0.82);
  --nav-border: rgba(255, 255, 255, 0.07);
  --nav-icon: #8e8e93;
  --nav-icon-active: #f5f5f7;
  --nav-active: rgba(255, 255, 255, 0.11);
  --scrim: rgba(0, 0, 0, 0.62);
  --focus: #f5f5f7;
  --skeleton-a: #1a1a1c;
  --skeleton-b: #26262a;
  --toast-bg: #2c2c30;
  --toast-text: #f5f5f7;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #ececf1;
  --surface-3: #e1e1e7;
  --sheet: #ffffff;
  --text: #0b0b0c;
  --text-2: #3f3f45;
  --text-3: #6c6c72;
  --border: rgba(0, 0, 0, 0.08);
  --track: rgba(0, 0, 0, 0.1);
  --fill: #0b0b0c;
  --primary: #0b0b0c;
  --on-primary: #ffffff;
  --success: #1a7f37;
  --danger: #c4161c;
  --star: #e09b00;
  --nav-bg: rgba(255, 255, 255, 0.86);
  --nav-border: rgba(0, 0, 0, 0.07);
  --nav-icon: #7c7c82;
  --nav-icon-active: #0b0b0c;
  --nav-active: rgba(0, 0, 0, 0.07);
  --scrim: rgba(0, 0, 0, 0.38);
  --focus: #0b0b0c;
  --skeleton-a: #ffffff;
  --skeleton-b: #ececf1;
  --toast-bg: #1c1c1f;
  --toast-text: #f5f5f7;
  color-scheme: light;
}

:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --gap: 10px;
  --gutter: 12px;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-press: 120ms;
  --dur-fast: 180ms;
  --dur-base: 260ms;
  --dur-sheet: 380ms;

  --icon-sm: 18px;
  --icon-md: 22px;

  --safe-top: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --nav-h: 72px;
  --nav-offset: calc(12px + var(--safe-bottom));
}

/* ---------- base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-base) ease;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled { cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: calc(12px + var(--safe-top)); }

.i {
  width: var(--icon-md);
  height: var(--icon-md);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i--sm { width: var(--icon-sm); height: var(--icon-sm); }
.i--star { fill: var(--star); stroke: var(--star); stroke-width: 1; }

.muted { color: var(--text-2); }

/* ---------- layout ---------- */

.app {
  max-width: 720px;
  margin: 0 auto;
  padding:
    calc(var(--gutter) + var(--safe-top))
    max(var(--gutter), env(safe-area-inset-right, 0px))
    calc(var(--nav-h) + var(--nav-offset) + 28px)
    max(var(--gutter), env(safe-area-inset-left, 0px));
}

.views:focus { outline: none; }

.view { animation: view-in var(--dur-base) var(--ease-out); }
.view[hidden] { display: none; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
}

.page-head { padding: 12px 4px 18px; }
.page-title {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.page-sub {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
}

.block + .block { margin-top: 28px; }

.section-title {
  margin: 0 4px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- hero (balance card) ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 196px;
  margin-bottom: var(--gap);
  padding: 18px 16px 18px 20px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #141826;
  color: #fff;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("img/banner.jpg") center / cover no-repeat;
  transform: scale(1.02);
}

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0) 34%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 58%);
}

/* Постер: картинка 16:9 целиком по ширине, якорь сверху — для мемов и обложек с надписью
   в верхней полосе. Интерфейс шапки опускается под эту полосу (padding в % от ширины). */
.hero--poster {
  height: auto;
  aspect-ratio: 16 / 9;
  min-height: 196px;
  max-height: 300px;
  padding-top: max(18px, 13%);
  background: #000;
}
.hero--poster .hero__bg { background-position: center top; }
.hero--poster .hero__shade {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0) 48%);
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero__title {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.hero__amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.hero__amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.hero__cur {
  font-size: 26px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
}

/* glass buttons on top of the hero image */
.glass-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: rgba(20, 20, 24, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease;
}
.glass-btn .i { width: 18px; height: 18px; }
.glass-btn::before {           /* расширяем зону касания до 44px */
  content: "";
  position: absolute;
  inset: -5px;
}
.glass-btn--round {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.28);
}
.glass-btn--round::before { inset: -6px; }
.glass-btn--round .i { stroke-width: 2.4; }
.glass-btn:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.28); }
@media (hover: hover) {
  .glass-btn:hover { background: rgba(255, 255, 255, 0.24); }
}

/* ---------- avatar ---------- */

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--avatar-h, 250) 70% 62%), hsl(calc(var(--avatar-h, 250) + 40) 70% 48%));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--hero {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  transition: transform var(--dur-press) var(--ease-out);
}
.avatar--hero::before { content: ""; position: absolute; inset: -4px; }
.avatar--hero:active { transform: scale(0.94); }
.avatar--xl { width: 88px; height: 88px; font-size: 32px; }

/* ---------- product grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 172px;
  padding: 14px 14px 12px;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  overflow: hidden;
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color var(--dur-fast) ease;
}

.card:active { transform: scale(0.965); background: var(--surface-2); }
@media (hover: hover) {
  .card:hover { background: var(--surface-2); }
}

.card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: contain;
}

.card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.3em);
  margin-top: 22px;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.price {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.price__value { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.price__cur { font-size: 15px; font-weight: 600; color: var(--text-3); }

.card__stock {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}
.card__stock .inf { font-size: 16px; line-height: 1; }

.meter {
  position: relative;
  height: 3px;
  margin-top: 8px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}
.meter__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--fill);
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 700ms var(--ease-out);
}

.card.is-out { color: var(--text-3); }
.card.is-out .card__icon { filter: grayscale(1); opacity: 0.5; }
.card.is-out .price__value { color: var(--text-3); }

/* staggered entrance — only on first paint */
.grid.is-entering .card {
  animation: card-in 420ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.grid.is-entering .meter__fill {
  animation: meter-in 900ms var(--ease-out) both;
  animation-delay: calc(200ms + var(--i, 0) * 45ms);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
}
@keyframes meter-in {
  from { transform: scaleX(0); }
}

/* ---------- stickers ---------- */

.sticker {
  position: relative;
  display: block;
  flex: none;
  width: var(--s, 52px);
  height: var(--s, 52px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sticker > img,
.sticker > video,
.sticker > svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  pointer-events: none;
}
/* мягкий плейсхолдер, пока грузится .tgs / .webm */
.sticker:not([data-ready])::before {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: var(--surface-2);
  animation: sticker-wait 1.2s ease-in-out infinite;
}
@keyframes sticker-wait {
  50% { opacity: 0.45; }
}
.sticker.is-boop { animation: boop 460ms cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes boop {
  0% { transform: scale(1); }
  35% { transform: scale(0.84); }
  100% { transform: scale(1); }
}
.sheet .sticker { cursor: pointer; }

/* иконка-стикер на карточке: 64px, но занимает место 52px иконки */
.card .sticker.card__icon {
  width: 64px;
  height: 64px;
  margin: -6px 0 -6px -6px;
  border-radius: 0;
}

/* стикер-бейдж в углу карточки, как мем на оригинальном макете */
.card__corner {
  position: absolute;
  right: -6px;
  bottom: -8px;
  z-index: 1;
  pointer-events: none;
}
.card.has-corner .card__foot,
.card.has-corner .meter { margin-right: 66px; }

.pd__icon--sticker {
  width: 88px;
  height: 88px;
  background: none;
}

.sheet-head--art {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.sheet-head--art .sheet__title { padding: 0 40px; margin-top: 4px; }
.sheet-head--art .sheet__lead { max-width: 34ch; }

.success__sticker { margin: -12px 0 4px; }
.empty__sticker { margin-bottom: 4px; }

/* ---------- skeletons ---------- */

.skel {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--skeleton-a) 0%, var(--skeleton-b) 50%, var(--skeleton-a) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel--card { height: 172px; }
.skel--row { height: 68px; border-radius: 18px; }
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* ---------- lists ---------- */

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease;
}
button.row:active { transform: scale(0.98); background: var(--surface-2); }
@media (hover: hover) {
  button.row:hover { background: var(--surface-2); }
}

.row__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-2);
}
.row__icon img { width: 36px; height: 36px; object-fit: contain; }
.row__icon--plus { color: var(--success); }

.row__main { flex: 1; min-width: 0; }
.row__title {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-3);
}
.row__end {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row__end .i { width: 18px; height: 18px; color: var(--text-3); }
.amount--plus { color: var(--success); }

/* ---------- empty & error states ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
}
.grid .empty { grid-column: 1 / -1; }
.empty__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-2);
}
.empty__icon .i { width: 28px; height: 28px; }
.empty__title { font-size: 17px; font-weight: 700; }
.empty__text { max-width: 280px; color: var(--text-2); font-size: 15px; }
.empty .btn { margin-top: 12px; }

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--r-md);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color var(--dur-fast) ease,
    opacity var(--dur-fast) ease;
}
.btn .i { width: 20px; height: 20px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--secondary { background: var(--surface-2); color: var(--text); }
.btn--ghost { background: transparent; color: var(--text-2); min-height: 48px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn--primary:active:not(:disabled) { opacity: 0.88; }
.btn--secondary:active:not(:disabled) { background: var(--surface-3); }
@media (hover: hover) {
  .btn--primary:hover:not(:disabled) { opacity: 0.9; }
  .btn--secondary:hover:not(:disabled) { background: var(--surface-3); }
  .btn--ghost:hover:not(:disabled) { color: var(--text); }
}
.btn:disabled { opacity: 0.4; }

.btn.is-loading { pointer-events: none; }
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--nav-offset);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100% - 2 * var(--gutter), 520px);
  margin: 0 auto;
  pointer-events: none;
}
.tabbar > * { pointer-events: auto; }

.tabbar__group,
.tab--solo {
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.tabbar__group {
  flex: 1;
  display: flex;
  gap: 2px;
  height: var(--nav-h);
  padding: 7px;
  border-radius: 999px;
}

.tab {
  flex: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--nav-icon);
  transition:
    color var(--dur-fast) ease,
    background-color var(--dur-base) var(--ease-out),
    transform var(--dur-press) var(--ease-out);
}
.tab.is-active { color: var(--nav-icon-active); background: var(--nav-active); }
.tab:active { transform: scale(0.94); }
@media (hover: hover) {
  .tab:not(.is-active):hover { color: var(--text-2); }
}

.tab--solo {
  flex: 0 0 var(--nav-h);
  height: var(--nav-h);
  border-radius: 50%;
}
.tab--solo.is-active { background: var(--surface-3); }
[data-theme="light"] .tab--solo.is-active { background: #e4e4ea; }

.nav-i { width: 24px; height: 24px; }

.fade-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: calc(var(--nav-h) + var(--nav-offset) + 36px);
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg) 80%, transparent) 55%, var(--bg) 100%);
  pointer-events: none;
}

/* ---------- info page ---------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.step {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
}
.step__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 15px;
}
.step__title { font-weight: 600; font-size: 16px; line-height: 1.35; }
.step__text { margin-top: 2px; color: var(--text-2); font-size: 15px; line-height: 1.45; }

.faq {
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.faq__item { background: var(--surface); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__chev {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transform: rotate(90deg);
  transition: transform var(--dur-fast) var(--ease-out);
}
.faq__item[open] .faq__chev { transform: rotate(-90deg); }
.faq__item p {
  padding: 0 16px 16px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
  max-width: 60ch;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.menu__row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  background: var(--surface);
  text-align: left;
  transition: background-color var(--dur-fast) ease;
}
.menu__row:active { background: var(--surface-2); }
@media (hover: hover) {
  .menu__row:hover { background: var(--surface-2); }
}
.menu__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
}
.menu__icon .i { width: 20px; height: 20px; }
.menu__text { flex: 1; min-width: 0; }
.menu__title { display: block; font-weight: 600; line-height: 1.35; }
.menu__sub { display: block; font-size: 13px; color: var(--text-3); }
.menu__chev { width: 18px; height: 18px; color: var(--text-3); }

/* ---------- profile ---------- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px 22px;
  text-align: center;
}
.profile .avatar { margin-bottom: 10px; }
.profile__name {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.profile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 14px;
}
.profile__meta .badge { margin-left: 2px; }

.id-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 8px;
  margin: -6px 0;
  border-radius: 8px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.id-copy .i { width: 14px; height: 14px; }
.id-copy:active { background: var(--surface-2); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 12px;
  font-weight: 700;
}

.balance-card {
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
}
.balance-card__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.balance-card__amount {
  margin-top: 2px;
  font-size: 36px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.balance-card__cur { color: var(--text-3); font-size: 26px; font-weight: 700; }
.balance-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin: var(--gap) 0 28px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
}
.stat__value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: 13px; color: var(--text-3); }

/* ---------- bottom sheet ---------- */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-root[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--dur-sheet) ease;
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(var(--tg-viewport-height, 100dvh) - 24px - var(--safe-top));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--sheet);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform var(--dur-sheet) var(--ease-sheet);
  outline: none;
  will-change: transform;
}

.sheet-root.is-open .sheet-backdrop { opacity: 1; }
.sheet-root.is-open .sheet { transform: translateY(0); }
/* закрытие быстрее открытия */
.sheet-root.is-closing .sheet { transition: transform 220ms var(--ease-in); }
.sheet-root.is-closing .sheet-backdrop { transition-duration: 220ms; }
.sheet.is-dragging { transition: none; }

.sheet__grab {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: grab;
  touch-action: none;
}
.sheet__handle {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
}

.sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-2);
}
.sheet__close::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface-2);
  z-index: -1;
  transition: background-color var(--dur-fast) ease;
}
.sheet__close .i { width: 18px; height: 18px; stroke-width: 2.4; }
.sheet__close:active::after { background: var(--surface-3); }

.sheet__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 20px calc(20px + var(--safe-bottom));
}

.sheet__title {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-right: 40px;
}
.sheet__lead {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
}

.sheet__footer {
  align-self: stretch;
  position: sticky;
  bottom: calc(-20px - var(--safe-bottom));
  margin: 20px -20px calc(-20px - var(--safe-bottom));
  padding: 16px 20px calc(20px + var(--safe-bottom));
  background: linear-gradient(180deg, color-mix(in srgb, var(--sheet) 0%, transparent) 0%, var(--sheet) 22%);
}

/* product detail */
.pd__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}
.pd__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: var(--surface);
}
.pd__icon img { width: 56px; height: 56px; object-fit: contain; }
.pd__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.chip .i { width: 14px; height: 14px; }
.chip--warn { color: var(--danger); }

.pd__desc {
  margin-top: 18px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-line;
  max-width: 60ch;
}

.perks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 18px;
  border-radius: var(--r-md);
  overflow: hidden;
}
.perk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.4;
}
.perk .i { width: 20px; height: 20px; color: var(--text-2); }

.summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.summary__label { color: var(--text-2); font-size: 15px; }
.summary__value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.summary__value .i { width: 20px; height: 20px; }
.summary__note {
  margin: -6px 0 12px;
  font-size: 14px;
  color: var(--text-3);
}
.summary__note b { color: var(--text); font-weight: 600; }

/* success / delivered content */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  text-align: center;
}
.success__badge {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  animation: pop 520ms var(--ease-out) both;
}
.success__badge .i { width: 34px; height: 34px; stroke-width: 3; }
.success__badge path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw 420ms 200ms var(--ease-out) forwards;
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.success .sheet__title { padding: 0; }

.secret {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px dashed var(--track);
  text-align: left;
}
.secret__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.secret__value {
  display: block;
  margin-top: 6px;
  font: 600 16px/1.45 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color: var(--text);
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
.secret__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.secret__actions .btn { flex: 1; min-height: 44px; font-size: 15px; border-radius: var(--r-sm); }

/* ---------- forms ---------- */

.field { display: block; margin-top: 20px; }
.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.field__control {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 2px solid transparent;
  transition: border-color var(--dur-fast) ease;
}
.field__control:focus-within { border-color: var(--focus); }
.field__control input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: 700 24px/1 var(--font);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.field__control input::placeholder { color: var(--text-3); font-weight: 500; }
.field__control--text input { font-size: 18px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.field__control--text input::placeholder { text-transform: none; letter-spacing: 0; }
.field__suffix { font-size: 20px; font-weight: 700; color: var(--text-3); }
.field__hint { display: block; margin-top: 8px; font-size: 13px; color: var(--text-3); }
.field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--danger);
}
.field__error[hidden] { display: none; }
.field__error .i { width: 16px; height: 16px; }
.field.has-error .field__control { border-color: var(--danger); }

.presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.preset {
  min-height: 44px;
  border-radius: var(--r-sm);
  background: var(--surface);
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-press) var(--ease-out);
}
.preset:active { transform: scale(0.95); }
.preset[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

.notice {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.45;
}
.notice .i { width: 18px; height: 18px; margin-top: 1px; }

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--nav-offset) + 14px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
body.no-scroll .toasts { bottom: calc(24px + var(--safe-bottom)); }

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity var(--dur-fast) ease, transform var(--dur-base) var(--ease-out);
}
.toast.is-in { opacity: 1; transform: none; }
.toast .i { width: 20px; height: 20px; }
.toast--success .i { color: #32d74b; }
.toast--error .i { color: #ff6961; }

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .success__badge path { stroke-dashoffset: 0; }
}

@media (max-width: 360px) {
  :root { --gutter: 10px; --gap: 8px; }
  .card { padding: 12px 12px 10px; }
  .card__title { font-size: 14px; }
  .hero__amount { font-size: 34px; }
}
