/* =============================================================
 *  style.css — стили клон-интерфейса PS Wallet
 *
 *  Токены ниже вытащены из ОРИГИНАЛЬНОГО бандла pswallet.org
 *  (main.css + Chakra-тема BRAND). Менять их — значит менять
 *  внешний вид всего приложения.
 * ============================================================= */

/* ---------- 1. ТОКЕНЫ ДИЗАЙНА (как в оригинале) ---------- */
:root {
  /* Фон и текст */
  --bg:            #0f0f0f;   /* bg_color        */
  --section-bg:    #191919;   /* section_bg_color */
  --secondary-bg:  #1c1c1c;   /* secondary_bg_color */
  --text:          #ffffff;   /* text            */
  --text-2:        rgba(255, 255, 255, .7);   /* text_secondary  */
  --text-3:        rgba(255, 255, 255, .5);   /* text_tertiary   */
  --text-4:        rgba(255, 255, 255, .25);  /* text_fourth     */
  --hint:          rgba(255, 255, 255, .5);

  /* Полупрозрачные накладки (white_3 … white_40) */
  --w3:  rgba(255, 255, 255, .03);
  --w5:  rgba(255, 255, 255, .05);
  --w7:  rgba(255, 255, 255, .07);
  --w15: rgba(255, 255, 255, .15);
  --w30: rgba(255, 255, 255, .3);
  --w40: rgba(255, 255, 255, .4);

  /* Остров (island) и разделители */
  --island:    rgba(25, 25, 25, .2);
  --separator: rgba(255, 255, 255, .05);

  /* Акценты */
  --accent:   #4dccff;                    /* link / button / accent_text_color */
  --green:    #9dd752;
  --green-dk: #6fbb0d;
  --red:      #d75254;

  /* Радиусы и шрифты */
  --r-sm: 12px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-xl: 24px;
  --font: 'Geologica', 'Onest', -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Telegram-безопасные отступы */
  --inset-top:    calc(env(safe-area-inset-top, 0px) + 0px);
  --bottom-gap:   16px;
  --tabbar-h:     88px;
}

/* ---------- 2. БАЗА ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
}

button { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font-family: inherit; color: inherit; }
h1, h2, p { margin: 0; }

/* Скрываем стандартный скроллбар (как в оригинале) */
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
* { scrollbar-width: none; }

.ic {
  width: 24px; height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.is-hidden { display: none !important; }

/* ---------- 3. КАРКАС ---------- */
.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding: var(--inset-top) 16px calc(var(--tabbar-h) + 8px);
}

/* Шапка — рисуется только когда приложение открыто НЕ в Telegram
   (в Telegram шапку рисует сам клиент) */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  margin: 0 -16px 8px;
  padding: 0 16px;
  background: var(--bg);
  position: sticky;
  top: var(--inset-top);
  z-index: 20;
}
.topbar.is-hidden { display: none; }
.topbar__logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 100% 0%, #8be2ff 0%, #1baae8 55%, #015274 100%);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, .35);
}
/* Оригинал: Image$1({src: psLogo, w:"24px", h:"21px", filter:"brightness(2)"}).
   Image$1 — это Chakra Image: const {fit = "cover"} = props => object-fit: cover.
   Поэтому картинка ОБРЕЗАЕТСЯ, а не растягивается (исходник 135×108).
   psLogo = /assets/ps-logo-DMAdxrpj.png — НЕ путать с logo-sK9nIhEJ.png
   (тот используется на загрузочном экране 96×96). */
.topbar__logo img {
  width: 24px;
  height: 21px;
  object-fit: cover;
  filter: brightness(2);
}
.topbar__title { font-size: 19px; font-weight: 600; letter-spacing: -.2px; }
.topbar__menu {
  margin-left: auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--text-2);
}
.topbar__menu .ic { width: 20px; height: 20px; }

/* ---------- 4. ЭКРАНЫ ---------- */
.screen { display: none; animation: fade .18s ease; }
.screen.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Шапка под-экрана с кнопкой «назад» */
.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 56px;
  margin: 0 -16px 4px;
  padding: 0 8px;
}
.subhead__title { font-size: 17px; font-weight: 600; text-align: center; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text);
  transition: background-color .15s;
}
.icon-btn:active { background: var(--w7); }
.icon-btn.is-ghost { pointer-events: none; opacity: 0; }

/* ---------- 5. БАЛАНС ---------- */
/* Оригинал: Box position:relative, h:177px, borderRadius:24px,
   overflow:hidden, flexShrink:0. Детали позиционируются absolute. */
.balance {
  position: relative;
  height: 177px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 24px;
  /* Фон — MAIN_BALANCE_BG из бандла: 5 SVG-радиалов + ACCENT_LINEAR.
     stretchedBg() задаёт backgroundSize:100% 100% и repeat:no-repeat. */
  background-image:
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 400 177' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(-20.85 -4.0925 9.0415 -11.789 359 182.63)'><stop stop-color='rgba(0,136,182,1)' offset='0'/><stop stop-color='rgba(0,179,255,0)' offset='1'/></radialGradient></defs></svg>"),
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 400 177' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(-24.15 14.068 -6.7321 -12.097 400 -0.000014421)'><stop stop-color='rgba(139,226,255,1)' offset='0'/><stop stop-color='rgba(85,212,255,0)' offset='1'/></radialGradient></defs></svg>"),
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 400 177' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(27.1 -12.351 10.967 24.064 110 -9.5)'><stop stop-color='rgba(1,82,116,1)' offset='0'/><stop stop-color='rgba(0,130,185,0.5)' offset='0.5'/><stop stop-color='rgba(0,178,255,0)' offset='1'/></radialGradient></defs></svg>"),
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 400 177' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(-9.25 10.743 -6.8817 -6.2026 243 -10.743)'><stop stop-color='rgba(27,170,232,1)' offset='0'/><stop stop-color='rgba(17,151,208,0)' offset='1'/></radialGradient></defs></svg>"),
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 400 177' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(19.3 -3.5298 -11.55 8.85 7 177)'><stop stop-color='rgba(139,226,255,1)' offset='0'/><stop stop-color='rgba(85,212,255,0)' offset='1'/></radialGradient></defs></svg>"),
  linear-gradient(90deg, rgb(77, 204, 255) 0%, rgb(139, 225, 255) 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  /* boxShadow из бандла: внешняя тень + внутреннее свечение 20px/40% */
  box-shadow: 0 0 16px 0 rgba(21, 24, 29, .4), inset 0 0 20px 0 rgba(255, 255, 255, .4);
}

/* Подсветку делает сам градиент — своих псевдослоев больше нет.
   Text: absolute left:23 top:15, fontSize:16, color:text_tertiary */
.balance__label {
  position: absolute;
  left: 23px; top: 15px;
  font-size: 16px;
  line-height: normal;
  color: var(--text-3);
}

/* FitText: absolute left:23 top:35 right:23,
   fontSize:40 fontWeight:500 letterSpacing:-0.02em, cursor:pointer */
.balance__value {
  position: absolute;
  left: 23px; top: 35px; right: 23px;
  display: flex;
  align-items: baseline;
  gap: .22em;                      /* в оригинале это явный пробел перед кодом */
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: normal;
  color: var(--text);
  cursor: pointer;
}
.balance__unit { color: var(--text-3); }

/* CurrencyPicker (вариант inline:false):
   absolute left:23 top:130, h:30, p:2, bg rgba(5,28,37,.08),
   border 1px solid rgba(5,28,37,.03), backdrop-filter blur(2px) */
.cur-pick {
  position: absolute;
  left: 23px; top: 130px;
  height: 30px;
  padding: 2px;
  display: flex;
  border-radius: 999px;
  background: rgba(5, 28, 37, .08);
  border: 1px solid rgba(5, 28, 37, .03);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
/* Внутреннее свечение: inset 0 0 20px 0 rgba(255,255,255,.4) */
.cur-pick__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 20px 0 rgba(255, 255, 255, .4);
  z-index: 1;
}
/* Каждая опция: Center as="button", w:60px, h:full, borderRadius:full */
.cur-pick__opt {
  position: relative;
  z-index: 2;
  width: 60px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  line-height: normal;
  color: var(--text-3);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.cur-pick__opt.is-active {
  background: rgba(5, 28, 37, .25);
  color: var(--text);
  cursor: default;
}

/* ---------- 6. КНОПКИ-ДЕЙСТВИЯ (RoundAction оригинала) ---------- */
.actions {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 20px;
}
.round {
  flex: 1;
  /* RoundAction: VStack gap:"4px", w:"100px", px:"12px" */
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0 12px;
}
.round__circle {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--w3);
  border: 1px solid var(--w3);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .05);
  transition: background-color .15s, border-color .15s, transform .12s;
}
.round:active .round__circle { background: var(--w7); border-color: var(--w7); transform: scale(.95); }
/* RoundAction: size 60, iconSize 28 */
.round__circle .ic { width: 28px; height: 28px; stroke-width: 1.8; }
.round__label { font-size: 12px; color: var(--text); white-space: nowrap; }

/* ---------- 7. ПРОМО-КАРТОЧКА РЕФЕРАЛКИ ---------- */
.promo {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--r-lg);
  text-align: left;
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(77, 204, 255, .22), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  border: 1px solid var(--w7);
  transition: transform .12s;
}
.promo:active { transform: scale(.985); }
.promo__icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .1);
  color: var(--accent);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
}
.promo__icon .ic { width: 22px; height: 22px; }
.promo__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.promo__title { font-size: 15px; font-weight: 600; }
.promo__sub { font-size: 13px; color: var(--text-3); }
.promo__chevron { width: 18px; height: 18px; margin-left: auto; color: var(--text-4); }

/* ---------- 8. СЕКЦИИ И СПИСКИ ---------- */
.section { margin-top: 24px; }
.section__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.list {
  background: var(--w3);
  border: 1px solid var(--w5);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.list--empty { padding: 8px 0; }
.list--tall { min-height: 320px; display: flex; align-items: center; justify-content: center; }

.row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  text-align: left;
  transition: background-color .15s;
}
.row + .row { border-top: 1px solid var(--separator); }
.row:not(.is-static):active { background: var(--w5); }
.row.is-static { cursor: default; }
.row__icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--w5);
  color: var(--text-2);
  flex-shrink: 0;
}
.row__icon .ic { width: 20px; height: 20px; }
.row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.row__title { font-size: 15px; font-weight: 500; }
.row__sub { font-size: 13px; color: var(--text-3); }
.row__value { font-size: 15px; color: var(--text-2); white-space: nowrap; }
.row__chevron { width: 18px; height: 18px; color: var(--text-4); }
.row--danger .row__title, .row--danger .row__icon { color: var(--red); }

/* Иконка валюты в списке счетов */
.coin {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
/* img внутри — реальный логотип из бандла (icons/),
   object-fit:contain + исходник 128–160px => чётко и на Retina.
   :not(.coin__net) обязателен — иначе бейдж сети наследует размер монеты. */
.coin > img:not(.coin__net) { width: 100%; height: 100%; object-fit: contain; display: block; }
/* запасной вариант: для токена нет файла иконки — кружок с первой буквой */
.coin--letter { background: var(--accent); }
/* бейдж сети (TRC20 / ERC20 / TON …) в правом нижнем углу, как в оригинале */
.coin > img.coin__net {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 40%; height: 40%;
  object-fit: contain;
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(15,15,15,.92);
  z-index: 1;
}

/* ---------- 9. ПУСТОЕ СОСТОЯНИЕ ---------- */
.empty { text-align: center; padding: 36px 16px; }
.empty__icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--w5);
  color: var(--text-4);
}
.empty__icon .ic { width: 30px; height: 30px; }
.empty__title { font-size: 17px; font-weight: 600; }
.empty__text { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ---------- 10. ПОЛЯ ВВОДА ---------- */
.field {
  display: flex; align-items: center; gap: 10px;
  height: 54px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--w5);
  border: 1px solid var(--w7);
  transition: border-color .15s;
}
.field:focus-within { border-color: rgba(77, 204, 255, .45); }
.field + .field { margin-top: 10px; }
.field__lead { display: grid; place-items: center; color: var(--text-3); }
.field__lead .ic { width: 20px; height: 20px; }
.field__input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  font-size: 15px;
}
.field__input::placeholder { color: var(--text-4); }
.field__action { font-size: 13px; color: var(--accent); white-space: nowrap; }
.field--textarea { height: auto; padding: 12px 14px; }
.field__area {
  width: 100%; background: none; border: 0; outline: none; resize: none;
  font-size: 14px; line-height: 1.45;
}
.field__area::placeholder { color: var(--text-4); }

/* Сегментированный контрол */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--w3);
  border: 1px solid var(--w5);
  margin-bottom: 12px;
}
.segmented__item {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-3);
  transition: background-color .15s, color .15s;
}
.segmented__item.is-active { background: var(--w7); color: var(--text); font-weight: 500; }

/* Выбор сети: логотип рядом с названием (Tron / BSC / Ethereum / TON) */
.segmented--net .segmented__item {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px;
  font-size: 12.5px;
  padding: 0 2px;
  white-space: nowrap;
}
.net-ic {
  width: 16px; height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* ---------- 11. ЭКРАН ОТПРАВКИ ---------- */
.amount-card {
  border-radius: var(--r-lg);
  background: var(--w3);
  border: 1px solid var(--w5);
  padding: 18px 16px 14px;
}
.amount-card__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.amount-card__value {
  font-size: 38px; font-weight: 700; letter-spacing: -1px;
  display: flex; align-items: center;
}
.amount-card__cursor {
  width: 2px; height: 34px;
  margin-left: 3px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px;
  border-radius: 999px;
  background: var(--w7);
  font-size: 14px; font-weight: 600;
}
.chip .ic { width: 16px; height: 16px; color: var(--text-3); }
/* иконка валюты в чипе суммы */
.chip__ic { width: 18px; height: 18px; object-fit: contain; display: block; }

.amount-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px;
  font-size: 13px; color: var(--text-3);
}
.amount-card__meta b { color: var(--text-2); font-weight: 500; }
.link-btn { font-size: 13px; color: var(--accent); font-weight: 500; }

/* Клавиатура суммы */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.keypad button {
  height: 52px;
  border-radius: var(--r-md);
  background: var(--w3);
  font-size: 20px; font-weight: 500;
  display: grid; place-items: center;
  transition: background-color .12s;
}
.keypad button:active { background: var(--w7); }
.keypad .ic { width: 20px; height: 20px; color: var(--text-2); }

/* Блок комиссий */
.fees {
  margin-top: 20px;
  padding: 4px 16px;
  border-radius: var(--r-lg);
  background: var(--w3);
  border: 1px solid var(--w5);
}
.fees__row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  font-size: 14px;
  color: var(--text-2);
}
.fees__row + .fees__row { border-top: 1px solid var(--separator); }
.fees__row span:last-child { color: var(--text); font-weight: 500; }

/* ---------- 12. ЭКРАН ПОЛУЧЕНИЯ ---------- */
.qr-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 16px;
  border-radius: var(--r-xl);
  background: var(--w3);
  border: 1px solid var(--w5);
}
.qr {
  width: 168px; height: 168px;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  image-rendering: pixelated;
}
.qr-card__label { font-size: 13px; color: var(--text-3); }
.addr {
  font-size: 13px;
  word-break: break-all;
  text-align: center;
  color: var(--text-2);
  background: var(--w5);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  user-select: all;
}
.notice {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: rgba(77, 204, 255, .07);
  border: 1px solid rgba(77, 204, 255, .16);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}
.notice b { color: var(--text); font-weight: 600; }

/* ---------- 12b. РЕФЕРАЛКА: команда @PsWalletApp ref + уведомления ---------- */
.notice--cmd { padding: 14px; }
.notice__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.notice__lead { font-size: 13px; color: var(--text-2); }
.notice__hint { margin: 10px 0 0; font-size: 13px; color: var(--text); }
.notice__note { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }

/* Сама команда — как ссылка, но кликабельна целиком */
.cmd-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(77, 204, 255, .14);
  border: 1px solid rgba(77, 204, 255, .28);
  color: var(--accent);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.cmd-chip .ic { width: 15px; height: 15px; }

/* Строка уведомлений: текст слева, переключатель справа */
.cond__row--notify { align-items: flex-start; }
.cond__label-text { display: flex; flex-direction: column; gap: 3px; }
.cond__label-text b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.cond__label-text span { font-size: 12.5px; line-height: 1.45; color: var(--text-3); }

/* ---------- 13. ЭКРАН ОБМЕНА ---------- */
.swap { position: relative; display: flex; flex-direction: column; gap: 10px; }
.swap__card {
  border-radius: var(--r-lg);
  background: var(--w3);
  border: 1px solid var(--w5);
  padding: 16px;
}
.swap__head { display: flex; align-items: center; justify-content: space-between; }
.swap__hint { font-size: 13px; color: var(--text-3); }
.asset-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  border-radius: 999px;
  background: var(--w7);
  font-size: 15px; font-weight: 600;
}
.asset-btn .ic { width: 16px; height: 16px; color: var(--text-3); }
/* «Кружок» выбора актива в экране обмена: внутри реальный логотип */
.asset-btn__dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.asset-btn__dot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.asset-btn__dot--letter { font-size: 11px; font-weight: 700; color: #fff; }
.swap__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.swap__amount {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  font-size: 34px; font-weight: 700; letter-spacing: -1px;
}
.swap__sub { margin-top: 6px; font-size: 13px; color: var(--text-3); }

.swap__flip {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--secondary-bg);
  border: 1px solid var(--w15);
  color: var(--accent);
  transition: transform .2s;
}
.swap__flip:active { transform: translate(-50%, -50%) rotate(180deg); }
.swap__flip .ic { width: 22px; height: 22px; }

/* ---------- 14. РЕФЕРАЛЬНЫЙ ЭКРАН ---------- */
.ref-sub {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Прогресс-карточка */
.progress-card {
  position: relative;
  overflow: hidden;
  padding: 22px 20px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(77, 204, 255, .26), transparent 62%),
    radial-gradient(70% 110% at 0% 100%, rgba(139, 226, 255, .12), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  border: 1px solid var(--w7);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .05);
}
.progress-card__badge {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 0 6px;
  border-radius: 999px;
  background: rgba(77, 204, 255, .12);
  color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.progress-card__badge-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .22);
}
.progress-card__badge-icon .ic { width: 13px; height: 13px; stroke-width: 2; }

.progress-card__value {
  margin-top: 16px;
  display: flex; align-items: baseline; gap: 8px;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1.6px;
  line-height: 1.05;
}
.progress-card__sep { font-size: 26px; color: var(--text-4); font-weight: 500; }
#ref-goal { color: var(--accent); text-shadow: 0 0 24px rgba(77, 204, 255, .5); }
.progress-card__caption { margin-top: 4px; font-size: 14px; color: var(--text-3); }

/* Большой красивый прогресс-бар */
.progress {
  position: relative;
  margin-top: 18px;
  height: 22px;
  border-radius: 999px;
  background: var(--w5);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.progress__fill {
  position: relative;
  height: 100%;
  min-width: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4dccff, #8be1ff);
  box-shadow: 0 0 18px rgba(77, 204, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: width .9s cubic-bezier(.32, .72, 0, 1);
  overflow: hidden;
}
.progress__sheen {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: sheen 2.6s ease-in-out infinite;
}
@keyframes sheen { 60%, 100% { transform: translateX(220%); } }

.progress-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
}
#ref-percent { color: var(--accent); font-weight: 600; }

/* Блок «кто пригласил» */
.inviter {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: rgba(157, 215, 82, .08);
  border: 1px solid rgba(157, 215, 82, .22);
}
.inviter__icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(157, 215, 82, .14);
  color: var(--green);
  flex-shrink: 0;
}
.inviter__icon .ic { width: 22px; height: 22px; }
.inviter__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inviter__label { font-size: 13px; color: var(--text-3); }
.inviter__value { font-size: 17px; font-weight: 600; color: var(--green); }
.inviter__caption { font-size: 12px; color: var(--text-3); }
/* Нейтральный вид, когда приглашения не было */
.inviter--default {
  background: rgba(77, 204, 255, .07);
  border-color: rgba(77, 204, 255, .18);
}
.inviter--default .inviter__icon { background: rgba(77, 204, 255, .12); color: var(--accent); }
.inviter--default .inviter__value { color: var(--accent); font-size: 15px; font-weight: 500; }

/* Карточки условий */
.rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reward {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--w3);
  border: 1px solid var(--w5);
}
.reward__icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .1);
  color: var(--accent);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
}
.reward__icon .ic { width: 22px; height: 22px; }
/* Иконка USDT — фирменный знак Tether */
.reward__icon--usdt {
  background: rgba(38, 161, 123, .16);
  color: #26a17b;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.reward__label { font-size: 15px; font-weight: 500; }
.reward__value { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: -.3px; }
.reward__hint { font-size: 12px; color: var(--text-3); line-height: 1.45; }

/* Кто что получает: приглашённый — слева, сумма — справа */
.reward__who {
  display: flex; flex-direction: column; gap: 6px;
  width: 100%;
  padding-top: 2px;
}
.reward__who-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
  font-size: 12px;
  line-height: 1.4;
}
.reward__who-label { font-weight: 400; color: var(--text-3); }
.reward__who-amt   { font-style: normal; font-weight: 600; color: var(--text); }

/* Кнопка «Поделиться» — большая синяя */
.btn {
  width: 100%;
  height: 56px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 600;
  transition: transform .12s, filter .15s;
}
.btn:active { transform: scale(.985); }
.btn .ic { width: 20px; height: 20px; }

.btn--share {
  margin-top: 20px;
  background: linear-gradient(180deg, #57d0ff, #2fb6ef);
  color: #fff;
  box-shadow: 0 10px 26px rgba(77, 204, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .45);
}
/* Основная кнопка действий (та же роль, что у Telegram MainButton) */
.btn--primary {
  margin-top: 20px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(77, 204, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn--secondary { background: var(--w7); color: var(--text); }
.btn-caption {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

/* Ссылка */
.link-box {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-md);
  background: var(--w5);
  border: 1px solid var(--w7);
}
.link-box__text {
  flex: 1; min-width: 0;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  user-select: all;
}
.link-box__btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}
.link-box__btn .ic { width: 19px; height: 19px; }

/* Статистика */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.stat {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--w3);
  border: 1px solid var(--w5);
}
.stat__title { font-size: 15px; font-weight: 600; }
.stat__value { margin-top: 6px; font-size: 20px; font-weight: 700; color: var(--text-2); letter-spacing: -.4px; }

/* Шаги «Как это работает» */
.steps { display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; align-items: flex-start; gap: 12px; }
.step__num {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .1);
  color: var(--accent);
  font-size: 15px; font-weight: 700;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
  flex-shrink: 0;
}
.step__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-top: 2px; }
.step__title { font-size: 15px; font-weight: 500; }
.step__text { font-size: 13px; color: var(--text-3); line-height: 1.45; }

/* ---------- 15. ПРОФИЛЬ ---------- */
.profile { text-align: center; padding: 8px 0 4px; }
.profile__avatar {
  width: 84px; height: 84px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 700;
  color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, #8be2ff 0%, #1baae8 55%, #015274 100%);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, .35);
}
.profile__name { margin-top: 12px; font-size: 21px; font-weight: 700; }
.profile__handle { font-size: 14px; color: var(--text-3); }

/* ---------- 16. НИЖНЯЯ ПАНЕЛЬ (пилюля как в оригинале) ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: max(var(--bottom-gap), env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}
.tabbar__pill {
  position: relative;
  display: flex;
  align-items: center;
  width: 344px;
  max-width: calc(100vw - 24px);
  height: 48px;
  padding: 4px;
  border-radius: 999px;
  background: var(--island);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--w7);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
  overflow: hidden;
  pointer-events: auto;
}
/* Неоновое свечение по центру пилюли */
/* Неоновое свечение — оригинальный ассет navbarNeon (95×110, ellipse + blur 5),
   в оригинале position:absolute; top:-8px; left:(BAR_W-2)/2+.5-47.5 — т.е. по центру */
.tabbar__glow {
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 95px; height: 110px;
  background: url("../icons/navbar-neon.svg") no-repeat center / 95px 110px;
  pointer-events: none;
}
/* Иконка таба: бокс 24×24 как Box в оригинале, картинка позиционируется
   absolute по dx/dy из ICONS бандла (см. inline-стили в index.html) */
.tab__box {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform .15s ease;
}
.tab__box .i {
  position: absolute;
  max-width: none;
  display: block;
}
.tab__box .i--a { display: none; }
.tab.is-active .tab__box .i--d { display: none; }
.tab.is-active .tab__box .i--a { display: block; }
.tab:active .tab__box { transform: scale(.9167); }

/* Подвижный индикатор активного таба */
.tabbar__active {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 67px;
  height: 40px;
  border-radius: 999px;
  background: var(--w7);
  transition: left .3s cubic-bezier(.32, .72, 0, 1);
  pointer-events: none;
}
.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .5);
  transition: color .18s;
}
.tab .ic { width: 24px; height: 24px; transition: transform .15s ease; }
.tab:active .ic { transform: scale(.9167); }
.tab.is-active { color: var(--accent); filter: drop-shadow(0 0 6px rgba(77, 204, 255, .6)); }
.tab--avatar { color: inherit; }
.tab__avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, #8be2ff 0%, #1baae8 55%, #015274 100%);
  border: 2px solid var(--w15);
  transition: border-color .2s;
}
.tab--avatar.is-active .tab__avatar { border-color: #fff; }

/* ---------- 17. НИЖНИЙ ЛИСТ ---------- */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 60;
}
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 50%; bottom: 0;
  transform: translate(-50%, 110%);
  width: 100%;
  max-width: 520px;
  max-height: 76vh;
  overflow-y: auto;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0;
  background: var(--section-bg);
  border-top: 1px solid var(--w7);
  z-index: 70;
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet__handle {
  width: 40px; height: 4px;
  border-radius: 999px;
  background: var(--w15);
  margin: 6px auto 14px;
}
.sheet__title { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.sheet__list { display: flex; flex-direction: column; gap: 6px; }
.sheet__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--w3);
  text-align: left;
  transition: background-color .15s;
}
.sheet__item:active { background: var(--w7); }
.sheet__item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sheet__item-title { font-size: 15px; font-weight: 500; }
.sheet__item-sub { font-size: 12px; color: var(--text-3); }
.sheet__item-value { font-size: 14px; color: var(--text-2); }

/* ---------- 18. УВЕДОМЛЕНИЕ ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 8px);
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 48px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #0f0f0f;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 18b. ЧЕКИ (экраны 8–10) ----------
   Механика и тексты — из оригинала pswallet.org (ключи ds_checks_* / ds_check_*). */

/* Плоская карточка на главном (белый остров, как Island в оригинале) */
.promo--flat {
  background: var(--w3);
  border: 1px solid var(--w5);
}
/* Иконка-плитка в оригинале: Center 40×40, borderRadius full,
   bg white_3, boxShadow inset 0 0 20px 0 rgba(255,255,255,0.08),
   color text, внутри Lucide Receipt 20px */
.promo--flat .promo__icon {
  width: 40px; height: 40px;
  background: var(--w3);
  color: var(--text);
  box-shadow: inset 0 0 20px 0 rgba(255, 255, 255, .08);
}
.promo--flat .promo__icon .ic { width: 20px; height: 20px; }

/* Подсказка режима «Чеком» на экране перевода */
.check-hint {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--w3);
  border: 1px solid var(--w5);
}
.check-hint__icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .1);
  color: var(--accent);
}
.check-hint__icon .ic { width: 18px; height: 18px; }
.check-hint__body { display: flex; flex-direction: column; gap: 4px; }
.check-hint__body b { font-size: 14px; font-weight: 600; }
.check-hint__body span { font-size: 12.5px; line-height: 1.45; color: var(--text-3); }

/* Выбор типа чека */
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--w3);
  border: 1px solid var(--w5);
  text-align: left;
  transition: background-color .15s;
}
.choice:active { background: var(--w7); }
.choice__icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .1);
  color: var(--accent);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
}
.choice__icon .ic { width: 22px; height: 22px; }
.choice__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.choice__title { font-size: 15px; font-weight: 600; }
.choice__desc { font-size: 12.5px; line-height: 1.45; color: var(--text-3); }
.choice__chevron { width: 18px; height: 18px; color: var(--text-4); flex-shrink: 0; }
.notice code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

/* Карточка чека в списке */
.check {
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--w3);
  border: 1px solid var(--w5);
}
.check + .check { margin-top: 10px; }
.check__head { display: flex; align-items: center; gap: 12px; }
.check__icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .1);
  color: var(--accent);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
}
.check__icon .ic { width: 20px; height: 20px; }
.check__sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.check__amount { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.check__when { font-size: 12px; color: var(--text-3); }
.badge {
  flex-shrink: 0;
  font-size: 11px; font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(157, 215, 82, .14);
  color: var(--green);
}
.badge--muted { background: var(--w7); color: var(--text-3); }
.check__meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px;
}
.tag {
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--w5);
  color: var(--text-3);
  display: inline-flex; align-items: center; gap: 4px;
}
.tag .ic { width: 12px; height: 12px; }
.check__link { margin-top: 12px; }
.check__actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
}
.check__btn {
  flex: 1 1 auto;
  height: 38px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  background: var(--w7);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 10px;
  white-space: nowrap;
}
.check__btn .ic { width: 15px; height: 15px; }
.check__btn--accent { background: rgba(77, 204, 255, .16); color: var(--accent); }
.check__btn--danger { background: rgba(215, 82, 84, .14); color: var(--red); }
/* Порядок важен: уточнение идёт ПОСЛЕ базового правила */
.check__btn--full { flex: 1 1 100%; }

/* Подпись под пустым состоянием («Создайте его в чате…») */
.empty__hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-4);
}

/* Форма создания чека */
.asset-btn--wide {
  width: 100%;
  height: 52px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 16px;
}
.asset-btn--wide #ck-account-name { flex: 1; text-align: left; font-size: 15px; }
.asset-btn--wide .ic { margin-left: auto; }
.field-error {
  margin-top: 8px;
  font-size: 12px;
  color: var(--red);
}
.field-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.stepper { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.stepper button {
  width: 26px; height: 20px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-3);
}
.stepper button:active { background: var(--w7); }
.stepper button:first-child .ic { transform: rotate(180deg); }
.stepper .ic { width: 14px; height: 14px; }

/* Блок «Условия получения» */
.cond {
  margin-top: 4px;
  border-radius: 20px;
  background: var(--w5);
  border: 1px solid var(--w5);
  padding: 15px;
}
.cond__head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
}
.cond__head .ic { width: 16px; height: 16px; transition: transform .2s; }
.cond__head[aria-expanded="true"] .ic { transform: rotate(180deg); }
.cond__body { padding-top: 8px; }
.cond__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--w3);
}
.cond__row--stack { flex-wrap: wrap; }
.cond__row--last { border-bottom: 0; padding-bottom: 0; }
.cond__label {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 14px; font-weight: 500;
  flex: 1; min-width: 0;
}
.cond__label em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--text-3); }
.cond__ic { width: 15px; height: 15px; color: var(--text-3); }
.cond__reveal { width: 100%; margin-top: 10px; }

/* Переключатель — геометрия и цвета из оригинала (44×24, #6fbb0d / #c8ff81) */
.switch {
  position: relative;
  width: 44px; height: 24px; flex-shrink: 0;
  border-radius: 11px;
  background: var(--w7);
  transition: background-color .2s;
}
.switch i {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 9px;
  background: var(--w7);
  transition: left .2s, background-color .2s;
}
.switch[aria-checked="true"] { background: #6fbb0d; box-shadow: inset 0 0 8px rgba(255, 255, 255, .2); }
.switch[aria-checked="true"] i { left: 22px; background: #c8ff81; }
.switch:disabled { opacity: .5; }

/* Каналы (подписка как условие) */
.chan {
  display: flex; align-items: center; gap: 8px;
  height: 44px;
  cursor: pointer;
}
.chan input { accent-color: #6fbb0d; width: 16px; height: 16px; }
.chan__ava {
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--w7);
  font-size: 9px; font-weight: 700;
  color: var(--text-2);
}
.chan__name { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Развернутое объяснение быстрого чека */
.fast-help {
  display: flex; flex-direction: column; gap: 6px;
  padding: 2px 6px 6px;
}
.fast-help b { font-size: 14px; font-weight: 600; }
.fast-help p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-3); }
.fast-help__code {
  align-self: flex-start;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--w5);
  color: var(--accent);
}
.fast-help__done { font-size: 12px !important; color: var(--text-4) !important; }
.or-custom {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-3);
}
.cond__per {
  display: block;
  margin-bottom: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
}

/* Экран активации чека (получатель) */
.claim {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 8px;
}
.claim__icon {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .1);
  color: var(--accent);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, .06);
}
.claim__icon .ic { width: 34px; height: 34px; }
.claim__sum {
  margin-top: 16px;
  font-size: 26px; font-weight: 700; letter-spacing: -.5px;
}
.claim__code {
  margin-top: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-2);
}
.claim .cond,
.claim .field,
.claim .btn,
.claim .list,
.claim .field-error { width: 100%; text-align: left; }
.claim .cond { margin-top: 20px; }
.claim .field { margin-top: 12px; }
.claim .btn { margin-top: 20px; }
.claim .field-error { margin-top: 12px; }
.claim__hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}
#claim-channels { margin-top: 12px; padding: 4px 14px; }

/* ---------- 18c. СТРОКИ BillTypeItem (экран QR СБП) ----------
   Оригинал: HStack button, w full, justify space-between, py 20px, gap 12px,
   border-bottom 1px white_3 (кроме последней); бокс иконки 40×40, картинка
   absolute по x/y/w/h из QR_ICON / NSPK_ICON; заголовок 14px, описание 13px/16px. */
.bill-list { display: flex; flex-direction: column; }
.bill {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; gap: 12px;
  padding: 20px 0;
  text-align: left;
  border-bottom: 1px solid var(--w3);
  cursor: pointer;
}
.bill--last { border-bottom: 0; }
.bill__lead { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.bill__icon { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.bill__icon img { position: absolute; max-width: none; display: block; }
.bill__body { display: flex; flex-direction: column; min-width: 0; line-height: normal; }
.bill__title { font-size: 14px; color: var(--text); }
.bill__desc  { font-size: 13px; line-height: 16px; color: var(--text-2); }
.bill__chevron { width: 18px; height: 18px; color: var(--text-2); flex-shrink: 0; }

/* ---------- 19. АДАПТИВ ---------- */
@media (max-width: 360px) {
  .balance__value { font-size: 34px; }
  .progress-card__value { font-size: 38px; }
  .rewards, .stats { grid-template-columns: 1fr; }
  .swap__amount { font-size: 30px; }
}


/* ============================================================
   19. ISLAND / CRYPTOITEM — блоки главного экрана оригинала.
   Island      : bg island, radius 24, inset 0 0 20px white_5, overflow hidden
   IslandHeader: pt20 pb15 px24, border-bottom white_5, 18/600
   CryptoItem  : space-between, pt20 pb19, gap 12, border-bottom white_3
   ArrowButton : 32x32 белый круг, картинка 16x16
   ============================================================ */
.island {
  position: relative;
  background: var(--island);
  border-radius: 24px;
  box-shadow: inset 0 0 20px 0 var(--w5);
  overflow: hidden;
}
.island + .island,
.promo + .island,
.island + .promo { margin-top: 20px; }

.island__head {
  padding: 20px 24px 15px;
  border-bottom: 1px solid var(--w5);
  font-size: 18px;
  font-weight: 600;
  line-height: normal;
  color: var(--text);
}
.island__body { padding: 0 24px; }

/* CryptoItem */
.item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 19px;
  border: 0;
  border-bottom: 1px solid var(--w3);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.item:last-child { border-bottom: 0; padding-bottom: 20px; }
.item--noline { border-bottom: 0; }
.item__lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item__icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--w3);
  box-shadow: inset 0 0 20px 0 rgba(255, 255, 255, .08);
  color: var(--text);
}
.item__icon .ic { width: 20px; height: 20px; }
.item__col {
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 4px;
  min-width: 0;
}
.item__titlerow { display: flex; align-items: center; gap: 4px; min-width: 0; }
.item__title {
  font-size: 14px; line-height: normal; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item__badge { font-size: 14px; line-height: normal; color: var(--text-3); white-space: nowrap; }
.item__sub {
  font-size: 12px; line-height: normal; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.item__right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.item__val { font-size: 14px; font-weight: 500; line-height: normal; color: var(--text); white-space: nowrap; }
.item__sub2 { font-size: 12px; line-height: normal; color: var(--text-3); white-space: nowrap; }

/* ArrowButton: Center w32 h32 radius full bg white + картинка 16x16 */
.arrow-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  padding: 0;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.arrow-btn img, .arrow-btn svg { width: 16px; height: 16px; display: block; }

/* StakingLogo(size 40): radius round(size*.3)=12,
   gradient 160deg #6fdcff→#2a8dff, glow 40px + inset 24px */
.stake-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: linear-gradient(160deg, #6fdcff 0%, #2a8dff 100%);
  box-shadow: 0 0 40px 0 rgba(77, 204, 255, .45), inset 0 0 24px 0 rgba(255, 255, 255, .35);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  user-select: none;
}

/* Иконка копилки — скруглённый квадрат 40 с монетой */
.piggy-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: linear-gradient(160deg, #b9f27c 0%, #6fbb0d 100%);
  box-shadow: 0 0 40px 0 rgba(157, 215, 82, .35), inset 0 0 24px 0 rgba(255, 255, 255, .35);
  color: #173300;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

/* ============================================================
   20. BANNER ВИРТУАЛЬНОЙ КАРТЫ — CardBanner из бандла.
   Box radius 32, h 182, overflow hidden:
     фон card-banner-bg (cover, opacity .8)
     + растянутый CARD_BANNER_BG
     + слой #6a6a6a с mix-blend-mode: multiply
     + картинка карточек (left -80 top -61, 279x349, rotate 24.38deg)
     + текстовый стек справа
     + внутреннее свечение rd-inner-glow-20
   ============================================================ */
.card-banner {
  position: relative;
  display: block;
  width: 100%;
  height: 182px;
  margin-top: 20px;
  padding: 0;
  border: 0;
  border-radius: 32px;
  overflow: hidden;
  cursor: pointer;
  text-align: right;
}
.card-banner__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .8;
}
.card-banner__grad {
  position: absolute; inset: 0;
  background-image:
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 408 182' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(-21.267 -4.2081 9.2223 -12.122 366.18 187.79)'><stop stop-color='rgba(0,136,182,1)' offset='0'/><stop stop-color='rgba(0,179,255,0)' offset='1'/></radialGradient></defs></svg>"),
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 408 182' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(-24.633 14.465 -6.8667 -12.439 408 -0.000014829)'><stop stop-color='rgba(139,226,255,1)' offset='0'/><stop stop-color='rgba(85,212,255,0)' offset='1'/></radialGradient></defs></svg>"),
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 408 182' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(27.642 -12.699 11.186 24.744 112.2 -9.7684)'><stop stop-color='rgba(1,82,116,1)' offset='0'/><stop stop-color='rgba(0,130,185,0.5)' offset='0.5'/><stop stop-color='rgba(0,178,255,0)' offset='1'/></radialGradient></defs></svg>"),
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 408 182' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(-9.435 11.046 -7.0193 -6.3778 247.86 -11.046)'><stop stop-color='rgba(27,170,232,1)' offset='0'/><stop stop-color='rgba(17,151,208,0)' offset='1'/></radialGradient></defs></svg>"),
  url("data:image/svg+xml;utf8,<svg viewBox='0 0 408 182' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='1'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(19.686 -3.6295 -11.781 9.1 7.14 182)'><stop stop-color='rgba(139,226,255,1)' offset='0'/><stop stop-color='rgba(85,212,255,0)' offset='1'/></radialGradient></defs></svg>"),
  linear-gradient(90deg, rgb(77, 204, 255) 0%, rgb(139, 225, 255) 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.card-banner__mul {
  position: absolute; inset: 0;
  background: #6a6a6a;
  mix-blend-mode: multiply;
}
.card-banner__cards {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 219px;
  overflow: hidden;
}
.card-banner__cards img {
  position: absolute;
  left: -80px; top: -61px;
  width: 279px; height: 349px;
  max-width: none;
  transform: rotate(24.38deg);
}
.card-banner__stack {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  padding: 28px 28px 16px;
  gap: 4px;
  align-items: flex-end;
}
.card-banner__title {
  font-size: 20px; font-weight: 500; line-height: 1.3;
  color: var(--text); text-align: right;
  white-space: pre-line; max-width: 200px;
}
.card-banner__desc { font-size: 14px; line-height: normal; color: var(--text-3); text-align: right; }
.card-banner__cta { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.card-banner__cta-label { font-size: 14px; line-height: 1.3; color: var(--text-2); }
.card-banner__glow {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 20px 0 rgba(255, 255, 255, .08);
}


/* ============================================================
   21. ЭКРАНЫ-ДЕТАЛИ: миграция / стейкинг / копилки / карты
   ============================================================ */
.lead {
  margin: 4px 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-3);
}
.para {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}
.para:last-child { margin-bottom: 0; }
.para--strong { font-size: 16px; font-weight: 500; color: var(--text); }

/* AmountsList: VStack gap 0, radius 24, bg white_3, px 16;
   строка py 12 gap 12, border-bottom white_5 кроме последней */
.amounts {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--w3);
  padding: 0 16px;
  margin-bottom: 14px;
}
.amounts__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--w5);
}
.amounts__row:last-child { border-bottom: 0; }
.amounts__code { flex: 1; font-size: 16px; color: var(--text); min-width: 0; }
.amounts__code span { color: var(--text-3); }
.amounts__val { font-size: 16px; font-weight: 500; color: var(--text); }

/* Вторичная кнопка (NeonButton variant=secondary) */
.btn--ghost {
  background: var(--w3);
  color: var(--text);
  border: 1px solid var(--w5);
  margin-top: 10px;
}

/* Нумерованные шаги «Как это работает» */
.how {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--w3);
}
.how:last-child { border-bottom: 0; padding-bottom: 20px; }
.how:first-child { padding-top: 20px; }
.how__n {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(77, 204, 255, .14);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.how__t { font-size: 14px; line-height: 1.5; color: var(--text-2); }

/* Мелкая сноска под кнопкой */
.note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-3);
  text-align: center;
}

/* Баннер на экране «Карты» — без верхнего отступа */
.card-banner--flush { margin-top: 0; }

/* Карточка продукта стейкинга */
.product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--w3);
  width: 100%;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  color: inherit; font: inherit; text-align: left;
  cursor: pointer;
}
.product:last-child { border-bottom: 0; padding-bottom: 20px; }
.product__rate { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: -.3px; }
.product__meta { font-size: 12px; color: var(--text-3); line-height: 1.45; }


/* ============================================================
   22. РЕФЕРАЛЬНЫЙ БАЛАНС + ПОСЛЕДНИЕ НАЧИСЛЕНИЯ
   Ключи: referral_balance / referral_claim / referral_recent /
   referral_recent_reward / referral_recent_claim
   ============================================================ */
.ref-balance {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px;
  border-radius: var(--r-lg);
  background: var(--w3);
  border: 1px solid var(--w5);
}
.ref-balance__val {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.5px;
  color: var(--text);
}
.ref-balance__val span {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 6px;
}

.recent__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--w3);
}
.recent__row:first-child { padding-top: 16px; }
.recent__row:last-child { border-bottom: 0; padding-bottom: 16px; }
.recent__icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--w3);
  color: var(--text-3);
}
.recent__icon .ic { width: 18px; height: 18px; }
.recent__col { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.recent__label { font-size: 14px; color: var(--text); }
.recent__date { font-size: 12px; color: var(--text-3); }
.recent__amt { font-size: 14px; font-weight: 600; white-space: nowrap; }
.recent__amt--in  { color: var(--green); }
.recent__amt--out { color: var(--text-2); }


/* ============================================================
   23. ЭКРАН «ПЕРЕВОДЫ» (/payments) — PaymentsPage из бандла
   ============================================================ */
.tp { padding-bottom: 8px; }
.tp__h {
  padding-top: 40px;
  padding-bottom: 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.tp__h--pay { padding-bottom: 0; }

/* SimpleGrid columns:2 gap:4 */
.tp__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

/* TransferButtonItem (малая вариация): HStack h72 px16 py12,
   align-items flex-end, justify-content space-between,
   bg white_3, border 1px white_3, radius16, inset glow white_5 */
.tp-tile {
  height: 72px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  background: var(--w3);
  border: 1px solid var(--w3);
  border-radius: 16px;
  box-shadow: inset 0 0 20px 0 var(--w5);
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.tp-tile:hover { background: var(--w5); border-color: var(--w7); }
.tp-tile--off, .tp-tile:disabled { opacity: .5; cursor: not-allowed; }
.tp-tile--off:hover { background: var(--w3); border-color: var(--w3); }
.tp-tile__body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.tp-tile__t {
  font-size: 13px;
  line-height: normal;
  color: var(--text);
  white-space: pre-line;
}
.tp-tile__note { font-size: 10px; line-height: normal; color: var(--text-3); white-space: nowrap; }
.tp-tile__ic { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }

/* VStack gap:8 pt:16 */
.tp__rows { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; }

/* PaymentActionItem: HStack h80 pl16 pr24 py16, radius20 */
.pay-row {
  width: 100%;
  height: 80px;
  padding: 16px 24px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--w3);
  border: 1px solid var(--w3);
  border-radius: 20px;
  box-shadow: inset 0 0 20px 0 var(--w5);
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}
.pay-row__lead { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Center 40×40 radius full bg white_3, inset 0 0 20px rgba(255,255,255,.08) */
.pay-row__ic {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--w3);
  box-shadow: inset 0 0 20px 0 rgba(255, 255, 255, .08);
}
.pay-row__ic img, .pay-row__ic .ic { width: 24px; height: 24px; object-fit: contain; }
.pay-row__col { display: flex; flex-direction: column; min-width: 0; }
.pay-row__col b { font-size: 16px; font-weight: 500; line-height: normal; color: var(--text); }
.pay-row__col span {
  font-size: 14px; line-height: normal; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


/* ============================================================
   24. МОБИЛЬНАЯ АДАПТАЦИЯ
   ------------------------------------------------------------
   Клон открывается и внутри Telegram (панель ~400px), и в
   обычном браузере с телефона, и на десктопе. Здесь — всё, что
   зависит от размера и safe-area:
     * высота в единицах dvh (иначе iOS-панель адреса обрезает низ);
     * поля ввода 16px на тач-устройствах (Android иначе сам
       увеличивает страницу при фокусе);
     * safe-area вокруг таб-бара и домашний индикатор iPhone;
     * -webkit- префикс для backdrop-filter (старый Safari);
     * тапы без 300-мс задержки.
   ============================================================ */
html { height: 100%; }

html, body {
  /* iOS/Android не должны сами увеличивать текст при повороте */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* pull-to-refresh в приложении не нужен */
  overscroll-behavior-y: none;
}

body {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Тапы без паузы в 300 мс на старых WebView */
button, a, [role="button"], .segmented__item, .tab, .sheet__item {
  touch-action: manipulation;
}

/* Сегменты отправки: их 7, и в одну строку они не влезают ни на одном
   телефоне (сумма подписей ~565px при 358px доступных).
   Оригинал вообще не показывает строку сегментов — там метод выбирается
   модалкой TransferMethodModal и каждый метод это отдельный маршрут.
   У нас один общий экран, поэтому способ: сетка на 4 колонки с переносом —
   все семь способов видны сразу, ничего не прячется за прокруткой.
   auto-fit + minmax — колонки сами подстраиваются под ширину экрана. */
.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 4px;
}
.segmented__item {
  height: auto;
  min-height: 36px;
  padding: 6px 4px;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}
/* На узких поджимаем шрифт — тогда подписи укладываются в два ряда */
@media (max-width: 380px) {
  .segmented__item { font-size: 12px; }
}

.app {
  /* 100vh — фолбэк, 100dvh — единица, которая учитывает панель адреса */
  min-height: 100vh;
  min-height: 100dvh;
  /* запас снизу: таб-бар + отступ + домашний индикатор iPhone */
  padding-bottom: calc(var(--tabbar-h) + var(--bottom-gap) + env(safe-area-inset-bottom, 0px));
}

/* Таб-бар: раньше bottom = max(отступ, safe-area) терял отступ, когда
   safe-area больше. Складываем — тогда и до иконок ровно, и над
   индикатором есть воздух. */
.tabbar {
  bottom: calc(var(--bottom-gap) + env(safe-area-inset-bottom, 0px));
}

/* Safari до 15 не знает обычный backdrop-filter */
.tabbar, .topbar, .cur-pick, .field, .sheet {
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

/* На тач-экранах поля ввода обязаны быть 16px: меньше — Android Chrome
   при фокусе увеличивает всю страницу и интерфейс «прыгает». */
@media (pointer: coarse) {
  .field__input, .amount__input, input[type="text"],
  input[type="tel"], input[type="number"], input[type="password"] {
    font-size: 16px;
  }
}

/* Очень узкие телефоны (iPhone SE / 320px) — уже задано чуть выше,
   добавляем то, что касается адаптации: плитки и строки платежей. */
@media (max-width: 340px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .topbar { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  /* .subhead выходит за поля на -16px; при боковых отступах 12px это
     давало +4px горизонтального скролла на каждой подстранице. */
  .subhead { margin-left: -12px; margin-right: -12px; }
  .tp-tile { padding: 12px; }
  .pay-row { padding-right: 16px; }
  .subhead__title { font-size: 17px; }
}

/* Планшет и десктоп: Mini App должен выглядеть как телефон, а не
   растягиваться на всю ширину. 430px — ширина панели в Telegram. */
@media (min-width: 768px) {
  .app { max-width: 430px; }
}

/* Альбом на телефоне: шапка и таб-бар компактнее, контент не упирается
   в нижнюю панель. */
@media (orientation: landscape) and (max-height: 520px) {
  .topbar { height: 48px; }
  .app { padding-top: 0; }
  .tabbar { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}
