/* ============================================================
   Валлет mini app — dark UI, coral + periwinkle accents
   ============================================================ */

:root {
  --bg: #0f1729;
  --bg-deep: #0b1220;
  --panel: #1b2742;
  --panel-2: #223154;
  --panel-3: #182338;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f6ff;
  --muted: #8e9ab8;
  --muted-2: #6f7c99;
  --blue: #6f8dff;
  --blue-2: #5b7cff;
  --blue-ink: #3653c9;
  --coral: #ff6b6b;
  --white: #f6f7fb;
  --ink: #1a2336;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(140% 55% at 50% -12%, rgba(58, 92, 175, 0.28) 0%, rgba(15, 23, 41, 0) 62%),
    var(--bg);
  touch-action: manipulation;
}

body.no-scroll { overflow: hidden; }

button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg use { pointer-events: none; }
#i-mark, #i-mark * { stroke: none; }

/* ---------------- splash ---------------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity 0.35s ease, visibility 0.35s;
}
.splash.is-hidden { opacity: 0; visibility: hidden; }
.splash__logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #7b97ff, #5479ff);
  box-shadow: 0 16px 40px rgba(91, 124, 255, 0.35);
  animation: breathe 2.4s ease-in-out infinite;
}
.splash__logo svg { width: 34px; height: 34px; fill: currentColor; }
.splash__name { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; }
.splash__bar { width: 92px; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.splash__bar i { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--coral); animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-110%); } 100% { transform: translateX(280%); } }
@keyframes breathe { 50% { transform: translateY(-3px) scale(1.02); } }

/* ---------------- layout ---------------- */

.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(92px + var(--safe-b));
  position: relative;
}
main { display: block; }

@media (min-width: 560px) {
  .app { border-left: 1px solid rgba(255, 255, 255, 0.04); border-right: 1px solid rgba(255, 255, 255, 0.04); }
}

.screen {
  padding: 14px 18px 24px;
  animation: fade-up 0.28s ease both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

h1, h2, h3, p { margin: 0; }

.page-title {
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.01em;
  margin: 8px 0 22px;
}
.page-title--tight { margin-bottom: 24px; }

.subhead {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.subhead--account { margin-top: 24px; }

.caption {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 6px 0 12px;
}

/* ---------------- top bar / avatars ---------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 0 16px;
}
.topbar__name {
  font-size: 14.5px;
  font-weight: 600;
  color: #e9eefb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #d5deef;
  display: grid;
  place-items: center;
  transition: background 0.18s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); }
.icon-btn--dark { margin-left: auto; background: rgba(255, 255, 255, 0.06); width: 34px; height: 34px; }
.icon-btn--dark svg { width: 18px; height: 18px; }

.avatar {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #3d5cb8, #6f8dff);
  color: #fff;
  font-weight: 700;
  font-size: 30px;
  flex: none;
}
.avatar--sm { width: 40px; height: 40px; font-size: 16px; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------------- home: news stories ---------------- */

.stories-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 1px 11px;
}
.stories-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.stories-head span { font-size: 11.5px; color: var(--muted); }

.stories {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78px;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 18px;
  scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }

.story {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  text-align: center;
}
.story__ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  display: block;
  background: conic-gradient(from 210deg, #ff8a5b, #ff5d7a, #7b97ff, #61e0ff, #ff8a5b);
  transition: transform 0.18s, filter 0.18s, background 0.2s;
}
.story__inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(85% 85% at 35% 18%, #2c416d, #17233d 72%);
  border: 2px solid var(--bg);
  color: #fff;
}
.story__inner svg { width: 25px; height: 25px; stroke-width: 1.8; }
.story__ring--coral .story__inner { color: #ffaaa2; }
.story__ring--blue { background: conic-gradient(from 230deg, #6f8dff, #61e0ff, #a78bfa, #6f8dff); }
.story__ring--blue .story__inner { color: #9db5ff; }
.story__ring--green { background: conic-gradient(from 200deg, #6ee7b7, #61e0ff, #6f8dff, #6ee7b7); }
.story__ring--green .story__inner { color: #8cf0cb; }
.story__ring--violet { background: conic-gradient(from 220deg, #b18cff, #7b97ff, #ff7ac8, #b18cff); }
.story__ring--violet .story__inner { color: #c4a9ff; }
.story:active .story__ring { transform: scale(0.96); }
.story__label {
  max-width: 78px;
  font-size: 10.5px;
  line-height: 1.22;
  color: #c9d3e9;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story__dot {
  position: absolute;
  top: 1px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid var(--bg);
}
.story.is-read .story__ring {
  background: rgba(255, 255, 255, 0.15);
  filter: saturate(0.2);
}
.story.is-read .story__inner { color: #90a0be; }
.story.is-read .story__label { color: #8998b4; }

/* ---------------- balances ---------------- */

.balance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 2px 0 4px;
}

.balance {
  position: relative;
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  min-width: 0;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: filter 0.25s;
}
.balance--main {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(155deg, #7e9aff 0%, #5f81f9 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(68, 102, 220, 0.25);
}
.balance__top { height: 16px; }
.mark { width: 26px; height: 26px; fill: currentColor; color: #fff; stroke: none; }
.mark--sm { width: 15px; height: 15px; }
.balance__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #eef3ff;
  height: 26px;
}
.balance__amount {
  font-size: clamp(36px, 10.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-top: 9px;
  line-height: 1.02;
  white-space: nowrap;
}
.balance__rub {
  font-size: 12.5px;
  opacity: 0.78;
  margin-top: 3px;
  min-height: 16px;
}
.balance__bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
}
.eye {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue-ink);
  display: grid;
  place-items: center;
  flex: none;
}
.eye svg { width: 15px; height: 15px; stroke-width: 2; }
.rate {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.82);
}
.rate svg { width: 14px; height: 14px; stroke-width: 1.7; }

.balance-row.is-masked .balance__amount,
.balance-row.is-masked .balance__rub { filter: blur(8px); }

/* ---------------- quick actions ---------------- */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.qa { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qa__icon {
  width: 60px;
  height: 60px;
  border-radius: 17px;
  background: #1b2540;
  border: 1px solid rgba(255, 255, 255, 0.035);
  display: grid;
  place-items: center;
  color: #f0f4ff;
  transition: background 0.2s, transform 0.15s;
}
.qa__icon svg { width: 25px; height: 25px; stroke-width: 1.8; }
.qa__label { font-size: 12.5px; color: #e7ecf8; font-weight: 500; }
.qa:active .qa__icon { transform: scale(0.95); background: #223052; }

/* ---------------- promo ---------------- */

.promo {
  margin-top: 24px;
  background: #f2f4f9;
  border-radius: 20px;
  padding: 10px 10px 0;
  overflow: hidden;
}
.promo__card {
  position: relative;
  border-radius: 15px;
  background:
    radial-gradient(120% 140% at 100% 15%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, #83a0ff 0%, #5d81ff 100%);
  min-height: 124px;
  padding: 15px 16px;
  overflow: hidden;
}
.promo__text { position: relative; z-index: 1; max-width: 66%; }
.promo__title { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.promo__sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.82); margin-top: 3px; }
.promo__btn {
  margin-top: 11px;
  background: #fff;
  color: #26375e;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 17px;
  border-radius: 99px;
  transition: transform 0.15s;
}
.promo__btn:active { transform: scale(0.96); }
.promo__mascot {
  position: absolute;
  right: -6px;
  bottom: -12px;
  width: 122px;
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(23, 42, 94, 0.25));
}
.dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px 0 9px;
}
.dots i { width: 5px; height: 5px; border-radius: 50%; background: #c8d0e2; }
.dots i.on { background: #5b7cff; }

/* ---------------- history ---------------- */

.history-empty {
  min-height: 58vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 40px;
}
.history-empty h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.history-empty p { font-size: 13.5px; color: var(--muted); margin-top: 7px; }
.add-card {
  margin-top: 28px;
  width: 92px;
  height: 92px;
  border-radius: 22px;
  background: #f4f6fb;
  color: #1f2a42;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s;
}
.add-card:active { transform: scale(0.96); }
.add-card svg { width: 27px; height: 27px; color: #6f8dff; stroke-width: 2; }
.add-card span { font-size: 12.5px; font-weight: 600; }

.tx-list { display: flex; flex-direction: column; gap: 9px; padding-top: 2px; }
.tx {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #1a2540;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 15px;
  padding: 11px 13px;
}
.tx__ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(111, 141, 255, 0.14);
  color: var(--blue);
  flex: none;
}
.tx__ico svg { width: 19px; height: 19px; }
.tx--out .tx__ico { background: rgba(255, 107, 107, 0.12); color: var(--coral); }
.tx__body { min-width: 0; flex: 1; }
.tx__title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx__date { font-size: 11px; color: var(--muted); margin-top: 3px; }
.tx__amount { text-align: right; flex: none; }
.tx__usd { font-size: 14px; font-weight: 700; }
.tx--in .tx__usd { color: #8fa8ff; }
.tx--out .tx__usd { color: #ff9c9c; }
.tx__rub { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* ---------------- services screen ---------------- */

.scards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 166px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.scards::-webkit-scrollbar { display: none; }

.scard {
  position: relative;
  height: 224px;
  border-radius: 17px;
  overflow: hidden;
  padding: 15px;
  text-align: left;
  background: linear-gradient(150deg, #2e4477, #22345e);
  isolation: isolate;
  transition: transform 0.16s;
}
.scard:active { transform: scale(0.98); }
.scard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 16, 34, 0.7) 0%, rgba(8, 16, 34, 0.04) 50%, rgba(8, 16, 34, 0.16) 100%);
  z-index: 1;
}
.scard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.4s;
}
.scard:hover img { transform: scale(1.03); }
.scard__text { position: relative; z-index: 2; }
.scard__title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.scard__sub { font-size: 11.5px; line-height: 1.35; color: rgba(255, 255, 255, 0.8); margin-top: 5px; max-width: 120px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f4f6fb;
  border-radius: 12px;
  height: 48px;
  padding: 5px 6px 5px 15px;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #24304a;
  font-size: 14px;
}
.search input::placeholder { color: #6d788c; }
.search input::-webkit-search-cancel-button { display: none; }
.search__btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #6f8dff;
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.search__btn svg { width: 19px; height: 19px; stroke-width: 2; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 11px 0 20px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 35px;
  padding: 0 16px;
  border-radius: 99px;
  background: #f3f5fb;
  color: #5f7fe8;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.18s, color 0.18s;
}
.chip.is-active { background: #6f8dff; color: #fff; }

.functions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 12px;
}
.functions-head h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.functions-head__ico { width: 21px; height: 21px; color: #c9d2e8; }

.functions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.fn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1d2a49;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 13px;
  padding: 10px 11px;
  text-align: left;
  min-height: 54px;
  transition: background 0.18s, transform 0.14s;
}
.fn:hover { background: #233256; }
.fn:active { transform: scale(0.98); }
.fn__ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #4364bd;
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.fn__ico svg { width: 16px; height: 16px; stroke-width: 1.9; }
.fn__label { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.fn-empty {
  grid-column: 1 / -1;
  padding: 26px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty-inline {
  padding: 26px 16px;
  border-radius: 14px;
  background: #1a2540;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  min-width: 100%;
}

/* ---------------- profile ---------------- */

.profile-card {
  margin-top: 52px;
  position: relative;
  border-radius: 22px;
  padding: 52px 14px 16px;
  text-align: center;
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(145deg, #7f9bff, #5b7eff);
  box-shadow: 0 18px 38px rgba(61, 92, 196, 0.22);
}
.profile-card__avatar {
  position: absolute;
  top: -43px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid var(--bg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  width: 86px;
  height: 86px;
}
.profile-card__name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.profile-card__id {
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.copy { color: rgba(255, 255, 255, 0.9); display: grid; place-items: center; }
.copy svg { width: 15px; height: 15px; stroke-width: 1.7; }
.profile-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.white-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: #f8f9fd;
  border-radius: 13px;
  min-height: 62px;
  padding: 9px 11px;
  color: #22304c;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  transition: transform 0.15s;
}
.white-btn:active { transform: scale(0.98); }
.white-btn__ico {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #6f8dff;
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.white-btn__ico svg { width: 14px; height: 14px; stroke-width: 1.9; }

.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  background: #f5f6fa;
  border-radius: 14px;
  min-height: 55px;
  padding: 8px 12px 8px 10px;
  color: #202b42;
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.14s;
}
.menu-row:active { transform: scale(0.99); }
.menu-row__ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #6f8dff;
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.menu-row__ico svg { width: 16px; height: 16px; stroke-width: 1.9; }
.menu-row .chev { margin-left: auto; width: 17px; height: 17px; color: #a7b2c7; stroke-width: 2.2; }

.legal {
  margin: 28px 4px 6px;
  font-size: 11px;
  line-height: 1.55;
  color: #8592ad;
  white-space: pre-line;
}

/* ---------------- tabbar ---------------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: start;
  height: calc(68px + var(--safe-b));
  padding: 10px 6px var(--safe-b);
  background: rgba(10, 17, 31, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #aab5cc;
  font-size: 10px;
  font-weight: 500;
  padding: 0;
  transition: color 0.18s;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.75; }
.tab.is-active { color: var(--coral); }
.tab:active { color: #dfe6f6; }

.scan-fab {
  position: fixed;
  bottom: calc(23px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  width: 55px;
  height: 55px;
  border-radius: 16px;
  background: var(--coral);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 61;
  box-shadow: 0 10px 26px rgba(255, 107, 107, 0.36);
  transition: transform 0.15s, filter 0.15s;
}
.scan-fab svg { width: 25px; height: 25px; stroke-width: 2; }
.scan-fab:active { transform: translateX(-50%) scale(0.94); filter: brightness(0.95); }

/* ---------------- scan overlay ---------------- */

.scan {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 200;
  background:
    radial-gradient(75% 45% at 50% 40%, #27486c 0%, #142235 48%, #080f1c 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 22px calc(26px + var(--safe-b));
  animation: scan-in 0.25s ease both;
}
@keyframes scan-in { from { opacity: 0; } to { opacity: 1; } }

.scan__close {
  align-self: flex-start;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
}
.scan__close svg { width: 22px; height: 22px; stroke-width: 2; }
.scan__head { text-align: center; margin-top: 32px; }
.scan__head h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; }
.scan__head p { font-size: 13.5px; color: rgba(255, 255, 255, 0.72); margin-top: 10px; }

.scan__frame {
  position: relative;
  width: min(278px, 72vw);
  aspect-ratio: 1;
  margin-top: 42px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #4a7cad, #2b4d75);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.scan__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; }
.scan.has-camera video { opacity: 1; }
.scan__fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, #4a7ba9 0%, #3b6895 48%, #27496e 100%);
}
.scan.has-camera .scan__fallback { display: none; }
.scan__fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 40%, rgba(255, 255, 255, 0.12), transparent 70%);
}
.scan__line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  box-shadow: 0 0 12px rgba(160, 210, 255, 0.8);
  animation: scanline 2.4s ease-in-out infinite;
}
@keyframes scanline {
  0%, 100% { top: 12%; opacity: 0.2; }
  50% { top: 86%; opacity: 1; }
}
.corner { position: absolute; width: 34px; height: 34px; border: 3px solid #fff; }
.corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }

.scan__manual {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
}
.scan__torch {
  margin-top: 14px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: grid;
  place-items: center;
}
.scan__torch svg { width: 22px; height: 22px; stroke-width: 1.7; }
.scan__torch.is-on { background: rgba(255, 255, 255, 0.16); border-color: #fff; }

/* ---------------- sheet ---------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(3, 7, 15, 0.62);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.scrim.is-open { opacity: 1; }

.sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 104%);
  width: 100%;
  max-width: 480px;
  max-height: 84vh;
  max-height: 84dvh;
  z-index: 140;
  background: #151f35;
  border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(20px + var(--safe-b));
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.4);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet__grab {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 auto 8px;
}
.sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 14px;
  position: sticky;
  top: -8px;
  background: #151f35;
  z-index: 2;
}
.sheet__head h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.sheet__body { padding-bottom: 4px; }

.sheet-text { font-size: 13px; line-height: 1.55; color: #a8b4cc; margin: 0 0 14px; }
.sheet-text b { color: #e8edfa; }

/* ---------------- news story sheet ---------------- */

.news-story {
  position: relative;
  min-height: 154px;
  border-radius: 18px;
  padding: 15px 16px;
  margin-bottom: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #7091ff, #4c6fe8);
}
.news-story--blue {
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(255, 255, 255, 0.2), transparent 55%),
    linear-gradient(135deg, #6f8dff, #3e66e4);
}
.news-story--coral {
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(255, 255, 255, 0.2), transparent 55%),
    linear-gradient(135deg, #ff946e, #e95474);
}
.news-story--green {
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(255, 255, 255, 0.2), transparent 55%),
    linear-gradient(135deg, #51cfae, #2f88bd);
}
.news-story--violet {
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(255, 255, 255, 0.2), transparent 55%),
    linear-gradient(135deg, #a88bff, #5c6be0);
}
.news-story__tag {
  position: relative;
  z-index: 1;
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.news-story__icon {
  position: absolute;
  right: -12px;
  bottom: -22px;
  width: 132px;
  height: 132px;
  opacity: 0.22;
  transform: rotate(-9deg);
}
.news-story__icon svg { width: 100%; height: 100%; stroke-width: 1.1; }
.news-story__date {
  position: absolute;
  left: 16px;
  bottom: 15px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.82);
}
.news-title {
  font-size: 22px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.news-copy p {
  font-size: 13px;
  line-height: 1.6;
  color: #a8b4cc;
  margin-bottom: 10px;
}
.news-copy p:last-child { margin-bottom: 15px; }
.news-action { margin-top: 4px; }

/* ---------------- scanned QR result ---------------- */

.scan-result {
  background: #0e182b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.scan-result__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.scan-result__text {
  max-height: 220px;
  overflow: auto;
  color: #dfe8fb;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}
.scan-result__copy { margin-top: 9px; }

/* ---------------- crypto top-up ---------------- */

.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 2px 0 14px;
}
.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  text-align: left;
  background: #1a2540;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  transition: background 0.18s, transform 0.14s, border-color 0.18s;
}
.pay-method:active { transform: scale(0.99); }
.pay-method:disabled { opacity: 0.6; }
.pay-method.is-ready { border-color: rgba(111, 141, 255, 0.2); }
.pay-method.is-loading { opacity: 0.65; }
.pay-method__badge {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.pay-method--cryptobot .pay-method__badge {
  background: linear-gradient(145deg, #43b7ff, #2f7cf6);
  box-shadow: 0 6px 16px rgba(47, 124, 246, 0.25);
}
.pay-method--xrocket .pay-method__badge {
  background: linear-gradient(145deg, #ff9b5a, #f45a7d);
  box-shadow: 0 6px 16px rgba(244, 90, 125, 0.22);
}
.pay-method--ton .pay-method__badge {
  background: linear-gradient(145deg, #55b6f5, #2d84d9);
  box-shadow: 0 6px 16px rgba(45, 132, 217, 0.24);
}
.pay-method__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pay-method__text b { font-size: 14px; font-weight: 700; }
.pay-method__text small {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pay-method__chev { width: 18px; height: 18px; flex: none; color: #7d8aa6; stroke-width: 2; }

.topup-amount {
  padding: 18px 14px;
  margin-bottom: 14px;
  text-align: center;
  background: #0e182b;
  border-radius: 16px;
}
.topup-amount__label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topup-amount__value {
  font-size: clamp(32px, 9vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.topup-amount__value small { color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.topup-amount__usd { margin-top: 6px; color: var(--muted); font-size: 12px; }

.pay-info {
  padding: 3px 13px;
  margin-bottom: 14px;
  background: #1a2540;
  border-radius: 14px;
}
.pay-info__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
}
.pay-info__row:last-child { border-bottom: 0; }
.pay-info__row > span { flex: none; color: var(--muted); }
.pay-info__row b {
  margin-left: auto;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e7edfb;
  font-size: 12.5px;
  font-weight: 600;
}
.pay-info__copy { display: grid; place-items: center; flex: none; color: var(--blue); }
.pay-info__copy svg { width: 16px; height: 16px; }
.pay-hint { margin-top: 10px; color: #8492b0; font-size: 11.5px; line-height: 1.5; }
.pay-alt-link {
  display: block;
  margin-top: 12px;
  text-align: center;
  color: var(--blue);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.topup-check { margin-top: 9px; }
.topup-status {
  min-height: 18px;
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.topup-demo {
  padding: 13px 14px;
  margin-bottom: 14px;
  background: rgba(255, 180, 90, 0.08);
  border: 1px solid rgba(255, 180, 90, 0.18);
  border-radius: 14px;
}
.topup-demo__badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(255, 180, 90, 0.16);
  color: #ffbf7a;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topup-demo p { margin-top: 8px; color: #b4bfd4; font-size: 12px; line-height: 1.5; }

.amount-field {
  position: relative;
  display: flex;
  align-items: center;
  background: #0e182b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 15px;
}
.amount-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-right: 34px;
  appearance: textfield;
}
.amount-field input::-webkit-outer-spin-button,
.amount-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-field__cur {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(calc(-50% - 2px));
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: #8b98b3;
}
.amount-preview { font-size: 12.5px; color: var(--muted); margin: 8px 2px 14px; }
.amount-preview b { color: #dce5f7; font-weight: 600; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.pill-btn {
  height: 38px;
  border-radius: 10px;
  background: #1d2a47;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #dbe3f5;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.16s;
}
.pill-btn:hover { background: #243358; }
.pill-btn.is-picked { background: #2d4276; border-color: rgba(111, 141, 255, 0.5); }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; color: var(--muted); margin: 0 0 6px 2px; }
.field input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  background: #0e182b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  outline: 0;
  padding: 0 13px;
  color: #fff;
  font-size: 14px;
}
.field input:focus { border-color: rgba(111, 141, 255, 0.7); }
.field input::placeholder { color: #5f6c86; }

.btn-primary {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(180deg, #7693ff, #5b7cff);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: filter 0.18s, transform 0.14s;
  box-shadow: 0 10px 24px rgba(76, 108, 229, 0.25);
}
.btn-primary:hover { filter: brightness(1.04); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; }
.btn-secondary {
  width: 100%;
  height: 46px;
  border-radius: 13px;
  background: #1d2a47;
  color: #dfe6f6;
  font-size: 13.5px;
  font-weight: 600;
}
.btn-danger { background: rgba(255, 107, 107, 0.12); color: #ff9c9c; }
.note { font-size: 11px; line-height: 1.5; color: #8492b0; margin-top: 12px; }
.note--center { text-align: center; }
.form-error { color: #ff9c9c; font-size: 12px; margin: -4px 2px 10px; min-height: 0; }

.sheet-hero {
  border-radius: 14px;
  overflow: hidden;
  height: 150px;
  margin-bottom: 14px;
  background: linear-gradient(150deg, #2b3f74, #223458);
}
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f192c;
  border-radius: 13px;
  padding: 13px 14px;
  margin: 4px 0 14px;
  font-size: 13px;
  color: #aab6cd;
}
.price-row b { font-size: 17px; color: #fff; }

.referral-stat {
  background: linear-gradient(140deg, #2c4276, #1e2f52);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
}
.referral-stat__num { font-size: 30px; font-weight: 800; color: #fff; line-height: 1; }
.referral-stat__label { font-size: 12px; color: #a9b8d8; line-height: 1.3; }
.link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0e182b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 12px;
}
.link-box span { flex: 1; min-width: 0; font-size: 12px; color: #9fb0cf; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-box button { color: var(--blue); display: grid; place-items: center; flex: none; }
.link-box svg { width: 18px; height: 18px; }

.secure-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.secure-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #1a2540;
  border-radius: 13px;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #b8c4da;
}
.secure-item svg { width: 18px; height: 18px; color: #79a0ff; flex: none; margin-top: 1px; }
.secure-item b { color: #edf2fd; font-weight: 600; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: #dbe3f3;
}
.switch-row:last-child { border-bottom: 0; }
.switch {
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: #2a3754;
  position: relative;
  flex: none;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.switch.is-on { background: var(--blue); }
.switch.is-on::after { transform: translateX(18px); }

.accordion { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 2px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e9f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: #8090ad;
  transition: transform 0.2s;
}
.accordion[open] summary::after { transform: rotate(45deg); }
.accordion p { font-size: 12px; line-height: 1.6; color: #93a1bc; padding: 0 2px 14px; }

.success-box {
  text-align: center;
  padding: 18px 8px 10px;
}
.success-box__ico {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: rgba(111, 141, 255, 0.14);
  color: #8fa8ff;
  display: grid;
  place-items: center;
}
.success-box__ico svg { width: 30px; height: 30px; stroke-width: 2.2; }
.success-box h3 { font-size: 17px; font-weight: 700; }
.success-box p { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  transform: translate(-50%, 12px);
  z-index: 300;
  max-width: min(360px, calc(100vw - 40px));
  background: #f4f6fb;
  color: #172137;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  padding: 10px 15px;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- desktop niceties ---------------- */

@media (hover: hover) {
  .tab:hover { color: #dfe6f6; }
  .tab.is-active:hover { color: var(--coral); }
  .chip:hover:not(.is-active) { background: #fff; }
  .menu-row:hover { background: #fff; }
}
