/* ==========================================================================
   TGRShark Wallet — UI-кит
   Глубокий синий, тонкие поверхности, акцент на цифрах и действиях.
   ========================================================================== */
:root {
  --bg: #040d1f;
  --bg-2: #061226;
  --surface: #08182f;
  --surface-2: #0b213c;
  --line: rgba(126, 183, 255, .13);
  --line-2: rgba(126, 183, 255, .26);
  --accent: #3ddcff;
  --accent-2: #2f6bff;
  --ok: #33d68a;
  --warn: #ffc53d;
  --danger: #ff5f72;
  --text: #e9f2ff;
  --muted: #8ba6c9;
  --muted-2: #6c88ab;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --shadow-sm: 0 2px 10px rgba(2, 8, 22, .5);
  --shadow: 0 22px 44px -24px rgba(2, 8, 22, .95);
  --ring: 0 0 0 3px rgba(61, 220, 255, .22);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Montserrat", var(--font);
  --tabbar-h: 84px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(880px 520px at 80% -10%, rgba(47, 107, 255, .30), transparent 62%),
    radial-gradient(720px 460px at 6% 2%, rgba(61, 220, 255, .13), transparent 58%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 46%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .45;
  background-image:
    linear-gradient(rgba(126, 183, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 183, 255, .04) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(1100px 600px at 50% -8%, #000 0%, transparent 74%);
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #a7ecff; }

h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.06rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: min(1080px, 100% - 2.6rem); margin-inline: auto; }
.nums, td.num, .amount { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.dim { color: var(--muted-2); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.star { color: var(--warn); }

/* ---------------------------- топбар ------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(160%) blur(14px);
  background: rgba(5, 15, 33, .84);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.topbar__right { display: flex; align-items: center; gap: .6rem; }

.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); }
.brand img { width: 26px; height: 26px; }
.brand__name { font-family: var(--display); font-weight: 800; font-size: .99rem; display: block; }
.brand__name em { font-style: normal; color: var(--accent); }
.brand__tag { display: block; margin-top: -3px; font-size: .58rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted-2); }

.balance-pill {
  display: inline-flex; align-items: baseline; gap: .4rem; padding: .38rem .8rem;
  border-radius: 999px; border: 1px solid var(--line-2); background: rgba(61, 220, 255, .08);
  color: var(--text); font-size: .86rem;
}
.balance-pill b { font-weight: 700; font-variant-numeric: tabular-nums; }
.balance-pill span { font-size: .68rem; letter-spacing: .08em; color: var(--muted-2); }
.balance-pill:hover { background: rgba(61, 220, 255, .16); color: #fff; }

.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; padding: .18rem; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(126, 183, 255, .07);
  display: inline-flex;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: rgba(126, 183, 255, .14); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: .82rem; color: #04202f;
  background: linear-gradient(140deg, #9df0ff, var(--accent));
}
.menu__list {
  position: absolute; right: 0; top: calc(100% + .5rem); min-width: 200px; padding: .35rem;
  background: #0a1b33; border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow); display: grid; gap: .1rem;
}
.menu__list a, .menu__list button {
  display: flex; align-items: center; width: 100%; text-align: left; padding: .55rem .7rem;
  border-radius: var(--r-sm); background: none; border: 0; color: var(--text);
  font: inherit; font-size: .88rem; cursor: pointer;
}
.menu__list a:hover, .menu__list button:hover { background: rgba(126, 183, 255, .1); }
.menu__list .danger { color: #ffb3c0; }
.menu__sep { height: 1px; background: var(--line); margin: .3rem .2rem; }

/* ---------------------------- кнопки ------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.1rem; border-radius: 11px; border: 1px solid transparent;
  font-family: var(--font); font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.btn--primary {
  color: #04182b;
  background: linear-gradient(135deg, #8ceaff 0%, var(--accent) 52%, #63a4ff 100%);
  box-shadow: 0 10px 24px -12px rgba(61, 220, 255, .8);
}
.btn--primary:hover { color: #04182b; transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(61, 220, 255, .95); }
.btn--secondary { color: var(--text); background: rgba(126, 183, 255, .09); border-color: var(--line-2); }
.btn--secondary:hover { color: #fff; background: rgba(126, 183, 255, .16); }
.btn--ghost { color: var(--muted); }
.btn--ghost:hover { color: var(--text); background: rgba(126, 183, 255, .08); }
.btn--block { width: 100%; }
.btn--lg { padding: .82rem 1.4rem; font-size: .95rem; }
.btn--sm { padding: .42rem .8rem; font-size: .83rem; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------------------------- разметка ---------------------------------- */
.page { padding: 1.6rem 0 2.5rem; }
.page--app { padding-bottom: calc(var(--tabbar-h) + 1.2rem); }
.section { margin-top: 1.6rem; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section__head h2 { font-size: 1rem; }

.sheet { display: grid; gap: 1.3rem; }
.sheet__head { display: grid; gap: .3rem; }
.sheet__head p { color: var(--muted); font-size: .9rem; max-width: 62ch; }
.sheet__foot { color: var(--muted-2); font-size: .84rem; }

.card {
  background: linear-gradient(180deg, rgba(19, 44, 80, .5), rgba(8, 24, 47, .72));
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}

.flash-stack { display: grid; gap: .5rem; margin-top: .9rem; }
.flash { padding: .75rem 1rem; border-radius: var(--r); font-size: .88rem; border: 1px solid var(--line-2); background: var(--surface-2); }
.flash--success { border-color: rgba(51, 214, 138, .38); background: rgba(51, 214, 138, .1); }
.flash--error { border-color: rgba(255, 95, 114, .38); background: rgba(255, 95, 114, .1); }
.flash--info { border-color: var(--line-2); background: rgba(61, 220, 255, .08); }
.status-line { padding: .75rem 1rem; border-radius: var(--r); font-size: .88rem; border: 1px solid var(--line-2); background: var(--surface-2); }
.status-line--error { border-color: rgba(255, 95, 114, .38); background: rgba(255, 95, 114, .1); }
.status-line--ok { border-color: rgba(51, 214, 138, .38); background: rgba(51, 214, 138, .1); }

/* ---------------------------- карта кошелька ---------------------------- */
.wallet-home { display: grid; gap: 1.1rem; }

.bankcard {
  position: relative; overflow: hidden; padding: 1.5rem 1.6rem 1.4rem;
  border-radius: var(--r-xl); border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -30px rgba(2, 10, 28, .95);
  background:
    radial-gradient(560px 260px at 88% -26%, rgba(61, 220, 255, .30), transparent 62%),
    radial-gradient(420px 240px at 8% 118%, rgba(47, 107, 255, .38), transparent 60%),
    linear-gradient(152deg, #10305f 0%, #0a1f42 52%, #071831 100%);
  display: grid; gap: 1.5rem;
}
.bankcard__sheen {
  position: absolute; inset: -40% -10% auto; height: 120%;
  background: linear-gradient(112deg, transparent 42%, rgba(255, 255, 255, .10) 50%, transparent 58%);
  transform: translateX(-18%);
  animation: sheen 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%, 100% { transform: translateX(-18%); }
  50% { transform: translateX(16%); }
}
@media (prefers-reduced-motion: reduce) { .bankcard__sheen { animation: none; } }

.bankcard__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bankcard__brand { font-family: var(--display); font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; }
.bankcard__brand em { font-style: normal; color: #9fecff; }
.bankcard__currency {
  font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: #a9cdeb;
  padding: .22rem .6rem; border-radius: 999px; border: 1px solid rgba(169, 205, 235, .3);
}
.bankcard__balance { display: grid; gap: .1rem; }
.bankcard__label { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: #a9cdeb; }
.bankcard__value { display: flex; align-items: baseline; gap: .5rem; }
.bankcard__value b {
  font-family: var(--display); font-weight: 800; letter-spacing: -.02em;
  font-size: clamp(2.1rem, 6vw, 3rem); color: #fff; font-variant-numeric: tabular-nums;
  text-shadow: 0 10px 30px rgba(3, 20, 45, .6);
}
.bankcard__value i { font-style: normal; font-size: .8rem; letter-spacing: .18em; font-weight: 700; color: #8fe6ff; }
.bankcard__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bankcard__number { display: grid; gap: .2rem; }
.bankcard__number-label { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #9dbde1; }
.bankcard__number-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.bankcard__number-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.06rem; font-weight: 600;
  letter-spacing: .1em; color: #eaf7ff; font-variant-numeric: tabular-nums;
}
.copy-btn {
  padding: .28rem .6rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: .72rem;
  color: #cfeaff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(207, 234, 255, .22);
  transition: background .15s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, .16); }
.copy-btn.is-done { color: #04202f; background: #9df0ff; border-color: #9df0ff; }
.bankcard__holder { font-family: var(--display); font-size: .84rem; font-weight: 600; color: #c9e3ff; letter-spacing: .02em; }

.wallet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.action {
  display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.2rem;
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 44, 80, .5), rgba(8, 24, 47, .72));
  color: var(--text); transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.action:hover { transform: translateY(-2px); border-color: var(--line-2); color: #fff; }
.action--accent { border-color: rgba(61, 220, 255, .42); background: linear-gradient(150deg, rgba(61, 220, 255, .16), rgba(8, 24, 47, .8)); }
.action__icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  color: var(--accent); background: rgba(61, 220, 255, .1); border: 1px solid var(--line-2);
}
.action__icon svg { width: 21px; height: 21px; }
.action__text { display: grid; }
.action__text b { font-family: var(--display); font-size: .98rem; font-weight: 700; }
.action__text small { color: var(--muted-2); font-size: .78rem; }

/* ---------------------------- нижняя навигация -------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center; padding: .6rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  pointer-events: none;
}
.tabbar__pill {
  position: relative;
  pointer-events: auto;
  display: flex; align-items: stretch; gap: .15rem;
  padding: .4rem; border-radius: 999px;
  background: rgba(7, 20, 42, .86);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -18px rgba(2, 8, 22, .95), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(16px) saturate(160%);
  animation: tabbarIn .55s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes tabbarIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* скользящий индикатор активной вкладки */
.tabpill {
  position: absolute; left: 0; top: .4rem; bottom: .4rem; width: 0;
  border-radius: 999px; opacity: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(150deg, rgba(61, 220, 255, .24), rgba(47, 107, 255, .18));
  box-shadow: inset 0 0 0 1px rgba(61, 220, 255, .38), 0 10px 22px -14px rgba(61, 220, 255, .8);
}
.tabpill.is-ready {
  transition: transform .38s cubic-bezier(.34, 1.16, .5, 1), width .38s cubic-bezier(.34, 1.16, .5, 1),
              opacity .2s ease;
}
.tab {
  position: relative; z-index: 1;
  display: grid; place-items: center; gap: .16rem; min-width: 88px; padding: .5rem .85rem;
  border-radius: 999px; color: var(--muted-2); font-size: .7rem; font-weight: 600;
  transition: color .2s ease, transform .2s ease;
}
.tab svg { width: 20px; height: 20px; transition: transform .28s cubic-bezier(.34, 1.3, .5, 1); }
.tab:hover { color: var(--text); }
.tab:hover svg { transform: translateY(-1px) scale(1.06); }
.tab.is-active { color: #e6faff; }
.tab.is-active svg { transform: translateY(-1px) scale(1.08); }

/* ---------------------------- переходы между страницами ----------------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: pageFadeOut .18s ease both; }
::view-transition-new(root) { animation: pageFadeIn .26s ease both; }
@keyframes pageFadeOut { to { opacity: 0; } }
@keyframes pageFadeIn { from { opacity: 0; } }

/* вход в приложение показываем один раз за сессию */
body.no-intro .tabbar__pill { animation: none; }

@media (prefers-reduced-motion: no-preference) {
  .page > *, .sheet > * {
    animation: contentRise .46s cubic-bezier(.22, .61, .36, 1) both;
  }
  .page > *:nth-child(2), .sheet > *:nth-child(2) { animation-delay: .05s; }
  .page > *:nth-child(3), .sheet > *:nth-child(3) { animation-delay: .1s; }
  .page > *:nth-child(4), .sheet > *:nth-child(4) { animation-delay: .14s; }

  .bankcard { animation: cardRise .6s cubic-bezier(.22, .61, .36, 1) both; }
  .flash-stack .flash { animation: contentRise .34s ease both; }
}
@keyframes contentRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(20px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* уход со страницы по клику в нижней навигации */
body.is-leaving .page,
body.is-leaving .sheet > * {
  transition: opacity .16s ease, transform .16s ease;
  opacity: 0;
  transform: translateY(-6px) scale(.995);
}
body.is-leaving .footer { opacity: .4; transition: opacity .16s ease; }

/* ---------------------------- формы ------------------------------------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field > label { font-size: .83rem; font-weight: 600; color: #cfe0f7; }
.field input {
  width: 100%; padding: .74rem .88rem; border-radius: var(--r-sm);
  color: var(--text); background: rgba(3, 11, 25, .72);
  border: 1px solid var(--line-2); font: inherit; font-size: .93rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field input::placeholder { color: #55708f; }
.field input:hover { border-color: rgba(126, 183, 255, .38); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: rgba(3, 11, 25, .95); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 3.4rem; }
.input-wrap .eye {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--muted); cursor: pointer; padding: .4rem .5rem;
  border-radius: 8px; font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .06em; line-height: 1;
}
.input-wrap .eye:hover { color: var(--text); background: rgba(126, 183, 255, .1); }
.hint { color: var(--muted-2); font-size: .78rem; }
.hint b { color: var(--muted); }
.input-status { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); font-size: .8rem; }
.input-status.is-ok { color: var(--ok); }
.input-status.is-bad { color: var(--danger); }
.input-status.is-checking { color: var(--warn); }

.meter { display: flex; align-items: center; gap: .55rem; }
.meter__track { flex: 1; height: 4px; border-radius: 999px; background: rgba(126, 183, 255, .16); overflow: hidden; }
.meter__track i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .3s ease, background .3s ease; }
.meter__text { font-size: .74rem; color: var(--muted-2); min-width: 74px; text-align: right; }
.meter[data-score="1"] i { width: 25%; background: linear-gradient(90deg, #ff6b7d, #ff9f5a); }
.meter[data-score="2"] i { width: 50%; background: linear-gradient(90deg, #ffb454, var(--warn)); }
.meter[data-score="3"] i { width: 75%; background: linear-gradient(90deg, #5cd0ff, #4ad9c0); }
.meter[data-score="4"] i { width: 100%; background: linear-gradient(90deg, #46d8c0, var(--ok)); }

.rules { display: grid; gap: .2rem; font-size: .76rem; color: var(--muted-2); }
.rules li { display: flex; align-items: center; gap: .45rem; }
.rules li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; flex: 0 0 auto; }
.rules li.is-ok { color: #62d9a6; }
.rules li.is-bad { color: #ff9dab; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.checkbox input { margin: .15rem 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.field .error { color: #ff9dab; font-size: .78rem; }

/* ---------------------------- панель-аккордеон -------------------------- */
.panel {
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 44, 80, .5), rgba(8, 24, 47, .72));
  overflow: hidden;
}
.panel__row {
  display: flex; align-items: center; gap: .9rem; padding: 1.05rem 1.2rem; cursor: pointer;
  list-style: none;
}
.panel__row::-webkit-details-marker { display: none; }
.panel__row:hover { background: rgba(126, 183, 255, .05); }
.panel__icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--accent); background: rgba(61, 220, 255, .1); border: 1px solid var(--line-2);
}
.panel__icon svg { width: 20px; height: 20px; }
.panel__text { display: grid; flex: 1; }
.panel__text b { font-family: var(--display); font-size: .96rem; }
.panel__text small { color: var(--muted-2); font-size: .78rem; }
.panel__chev { color: var(--muted-2); display: grid; }
.panel__chev svg { width: 18px; height: 18px; transition: transform .2s ease; }
.panel[open] .panel__chev svg { transform: rotate(90deg); }
.panel__body { padding: 0 1.2rem 1.3rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }

/* ---------------------------- сессии ------------------------------------ */
.sessions { display: grid; gap: .55rem; }
.sessions__item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.1rem; border-radius: var(--r); border: 1px solid var(--line);
  background: rgba(8, 24, 47, .6);
}
.sessions__item b { display: block; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.sessions__item small { color: var(--muted-2); font-size: .76rem; }

/* ---------------------------- пакеты ------------------------------------ */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: .9rem; }
.pack {
  position: relative; display: flex; flex-direction: column; gap: .85rem;
  padding: 1.15rem; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 44, 80, .5), rgba(8, 24, 47, .78));
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.pack:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 22px 40px -24px rgba(4, 20, 45, .95); }
.pack--featured { border-color: rgba(61, 220, 255, .42); background: linear-gradient(180deg, rgba(61, 220, 255, .14), rgba(8, 24, 47, .85)); }
.pack__ribbon {
  position: absolute; top: .85rem; right: .85rem; font-size: .62rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: #04212f; padding: .16rem .5rem; border-radius: 999px;
  background: linear-gradient(120deg, #a9f2ff, var(--accent));
}
.pack__name { font-family: var(--display); font-size: 1rem; font-weight: 700; }
.pack__amount { display: flex; align-items: center; gap: .45rem; margin-top: .3rem; }
.pack__amount img { width: 22px; height: 22px; }
.pack__amount b { font-family: var(--display); font-size: 1.34rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pack__amount span { font-size: .7rem; letter-spacing: .12em; color: var(--muted-2); }
.pack__rows { display: grid; gap: .4rem; font-size: .84rem; }
.pack__rows div { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; color: var(--muted); }
.pack__rows b { color: var(--text); font-weight: 600; }
.pack__note { font-size: .74rem; color: var(--ok); }
.pack .btn { margin-top: auto; }

/* ---------------------------- таблицы ----------------------------------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: rgba(6, 18, 38, .6); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .78rem 1rem; text-align: left; font-size: .87rem; }
thead th {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2);
  font-weight: 600; background: rgba(9, 26, 51, .92); border-bottom: 1px solid var(--line);
}
tbody tr { border-bottom: 1px solid rgba(126, 183, 255, .07); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: rgba(126, 183, 255, .04); }
td.amount { font-weight: 600; }
.plus { color: var(--ok); }
.minus { color: #ff8fa0; }

.badge { display: inline-flex; align-items: center; padding: .18rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; border: 1px solid var(--line-2); color: var(--muted); }
.badge--done, .badge--ok { color: #7ee2b0; border-color: rgba(51, 214, 138, .35); background: rgba(51, 214, 138, .1); }
.badge--pending { color: #ffd479; border-color: rgba(255, 197, 61, .35); background: rgba(255, 197, 61, .1); }
.badge--failed, .badge--canceled { color: #ff9dab; border-color: rgba(255, 95, 114, .35); background: rgba(255, 95, 114, .1); }
.badge--cyan, .badge--blue, .badge--teal { color: #9fe6ff; border-color: var(--line-2); background: rgba(61, 220, 255, .08); }
.badge--gold { color: #ffd479; border-color: rgba(255, 197, 61, .3); background: rgba(255, 197, 61, .1); }

.empty { display: grid; justify-items: center; gap: .4rem; text-align: center; padding: 2.3rem 1.4rem; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: rgba(6, 18, 38, .5); }
.empty h3 { font-size: .96rem; }
.empty p { color: var(--muted); font-size: .86rem; }

/* ---------------------------- вход / регистрация ------------------------ */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2.6rem 1.1rem; }
.auth-box { width: 100%; max-width: 412px; display: grid; gap: 1rem; }
.auth-card { padding: 1.5rem; display: grid; gap: 1.1rem; }
.auth-card h1 { font-size: 1.18rem; }
.auth-card .sub { color: var(--muted); font-size: .87rem; margin-top: .25rem; }
.auth-lockup { display: inline-flex; align-items: center; gap: .5rem; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.auth-lockup::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(61, 220, 255, .12); }
.auth-foot { text-align: center; color: var(--muted); font-size: .86rem; }
.auth-foot a { font-weight: 600; }
.legal { text-align: center; color: var(--muted-2); font-size: .72rem; line-height: 1.5; }
.legal a { color: var(--muted); }

/* ---------------------------- ошибки ------------------------------------ */
.error-page { display: grid; justify-items: center; gap: .5rem; text-align: center; padding: 3.4rem 0; }
.error-page__code { font-family: var(--display); font-size: 2.6rem; font-weight: 800; color: var(--accent); }
.error-page p { color: var(--muted); max-width: 44ch; }
.error-page__actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-top: .8rem; }

/* ---------------------------- футер ------------------------------------- */
.footer { padding: 1.4rem 0 1.6rem; }
.is-app .footer { padding-bottom: calc(var(--tabbar-h) + .6rem); }
.footer__note { color: var(--muted-2); font-size: .74rem; text-align: center; }

/* ---------------------------- адаптив ---------------------------------- */
@media (max-width: 720px) {
  .container { width: min(1080px, 100% - 1.8rem); }
  .wallet-actions { grid-template-columns: 1fr; }
  .bankcard { padding: 1.25rem 1.2rem 1.15rem; border-radius: var(--r-lg); }
  .bankcard__number-row code { font-size: .96rem; letter-spacing: .06em; }
  .tab { min-width: 0; padding: .5rem .62rem; }
  .tab span { font-size: .62rem; }
  .tab svg { width: 19px; height: 19px; }
  .tabbar__pill { width: 100%; justify-content: space-between; }
  .sessions__item b { max-width: 30ch; }
}

/* ---------------------------- код из письма ----------------------------- */
.auth-card--code { gap: 1.3rem; }
.auth-card--code h1 { font-size: 1.3rem; }
.auth-card--code .sub { max-width: 33ch; }

.code { display: flex; align-items: center; justify-content: center; gap: .42rem; }
.code__cell {
  width: 50px; height: 62px; text-align: center;
  font-family: var(--display); font-size: 1.5rem; font-weight: 700;
  color: var(--text); caret-color: transparent;
  background: linear-gradient(180deg, rgba(11, 33, 60, .9), rgba(5, 15, 33, .92));
  border: 1px solid var(--line-2); border-radius: var(--r);
  transition: border-color .16s ease, box-shadow .16s ease, background .18s ease,
              color .18s ease, transform .16s ease;
}
.code__cell:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
  transform: translateY(-2px);
}
.code__cell.is-filled {
  color: #c2f4ff; border-color: rgba(61, 220, 255, .45);
  background: linear-gradient(180deg, rgba(22, 62, 102, .92), rgba(8, 26, 52, .95));
}
.code__cell.is-pop { animation: cellPop .3s cubic-bezier(.22, .61, .36, 1); }
@keyframes cellPop {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-3px) scale(1.07); }
  100% { transform: none; }
}
.code__sep { flex: 0 0 auto; width: 13px; height: 2px; border-radius: 2px; background: var(--line-2); }
.code-note { text-align: center; color: var(--muted-2); font-size: .78rem; margin-top: -.2rem; }
.code-note b { color: var(--muted); }

.resend { display: flex; align-items: center; justify-content: center; gap: .45rem; font-size: .84rem; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--accent);
}
.link-btn:hover { color: #a7ecff; }
.link-btn:disabled { color: var(--muted-2); cursor: default; font-weight: 500; }

/* ------------------- зачисление монет на баланс ------------------------- */
.coin-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.coin-fly {
  position: fixed; width: 26px; height: 26px; will-change: transform, opacity;
  filter: drop-shadow(0 8px 16px rgba(61, 220, 255, .45));
}
.balance-pill b.is-credited, .bankcard__value b.is-credited { animation: creditPulse 1.4s cubic-bezier(.22, .61, .36, 1); }
@keyframes creditPulse {
  0% { transform: scale(1); }
  20% { transform: scale(1.16); color: #a9ffd8; text-shadow: 0 0 16px rgba(51, 214, 138, .75); }
  100% { transform: scale(1); }
}

.credit-banner[hidden] { display: none; }
.credit-banner {
  display: flex; align-items: center; gap: .85rem; padding: .95rem 1.1rem;
  border-radius: var(--r-lg); border: 1px solid rgba(51, 214, 138, .4);
  background: linear-gradient(120deg, rgba(51, 214, 138, .16), rgba(8, 24, 47, .86));
  opacity: 0;
}
.credit-banner.is-visible { animation: bannerIn .45s cubic-bezier(.22, .61, .36, 1) forwards; }
@keyframes bannerIn { to { opacity: 1; transform: none; } }
.credit-banner img { animation: coinFlip 2.6s linear infinite; transform-style: preserve-3d; }
@keyframes coinFlip { 0%, 100% { transform: rotateY(0deg); } 50% { transform: rotateY(180deg); } }
.credit-banner__text { display: grid; }
.credit-banner__text b {
  font-family: var(--display); font-size: 1.2rem; color: #a9ffd8;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.credit-banner__text span { color: var(--muted); font-size: .82rem; }

/* ------------------- статичная панель (без раскрытия) ------------------- */
.panel--static .panel__row { cursor: default; }
.panel--static .panel__row:hover { background: none; }

@media (prefers-reduced-motion: reduce) {
  .coin-fly, .credit-banner img, .credit-banner.is-visible { animation: none; opacity: 1; }
}

@media (max-width: 380px) {
  .code { gap: .3rem; }
  .code__cell { width: 43px; height: 54px; font-size: 1.3rem; border-radius: var(--r-sm); }
  .code__sep { width: 9px; }
}

/* ============================ May — ассистент ============================ */
.may-fab {
  position: fixed; right: 1rem; bottom: 1.1rem; z-index: 55;
  width: 62px; height: 62px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(61, 220, 255, .42);
  background: linear-gradient(160deg, #0e2a52, #061831);
  box-shadow: 0 20px 38px -18px rgba(2, 8, 22, .95);
  animation: mayFloat 5.5s ease-in-out infinite;
  transition: box-shadow .2s ease, border-color .2s ease, filter .2s ease;
}
.is-app .may-fab { bottom: calc(var(--tabbar-h) + .7rem); }
.may-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.may-fab__pulse {
  position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid rgba(61, 220, 255, .55); animation: mayPulse 3.4s ease-out infinite;
}
.may-fab:hover { border-color: var(--accent); filter: brightness(1.1); box-shadow: 0 24px 44px -18px rgba(61, 220, 255, .5); }
.may-fab:focus-visible { outline: none; box-shadow: var(--ring); }
@keyframes mayFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes mayPulse {
  0% { transform: scale(.92); opacity: .8; }
  70% { transform: scale(1.22); opacity: 0; }
  100% { opacity: 0; }
}

.may { position: fixed; inset: 0; z-index: 70; }
.may[hidden] { display: none; }
.may__backdrop {
  position: absolute; inset: 0; background: rgba(2, 8, 22, .6);
  backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s ease;
}
.may.is-open .may__backdrop { opacity: 1; }
.may__panel {
  position: absolute; right: 1rem; bottom: 1rem;
  width: min(430px, calc(100vw - 2rem)); height: min(620px, calc(100vh - 2rem));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: linear-gradient(180deg, rgba(11, 33, 60, .97), rgba(5, 15, 33, .99));
  border: 1px solid var(--line-2); border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: transform .26s cubic-bezier(.22, .61, .36, 1), opacity .2s ease;
}
.may.is-open .may__panel { opacity: 1; transform: none; }
body.may-open { overflow: hidden; }

.may__head {
  display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem;
  border-bottom: 1px solid var(--line); background: rgba(9, 26, 48, .6);
}
.may__avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  border: 1px solid rgba(61, 220, 255, .35);
}
.may__avatar img { width: 100%; height: 100%; object-fit: cover; }
.may__who { display: grid; flex: 1; min-width: 0; }
.may__who b { font-family: var(--display); font-size: .98rem; }
.may__who small { color: var(--muted-2); font-size: .74rem; display: flex; align-items: center; gap: .35rem; }
.may__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(51, 214, 138, .18); }
.may__close {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(126, 183, 255, .07); border: 1px solid var(--line); color: var(--muted);
  cursor: pointer;
}
.may__close svg { width: 16px; height: 16px; }
.may__close:hover { color: var(--text); border-color: var(--line-2); }

.may__log {
  overflow-y: auto; padding: 1rem .9rem; display: flex; flex-direction: column; gap: .6rem;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.may__msg { display: flex; }
.may__msg--me { justify-content: flex-end; }
.may__bubble {
  max-width: 84%; padding: .6rem .8rem; border-radius: 16px; font-size: .89rem; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--line);
}
.may__msg--may .may__bubble {
  border-bottom-left-radius: 6px;
  background: linear-gradient(150deg, rgba(20, 58, 96, .85), rgba(8, 26, 52, .9));
}
.may__msg--me .may__bubble {
  border-bottom-right-radius: 6px;
  background: linear-gradient(150deg, rgba(47, 107, 255, .32), rgba(20, 58, 96, .5));
  border-color: rgba(61, 220, 255, .28);
}
.may__bubble--typing { display: inline-flex; gap: .3rem; align-items: center; padding: .75rem .85rem; }
.may__bubble--typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .35;
  animation: mayDots 1.1s ease-in-out infinite;
}
.may__bubble--typing span:nth-child(2) { animation-delay: .18s; }
.may__bubble--typing span:nth-child(3) { animation-delay: .36s; }
@keyframes mayDots { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.may__note { color: var(--muted-2); font-size: .76rem; text-align: center; }
.may__note--ok { color: #7ee2b0; }

.may__card {
  border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: .8rem .85rem;
  background: linear-gradient(150deg, rgba(22, 62, 102, .55), rgba(8, 24, 47, .8));
  display: grid; gap: .6rem;
}
.may__card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.may__card-head b { font-family: var(--display); font-size: .92rem; }
.may__card-head span { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.may__card-note { color: var(--muted-2); font-size: .78rem; }
.may__card-error { color: #ff9dab; font-size: .79rem; }
.may__card-actions { display: flex; gap: .5rem; }

.may__quick { display: flex; gap: .4rem; padding: 0 .9rem .55rem; flex-wrap: wrap; }
.may__quick[hidden] { display: none; }
.may__quick button {
  padding: .34rem .7rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(61, 220, 255, .07); color: var(--text);
  font: inherit; font-size: .78rem;
}
.may__quick button:hover { background: rgba(61, 220, 255, .15); border-color: var(--accent); }

.may__form {
  display: flex; align-items: flex-end; gap: .5rem; padding: .7rem .9rem .85rem;
  border-top: 1px solid var(--line); background: rgba(9, 26, 48, .55);
}
.may__input {
  flex: 1; resize: none; max-height: 120px; padding: .6rem .8rem;
  border-radius: 14px; border: 1px solid var(--line-2); background: rgba(3, 11, 25, .8);
  color: var(--text); font: inherit; font-size: .89rem; line-height: 1.4;
}
.may__input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.may__send {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; cursor: pointer;
  display: grid; place-items: center; border: 1px solid rgba(61, 220, 255, .4);
  background: linear-gradient(150deg, rgba(61, 220, 255, .22), rgba(47, 107, 255, .22));
  color: #d9f4ff;
}
.may__send svg { width: 19px; height: 19px; }
.may__send:disabled { opacity: .45; cursor: default; }
.may__send:not(:disabled):hover { border-color: var(--accent); filter: brightness(1.12); }

@media (prefers-reduced-motion: reduce) {
  .may-fab, .may-fab__pulse, .may__bubble--typing span { animation: none; }
}

/* --------------- защита от ручного копирования и скачивания -------------- */
body { user-select: none; -webkit-user-select: none; overflow-x: clip; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
img {
  -webkit-user-drag: none; user-drag: none;
  -webkit-touch-callout: none; pointer-events: none;
}

/* ------------------------- адаптив: телефоны/планшеты ------------------- */
@media (max-width: 560px) {
  .may__panel { inset: .5rem; width: auto; height: auto; border-radius: var(--r-lg); }
  .may__bubble { max-width: 90%; font-size: .87rem; }
  .may-fab { width: 56px; height: 56px; right: .8rem; }
  .is-app .may-fab { bottom: calc(var(--tabbar-h) + .5rem); }
  .may__log { padding: .8rem .75rem; }
}

@media (max-width: 380px) {
  .may__quick { flex-wrap: nowrap; overflow-x: auto; }
  .may__quick button { white-space: nowrap; }
  .may__card-actions { flex-direction: column; }
  .tab span { font-size: .58rem; }
}

@media (min-width: 561px) and (max-width: 900px) {
  .may__panel { width: min(400px, calc(100vw - 2rem)); }
}

@media (max-height: 520px) {
  .may__panel { height: calc(100vh - 1rem); bottom: .5rem; }
}
