/* =========================================================
   USD Mini App — стили
   ========================================================= */
:root {
  --sat: 0px;               /* верхний отступ (вырез + кнопки Telegram в fullscreen) */
  --sab: 0px;               /* нижний отступ (полоска «домой») */
  --vh: 100vh;

  --bg: #0c0e11;
  --bg-2: #15181d;
  --text: #f5f7fa;
  --muted: rgba(245, 247, 250, .56);
  --dim: rgba(245, 247, 250, .34);
  --glass: rgba(255, 255, 255, .06);
  --glass-2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .08);

  --red: #ff4b45;
  --green: #2fd27a;
  --green-ink: #16a35a;

  --c0: #ffe03a; --c1: #2ee3c3; --c2: #2b9cf4;
  --c3: #9a8cff; --c4: #ff7aa9; --c5: #ff9f3d;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --sheet: cubic-bezier(.32, .72, 0, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  position: fixed; inset: 0; overflow: hidden;
  color: var(--text); font-family: var(--font); font-size: 15px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none; user-select: none;
  font-variant-numeric: tabular-nums;
}
input, textarea { -webkit-user-select: text; user-select: text; font-family: inherit; }
button { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; }

/* ---------- фон ---------- */
.bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(90% 55% at 0% 0%, rgba(52, 66, 82, .55), transparent 62%),
    linear-gradient(180deg, #12171d 0%, #0d1014 46%, #0b0c0f 100%);
}
.bg-glow {
  position: absolute; width: 120vw; height: 120vw; right: -55vw; top: -40vw; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(120, 160, 190, .30), rgba(80, 120, 150, .10) 55%, transparent 72%);
  filter: blur(10px); animation: glow 14s ease-in-out infinite alternate;
}
@keyframes glow { to { transform: translate(-6vw, 8vw) scale(1.08); } }

/* ---------- слои ---------- */
.layer { position: absolute; inset: 0; z-index: 30; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.layer.out { opacity: 0; pointer-events: none; transform: scale(1.04); }

.splash { display: grid; place-content: center; justify-items: center; gap: 22px; }
.splash-logo {
  width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0,0,0,.45);
  font-size: 40px; font-weight: 700; animation: breathe 1.8s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.06); } }
.splash-dots { display: flex; gap: 6px; }
.splash-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1.1s ease-in-out infinite; }
.splash-dots i:nth-child(2) { animation-delay: .15s; }
.splash-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-5px); } }

.gate { display: grid; place-items: center; padding: 30px; text-align: center; }
.gate-inner { max-width: 320px; animation: fadeUp .7s var(--ease) both; }
.gate-icon { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 24px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); }
.gate-icon svg { width: 30px; height: 30px; }
.gate h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.3px; }
.gate p { margin: 0 0 20px; color: var(--muted); line-height: 1.45; }
.gate p code { color: var(--text); font-size: 17px; font-weight: 600; font-family: inherit; }

/* ---------- регистрация ---------- */
.onboard { display: flex; align-items: center; justify-content: center; padding: calc(var(--sat) + 20px) 22px calc(var(--sab) + 24px); }
.ob-inner { width: 100%; max-width: 420px; }
.ob-cards { position: relative; height: 170px; margin-bottom: 22px; }
.ob-card {
  position: absolute; left: 50%; top: 18px; width: 200px; height: 124px; margin-left: -100px; border-radius: 24px;
  box-shadow: 0 24px 50px -18px rgba(0,0,0,.6); animation: obCard 1s var(--spring) both;
}
.ob-card::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.22); }
.ob-card { overflow: hidden; }
.ob-card.c0 { background: var(--c0); --r: -12deg; --x: -46px; animation-delay: .05s; }
.ob-card.c1 { background: var(--c1); --r: 0deg; --x: 0px; animation-delay: .15s; z-index: 1; }
.ob-card.c2 { background: var(--c2); --r: 12deg; --x: 46px; animation-delay: .25s; z-index: 2; }
@keyframes obCard {
  from { opacity: 0; transform: translateY(60px) rotate(0) scale(.8); }
  to   { opacity: 1; transform: translateX(var(--x)) rotate(var(--r)); }
}
.ob-title { margin: 0 0 8px; font-size: 30px; letter-spacing: -.6px; text-align: center; animation: fadeUp .7s .2s var(--ease) both; }
.ob-sub { margin: 0 auto 24px; color: var(--muted); text-align: center; line-height: 1.45; max-width: 330px; animation: fadeUp .7s .28s var(--ease) both; }
.onboard .field { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 12px 16px; animation: fadeUp .7s .36s var(--ease) both; }
.onboard .field input { font-size: 22px; font-weight: 600; letter-spacing: .5px; }
.ob-hint { color: var(--dim); font-size: 13px; margin: 10px 4px 0; animation: fadeUp .7s .42s var(--ease) both; }
.onboard .btn-primary { animation: fadeUp .7s .48s var(--ease) both; }

/* ---------- pager ---------- */
#pager { position: absolute; inset: 0; overflow: hidden; }
#track { display: flex; height: 100%; will-change: transform; }
.page { position: relative; flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden; }
.page-scroll {
  height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(var(--sat) + 12px) 18px 0;
  scrollbar-width: none;
}
.page-scroll::-webkit-scrollbar { display: none; }
#homeScroll { padding: 0; }

.page.intro .page-scroll > * { animation: fadeUp .65s var(--ease) both; }
.page.intro .page-scroll > *:nth-child(2) { animation-delay: .04s; }
.page.intro .page-scroll > *:nth-child(3) { animation-delay: .08s; }
.page.intro .page-scroll > *:nth-child(4) { animation-delay: .12s; }
.page.intro .page-scroll > *:nth-child(5) { animation-delay: .16s; }
.page.intro .page-scroll > *:nth-child(6) { animation-delay: .2s; }
.page.intro .page-scroll > *:nth-child(n+7) { animation-delay: .24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: 4px 0 16px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.7px; }
.page-sub { margin: -6px 2px 16px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.head-pill {
  display: flex; flex-direction: column; align-items: flex-end; padding: 6px 14px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line); line-height: 1.15;
}
.head-pill small { font-size: 11px; color: var(--muted); }
.head-pill b { font-size: 15px; font-weight: 600; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px;
  background: #f3f4f6; color: #101215; font-weight: 600; font-size: 14px;
  transition: transform .25s var(--spring);
}
.pill-btn svg { width: 18px; height: 18px; }
.pill-btn:active { transform: scale(.94); }

.sec-label { margin: 22px 2px 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.page-head + .sec-label { margin-top: 6px; }
.nav-spacer { height: calc(var(--sab) + 110px); }

/* ---------- кнопки / поля ---------- */
.btn-primary {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 56px; margin-top: 20px; border-radius: 18px;
  background: #f5f6f8; color: #0d0f12; font-size: 17px; font-weight: 600;
  transition: transform .25s var(--spring), opacity .3s, background .3s;
}
.btn-primary:active:not(:disabled) { transform: scale(.97); }
.btn-primary:disabled { opacity: .32; cursor: default; }
.btn-primary .prog { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: rgba(0,0,0,.08); transition: transform .2s linear; }
.btn-primary.loading { pointer-events: none; }
.btn-primary.loading .btn-txt { opacity: .55; }
.btn-primary.danger { background: var(--red); color: #fff; }
.btn-primary.green { background: var(--green); color: #06210f; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 16px;
  background: var(--glass-2); font-weight: 600; transition: transform .25s var(--spring);
}
.btn-ghost:active { transform: scale(.96); }
.btn-row { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
/* .sheet .btn-row — чтобы перебить «.sheet .btn-primary { margin-top }» ниже: обе кнопки на одной линии */
.btn-row > .btn-ghost, .btn-row > .btn-primary,
.sheet .btn-row > .btn-ghost, .sheet .btn-row > .btn-primary { flex: 1; margin: 0; height: 54px; border-radius: 18px; }

.form-card { background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 2px 16px; }
.field { display: block; padding: 11px 0; }
.form-card .field + .field { border-top: 1px solid var(--line); }
.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.field input {
  width: 100%; border: 0; outline: 0; background: transparent; color: var(--text);
  font-size: 17px; padding: 3px 0; caret-color: #fff;
}
.field input::placeholder { color: var(--dim); }
.field.solo { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; margin-top: 8px; }
.field.err { animation: shake .4s; }
.field.err input { color: #ff8a84; }

.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; cursor: pointer; }
.switch-row input { display: none; }
.switch { position: relative; width: 48px; height: 29px; border-radius: 99px; background: rgba(255,255,255,.16); transition: background .3s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .35s var(--spring); }
.switch-row input:checked + .switch { background: var(--green); }
.switch-row input:checked + .switch::after { transform: translateX(19px); }

/* раскрывающийся блок */
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease), opacity .35s, margin .45s var(--ease); opacity: 0; }
.collapse > .collapse-inner { overflow: hidden; min-height: 0; }
.collapse.open { grid-template-rows: 1fr; opacity: 1; }
#newRecipient.open { margin-top: 4px; }

/* ---------- Продать: получатели ---------- */
.hscroll {
  display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
  margin: 0 -18px; padding: 4px 18px 12px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.hscroll::-webkit-scrollbar { display: none; }
.rc {
  --cc: var(--c0); --ink: #17181a;
  position: relative; flex: none; width: 148px; height: 96px; padding: 12px 13px; border-radius: 20px; overflow: hidden;
  scroll-snap-align: start; text-align: left; background: var(--cc); color: var(--ink);
  transition: transform .4s var(--spring), opacity .3s, box-shadow .3s;
  box-shadow: 0 10px 24px -14px var(--cc);
}
.rc::after { content: ""; position: absolute; right: -26px; bottom: -42px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.22); }
.rc-name { position: relative; z-index: 1; font-size: 13px; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-phone { position: absolute; z-index: 1; left: 13px; bottom: 11px; font-size: 12.5px; font-weight: 600; opacity: .78; }
.rc-check { position: absolute; z-index: 2; right: 9px; top: 9px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #101215; color: #fff; transform: scale(0); transition: transform .35s var(--spring); }
.rc-check svg { width: 13px; height: 13px; }
.hscroll.has-sel .rc:not(.sel) { opacity: .5; transform: scale(.95); }
.rc.sel { transform: translateY(-2px); box-shadow: 0 0 0 2px #fff, 0 14px 28px -12px var(--cc); }
.rc.sel .rc-check { transform: scale(1); }
.rc.new { background: transparent; border: 1.5px dashed rgba(255,255,255,.22); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; box-shadow: none; }
.rc.new::after { display: none; }
.rc.new svg { width: 22px; height: 22px; }
.rc.new.sel { border-style: solid; border-color: #fff; background: rgba(255,255,255,.07); box-shadow: none; }

/* ---------- банки ---------- */
.bank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bank {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 74px; padding: 0 6px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--line); font-size: 13px; font-weight: 500; text-align: center;
  transition: background .3s, color .3s, transform .3s var(--spring), border-color .3s;
}
.bank span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank:active { transform: scale(.95); }
.bank.sel { background: #f5f6f8; color: #111; border-color: transparent; }
.bank-logo { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; letter-spacing: -.3px; }

/* ---------- сумма ---------- */
.amount-box {
  display: flex; align-items: baseline; gap: 6px; padding: 14px 18px; border-radius: 22px; cursor: text;
  background: var(--glass); border: 1px solid var(--line); transition: border-color .3s, background .3s;
}
.amount-box:focus-within { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }
.amount-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 36px; font-weight: 600; letter-spacing: -1px; caret-color: #fff; }
.amount-box input::placeholder { color: var(--dim); }
.amount-cur { font-size: 26px; font-weight: 500; color: var(--muted); }

/* ---------- списки ---------- */
.list > * { margin-bottom: 10px; }
.enter { animation: itemIn .55s var(--ease) backwards; }
@keyframes itemIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); text-align: left; width: 100%; }
.item-main { flex: 1; min-width: 0; }
.item-title { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-amt { font-weight: 600; white-space: nowrap; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--muted); white-space: nowrap; }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.wait { color: #ffd16a; background: rgba(255, 209, 106, .1); }
.status-chip.wait::before { animation: blink 1.2s ease-in-out infinite; }
.status-chip.red { color: #ff7a73; background: rgba(255, 75, 69, .12); }
.status-chip.ok { color: var(--green); background: rgba(47, 210, 122, .1); }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- Купить: реквизиты ---------- */
.req {
  position: relative; display: block; width: 100%; text-align: left; padding: 16px; border-radius: 24px; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  border: 1px solid var(--line); transition: transform .35s var(--spring), opacity .3s;
}
.req:active { transform: scale(.98); }
.req-top { display: flex; align-items: center; gap: 12px; }
.req-ava { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #111; }
.req-who { min-width: 0; }
.req-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.req-phone { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.req-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 16px; }
.req-sum { font-size: 28px; font-weight: 700; letter-spacing: -.8px; line-height: 1; }
.req-sum small { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.req-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--muted); white-space: nowrap; }
.tag svg { width: 12px; height: 12px; }
.tag.ok { color: var(--green); background: rgba(47,210,122,.1); }
.tag.lock { color: #ff9a94; background: rgba(255,75,69,.1); }
.req.lack { opacity: .55; }
.req.lack .req-sum { color: var(--muted); }
.shake { animation: shake .45s; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

/* ---------- пусто ---------- */
.empty { text-align: center; padding: 50px 20px 10px; animation: fadeUp .6s var(--ease) both; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line); color: var(--muted); }
.empty-icon svg { width: 28px; height: 28px; }
.empty-title { font-size: 17px; font-weight: 600; }
.empty-text { color: var(--muted); font-size: 14px; margin: 6px auto 18px; max-width: 280px; line-height: 1.4; }
.empty-cards { position: relative; height: 92px; margin-bottom: 14px; }
.empty-cards i { position: absolute; left: 50%; top: 10px; width: 110px; height: 70px; margin-left: -55px; border-radius: 16px; opacity: .9; }
.empty-cards i:nth-child(1) { background: var(--c0); transform: translateX(-34px) rotate(-10deg); }
.empty-cards i:nth-child(2) { background: var(--c1); }
.empty-cards i:nth-child(3) { background: var(--c2); transform: translateX(34px) rotate(10deg); }

/* ---------- Главная ---------- */
.hero { position: sticky; top: 0; z-index: 0; padding: calc(var(--sat) + 10px) 20px 22px; transform-origin: 50% 0; will-change: transform, opacity; }
.topbar { display: flex; align-items: center; gap: 12px; height: 44px; }
.avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(140deg, #3a4452, #20262e); font-weight: 700; font-size: 16px; border: 1.5px solid rgba(255,255,255,.12);
  transition: transform .3s var(--spring);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar:active { transform: scale(.92); }
.bal-chip { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.bal-label { font-size: 12px; color: var(--muted); }
.bal-val { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.icon-btn { position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; margin-left: auto; transition: transform .3s var(--spring), background .3s; }
.icon-btn:active { transform: scale(.9); background: var(--glass); }
.icon-btn svg { width: 22px; height: 22px; }
@keyframes pop { from { transform: scale(0); } }

.rate-wrap { margin-top: 30px; padding-right: 70px; }
.rate-label { font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.rate { display: flex; align-items: baseline; flex-wrap: wrap; font-size: 50px; font-weight: 600; letter-spacing: -1.6px; line-height: 1.05; white-space: nowrap; }
.rate .r-frac { font-size: 26px; color: var(--muted); letter-spacing: -.4px; margin-left: 2px; }
.rate .r-sep { font-weight: 300; color: var(--dim); margin: 0 10px; font-size: 40px; }
.rate .r-main.empty { color: var(--dim); }
.rate-meta { margin-top: 8px; font-size: 12.5px; color: var(--dim); min-height: 16px; }
.rate.bump { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.04); } }

.peek { position: absolute; right: 0; top: calc(var(--sat) + 84px); width: 64px; height: 124px; animation: peekIn .9s .2s var(--spring) backwards; }
.peek .pk { position: absolute; top: 0; width: 80px; height: 124px; border-radius: 16px; box-shadow: -6px 0 18px rgba(0,0,0,.28); transition: transform .5s var(--spring); }
.peek .pk0 { left: 0;  background: var(--pk0, var(--c0)); }
.peek .pk1 { left: 16px; background: var(--pk1, var(--c1)); }
.peek .pk2 { left: 32px; background: var(--pk2, var(--c2)); }
.peek:active .pk1 { transform: translateX(-4px); }
.peek:active .pk0 { transform: translateX(-8px); }
@keyframes peekIn { from { transform: translateX(80px); } }

.spending {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding: 14px 16px; border-radius: 22px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.sp-label { font-size: 14px; color: var(--muted); }
.sp-val { font-size: 19px; font-weight: 600; margin-top: 2px; letter-spacing: -.3px; }
.bubbles { display: flex; align-items: center; padding-left: 10px; }
.bubble { width: 36px; height: 36px; margin-left: -10px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; border: 2.5px solid #1a1f25; animation: pop .5s var(--spring) both; }
.bubble.more { background: #2a3038; color: var(--muted); font-size: 11px; }

/* белая шторка транзакций */
.tx-sheet {
  position: relative; z-index: 2; background: #fff; color: #15171a; border-radius: 30px 30px 0 0;
  padding: 8px 16px 0; min-height: calc(var(--vh) - var(--sat) - 12px);
  box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
.handle { width: 38px; height: 4px; border-radius: 4px; background: #e2e4e8; margin: 0 auto 6px; }
.tx-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 10px; }
.mini-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #f2f3f5; color: #6b7078; transition: transform .25s var(--spring), background .3s, color .3s; }
.mini-btn svg { width: 18px; height: 18px; }
.mini-btn:active { transform: scale(.9); }
.mini-btn.on { background: #15171a; color: #fff; }
.tx-title { display: flex; flex-direction: column; align-items: center; font-weight: 600; font-size: 16px; }
.tx-title small { font-size: 11.5px; font-weight: 500; color: #8a9099; height: 0; overflow: hidden; transition: height .3s var(--ease); }
.tx-title small.show { height: 15px; }
.tx-search { width: 100%; height: 42px; margin: 2px 0 8px; padding: 0 14px; border-radius: 14px; border: 0; outline: 0; background: #f2f3f5; color: #15171a; font-size: 15px; }
.tx-day { font-size: 12.5px; color: #8a9099; font-weight: 600; padding: 12px 2px 2px; }
.tx { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 2px; text-align: left; border-radius: 14px; transition: background .2s; }
.tx:active { background: #f4f5f7; }
.tx-ico { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.tx-ico i { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #fff; }
.tx-main { flex: 1; min-width: 0; }
.tx-name { display: block; font-size: 15px; font-weight: 500; color: #23262b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { display: block; font-size: 12.5px; color: #8a9099; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-size: 15px; font-weight: 600; white-space: nowrap; color: #23262b; }
.tx-amt.plus { color: var(--green-ink); }
.tx-amt.muted { color: #a3a8af; }
.tx-amt.strike { color: #b4b8be; text-decoration: line-through; }
.tx-empty { text-align: center; color: #9aa0a8; padding: 40px 0 10px; font-size: 14px; }

/* ---------- Карты ---------- */
.pcards { padding-top: 2px; }
.pcard {
  --cc: var(--c0); --ink: 23, 24, 26;
  position: relative; height: 172px; margin-bottom: 18px; padding: 18px 18px 16px; border-radius: 26px; overflow: hidden;
  background: var(--cc); color: rgb(var(--ink));
  box-shadow: 0 18px 34px -18px var(--cc), 0 2px 0 rgba(255,255,255,.25) inset;
}
.pcard::before { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; bottom: -150px; border-radius: 50%; background: rgba(255,255,255,.2); }
.pcard::after { content: ""; position: absolute; width: 190px; height: 190px; left: -60px; top: -110px; border-radius: 50%; background: rgba(255,255,255,.12); }
.pcard > * { position: relative; z-index: 1; }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pc-name { font-size: 15px; font-weight: 600; opacity: .78; line-height: 1.25; max-width: 70%; }
.pc-last { font-size: 14px; font-weight: 600; opacity: .7; white-space: nowrap; letter-spacing: .3px; }
.pc-phone { margin-top: 18px; font-size: 23px; font-weight: 700; letter-spacing: .2px; }
.pc-bottom { position: absolute; left: 14px; right: 18px; bottom: 14px; display: flex; align-items: center; }
.pc-act { width: 40px; height: 40px; margin-right: 8px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--ink), .12); color: rgb(var(--ink)); transition: transform .3s var(--spring), background .2s; }
.pc-act svg { width: 18px; height: 18px; }
.pc-act:active { transform: scale(.88); background: rgba(var(--ink), .22); }
.pc-dots { margin-left: auto; display: flex; }
.pc-dots i { width: 22px; height: 22px; border-radius: 50%; background: rgba(var(--ink), .22); }
.pc-dots i + i { margin-left: -9px; background: rgba(var(--ink), .1); }
.pcard.removing { transition: transform .45s var(--ease), opacity .35s; transform: translateX(-30%) scale(.9) rotate(-4deg); opacity: 0; }

.color-0 { --cc: var(--c0); } .color-1 { --cc: var(--c1); } .color-2 { --cc: var(--c2); --ink: 255, 255, 255; }
.color-3 { --cc: var(--c3); --ink: 255, 255, 255; } .color-4 { --cc: var(--c4); } .color-5 { --cc: var(--c5); }

/* ---------- навигация ---------- */
#nav {
  position: absolute; z-index: 20; left: 50%; bottom: calc(var(--sab) + 14px); transform: translateX(-50%);
  display: flex; padding: 6px; border-radius: 30px;
  background: rgba(24, 27, 32, .9); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 14px 34px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.06);
  transition: transform .5s var(--ease), opacity .4s;
  animation: navIn .8s .15s var(--spring) backwards;
}
@keyframes navIn { from { transform: translate(-50%, 120px); } }
#nav.away { transform: translate(-50%, 140px); }
#nav button { position: relative; z-index: 1; width: 58px; height: 46px; border-radius: 23px; display: grid; place-items: center; color: #8d929a; transition: color .35s; }
#nav button svg { width: 23px; height: 23px; transition: transform .35s var(--spring); }
#nav button:active svg { transform: scale(.85); }
#nav button.on { color: #111317; }
.nav-ind { position: absolute; top: 6px; left: 6px; width: 58px; height: 46px; border-radius: 23px; background: #f4f5f7; transition: transform .5s var(--spring); will-change: transform; }

/* ---------- окно сделки ---------- */
.deal {
  position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg);
  transform: translateX(100%); visibility: hidden; transition: transform .55s var(--ease), visibility 0s .55s;
}
.deal::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 40% at 100% 0%, rgba(43,156,244,.12), transparent 70%); pointer-events: none; }
.deal.open { transform: none; visibility: visible; transition: transform .55s var(--ease), visibility 0s; }
.deal-head { position: relative; display: flex; align-items: center; gap: 8px; padding: calc(var(--sat) + 8px) 14px 12px; border-bottom: 1px solid var(--line); }
.deal-head .icon-btn { margin-left: 0; }
.deal-titles { flex: 1; min-width: 0; }
.deal-title { font-weight: 700; font-size: 17px; }
.deal-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.deal-amount { font-weight: 700; font-size: 17px; white-space: nowrap; }
.deal-body { position: relative; flex: 1; overflow-y: auto; padding: 14px 14px 6px; -webkit-overflow-scrolling: touch; }
.deal-foot { position: relative; padding: 10px 14px calc(var(--sab) + 14px); }
.deal-foot:empty { padding: 0 0 var(--sab); }

.msg { position: relative; max-width: 86%; margin: 8px 0; padding: 11px 14px 9px; border-radius: 20px; line-height: 1.38; animation: msgIn .5s var(--ease) both; }
.msg.out { margin-left: auto; background: #2b8ff0; color: #fff; border-bottom-right-radius: 6px; transform-origin: 100% 100%; }
.msg.in { background: #1c2026; border-bottom-left-radius: 6px; transform-origin: 0 100%; }
.msg.bad { background: rgba(255,75,69,.14); color: #ffb0ab; }
.msg-title { font-weight: 600; margin-bottom: 6px; }
.msg-time { display: block; text-align: right; font-size: 11px; opacity: .55; margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { opacity: .62; }
.kv dd { margin: 0; font-weight: 600; text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.copy { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.1); flex: none; transition: transform .25s var(--spring), background .2s; }
.copy svg { width: 14px; height: 14px; }
.copy:active { transform: scale(.85); }
.copy.done { background: var(--green); color: #06210f; }
.msg-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 2px -6px 4px; }
.msg-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
@keyframes msgIn { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
.sys { width: fit-content; max-width: 90%; margin: 14px auto; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.06); color: var(--muted); font-size: 12.5px; text-align: center; animation: msgIn .5s var(--ease) both; }
.sys.ok { color: var(--green); background: rgba(47,210,122,.1); }
.typing { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: dot 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }

.alert-red {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 13px 14px; border-radius: 18px;
  background: rgba(255, 59, 48, .12); border: 1px solid rgba(255, 75, 69, .55); color: #ff6d66; font-weight: 600; font-size: 15px;
  animation: redGlow 1.6s ease-in-out infinite;
}
.alert-red .pulse { position: relative; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
.alert-red .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--red); animation: ping 1.6s cubic-bezier(0,0,.2,1) infinite; }
.alert-red small { display: block; font-weight: 500; font-size: 12.5px; color: rgba(255, 140, 134, .85); margin-top: 1px; }
@keyframes redGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 59, 48, .18); border-color: rgba(255, 75, 69, .45); }
  50% { box-shadow: 0 0 28px rgba(255, 59, 48, .45); border-color: rgba(255, 75, 69, .95); }
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
.alert-ok { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 13px 14px; border-radius: 18px; background: rgba(47,210,122,.1); border: 1px solid rgba(47,210,122,.4); color: var(--green); font-weight: 600; animation: msgIn .5s var(--ease) both; }
.alert-ok svg { width: 22px; height: 22px; }

.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shot { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--glass); border: 1px solid var(--line); animation: pop .4s var(--spring) both; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .x { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; }
.shot .x svg { width: 12px; height: 12px; }
.shot.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed rgba(255,255,255,.25); background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; animation: none; }
.shot.add svg { width: 22px; height: 22px; }

.checks { display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow-y: auto; }
.chk { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.chk .shot { flex: none; width: 58px; height: 58px; aspect-ratio: auto; border-radius: 14px; }
.chk .shot.add { font-size: 0; gap: 0; }
.chk-main { flex: 1; min-width: 0; }
.chk-label { font-size: 12px; color: var(--muted); }
.chk-amt { display: flex; align-items: baseline; gap: 4px; }
.chk-amt input { width: 100%; border: 0; outline: 0; background: none; color: var(--text); font-size: 20px; font-weight: 600; padding: 2px 0; caret-color: #fff; }
.chk-amt input::placeholder { color: var(--dim); }
.chk-amt span { color: var(--muted); font-weight: 500; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 4px 0; font-size: 14px; color: var(--muted); }
.total-row b { color: var(--text); font-size: 16px; }
.total-row.warn b { color: #ffd16a; }
.total-row.good b { color: var(--green); }

/* ---------- шторки (модальные окна) ---------- */
.sheet-wrap { position: absolute; inset: 0; z-index: 60; }
.sheet-bd { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .45s var(--ease); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--sat) - 20px); overflow-y: auto;
  padding: 10px 18px calc(var(--sab) + 18px); border-radius: 30px 30px 0 0; background: #171a1f;
  box-shadow: 0 -20px 50px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translateY(100%); transition: transform .55s var(--sheet);
  overscroll-behavior: contain; scrollbar-width: none;
}
.sheet-wrap.open .sheet-bd { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.18); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.4px; }
.sheet .sheet-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.sheet .btn-primary { margin-top: 18px; }
.colors { display: flex; gap: 12px; padding: 14px 2px 4px; }
.colors button { width: 34px; height: 34px; border-radius: 50%; background: var(--cc); transition: transform .3s var(--spring), box-shadow .3s; }
.colors button.sel { transform: scale(1.12); box-shadow: 0 0 0 3px #171a1f, 0 0 0 5px #fff; }
.preview-card { height: 150px; margin-bottom: 16px; transition: background .4s, box-shadow .4s; }
.preview-card .pc-phone { margin-top: 26px; }

.req-detail .big-sum { font-size: 44px; font-weight: 700; letter-spacing: -1.4px; margin: 6px 0 2px; }
.req-detail .big-sum small { font-size: 26px; color: var(--muted); font-weight: 500; }
.detail-list { margin-top: 16px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); padding: 2px 14px; }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; }
.detail-row + .detail-row { border-top: 1px solid var(--line); }
.detail-row span { color: var(--muted); font-size: 14px; }
.detail-row b { font-weight: 600; text-align: right; display: flex; align-items: center; gap: 8px; }
.note { display: flex; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 209, 106, .08); color: #f3d38a; font-size: 13px; line-height: 1.4; }
.note svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.profile-name { font-size: 19px; font-weight: 700; }
.profile-un { color: var(--muted); font-size: 14px; }
.copy.edit svg { width: 15px; height: 15px; }
.uid-hint { margin: 10px 4px 0; color: var(--dim); font-size: 13px; line-height: 1.4; }

/* ---------- toast ---------- */
.toast {
  position: absolute; z-index: 90; left: 50%; top: calc(var(--sat) + 10px); max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: 16px; background: rgba(36, 40, 47, .94); color: #fff; font-size: 14px; font-weight: 500;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 30px rgba(0,0,0,.4);
  transform: translate(-50%, -140%); opacity: 0; transition: transform .5s var(--spring), opacity .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: rgba(120, 26, 22, .95); }
.toast.ok { background: rgba(16, 92, 52, .95); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 560px) {
  .page-scroll { padding-left: calc(50% - 250px); padding-right: calc(50% - 250px); }
  .hscroll { margin: 0; padding-left: 0; padding-right: 0; }
  .hero { padding-left: calc(50% - 250px); padding-right: calc(50% - 250px); }
  .tx-sheet { margin: 0 calc(50% - 270px); }
  .sheet { left: calc(50% - 260px); right: calc(50% - 260px); }
}
