:root {
  --bg: #050a19;
  --bg2: #081028;
  --surface: #0c1532;
  --surface2: #101c40;
  --surface3: #15244f;
  --line: rgba(110, 150, 255, .13);
  --line2: rgba(110, 150, 255, .22);
  --text: #eaf0ff;
  --muted: #8b9cc6;
  --dim: #5c6c98;
  --accent: #3b7bff;
  --accent2: #6aa9ff;
  --grad: linear-gradient(135deg, #5aa8ff 0%, #2f6bff 55%, #1e43dc 100%);
  --ok: #34d399;
  --bad: #ff5d73;
  --warn: #ffb547;
  --r: 18px;
  --r2: 14px;
  --shadow: 0 10px 30px rgba(0, 8, 40, .45);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.42 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 420px at 85% -120px, rgba(47, 107, 255, .28), transparent 60%),
    radial-gradient(700px 380px at -10% 10%, rgba(90, 168, 255, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.ic { width: 22px; height: 22px; flex: 0 0 auto; }
.ic.sm { width: 18px; height: 18px; }
.ic.lg { width: 28px; height: 28px; }

/* ── шапка ── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 10px;
  background: linear-gradient(180deg, rgba(5, 10, 25, .96), rgba(5, 10, 25, .82));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.top .brand b { font-size: 17px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.bal-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 10px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--line2);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.bal-pill .ic { color: var(--accent2); width: 18px; height: 18px; }
.bal-pill .plus { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); }
.bal-pill .plus .ic { color: #fff; width: 14px; height: 14px; }

/* ── контент ── */
#view { padding: 14px 16px calc(96px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.screen { animation: in .22s ease; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h1 { font-size: 24px; margin: 4px 0 4px; letter-spacing: -.2px; }
h2 { font-size: 17px; margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; }
h2 .link { font-size: 13px; color: var(--accent2); font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── карточки ── */
.card {
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 20px;
  background: var(--grad); box-shadow: 0 16px 40px rgba(28, 74, 230, .45);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(260px 160px at 100% 0%, rgba(255, 255, 255, .28), transparent 70%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .06) 0 2px, transparent 2px 18px);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero .lbl { font-size: 13px; opacity: .85; font-weight: 600; }
.hero .amt { font-size: 38px; font-weight: 800; letter-spacing: -1px; margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.hero .amt span { font-size: 24px; opacity: .85; margin-left: 4px; }
.hero .acts { display: flex; gap: 10px; }
.hero .acts .btn { flex: 1; }
.cash { margin-top: 14px; font-size: 13px; }
.cash .bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .22); margin-top: 6px; overflow: hidden; }
.cash .bar i { display: block; height: 100%; border-radius: 6px; background: #fff; }

/* ── кнопки ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 14px;
  font-weight: 700; font-size: 15px; transition: transform .12s, opacity .2s, filter .2s;
  background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(47, 107, 255, .35);
  user-select: none; white-space: nowrap; min-width: 0;
}
.btns .btn.sm { padding: 0 10px; font-size: 13.5px; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface2); border: 1px solid var(--line2); box-shadow: none; color: var(--text); }
.btn.white { background: #fff; color: #1d3bd8; box-shadow: none; }
.btn.glass { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); box-shadow: none; }
.btn.danger { background: rgba(255, 93, 115, .14); color: #ff8b9b; border: 1px solid rgba(255, 93, 115, .3); box-shadow: none; }
.btn.ok { background: linear-gradient(135deg, #3fe0a4, #13b57c); box-shadow: 0 8px 22px rgba(19, 181, 124, .3); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btns { display: flex; gap: 10px; margin-top: 14px; }
.btns .btn { flex: 1; }

/* ── быстрые действия ── */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 4px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.qa .bub { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.qa:active { transform: scale(.96); }

/* ── списки ── */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; border-bottom: 1px solid var(--line); background: transparent;
}
.item:last-child { border-bottom: 0; }
.item:active { background: rgba(110, 150, 255, .07); }
.item .t { font-weight: 600; }
.item .s { color: var(--muted); font-size: 13px; }
.item .end { margin-left: auto; text-align: right; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.item .chev { color: var(--dim); width: 18px; height: 18px; }
.price { font-weight: 800; font-variant-numeric: tabular-nums; }
.price s { color: var(--dim); font-weight: 600; font-size: 12px; margin-right: 4px; }
.flag { font-size: 24px; width: 34px; text-align: center; flex: 0 0 34px; line-height: 1; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.bub { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px; }
.tint-blue { background: rgba(59, 123, 255, .16); color: #7fb3ff; }
.tint-green { background: rgba(52, 211, 153, .14); color: #5be3b0; }
.tint-violet { background: rgba(139, 123, 255, .16); color: #a99cff; }
.tint-amber { background: rgba(255, 181, 71, .15); color: #ffc874; }
.tint-pink { background: rgba(255, 93, 140, .15); color: #ff8fb0; }
.tint-cyan { background: rgba(56, 182, 255, .15); color: #6fd0ff; }

/* ── поиск, чипы, табы ── */
.search {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line2); margin-bottom: 12px;
}
.search .ic { color: var(--muted); }
.search input { flex: 1; background: transparent; border: 0; outline: 0; font-size: 15px; min-width: 0; }
.search input::placeholder { color: var(--dim); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: rgba(59, 123, 255, .18); border-color: rgba(106, 169, 255, .5); color: #cfe0ff; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; height: 36px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--surface3); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }

/* ── большие карточки выбора ── */
.tiles { display: grid; gap: 12px; }
.tile {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px; border-radius: var(--r); background: linear-gradient(160deg, var(--surface2), var(--surface));
  border: 1px solid var(--line);
}
.tile:active { transform: scale(.985); }
.tile .bub { width: 48px; height: 48px; border-radius: 15px; flex-basis: 48px; }
.tile .t { font-weight: 700; font-size: 16px; }
.tile .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile.feat { border-color: rgba(106, 169, 255, .45); box-shadow: 0 0 0 1px rgba(106, 169, 255, .15), var(--shadow); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: rgba(59, 123, 255, .2); color: #a9c8ff;
}
.badge.ok { background: rgba(52, 211, 153, .16); color: #6fe6b9; }
.badge.bad { background: rgba(255, 93, 115, .16); color: #ff9aa8; }
.badge.warn { background: rgba(255, 181, 71, .16); color: #ffcb7d; }

/* ── заказ ── */
.order { padding: 16px; }
.order .head { display: flex; align-items: center; gap: 12px; }
.order .phone {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding: 14px; border-radius: 14px;
  background: var(--bg2); border: 1px dashed var(--line2);
  font-size: 22px; font-weight: 800; letter-spacing: .5px; font-variant-numeric: tabular-nums;
}
.copybtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface3); color: var(--accent2); flex: 0 0 40px; }
.copybtn:active { transform: scale(.92); }
.code {
  margin-top: 12px; padding: 16px; border-radius: 16px; text-align: center;
  background: linear-gradient(135deg, rgba(52, 211, 153, .18), rgba(52, 211, 153, .06));
  border: 1px solid rgba(52, 211, 153, .4); animation: pop .4s ease;
}
.code .v { font-size: 34px; font-weight: 900; letter-spacing: 6px; font-variant-numeric: tabular-nums; color: #b7f5dc; }
.code .l { font-size: 12px; color: #7fe3bd; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.wait { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(59, 123, 255, .1); border: 1px solid rgba(106, 169, 255, .25); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 0 0 rgba(106, 169, 255, .6); animation: pulse 1.6s infinite; flex: 0 0 10px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(106, 169, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(106, 169, 255, 0); } }
.timer { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin-top: 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 36px; font-size: 14px; color: #cdd8f5; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface3); color: var(--accent2);
}
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: #c6d2f2; margin-top: 12px; }
.note .ic { color: var(--accent2); width: 20px; height: 20px; margin-top: 1px; }
.note.warn { border-color: rgba(255, 181, 71, .35); background: rgba(255, 181, 71, .07); }
.note.warn .ic { color: var(--warn); }
.mailtext { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; color: #c8d3f0; white-space: pre-wrap; max-height: 220px; overflow: auto; }

/* ── нижнее меню ── */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + var(--safe-b));
  background: linear-gradient(180deg, rgba(8, 14, 34, .9), rgba(5, 10, 25, .98));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; flex: 1; max-width: 90px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0 2px; font-size: 11px; font-weight: 600; color: var(--dim);
}
.tab .ic { width: 24px; height: 24px; transition: transform .2s; }
.tab.on { color: #dbe7ff; }
.tab.on .ic { color: var(--accent2); transform: translateY(-1px); filter: drop-shadow(0 4px 10px rgba(59, 123, 255, .55)); }
.tab.on::before { content: ""; position: absolute; top: -9px; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--grad); }
.tab .dot { position: absolute; top: 2px; right: calc(50% - 18px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }

/* ── шторка ── */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(2, 6, 18, .6); backdrop-filter: blur(3px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 88vh; overflow: auto;
  padding: 10px 18px calc(18px + var(--safe-b)); border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #111d42, #0a1330); border-top: 1px solid var(--line2);
  animation: up .26s cubic-bezier(.2, .9, .3, 1); max-width: 640px; margin: 0 auto;
}
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 19px; }

/* ── поля ── */
.field { display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 16px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--line2); margin-top: 12px; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.field span { font-size: 22px; font-weight: 800; color: var(--muted); }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.method {
  display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); text-align: left; font-weight: 700; font-size: 14px;
}
.method.on { border-color: rgba(106, 169, 255, .6); background: rgba(59, 123, 255, .12); box-shadow: 0 0 0 1px rgba(106, 169, 255, .25); }
.method .bub { width: 36px; height: 36px; border-radius: 11px; flex-basis: 36px; }

/* ── переключатель ── */
.switch { position: relative; width: 48px; height: 28px; border-radius: 14px; background: var(--surface3); flex: 0 0 48px; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #c9d6f7; transition: transform .2s, background .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); background: #fff; }

/* ── пусто / загрузка / тосты ── */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .bub { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px; }
.empty .bub .ic { width: 30px; height: 30px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.skel { height: 64px; border-radius: 14px; margin-bottom: 10px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 80; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px;
  background: #16244f; border: 1px solid var(--line2); box-shadow: var(--shadow); animation: tin .25s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.ok .ic { color: var(--ok); }
.toast.bad { border-color: rgba(255, 93, 115, .45); }
.toast.bad .ic { color: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translate(-50%, -10px); } }
.wall { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.wall .logo-big { margin-bottom: 18px; filter: drop-shadow(0 16px 40px rgba(47, 107, 255, .5)); }
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; background: rgba(255, 181, 71, .1); border: 1px solid rgba(255, 181, 71, .35); color: #ffd79a; font-size: 13.5px; font-weight: 600; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .ava { width: 64px; height: 64px; border-radius: 20px; background: var(--grad); display: grid; place-items: center; font-size: 26px; font-weight: 800; overflow: hidden; flex: 0 0 64px; }
.profile-head .ava img { width: 100%; height: 100%; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { padding: 12px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); text-align: center; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.reflink { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line2); font-size: 13px; color: #c9d6f7; }
.more-btn { display: block; margin: 12px auto 0; color: var(--accent2); font-weight: 700; font-size: 14px; padding: 8px 14px; }
.btn.off { background: var(--surface3); box-shadow: none; color: var(--muted); }
